kicadts 0.0.34 → 0.0.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/index.d.ts +380 -16
  2. package/dist/index.js +1026 -71
  3. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -11749,38 +11749,996 @@ var FootprintUnits = class _FootprintUnits extends SxClass {
11749
11749
  };
11750
11750
  SxClass.register(FootprintUnits);
11751
11751
 
11752
+ // lib/sexpr/classes/Layers.ts
11753
+ var Layers = class _Layers extends SxClass {
11754
+ static token = "layers";
11755
+ token = "layers";
11756
+ _names = [];
11757
+ constructor(names = []) {
11758
+ super();
11759
+ this.names = names;
11760
+ }
11761
+ static fromSexprPrimitives(primitiveSexprs) {
11762
+ const names = primitiveSexprs.map(
11763
+ (primitive) => typeof primitive === "string" || typeof primitive === "number" ? String(primitive) : printSExpr(primitive)
11764
+ );
11765
+ return new _Layers(names);
11766
+ }
11767
+ get names() {
11768
+ return [...this._names];
11769
+ }
11770
+ set names(values) {
11771
+ this._names = values.map((value) => String(value));
11772
+ }
11773
+ getString() {
11774
+ const rendered = this._names.map((name) => {
11775
+ if (/^[^\s()"]+$/u.test(name) && !["nil", "#t", "#f"].includes(name)) {
11776
+ return name;
11777
+ }
11778
+ return quoteSExprString(name);
11779
+ }).join(" ");
11780
+ return `(layers ${rendered})`;
11781
+ }
11782
+ };
11783
+ SxClass.register(Layers);
11784
+
11785
+ // lib/sexpr/classes/ZoneAttrTeardropType.ts
11786
+ var ZoneAttrTeardropType = class extends SxPrimitiveString {
11787
+ static token = "type";
11788
+ static parentToken = "teardrop";
11789
+ token = "type";
11790
+ };
11791
+ SxClass.register(ZoneAttrTeardropType);
11792
+
11793
+ // lib/sexpr/classes/ZoneAttrTeardrop.ts
11794
+ var ZoneAttrTeardrop = class _ZoneAttrTeardrop extends SxClass {
11795
+ static token = "teardrop";
11796
+ static parentToken = "attr";
11797
+ token = "teardrop";
11798
+ _sxType;
11799
+ constructor(type) {
11800
+ super();
11801
+ this.type = type;
11802
+ }
11803
+ static fromSexprPrimitives(primitiveSexprs) {
11804
+ const teardrop = new _ZoneAttrTeardrop();
11805
+ const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(primitiveSexprs, this.token);
11806
+ for (const [token, entries] of Object.entries(arrayPropertyMap)) {
11807
+ if (token !== "type") {
11808
+ throw new Error(
11809
+ `zone attr teardrop encountered unsupported child "${token}"`
11810
+ );
11811
+ }
11812
+ if (entries.length > 1) {
11813
+ throw new Error("zone attr teardrop does not support repeated type");
11814
+ }
11815
+ }
11816
+ teardrop._sxType = propertyMap.type;
11817
+ return teardrop;
11818
+ }
11819
+ get type() {
11820
+ return this._sxType?.value;
11821
+ }
11822
+ set type(value) {
11823
+ this._sxType = value === void 0 ? void 0 : value instanceof ZoneAttrTeardropType ? value : new ZoneAttrTeardropType(value);
11824
+ }
11825
+ getChildren() {
11826
+ return this._sxType ? [this._sxType] : [];
11827
+ }
11828
+ };
11829
+ SxClass.register(ZoneAttrTeardrop);
11830
+
11831
+ // lib/sexpr/classes/ZoneAttr.ts
11832
+ var ZoneAttr = class _ZoneAttr extends SxClass {
11833
+ static token = "attr";
11834
+ static parentToken = "zone";
11835
+ token = "attr";
11836
+ _sxTeardrop;
11837
+ constructor(params = {}) {
11838
+ super();
11839
+ if (params.teardrop !== void 0) this.teardrop = params.teardrop;
11840
+ }
11841
+ static fromSexprPrimitives(primitiveSexprs) {
11842
+ const attr = new _ZoneAttr();
11843
+ const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(primitiveSexprs, this.token);
11844
+ for (const [token, entries] of Object.entries(arrayPropertyMap)) {
11845
+ if (token !== "teardrop") {
11846
+ throw new Error(`zone attr encountered unsupported child "${token}"`);
11847
+ }
11848
+ if (entries.length > 1) {
11849
+ throw new Error("zone attr does not support repeated teardrop children");
11850
+ }
11851
+ }
11852
+ attr._sxTeardrop = propertyMap.teardrop;
11853
+ return attr;
11854
+ }
11855
+ get teardrop() {
11856
+ return this._sxTeardrop;
11857
+ }
11858
+ set teardrop(value) {
11859
+ this._sxTeardrop = value;
11860
+ }
11861
+ getChildren() {
11862
+ return this._sxTeardrop ? [this._sxTeardrop] : [];
11863
+ }
11864
+ };
11865
+ SxClass.register(ZoneAttr);
11866
+
11867
+ // lib/sexpr/classes/ZoneConnectPadsClearance.ts
11868
+ var ZoneConnectPadsClearance = class extends SxPrimitiveNumber {
11869
+ static token = "clearance";
11870
+ static parentToken = "connect_pads";
11871
+ token = "clearance";
11872
+ };
11873
+ SxClass.register(ZoneConnectPadsClearance);
11874
+
11875
+ // lib/sexpr/classes/ZoneConnectPads.ts
11876
+ var ZoneConnectPads = class _ZoneConnectPads extends SxClass {
11877
+ static token = "connect_pads";
11878
+ static parentToken = "zone";
11879
+ token = "connect_pads";
11880
+ _enabled;
11881
+ _sxClearance;
11882
+ constructor(params = {}) {
11883
+ super();
11884
+ if (params.enabled !== void 0) this.enabled = params.enabled;
11885
+ if (params.clearance !== void 0) this.clearance = params.clearance;
11886
+ }
11887
+ static fromSexprPrimitives(primitiveSexprs) {
11888
+ const connectPads = new _ZoneConnectPads();
11889
+ for (const primitive of primitiveSexprs) {
11890
+ const enabled = parseYesNo(primitive);
11891
+ if (enabled !== void 0) {
11892
+ connectPads.enabled = enabled;
11893
+ continue;
11894
+ }
11895
+ if (!Array.isArray(primitive) || typeof primitive[0] !== "string") {
11896
+ throw new Error(
11897
+ `zone connect_pads encountered invalid child expression: ${JSON.stringify(primitive)}`
11898
+ );
11899
+ }
11900
+ const parsed = SxClass.parsePrimitiveSexpr(primitive, {
11901
+ parentToken: this.token
11902
+ });
11903
+ if (parsed instanceof ZoneConnectPadsClearance) {
11904
+ if (connectPads._sxClearance) {
11905
+ throw new Error("zone connect_pads encountered duplicate clearance");
11906
+ }
11907
+ connectPads._sxClearance = parsed;
11908
+ continue;
11909
+ }
11910
+ throw new Error(
11911
+ `zone connect_pads encountered unsupported child ${JSON.stringify(primitive)}`
11912
+ );
11913
+ }
11914
+ return connectPads;
11915
+ }
11916
+ get enabled() {
11917
+ return this._enabled;
11918
+ }
11919
+ set enabled(value) {
11920
+ this._enabled = value;
11921
+ }
11922
+ get clearance() {
11923
+ return this._sxClearance?.value;
11924
+ }
11925
+ set clearance(value) {
11926
+ this._sxClearance = value === void 0 ? void 0 : value instanceof ZoneConnectPadsClearance ? value : new ZoneConnectPadsClearance(value);
11927
+ }
11928
+ getChildren() {
11929
+ return this._sxClearance ? [this._sxClearance] : [];
11930
+ }
11931
+ getString() {
11932
+ if (this._enabled === void 0) return super.getString();
11933
+ const children = this.getChildren();
11934
+ if (children.length === 0) {
11935
+ return `(connect_pads ${this._enabled ? "yes" : "no"})`;
11936
+ }
11937
+ const lines = [`(connect_pads ${this._enabled ? "yes" : "no"}`];
11938
+ for (const child of children) lines.push(child.getStringIndented());
11939
+ lines.push(")");
11940
+ return lines.join("\n");
11941
+ }
11942
+ };
11943
+ SxClass.register(ZoneConnectPads);
11944
+
11945
+ // lib/sexpr/classes/ZoneFillIslandAreaMin.ts
11946
+ var ZoneFillIslandAreaMin = class extends SxPrimitiveNumber {
11947
+ static token = "island_area_min";
11948
+ static parentToken = "fill";
11949
+ token = "island_area_min";
11950
+ };
11951
+ SxClass.register(ZoneFillIslandAreaMin);
11952
+
11953
+ // lib/sexpr/classes/ZoneFillIslandRemovalMode.ts
11954
+ var ZoneFillIslandRemovalMode = class extends SxPrimitiveNumber {
11955
+ static token = "island_removal_mode";
11956
+ static parentToken = "fill";
11957
+ token = "island_removal_mode";
11958
+ };
11959
+ SxClass.register(ZoneFillIslandRemovalMode);
11960
+
11961
+ // lib/sexpr/classes/ZoneFillRadius.ts
11962
+ var ZoneFillRadius = class extends SxPrimitiveNumber {
11963
+ static token = "radius";
11964
+ static parentToken = "fill";
11965
+ token = "radius";
11966
+ };
11967
+ SxClass.register(ZoneFillRadius);
11968
+
11969
+ // lib/sexpr/classes/ZoneFillSmoothing.ts
11970
+ var ZoneFillSmoothing = class extends SxPrimitiveString {
11971
+ static token = "smoothing";
11972
+ static parentToken = "fill";
11973
+ token = "smoothing";
11974
+ };
11975
+ SxClass.register(ZoneFillSmoothing);
11976
+
11977
+ // lib/sexpr/classes/ZoneFillThermalBridgeWidth.ts
11978
+ var ZoneFillThermalBridgeWidth = class extends SxPrimitiveNumber {
11979
+ static token = "thermal_bridge_width";
11980
+ static parentToken = "fill";
11981
+ token = "thermal_bridge_width";
11982
+ };
11983
+ SxClass.register(ZoneFillThermalBridgeWidth);
11984
+
11985
+ // lib/sexpr/classes/ZoneFillThermalGap.ts
11986
+ var ZoneFillThermalGap = class extends SxPrimitiveNumber {
11987
+ static token = "thermal_gap";
11988
+ static parentToken = "fill";
11989
+ token = "thermal_gap";
11990
+ };
11991
+ SxClass.register(ZoneFillThermalGap);
11992
+
11993
+ // lib/sexpr/classes/ZoneFill.ts
11994
+ var SINGLE_TOKENS2 = /* @__PURE__ */ new Set([
11995
+ "thermal_gap",
11996
+ "thermal_bridge_width",
11997
+ "smoothing",
11998
+ "radius",
11999
+ "island_removal_mode",
12000
+ "island_area_min"
12001
+ ]);
12002
+ var ZoneFill = class _ZoneFill extends SxClass {
12003
+ static token = "fill";
12004
+ static parentToken = "zone";
12005
+ token = "fill";
12006
+ _filled;
12007
+ _sxThermalGap;
12008
+ _sxThermalBridgeWidth;
12009
+ _sxSmoothing;
12010
+ _sxRadius;
12011
+ _sxIslandRemovalMode;
12012
+ _sxIslandAreaMin;
12013
+ constructor(params = {}) {
12014
+ super();
12015
+ if (params.filled !== void 0) this.filled = params.filled;
12016
+ if (params.thermalGap !== void 0) this.thermalGap = params.thermalGap;
12017
+ if (params.thermalBridgeWidth !== void 0)
12018
+ this.thermalBridgeWidth = params.thermalBridgeWidth;
12019
+ if (params.smoothing !== void 0) this.smoothing = params.smoothing;
12020
+ if (params.radius !== void 0) this.radius = params.radius;
12021
+ if (params.islandRemovalMode !== void 0)
12022
+ this.islandRemovalMode = params.islandRemovalMode;
12023
+ if (params.islandAreaMin !== void 0)
12024
+ this.islandAreaMin = params.islandAreaMin;
12025
+ }
12026
+ static fromSexprPrimitives(primitiveSexprs) {
12027
+ const fill = new _ZoneFill();
12028
+ const nodes = [];
12029
+ for (const primitive of primitiveSexprs) {
12030
+ const filled = parseYesNo(primitive);
12031
+ if (filled !== void 0) {
12032
+ fill.filled = filled;
12033
+ continue;
12034
+ }
12035
+ if (!Array.isArray(primitive) || typeof primitive[0] !== "string") {
12036
+ throw new Error(
12037
+ `zone fill encountered invalid child expression: ${JSON.stringify(primitive)}`
12038
+ );
12039
+ }
12040
+ nodes.push(primitive);
12041
+ }
12042
+ const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(nodes, this.token);
12043
+ for (const [token, entries] of Object.entries(arrayPropertyMap)) {
12044
+ if (!SINGLE_TOKENS2.has(token)) {
12045
+ throw new Error(`zone fill encountered unsupported child "${token}"`);
12046
+ }
12047
+ if (entries.length > 1) {
12048
+ throw new Error(`zone fill does not support repeated child "${token}"`);
12049
+ }
12050
+ }
12051
+ fill._sxThermalGap = propertyMap.thermal_gap;
12052
+ fill._sxThermalBridgeWidth = propertyMap.thermal_bridge_width;
12053
+ fill._sxSmoothing = propertyMap.smoothing;
12054
+ fill._sxRadius = propertyMap.radius;
12055
+ fill._sxIslandRemovalMode = propertyMap.island_removal_mode;
12056
+ fill._sxIslandAreaMin = propertyMap.island_area_min;
12057
+ return fill;
12058
+ }
12059
+ get filled() {
12060
+ return this._filled;
12061
+ }
12062
+ set filled(value) {
12063
+ this._filled = value;
12064
+ }
12065
+ get thermalGap() {
12066
+ return this._sxThermalGap?.value;
12067
+ }
12068
+ set thermalGap(value) {
12069
+ this._sxThermalGap = value === void 0 ? void 0 : value instanceof ZoneFillThermalGap ? value : new ZoneFillThermalGap(value);
12070
+ }
12071
+ get thermalBridgeWidth() {
12072
+ return this._sxThermalBridgeWidth?.value;
12073
+ }
12074
+ set thermalBridgeWidth(value) {
12075
+ this._sxThermalBridgeWidth = value === void 0 ? void 0 : value instanceof ZoneFillThermalBridgeWidth ? value : new ZoneFillThermalBridgeWidth(value);
12076
+ }
12077
+ get smoothing() {
12078
+ return this._sxSmoothing?.value;
12079
+ }
12080
+ set smoothing(value) {
12081
+ this._sxSmoothing = value === void 0 ? void 0 : value instanceof ZoneFillSmoothing ? value : new ZoneFillSmoothing(value);
12082
+ }
12083
+ get radius() {
12084
+ return this._sxRadius?.value;
12085
+ }
12086
+ set radius(value) {
12087
+ this._sxRadius = value === void 0 ? void 0 : value instanceof ZoneFillRadius ? value : new ZoneFillRadius(value);
12088
+ }
12089
+ get islandRemovalMode() {
12090
+ return this._sxIslandRemovalMode?.value;
12091
+ }
12092
+ set islandRemovalMode(value) {
12093
+ this._sxIslandRemovalMode = value === void 0 ? void 0 : value instanceof ZoneFillIslandRemovalMode ? value : new ZoneFillIslandRemovalMode(value);
12094
+ }
12095
+ get islandAreaMin() {
12096
+ return this._sxIslandAreaMin?.value;
12097
+ }
12098
+ set islandAreaMin(value) {
12099
+ this._sxIslandAreaMin = value === void 0 ? void 0 : value instanceof ZoneFillIslandAreaMin ? value : new ZoneFillIslandAreaMin(value);
12100
+ }
12101
+ getChildren() {
12102
+ const children = [];
12103
+ if (this._sxThermalGap) children.push(this._sxThermalGap);
12104
+ if (this._sxThermalBridgeWidth) children.push(this._sxThermalBridgeWidth);
12105
+ if (this._sxSmoothing) children.push(this._sxSmoothing);
12106
+ if (this._sxRadius) children.push(this._sxRadius);
12107
+ if (this._sxIslandRemovalMode) children.push(this._sxIslandRemovalMode);
12108
+ if (this._sxIslandAreaMin) children.push(this._sxIslandAreaMin);
12109
+ return children;
12110
+ }
12111
+ getString() {
12112
+ if (this._filled === void 0) return super.getString();
12113
+ const children = this.getChildren();
12114
+ if (children.length === 0) {
12115
+ return `(fill ${this._filled ? "yes" : "no"})`;
12116
+ }
12117
+ const lines = [`(fill ${this._filled ? "yes" : "no"}`];
12118
+ for (const child of children) lines.push(child.getStringIndented());
12119
+ lines.push(")");
12120
+ return lines.join("\n");
12121
+ }
12122
+ };
12123
+ SxClass.register(ZoneFill);
12124
+
12125
+ // lib/sexpr/classes/ZoneFilledAreasThickness.ts
12126
+ var ZoneFilledAreasThickness = class extends SxPrimitiveBoolean {
12127
+ static token = "filled_areas_thickness";
12128
+ static parentToken = "zone";
12129
+ token = "filled_areas_thickness";
12130
+ };
12131
+ SxClass.register(ZoneFilledAreasThickness);
12132
+
12133
+ // lib/sexpr/classes/ZoneFilledPolygon.ts
12134
+ var ZoneFilledPolygon = class _ZoneFilledPolygon extends SxClass {
12135
+ static token = "filled_polygon";
12136
+ static parentToken = "zone";
12137
+ token = "filled_polygon";
12138
+ _sxLayer;
12139
+ _sxPts;
12140
+ constructor(params = {}) {
12141
+ super();
12142
+ if (params.layer !== void 0) this.layer = params.layer;
12143
+ if (params.pts !== void 0) this.pts = params.pts;
12144
+ }
12145
+ static fromSexprPrimitives(primitiveSexprs) {
12146
+ const polygon = new _ZoneFilledPolygon();
12147
+ const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(primitiveSexprs, this.token);
12148
+ for (const [token, entries] of Object.entries(arrayPropertyMap)) {
12149
+ if (token !== "layer" && token !== "pts") {
12150
+ throw new Error(
12151
+ `zone filled_polygon encountered unsupported child "${token}"`
12152
+ );
12153
+ }
12154
+ if (entries.length > 1) {
12155
+ throw new Error(
12156
+ `zone filled_polygon does not support repeated child "${token}"`
12157
+ );
12158
+ }
12159
+ }
12160
+ polygon._sxLayer = propertyMap.layer;
12161
+ polygon._sxPts = propertyMap.pts;
12162
+ return polygon;
12163
+ }
12164
+ get layer() {
12165
+ return this._sxLayer;
12166
+ }
12167
+ set layer(value) {
12168
+ this._sxLayer = value;
12169
+ }
12170
+ get pts() {
12171
+ return this._sxPts;
12172
+ }
12173
+ set pts(value) {
12174
+ this._sxPts = value;
12175
+ }
12176
+ getChildren() {
12177
+ const children = [];
12178
+ if (this._sxLayer) children.push(this._sxLayer);
12179
+ if (this._sxPts) children.push(this._sxPts);
12180
+ return children;
12181
+ }
12182
+ };
12183
+ SxClass.register(ZoneFilledPolygon);
12184
+
12185
+ // lib/sexpr/classes/ZoneHatch.ts
12186
+ var ZoneHatch = class _ZoneHatch extends SxClass {
12187
+ constructor(style, pitch) {
12188
+ super();
12189
+ this.style = style;
12190
+ this.pitch = pitch;
12191
+ }
12192
+ style;
12193
+ pitch;
12194
+ static token = "hatch";
12195
+ static parentToken = "zone";
12196
+ token = "hatch";
12197
+ static fromSexprPrimitives(primitiveSexprs) {
12198
+ const style = toStringValue(primitiveSexprs[0]);
12199
+ const pitch = toNumberValue(primitiveSexprs[1]);
12200
+ if (style === void 0 || pitch === void 0) {
12201
+ throw new Error("zone hatch requires style and numeric pitch");
12202
+ }
12203
+ return new _ZoneHatch(style, pitch);
12204
+ }
12205
+ getString() {
12206
+ return `(hatch ${this.style} ${this.pitch})`;
12207
+ }
12208
+ };
12209
+ SxClass.register(ZoneHatch);
12210
+
12211
+ // lib/sexpr/classes/ZoneKeepoutCopperpour.ts
12212
+ var ZoneKeepoutCopperpour = class extends SxPrimitiveString {
12213
+ static token = "copperpour";
12214
+ static parentToken = "keepout";
12215
+ token = "copperpour";
12216
+ };
12217
+ SxClass.register(ZoneKeepoutCopperpour);
12218
+
12219
+ // lib/sexpr/classes/ZoneKeepoutFootprints.ts
12220
+ var ZoneKeepoutFootprints = class extends SxPrimitiveString {
12221
+ static token = "footprints";
12222
+ static parentToken = "keepout";
12223
+ token = "footprints";
12224
+ };
12225
+ SxClass.register(ZoneKeepoutFootprints);
12226
+
12227
+ // lib/sexpr/classes/ZoneKeepoutPads.ts
12228
+ var ZoneKeepoutPads = class extends SxPrimitiveString {
12229
+ static token = "pads";
12230
+ static parentToken = "keepout";
12231
+ token = "pads";
12232
+ };
12233
+ SxClass.register(ZoneKeepoutPads);
12234
+
12235
+ // lib/sexpr/classes/ZoneKeepoutTracks.ts
12236
+ var ZoneKeepoutTracks = class extends SxPrimitiveString {
12237
+ static token = "tracks";
12238
+ static parentToken = "keepout";
12239
+ token = "tracks";
12240
+ };
12241
+ SxClass.register(ZoneKeepoutTracks);
12242
+
12243
+ // lib/sexpr/classes/ZoneKeepoutVias.ts
12244
+ var ZoneKeepoutVias = class extends SxPrimitiveString {
12245
+ static token = "vias";
12246
+ static parentToken = "keepout";
12247
+ token = "vias";
12248
+ };
12249
+ SxClass.register(ZoneKeepoutVias);
12250
+
12251
+ // lib/sexpr/classes/ZoneKeepout.ts
12252
+ var SINGLE_TOKENS3 = /* @__PURE__ */ new Set([
12253
+ "tracks",
12254
+ "vias",
12255
+ "pads",
12256
+ "copperpour",
12257
+ "footprints"
12258
+ ]);
12259
+ var ZoneKeepout = class _ZoneKeepout extends SxClass {
12260
+ static token = "keepout";
12261
+ static parentToken = "zone";
12262
+ token = "keepout";
12263
+ _sxTracks;
12264
+ _sxVias;
12265
+ _sxPads;
12266
+ _sxCopperpour;
12267
+ _sxFootprints;
12268
+ static fromSexprPrimitives(primitiveSexprs) {
12269
+ const keepout = new _ZoneKeepout();
12270
+ const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(primitiveSexprs, this.token);
12271
+ for (const [token, entries] of Object.entries(arrayPropertyMap)) {
12272
+ if (!SINGLE_TOKENS3.has(token)) {
12273
+ throw new Error(`zone keepout encountered unsupported child "${token}"`);
12274
+ }
12275
+ if (entries.length > 1) {
12276
+ throw new Error(
12277
+ `zone keepout does not support repeated child "${token}"`
12278
+ );
12279
+ }
12280
+ }
12281
+ keepout._sxTracks = propertyMap.tracks;
12282
+ keepout._sxVias = propertyMap.vias;
12283
+ keepout._sxPads = propertyMap.pads;
12284
+ keepout._sxCopperpour = propertyMap.copperpour;
12285
+ keepout._sxFootprints = propertyMap.footprints;
12286
+ return keepout;
12287
+ }
12288
+ get tracks() {
12289
+ return this._sxTracks?.value;
12290
+ }
12291
+ set tracks(value) {
12292
+ this._sxTracks = value === void 0 ? void 0 : value instanceof ZoneKeepoutTracks ? value : new ZoneKeepoutTracks(value);
12293
+ }
12294
+ get vias() {
12295
+ return this._sxVias?.value;
12296
+ }
12297
+ set vias(value) {
12298
+ this._sxVias = value === void 0 ? void 0 : value instanceof ZoneKeepoutVias ? value : new ZoneKeepoutVias(value);
12299
+ }
12300
+ get pads() {
12301
+ return this._sxPads?.value;
12302
+ }
12303
+ set pads(value) {
12304
+ this._sxPads = value === void 0 ? void 0 : value instanceof ZoneKeepoutPads ? value : new ZoneKeepoutPads(value);
12305
+ }
12306
+ get copperpour() {
12307
+ return this._sxCopperpour?.value;
12308
+ }
12309
+ set copperpour(value) {
12310
+ this._sxCopperpour = value === void 0 ? void 0 : value instanceof ZoneKeepoutCopperpour ? value : new ZoneKeepoutCopperpour(value);
12311
+ }
12312
+ get footprints() {
12313
+ return this._sxFootprints?.value;
12314
+ }
12315
+ set footprints(value) {
12316
+ this._sxFootprints = value === void 0 ? void 0 : value instanceof ZoneKeepoutFootprints ? value : new ZoneKeepoutFootprints(value);
12317
+ }
12318
+ getChildren() {
12319
+ const children = [];
12320
+ if (this._sxTracks) children.push(this._sxTracks);
12321
+ if (this._sxVias) children.push(this._sxVias);
12322
+ if (this._sxPads) children.push(this._sxPads);
12323
+ if (this._sxCopperpour) children.push(this._sxCopperpour);
12324
+ if (this._sxFootprints) children.push(this._sxFootprints);
12325
+ return children;
12326
+ }
12327
+ };
12328
+ SxClass.register(ZoneKeepout);
12329
+
12330
+ // lib/sexpr/classes/ZoneMinThickness.ts
12331
+ var ZoneMinThickness = class extends SxPrimitiveNumber {
12332
+ static token = "min_thickness";
12333
+ static parentToken = "zone";
12334
+ token = "min_thickness";
12335
+ };
12336
+ SxClass.register(ZoneMinThickness);
12337
+
12338
+ // lib/sexpr/classes/ZoneName.ts
12339
+ var ZoneName = class extends SxPrimitiveString {
12340
+ static token = "name";
12341
+ static parentToken = "zone";
12342
+ token = "name";
12343
+ };
12344
+ SxClass.register(ZoneName);
12345
+
12346
+ // lib/sexpr/classes/ZoneNet.ts
12347
+ var ZoneNet = class _ZoneNet extends SxClass {
12348
+ constructor(value) {
12349
+ super();
12350
+ this.value = value;
12351
+ }
12352
+ value;
12353
+ static token = "net";
12354
+ static parentToken = "zone";
12355
+ token = "net";
12356
+ static fromSexprPrimitives(primitiveSexprs) {
12357
+ const numberValue = toNumberValue(primitiveSexprs[0]);
12358
+ if (numberValue !== void 0) return new _ZoneNet(numberValue);
12359
+ const stringValue = toStringValue(primitiveSexprs[0]);
12360
+ if (stringValue === void 0) {
12361
+ throw new Error("zone net requires a numeric id or string name");
12362
+ }
12363
+ return new _ZoneNet(stringValue);
12364
+ }
12365
+ getString() {
12366
+ return `(net ${typeof this.value === "number" ? this.value : quoteIfNeeded(this.value)})`;
12367
+ }
12368
+ };
12369
+ SxClass.register(ZoneNet);
12370
+
12371
+ // lib/sexpr/classes/ZoneNetName.ts
12372
+ var ZoneNetName = class extends SxPrimitiveString {
12373
+ static token = "net_name";
12374
+ static parentToken = "zone";
12375
+ token = "net_name";
12376
+ };
12377
+ SxClass.register(ZoneNetName);
12378
+
12379
+ // lib/sexpr/classes/ZonePlacementEnabled.ts
12380
+ var ZonePlacementEnabled = class extends SxPrimitiveBoolean {
12381
+ static token = "enabled";
12382
+ static parentToken = "placement";
12383
+ token = "enabled";
12384
+ };
12385
+ SxClass.register(ZonePlacementEnabled);
12386
+
12387
+ // lib/sexpr/classes/ZonePlacementSheetname.ts
12388
+ var ZonePlacementSheetname = class extends SxPrimitiveString {
12389
+ static token = "sheetname";
12390
+ static parentToken = "placement";
12391
+ token = "sheetname";
12392
+ };
12393
+ SxClass.register(ZonePlacementSheetname);
12394
+
12395
+ // lib/sexpr/classes/ZonePlacement.ts
12396
+ var ZonePlacement = class _ZonePlacement extends SxClass {
12397
+ static token = "placement";
12398
+ static parentToken = "zone";
12399
+ token = "placement";
12400
+ _sxEnabled;
12401
+ _sxSheetname;
12402
+ static fromSexprPrimitives(primitiveSexprs) {
12403
+ const placement = new _ZonePlacement();
12404
+ const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(primitiveSexprs, this.token);
12405
+ for (const [token, entries] of Object.entries(arrayPropertyMap)) {
12406
+ if (token !== "enabled" && token !== "sheetname") {
12407
+ throw new Error(
12408
+ `zone placement encountered unsupported child "${token}"`
12409
+ );
12410
+ }
12411
+ if (entries.length > 1) {
12412
+ throw new Error(
12413
+ `zone placement does not support repeated child "${token}"`
12414
+ );
12415
+ }
12416
+ }
12417
+ placement._sxEnabled = propertyMap.enabled;
12418
+ placement._sxSheetname = propertyMap.sheetname;
12419
+ return placement;
12420
+ }
12421
+ get enabled() {
12422
+ return this._sxEnabled?.value;
12423
+ }
12424
+ set enabled(value) {
12425
+ this._sxEnabled = value === void 0 ? void 0 : value instanceof ZonePlacementEnabled ? value : new ZonePlacementEnabled(value);
12426
+ }
12427
+ get sheetname() {
12428
+ return this._sxSheetname?.value;
12429
+ }
12430
+ set sheetname(value) {
12431
+ this._sxSheetname = value === void 0 ? void 0 : value instanceof ZonePlacementSheetname ? value : new ZonePlacementSheetname(value);
12432
+ }
12433
+ getChildren() {
12434
+ const children = [];
12435
+ if (this._sxEnabled) children.push(this._sxEnabled);
12436
+ if (this._sxSheetname) children.push(this._sxSheetname);
12437
+ return children;
12438
+ }
12439
+ };
12440
+ SxClass.register(ZonePlacement);
12441
+
12442
+ // lib/sexpr/classes/ZonePolygon.ts
12443
+ var ZonePolygon = class _ZonePolygon extends SxClass {
12444
+ static token = "polygon";
12445
+ static parentToken = "zone";
12446
+ token = "polygon";
12447
+ _sxPts;
12448
+ constructor(pts) {
12449
+ super();
12450
+ this._sxPts = pts;
12451
+ }
12452
+ static fromSexprPrimitives(primitiveSexprs) {
12453
+ const polygon = new _ZonePolygon();
12454
+ const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(primitiveSexprs, this.token);
12455
+ for (const [token, entries] of Object.entries(arrayPropertyMap)) {
12456
+ if (token !== "pts") {
12457
+ throw new Error(`zone polygon encountered unsupported child "${token}"`);
12458
+ }
12459
+ if (entries.length > 1) {
12460
+ throw new Error("zone polygon does not support repeated pts children");
12461
+ }
12462
+ }
12463
+ polygon._sxPts = propertyMap.pts;
12464
+ return polygon;
12465
+ }
12466
+ get pts() {
12467
+ return this._sxPts;
12468
+ }
12469
+ set pts(value) {
12470
+ this._sxPts = value;
12471
+ }
12472
+ getChildren() {
12473
+ return this._sxPts ? [this._sxPts] : [];
12474
+ }
12475
+ };
12476
+ SxClass.register(ZonePolygon);
12477
+
12478
+ // lib/sexpr/classes/ZonePriority.ts
12479
+ var ZonePriority = class extends SxPrimitiveNumber {
12480
+ static token = "priority";
12481
+ static parentToken = "zone";
12482
+ token = "priority";
12483
+ };
12484
+ SxClass.register(ZonePriority);
12485
+
11752
12486
  // lib/sexpr/classes/Zone.ts
12487
+ var SINGLE_TOKENS4 = /* @__PURE__ */ new Set([
12488
+ "net",
12489
+ "net_name",
12490
+ "layer",
12491
+ "layers",
12492
+ "tstamp",
12493
+ "uuid",
12494
+ "name",
12495
+ "hatch",
12496
+ "priority",
12497
+ "attr",
12498
+ "connect_pads",
12499
+ "min_thickness",
12500
+ "filled_areas_thickness",
12501
+ "keepout",
12502
+ "placement",
12503
+ "fill"
12504
+ ]);
12505
+ var MULTI_TOKENS2 = /* @__PURE__ */ new Set(["polygon", "filled_polygon"]);
12506
+ var SUPPORTED_TOKENS15 = /* @__PURE__ */ new Set([...SINGLE_TOKENS4, ...MULTI_TOKENS2]);
11753
12507
  var Zone = class _Zone extends SxClass {
11754
12508
  static token = "zone";
11755
12509
  token = "zone";
11756
- _rawChildren = [];
12510
+ _sxNet;
12511
+ _sxNetName;
12512
+ _sxLayer;
12513
+ _sxLayers;
12514
+ _sxTstamp;
12515
+ _sxUuid;
12516
+ _sxName;
12517
+ _sxHatch;
12518
+ _sxPriority;
12519
+ _sxAttr;
12520
+ _sxConnectPads;
12521
+ _sxMinThickness;
12522
+ _sxFilledAreasThickness;
12523
+ _sxKeepout;
12524
+ _sxPlacement;
12525
+ _sxFill;
12526
+ _polygons = [];
12527
+ _filledPolygons = [];
12528
+ constructor(params = {}) {
12529
+ super();
12530
+ if (params.net !== void 0) this.net = params.net;
12531
+ if (params.netName !== void 0) this.netName = params.netName;
12532
+ if (params.layer !== void 0) this.layer = params.layer;
12533
+ if (params.layers !== void 0) this.layers = params.layers;
12534
+ if (params.tstamp !== void 0) this.tstamp = params.tstamp;
12535
+ if (params.uuid !== void 0) this.uuid = params.uuid;
12536
+ if (params.name !== void 0) this.name = params.name;
12537
+ if (params.hatch !== void 0) this.hatch = params.hatch;
12538
+ if (params.priority !== void 0) this.priority = params.priority;
12539
+ if (params.attr !== void 0) this.attr = params.attr;
12540
+ if (params.connectPads !== void 0) this.connectPads = params.connectPads;
12541
+ if (params.minThickness !== void 0)
12542
+ this.minThickness = params.minThickness;
12543
+ if (params.filledAreasThickness !== void 0)
12544
+ this.filledAreasThickness = params.filledAreasThickness;
12545
+ if (params.keepout !== void 0) this.keepout = params.keepout;
12546
+ if (params.placement !== void 0) this.placement = params.placement;
12547
+ if (params.fill !== void 0) this.fill = params.fill;
12548
+ if (params.polygons !== void 0) this.polygons = params.polygons;
12549
+ if (params.filledPolygons !== void 0)
12550
+ this.filledPolygons = params.filledPolygons;
12551
+ }
11757
12552
  static fromSexprPrimitives(primitiveSexprs) {
11758
12553
  const zone = new _Zone();
11759
- zone._rawChildren = [...primitiveSexprs];
12554
+ for (const primitive of primitiveSexprs) {
12555
+ if (!Array.isArray(primitive) || typeof primitive[0] !== "string") {
12556
+ throw new Error(
12557
+ `zone encountered invalid child expression: ${JSON.stringify(primitive)}`
12558
+ );
12559
+ }
12560
+ }
12561
+ const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(primitiveSexprs, this.token);
12562
+ for (const [token, entries] of Object.entries(arrayPropertyMap)) {
12563
+ if (!SUPPORTED_TOKENS15.has(token)) {
12564
+ throw new Error(`zone encountered unsupported child token "${token}"`);
12565
+ }
12566
+ if (!MULTI_TOKENS2.has(token) && entries.length > 1) {
12567
+ throw new Error(`zone does not support repeated child token "${token}"`);
12568
+ }
12569
+ }
12570
+ zone._sxNet = propertyMap.net;
12571
+ zone._sxNetName = propertyMap.net_name;
12572
+ zone._sxLayer = propertyMap.layer;
12573
+ zone._sxLayers = propertyMap.layers;
12574
+ if (zone._sxLayer && zone._sxLayers) {
12575
+ throw new Error("zone cannot include both layer and layers children");
12576
+ }
12577
+ zone._sxTstamp = propertyMap.tstamp;
12578
+ zone._sxUuid = propertyMap.uuid;
12579
+ zone._sxName = propertyMap.name;
12580
+ zone._sxHatch = propertyMap.hatch;
12581
+ zone._sxPriority = propertyMap.priority;
12582
+ zone._sxAttr = propertyMap.attr;
12583
+ zone._sxConnectPads = propertyMap.connect_pads;
12584
+ zone._sxMinThickness = propertyMap.min_thickness;
12585
+ zone._sxFilledAreasThickness = propertyMap.filled_areas_thickness;
12586
+ zone._sxKeepout = propertyMap.keepout;
12587
+ zone._sxPlacement = propertyMap.placement;
12588
+ zone._sxFill = propertyMap.fill;
12589
+ zone._polygons = arrayPropertyMap.polygon ?? [];
12590
+ zone._filledPolygons = arrayPropertyMap.filled_polygon ?? [];
11760
12591
  return zone;
11761
12592
  }
11762
- get rawChildren() {
11763
- return [...this._rawChildren];
12593
+ get net() {
12594
+ return this._sxNet?.value;
12595
+ }
12596
+ set net(value) {
12597
+ this._sxNet = value === void 0 ? void 0 : value instanceof ZoneNet ? value : new ZoneNet(value);
11764
12598
  }
11765
- set rawChildren(children) {
11766
- this._rawChildren = [...children];
12599
+ get netClass() {
12600
+ return this._sxNet;
11767
12601
  }
11768
- getChildren() {
11769
- return [];
12602
+ get netName() {
12603
+ return this._sxNetName?.value;
11770
12604
  }
11771
- getString() {
11772
- const lines = ["(zone"];
11773
- for (const arg of this._rawChildren) {
11774
- lines.push(` ${printSExpr(arg)}`);
12605
+ set netName(value) {
12606
+ this._sxNetName = value === void 0 ? void 0 : value instanceof ZoneNetName ? value : new ZoneNetName(value);
12607
+ }
12608
+ get layer() {
12609
+ return this._sxLayer;
12610
+ }
12611
+ set layer(value) {
12612
+ if (value === void 0) {
12613
+ this._sxLayer = void 0;
12614
+ return;
11775
12615
  }
11776
- lines.push(")");
11777
- return lines.join("\n");
12616
+ this._sxLayer = value instanceof Layer ? value : new Layer([value].flat());
12617
+ this._sxLayers = void 0;
12618
+ }
12619
+ get layers() {
12620
+ return this._sxLayers;
12621
+ }
12622
+ set layers(value) {
12623
+ if (value === void 0) {
12624
+ this._sxLayers = void 0;
12625
+ return;
12626
+ }
12627
+ this._sxLayers = value instanceof Layers ? value : new Layers(value);
12628
+ this._sxLayer = void 0;
12629
+ }
12630
+ get tstamp() {
12631
+ return this._sxTstamp;
12632
+ }
12633
+ set tstamp(value) {
12634
+ this._sxTstamp = value === void 0 ? void 0 : value instanceof Tstamp ? value : new Tstamp(value);
12635
+ }
12636
+ get uuid() {
12637
+ return this._sxUuid;
12638
+ }
12639
+ set uuid(value) {
12640
+ this._sxUuid = value === void 0 ? void 0 : value instanceof Uuid ? value : new Uuid(value);
12641
+ }
12642
+ get name() {
12643
+ return this._sxName?.value;
12644
+ }
12645
+ set name(value) {
12646
+ this._sxName = value === void 0 ? void 0 : value instanceof ZoneName ? value : new ZoneName(value);
12647
+ }
12648
+ get hatch() {
12649
+ return this._sxHatch;
12650
+ }
12651
+ set hatch(value) {
12652
+ this._sxHatch = value;
12653
+ }
12654
+ get priority() {
12655
+ return this._sxPriority?.value;
12656
+ }
12657
+ set priority(value) {
12658
+ this._sxPriority = value === void 0 ? void 0 : value instanceof ZonePriority ? value : new ZonePriority(value);
12659
+ }
12660
+ get attr() {
12661
+ return this._sxAttr;
12662
+ }
12663
+ set attr(value) {
12664
+ this._sxAttr = value;
12665
+ }
12666
+ get connectPads() {
12667
+ return this._sxConnectPads;
12668
+ }
12669
+ set connectPads(value) {
12670
+ this._sxConnectPads = value;
12671
+ }
12672
+ get minThickness() {
12673
+ return this._sxMinThickness?.value;
12674
+ }
12675
+ set minThickness(value) {
12676
+ this._sxMinThickness = value === void 0 ? void 0 : value instanceof ZoneMinThickness ? value : new ZoneMinThickness(value);
12677
+ }
12678
+ get filledAreasThickness() {
12679
+ return this._sxFilledAreasThickness?.value;
12680
+ }
12681
+ set filledAreasThickness(value) {
12682
+ this._sxFilledAreasThickness = value === void 0 ? void 0 : value instanceof ZoneFilledAreasThickness ? value : new ZoneFilledAreasThickness(value);
12683
+ }
12684
+ get keepout() {
12685
+ return this._sxKeepout;
12686
+ }
12687
+ set keepout(value) {
12688
+ this._sxKeepout = value;
12689
+ }
12690
+ get placement() {
12691
+ return this._sxPlacement;
12692
+ }
12693
+ set placement(value) {
12694
+ this._sxPlacement = value;
12695
+ }
12696
+ get fill() {
12697
+ return this._sxFill;
12698
+ }
12699
+ set fill(value) {
12700
+ this._sxFill = value;
12701
+ }
12702
+ get polygons() {
12703
+ return [...this._polygons];
12704
+ }
12705
+ set polygons(value) {
12706
+ this._polygons = [...value];
12707
+ }
12708
+ get filledPolygons() {
12709
+ return [...this._filledPolygons];
12710
+ }
12711
+ set filledPolygons(value) {
12712
+ this._filledPolygons = [...value];
12713
+ }
12714
+ getChildren() {
12715
+ const children = [];
12716
+ if (this._sxNet) children.push(this._sxNet);
12717
+ if (this._sxNetName) children.push(this._sxNetName);
12718
+ if (this._sxLayer) children.push(this._sxLayer);
12719
+ if (this._sxLayers) children.push(this._sxLayers);
12720
+ if (this._sxTstamp) children.push(this._sxTstamp);
12721
+ if (this._sxUuid) children.push(this._sxUuid);
12722
+ if (this._sxName) children.push(this._sxName);
12723
+ if (this._sxHatch) children.push(this._sxHatch);
12724
+ if (this._sxPriority) children.push(this._sxPriority);
12725
+ if (this._sxAttr) children.push(this._sxAttr);
12726
+ if (this._sxConnectPads) children.push(this._sxConnectPads);
12727
+ if (this._sxMinThickness) children.push(this._sxMinThickness);
12728
+ if (this._sxFilledAreasThickness)
12729
+ children.push(this._sxFilledAreasThickness);
12730
+ if (this._sxKeepout) children.push(this._sxKeepout);
12731
+ if (this._sxPlacement) children.push(this._sxPlacement);
12732
+ if (this._sxFill) children.push(this._sxFill);
12733
+ children.push(...this._polygons);
12734
+ children.push(...this._filledPolygons);
12735
+ return children;
11778
12736
  }
11779
12737
  };
11780
12738
  SxClass.register(Zone);
11781
12739
 
11782
12740
  // lib/sexpr/classes/Footprint.ts
11783
- var SINGLE_TOKENS2 = /* @__PURE__ */ new Set([
12741
+ var SINGLE_TOKENS5 = /* @__PURE__ */ new Set([
11784
12742
  "version",
11785
12743
  "generator",
11786
12744
  "generator_version",
@@ -11814,7 +12772,7 @@ var SINGLE_TOKENS2 = /* @__PURE__ */ new Set([
11814
12772
  "embedded_fonts",
11815
12773
  "embedded_files"
11816
12774
  ]);
11817
- var MULTI_TOKENS2 = /* @__PURE__ */ new Set([
12775
+ var MULTI_TOKENS3 = /* @__PURE__ */ new Set([
11818
12776
  "property",
11819
12777
  "fp_text",
11820
12778
  "fp_text_box",
@@ -11828,7 +12786,7 @@ var MULTI_TOKENS2 = /* @__PURE__ */ new Set([
11828
12786
  "model",
11829
12787
  "zone"
11830
12788
  ]);
11831
- var SUPPORTED_TOKENS15 = /* @__PURE__ */ new Set([...SINGLE_TOKENS2, ...MULTI_TOKENS2]);
12789
+ var SUPPORTED_TOKENS16 = /* @__PURE__ */ new Set([...SINGLE_TOKENS5, ...MULTI_TOKENS3]);
11832
12790
  var Footprint = class _Footprint extends SxClass {
11833
12791
  static token = "footprint";
11834
12792
  token = "footprint";
@@ -11960,19 +12918,19 @@ var Footprint = class _Footprint extends SxClass {
11960
12918
  }
11961
12919
  const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(rawNodes, this.token);
11962
12920
  for (const token of Object.keys(propertyMap)) {
11963
- if (!SUPPORTED_TOKENS15.has(token)) {
12921
+ if (!SUPPORTED_TOKENS16.has(token)) {
11964
12922
  throw new Error(
11965
12923
  `footprint encountered unsupported child token "${token}"`
11966
12924
  );
11967
12925
  }
11968
12926
  }
11969
12927
  for (const [token, entries] of Object.entries(arrayPropertyMap)) {
11970
- if (!SUPPORTED_TOKENS15.has(token)) {
12928
+ if (!SUPPORTED_TOKENS16.has(token)) {
11971
12929
  throw new Error(
11972
12930
  `footprint encountered unsupported child token "${token}"`
11973
12931
  );
11974
12932
  }
11975
- if (!MULTI_TOKENS2.has(token) && entries.length > 1) {
12933
+ if (!MULTI_TOKENS3.has(token) && entries.length > 1) {
11976
12934
  throw new Error(
11977
12935
  `footprint does not support repeated child token "${token}"`
11978
12936
  );
@@ -13127,7 +14085,7 @@ var GrCircleLocked = class _GrCircleLocked extends SxClass {
13127
14085
  SxClass.register(GrCircleLocked);
13128
14086
 
13129
14087
  // lib/sexpr/classes/GrCurve.ts
13130
- var SUPPORTED_TOKENS16 = /* @__PURE__ */ new Set([
14088
+ var SUPPORTED_TOKENS17 = /* @__PURE__ */ new Set([
13131
14089
  "pts",
13132
14090
  "xy",
13133
14091
  "layer",
@@ -13159,12 +14117,12 @@ var GrCurve = class _GrCurve extends SxClass {
13159
14117
  const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(primitiveSexprs, this.token);
13160
14118
  const unexpectedTokens = /* @__PURE__ */ new Set();
13161
14119
  for (const token of Object.keys(propertyMap)) {
13162
- if (!SUPPORTED_TOKENS16.has(token)) {
14120
+ if (!SUPPORTED_TOKENS17.has(token)) {
13163
14121
  unexpectedTokens.add(token);
13164
14122
  }
13165
14123
  }
13166
14124
  for (const token of Object.keys(arrayPropertyMap)) {
13167
- if (!SUPPORTED_TOKENS16.has(token)) {
14125
+ if (!SUPPORTED_TOKENS17.has(token)) {
13168
14126
  unexpectedTokens.add(token);
13169
14127
  continue;
13170
14128
  }
@@ -14268,7 +15226,7 @@ var GrPolyFill = class _GrPolyFill extends SxClass {
14268
15226
  }
14269
15227
  };
14270
15228
  SxClass.register(GrPolyFill);
14271
- var SUPPORTED_TOKENS17 = /* @__PURE__ */ new Set([
15229
+ var SUPPORTED_TOKENS18 = /* @__PURE__ */ new Set([
14272
15230
  "pts",
14273
15231
  "xy",
14274
15232
  "layer",
@@ -14303,12 +15261,12 @@ var GrPoly = class _GrPoly extends SxClass {
14303
15261
  const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(primitiveSexprs, this.token);
14304
15262
  const unexpectedTokens = /* @__PURE__ */ new Set();
14305
15263
  for (const token of Object.keys(propertyMap)) {
14306
- if (!SUPPORTED_TOKENS17.has(token)) {
15264
+ if (!SUPPORTED_TOKENS18.has(token)) {
14307
15265
  unexpectedTokens.add(token);
14308
15266
  }
14309
15267
  }
14310
15268
  for (const token of Object.keys(arrayPropertyMap)) {
14311
- if (!SUPPORTED_TOKENS17.has(token)) {
15269
+ if (!SUPPORTED_TOKENS18.has(token)) {
14312
15270
  unexpectedTokens.add(token);
14313
15271
  }
14314
15272
  if (token !== "xy" && arrayPropertyMap[token].length > 1) {
@@ -14354,7 +15312,7 @@ var GrPoly = class _GrPoly extends SxClass {
14354
15312
  `gr_poly child token must be a string, received: ${JSON.stringify(token)}`
14355
15313
  );
14356
15314
  }
14357
- if (!SUPPORTED_TOKENS17.has(token)) {
15315
+ if (!SUPPORTED_TOKENS18.has(token)) {
14358
15316
  throw new Error(
14359
15317
  `Unsupported child token inside gr_poly expression: ${token}`
14360
15318
  );
@@ -14545,7 +15503,7 @@ var DimensionFormatUnitsFormat = class extends SxPrimitiveNumber {
14545
15503
  SxClass.register(DimensionFormatUnitsFormat);
14546
15504
 
14547
15505
  // lib/sexpr/classes/DimensionFormat.ts
14548
- var SUPPORTED_TOKENS18 = /* @__PURE__ */ new Set([
15506
+ var SUPPORTED_TOKENS19 = /* @__PURE__ */ new Set([
14549
15507
  "prefix",
14550
15508
  "suffix",
14551
15509
  "units",
@@ -14569,7 +15527,7 @@ var DimensionFormat = class _DimensionFormat extends SxClass {
14569
15527
  const format = new _DimensionFormat();
14570
15528
  const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(primitiveSexprs, this.token);
14571
15529
  for (const token of Object.keys(arrayPropertyMap)) {
14572
- if (!SUPPORTED_TOKENS18.has(token)) {
15530
+ if (!SUPPORTED_TOKENS19.has(token)) {
14573
15531
  throw new Error(`format does not support child token "${token}"`);
14574
15532
  }
14575
15533
  if (arrayPropertyMap[token].length > 1) {
@@ -14729,7 +15687,7 @@ var DimensionTextPositionMode = class extends SxPrimitiveNumber {
14729
15687
  SxClass.register(DimensionTextPositionMode);
14730
15688
 
14731
15689
  // lib/sexpr/classes/DimensionStyle.ts
14732
- var SUPPORTED_TOKENS19 = /* @__PURE__ */ new Set([
15690
+ var SUPPORTED_TOKENS20 = /* @__PURE__ */ new Set([
14733
15691
  "thickness",
14734
15692
  "arrow_length",
14735
15693
  "text_position_mode",
@@ -14755,7 +15713,7 @@ var DimensionStyle = class _DimensionStyle extends SxClass {
14755
15713
  const style = new _DimensionStyle();
14756
15714
  const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(primitiveSexprs, this.token);
14757
15715
  for (const token of Object.keys(arrayPropertyMap)) {
14758
- if (!SUPPORTED_TOKENS19.has(token)) {
15716
+ if (!SUPPORTED_TOKENS20.has(token)) {
14759
15717
  throw new Error(`style does not support child token "${token}"`);
14760
15718
  }
14761
15719
  if (arrayPropertyMap[token].length > 1) {
@@ -14814,7 +15772,7 @@ var DimensionType = class extends SxPrimitiveString {
14814
15772
  SxClass.register(DimensionType);
14815
15773
 
14816
15774
  // lib/sexpr/classes/Dimension.ts
14817
- var SUPPORTED_TOKENS20 = /* @__PURE__ */ new Set([
15775
+ var SUPPORTED_TOKENS21 = /* @__PURE__ */ new Set([
14818
15776
  "locked",
14819
15777
  "type",
14820
15778
  "layer",
@@ -14846,7 +15804,7 @@ var Dimension = class _Dimension extends SxClass {
14846
15804
  const dimension = new _Dimension();
14847
15805
  const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(primitiveSexprs, this.token);
14848
15806
  for (const token of Object.keys(arrayPropertyMap)) {
14849
- if (!SUPPORTED_TOKENS20.has(token)) {
15807
+ if (!SUPPORTED_TOKENS21.has(token)) {
14850
15808
  throw new Error(`dimension does not support child token "${token}"`);
14851
15809
  }
14852
15810
  if (arrayPropertyMap[token].length > 1) {
@@ -14917,7 +15875,7 @@ var TargetSize = class extends SxPrimitiveNumber {
14917
15875
  SxClass.register(TargetSize);
14918
15876
 
14919
15877
  // lib/sexpr/classes/Target.ts
14920
- var SUPPORTED_TOKENS21 = /* @__PURE__ */ new Set(["at", "size", "width", "layer", "uuid"]);
15878
+ var SUPPORTED_TOKENS22 = /* @__PURE__ */ new Set(["at", "size", "width", "layer", "uuid"]);
14921
15879
  var Target = class _Target extends SxClass {
14922
15880
  static token = "target";
14923
15881
  static parentToken = "kicad_pcb";
@@ -14940,7 +15898,7 @@ var Target = class _Target extends SxClass {
14940
15898
  const target = new _Target(rawShape);
14941
15899
  const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(rest, this.token);
14942
15900
  for (const token of Object.keys(arrayPropertyMap)) {
14943
- if (!SUPPORTED_TOKENS21.has(token)) {
15901
+ if (!SUPPORTED_TOKENS22.has(token)) {
14944
15902
  throw new Error(`target does not support child token "${token}"`);
14945
15903
  }
14946
15904
  if (arrayPropertyMap[token].length > 1) {
@@ -15735,39 +16693,6 @@ var Segment = class _Segment extends SxClass {
15735
16693
  };
15736
16694
  SxClass.register(Segment);
15737
16695
 
15738
- // lib/sexpr/classes/Layers.ts
15739
- var Layers = class _Layers extends SxClass {
15740
- static token = "layers";
15741
- token = "layers";
15742
- _names = [];
15743
- constructor(names = []) {
15744
- super();
15745
- this.names = names;
15746
- }
15747
- static fromSexprPrimitives(primitiveSexprs) {
15748
- const names = primitiveSexprs.map(
15749
- (primitive) => typeof primitive === "string" || typeof primitive === "number" ? String(primitive) : printSExpr(primitive)
15750
- );
15751
- return new _Layers(names);
15752
- }
15753
- get names() {
15754
- return [...this._names];
15755
- }
15756
- set names(values) {
15757
- this._names = values.map((value) => String(value));
15758
- }
15759
- getString() {
15760
- const rendered = this._names.map((name) => {
15761
- if (/^[^\s()"]+$/u.test(name) && !["nil", "#t", "#f"].includes(name)) {
15762
- return name;
15763
- }
15764
- return quoteSExprString(name);
15765
- }).join(" ");
15766
- return `(layers ${rendered})`;
15767
- }
15768
- };
15769
- SxClass.register(Layers);
15770
-
15771
16696
  // lib/sexpr/classes/Setup/base.ts
15772
16697
  var SingleValueProperty = class extends SxClass {
15773
16698
  _value;
@@ -17887,7 +18812,7 @@ var PcbGeneralLegacyTeardrops = class _PcbGeneralLegacyTeardrops extends SxClass
17887
18812
  SxClass.register(PcbGeneralLegacyTeardrops);
17888
18813
 
17889
18814
  // lib/sexpr/classes/PcbGeneral.ts
17890
- var SINGLE_TOKENS3 = /* @__PURE__ */ new Set(["thickness", "legacy_teardrops"]);
18815
+ var SINGLE_TOKENS6 = /* @__PURE__ */ new Set(["thickness", "legacy_teardrops"]);
17891
18816
  var PcbGeneral = class _PcbGeneral extends SxClass {
17892
18817
  static token = "general";
17893
18818
  static parentToken = "kicad_pcb";
@@ -17898,14 +18823,14 @@ var PcbGeneral = class _PcbGeneral extends SxClass {
17898
18823
  const general = new _PcbGeneral();
17899
18824
  const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(primitiveSexprs, this.token);
17900
18825
  for (const token of Object.keys(propertyMap)) {
17901
- if (!SINGLE_TOKENS3.has(token)) {
18826
+ if (!SINGLE_TOKENS6.has(token)) {
17902
18827
  throw new Error(
17903
18828
  `general encountered unsupported child token "${token}"`
17904
18829
  );
17905
18830
  }
17906
18831
  }
17907
18832
  for (const [token, entries] of Object.entries(arrayPropertyMap)) {
17908
- if (!SINGLE_TOKENS3.has(token)) {
18833
+ if (!SINGLE_TOKENS6.has(token)) {
17909
18834
  throw new Error(
17910
18835
  `general encountered unsupported child token "${token}"`
17911
18836
  );
@@ -19364,6 +20289,36 @@ export {
19364
20289
  Wire,
19365
20290
  Xy,
19366
20291
  Zone,
20292
+ ZoneAttr,
20293
+ ZoneAttrTeardrop,
20294
+ ZoneAttrTeardropType,
20295
+ ZoneConnectPads,
20296
+ ZoneConnectPadsClearance,
20297
+ ZoneFill,
20298
+ ZoneFillIslandAreaMin,
20299
+ ZoneFillIslandRemovalMode,
20300
+ ZoneFillRadius,
20301
+ ZoneFillSmoothing,
20302
+ ZoneFillThermalBridgeWidth,
20303
+ ZoneFillThermalGap,
20304
+ ZoneFilledAreasThickness,
20305
+ ZoneFilledPolygon,
20306
+ ZoneHatch,
20307
+ ZoneKeepout,
20308
+ ZoneKeepoutCopperpour,
20309
+ ZoneKeepoutFootprints,
20310
+ ZoneKeepoutPads,
20311
+ ZoneKeepoutTracks,
20312
+ ZoneKeepoutVias,
20313
+ ZoneMinThickness,
20314
+ ZoneName,
20315
+ ZoneNet,
20316
+ ZoneNetName,
20317
+ ZonePlacement,
20318
+ ZonePlacementEnabled,
20319
+ ZonePlacementSheetname,
20320
+ ZonePolygon,
20321
+ ZonePriority,
19367
20322
  parseKicadMod,
19368
20323
  parseKicadPcb,
19369
20324
  parseKicadSch,