kicadts 0.0.37 → 0.0.39

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 +139 -48
  2. package/dist/index.js +600 -263
  3. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -8140,7 +8140,8 @@ var NUMERIC_TOKENS = /* @__PURE__ */ new Map([
8140
8140
  ["max_length", "maxLength"],
8141
8141
  ["best_width_ratio", "bestWidthRatio"],
8142
8142
  ["max_width", "maxWidth"],
8143
- ["filter_ratio", "filterRatio"]
8143
+ ["filter_ratio", "filterRatio"],
8144
+ ["curve_points", "curvePoints"]
8144
8145
  ]);
8145
8146
  var BOOLEAN_TOKENS = /* @__PURE__ */ new Map([
8146
8147
  ["curved_edges", "curvedEdges"],
@@ -8157,6 +8158,7 @@ var PadTeardrops = class _PadTeardrops extends SxClass {
8157
8158
  _bestWidthRatio;
8158
8159
  _maxWidth;
8159
8160
  _filterRatio;
8161
+ _curvePoints;
8160
8162
  _curvedEdges;
8161
8163
  _enabled;
8162
8164
  _allowTwoSegments;
@@ -8231,6 +8233,12 @@ var PadTeardrops = class _PadTeardrops extends SxClass {
8231
8233
  set filterRatio(value) {
8232
8234
  this._filterRatio = value;
8233
8235
  }
8236
+ get curvePoints() {
8237
+ return this._curvePoints;
8238
+ }
8239
+ set curvePoints(value) {
8240
+ this._curvePoints = value;
8241
+ }
8234
8242
  get curvedEdges() {
8235
8243
  return this._curvedEdges;
8236
8244
  }
@@ -8278,6 +8286,9 @@ var PadTeardrops = class _PadTeardrops extends SxClass {
8278
8286
  if (this._filterRatio !== void 0) {
8279
8287
  lines.push(` (filter_ratio ${this._filterRatio})`);
8280
8288
  }
8289
+ if (this._curvePoints !== void 0) {
8290
+ lines.push(` (curve_points ${this._curvePoints})`);
8291
+ }
8281
8292
  if (this._enabled !== void 0) {
8282
8293
  lines.push(` (enabled ${this._enabled ? "yes" : "no"})`);
8283
8294
  }
@@ -10493,6 +10504,225 @@ var FpArcEnd = class _FpArcEnd extends SxClass {
10493
10504
  };
10494
10505
  SxClass.register(FpArcEnd);
10495
10506
 
10507
+ // lib/sexpr/classes/FpCurve.ts
10508
+ var SUPPORTED_TOKENS14 = /* @__PURE__ */ new Set([
10509
+ "pts",
10510
+ "xy",
10511
+ "layer",
10512
+ "width",
10513
+ "stroke",
10514
+ "tstamp",
10515
+ "uuid",
10516
+ "locked"
10517
+ ]);
10518
+ var FpCurve = class _FpCurve extends SxClass {
10519
+ static token = "fp_curve";
10520
+ static parentToken = "footprint";
10521
+ token = "fp_curve";
10522
+ _sxPts;
10523
+ _sxLayer;
10524
+ _sxWidth;
10525
+ _sxStroke;
10526
+ _sxTstamp;
10527
+ _sxUuid;
10528
+ _locked = false;
10529
+ constructor(params = {}) {
10530
+ super();
10531
+ if (params.points !== void 0) this.points = params.points;
10532
+ if (params.layer !== void 0) this.layer = params.layer;
10533
+ if (params.width !== void 0) this.width = params.width;
10534
+ if (params.stroke !== void 0) this.stroke = params.stroke;
10535
+ if (params.tstamp !== void 0) this.tstamp = params.tstamp;
10536
+ if (params.uuid !== void 0) this.uuid = params.uuid;
10537
+ if (params.locked !== void 0) this.locked = params.locked;
10538
+ }
10539
+ static fromSexprPrimitives(primitiveSexprs) {
10540
+ const fpCurve = new _FpCurve();
10541
+ const structuredPrimitives = [];
10542
+ for (const primitive of primitiveSexprs) {
10543
+ if (typeof primitive === "string") {
10544
+ if (primitive === "locked") {
10545
+ if (fpCurve._locked) {
10546
+ throw new Error("fp_curve encountered duplicate locked flags");
10547
+ }
10548
+ fpCurve._locked = true;
10549
+ continue;
10550
+ }
10551
+ throw new Error(`fp_curve encountered unsupported flag "${primitive}"`);
10552
+ }
10553
+ if (!Array.isArray(primitive) || primitive.length === 0) {
10554
+ throw new Error(
10555
+ `fp_curve encountered invalid child expression: ${JSON.stringify(primitive)}`
10556
+ );
10557
+ }
10558
+ structuredPrimitives.push(primitive);
10559
+ }
10560
+ const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(structuredPrimitives, this.token);
10561
+ for (const token of Object.keys(propertyMap)) {
10562
+ if (!SUPPORTED_TOKENS14.has(token)) {
10563
+ throw new Error(
10564
+ `fp_curve encountered unsupported child token "${token}"`
10565
+ );
10566
+ }
10567
+ }
10568
+ for (const [token, entries] of Object.entries(arrayPropertyMap)) {
10569
+ if (!SUPPORTED_TOKENS14.has(token)) {
10570
+ throw new Error(
10571
+ `fp_curve encountered unsupported child token "${token}"`
10572
+ );
10573
+ }
10574
+ if (token !== "xy" && entries.length > 1) {
10575
+ throw new Error(
10576
+ `fp_curve does not support repeated child token "${token}"`
10577
+ );
10578
+ }
10579
+ }
10580
+ const ptsEntries = arrayPropertyMap.pts;
10581
+ const xyEntries = arrayPropertyMap.xy;
10582
+ let pts = propertyMap.pts;
10583
+ if (pts && xyEntries && xyEntries.length > 0) {
10584
+ throw new Error("fp_curve cannot mix pts and xy child tokens");
10585
+ }
10586
+ if (!pts && ptsEntries?.length) {
10587
+ pts = ptsEntries[0];
10588
+ }
10589
+ if (!pts && xyEntries && xyEntries.length > 0) {
10590
+ pts = new Pts(xyEntries);
10591
+ }
10592
+ fpCurve._sxPts = pts;
10593
+ fpCurve._sxLayer = propertyMap.layer;
10594
+ fpCurve._sxWidth = propertyMap.width;
10595
+ fpCurve._sxStroke = propertyMap.stroke;
10596
+ fpCurve._sxTstamp = propertyMap.tstamp;
10597
+ fpCurve._sxUuid = propertyMap.uuid;
10598
+ const locked = propertyMap.locked;
10599
+ fpCurve._locked = fpCurve._locked || (locked?.value ?? false);
10600
+ if (!fpCurve._sxPts) {
10601
+ throw new Error("fp_curve requires pts or xy child tokens");
10602
+ }
10603
+ if (!fpCurve._sxLayer) {
10604
+ throw new Error("fp_curve requires a layer child token");
10605
+ }
10606
+ return fpCurve;
10607
+ }
10608
+ get points() {
10609
+ return this._sxPts;
10610
+ }
10611
+ set points(value) {
10612
+ if (value === void 0) {
10613
+ this._sxPts = void 0;
10614
+ return;
10615
+ }
10616
+ if (value instanceof Pts) {
10617
+ this._sxPts = value;
10618
+ return;
10619
+ }
10620
+ if (Array.isArray(value) && value.every((point) => point instanceof Xy)) {
10621
+ this._sxPts = new Pts(value);
10622
+ return;
10623
+ }
10624
+ if (Array.isArray(value)) {
10625
+ this._sxPts = new Pts(value.map(({ x, y }) => new Xy(x, y)));
10626
+ return;
10627
+ }
10628
+ throw new Error("Unsupported points value provided to fp_curve");
10629
+ }
10630
+ get layer() {
10631
+ return this._sxLayer;
10632
+ }
10633
+ set layer(value) {
10634
+ if (value === void 0) {
10635
+ this._sxLayer = void 0;
10636
+ return;
10637
+ }
10638
+ if (value instanceof Layer) {
10639
+ this._sxLayer = value;
10640
+ return;
10641
+ }
10642
+ const names = Array.isArray(value) ? value : [value];
10643
+ this._sxLayer = new Layer(names);
10644
+ }
10645
+ get width() {
10646
+ return this._sxWidth?.value;
10647
+ }
10648
+ set width(value) {
10649
+ if (value === void 0) {
10650
+ this._sxWidth = void 0;
10651
+ return;
10652
+ }
10653
+ this._sxWidth = value instanceof Width ? value : new Width(value);
10654
+ }
10655
+ get stroke() {
10656
+ return this._sxStroke;
10657
+ }
10658
+ set stroke(value) {
10659
+ this._sxStroke = value;
10660
+ }
10661
+ get tstamp() {
10662
+ return this._sxTstamp;
10663
+ }
10664
+ set tstamp(value) {
10665
+ if (value === void 0) {
10666
+ this._sxTstamp = void 0;
10667
+ return;
10668
+ }
10669
+ this._sxTstamp = value instanceof Tstamp ? value : new Tstamp(value);
10670
+ }
10671
+ get uuid() {
10672
+ return this._sxUuid;
10673
+ }
10674
+ set uuid(value) {
10675
+ if (value === void 0) {
10676
+ this._sxUuid = void 0;
10677
+ return;
10678
+ }
10679
+ this._sxUuid = value instanceof Uuid ? value : new Uuid(value);
10680
+ }
10681
+ get locked() {
10682
+ return this._locked;
10683
+ }
10684
+ set locked(value) {
10685
+ this._locked = value;
10686
+ }
10687
+ getChildren() {
10688
+ const children = [];
10689
+ if (this._sxPts) children.push(this._sxPts);
10690
+ if (this._sxStroke) {
10691
+ children.push(this._sxStroke);
10692
+ } else if (this._sxWidth) {
10693
+ children.push(this._sxWidth);
10694
+ }
10695
+ if (this._sxLayer) children.push(this._sxLayer);
10696
+ if (this._sxTstamp) children.push(this._sxTstamp);
10697
+ if (this._sxUuid) children.push(this._sxUuid);
10698
+ if (this._locked) children.push(new FpCurveLocked(true));
10699
+ return children;
10700
+ }
10701
+ };
10702
+ SxClass.register(FpCurve);
10703
+ var FpCurveLocked = class _FpCurveLocked extends SxClass {
10704
+ constructor(value = true) {
10705
+ super();
10706
+ this.value = value;
10707
+ }
10708
+ value;
10709
+ static token = "locked";
10710
+ static parentToken = "fp_curve";
10711
+ token = "locked";
10712
+ static fromSexprPrimitives(primitiveSexprs) {
10713
+ if (primitiveSexprs.length === 0) {
10714
+ return new _FpCurveLocked(true);
10715
+ }
10716
+ return new _FpCurveLocked(
10717
+ primitiveSexprs[0] === true || primitiveSexprs[0] === "yes" || primitiveSexprs[0] === "true"
10718
+ );
10719
+ }
10720
+ getString() {
10721
+ return "(locked)";
10722
+ }
10723
+ };
10724
+ SxClass.register(FpCurveLocked);
10725
+
10496
10726
  // lib/sexpr/classes/FpPolyFill.ts
10497
10727
  var truthyStrings = /* @__PURE__ */ new Set(["yes", "true", "1", "solid"]);
10498
10728
  var FpPolyFill = class _FpPolyFill extends SxClass {
@@ -10562,7 +10792,7 @@ var FpPolyLocked = class _FpPolyLocked extends SxPrimitiveBoolean {
10562
10792
  SxClass.register(FpPolyLocked);
10563
10793
 
10564
10794
  // lib/sexpr/classes/FpPoly.ts
10565
- var SUPPORTED_TOKENS14 = /* @__PURE__ */ new Set([
10795
+ var SUPPORTED_TOKENS15 = /* @__PURE__ */ new Set([
10566
10796
  "pts",
10567
10797
  "xy",
10568
10798
  "layer",
@@ -10600,12 +10830,12 @@ var FpPoly = class _FpPoly extends SxClass {
10600
10830
  const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(primitiveSexprs, this.token);
10601
10831
  const unexpectedTokens = /* @__PURE__ */ new Set();
10602
10832
  for (const token of Object.keys(propertyMap)) {
10603
- if (!SUPPORTED_TOKENS14.has(token)) {
10833
+ if (!SUPPORTED_TOKENS15.has(token)) {
10604
10834
  unexpectedTokens.add(token);
10605
10835
  }
10606
10836
  }
10607
10837
  for (const token of Object.keys(arrayPropertyMap)) {
10608
- if (!SUPPORTED_TOKENS14.has(token)) {
10838
+ if (!SUPPORTED_TOKENS15.has(token)) {
10609
10839
  unexpectedTokens.add(token);
10610
10840
  }
10611
10841
  if (token !== "xy" && arrayPropertyMap[token].length > 1) {
@@ -10659,7 +10889,7 @@ var FpPoly = class _FpPoly extends SxClass {
10659
10889
  `fp_poly child token must be a string, received: ${JSON.stringify(token)}`
10660
10890
  );
10661
10891
  }
10662
- if (!SUPPORTED_TOKENS14.has(token)) {
10892
+ if (!SUPPORTED_TOKENS15.has(token)) {
10663
10893
  throw new Error(
10664
10894
  `Unsupported child token inside fp_poly expression: ${token}`
10665
10895
  );
@@ -10798,58 +11028,222 @@ var FpPoly = class _FpPoly extends SxClass {
10798
11028
  };
10799
11029
  SxClass.register(FpPoly);
10800
11030
 
10801
- // lib/sexpr/classes/FootprintSheetname.ts
10802
- var FootprintSheetname = class _FootprintSheetname extends SxClass {
10803
- static token = "sheetname";
10804
- static parentToken = "footprint";
10805
- token = "sheetname";
10806
- _value;
10807
- constructor(value) {
10808
- super();
10809
- this._value = value;
10810
- }
10811
- static fromSexprPrimitives(primitiveSexprs) {
10812
- const value = toStringValue(primitiveSexprs[0]);
10813
- if (value === void 0) {
10814
- throw new Error("sheetname expects a string value");
10815
- }
10816
- return new _FootprintSheetname(value);
10817
- }
10818
- get value() {
10819
- return this._value;
10820
- }
10821
- set value(value) {
10822
- this._value = value;
10823
- }
10824
- getChildren() {
10825
- return [];
10826
- }
10827
- getString() {
10828
- return `(sheetname ${quoteSExprString(this._value)})`;
10829
- }
10830
- };
10831
- SxClass.register(FootprintSheetname);
10832
-
10833
- // lib/sexpr/classes/FootprintSheetfile.ts
10834
- var FootprintSheetfile = class _FootprintSheetfile extends SxClass {
10835
- static token = "sheetfile";
10836
- static parentToken = "footprint";
10837
- token = "sheetfile";
10838
- _value;
10839
- constructor(value) {
11031
+ // lib/sexpr/classes/Group.ts
11032
+ var SUPPORTED_SINGLE_TOKENS4 = /* @__PURE__ */ new Set(["uuid", "locked", "members"]);
11033
+ var Group = class _Group extends SxClass {
11034
+ static token = "group";
11035
+ token = "group";
11036
+ _name = "";
11037
+ _sxUuid;
11038
+ _sxLocked;
11039
+ _sxMembers;
11040
+ constructor(params = {}) {
10840
11041
  super();
10841
- this._value = value;
11042
+ if (params.name !== void 0) this.name = params.name;
11043
+ if (params.uuid !== void 0) this.uuid = params.uuid;
11044
+ if (params.locked !== void 0) this.locked = params.locked;
11045
+ if (params.members !== void 0) this.members = params.members;
10842
11046
  }
10843
11047
  static fromSexprPrimitives(primitiveSexprs) {
10844
- const value = toStringValue(primitiveSexprs[0]);
10845
- if (value === void 0) {
10846
- throw new Error("sheetfile expects a string value");
11048
+ const group = new _Group();
11049
+ if (primitiveSexprs.length > 0 && typeof primitiveSexprs[0] === "string") {
11050
+ group._name = primitiveSexprs[0];
10847
11051
  }
10848
- return new _FootprintSheetfile(value);
10849
- }
10850
- get value() {
10851
- return this._value;
10852
- }
11052
+ const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(
11053
+ primitiveSexprs.slice(1),
11054
+ this.token
11055
+ );
11056
+ const unexpectedTokens = /* @__PURE__ */ new Set();
11057
+ for (const token of Object.keys(propertyMap)) {
11058
+ if (!SUPPORTED_SINGLE_TOKENS4.has(token)) {
11059
+ unexpectedTokens.add(token);
11060
+ }
11061
+ }
11062
+ for (const token of Object.keys(arrayPropertyMap)) {
11063
+ if (!SUPPORTED_SINGLE_TOKENS4.has(token)) {
11064
+ unexpectedTokens.add(token);
11065
+ continue;
11066
+ }
11067
+ if (arrayPropertyMap[token].length > 1) {
11068
+ throw new Error(
11069
+ `group does not support repeated child tokens: ${token}`
11070
+ );
11071
+ }
11072
+ }
11073
+ if (unexpectedTokens.size > 0) {
11074
+ throw new Error(
11075
+ `Unsupported child tokens inside group expression: ${[...unexpectedTokens].join(", ")}`
11076
+ );
11077
+ }
11078
+ for (const primitive of primitiveSexprs.slice(1)) {
11079
+ if (Array.isArray(primitive)) continue;
11080
+ throw new Error(
11081
+ `group encountered unexpected primitive child: ${JSON.stringify(primitive)}`
11082
+ );
11083
+ }
11084
+ group._sxUuid = propertyMap.uuid;
11085
+ const locked = propertyMap.locked;
11086
+ group._sxLocked = locked && locked.value ? locked : void 0;
11087
+ group._sxMembers = propertyMap.members;
11088
+ return group;
11089
+ }
11090
+ get name() {
11091
+ return this._name;
11092
+ }
11093
+ set name(value) {
11094
+ this._name = value;
11095
+ }
11096
+ get uuid() {
11097
+ return this._sxUuid?.value;
11098
+ }
11099
+ set uuid(value) {
11100
+ if (value === void 0) {
11101
+ this._sxUuid = void 0;
11102
+ return;
11103
+ }
11104
+ this._sxUuid = value instanceof Uuid ? value : new Uuid(value);
11105
+ }
11106
+ get uuidClass() {
11107
+ return this._sxUuid;
11108
+ }
11109
+ get locked() {
11110
+ return this._sxLocked?.value ?? false;
11111
+ }
11112
+ set locked(value) {
11113
+ this._sxLocked = value ? new GroupLocked(true) : void 0;
11114
+ }
11115
+ get members() {
11116
+ return this._sxMembers?.members ?? [];
11117
+ }
11118
+ set members(value) {
11119
+ this._sxMembers = new GroupMembers(value);
11120
+ }
11121
+ get membersClass() {
11122
+ return this._sxMembers;
11123
+ }
11124
+ getChildren() {
11125
+ const children = [];
11126
+ if (this._sxUuid) children.push(this._sxUuid);
11127
+ if (this._sxLocked) children.push(this._sxLocked);
11128
+ if (this._sxMembers) children.push(this._sxMembers);
11129
+ return children;
11130
+ }
11131
+ getString() {
11132
+ const lines = [`(group "${this._name}"`];
11133
+ const push = (value) => {
11134
+ if (!value) return;
11135
+ lines.push(value.getStringIndented());
11136
+ };
11137
+ push(this._sxUuid);
11138
+ push(this._sxLocked);
11139
+ push(this._sxMembers);
11140
+ lines.push(")");
11141
+ return lines.join("\n");
11142
+ }
11143
+ };
11144
+ SxClass.register(Group);
11145
+ var GroupLocked = class _GroupLocked extends SxClass {
11146
+ static token = "locked";
11147
+ static parentToken = "group";
11148
+ token = "locked";
11149
+ value;
11150
+ constructor(value) {
11151
+ super();
11152
+ this.value = value;
11153
+ }
11154
+ static fromSexprPrimitives(primitiveSexprs) {
11155
+ if (primitiveSexprs.length === 0) {
11156
+ return new _GroupLocked(true);
11157
+ }
11158
+ const state = toStringValue(primitiveSexprs[0]);
11159
+ return new _GroupLocked(state === "yes");
11160
+ }
11161
+ getString() {
11162
+ return this.value ? "(locked yes)" : "(locked no)";
11163
+ }
11164
+ };
11165
+ SxClass.register(GroupLocked);
11166
+ var GroupMembers = class _GroupMembers extends SxClass {
11167
+ static token = "members";
11168
+ static parentToken = "group";
11169
+ token = "members";
11170
+ members;
11171
+ constructor(members) {
11172
+ super();
11173
+ this.members = members;
11174
+ }
11175
+ static fromSexprPrimitives(primitiveSexprs) {
11176
+ const members = [];
11177
+ for (const primitive of primitiveSexprs) {
11178
+ const str = toStringValue(primitive);
11179
+ if (str) {
11180
+ members.push(str);
11181
+ }
11182
+ }
11183
+ return new _GroupMembers(members);
11184
+ }
11185
+ getString() {
11186
+ if (this.members.length === 0) {
11187
+ return "(members)";
11188
+ }
11189
+ const memberStrings = this.members.map((m) => `"${m}"`).join(" ");
11190
+ return `(members ${memberStrings})`;
11191
+ }
11192
+ };
11193
+ SxClass.register(GroupMembers);
11194
+
11195
+ // lib/sexpr/classes/FootprintSheetname.ts
11196
+ var FootprintSheetname = class _FootprintSheetname extends SxClass {
11197
+ static token = "sheetname";
11198
+ static parentToken = "footprint";
11199
+ token = "sheetname";
11200
+ _value;
11201
+ constructor(value) {
11202
+ super();
11203
+ this._value = value;
11204
+ }
11205
+ static fromSexprPrimitives(primitiveSexprs) {
11206
+ const value = toStringValue(primitiveSexprs[0]);
11207
+ if (value === void 0) {
11208
+ throw new Error("sheetname expects a string value");
11209
+ }
11210
+ return new _FootprintSheetname(value);
11211
+ }
11212
+ get value() {
11213
+ return this._value;
11214
+ }
11215
+ set value(value) {
11216
+ this._value = value;
11217
+ }
11218
+ getChildren() {
11219
+ return [];
11220
+ }
11221
+ getString() {
11222
+ return `(sheetname ${quoteSExprString(this._value)})`;
11223
+ }
11224
+ };
11225
+ SxClass.register(FootprintSheetname);
11226
+
11227
+ // lib/sexpr/classes/FootprintSheetfile.ts
11228
+ var FootprintSheetfile = class _FootprintSheetfile extends SxClass {
11229
+ static token = "sheetfile";
11230
+ static parentToken = "footprint";
11231
+ token = "sheetfile";
11232
+ _value;
11233
+ constructor(value) {
11234
+ super();
11235
+ this._value = value;
11236
+ }
11237
+ static fromSexprPrimitives(primitiveSexprs) {
11238
+ const value = toStringValue(primitiveSexprs[0]);
11239
+ if (value === void 0) {
11240
+ throw new Error("sheetfile expects a string value");
11241
+ }
11242
+ return new _FootprintSheetfile(value);
11243
+ }
11244
+ get value() {
11245
+ return this._value;
11246
+ }
10853
11247
  set value(value) {
10854
11248
  this._value = value;
10855
11249
  }
@@ -10889,7 +11283,7 @@ var FpLineNet = class _FpLineNet extends SxClass {
10889
11283
  SxClass.register(FpLineNet);
10890
11284
 
10891
11285
  // lib/sexpr/classes/FpLine.ts
10892
- var SUPPORTED_SINGLE_TOKENS4 = /* @__PURE__ */ new Set([
11286
+ var SUPPORTED_SINGLE_TOKENS5 = /* @__PURE__ */ new Set([
10893
11287
  "start",
10894
11288
  "end",
10895
11289
  "layer",
@@ -10947,14 +11341,14 @@ var FpLine = class _FpLine extends SxClass {
10947
11341
  }
10948
11342
  const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(structuredPrimitives, this.token);
10949
11343
  for (const token of Object.keys(propertyMap)) {
10950
- if (!SUPPORTED_SINGLE_TOKENS4.has(token)) {
11344
+ if (!SUPPORTED_SINGLE_TOKENS5.has(token)) {
10951
11345
  throw new Error(
10952
11346
  `fp_line encountered unsupported child token "${token}"`
10953
11347
  );
10954
11348
  }
10955
11349
  }
10956
11350
  for (const [token, entries] of Object.entries(arrayPropertyMap)) {
10957
- if (!SUPPORTED_SINGLE_TOKENS4.has(token)) {
11351
+ if (!SUPPORTED_SINGLE_TOKENS5.has(token)) {
10958
11352
  throw new Error(
10959
11353
  `fp_line encountered unsupported child token "${token}"`
10960
11354
  );
@@ -11479,7 +11873,7 @@ var EmbeddedFileType = class _EmbeddedFileType extends SxClass {
11479
11873
  SxClass.register(EmbeddedFileType);
11480
11874
 
11481
11875
  // lib/sexpr/classes/EmbeddedFile.ts
11482
- var SUPPORTED_SINGLE_TOKENS5 = /* @__PURE__ */ new Set(["name", "type", "checksum", "data"]);
11876
+ var SUPPORTED_SINGLE_TOKENS6 = /* @__PURE__ */ new Set(["name", "type", "checksum", "data"]);
11483
11877
  var EmbeddedFile = class _EmbeddedFile extends SxClass {
11484
11878
  static token = "file";
11485
11879
  static parentToken = "embedded_files";
@@ -11499,12 +11893,12 @@ var EmbeddedFile = class _EmbeddedFile extends SxClass {
11499
11893
  const embeddedFile = new _EmbeddedFile();
11500
11894
  const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(primitiveSexprs, this.token);
11501
11895
  for (const token of Object.keys(propertyMap)) {
11502
- if (!SUPPORTED_SINGLE_TOKENS5.has(token)) {
11896
+ if (!SUPPORTED_SINGLE_TOKENS6.has(token)) {
11503
11897
  throw new Error(`file encountered unsupported child token "${token}"`);
11504
11898
  }
11505
11899
  }
11506
11900
  for (const [token, entries] of Object.entries(arrayPropertyMap)) {
11507
- if (!SUPPORTED_SINGLE_TOKENS5.has(token)) {
11901
+ if (!SUPPORTED_SINGLE_TOKENS6.has(token)) {
11508
11902
  throw new Error(`file encountered unsupported child token "${token}"`);
11509
11903
  }
11510
11904
  if (entries.length > 1) {
@@ -12205,12 +12599,14 @@ var ZoneFilledPolygon = class _ZoneFilledPolygon extends SxClass {
12205
12599
  super();
12206
12600
  if (params.layer !== void 0) this.layer = params.layer;
12207
12601
  if (params.pts !== void 0) this.pts = params.pts;
12602
+ if (params.island !== void 0) this.island = params.island;
12208
12603
  }
12604
+ _island = false;
12209
12605
  static fromSexprPrimitives(primitiveSexprs) {
12210
12606
  const polygon = new _ZoneFilledPolygon();
12211
12607
  const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(primitiveSexprs, this.token);
12212
12608
  for (const [token, entries] of Object.entries(arrayPropertyMap)) {
12213
- if (token !== "layer" && token !== "pts") {
12609
+ if (token !== "layer" && token !== "pts" && token !== "island") {
12214
12610
  throw new Error(
12215
12611
  `zone filled_polygon encountered unsupported child "${token}"`
12216
12612
  );
@@ -12223,6 +12619,8 @@ var ZoneFilledPolygon = class _ZoneFilledPolygon extends SxClass {
12223
12619
  }
12224
12620
  polygon._sxLayer = propertyMap.layer;
12225
12621
  polygon._sxPts = propertyMap.pts;
12622
+ const island = propertyMap.island;
12623
+ polygon._island = island?.value ?? false;
12226
12624
  return polygon;
12227
12625
  }
12228
12626
  get layer() {
@@ -12237,14 +12635,38 @@ var ZoneFilledPolygon = class _ZoneFilledPolygon extends SxClass {
12237
12635
  set pts(value) {
12238
12636
  this._sxPts = value;
12239
12637
  }
12638
+ get island() {
12639
+ return this._island;
12640
+ }
12641
+ set island(value) {
12642
+ this._island = value;
12643
+ }
12240
12644
  getChildren() {
12241
12645
  const children = [];
12242
12646
  if (this._sxLayer) children.push(this._sxLayer);
12647
+ if (this._island) children.push(new ZoneFilledPolygonIsland(true));
12243
12648
  if (this._sxPts) children.push(this._sxPts);
12244
12649
  return children;
12245
12650
  }
12246
12651
  };
12247
12652
  SxClass.register(ZoneFilledPolygon);
12653
+ var ZoneFilledPolygonIsland = class _ZoneFilledPolygonIsland extends SxClass {
12654
+ constructor(value = true) {
12655
+ super();
12656
+ this.value = value;
12657
+ }
12658
+ value;
12659
+ static token = "island";
12660
+ static parentToken = "filled_polygon";
12661
+ token = "island";
12662
+ static fromSexprPrimitives() {
12663
+ return new _ZoneFilledPolygonIsland(true);
12664
+ }
12665
+ getString() {
12666
+ return "(island)";
12667
+ }
12668
+ };
12669
+ SxClass.register(ZoneFilledPolygonIsland);
12248
12670
 
12249
12671
  // lib/sexpr/classes/ZoneHatch.ts
12250
12672
  var ZoneHatch = class _ZoneHatch extends SxClass {
@@ -12567,7 +12989,7 @@ var SINGLE_TOKENS4 = /* @__PURE__ */ new Set([
12567
12989
  "fill"
12568
12990
  ]);
12569
12991
  var MULTI_TOKENS2 = /* @__PURE__ */ new Set(["polygon", "filled_polygon"]);
12570
- var SUPPORTED_TOKENS15 = /* @__PURE__ */ new Set([...SINGLE_TOKENS4, ...MULTI_TOKENS2]);
12992
+ var SUPPORTED_TOKENS16 = /* @__PURE__ */ new Set([...SINGLE_TOKENS4, ...MULTI_TOKENS2]);
12571
12993
  var Zone = class _Zone extends SxClass {
12572
12994
  static token = "zone";
12573
12995
  token = "zone";
@@ -12624,7 +13046,7 @@ var Zone = class _Zone extends SxClass {
12624
13046
  }
12625
13047
  const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(primitiveSexprs, this.token);
12626
13048
  for (const [token, entries] of Object.entries(arrayPropertyMap)) {
12627
- if (!SUPPORTED_TOKENS15.has(token)) {
13049
+ if (!SUPPORTED_TOKENS16.has(token)) {
12628
13050
  throw new Error(`zone encountered unsupported child token "${token}"`);
12629
13051
  }
12630
13052
  if (!MULTI_TOKENS2.has(token) && entries.length > 1) {
@@ -12844,13 +13266,15 @@ var MULTI_TOKENS3 = /* @__PURE__ */ new Set([
12844
13266
  "fp_rect",
12845
13267
  "fp_circle",
12846
13268
  "fp_arc",
13269
+ "fp_curve",
12847
13270
  "fp_poly",
12848
13271
  "point",
12849
13272
  "pad",
12850
13273
  "model",
12851
- "zone"
13274
+ "zone",
13275
+ "group"
12852
13276
  ]);
12853
- var SUPPORTED_TOKENS16 = /* @__PURE__ */ new Set([...SINGLE_TOKENS5, ...MULTI_TOKENS3]);
13277
+ var SUPPORTED_TOKENS17 = /* @__PURE__ */ new Set([...SINGLE_TOKENS5, ...MULTI_TOKENS3]);
12854
13278
  var Footprint = class _Footprint extends SxClass {
12855
13279
  static token = "footprint";
12856
13280
  token = "footprint";
@@ -12894,11 +13318,13 @@ var Footprint = class _Footprint extends SxClass {
12894
13318
  _fpRects = [];
12895
13319
  _fpCircles = [];
12896
13320
  _fpArcs = [];
13321
+ _fpCurves = [];
12897
13322
  _fpPolys = [];
12898
13323
  _points = [];
12899
13324
  _fpPads = [];
12900
13325
  _models = [];
12901
13326
  _zones = [];
13327
+ _groups = [];
12902
13328
  constructor(params = {}) {
12903
13329
  super();
12904
13330
  if (params.libraryLink !== void 0) this.libraryLink = params.libraryLink;
@@ -12952,11 +13378,13 @@ var Footprint = class _Footprint extends SxClass {
12952
13378
  if (params.fpRects !== void 0) this.fpRects = params.fpRects;
12953
13379
  if (params.fpCircles !== void 0) this.fpCircles = params.fpCircles;
12954
13380
  if (params.fpArcs !== void 0) this.fpArcs = params.fpArcs;
13381
+ if (params.fpCurves !== void 0) this.fpCurves = params.fpCurves;
12955
13382
  if (params.fpPolys !== void 0) this.fpPolys = params.fpPolys;
12956
13383
  if (params.points !== void 0) this.points = params.points;
12957
13384
  if (params.pads !== void 0) this.fpPads = params.pads;
12958
13385
  if (params.models !== void 0) this.models = params.models;
12959
13386
  if (params.zones !== void 0) this.zones = params.zones;
13387
+ if (params.groups !== void 0) this.groups = params.groups;
12960
13388
  }
12961
13389
  static fromSexprPrimitives(primitiveSexprs) {
12962
13390
  const footprint = new _Footprint();
@@ -12982,14 +13410,14 @@ var Footprint = class _Footprint extends SxClass {
12982
13410
  }
12983
13411
  const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(rawNodes, this.token);
12984
13412
  for (const token of Object.keys(propertyMap)) {
12985
- if (!SUPPORTED_TOKENS16.has(token)) {
13413
+ if (!SUPPORTED_TOKENS17.has(token)) {
12986
13414
  throw new Error(
12987
13415
  `footprint encountered unsupported child token "${token}"`
12988
13416
  );
12989
13417
  }
12990
13418
  }
12991
13419
  for (const [token, entries] of Object.entries(arrayPropertyMap)) {
12992
- if (!SUPPORTED_TOKENS16.has(token)) {
13420
+ if (!SUPPORTED_TOKENS17.has(token)) {
12993
13421
  throw new Error(
12994
13422
  `footprint encountered unsupported child token "${token}"`
12995
13423
  );
@@ -13048,11 +13476,13 @@ var Footprint = class _Footprint extends SxClass {
13048
13476
  footprint._fpRects = arrayPropertyMap["fp_rect"] ?? [];
13049
13477
  footprint._fpCircles = arrayPropertyMap["fp_circle"] ?? [];
13050
13478
  footprint._fpArcs = arrayPropertyMap["fp_arc"] ?? [];
13479
+ footprint._fpCurves = arrayPropertyMap["fp_curve"] ?? [];
13051
13480
  footprint._fpPolys = arrayPropertyMap["fp_poly"] ?? [];
13052
13481
  footprint._points = arrayPropertyMap.point ?? [];
13053
13482
  footprint._fpPads = arrayPropertyMap.pad ?? [];
13054
13483
  footprint._models = arrayPropertyMap.model ?? [];
13055
13484
  footprint._zones = arrayPropertyMap.zone ?? [];
13485
+ footprint._groups = arrayPropertyMap.group ?? [];
13056
13486
  for (const flag of pendingFlags) {
13057
13487
  if (flag === "locked") {
13058
13488
  if (footprint._sxLocked) {
@@ -13439,6 +13869,12 @@ var Footprint = class _Footprint extends SxClass {
13439
13869
  set fpArcs(value) {
13440
13870
  this._fpArcs = [...value];
13441
13871
  }
13872
+ get fpCurves() {
13873
+ return [...this._fpCurves];
13874
+ }
13875
+ set fpCurves(value) {
13876
+ this._fpCurves = [...value];
13877
+ }
13442
13878
  get fpPolys() {
13443
13879
  return [...this._fpPolys];
13444
13880
  }
@@ -13469,6 +13905,12 @@ var Footprint = class _Footprint extends SxClass {
13469
13905
  set zones(value) {
13470
13906
  this._zones = [...value];
13471
13907
  }
13908
+ get groups() {
13909
+ return [...this._groups];
13910
+ }
13911
+ set groups(value) {
13912
+ this._groups = [...value];
13913
+ }
13472
13914
  getChildren() {
13473
13915
  const children = [];
13474
13916
  if (this._sxVersion) children.push(this._sxVersion);
@@ -13512,11 +13954,13 @@ var Footprint = class _Footprint extends SxClass {
13512
13954
  children.push(...this._fpRects);
13513
13955
  children.push(...this._fpCircles);
13514
13956
  children.push(...this._fpArcs);
13957
+ children.push(...this._fpCurves);
13515
13958
  children.push(...this._fpPolys);
13516
13959
  children.push(...this._points);
13517
13960
  children.push(...this._fpPads);
13518
13961
  children.push(...this._models);
13519
13962
  children.push(...this._zones);
13963
+ children.push(...this._groups);
13520
13964
  return children;
13521
13965
  }
13522
13966
  getString() {
@@ -13562,7 +14006,7 @@ var GrArcLocked = class _GrArcLocked extends SxPrimitiveBoolean {
13562
14006
  SxClass.register(GrArcLocked);
13563
14007
 
13564
14008
  // lib/sexpr/classes/GrArc.ts
13565
- var SUPPORTED_SINGLE_TOKENS6 = /* @__PURE__ */ new Set([
14009
+ var SUPPORTED_SINGLE_TOKENS7 = /* @__PURE__ */ new Set([
13566
14010
  "start",
13567
14011
  "mid",
13568
14012
  "end",
@@ -13602,12 +14046,12 @@ var GrArc = class _GrArc extends SxClass {
13602
14046
  const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(primitiveSexprs, this.token);
13603
14047
  const unexpectedTokens = /* @__PURE__ */ new Set();
13604
14048
  for (const token of Object.keys(propertyMap)) {
13605
- if (!SUPPORTED_SINGLE_TOKENS6.has(token)) {
14049
+ if (!SUPPORTED_SINGLE_TOKENS7.has(token)) {
13606
14050
  unexpectedTokens.add(token);
13607
14051
  }
13608
14052
  }
13609
14053
  for (const token of Object.keys(arrayPropertyMap)) {
13610
- if (!SUPPORTED_SINGLE_TOKENS6.has(token)) {
14054
+ if (!SUPPORTED_SINGLE_TOKENS7.has(token)) {
13611
14055
  unexpectedTokens.add(token);
13612
14056
  continue;
13613
14057
  }
@@ -13879,7 +14323,7 @@ var GrArcEnd = class _GrArcEnd extends SxClass {
13879
14323
  SxClass.register(GrArcEnd);
13880
14324
 
13881
14325
  // lib/sexpr/classes/GrCircle.ts
13882
- var SUPPORTED_SINGLE_TOKENS7 = /* @__PURE__ */ new Set([
14326
+ var SUPPORTED_SINGLE_TOKENS8 = /* @__PURE__ */ new Set([
13883
14327
  "center",
13884
14328
  "end",
13885
14329
  "layer",
@@ -13919,12 +14363,12 @@ var GrCircle = class _GrCircle extends SxClass {
13919
14363
  const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(primitiveSexprs, this.token);
13920
14364
  const unexpectedTokens = /* @__PURE__ */ new Set();
13921
14365
  for (const token of Object.keys(propertyMap)) {
13922
- if (!SUPPORTED_SINGLE_TOKENS7.has(token)) {
14366
+ if (!SUPPORTED_SINGLE_TOKENS8.has(token)) {
13923
14367
  unexpectedTokens.add(token);
13924
14368
  }
13925
14369
  }
13926
14370
  for (const token of Object.keys(arrayPropertyMap)) {
13927
- if (!SUPPORTED_SINGLE_TOKENS7.has(token)) {
14371
+ if (!SUPPORTED_SINGLE_TOKENS8.has(token)) {
13928
14372
  unexpectedTokens.add(token);
13929
14373
  continue;
13930
14374
  }
@@ -14189,7 +14633,7 @@ var GrCircleLocked = class _GrCircleLocked extends SxClass {
14189
14633
  SxClass.register(GrCircleLocked);
14190
14634
 
14191
14635
  // lib/sexpr/classes/GrCurve.ts
14192
- var SUPPORTED_TOKENS17 = /* @__PURE__ */ new Set([
14636
+ var SUPPORTED_TOKENS18 = /* @__PURE__ */ new Set([
14193
14637
  "pts",
14194
14638
  "xy",
14195
14639
  "layer",
@@ -14221,12 +14665,12 @@ var GrCurve = class _GrCurve extends SxClass {
14221
14665
  const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(primitiveSexprs, this.token);
14222
14666
  const unexpectedTokens = /* @__PURE__ */ new Set();
14223
14667
  for (const token of Object.keys(propertyMap)) {
14224
- if (!SUPPORTED_TOKENS17.has(token)) {
14668
+ if (!SUPPORTED_TOKENS18.has(token)) {
14225
14669
  unexpectedTokens.add(token);
14226
14670
  }
14227
14671
  }
14228
14672
  for (const token of Object.keys(arrayPropertyMap)) {
14229
- if (!SUPPORTED_TOKENS17.has(token)) {
14673
+ if (!SUPPORTED_TOKENS18.has(token)) {
14230
14674
  unexpectedTokens.add(token);
14231
14675
  continue;
14232
14676
  }
@@ -14419,7 +14863,7 @@ var GrLineLocked = class _GrLineLocked extends SxPrimitiveBoolean {
14419
14863
  SxClass.register(GrLineLocked);
14420
14864
 
14421
14865
  // lib/sexpr/classes/GrLine.ts
14422
- var SUPPORTED_SINGLE_TOKENS8 = /* @__PURE__ */ new Set([
14866
+ var SUPPORTED_SINGLE_TOKENS9 = /* @__PURE__ */ new Set([
14423
14867
  "start",
14424
14868
  "end",
14425
14869
  "angle",
@@ -14459,12 +14903,12 @@ var GrLine = class _GrLine extends SxClass {
14459
14903
  const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(primitiveSexprs, this.token);
14460
14904
  const unexpectedTokens = /* @__PURE__ */ new Set();
14461
14905
  for (const token of Object.keys(propertyMap)) {
14462
- if (!SUPPORTED_SINGLE_TOKENS8.has(token)) {
14906
+ if (!SUPPORTED_SINGLE_TOKENS9.has(token)) {
14463
14907
  unexpectedTokens.add(token);
14464
14908
  }
14465
14909
  }
14466
14910
  for (const token of Object.keys(arrayPropertyMap)) {
14467
- if (!SUPPORTED_SINGLE_TOKENS8.has(token)) {
14911
+ if (!SUPPORTED_SINGLE_TOKENS9.has(token)) {
14468
14912
  unexpectedTokens.add(token);
14469
14913
  continue;
14470
14914
  }
@@ -14632,7 +15076,7 @@ var GrLine = class _GrLine extends SxClass {
14632
15076
  SxClass.register(GrLine);
14633
15077
 
14634
15078
  // lib/sexpr/classes/GrRect.ts
14635
- var SUPPORTED_SINGLE_TOKENS9 = /* @__PURE__ */ new Set([
15079
+ var SUPPORTED_SINGLE_TOKENS10 = /* @__PURE__ */ new Set([
14636
15080
  "start",
14637
15081
  "end",
14638
15082
  "layer",
@@ -14669,12 +15113,12 @@ var GrRect = class _GrRect extends SxClass {
14669
15113
  const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(primitiveSexprs, this.token);
14670
15114
  const unexpectedTokens = /* @__PURE__ */ new Set();
14671
15115
  for (const token of Object.keys(propertyMap)) {
14672
- if (!SUPPORTED_SINGLE_TOKENS9.has(token)) {
15116
+ if (!SUPPORTED_SINGLE_TOKENS10.has(token)) {
14673
15117
  unexpectedTokens.add(token);
14674
15118
  }
14675
15119
  }
14676
15120
  for (const token of Object.keys(arrayPropertyMap)) {
14677
- if (!SUPPORTED_SINGLE_TOKENS9.has(token)) {
15121
+ if (!SUPPORTED_SINGLE_TOKENS10.has(token)) {
14678
15122
  unexpectedTokens.add(token);
14679
15123
  continue;
14680
15124
  }
@@ -14971,14 +15415,15 @@ var GrRectLocked = class _GrRectLocked extends SxClass {
14971
15415
  SxClass.register(GrRectLocked);
14972
15416
 
14973
15417
  // lib/sexpr/classes/GrText.ts
14974
- var SUPPORTED_SINGLE_TOKENS10 = /* @__PURE__ */ new Set([
15418
+ var SUPPORTED_SINGLE_TOKENS11 = /* @__PURE__ */ new Set([
14975
15419
  "at",
14976
15420
  "xy",
14977
15421
  "layer",
14978
15422
  "tstamp",
14979
15423
  "uuid",
14980
15424
  "effects",
14981
- "render_cache"
15425
+ "render_cache",
15426
+ "locked"
14982
15427
  ]);
14983
15428
  var SUPPORTED_ARRAY_TOKENS3 = /* @__PURE__ */ new Set([
14984
15429
  "at",
@@ -14987,7 +15432,8 @@ var SUPPORTED_ARRAY_TOKENS3 = /* @__PURE__ */ new Set([
14987
15432
  "tstamp",
14988
15433
  "uuid",
14989
15434
  "effects",
14990
- "render_cache"
15435
+ "render_cache",
15436
+ "locked"
14991
15437
  ]);
14992
15438
  var GrText = class _GrText extends SxClass {
14993
15439
  static token = "gr_text";
@@ -14999,6 +15445,7 @@ var GrText = class _GrText extends SxClass {
14999
15445
  _sxUuid;
15000
15446
  _sxEffects;
15001
15447
  _renderCaches = [];
15448
+ _locked = false;
15002
15449
  constructor(params = {}) {
15003
15450
  super();
15004
15451
  if (typeof params === "string") {
@@ -15012,6 +15459,7 @@ var GrText = class _GrText extends SxClass {
15012
15459
  if (params.effects !== void 0) this.effects = params.effects;
15013
15460
  if (params.renderCaches !== void 0)
15014
15461
  this.renderCaches = params.renderCaches;
15462
+ if (params.locked !== void 0) this.locked = params.locked;
15015
15463
  }
15016
15464
  }
15017
15465
  static fromSexprPrimitives(primitiveSexprs) {
@@ -15024,10 +15472,21 @@ var GrText = class _GrText extends SxClass {
15024
15472
  throw new Error("gr_text text must be a string value");
15025
15473
  }
15026
15474
  const grText = new _GrText(text);
15027
- const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(rest, this.token);
15475
+ const structuredRest = [];
15476
+ for (const primitive of rest) {
15477
+ if (primitive === "locked") {
15478
+ if (grText._locked) {
15479
+ throw new Error("gr_text encountered duplicate locked flags");
15480
+ }
15481
+ grText._locked = true;
15482
+ continue;
15483
+ }
15484
+ structuredRest.push(primitive);
15485
+ }
15486
+ const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(structuredRest, this.token);
15028
15487
  const unexpectedTokens = /* @__PURE__ */ new Set();
15029
15488
  for (const token of Object.keys(propertyMap)) {
15030
- if (!SUPPORTED_SINGLE_TOKENS10.has(token)) {
15489
+ if (!SUPPORTED_SINGLE_TOKENS11.has(token)) {
15031
15490
  unexpectedTokens.add(token);
15032
15491
  }
15033
15492
  }
@@ -15047,7 +15506,7 @@ var GrText = class _GrText extends SxClass {
15047
15506
  `Unsupported child tokens inside gr_text expression: ${[...unexpectedTokens].join(", ")}`
15048
15507
  );
15049
15508
  }
15050
- for (const primitive of rest) {
15509
+ for (const primitive of structuredRest) {
15051
15510
  if (Array.isArray(primitive)) continue;
15052
15511
  throw new Error(
15053
15512
  `gr_text encountered unexpected primitive child: ${JSON.stringify(primitive)}`
@@ -15063,6 +15522,8 @@ var GrText = class _GrText extends SxClass {
15063
15522
  grText._sxTstamp = propertyMap.tstamp;
15064
15523
  grText._sxUuid = propertyMap.uuid;
15065
15524
  grText._sxEffects = propertyMap.effects;
15525
+ const locked = propertyMap.locked;
15526
+ grText._locked = grText._locked || (locked?.value ?? false);
15066
15527
  const renderCaches = arrayPropertyMap.render_cache;
15067
15528
  if (renderCaches && renderCaches.length > 0) {
15068
15529
  grText._renderCaches = renderCaches;
@@ -15157,6 +15618,12 @@ var GrText = class _GrText extends SxClass {
15157
15618
  set renderCaches(value) {
15158
15619
  this._renderCaches = [...value];
15159
15620
  }
15621
+ get locked() {
15622
+ return this._locked;
15623
+ }
15624
+ set locked(value) {
15625
+ this._locked = value;
15626
+ }
15160
15627
  getChildren() {
15161
15628
  const children = [];
15162
15629
  if (this._sxPosition) children.push(this._sxPosition);
@@ -15164,6 +15631,7 @@ var GrText = class _GrText extends SxClass {
15164
15631
  if (this._sxTstamp) children.push(this._sxTstamp);
15165
15632
  if (this._sxUuid) children.push(this._sxUuid);
15166
15633
  if (this._sxEffects) children.push(this._sxEffects);
15634
+ if (this._locked) children.push(new GrTextLocked(true));
15167
15635
  children.push(...this._renderCaches);
15168
15636
  return children;
15169
15637
  }
@@ -15177,6 +15645,27 @@ var GrText = class _GrText extends SxClass {
15177
15645
  }
15178
15646
  };
15179
15647
  SxClass.register(GrText);
15648
+ var GrTextLocked = class _GrTextLocked extends SxClass {
15649
+ constructor(value = true) {
15650
+ super();
15651
+ this.value = value;
15652
+ }
15653
+ value;
15654
+ static token = "locked";
15655
+ static parentToken = "gr_text";
15656
+ token = "locked";
15657
+ static fromSexprPrimitives(primitiveSexprs) {
15658
+ if (primitiveSexprs.length === 0) {
15659
+ return new _GrTextLocked(true);
15660
+ }
15661
+ const parsed = parseYesNo(primitiveSexprs[0]);
15662
+ return new _GrTextLocked(parsed ?? false);
15663
+ }
15664
+ getString() {
15665
+ return "(locked)";
15666
+ }
15667
+ };
15668
+ SxClass.register(GrTextLocked);
15180
15669
  var GrTextRenderCache = class _GrTextRenderCache extends SxClass {
15181
15670
  static token = "render_cache";
15182
15671
  static parentToken = "gr_text";
@@ -15330,7 +15819,7 @@ var GrPolyFill = class _GrPolyFill extends SxClass {
15330
15819
  }
15331
15820
  };
15332
15821
  SxClass.register(GrPolyFill);
15333
- var SUPPORTED_TOKENS18 = /* @__PURE__ */ new Set([
15822
+ var SUPPORTED_TOKENS19 = /* @__PURE__ */ new Set([
15334
15823
  "pts",
15335
15824
  "xy",
15336
15825
  "layer",
@@ -15365,12 +15854,12 @@ var GrPoly = class _GrPoly extends SxClass {
15365
15854
  const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(primitiveSexprs, this.token);
15366
15855
  const unexpectedTokens = /* @__PURE__ */ new Set();
15367
15856
  for (const token of Object.keys(propertyMap)) {
15368
- if (!SUPPORTED_TOKENS18.has(token)) {
15857
+ if (!SUPPORTED_TOKENS19.has(token)) {
15369
15858
  unexpectedTokens.add(token);
15370
15859
  }
15371
15860
  }
15372
15861
  for (const token of Object.keys(arrayPropertyMap)) {
15373
- if (!SUPPORTED_TOKENS18.has(token)) {
15862
+ if (!SUPPORTED_TOKENS19.has(token)) {
15374
15863
  unexpectedTokens.add(token);
15375
15864
  }
15376
15865
  if (token !== "xy" && arrayPropertyMap[token].length > 1) {
@@ -15416,7 +15905,7 @@ var GrPoly = class _GrPoly extends SxClass {
15416
15905
  `gr_poly child token must be a string, received: ${JSON.stringify(token)}`
15417
15906
  );
15418
15907
  }
15419
- if (!SUPPORTED_TOKENS18.has(token)) {
15908
+ if (!SUPPORTED_TOKENS19.has(token)) {
15420
15909
  throw new Error(
15421
15910
  `Unsupported child token inside gr_poly expression: ${token}`
15422
15911
  );
@@ -15607,7 +16096,7 @@ var DimensionFormatUnitsFormat = class extends SxPrimitiveNumber {
15607
16096
  SxClass.register(DimensionFormatUnitsFormat);
15608
16097
 
15609
16098
  // lib/sexpr/classes/DimensionFormat.ts
15610
- var SUPPORTED_TOKENS19 = /* @__PURE__ */ new Set([
16099
+ var SUPPORTED_TOKENS20 = /* @__PURE__ */ new Set([
15611
16100
  "prefix",
15612
16101
  "suffix",
15613
16102
  "units",
@@ -15631,7 +16120,7 @@ var DimensionFormat = class _DimensionFormat extends SxClass {
15631
16120
  const format = new _DimensionFormat();
15632
16121
  const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(primitiveSexprs, this.token);
15633
16122
  for (const token of Object.keys(arrayPropertyMap)) {
15634
- if (!SUPPORTED_TOKENS19.has(token)) {
16123
+ if (!SUPPORTED_TOKENS20.has(token)) {
15635
16124
  throw new Error(`format does not support child token "${token}"`);
15636
16125
  }
15637
16126
  if (arrayPropertyMap[token].length > 1) {
@@ -15791,7 +16280,7 @@ var DimensionTextPositionMode = class extends SxPrimitiveNumber {
15791
16280
  SxClass.register(DimensionTextPositionMode);
15792
16281
 
15793
16282
  // lib/sexpr/classes/DimensionStyle.ts
15794
- var SUPPORTED_TOKENS20 = /* @__PURE__ */ new Set([
16283
+ var SUPPORTED_TOKENS21 = /* @__PURE__ */ new Set([
15795
16284
  "thickness",
15796
16285
  "arrow_length",
15797
16286
  "text_position_mode",
@@ -15817,7 +16306,7 @@ var DimensionStyle = class _DimensionStyle extends SxClass {
15817
16306
  const style = new _DimensionStyle();
15818
16307
  const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(primitiveSexprs, this.token);
15819
16308
  for (const token of Object.keys(arrayPropertyMap)) {
15820
- if (!SUPPORTED_TOKENS20.has(token)) {
16309
+ if (!SUPPORTED_TOKENS21.has(token)) {
15821
16310
  throw new Error(`style does not support child token "${token}"`);
15822
16311
  }
15823
16312
  if (arrayPropertyMap[token].length > 1) {
@@ -15826,8 +16315,13 @@ var DimensionStyle = class _DimensionStyle extends SxClass {
15826
16315
  );
15827
16316
  }
15828
16317
  }
16318
+ let hasBareKeepTextAligned = false;
15829
16319
  for (const primitive of primitiveSexprs) {
15830
16320
  if (!Array.isArray(primitive)) {
16321
+ if (primitive === "keep_text_aligned") {
16322
+ hasBareKeepTextAligned = true;
16323
+ continue;
16324
+ }
15831
16325
  throw new Error(
15832
16326
  `style encountered unexpected primitive child ${JSON.stringify(primitive)}`
15833
16327
  );
@@ -15841,6 +16335,9 @@ var DimensionStyle = class _DimensionStyle extends SxClass {
15841
16335
  style._sxTextFrame = propertyMap.text_frame;
15842
16336
  style._sxExtensionOffset = propertyMap.extension_offset;
15843
16337
  style._sxKeepTextAligned = propertyMap.keep_text_aligned;
16338
+ if (hasBareKeepTextAligned) {
16339
+ style._sxKeepTextAligned = new DimensionKeepTextAligned(true);
16340
+ }
15844
16341
  if (!style._sxThickness) {
15845
16342
  throw new Error("style requires a thickness child token");
15846
16343
  }
@@ -15876,7 +16373,7 @@ var DimensionType = class extends SxPrimitiveString {
15876
16373
  SxClass.register(DimensionType);
15877
16374
 
15878
16375
  // lib/sexpr/classes/Dimension.ts
15879
- var SUPPORTED_TOKENS21 = /* @__PURE__ */ new Set([
16376
+ var SUPPORTED_TOKENS22 = /* @__PURE__ */ new Set([
15880
16377
  "locked",
15881
16378
  "type",
15882
16379
  "layer",
@@ -15908,7 +16405,7 @@ var Dimension = class _Dimension extends SxClass {
15908
16405
  const dimension = new _Dimension();
15909
16406
  const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(primitiveSexprs, this.token);
15910
16407
  for (const token of Object.keys(arrayPropertyMap)) {
15911
- if (!SUPPORTED_TOKENS21.has(token)) {
16408
+ if (!SUPPORTED_TOKENS22.has(token)) {
15912
16409
  throw new Error(`dimension does not support child token "${token}"`);
15913
16410
  }
15914
16411
  if (arrayPropertyMap[token].length > 1) {
@@ -15979,7 +16476,7 @@ var TargetSize = class extends SxPrimitiveNumber {
15979
16476
  SxClass.register(TargetSize);
15980
16477
 
15981
16478
  // lib/sexpr/classes/Target.ts
15982
- var SUPPORTED_TOKENS22 = /* @__PURE__ */ new Set(["at", "size", "width", "layer", "uuid"]);
16479
+ var SUPPORTED_TOKENS23 = /* @__PURE__ */ new Set(["at", "size", "width", "layer", "uuid"]);
15983
16480
  var Target = class _Target extends SxClass {
15984
16481
  static token = "target";
15985
16482
  static parentToken = "kicad_pcb";
@@ -16002,7 +16499,7 @@ var Target = class _Target extends SxClass {
16002
16499
  const target = new _Target(rawShape);
16003
16500
  const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(rest, this.token);
16004
16501
  for (const token of Object.keys(arrayPropertyMap)) {
16005
- if (!SUPPORTED_TOKENS22.has(token)) {
16502
+ if (!SUPPORTED_TOKENS23.has(token)) {
16006
16503
  throw new Error(`target does not support child token "${token}"`);
16007
16504
  }
16008
16505
  if (arrayPropertyMap[token].length > 1) {
@@ -16064,170 +16561,6 @@ var Target = class _Target extends SxClass {
16064
16561
  };
16065
16562
  SxClass.register(Target);
16066
16563
 
16067
- // lib/sexpr/classes/Group.ts
16068
- var SUPPORTED_SINGLE_TOKENS11 = /* @__PURE__ */ new Set(["uuid", "locked", "members"]);
16069
- var Group = class _Group extends SxClass {
16070
- static token = "group";
16071
- token = "group";
16072
- _name = "";
16073
- _sxUuid;
16074
- _sxLocked;
16075
- _sxMembers;
16076
- constructor(params = {}) {
16077
- super();
16078
- if (params.name !== void 0) this.name = params.name;
16079
- if (params.uuid !== void 0) this.uuid = params.uuid;
16080
- if (params.locked !== void 0) this.locked = params.locked;
16081
- if (params.members !== void 0) this.members = params.members;
16082
- }
16083
- static fromSexprPrimitives(primitiveSexprs) {
16084
- const group = new _Group();
16085
- if (primitiveSexprs.length > 0 && typeof primitiveSexprs[0] === "string") {
16086
- group._name = primitiveSexprs[0];
16087
- }
16088
- const { propertyMap, arrayPropertyMap } = SxClass.parsePrimitivesToClassProperties(
16089
- primitiveSexprs.slice(1),
16090
- this.token
16091
- );
16092
- const unexpectedTokens = /* @__PURE__ */ new Set();
16093
- for (const token of Object.keys(propertyMap)) {
16094
- if (!SUPPORTED_SINGLE_TOKENS11.has(token)) {
16095
- unexpectedTokens.add(token);
16096
- }
16097
- }
16098
- for (const token of Object.keys(arrayPropertyMap)) {
16099
- if (!SUPPORTED_SINGLE_TOKENS11.has(token)) {
16100
- unexpectedTokens.add(token);
16101
- continue;
16102
- }
16103
- if (arrayPropertyMap[token].length > 1) {
16104
- throw new Error(
16105
- `group does not support repeated child tokens: ${token}`
16106
- );
16107
- }
16108
- }
16109
- if (unexpectedTokens.size > 0) {
16110
- throw new Error(
16111
- `Unsupported child tokens inside group expression: ${[...unexpectedTokens].join(", ")}`
16112
- );
16113
- }
16114
- for (const primitive of primitiveSexprs.slice(1)) {
16115
- if (Array.isArray(primitive)) continue;
16116
- throw new Error(
16117
- `group encountered unexpected primitive child: ${JSON.stringify(primitive)}`
16118
- );
16119
- }
16120
- group._sxUuid = propertyMap.uuid;
16121
- const locked = propertyMap.locked;
16122
- group._sxLocked = locked && locked.value ? locked : void 0;
16123
- group._sxMembers = propertyMap.members;
16124
- return group;
16125
- }
16126
- get name() {
16127
- return this._name;
16128
- }
16129
- set name(value) {
16130
- this._name = value;
16131
- }
16132
- get uuid() {
16133
- return this._sxUuid?.value;
16134
- }
16135
- set uuid(value) {
16136
- if (value === void 0) {
16137
- this._sxUuid = void 0;
16138
- return;
16139
- }
16140
- this._sxUuid = value instanceof Uuid ? value : new Uuid(value);
16141
- }
16142
- get uuidClass() {
16143
- return this._sxUuid;
16144
- }
16145
- get locked() {
16146
- return this._sxLocked?.value ?? false;
16147
- }
16148
- set locked(value) {
16149
- this._sxLocked = value ? new GroupLocked(true) : void 0;
16150
- }
16151
- get members() {
16152
- return this._sxMembers?.members ?? [];
16153
- }
16154
- set members(value) {
16155
- this._sxMembers = new GroupMembers(value);
16156
- }
16157
- get membersClass() {
16158
- return this._sxMembers;
16159
- }
16160
- getChildren() {
16161
- const children = [];
16162
- if (this._sxUuid) children.push(this._sxUuid);
16163
- if (this._sxLocked) children.push(this._sxLocked);
16164
- if (this._sxMembers) children.push(this._sxMembers);
16165
- return children;
16166
- }
16167
- getString() {
16168
- const lines = [`(group "${this._name}"`];
16169
- const push = (value) => {
16170
- if (!value) return;
16171
- lines.push(value.getStringIndented());
16172
- };
16173
- push(this._sxUuid);
16174
- push(this._sxLocked);
16175
- push(this._sxMembers);
16176
- lines.push(")");
16177
- return lines.join("\n");
16178
- }
16179
- };
16180
- SxClass.register(Group);
16181
- var GroupLocked = class _GroupLocked extends SxClass {
16182
- static token = "locked";
16183
- static parentToken = "group";
16184
- token = "locked";
16185
- value;
16186
- constructor(value) {
16187
- super();
16188
- this.value = value;
16189
- }
16190
- static fromSexprPrimitives(primitiveSexprs) {
16191
- if (primitiveSexprs.length === 0) {
16192
- return new _GroupLocked(true);
16193
- }
16194
- const state = toStringValue(primitiveSexprs[0]);
16195
- return new _GroupLocked(state === "yes");
16196
- }
16197
- getString() {
16198
- return this.value ? "(locked yes)" : "(locked no)";
16199
- }
16200
- };
16201
- SxClass.register(GroupLocked);
16202
- var GroupMembers = class _GroupMembers extends SxClass {
16203
- static token = "members";
16204
- static parentToken = "group";
16205
- token = "members";
16206
- members;
16207
- constructor(members) {
16208
- super();
16209
- this.members = members;
16210
- }
16211
- static fromSexprPrimitives(primitiveSexprs) {
16212
- const members = [];
16213
- for (const primitive of primitiveSexprs) {
16214
- const str = toStringValue(primitive);
16215
- if (str) {
16216
- members.push(str);
16217
- }
16218
- }
16219
- return new _GroupMembers(members);
16220
- }
16221
- getString() {
16222
- if (this.members.length === 0) {
16223
- return "(members)";
16224
- }
16225
- const memberStrings = this.members.map((m) => `"${m}"`).join(" ");
16226
- return `(members ${memberStrings})`;
16227
- }
16228
- };
16229
- SxClass.register(GroupMembers);
16230
-
16231
16564
  // lib/sexpr/classes/Generated.ts
16232
16565
  var Generated = class _Generated extends SxClass {
16233
16566
  static token = "generated";
@@ -20111,6 +20444,8 @@ export {
20111
20444
  FpCircleEnd,
20112
20445
  FpCircleFill,
20113
20446
  FpCircleNet,
20447
+ FpCurve,
20448
+ FpCurveLocked,
20114
20449
  FpLine,
20115
20450
  FpLineEnd,
20116
20451
  FpLineNet,
@@ -20155,6 +20490,7 @@ export {
20155
20490
  GrRectLocked,
20156
20491
  GrRectStart,
20157
20492
  GrText,
20493
+ GrTextLocked,
20158
20494
  GrTextRenderCache,
20159
20495
  GrTextRenderCachePolygon,
20160
20496
  Group,
@@ -20444,6 +20780,7 @@ export {
20444
20780
  ZoneFillThermalGap,
20445
20781
  ZoneFilledAreasThickness,
20446
20782
  ZoneFilledPolygon,
20783
+ ZoneFilledPolygonIsland,
20447
20784
  ZoneHatch,
20448
20785
  ZoneKeepout,
20449
20786
  ZoneKeepoutCopperpour,