@danielx/civet 0.5.93 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.js CHANGED
@@ -385,6 +385,82 @@ var require_lib = __commonJS({
385
385
  return '"' + str.replace(/"/g, '\\"') + '"';
386
386
  }
387
387
  }
388
+ function lastAccessInCallExpression(exp) {
389
+ let children, i;
390
+ do {
391
+ ({ children } = exp);
392
+ i = children.length - 1;
393
+ while (i >= 0 && (children[i].type === "Call" || children[i].type === "NonNullAssertion" || children[i].type === "Optional"))
394
+ i--;
395
+ if (i < 0)
396
+ return;
397
+ } while (children[i].type === "MemberExpression" && (exp = children[i]));
398
+ return children[i];
399
+ }
400
+ function convertMethodToFunction(method) {
401
+ const { signature, block } = method;
402
+ let { modifier } = signature;
403
+ if (modifier) {
404
+ if (modifier.get || modifier.set) {
405
+ return;
406
+ } else if (modifier.async) {
407
+ modifier = [modifier.children[0][0], " function ", ...modifier.children.slice(1)];
408
+ } else {
409
+ modifier = ["function ", ...modifier.children];
410
+ }
411
+ } else {
412
+ modifier = "function ";
413
+ }
414
+ return {
415
+ ...signature,
416
+ id: signature.name,
417
+ type: "FunctionExpression",
418
+ children: [
419
+ [modifier, ...signature.children.slice(1)],
420
+ block
421
+ ],
422
+ block
423
+ };
424
+ }
425
+ function convertObjectToJSXAttributes(obj) {
426
+ const { properties } = obj;
427
+ const parts = [];
428
+ const rest = [];
429
+ for (let i = 0; i < properties.length; i++) {
430
+ if (i > 0)
431
+ parts.push(" ");
432
+ const part = properties[i];
433
+ switch (part.type) {
434
+ case "Identifier":
435
+ parts.push([part.name, "={", part.name, "}"]);
436
+ break;
437
+ case "Property":
438
+ if (part.name.type === "ComputedPropertyName") {
439
+ rest.push(part);
440
+ } else {
441
+ parts.push([part.name, "={", insertTrimmingSpace(part.value, ""), "}"]);
442
+ }
443
+ break;
444
+ case "SpreadProperty":
445
+ parts.push(["{", part.dots, part.value, "}"]);
446
+ break;
447
+ case "MethodDefinition":
448
+ const func = convertMethodToFunction(part);
449
+ if (func) {
450
+ parts.push([part.name, "={", convertMethodToFunction(part), "}"]);
451
+ } else {
452
+ rest.push(part);
453
+ }
454
+ break;
455
+ default:
456
+ throw new Error(`invalid object literal type in JSX attribute: ${part.type}`);
457
+ }
458
+ }
459
+ if (rest.length) {
460
+ parts.push(["{...{", ...rest, "}}"]);
461
+ }
462
+ return parts;
463
+ }
388
464
  function processCoffeeInterpolation(s, parts, e, $loc) {
389
465
  if (parts.length === 0 || parts.length === 1 && parts[0].token != null) {
390
466
  return {
@@ -533,6 +609,8 @@ var require_lib = __commonJS({
533
609
  module2.exports = {
534
610
  blockWithPrefix,
535
611
  clone,
612
+ convertMethodToFunction,
613
+ convertObjectToJSXAttributes,
536
614
  deepCopy,
537
615
  findAncestor,
538
616
  forRange,
@@ -548,6 +626,7 @@ var require_lib = __commonJS({
548
626
  hoistRefDecs,
549
627
  insertTrimmingSpace,
550
628
  isFunction,
629
+ lastAccessInCallExpression,
551
630
  literalValue,
552
631
  modifyString,
553
632
  processCoffeeInterpolation,
@@ -989,6 +1068,7 @@ ${input.slice(result.pos)}
989
1068
  NonPipelineArgumentPart,
990
1069
  BinaryOpExpression,
991
1070
  BinaryOpRHS,
1071
+ SingleLineBinaryOpRHS,
992
1072
  RHS,
993
1073
  ParenthesizedAssignment,
994
1074
  UnaryExpression,
@@ -1051,6 +1131,7 @@ ${input.slice(result.pos)}
1051
1131
  SliceParameters,
1052
1132
  PropertyAccess,
1053
1133
  PropertyGlob,
1134
+ PropertyBind,
1054
1135
  SuperProperty,
1055
1136
  MetaProperty,
1056
1137
  ReturnValue,
@@ -1063,6 +1144,7 @@ ${input.slice(result.pos)}
1063
1144
  BindingIdentifier,
1064
1145
  NWBindingIdentifier,
1065
1146
  AtIdentifierRef,
1147
+ PinPattern,
1066
1148
  BindingPattern,
1067
1149
  ObjectBindingPattern,
1068
1150
  ObjectBindingPatternContent,
@@ -1081,21 +1163,6 @@ ${input.slice(result.pos)}
1081
1163
  BindingElement,
1082
1164
  BindingRestElement,
1083
1165
  EmptyBindingPattern,
1084
- MatchingPattern,
1085
- ObjectMatchingPattern,
1086
- ObjectMatchingPatternContent,
1087
- NestedMatchingProperties,
1088
- MatchingPropertyList,
1089
- NestedMatchingPropertyList,
1090
- MatchingProperty,
1091
- MatchingRestProperty,
1092
- ArrayMatchingPattern,
1093
- ArrayMatchingPatternContent,
1094
- NestedMatchingElements,
1095
- MatchingElementList,
1096
- NestedMatchingElementList,
1097
- MatchingElement,
1098
- MatchingRestElement,
1099
1166
  FunctionDeclaration,
1100
1167
  FunctionSignature,
1101
1168
  FunctionExpression,
@@ -1257,6 +1324,10 @@ ${input.slice(result.pos)}
1257
1324
  AllowMultiLineImplicitObjectLiteral,
1258
1325
  RestoreMultiLineImplicitObjectLiteral,
1259
1326
  MultiLineImplicitObjectLiteralAllowed,
1327
+ AllowNewlineBinaryOp,
1328
+ ForbidNewlineBinaryOp,
1329
+ RestoreNewlineBinaryOp,
1330
+ NewlineBinaryOpAllowed,
1260
1331
  AllowAll,
1261
1332
  RestoreAll,
1262
1333
  ExpressionStatement,
@@ -1838,7 +1909,7 @@ ${input.slice(result.pos)}
1838
1909
  var $R48 = $R(new RegExp("(?!\\p{ID_Continue})", "suy"));
1839
1910
  var $R49 = $R(new RegExp("\\s", "suy"));
1840
1911
  var $R50 = $R(new RegExp("(?:\\p{ID_Start}|[_$])(?:\\p{ID_Continue}|[\\u200C\\u200D$-])*", "suy"));
1841
- var $R51 = $R(new RegExp("[\\s>]", "suy"));
1912
+ var $R51 = $R(new RegExp("[\\s>]|\\/>", "suy"));
1842
1913
  var $R52 = $R(new RegExp("(?:[\\w\\-:]+|\\([^()]*\\)|\\[[^\\[\\]]*\\])+", "suy"));
1843
1914
  var $R53 = $R(new RegExp(`"[^"]*"|'[^']*'`, "suy"));
1844
1915
  var $R54 = $R(new RegExp("[<>]", "suy"));
@@ -2671,7 +2742,13 @@ ${input.slice(result.pos)}
2671
2742
  var rhs = $2;
2672
2743
  return [[], op, [], rhs];
2673
2744
  });
2674
- var BinaryOpRHS$1 = $S(NotDedented, BinaryOp, $C(_, $S(EOS, __)), RHS);
2745
+ var BinaryOpRHS$1 = $T($S(NewlineBinaryOpAllowed, $S(NotDedented, BinaryOp, $C(_, $S(EOS, __)), RHS)), function(value) {
2746
+ var rhs = value[1];
2747
+ return rhs;
2748
+ });
2749
+ var BinaryOpRHS$2 = $T($S($N(NewlineBinaryOpAllowed), SingleLineBinaryOpRHS), function(value) {
2750
+ return value[1];
2751
+ });
2675
2752
  function BinaryOpRHS(state) {
2676
2753
  let eventData;
2677
2754
  if (state.events) {
@@ -2683,17 +2760,46 @@ ${input.slice(result.pos)}
2683
2760
  }
2684
2761
  }
2685
2762
  if (state.tokenize) {
2686
- const result = $TOKEN("BinaryOpRHS", state, BinaryOpRHS$0(state) || BinaryOpRHS$1(state));
2763
+ const result = $TOKEN("BinaryOpRHS", state, BinaryOpRHS$0(state) || BinaryOpRHS$1(state) || BinaryOpRHS$2(state));
2687
2764
  if (state.events)
2688
2765
  state.events.exit?.("BinaryOpRHS", state, result, eventData);
2689
2766
  return result;
2690
2767
  } else {
2691
- const result = BinaryOpRHS$0(state) || BinaryOpRHS$1(state);
2768
+ const result = BinaryOpRHS$0(state) || BinaryOpRHS$1(state) || BinaryOpRHS$2(state);
2692
2769
  if (state.events)
2693
2770
  state.events.exit?.("BinaryOpRHS", state, result, eventData);
2694
2771
  return result;
2695
2772
  }
2696
2773
  }
2774
+ var SingleLineBinaryOpRHS$0 = $TS($S($E(_), BinaryOp, $C(_, $S(EOS, __)), RHS), function($skip, $loc, $0, $1, $2, $3, $4) {
2775
+ var ws1 = $1;
2776
+ var op = $2;
2777
+ var ws2 = $3;
2778
+ var rhs = $4;
2779
+ return [ws1 || [], op, ws2, rhs];
2780
+ });
2781
+ function SingleLineBinaryOpRHS(state) {
2782
+ let eventData;
2783
+ if (state.events) {
2784
+ const result = state.events.enter?.("SingleLineBinaryOpRHS", state);
2785
+ if (result) {
2786
+ if (result.cache)
2787
+ return result.cache;
2788
+ eventData = result.data;
2789
+ }
2790
+ }
2791
+ if (state.tokenize) {
2792
+ const result = $TOKEN("SingleLineBinaryOpRHS", state, SingleLineBinaryOpRHS$0(state));
2793
+ if (state.events)
2794
+ state.events.exit?.("SingleLineBinaryOpRHS", state, result, eventData);
2795
+ return result;
2796
+ } else {
2797
+ const result = SingleLineBinaryOpRHS$0(state);
2798
+ if (state.events)
2799
+ state.events.exit?.("SingleLineBinaryOpRHS", state, result, eventData);
2800
+ return result;
2801
+ }
2802
+ }
2697
2803
  var RHS$0 = ParenthesizedAssignment;
2698
2804
  var RHS$1 = UnaryExpression;
2699
2805
  var RHS$2 = ExpressionizedStatement;
@@ -4147,14 +4253,14 @@ ${input.slice(result.pos)}
4147
4253
  }
4148
4254
  var CallExpression$0 = $TS($S($EXPECT($L14, fail, 'CallExpression "super"'), ArgumentsWithTrailingMemberExpressions, $Q(CallExpressionRest)), function($skip, $loc, $0, $1, $2, $3) {
4149
4255
  var rest = $3;
4150
- return module2.processGlob({
4256
+ return module2.processCallMemberExpression({
4151
4257
  type: "CallExpression",
4152
4258
  children: [$1, ...$2, ...rest.flat()]
4153
4259
  });
4154
4260
  });
4155
4261
  var CallExpression$1 = $TS($S($EXPECT($L15, fail, 'CallExpression "import"'), ArgumentsWithTrailingMemberExpressions, $Q(CallExpressionRest)), function($skip, $loc, $0, $1, $2, $3) {
4156
4262
  var rest = $3;
4157
- return module2.processGlob({
4263
+ return module2.processCallMemberExpression({
4158
4264
  type: "CallExpression",
4159
4265
  children: [$1, ...$2, ...rest.flat()]
4160
4266
  });
@@ -4165,7 +4271,7 @@ ${input.slice(result.pos)}
4165
4271
  var rest = $3;
4166
4272
  if (rest.length || trailing.length) {
4167
4273
  rest = rest.flat();
4168
- return module2.processGlob({
4274
+ return module2.processCallMemberExpression({
4169
4275
  type: "CallExpression",
4170
4276
  children: [member, ...trailing, ...rest]
4171
4277
  });
@@ -4308,7 +4414,7 @@ ${input.slice(result.pos)}
4308
4414
  var MemberExpression$0 = $TS($S($C(PrimaryExpression, SuperProperty, MetaProperty), $Q(MemberExpressionRest)), function($skip, $loc, $0, $1, $2) {
4309
4415
  var rest = $2;
4310
4416
  if (rest.length || Array.isArray($1)) {
4311
- return module2.processGlob({
4417
+ return module2.processCallMemberExpression({
4312
4418
  type: "MemberExpression",
4313
4419
  children: [$1, ...rest].flat()
4314
4420
  });
@@ -4348,7 +4454,8 @@ ${input.slice(result.pos)}
4348
4454
  });
4349
4455
  var MemberExpressionRest$1 = PropertyAccess;
4350
4456
  var MemberExpressionRest$2 = PropertyGlob;
4351
- var MemberExpressionRest$3 = NonNullAssertion;
4457
+ var MemberExpressionRest$3 = PropertyBind;
4458
+ var MemberExpressionRest$4 = NonNullAssertion;
4352
4459
  function MemberExpressionRest(state) {
4353
4460
  let eventData;
4354
4461
  if (state.events) {
@@ -4360,12 +4467,12 @@ ${input.slice(result.pos)}
4360
4467
  }
4361
4468
  }
4362
4469
  if (state.tokenize) {
4363
- const result = $TOKEN("MemberExpressionRest", state, MemberExpressionRest$0(state) || MemberExpressionRest$1(state) || MemberExpressionRest$2(state) || MemberExpressionRest$3(state));
4470
+ const result = $TOKEN("MemberExpressionRest", state, MemberExpressionRest$0(state) || MemberExpressionRest$1(state) || MemberExpressionRest$2(state) || MemberExpressionRest$3(state) || MemberExpressionRest$4(state));
4364
4471
  if (state.events)
4365
4472
  state.events.exit?.("MemberExpressionRest", state, result, eventData);
4366
4473
  return result;
4367
4474
  } else {
4368
- const result = MemberExpressionRest$0(state) || MemberExpressionRest$1(state) || MemberExpressionRest$2(state) || MemberExpressionRest$3(state);
4475
+ const result = MemberExpressionRest$0(state) || MemberExpressionRest$1(state) || MemberExpressionRest$2(state) || MemberExpressionRest$3(state) || MemberExpressionRest$4(state);
4369
4476
  if (state.events)
4370
4477
  state.events.exit?.("MemberExpressionRest", state, result, eventData);
4371
4478
  return result;
@@ -4575,9 +4682,11 @@ ${input.slice(result.pos)}
4575
4682
  }
4576
4683
  }
4577
4684
  var PropertyGlob$0 = $TS($S(OptionalDot, BracedObjectLiteral), function($skip, $loc, $0, $1, $2) {
4685
+ var dot = $1;
4578
4686
  var object = $2;
4579
4687
  return {
4580
4688
  type: "PropertyGlob",
4689
+ dot,
4581
4690
  object,
4582
4691
  children: $0
4583
4692
  };
@@ -4604,6 +4713,38 @@ ${input.slice(result.pos)}
4604
4713
  return result;
4605
4714
  }
4606
4715
  }
4716
+ var PropertyBind$0 = $TS($S($E($C(QuestionMark, NonNullAssertion)), At, OptionalDot, $C(IdentifierName, PrivateIdentifier)), function($skip, $loc, $0, $1, $2, $3, $4) {
4717
+ var modifier = $1;
4718
+ var dot = $3;
4719
+ var id = $4;
4720
+ return {
4721
+ type: "PropertyBind",
4722
+ name: id.name,
4723
+ children: [modifier, dot, id]
4724
+ };
4725
+ });
4726
+ function PropertyBind(state) {
4727
+ let eventData;
4728
+ if (state.events) {
4729
+ const result = state.events.enter?.("PropertyBind", state);
4730
+ if (result) {
4731
+ if (result.cache)
4732
+ return result.cache;
4733
+ eventData = result.data;
4734
+ }
4735
+ }
4736
+ if (state.tokenize) {
4737
+ const result = $TOKEN("PropertyBind", state, PropertyBind$0(state));
4738
+ if (state.events)
4739
+ state.events.exit?.("PropertyBind", state, result, eventData);
4740
+ return result;
4741
+ } else {
4742
+ const result = PropertyBind$0(state);
4743
+ if (state.events)
4744
+ state.events.exit?.("PropertyBind", state, result, eventData);
4745
+ return result;
4746
+ }
4747
+ }
4607
4748
  var SuperProperty$0 = $S($EXPECT($L14, fail, 'SuperProperty "super"'), MemberBracketContent);
4608
4749
  var SuperProperty$1 = $S($EXPECT($L14, fail, 'SuperProperty "super"'), $N($C(QuestionMark, NonNullAssertion)), PropertyAccess);
4609
4750
  function SuperProperty(state) {
@@ -4996,20 +5137,41 @@ ${input.slice(result.pos)}
4996
5137
  return result;
4997
5138
  }
4998
5139
  }
4999
- var BindingPattern$0 = $TS($S(__, ObjectBindingPattern), function($skip, $loc, $0, $1, $2) {
5000
- var p = $2;
5001
- return {
5002
- children: [...$1, p],
5003
- names: p.names
5004
- };
5005
- });
5006
- var BindingPattern$1 = $TS($S(__, ArrayBindingPattern), function($skip, $loc, $0, $1, $2) {
5007
- var p = $2;
5140
+ var PinPattern$0 = $TS($S($EXPECT($L17, fail, 'PinPattern "^"'), Identifier), function($skip, $loc, $0, $1, $2) {
5141
+ var identifier = $2;
5008
5142
  return {
5009
- children: [...$1, p.children],
5010
- names: p.names
5143
+ type: "PinPattern",
5144
+ children: $0,
5145
+ identifier
5011
5146
  };
5012
5147
  });
5148
+ function PinPattern(state) {
5149
+ let eventData;
5150
+ if (state.events) {
5151
+ const result = state.events.enter?.("PinPattern", state);
5152
+ if (result) {
5153
+ if (result.cache)
5154
+ return result.cache;
5155
+ eventData = result.data;
5156
+ }
5157
+ }
5158
+ if (state.tokenize) {
5159
+ const result = $TOKEN("PinPattern", state, PinPattern$0(state));
5160
+ if (state.events)
5161
+ state.events.exit?.("PinPattern", state, result, eventData);
5162
+ return result;
5163
+ } else {
5164
+ const result = PinPattern$0(state);
5165
+ if (state.events)
5166
+ state.events.exit?.("PinPattern", state, result, eventData);
5167
+ return result;
5168
+ }
5169
+ }
5170
+ var BindingPattern$0 = ObjectBindingPattern;
5171
+ var BindingPattern$1 = ArrayBindingPattern;
5172
+ var BindingPattern$2 = PinPattern;
5173
+ var BindingPattern$3 = Literal;
5174
+ var BindingPattern$4 = RegularExpressionLiteral;
5013
5175
  function BindingPattern(state) {
5014
5176
  let eventData;
5015
5177
  if (state.events) {
@@ -5021,24 +5183,24 @@ ${input.slice(result.pos)}
5021
5183
  }
5022
5184
  }
5023
5185
  if (state.tokenize) {
5024
- const result = $TOKEN("BindingPattern", state, BindingPattern$0(state) || BindingPattern$1(state));
5186
+ const result = $TOKEN("BindingPattern", state, BindingPattern$0(state) || BindingPattern$1(state) || BindingPattern$2(state) || BindingPattern$3(state) || BindingPattern$4(state));
5025
5187
  if (state.events)
5026
5188
  state.events.exit?.("BindingPattern", state, result, eventData);
5027
5189
  return result;
5028
5190
  } else {
5029
- const result = BindingPattern$0(state) || BindingPattern$1(state);
5191
+ const result = BindingPattern$0(state) || BindingPattern$1(state) || BindingPattern$2(state) || BindingPattern$3(state) || BindingPattern$4(state);
5030
5192
  if (state.events)
5031
5193
  state.events.exit?.("BindingPattern", state, result, eventData);
5032
5194
  return result;
5033
5195
  }
5034
5196
  }
5035
- var ObjectBindingPattern$0 = $TS($S(OpenBrace, ObjectBindingPatternContent, __, CloseBrace), function($skip, $loc, $0, $1, $2, $3, $4) {
5036
- var c = $2;
5197
+ var ObjectBindingPattern$0 = $TS($S($E(_), OpenBrace, ObjectBindingPatternContent, __, CloseBrace), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
5198
+ var c = $3;
5037
5199
  return {
5038
5200
  type: "ObjectBindingPattern",
5039
- children: [$1, ...c.children, $3, $4],
5040
- content: c.children,
5041
- names: c.names
5201
+ children: $0,
5202
+ names: c.names,
5203
+ properties: c.children
5042
5204
  };
5043
5205
  });
5044
5206
  function ObjectBindingPattern(state) {
@@ -5065,10 +5227,10 @@ ${input.slice(result.pos)}
5065
5227
  }
5066
5228
  var ObjectBindingPatternContent$0 = NestedBindingProperties;
5067
5229
  var ObjectBindingPatternContent$1 = $TV($E(BindingPropertyList), function($skip, $loc, $0, $1) {
5068
- var props2 = $0;
5069
- if (!props2)
5230
+ var props = $0;
5231
+ if (!props)
5070
5232
  return { children: [], names: [] };
5071
- return module2.reorderBindingRestProperty(props2);
5233
+ return module2.reorderBindingRestProperty(props);
5072
5234
  });
5073
5235
  function ObjectBindingPatternContent(state) {
5074
5236
  let eventData;
@@ -5093,8 +5255,8 @@ ${input.slice(result.pos)}
5093
5255
  }
5094
5256
  }
5095
5257
  var BindingPropertyList$0 = $TV($P($S(BindingProperty, ObjectPropertyDelimiter)), function($skip, $loc, $0, $1) {
5096
- var props2 = $0;
5097
- return props2.map(([prop, delim]) => {
5258
+ var props = $0;
5259
+ return props.map(([prop, delim]) => {
5098
5260
  return {
5099
5261
  ...prop,
5100
5262
  children: [...prop.children, delim]
@@ -5123,12 +5285,14 @@ ${input.slice(result.pos)}
5123
5285
  return result;
5124
5286
  }
5125
5287
  }
5126
- var ArrayBindingPattern$0 = $TS($S(OpenBracket, ArrayBindingPatternContent, __, CloseBracket), function($skip, $loc, $0, $1, $2, $3, $4) {
5127
- var c = $2;
5288
+ var ArrayBindingPattern$0 = $TS($S($E(_), OpenBracket, ArrayBindingPatternContent, __, CloseBracket), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
5289
+ var c = $3;
5128
5290
  return {
5129
5291
  type: "ArrayBindingPattern",
5292
+ children: $0,
5130
5293
  names: c.names,
5131
- children: $0
5294
+ elements: c.children,
5295
+ length: c.length
5132
5296
  };
5133
5297
  });
5134
5298
  function ArrayBindingPattern(state) {
@@ -5157,7 +5321,7 @@ ${input.slice(result.pos)}
5157
5321
  var ArrayBindingPatternContent$1 = $TV($E(BindingElementList), function($skip, $loc, $0, $1) {
5158
5322
  var elements = $0;
5159
5323
  if (!elements)
5160
- return { children: [], names: [] };
5324
+ return { children: [], names: [], length: 0 };
5161
5325
  return module2.adjustBindingElements(elements);
5162
5326
  });
5163
5327
  function ArrayBindingPatternContent(state) {
@@ -5271,10 +5435,10 @@ ${input.slice(result.pos)}
5271
5435
  }
5272
5436
  }
5273
5437
  var NestedBindingProperties$0 = $TS($S(PushIndent, $Q(NestedBindingPropertyList), PopIndent), function($skip, $loc, $0, $1, $2, $3) {
5274
- var props2 = $2;
5275
- if (!props2.length)
5438
+ var props = $2;
5439
+ if (!props.length)
5276
5440
  return $skip;
5277
- return module2.reorderBindingRestProperty(props2.flat());
5441
+ return module2.reorderBindingRestProperty(props.flat());
5278
5442
  });
5279
5443
  function NestedBindingProperties(state) {
5280
5444
  let eventData;
@@ -5300,8 +5464,8 @@ ${input.slice(result.pos)}
5300
5464
  }
5301
5465
  var NestedBindingPropertyList$0 = $TS($S(Nested, BindingPropertyList), function($skip, $loc, $0, $1, $2) {
5302
5466
  var ws = $1;
5303
- var props2 = $2;
5304
- return props2.map((prop, i) => {
5467
+ var props = $2;
5468
+ return props.map((prop, i) => {
5305
5469
  if (i > 0)
5306
5470
  return prop;
5307
5471
  return {
@@ -5333,35 +5497,53 @@ ${input.slice(result.pos)}
5333
5497
  }
5334
5498
  }
5335
5499
  var BindingProperty$0 = BindingRestProperty;
5336
- var BindingProperty$1 = $TS($S($E(_), PropertyName, $E(_), Colon, $C(BindingIdentifier, BindingPattern), $E(Initializer)), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
5500
+ var BindingProperty$1 = $TS($S($E(_), PropertyName, $E(_), Colon, $E(_), $C(BindingIdentifier, BindingPattern), $E(Initializer)), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7) {
5337
5501
  var name = $2;
5338
- var b = $5;
5339
- var init = $6;
5502
+ var value = $6;
5503
+ var init = $7;
5340
5504
  return {
5505
+ type: "BindingProperty",
5506
+ children: $0,
5341
5507
  name,
5342
- value: b,
5508
+ value,
5343
5509
  init,
5344
- names: b.names,
5345
- children: $0
5510
+ names: value.names
5346
5511
  };
5347
5512
  });
5348
- var BindingProperty$2 = $TS($S(BindingIdentifier, $E(Initializer)), function($skip, $loc, $0, $1, $2) {
5349
- var b = $1;
5350
- var init = $2;
5351
- if (b.type === "AtBinding") {
5513
+ var BindingProperty$2 = $TS($S($E(_), $E($EXPECT($L17, fail, 'BindingProperty "^"')), BindingIdentifier, $E(Initializer)), function($skip, $loc, $0, $1, $2, $3, $4) {
5514
+ var ws = $1;
5515
+ var pin = $2;
5516
+ var binding = $3;
5517
+ var init = $4;
5518
+ if (binding.type === "AtBinding") {
5352
5519
  return {
5353
5520
  type: "AtBindingProperty",
5354
- ref: b.ref,
5521
+ children: $0,
5522
+ binding,
5523
+ ref: binding.ref,
5355
5524
  init,
5356
- names: [],
5357
- children: $0
5525
+ names: []
5526
+ };
5527
+ }
5528
+ if (pin) {
5529
+ return {
5530
+ type: "PinProperty",
5531
+ children: [ws, binding],
5532
+ name: binding,
5533
+ value: {
5534
+ type: "PinPattern",
5535
+ identifier: binding
5536
+ }
5358
5537
  };
5359
5538
  }
5360
5539
  return {
5361
- name: b,
5540
+ type: "BindingProperty",
5541
+ children: $0,
5542
+ name: binding,
5543
+ value: void 0,
5362
5544
  init,
5363
- names: b.names,
5364
- children: $0
5545
+ names: binding.names,
5546
+ identifier: binding
5365
5547
  };
5366
5548
  });
5367
5549
  function BindingProperty(state) {
@@ -5487,11 +5669,19 @@ ${input.slice(result.pos)}
5487
5669
  }
5488
5670
  }
5489
5671
  var BindingElement$0 = BindingRestElement;
5490
- var BindingElement$1 = $TS($S($C(BindingIdentifier, BindingPattern), $E(Initializer)), function($skip, $loc, $0, $1, $2) {
5491
- var binding = $1;
5672
+ var BindingElement$1 = $TS($S($E(_), $C(BindingIdentifier, BindingPattern), $E(Initializer)), function($skip, $loc, $0, $1, $2, $3) {
5673
+ var ws = $1;
5674
+ var binding = $2;
5675
+ var initializer = $3;
5676
+ if (binding.children) {
5677
+ binding = {
5678
+ ...binding,
5679
+ children: [...binding.children, initializer]
5680
+ };
5681
+ }
5492
5682
  return {
5493
5683
  names: binding.names,
5494
- children: $0
5684
+ children: [ws, binding]
5495
5685
  };
5496
5686
  });
5497
5687
  var BindingElement$2 = $TV($Y($S($E(_), $EXPECT($L21, fail, 'BindingElement ","'))), function($skip, $loc, $0, $1) {
@@ -5573,512 +5763,17 @@ ${input.slice(result.pos)}
5573
5763
  base: "ref",
5574
5764
  id: "ref"
5575
5765
  };
5576
- return {
5577
- type: "EmptyBinding",
5578
- children: [ref],
5579
- names: [],
5580
- ref
5581
- };
5582
- });
5583
- function EmptyBindingPattern(state) {
5584
- let eventData;
5585
- if (state.events) {
5586
- const result = state.events.enter?.("EmptyBindingPattern", state);
5587
- if (result) {
5588
- if (result.cache)
5589
- return result.cache;
5590
- eventData = result.data;
5591
- }
5592
- }
5593
- if (state.tokenize) {
5594
- const result = $TOKEN("EmptyBindingPattern", state, EmptyBindingPattern$0(state));
5595
- if (state.events)
5596
- state.events.exit?.("EmptyBindingPattern", state, result, eventData);
5597
- return result;
5598
- } else {
5599
- const result = EmptyBindingPattern$0(state);
5600
- if (state.events)
5601
- state.events.exit?.("EmptyBindingPattern", state, result, eventData);
5602
- return result;
5603
- }
5604
- }
5605
- var MatchingPattern$0 = ObjectMatchingPattern;
5606
- var MatchingPattern$1 = ArrayMatchingPattern;
5607
- var MatchingPattern$2 = Literal;
5608
- var MatchingPattern$3 = RegularExpressionLiteral;
5609
- function MatchingPattern(state) {
5610
- let eventData;
5611
- if (state.events) {
5612
- const result = state.events.enter?.("MatchingPattern", state);
5613
- if (result) {
5614
- if (result.cache)
5615
- return result.cache;
5616
- eventData = result.data;
5617
- }
5618
- }
5619
- if (state.tokenize) {
5620
- const result = $TOKEN("MatchingPattern", state, MatchingPattern$0(state) || MatchingPattern$1(state) || MatchingPattern$2(state) || MatchingPattern$3(state));
5621
- if (state.events)
5622
- state.events.exit?.("MatchingPattern", state, result, eventData);
5623
- return result;
5624
- } else {
5625
- const result = MatchingPattern$0(state) || MatchingPattern$1(state) || MatchingPattern$2(state) || MatchingPattern$3(state);
5626
- if (state.events)
5627
- state.events.exit?.("MatchingPattern", state, result, eventData);
5628
- return result;
5629
- }
5630
- }
5631
- var ObjectMatchingPattern$0 = $TS($S($E(_), OpenBrace, ObjectMatchingPatternContent, __, CloseBrace), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
5632
- var ws = $1;
5633
- var open = $2;
5634
- var properties = $3;
5635
- var ws = $4;
5636
- var close = $5;
5637
- return {
5638
- type: "ObjectMatchingPattern",
5639
- children: [ws, open, ...properties.children, ...ws, close],
5640
- properties: properties.children
5641
- };
5642
- });
5643
- function ObjectMatchingPattern(state) {
5644
- let eventData;
5645
- if (state.events) {
5646
- const result = state.events.enter?.("ObjectMatchingPattern", state);
5647
- if (result) {
5648
- if (result.cache)
5649
- return result.cache;
5650
- eventData = result.data;
5651
- }
5652
- }
5653
- if (state.tokenize) {
5654
- const result = $TOKEN("ObjectMatchingPattern", state, ObjectMatchingPattern$0(state));
5655
- if (state.events)
5656
- state.events.exit?.("ObjectMatchingPattern", state, result, eventData);
5657
- return result;
5658
- } else {
5659
- const result = ObjectMatchingPattern$0(state);
5660
- if (state.events)
5661
- state.events.exit?.("ObjectMatchingPattern", state, result, eventData);
5662
- return result;
5663
- }
5664
- }
5665
- var ObjectMatchingPatternContent$0 = NestedMatchingProperties;
5666
- var ObjectMatchingPatternContent$1 = $TV($E(MatchingPropertyList), function($skip, $loc, $0, $1) {
5667
- var properties = $0;
5668
- if (!properties)
5669
- return { children: [], names: [] };
5670
- return module2.reorderBindingRestProperty(properties);
5671
- });
5672
- function ObjectMatchingPatternContent(state) {
5673
- let eventData;
5674
- if (state.events) {
5675
- const result = state.events.enter?.("ObjectMatchingPatternContent", state);
5676
- if (result) {
5677
- if (result.cache)
5678
- return result.cache;
5679
- eventData = result.data;
5680
- }
5681
- }
5682
- if (state.tokenize) {
5683
- const result = $TOKEN("ObjectMatchingPatternContent", state, ObjectMatchingPatternContent$0(state) || ObjectMatchingPatternContent$1(state));
5684
- if (state.events)
5685
- state.events.exit?.("ObjectMatchingPatternContent", state, result, eventData);
5686
- return result;
5687
- } else {
5688
- const result = ObjectMatchingPatternContent$0(state) || ObjectMatchingPatternContent$1(state);
5689
- if (state.events)
5690
- state.events.exit?.("ObjectMatchingPatternContent", state, result, eventData);
5691
- return result;
5692
- }
5693
- }
5694
- var NestedMatchingProperties$0 = $TS($S(PushIndent, $Q(NestedMatchingPropertyList), PopIndent), function($skip, $loc, $0, $1, $2, $3) {
5695
- var properties = $2;
5696
- if (!props.length)
5697
- return $skip;
5698
- return module2.reorderBindingRestProperty(props.flat());
5699
- });
5700
- function NestedMatchingProperties(state) {
5701
- let eventData;
5702
- if (state.events) {
5703
- const result = state.events.enter?.("NestedMatchingProperties", state);
5704
- if (result) {
5705
- if (result.cache)
5706
- return result.cache;
5707
- eventData = result.data;
5708
- }
5709
- }
5710
- if (state.tokenize) {
5711
- const result = $TOKEN("NestedMatchingProperties", state, NestedMatchingProperties$0(state));
5712
- if (state.events)
5713
- state.events.exit?.("NestedMatchingProperties", state, result, eventData);
5714
- return result;
5715
- } else {
5716
- const result = NestedMatchingProperties$0(state);
5717
- if (state.events)
5718
- state.events.exit?.("NestedMatchingProperties", state, result, eventData);
5719
- return result;
5720
- }
5721
- }
5722
- var MatchingPropertyList$0 = $TV($P($S(MatchingProperty, ObjectPropertyDelimiter)), function($skip, $loc, $0, $1) {
5723
- var props2 = $0;
5724
- return props2.map(([prop, delim]) => {
5725
- return {
5726
- ...prop,
5727
- children: [...prop.children, delim]
5728
- };
5729
- });
5730
- });
5731
- function MatchingPropertyList(state) {
5732
- let eventData;
5733
- if (state.events) {
5734
- const result = state.events.enter?.("MatchingPropertyList", state);
5735
- if (result) {
5736
- if (result.cache)
5737
- return result.cache;
5738
- eventData = result.data;
5739
- }
5740
- }
5741
- if (state.tokenize) {
5742
- const result = $TOKEN("MatchingPropertyList", state, MatchingPropertyList$0(state));
5743
- if (state.events)
5744
- state.events.exit?.("MatchingPropertyList", state, result, eventData);
5745
- return result;
5746
- } else {
5747
- const result = MatchingPropertyList$0(state);
5748
- if (state.events)
5749
- state.events.exit?.("MatchingPropertyList", state, result, eventData);
5750
- return result;
5751
- }
5752
- }
5753
- var NestedMatchingPropertyList$0 = $TS($S(Nested, MatchingPropertyList), function($skip, $loc, $0, $1, $2) {
5754
- var ws = $1;
5755
- var props2 = $2;
5756
- return props2.map((prop, i) => {
5757
- if (i > 0)
5758
- return prop;
5759
- return {
5760
- ...prop,
5761
- children: [ws, ...prop.children]
5762
- };
5763
- });
5764
- });
5765
- function NestedMatchingPropertyList(state) {
5766
- let eventData;
5767
- if (state.events) {
5768
- const result = state.events.enter?.("NestedMatchingPropertyList", state);
5769
- if (result) {
5770
- if (result.cache)
5771
- return result.cache;
5772
- eventData = result.data;
5773
- }
5774
- }
5775
- if (state.tokenize) {
5776
- const result = $TOKEN("NestedMatchingPropertyList", state, NestedMatchingPropertyList$0(state));
5777
- if (state.events)
5778
- state.events.exit?.("NestedMatchingPropertyList", state, result, eventData);
5779
- return result;
5780
- } else {
5781
- const result = NestedMatchingPropertyList$0(state);
5782
- if (state.events)
5783
- state.events.exit?.("NestedMatchingPropertyList", state, result, eventData);
5784
- return result;
5785
- }
5786
- }
5787
- var MatchingProperty$0 = MatchingRestProperty;
5788
- var MatchingProperty$1 = $TS($S($E(_), PropertyName, $E(_), Colon, $E(_), $C(BindingIdentifier, MatchingPattern)), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
5789
- var name = $2;
5790
- var match = $6;
5791
- return {
5792
- type: "BindingMatchProperty",
5793
- name,
5794
- match,
5795
- children: $0
5796
- };
5797
- });
5798
- var MatchingProperty$2 = $TS($S($E(_), BindingIdentifier), function($skip, $loc, $0, $1, $2) {
5799
- var ws = $1;
5800
- var b = $2;
5801
- if (b.type === "AtBinding") {
5802
- return {
5803
- type: "AtBindingProperty",
5804
- ref: b.ref,
5805
- names: [],
5806
- children: [ws, b]
5807
- };
5808
- }
5809
- return {
5810
- type: "BindingProperty",
5811
- names: b.names,
5812
- children: [ws, b],
5813
- identifier: b
5814
- };
5815
- });
5816
- function MatchingProperty(state) {
5817
- let eventData;
5818
- if (state.events) {
5819
- const result = state.events.enter?.("MatchingProperty", state);
5820
- if (result) {
5821
- if (result.cache)
5822
- return result.cache;
5823
- eventData = result.data;
5824
- }
5825
- }
5826
- if (state.tokenize) {
5827
- const result = $TOKEN("MatchingProperty", state, MatchingProperty$0(state) || MatchingProperty$1(state) || MatchingProperty$2(state));
5828
- if (state.events)
5829
- state.events.exit?.("MatchingProperty", state, result, eventData);
5830
- return result;
5831
- } else {
5832
- const result = MatchingProperty$0(state) || MatchingProperty$1(state) || MatchingProperty$2(state);
5833
- if (state.events)
5834
- state.events.exit?.("MatchingProperty", state, result, eventData);
5835
- return result;
5836
- }
5837
- }
5838
- var MatchingRestProperty$0 = BindingRestProperty;
5839
- function MatchingRestProperty(state) {
5840
- let eventData;
5841
- if (state.events) {
5842
- const result = state.events.enter?.("MatchingRestProperty", state);
5843
- if (result) {
5844
- if (result.cache)
5845
- return result.cache;
5846
- eventData = result.data;
5847
- }
5848
- }
5849
- if (state.tokenize) {
5850
- const result = $TOKEN("MatchingRestProperty", state, MatchingRestProperty$0(state));
5851
- if (state.events)
5852
- state.events.exit?.("MatchingRestProperty", state, result, eventData);
5853
- return result;
5854
- } else {
5855
- const result = MatchingRestProperty$0(state);
5856
- if (state.events)
5857
- state.events.exit?.("MatchingRestProperty", state, result, eventData);
5858
- return result;
5859
- }
5860
- }
5861
- var ArrayMatchingPattern$0 = $TS($S($E(_), OpenBracket, ArrayMatchingPatternContent, __, CloseBracket), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
5862
- var ws = $1;
5863
- var elements = $3;
5864
- return {
5865
- type: "ArrayMatchingPattern",
5866
- children: $0,
5867
- elements: elements.children,
5868
- length: elements.length
5869
- };
5870
- });
5871
- function ArrayMatchingPattern(state) {
5872
- let eventData;
5873
- if (state.events) {
5874
- const result = state.events.enter?.("ArrayMatchingPattern", state);
5875
- if (result) {
5876
- if (result.cache)
5877
- return result.cache;
5878
- eventData = result.data;
5879
- }
5880
- }
5881
- if (state.tokenize) {
5882
- const result = $TOKEN("ArrayMatchingPattern", state, ArrayMatchingPattern$0(state));
5883
- if (state.events)
5884
- state.events.exit?.("ArrayMatchingPattern", state, result, eventData);
5885
- return result;
5886
- } else {
5887
- const result = ArrayMatchingPattern$0(state);
5888
- if (state.events)
5889
- state.events.exit?.("ArrayMatchingPattern", state, result, eventData);
5890
- return result;
5891
- }
5892
- }
5893
- var ArrayMatchingPatternContent$0 = NestedMatchingElements;
5894
- var ArrayMatchingPatternContent$1 = $TV($E(MatchingElementList), function($skip, $loc, $0, $1) {
5895
- var elements = $0;
5896
- if (!elements)
5897
- return { children: [], names: [], length: 0 };
5898
- return module2.adjustBindingElements(elements);
5899
- });
5900
- function ArrayMatchingPatternContent(state) {
5901
- let eventData;
5902
- if (state.events) {
5903
- const result = state.events.enter?.("ArrayMatchingPatternContent", state);
5904
- if (result) {
5905
- if (result.cache)
5906
- return result.cache;
5907
- eventData = result.data;
5908
- }
5909
- }
5910
- if (state.tokenize) {
5911
- const result = $TOKEN("ArrayMatchingPatternContent", state, ArrayMatchingPatternContent$0(state) || ArrayMatchingPatternContent$1(state));
5912
- if (state.events)
5913
- state.events.exit?.("ArrayMatchingPatternContent", state, result, eventData);
5914
- return result;
5915
- } else {
5916
- const result = ArrayMatchingPatternContent$0(state) || ArrayMatchingPatternContent$1(state);
5917
- if (state.events)
5918
- state.events.exit?.("ArrayMatchingPatternContent", state, result, eventData);
5919
- return result;
5920
- }
5921
- }
5922
- var NestedMatchingElements$0 = $TS($S(PushIndent, $Q(NestedMatchingElementList), PopIndent), function($skip, $loc, $0, $1, $2, $3) {
5923
- var elements = $2;
5924
- return module2.adjustBindingElements(elements.flat());
5925
- });
5926
- function NestedMatchingElements(state) {
5927
- let eventData;
5928
- if (state.events) {
5929
- const result = state.events.enter?.("NestedMatchingElements", state);
5930
- if (result) {
5931
- if (result.cache)
5932
- return result.cache;
5933
- eventData = result.data;
5934
- }
5935
- }
5936
- if (state.tokenize) {
5937
- const result = $TOKEN("NestedMatchingElements", state, NestedMatchingElements$0(state));
5938
- if (state.events)
5939
- state.events.exit?.("NestedMatchingElements", state, result, eventData);
5940
- return result;
5941
- } else {
5942
- const result = NestedMatchingElements$0(state);
5943
- if (state.events)
5944
- state.events.exit?.("NestedMatchingElements", state, result, eventData);
5945
- return result;
5946
- }
5947
- }
5948
- var MatchingElementList$0 = $TV($P($S(MatchingElement, ArrayElementDelimiter)), function($skip, $loc, $0, $1) {
5949
- var elements = $0;
5950
- return elements.map(([element, delim]) => {
5951
- return {
5952
- ...element,
5953
- children: [...element.children, delim]
5954
- };
5955
- });
5956
- });
5957
- function MatchingElementList(state) {
5958
- let eventData;
5959
- if (state.events) {
5960
- const result = state.events.enter?.("MatchingElementList", state);
5961
- if (result) {
5962
- if (result.cache)
5963
- return result.cache;
5964
- eventData = result.data;
5965
- }
5966
- }
5967
- if (state.tokenize) {
5968
- const result = $TOKEN("MatchingElementList", state, MatchingElementList$0(state));
5969
- if (state.events)
5970
- state.events.exit?.("MatchingElementList", state, result, eventData);
5971
- return result;
5972
- } else {
5973
- const result = MatchingElementList$0(state);
5974
- if (state.events)
5975
- state.events.exit?.("MatchingElementList", state, result, eventData);
5976
- return result;
5977
- }
5978
- }
5979
- var NestedMatchingElementList$0 = $TS($S(Nested, MatchingElementList), function($skip, $loc, $0, $1, $2) {
5980
- var ws = $1;
5981
- var elements = $2;
5982
- return elements.map((element, i) => {
5983
- if (i > 0)
5984
- return element;
5985
- return {
5986
- ...element,
5987
- children: [ws, ...element.children]
5988
- };
5989
- });
5990
- });
5991
- function NestedMatchingElementList(state) {
5992
- let eventData;
5993
- if (state.events) {
5994
- const result = state.events.enter?.("NestedMatchingElementList", state);
5995
- if (result) {
5996
- if (result.cache)
5997
- return result.cache;
5998
- eventData = result.data;
5999
- }
6000
- }
6001
- if (state.tokenize) {
6002
- const result = $TOKEN("NestedMatchingElementList", state, NestedMatchingElementList$0(state));
6003
- if (state.events)
6004
- state.events.exit?.("NestedMatchingElementList", state, result, eventData);
6005
- return result;
6006
- } else {
6007
- const result = NestedMatchingElementList$0(state);
6008
- if (state.events)
6009
- state.events.exit?.("NestedMatchingElementList", state, result, eventData);
6010
- return result;
6011
- }
6012
- }
6013
- var MatchingElement$0 = MatchingRestElement;
6014
- var MatchingElement$1 = $TS($S($E(_), BindingIdentifier, $E(_), Colon, $E(_), $C(BindingIdentifier, MatchingPattern)), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
6015
- var ws = $1;
6016
- var name = $2;
6017
- var match = $6;
6018
- let blockPrefix;
6019
- switch (match.type) {
6020
- case "ArrayMatchingPattern":
6021
- case "ObjectMatchingPattern":
6022
- blockPrefix = [match, " = ", name];
6023
- break;
6024
- default:
6025
- break;
6026
- }
6027
- return {
6028
- names: name.names,
6029
- children: [ws, {
6030
- type: "BindingMatchElement",
6031
- name,
6032
- match,
6033
- children: [name],
6034
- blockPrefix
6035
- }]
6036
- };
6037
- });
6038
- var MatchingElement$2 = $TS($S($E(_), $C(BindingIdentifier, MatchingPattern)), function($skip, $loc, $0, $1, $2) {
6039
- var ws = $1;
6040
- var binding = $2;
6041
- return {
6042
- names: binding.names,
6043
- children: [ws, binding]
6044
- };
6045
- });
6046
- var MatchingElement$3 = $TV($Y($S($E(_), $EXPECT($L21, fail, 'MatchingElement ","'))), function($skip, $loc, $0, $1) {
6047
- return {
6048
- children: [{
6049
- type: "ElisionElement",
6050
- children: [""]
6051
- }],
6052
- names: []
6053
- };
6054
- });
6055
- function MatchingElement(state) {
6056
- let eventData;
6057
- if (state.events) {
6058
- const result = state.events.enter?.("MatchingElement", state);
6059
- if (result) {
6060
- if (result.cache)
6061
- return result.cache;
6062
- eventData = result.data;
6063
- }
6064
- }
6065
- if (state.tokenize) {
6066
- const result = $TOKEN("MatchingElement", state, MatchingElement$0(state) || MatchingElement$1(state) || MatchingElement$2(state) || MatchingElement$3(state));
6067
- if (state.events)
6068
- state.events.exit?.("MatchingElement", state, result, eventData);
6069
- return result;
6070
- } else {
6071
- const result = MatchingElement$0(state) || MatchingElement$1(state) || MatchingElement$2(state) || MatchingElement$3(state);
6072
- if (state.events)
6073
- state.events.exit?.("MatchingElement", state, result, eventData);
6074
- return result;
6075
- }
6076
- }
6077
- var MatchingRestElement$0 = BindingRestElement;
6078
- function MatchingRestElement(state) {
5766
+ return {
5767
+ type: "EmptyBinding",
5768
+ children: [ref],
5769
+ names: [],
5770
+ ref
5771
+ };
5772
+ });
5773
+ function EmptyBindingPattern(state) {
6079
5774
  let eventData;
6080
5775
  if (state.events) {
6081
- const result = state.events.enter?.("MatchingRestElement", state);
5776
+ const result = state.events.enter?.("EmptyBindingPattern", state);
6082
5777
  if (result) {
6083
5778
  if (result.cache)
6084
5779
  return result.cache;
@@ -6086,14 +5781,14 @@ ${input.slice(result.pos)}
6086
5781
  }
6087
5782
  }
6088
5783
  if (state.tokenize) {
6089
- const result = $TOKEN("MatchingRestElement", state, MatchingRestElement$0(state));
5784
+ const result = $TOKEN("EmptyBindingPattern", state, EmptyBindingPattern$0(state));
6090
5785
  if (state.events)
6091
- state.events.exit?.("MatchingRestElement", state, result, eventData);
5786
+ state.events.exit?.("EmptyBindingPattern", state, result, eventData);
6092
5787
  return result;
6093
5788
  } else {
6094
- const result = MatchingRestElement$0(state);
5789
+ const result = EmptyBindingPattern$0(state);
6095
5790
  if (state.events)
6096
- state.events.exit?.("MatchingRestElement", state, result, eventData);
5791
+ state.events.exit?.("EmptyBindingPattern", state, result, eventData);
6097
5792
  return result;
6098
5793
  }
6099
5794
  }
@@ -7798,16 +7493,16 @@ ${input.slice(result.pos)}
7798
7493
  var open = $1;
7799
7494
  if (!$3)
7800
7495
  return $skip;
7801
- const [content, ...close] = $3;
7802
- if (content) {
7803
- const children = [open, ...content, close];
7496
+ const [properties, ...close] = $3;
7497
+ if (properties) {
7498
+ const children = [open, ...properties, close];
7804
7499
  return {
7805
7500
  type: "ObjectExpression",
7806
- content,
7807
7501
  children,
7808
7502
  names: children.flatMap((c) => {
7809
7503
  return c.names || [];
7810
- })
7504
+ }),
7505
+ properties
7811
7506
  };
7812
7507
  }
7813
7508
  return {
@@ -8124,11 +7819,11 @@ ${input.slice(result.pos)}
8124
7819
  return result;
8125
7820
  }
8126
7821
  }
8127
- var PropertyDefinition$0 = $TS($S(__, At, IdentifierReference), function($skip, $loc, $0, $1, $2, $3) {
7822
+ var PropertyDefinition$0 = $TS($S(__, AtThis, IdentifierReference), function($skip, $loc, $0, $1, $2, $3) {
8128
7823
  var ws = $1;
8129
7824
  var at = $2;
8130
7825
  var id = $3;
8131
- const value = [{ ...at, token: "this." }, id];
7826
+ const value = [at, ".", id];
8132
7827
  return {
8133
7828
  type: "Property",
8134
7829
  children: [ws, id, ": ", ...value],
@@ -8186,26 +7881,19 @@ ${input.slice(result.pos)}
8186
7881
  if (value.type === "Identifier") {
8187
7882
  return { ...value, children: [ws, ...value.children] };
8188
7883
  }
8189
- let exp = value, children, i;
8190
- do {
8191
- ({ children } = exp);
8192
- i = children.length - 1;
8193
- while (i >= 0 && (children[i].type === "Call" || children[i].type === "NonNullAssertion" || children[i].type === "Optional"))
8194
- i--;
8195
- if (i < 0)
8196
- return $skip;
8197
- } while (children[i].type === "MemberExpression" && (exp = children[i]));
8198
- const last = children[i];
7884
+ const last = lastAccessInCallExpression(value);
7885
+ if (!last)
7886
+ return $skip;
8199
7887
  let name;
8200
- if (last.name) {
8201
- ({ name } = last);
8202
- } else if (last.type === "Index") {
7888
+ if (last.type === "Index") {
8203
7889
  name = {
8204
7890
  type: "ComputedPropertyName",
8205
7891
  children: last.children
8206
7892
  };
8207
7893
  } else {
8208
- return $skip;
7894
+ ({ name } = last);
7895
+ if (!name)
7896
+ return $skip;
8209
7897
  }
8210
7898
  return {
8211
7899
  type: "Property",
@@ -10921,7 +10609,7 @@ ${input.slice(result.pos)}
10921
10609
  return result;
10922
10610
  }
10923
10611
  }
10924
- var CaseClause$0 = $TS($S(MatchingPattern, $C(ThenClause, NestedBlockStatements, EmptyBareBlock)), function($skip, $loc, $0, $1, $2) {
10612
+ var CaseClause$0 = $TS($S(BindingPattern, $C(ThenClause, NestedBlockStatements, EmptyBareBlock)), function($skip, $loc, $0, $1, $2) {
10925
10613
  var pattern = $1;
10926
10614
  var block = $2;
10927
10615
  return {
@@ -10931,10 +10619,23 @@ ${input.slice(result.pos)}
10931
10619
  pattern
10932
10620
  };
10933
10621
  });
10934
- var CaseClause$1 = $T($S(Case, CaseExpressionList, $C(NestedBlockStatements, EmptyBareBlock)), function(value) {
10622
+ var CaseClause$1 = $TS($S(SingleLineBinaryOpRHS, $C(ThenClause, NestedBlockStatements, EmptyBareBlock)), function($skip, $loc, $0, $1, $2) {
10623
+ var pattern = $1;
10624
+ var block = $2;
10625
+ return {
10626
+ type: "PatternClause",
10627
+ children: $0,
10628
+ block,
10629
+ pattern: {
10630
+ type: "ConditionFragment",
10631
+ children: pattern
10632
+ }
10633
+ };
10634
+ });
10635
+ var CaseClause$2 = $T($S(Case, CaseExpressionList, $C(NestedBlockStatements, EmptyBareBlock)), function(value) {
10935
10636
  return { "type": "CaseClause", "children": value };
10936
10637
  });
10937
- var CaseClause$2 = $TS($S(When, CaseExpressionList, InsertOpenBrace, $C(ThenClause, NestedBlockStatements, EmptyBareBlock), InsertBreak, InsertNewline, InsertIndent, InsertCloseBrace), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8) {
10638
+ var CaseClause$3 = $TS($S(When, CaseExpressionList, InsertOpenBrace, $C(ThenClause, NestedBlockStatements, EmptyBareBlock), InsertBreak, InsertNewline, InsertIndent, InsertCloseBrace), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7, $8) {
10938
10639
  var cases = $2;
10939
10640
  var block = $4;
10940
10641
  var b = $5;
@@ -10946,7 +10647,7 @@ ${input.slice(result.pos)}
10946
10647
  children: $0
10947
10648
  };
10948
10649
  });
10949
- var CaseClause$3 = $TS($S(Default, ImpliedColon, $C(NestedBlockStatements, EmptyBareBlock)), function($skip, $loc, $0, $1, $2, $3) {
10650
+ var CaseClause$4 = $TS($S(Default, ImpliedColon, $C(NestedBlockStatements, EmptyBareBlock)), function($skip, $loc, $0, $1, $2, $3) {
10950
10651
  var block = $3;
10951
10652
  return {
10952
10653
  type: "DefaultClause",
@@ -10954,7 +10655,7 @@ ${input.slice(result.pos)}
10954
10655
  children: $0
10955
10656
  };
10956
10657
  });
10957
- var CaseClause$4 = $TS($S(Else, ImpliedColon, $C(ThenClause, BracedBlock, EmptyBlock)), function($skip, $loc, $0, $1, $2, $3) {
10658
+ var CaseClause$5 = $TS($S(Else, ImpliedColon, $C(ThenClause, BracedBlock, EmptyBlock)), function($skip, $loc, $0, $1, $2, $3) {
10958
10659
  var block = $3;
10959
10660
  $1.token = "default";
10960
10661
  return {
@@ -10974,12 +10675,12 @@ ${input.slice(result.pos)}
10974
10675
  }
10975
10676
  }
10976
10677
  if (state.tokenize) {
10977
- const result = $TOKEN("CaseClause", state, CaseClause$0(state) || CaseClause$1(state) || CaseClause$2(state) || CaseClause$3(state) || CaseClause$4(state));
10678
+ const result = $TOKEN("CaseClause", state, CaseClause$0(state) || CaseClause$1(state) || CaseClause$2(state) || CaseClause$3(state) || CaseClause$4(state) || CaseClause$5(state));
10978
10679
  if (state.events)
10979
10680
  state.events.exit?.("CaseClause", state, result, eventData);
10980
10681
  return result;
10981
10682
  } else {
10982
- const result = CaseClause$0(state) || CaseClause$1(state) || CaseClause$2(state) || CaseClause$3(state) || CaseClause$4(state);
10683
+ const result = CaseClause$0(state) || CaseClause$1(state) || CaseClause$2(state) || CaseClause$3(state) || CaseClause$4(state) || CaseClause$5(state);
10983
10684
  if (state.events)
10984
10685
  state.events.exit?.("CaseClause", state, result, eventData);
10985
10686
  return result;
@@ -11333,8 +11034,8 @@ ${input.slice(result.pos)}
11333
11034
  return result;
11334
11035
  }
11335
11036
  }
11336
- var ExpressionWithIndentedApplicationForbidden$0 = $TS($S(ForbidIndentedApplication, $E(ExtendedExpression), RestoreIndentedApplication), function($skip, $loc, $0, $1, $2, $3) {
11337
- var exp = $2;
11037
+ var ExpressionWithIndentedApplicationForbidden$0 = $TS($S(ForbidIndentedApplication, ForbidNewlineBinaryOp, $E(ExtendedExpression), RestoreNewlineBinaryOp, RestoreIndentedApplication), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
11038
+ var exp = $3;
11338
11039
  if (exp)
11339
11040
  return exp;
11340
11041
  return $skip;
@@ -11776,7 +11477,111 @@ ${input.slice(result.pos)}
11776
11477
  return result;
11777
11478
  }
11778
11479
  }
11779
- var AllowAll$0 = $S(AllowTrailingMemberProperty, AllowIndentedApplication, AllowMultiLineImplicitObjectLiteral, AllowClassImplicitCall);
11480
+ var AllowNewlineBinaryOp$0 = $TV($EXPECT($L0, fail, 'AllowNewlineBinaryOp ""'), function($skip, $loc, $0, $1) {
11481
+ module2.forbidNewlineBinaryOp.push(false);
11482
+ });
11483
+ function AllowNewlineBinaryOp(state) {
11484
+ let eventData;
11485
+ if (state.events) {
11486
+ const result = state.events.enter?.("AllowNewlineBinaryOp", state);
11487
+ if (result) {
11488
+ if (result.cache)
11489
+ return result.cache;
11490
+ eventData = result.data;
11491
+ }
11492
+ }
11493
+ if (state.tokenize) {
11494
+ const result = $TOKEN("AllowNewlineBinaryOp", state, AllowNewlineBinaryOp$0(state));
11495
+ if (state.events)
11496
+ state.events.exit?.("AllowNewlineBinaryOp", state, result, eventData);
11497
+ return result;
11498
+ } else {
11499
+ const result = AllowNewlineBinaryOp$0(state);
11500
+ if (state.events)
11501
+ state.events.exit?.("AllowNewlineBinaryOp", state, result, eventData);
11502
+ return result;
11503
+ }
11504
+ }
11505
+ var ForbidNewlineBinaryOp$0 = $TV($EXPECT($L0, fail, 'ForbidNewlineBinaryOp ""'), function($skip, $loc, $0, $1) {
11506
+ module2.forbidNewlineBinaryOp.push(true);
11507
+ });
11508
+ function ForbidNewlineBinaryOp(state) {
11509
+ let eventData;
11510
+ if (state.events) {
11511
+ const result = state.events.enter?.("ForbidNewlineBinaryOp", state);
11512
+ if (result) {
11513
+ if (result.cache)
11514
+ return result.cache;
11515
+ eventData = result.data;
11516
+ }
11517
+ }
11518
+ if (state.tokenize) {
11519
+ const result = $TOKEN("ForbidNewlineBinaryOp", state, ForbidNewlineBinaryOp$0(state));
11520
+ if (state.events)
11521
+ state.events.exit?.("ForbidNewlineBinaryOp", state, result, eventData);
11522
+ return result;
11523
+ } else {
11524
+ const result = ForbidNewlineBinaryOp$0(state);
11525
+ if (state.events)
11526
+ state.events.exit?.("ForbidNewlineBinaryOp", state, result, eventData);
11527
+ return result;
11528
+ }
11529
+ }
11530
+ var RestoreNewlineBinaryOp$0 = $TV($EXPECT($L0, fail, 'RestoreNewlineBinaryOp ""'), function($skip, $loc, $0, $1) {
11531
+ module2.forbidNewlineBinaryOp.pop();
11532
+ });
11533
+ function RestoreNewlineBinaryOp(state) {
11534
+ let eventData;
11535
+ if (state.events) {
11536
+ const result = state.events.enter?.("RestoreNewlineBinaryOp", state);
11537
+ if (result) {
11538
+ if (result.cache)
11539
+ return result.cache;
11540
+ eventData = result.data;
11541
+ }
11542
+ }
11543
+ if (state.tokenize) {
11544
+ const result = $TOKEN("RestoreNewlineBinaryOp", state, RestoreNewlineBinaryOp$0(state));
11545
+ if (state.events)
11546
+ state.events.exit?.("RestoreNewlineBinaryOp", state, result, eventData);
11547
+ return result;
11548
+ } else {
11549
+ const result = RestoreNewlineBinaryOp$0(state);
11550
+ if (state.events)
11551
+ state.events.exit?.("RestoreNewlineBinaryOp", state, result, eventData);
11552
+ return result;
11553
+ }
11554
+ }
11555
+ var NewlineBinaryOpAllowed$0 = $TV($EXPECT($L0, fail, 'NewlineBinaryOpAllowed ""'), function($skip, $loc, $0, $1) {
11556
+ if (module2.config.verbose) {
11557
+ console.log("forbidNewlineBinaryOp:", module2.forbidNewlineBinaryOp);
11558
+ }
11559
+ if (module2.newlineBinaryOpForbidden)
11560
+ return $skip;
11561
+ });
11562
+ function NewlineBinaryOpAllowed(state) {
11563
+ let eventData;
11564
+ if (state.events) {
11565
+ const result = state.events.enter?.("NewlineBinaryOpAllowed", state);
11566
+ if (result) {
11567
+ if (result.cache)
11568
+ return result.cache;
11569
+ eventData = result.data;
11570
+ }
11571
+ }
11572
+ if (state.tokenize) {
11573
+ const result = $TOKEN("NewlineBinaryOpAllowed", state, NewlineBinaryOpAllowed$0(state));
11574
+ if (state.events)
11575
+ state.events.exit?.("NewlineBinaryOpAllowed", state, result, eventData);
11576
+ return result;
11577
+ } else {
11578
+ const result = NewlineBinaryOpAllowed$0(state);
11579
+ if (state.events)
11580
+ state.events.exit?.("NewlineBinaryOpAllowed", state, result, eventData);
11581
+ return result;
11582
+ }
11583
+ }
11584
+ var AllowAll$0 = $S(AllowTrailingMemberProperty, AllowIndentedApplication, AllowMultiLineImplicitObjectLiteral, AllowClassImplicitCall, AllowNewlineBinaryOp);
11780
11585
  function AllowAll(state) {
11781
11586
  let eventData;
11782
11587
  if (state.events) {
@@ -11799,7 +11604,7 @@ ${input.slice(result.pos)}
11799
11604
  return result;
11800
11605
  }
11801
11606
  }
11802
- var RestoreAll$0 = $S(RestoreTrailingMemberProperty, RestoreIndentedApplication, RestoreMultiLineImplicitObjectLiteral, RestoreClassImplicitCall);
11607
+ var RestoreAll$0 = $S(RestoreTrailingMemberProperty, RestoreIndentedApplication, RestoreMultiLineImplicitObjectLiteral, RestoreClassImplicitCall, RestoreNewlineBinaryOp);
11803
11608
  function RestoreAll(state) {
11804
11609
  let eventData;
11805
11610
  if (state.events) {
@@ -12511,7 +12316,7 @@ ${input.slice(result.pos)}
12511
12316
  return result;
12512
12317
  }
12513
12318
  }
12514
- var ExportDeclaration$0 = $TS($S(Export, __, Default, __, $C(HoistableDeclaration, ClassDeclaration, ExtendedExpression)), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
12319
+ var ExportDeclaration$0 = $TS($S($E(Decorators), Export, __, Default, __, $C(HoistableDeclaration, ClassDeclaration, ExtendedExpression)), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
12515
12320
  return { type: "ExportDeclaration", children: $0 };
12516
12321
  });
12517
12322
  var ExportDeclaration$1 = $TS($S(Export, __, ExportFromClause, __, FromClause), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
@@ -17192,42 +16997,7 @@ ${input.slice(result.pos)}
17192
16997
  }
17193
16998
  }
17194
16999
  var JSXAttribute$0 = $TS($S(BracedObjectLiteral), function($skip, $loc, $0, $1) {
17195
- const { children } = $1;
17196
- const parts = [];
17197
- const rest = [];
17198
- for (let i = 1; i < children.length - 1; i++) {
17199
- if (i > 1)
17200
- parts.push(" ");
17201
- const part = children[i];
17202
- switch (part.type) {
17203
- case "Identifier":
17204
- parts.push([part.name, "={", part.name, "}"]);
17205
- break;
17206
- case "Property":
17207
- if (part.name.type === "ComputedPropertyName") {
17208
- rest.push(part);
17209
- } else {
17210
- parts.push([part.name, "={", insertTrimmingSpace(part.value, ""), "}"]);
17211
- }
17212
- break;
17213
- case "SpreadProperty":
17214
- parts.push(["{", part.dots, part.value, "}"]);
17215
- break;
17216
- case "MethodDefinition":
17217
- try {
17218
- parts.push([part.name, "={", module2.convertMethodToFunction(part), "}"]);
17219
- } catch {
17220
- rest.push(part);
17221
- }
17222
- break;
17223
- default:
17224
- throw new Error(`invalid object literal type in JSX attribute: ${part.type}`);
17225
- }
17226
- }
17227
- if (rest.length) {
17228
- parts.push(["{...{", ...rest, "}}"]);
17229
- }
17230
- return parts;
17000
+ return convertObjectToJSXAttributes($1);
17231
17001
  });
17232
17002
  var JSXAttribute$1 = $TS($S(JSXAttributeName, $C(JSXAttributeInitializer, $Y(JSXAttributeSpace))), function($skip, $loc, $0, $1, $2) {
17233
17003
  var name = $1;
@@ -17247,16 +17017,73 @@ ${input.slice(result.pos)}
17247
17017
  }
17248
17018
  });
17249
17019
  var JSXAttribute$2 = $S(InsertInlineOpenBrace, DotDotDot, InlineJSXAttributeValue, InsertCloseBrace, $Y(JSXAttributeSpace));
17250
- var JSXAttribute$3 = $TS($S($EXPECT($L13, fail, 'JSXAttribute "#"'), JSXShorthandString), function($skip, $loc, $0, $1, $2) {
17020
+ var JSXAttribute$3 = $TS($S(AtThis, $E(Identifier), $Q(InlineJSXCallExpressionRest), $Y(JSXAttributeSpace)), function($skip, $loc, $0, $1, $2, $3, $4) {
17021
+ var at = $1;
17022
+ var id = $2;
17023
+ var rest = $3;
17024
+ const access = id && {
17025
+ type: "PropertyAccess",
17026
+ children: [".", id],
17027
+ name: id
17028
+ };
17029
+ const expr = module2.processCallMemberExpression({
17030
+ type: "CallExpression",
17031
+ children: [at, access, ...rest.flat()]
17032
+ });
17033
+ const last = lastAccessInCallExpression(expr);
17034
+ if (!last)
17035
+ return $skip;
17036
+ let name;
17037
+ if (last.type === "Index") {
17038
+ return [
17039
+ "{...{",
17040
+ { ...last, type: "ComputedPropertyName" },
17041
+ ": ",
17042
+ expr,
17043
+ "}}"
17044
+ ];
17045
+ } else if (last.name) {
17046
+ return [last.name, "={", expr, "}"];
17047
+ }
17048
+ return $skip;
17049
+ });
17050
+ var JSXAttribute$4 = $TS($S(Identifier, $P(InlineJSXCallExpressionRest), $Y(JSXAttributeSpace)), function($skip, $loc, $0, $1, $2, $3) {
17051
+ var id = $1;
17052
+ var rest = $2;
17053
+ const expr = module2.processCallMemberExpression({
17054
+ type: "CallExpression",
17055
+ children: [id, ...rest.flat()]
17056
+ });
17057
+ if (expr.type === "ObjectExpression") {
17058
+ return convertObjectToJSXAttributes(expr);
17059
+ }
17060
+ const last = lastAccessInCallExpression(expr);
17061
+ if (!last)
17062
+ return $skip;
17063
+ let name;
17064
+ if (last.type === "Index") {
17065
+ return [
17066
+ "{...{",
17067
+ { ...last, type: "ComputedPropertyName" },
17068
+ ": ",
17069
+ expr,
17070
+ "}}"
17071
+ ];
17072
+ } else if (last.name) {
17073
+ return [last.name, "={", expr, "}"];
17074
+ }
17075
+ return $skip;
17076
+ });
17077
+ var JSXAttribute$5 = $TS($S($EXPECT($L13, fail, 'JSXAttribute "#"'), JSXShorthandString), function($skip, $loc, $0, $1, $2) {
17251
17078
  return [" ", "id=", $2];
17252
17079
  });
17253
- var JSXAttribute$4 = $TS($S(Dot, JSXShorthandString), function($skip, $loc, $0, $1, $2) {
17080
+ var JSXAttribute$6 = $TS($S(Dot, JSXShorthandString), function($skip, $loc, $0, $1, $2) {
17254
17081
  return {
17255
17082
  type: "JSXClass",
17256
17083
  class: $2
17257
17084
  };
17258
17085
  });
17259
- var JSXAttribute$5 = $TS($S($TEXT($EXPECT($R6, fail, "JSXAttribute /[!+-]/")), JSXAttributeName), function($skip, $loc, $0, $1, $2) {
17086
+ var JSXAttribute$7 = $TS($S($TEXT($EXPECT($R6, fail, "JSXAttribute /[!+-]/")), JSXAttributeName, $Y(JSXAttributeSpace)), function($skip, $loc, $0, $1, $2, $3) {
17260
17087
  var toggle = $1;
17261
17088
  var id = $2;
17262
17089
  const value = toggle === "+" ? "true" : "false";
@@ -17273,18 +17100,18 @@ ${input.slice(result.pos)}
17273
17100
  }
17274
17101
  }
17275
17102
  if (state.tokenize) {
17276
- const result = $TOKEN("JSXAttribute", state, JSXAttribute$0(state) || JSXAttribute$1(state) || JSXAttribute$2(state) || JSXAttribute$3(state) || JSXAttribute$4(state) || JSXAttribute$5(state));
17103
+ const result = $TOKEN("JSXAttribute", state, JSXAttribute$0(state) || JSXAttribute$1(state) || JSXAttribute$2(state) || JSXAttribute$3(state) || JSXAttribute$4(state) || JSXAttribute$5(state) || JSXAttribute$6(state) || JSXAttribute$7(state));
17277
17104
  if (state.events)
17278
17105
  state.events.exit?.("JSXAttribute", state, result, eventData);
17279
17106
  return result;
17280
17107
  } else {
17281
- const result = JSXAttribute$0(state) || JSXAttribute$1(state) || JSXAttribute$2(state) || JSXAttribute$3(state) || JSXAttribute$4(state) || JSXAttribute$5(state);
17108
+ const result = JSXAttribute$0(state) || JSXAttribute$1(state) || JSXAttribute$2(state) || JSXAttribute$3(state) || JSXAttribute$4(state) || JSXAttribute$5(state) || JSXAttribute$6(state) || JSXAttribute$7(state);
17282
17109
  if (state.events)
17283
17110
  state.events.exit?.("JSXAttribute", state, result, eventData);
17284
17111
  return result;
17285
17112
  }
17286
17113
  }
17287
- var JSXAttributeSpace$0 = $R$0($EXPECT($R51, fail, "JSXAttributeSpace /[\\s>]/"));
17114
+ var JSXAttributeSpace$0 = $R$0($EXPECT($R51, fail, "JSXAttributeSpace /[\\s>]|\\/>/"));
17288
17115
  function JSXAttributeSpace(state) {
17289
17116
  let eventData;
17290
17117
  if (state.events) {
@@ -17387,12 +17214,14 @@ ${input.slice(result.pos)}
17387
17214
  var JSXAttributeValue$0 = $S(OpenBrace, PostfixedExpression, $E(Whitespace), CloseBrace);
17388
17215
  var JSXAttributeValue$1 = JSXElement;
17389
17216
  var JSXAttributeValue$2 = JSXFragment;
17390
- var JSXAttributeValue$3 = $TS($S(InsertInlineOpenBrace, InlineJSXAttributeValue, InsertCloseBrace), function($skip, $loc, $0, $1, $2, $3) {
17217
+ var JSXAttributeValue$3 = $TS($S(InsertInlineOpenBrace, InlineJSXAttributeValue, InsertCloseBrace, $Y(JSXAttributeSpace)), function($skip, $loc, $0, $1, $2, $3, $4) {
17218
+ var open = $1;
17391
17219
  var value = $2;
17220
+ var close = $3;
17392
17221
  if (value.type === "StringLiteral") {
17393
17222
  return $skip;
17394
17223
  }
17395
- return $0;
17224
+ return [open, value, close];
17396
17225
  });
17397
17226
  var JSXAttributeValue$4 = $R$0($EXPECT($R53, fail, `JSXAttributeValue /"[^"]*"|'[^']*'/`));
17398
17227
  function JSXAttributeValue(state) {
@@ -17575,12 +17404,41 @@ ${input.slice(result.pos)}
17575
17404
  return result;
17576
17405
  }
17577
17406
  }
17578
- var InlineJSXCallExpression$0 = $S($EXPECT($L14, fail, 'InlineJSXCallExpression "super"'), ExplicitArguments);
17579
- var InlineJSXCallExpression$1 = $S($EXPECT($L15, fail, 'InlineJSXCallExpression "import"'), OpenParen, PostfixedExpression, __, CloseParen);
17407
+ var InlineJSXCallExpression$0 = $TS($S($EXPECT($L14, fail, 'InlineJSXCallExpression "super"'), ExplicitArguments, $Q(InlineJSXCallExpressionRest)), function($skip, $loc, $0, $1, $2, $3) {
17408
+ var args = $2;
17409
+ var rest = $3;
17410
+ return module2.processCallMemberExpression({
17411
+ type: "CallExpression",
17412
+ children: [
17413
+ $1,
17414
+ { type: "Call", children: args },
17415
+ ...rest.flat()
17416
+ ]
17417
+ });
17418
+ });
17419
+ var InlineJSXCallExpression$1 = $TS($S($EXPECT($L15, fail, 'InlineJSXCallExpression "import"'), ExplicitArguments, $Q(InlineJSXCallExpressionRest)), function($skip, $loc, $0, $1, $2, $3) {
17420
+ var args = $2;
17421
+ var rest = $3;
17422
+ return module2.processCallMemberExpression({
17423
+ type: "CallExpression",
17424
+ children: [
17425
+ $1,
17426
+ { type: "Call", children: args },
17427
+ ...rest.flat()
17428
+ ]
17429
+ });
17430
+ });
17580
17431
  var InlineJSXCallExpression$2 = $TS($S(InlineJSXMemberExpression, $Q(InlineJSXCallExpressionRest)), function($skip, $loc, $0, $1, $2) {
17581
- if ($2.length)
17582
- return $0;
17583
- return $1;
17432
+ var member = $1;
17433
+ var rest = $2;
17434
+ if (rest.length) {
17435
+ rest = rest.flat();
17436
+ return module2.processCallMemberExpression({
17437
+ type: "CallExpression",
17438
+ children: [member, ...rest]
17439
+ });
17440
+ }
17441
+ return member;
17584
17442
  });
17585
17443
  function InlineJSXCallExpression(state) {
17586
17444
  let eventData;
@@ -17604,9 +17462,20 @@ ${input.slice(result.pos)}
17604
17462
  return result;
17605
17463
  }
17606
17464
  }
17607
- var InlineJSXCallExpressionRest$0 = MemberExpressionRest;
17608
- var InlineJSXCallExpressionRest$1 = TemplateLiteral;
17609
- var InlineJSXCallExpressionRest$2 = $S($E($C(OptionalShorthand, NonNullAssertion)), ExplicitArguments);
17465
+ var InlineJSXCallExpressionRest$0 = InlineJSXMemberExpressionRest;
17466
+ var InlineJSXCallExpressionRest$1 = $TV($C(TemplateLiteral, StringLiteral), function($skip, $loc, $0, $1) {
17467
+ if ($1.type === "StringLiteral") {
17468
+ return "`" + $1.token.slice(1, -1).replace(/(`|\$\{)/g, "\\$1") + "`";
17469
+ }
17470
+ return $1;
17471
+ });
17472
+ var InlineJSXCallExpressionRest$2 = $TS($S($E($C(OptionalShorthand, NonNullAssertion)), ExplicitArguments), function($skip, $loc, $0, $1, $2) {
17473
+ var args = $2;
17474
+ args = { type: "Call", children: args };
17475
+ if (!$1)
17476
+ return args;
17477
+ return [$1, args];
17478
+ });
17610
17479
  function InlineJSXCallExpressionRest(state) {
17611
17480
  let eventData;
17612
17481
  if (state.events) {
@@ -17629,13 +17498,16 @@ ${input.slice(result.pos)}
17629
17498
  return result;
17630
17499
  }
17631
17500
  }
17632
- var InlineJSXMemberExpression$0 = $TS($S(InlineJSXPrimaryExpression, $Q(InlineJSXMemberExpressionRest)), function($skip, $loc, $0, $1, $2) {
17633
- if ($2.length)
17634
- return $0;
17501
+ var InlineJSXMemberExpression$0 = $TS($S($C(InlineJSXPrimaryExpression, SuperProperty, MetaProperty), $Q(InlineJSXMemberExpressionRest)), function($skip, $loc, $0, $1, $2) {
17502
+ var rest = $2;
17503
+ if (rest.length || Array.isArray($1)) {
17504
+ return module2.processCallMemberExpression({
17505
+ type: "MemberExpression",
17506
+ children: [$1, ...rest].flat()
17507
+ });
17508
+ }
17635
17509
  return $1;
17636
17510
  });
17637
- var InlineJSXMemberExpression$1 = SuperProperty;
17638
- var InlineJSXMemberExpression$2 = MetaProperty;
17639
17511
  function InlineJSXMemberExpression(state) {
17640
17512
  let eventData;
17641
17513
  if (state.events) {
@@ -17647,12 +17519,12 @@ ${input.slice(result.pos)}
17647
17519
  }
17648
17520
  }
17649
17521
  if (state.tokenize) {
17650
- const result = $TOKEN("InlineJSXMemberExpression", state, InlineJSXMemberExpression$0(state) || InlineJSXMemberExpression$1(state) || InlineJSXMemberExpression$2(state));
17522
+ const result = $TOKEN("InlineJSXMemberExpression", state, InlineJSXMemberExpression$0(state));
17651
17523
  if (state.events)
17652
17524
  state.events.exit?.("InlineJSXMemberExpression", state, result, eventData);
17653
17525
  return result;
17654
17526
  } else {
17655
- const result = InlineJSXMemberExpression$0(state) || InlineJSXMemberExpression$1(state) || InlineJSXMemberExpression$2(state);
17527
+ const result = InlineJSXMemberExpression$0(state);
17656
17528
  if (state.events)
17657
17529
  state.events.exit?.("InlineJSXMemberExpression", state, result, eventData);
17658
17530
  return result;
@@ -17668,7 +17540,9 @@ ${input.slice(result.pos)}
17668
17540
  return $2;
17669
17541
  });
17670
17542
  var InlineJSXMemberExpressionRest$1 = PropertyAccess;
17671
- var InlineJSXMemberExpressionRest$2 = NonNullAssertion;
17543
+ var InlineJSXMemberExpressionRest$2 = PropertyGlob;
17544
+ var InlineJSXMemberExpressionRest$3 = PropertyBind;
17545
+ var InlineJSXMemberExpressionRest$4 = NonNullAssertion;
17672
17546
  function InlineJSXMemberExpressionRest(state) {
17673
17547
  let eventData;
17674
17548
  if (state.events) {
@@ -17680,12 +17554,12 @@ ${input.slice(result.pos)}
17680
17554
  }
17681
17555
  }
17682
17556
  if (state.tokenize) {
17683
- const result = $TOKEN("InlineJSXMemberExpressionRest", state, InlineJSXMemberExpressionRest$0(state) || InlineJSXMemberExpressionRest$1(state) || InlineJSXMemberExpressionRest$2(state));
17557
+ const result = $TOKEN("InlineJSXMemberExpressionRest", state, InlineJSXMemberExpressionRest$0(state) || InlineJSXMemberExpressionRest$1(state) || InlineJSXMemberExpressionRest$2(state) || InlineJSXMemberExpressionRest$3(state) || InlineJSXMemberExpressionRest$4(state));
17684
17558
  if (state.events)
17685
17559
  state.events.exit?.("InlineJSXMemberExpressionRest", state, result, eventData);
17686
17560
  return result;
17687
17561
  } else {
17688
- const result = InlineJSXMemberExpressionRest$0(state) || InlineJSXMemberExpressionRest$1(state) || InlineJSXMemberExpressionRest$2(state);
17562
+ const result = InlineJSXMemberExpressionRest$0(state) || InlineJSXMemberExpressionRest$1(state) || InlineJSXMemberExpressionRest$2(state) || InlineJSXMemberExpressionRest$3(state) || InlineJSXMemberExpressionRest$4(state);
17689
17563
  if (state.events)
17690
17564
  state.events.exit?.("InlineJSXMemberExpressionRest", state, result, eventData);
17691
17565
  return result;
@@ -18398,9 +18272,9 @@ ${input.slice(result.pos)}
18398
18272
  }
18399
18273
  }
18400
18274
  var NestedInterfaceProperties$0 = $TS($S(PushIndent, $Q(NestedInterfaceProperty), PopIndent), function($skip, $loc, $0, $1, $2, $3) {
18401
- var props2 = $2;
18402
- if (props2.length)
18403
- return props2;
18275
+ var props = $2;
18276
+ if (props.length)
18277
+ return props;
18404
18278
  return $skip;
18405
18279
  });
18406
18280
  function NestedInterfaceProperties(state) {
@@ -18781,23 +18655,23 @@ ${input.slice(result.pos)}
18781
18655
  }
18782
18656
  }
18783
18657
  var EnumBlock$0 = $TS($S(__, OpenBrace, NestedEnumProperties, __, CloseBrace), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
18784
- var props2 = $3;
18658
+ var props = $3;
18785
18659
  return {
18786
- properties: props2.properties,
18660
+ properties: props.properties,
18787
18661
  children: $0
18788
18662
  };
18789
18663
  });
18790
18664
  var EnumBlock$1 = $TS($S(__, OpenBrace, $Q($S(__, EnumProperty)), __, CloseBrace), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
18791
- var props2 = $3;
18665
+ var props = $3;
18792
18666
  return {
18793
- properties: props2.map((p) => p[1]),
18667
+ properties: props.map((p) => p[1]),
18794
18668
  children: $0
18795
18669
  };
18796
18670
  });
18797
18671
  var EnumBlock$2 = $TS($S(InsertOpenBrace, NestedEnumProperties, InsertNewline, InsertIndent, InsertCloseBrace), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
18798
- var props2 = $2;
18672
+ var props = $2;
18799
18673
  return {
18800
- properties: props2.properties,
18674
+ properties: props.properties,
18801
18675
  children: $0
18802
18676
  };
18803
18677
  });
@@ -18824,11 +18698,11 @@ ${input.slice(result.pos)}
18824
18698
  }
18825
18699
  }
18826
18700
  var NestedEnumProperties$0 = $TS($S(PushIndent, $Q(NestedEnumProperty), PopIndent), function($skip, $loc, $0, $1, $2, $3) {
18827
- var props2 = $2;
18828
- if (!props2.length)
18701
+ var props = $2;
18702
+ if (!props.length)
18829
18703
  return $skip;
18830
18704
  return {
18831
- properties: props2.map((p) => p.property),
18705
+ properties: props.map((p) => p.property),
18832
18706
  children: $0
18833
18707
  };
18834
18708
  });
@@ -19803,7 +19677,7 @@ ${input.slice(result.pos)}
19803
19677
  return result;
19804
19678
  }
19805
19679
  }
19806
- var TypeParameter$0 = $S(__, Identifier, $E(TypeConstraint), $E(TypeInitializer), TypeParameterDelimiter);
19680
+ var TypeParameter$0 = $S(__, $E($S($EXPECT($L129, fail, 'TypeParameter "const"'), $E(_))), Identifier, $E(TypeConstraint), $E(TypeInitializer), TypeParameterDelimiter);
19807
19681
  function TypeParameter(state) {
19808
19682
  let eventData;
19809
19683
  if (state.events) {
@@ -21000,6 +20874,7 @@ ${input.slice(result.pos)}
21000
20874
  module2.forbidIndentedApplication = [false];
21001
20875
  module2.forbidTrailingMemberProperty = [false];
21002
20876
  module2.forbidMultiLineImplicitObjectLiteral = [false];
20877
+ module2.forbidNewlineBinaryOp = [false];
21003
20878
  module2.JSXTagStack = [];
21004
20879
  module2.operators = /* @__PURE__ */ new Set();
21005
20880
  if (!module2._init) {
@@ -21035,6 +20910,12 @@ ${input.slice(result.pos)}
21035
20910
  return s[s.length - 1];
21036
20911
  }
21037
20912
  },
20913
+ newlineBinaryOpForbidden: {
20914
+ get() {
20915
+ const { forbidNewlineBinaryOp: s } = module2;
20916
+ return s[s.length - 1];
20917
+ }
20918
+ },
21038
20919
  currentJSXTag: {
21039
20920
  get() {
21040
20921
  const { JSXTagStack: s } = module2;
@@ -21302,14 +21183,14 @@ ${input.slice(result.pos)}
21302
21183
  Object.assign(module2.config, directive.config);
21303
21184
  }
21304
21185
  });
21305
- module2.processGlob = (node) => {
21186
+ module2.processCallMemberExpression = (node) => {
21306
21187
  const { children } = node;
21307
21188
  for (let i = 0; i < children.length; i++) {
21308
21189
  const glob = children[i];
21309
21190
  if (glob?.type === "PropertyGlob") {
21310
- const prefix = children.slice(0, i).concat(glob.children[0]);
21191
+ const prefix = children.slice(0, i).concat(glob.dot);
21311
21192
  const parts = [];
21312
- for (const part of glob.object.content) {
21193
+ for (const part of glob.object.properties) {
21313
21194
  if (part.type === "MethodDefinition") {
21314
21195
  throw new Error("Glob pattern cannot have method definition");
21315
21196
  }
@@ -21332,7 +21213,7 @@ ${input.slice(result.pos)}
21332
21213
  });
21333
21214
  } else {
21334
21215
  parts.push({
21335
- type: part.type,
21216
+ type: part.type === "Identifier" ? "Property" : part.type,
21336
21217
  name: part.name,
21337
21218
  value,
21338
21219
  delim: part.delim,
@@ -21354,14 +21235,29 @@ ${input.slice(result.pos)}
21354
21235
  glob.object.children[0],
21355
21236
  ...parts,
21356
21237
  glob.object.children.at(-1)
21357
- ]
21238
+ ],
21239
+ properties: parts
21358
21240
  };
21359
21241
  if (i === children.length - 1)
21360
21242
  return object;
21361
- return module2.processGlob({
21243
+ return module2.processCallMemberExpression({
21362
21244
  ...node,
21363
21245
  children: [object, ...children.slice(i + 1)]
21364
21246
  });
21247
+ } else if (glob?.type === "PropertyBind") {
21248
+ const prefix = children.slice(0, i);
21249
+ return module2.processCallMemberExpression({
21250
+ ...node,
21251
+ children: [
21252
+ prefix,
21253
+ {
21254
+ ...glob,
21255
+ type: "PropertyAccess",
21256
+ children: [...glob.children, ".bind(", prefix, ")"]
21257
+ },
21258
+ ...children.slice(i + 1)
21259
+ ]
21260
+ });
21365
21261
  }
21366
21262
  }
21367
21263
  return node;
@@ -21950,11 +21846,11 @@ ${input.slice(result.pos)}
21950
21846
  length
21951
21847
  };
21952
21848
  };
21953
- module2.reorderBindingRestProperty = function(props2) {
21954
- const names = props2.flatMap((p) => p.names);
21849
+ module2.reorderBindingRestProperty = function(props) {
21850
+ const names = props.flatMap((p) => p.names);
21955
21851
  let restIndex = -1;
21956
21852
  let restCount = 0;
21957
- props2.forEach(({ type }, i) => {
21853
+ props.forEach(({ type }, i) => {
21958
21854
  if (type === "BindingRestProperty") {
21959
21855
  if (restIndex < 0)
21960
21856
  restIndex = i;
@@ -21963,19 +21859,19 @@ ${input.slice(result.pos)}
21963
21859
  });
21964
21860
  if (restCount === 0) {
21965
21861
  return {
21966
- children: props2,
21862
+ children: props,
21967
21863
  names
21968
21864
  };
21969
21865
  } else if (restCount === 1) {
21970
- let after = props2.slice(restIndex + 1);
21971
- let rest = props2[restIndex];
21972
- props2 = props2.slice(0, restIndex);
21866
+ let after = props.slice(restIndex + 1);
21867
+ let rest = props[restIndex];
21868
+ props = props.slice(0, restIndex);
21973
21869
  if (after.length) {
21974
21870
  const [restDelim] = rest.children.slice(-1), lastAfterProp = after[after.length - 1], lastAfterChildren = lastAfterProp.children, [lastDelim] = lastAfterChildren.slice(-1);
21975
21871
  rest = { ...rest, children: [...rest.children.slice(0, -1), lastDelim] };
21976
21872
  after = [...after.slice(0, -1), { ...lastAfterProp, children: [...lastAfterChildren.slice(0, -1), restDelim] }];
21977
21873
  }
21978
- const children = [...props2, ...after, rest];
21874
+ const children = [...props, ...after, rest];
21979
21875
  return {
21980
21876
  children,
21981
21877
  names
@@ -21985,7 +21881,7 @@ ${input.slice(result.pos)}
21985
21881
  children: [{
21986
21882
  type: "Error",
21987
21883
  message: "Multiple rest properties in object pattern"
21988
- }, props2]
21884
+ }, props]
21989
21885
  };
21990
21886
  };
21991
21887
  function addParentPointers(node, parent) {
@@ -22059,7 +21955,7 @@ ${input.slice(result.pos)}
22059
21955
  gatherRecursiveAll(statements, (n) => n.type === "AtBindingProperty").forEach((binding) => {
22060
21956
  const { ref } = binding;
22061
21957
  if (asThis) {
22062
- const atBinding = binding.children[0];
21958
+ const atBinding = binding.binding;
22063
21959
  atBinding.children.pop();
22064
21960
  atBinding.type = void 0;
22065
21961
  binding.children.unshift(ref.id, ": this.", ref.base);
@@ -22305,34 +22201,11 @@ ${input.slice(result.pos)}
22305
22201
  throw new Error("Unknown postfix statement");
22306
22202
  }
22307
22203
  };
22308
- module2.convertMethodToFunction = function(method) {
22309
- const { signature, block } = method;
22310
- let { modifier } = signature;
22311
- if (modifier) {
22312
- if (modifier.get || modifier.set) {
22313
- throw new Error("cannot convert get/set method to function");
22314
- } else if (modifier.async) {
22315
- modifier = [modifier.children[0][0], " function ", ...modifier.children.slice(1)];
22316
- } else {
22317
- modifier = ["function ", ...modifier.children];
22318
- }
22319
- } else {
22320
- modifier = "function ";
22321
- }
22322
- return {
22323
- ...signature,
22324
- id: signature.name,
22325
- type: "FunctionExpression",
22326
- children: [
22327
- [modifier, ...signature.children.slice(1)],
22328
- block
22329
- ],
22330
- block
22331
- };
22332
- };
22333
22204
  function getPatternConditions(pattern, ref, conditions) {
22205
+ if (pattern.rest)
22206
+ return;
22334
22207
  switch (pattern.type) {
22335
- case "ArrayMatchingPattern": {
22208
+ case "ArrayBindingPattern": {
22336
22209
  const { elements, length } = pattern, hasRest = elements.some((e) => e.rest), comparator = hasRest ? " >= " : " === ", l = [comparator, (length - hasRest).toString()];
22337
22210
  conditions.push(
22338
22211
  ["Array.isArray(", ref, ")"],
@@ -22340,46 +22213,28 @@ ${input.slice(result.pos)}
22340
22213
  );
22341
22214
  elements.forEach(({ children: [, e] }, i) => {
22342
22215
  const subRef = [ref, "[", i.toString(), "]"];
22343
- switch (e.type) {
22344
- case "ArrayMatchingPattern":
22345
- case "ObjectMatchingPattern":
22346
- case "RegularExpressionLiteral":
22347
- getPatternConditions(e, subRef, conditions);
22348
- break;
22349
- case "BindingMatchElement":
22350
- getPatternConditions(e.match, subRef, conditions);
22351
- break;
22352
- }
22216
+ getPatternConditions(e, subRef, conditions);
22353
22217
  });
22354
22218
  const postRest = pattern.children.find((c) => c?.blockPrefix);
22355
22219
  if (postRest) {
22356
22220
  const postElements = postRest.blockPrefix.children[1], { length: postLength } = postElements;
22357
22221
  postElements.forEach(({ children: [, e] }, i) => {
22358
22222
  const subRef = [ref, "[", ref, ".length - ", (postLength + i).toString(), "]"];
22359
- switch (e.type) {
22360
- case "ArrayMatchingPattern":
22361
- case "ObjectMatchingPattern":
22362
- case "RegularExpressionLiteral":
22363
- case "Literal":
22364
- getPatternConditions(e, subRef, conditions);
22365
- break;
22366
- case "BindingMatchElement":
22367
- getPatternConditions(e.match, subRef, conditions);
22368
- break;
22369
- }
22223
+ getPatternConditions(e, subRef, conditions);
22370
22224
  });
22371
22225
  }
22372
22226
  break;
22373
22227
  }
22374
- case "ObjectMatchingPattern": {
22228
+ case "ObjectBindingPattern": {
22375
22229
  conditions.push(
22376
22230
  ["typeof ", ref, " === 'object'"],
22377
22231
  [ref, " != null"]
22378
22232
  );
22379
22233
  pattern.properties.forEach((p) => {
22380
22234
  switch (p.type) {
22381
- case "BindingMatchProperty": {
22382
- const { name, match } = p;
22235
+ case "PinProperty":
22236
+ case "BindingProperty": {
22237
+ const { name, value } = p;
22383
22238
  let subRef;
22384
22239
  switch (name.type) {
22385
22240
  case "ComputedPropertyName":
@@ -22396,16 +22251,20 @@ ${input.slice(result.pos)}
22396
22251
  conditions.push(["'", name, "' in ", ref]);
22397
22252
  subRef = [ref, ".", name];
22398
22253
  }
22399
- getPatternConditions(p.match, subRef, conditions);
22254
+ if (value) {
22255
+ getPatternConditions(value, subRef, conditions);
22256
+ }
22400
22257
  break;
22401
22258
  }
22402
- case "BindingProperty":
22403
- conditions.push(["'", p.identifier, "' in ", ref]);
22404
- break;
22405
22259
  }
22406
22260
  });
22407
22261
  break;
22408
22262
  }
22263
+ case "ConditionFragment":
22264
+ conditions.push(
22265
+ [ref, " ", pattern.children]
22266
+ );
22267
+ break;
22409
22268
  case "RegularExpressionLiteral": {
22410
22269
  conditions.push(
22411
22270
  ["typeof ", ref, " === 'string'"],
@@ -22413,13 +22272,22 @@ ${input.slice(result.pos)}
22413
22272
  );
22414
22273
  break;
22415
22274
  }
22416
- default: {
22275
+ case "PinPattern":
22276
+ conditions.push([
22277
+ ref,
22278
+ " === ",
22279
+ pattern.identifier
22280
+ ]);
22281
+ break;
22282
+ case "Literal":
22417
22283
  conditions.push([
22418
22284
  ref,
22419
22285
  " === ",
22420
22286
  pattern
22421
22287
  ]);
22422
- }
22288
+ break;
22289
+ default:
22290
+ break;
22423
22291
  }
22424
22292
  }
22425
22293
  function elideMatchersFromArrayBindings(elements) {
@@ -22428,6 +22296,7 @@ ${input.slice(result.pos)}
22428
22296
  case "Literal":
22429
22297
  case "RegularExpressionLiteral":
22430
22298
  case "StringLiteral":
22299
+ case "PinPattern":
22431
22300
  return sep;
22432
22301
  default:
22433
22302
  return [ws, nonMatcherBindings(e), sep];
@@ -22437,27 +22306,19 @@ ${input.slice(result.pos)}
22437
22306
  function elideMatchersFromPropertyBindings(properties) {
22438
22307
  return properties.map((p) => {
22439
22308
  switch (p.type) {
22440
- case "BindingMatchProperty": {
22441
- const { children, name, match } = p;
22442
- const [ws, , , , , , sep] = children;
22443
- switch (match.type) {
22444
- case "ArrayMatchingPattern":
22445
- case "ObjectMatchingPattern":
22309
+ case "BindingProperty": {
22310
+ const { children, name, value } = p;
22311
+ const [ws] = children;
22312
+ const sep = children[children.length - 1];
22313
+ switch (value && value.type) {
22314
+ case "ArrayBindingPattern":
22315
+ case "ObjectBindingPattern":
22446
22316
  return {
22447
22317
  ...p,
22448
- children: [ws, name, ": ", nonMatcherBindings(match)]
22318
+ children: [ws, name, ": ", nonMatcherBindings(value)]
22449
22319
  };
22450
22320
  case "Identifier":
22451
- switch (name.type) {
22452
- case "ComputedPropertyName":
22453
- case "Literal":
22454
- case "StringLiteral":
22455
- case "NumericLiteral":
22456
- return {
22457
- ...p,
22458
- children: [ws, name, ": ", match, sep]
22459
- };
22460
- }
22321
+ return p;
22461
22322
  case "Literal":
22462
22323
  case "RegularExpressionLiteral":
22463
22324
  case "StringLiteral":
@@ -22468,7 +22329,7 @@ ${input.slice(result.pos)}
22468
22329
  };
22469
22330
  }
22470
22331
  }
22471
- case "BindingProperty":
22332
+ case "PinProperty":
22472
22333
  case "BindingRestProperty":
22473
22334
  default:
22474
22335
  return p;
@@ -22477,7 +22338,7 @@ ${input.slice(result.pos)}
22477
22338
  }
22478
22339
  function nonMatcherBindings(pattern) {
22479
22340
  switch (pattern.type) {
22480
- case "ArrayMatchingPattern":
22341
+ case "ArrayBindingPattern":
22481
22342
  return ["[", elideMatchersFromArrayBindings(pattern.elements), "]"];
22482
22343
  case "PostRestBindingElements": {
22483
22344
  const els = elideMatchersFromArrayBindings(pattern.children[1]);
@@ -22490,19 +22351,19 @@ ${input.slice(result.pos)}
22490
22351
  ]
22491
22352
  };
22492
22353
  }
22493
- case "ObjectMatchingPattern":
22354
+ case "ObjectBindingPattern":
22494
22355
  return ["{", elideMatchersFromPropertyBindings(pattern.properties), "}"];
22495
22356
  default:
22496
22357
  return pattern;
22497
22358
  }
22498
22359
  }
22499
22360
  function aggregateDuplicateBindings(bindings) {
22500
- const props2 = gatherRecursiveAll(bindings, (n) => n.type === "BindingMatchProperty");
22361
+ const props = gatherRecursiveAll(bindings, (n) => n.type === "BindingProperty");
22501
22362
  const declarations = [];
22502
22363
  const propsGroupedByName = /* @__PURE__ */ new Map();
22503
- for (const p of props2) {
22504
- const { name } = p;
22505
- const key = name.name;
22364
+ for (const p of props) {
22365
+ const { name, value } = p;
22366
+ const key = value?.name || name.name;
22506
22367
  if (propsGroupedByName.has(key)) {
22507
22368
  propsGroupedByName.get(key).push(p);
22508
22369
  } else {
@@ -22590,10 +22451,10 @@ ${input.slice(result.pos)}
22590
22451
  };
22591
22452
  const prefix = [];
22592
22453
  switch (pattern.type) {
22593
- case "ArrayMatchingPattern":
22454
+ case "ArrayBindingPattern":
22594
22455
  if (pattern.length === 0)
22595
22456
  break;
22596
- case "ObjectMatchingPattern": {
22457
+ case "ObjectBindingPattern": {
22597
22458
  if (pattern.properties?.length === 0)
22598
22459
  break;
22599
22460
  let [splices, thisAssignments] = gatherBindingCode(pattern);
@@ -23302,6 +23163,8 @@ ${input.slice(result.pos)}
23302
23163
  var {
23303
23164
  blockWithPrefix,
23304
23165
  clone,
23166
+ convertMethodToFunction,
23167
+ convertObjectToJSXAttributes,
23305
23168
  deepCopy,
23306
23169
  findAncestor,
23307
23170
  forRange,
@@ -23317,6 +23180,7 @@ ${input.slice(result.pos)}
23317
23180
  hoistRefDecs,
23318
23181
  insertTrimmingSpace,
23319
23182
  isFunction,
23183
+ lastAccessInCallExpression,
23320
23184
  literalValue,
23321
23185
  modifyString,
23322
23186
  processCoffeeInterpolation,
@@ -23769,7 +23633,7 @@ var parse;
23769
23633
  var uncacheable;
23770
23634
  ({ parse } = import_parser.default);
23771
23635
  ({ SourceMap: SourceMap2 } = util_exports);
23772
- uncacheable = /* @__PURE__ */ new Set(["ActualAssignment", "AllowAll", "AllowClassImplicitCall", "AllowIndentedApplication", "AllowMultiLineImplicitObjectLiteral", "AllowTrailingMemberProperty", "AllowedTrailingMemberExpressions", "ApplicationStart", "Arguments", "ArgumentsWithTrailingMemberExpressions", "ArrowFunction", "ArrowFunctionTail", "AssignmentExpression", "AssignmentExpressionTail", "BinaryOpExpression", "BinaryOpRHS", "BracedBlock", "BracedObjectLiteralContent", "BracedOrEmptyBlock", "CallExpression", "CallExpressionRest", "ClassImplicitCallForbidden", "CoffeeCommentEnabled", "CommaDelimiter", "ConditionalExpression", "Declaration", "Debugger", "Dedented", "ElementListWithIndentedApplicationForbidden", "ElseClause", "Expression", "ExpressionStatement", "ExpressionWithIndentedApplicationForbidden", "ExtendedExpression", "FatArrowBody", "ForbidClassImplicitCall", "ForbidIndentedApplication", "ForbidMultiLineImplicitObjectLiteral", "ForbidTrailingMemberProperty", "FunctionDeclaration", "FunctionExpression", "HoistableDeclaration", "ImplicitArguments", "ImplicitInlineObjectPropertyDelimiter", "ImplicitNestedBlock", "IndentedApplicationAllowed", "IndentedFurther", "IndentedJSXChildExpression", "InlineObjectLiteral", "InsertIndent", "JSXChild", "JSXChildren", "JSXElement", "JSXFragment", "JSXImplicitFragment", "JSXMixedChildren", "JSXNested", "JSXNestedChildren", "JSXOptionalClosingElement", "JSXOptionalClosingFragment", "JSXTag", "LeftHandSideExpression", "MemberExpression", "MemberExpressionRest", "Nested", "NestedBindingElement", "NestedBindingElements", "NestedBlockExpression", "NestedBlockExpression", "NestedBlockStatement", "NestedBlockStatements", "NestedClassSignatureElement", "NestedClassSignatureElements", "NestedDeclareElement", "NestedDeclareElements", "NestedElement", "NestedElementList", "NestedImplicitObjectLiteral", "NestedImplicitPropertyDefinition", "NestedImplicitPropertyDefinitions", "NestedInterfaceProperty", "NestedJSXChildExpression", "NestedModuleItem", "NestedModuleItems", "NestedNonAssignmentExtendedExpression", "NestedObject", "NestedPropertyDefinitions", "NonSingleBracedBlock", "NotDedented", "ObjectLiteral", "PopIndent", "PopJSXStack", "PostfixedExpression", "PostfixedStatement", "PrimaryExpression", "PushIndent", "PushJSXOpeningElement", "PushJSXOpeningFragment", "RestoreAll", "RestoreClassImplicitCall", "RestoreMultiLineImplicitObjectLiteral", "RestoreIndentedApplication", "RestoreTrailingMemberProperty", "RHS", "Samedent", "ShortCircuitExpression", "SingleLineAssignmentExpression", "SingleLineComment", "SingleLineStatements", "SnugNamedProperty", "Statement", "StatementListItem", "SuffixedExpression", "SuffixedStatement", "ThinArrowFunction", "TrackIndented", "TrailingMemberExpressions", "TrailingMemberPropertyAllowed", "TypedJSXElement", "TypedJSXFragment", "UnaryExpression", "UpdateExpression"]);
23636
+ uncacheable = /* @__PURE__ */ new Set(["ActualAssignment", "AllowAll", "AllowClassImplicitCall", "AllowIndentedApplication", "AllowMultiLineImplicitObjectLiteral", "AllowNewlineBinaryOp", "AllowTrailingMemberProperty", "AllowedTrailingMemberExpressions", "ApplicationStart", "Arguments", "ArgumentsWithTrailingMemberExpressions", "ArrowFunction", "ArrowFunctionTail", "AssignmentExpression", "AssignmentExpressionTail", "BinaryOpExpression", "BinaryOpRHS", "BracedBlock", "BracedObjectLiteralContent", "BracedOrEmptyBlock", "CallExpression", "CallExpressionRest", "ClassImplicitCallForbidden", "CoffeeCommentEnabled", "CommaDelimiter", "ConditionalExpression", "Declaration", "Debugger", "Dedented", "ElementListWithIndentedApplicationForbidden", "ElseClause", "Expression", "ExpressionStatement", "ExpressionWithIndentedApplicationForbidden", "ExtendedExpression", "FatArrowBody", "ForbidClassImplicitCall", "ForbidIndentedApplication", "ForbidMultiLineImplicitObjectLiteral", "ForbidNewlineBinaryOp", "ForbidTrailingMemberProperty", "FunctionDeclaration", "FunctionExpression", "HoistableDeclaration", "ImplicitArguments", "ImplicitInlineObjectPropertyDelimiter", "ImplicitNestedBlock", "IndentedApplicationAllowed", "IndentedFurther", "IndentedJSXChildExpression", "InlineObjectLiteral", "InsertIndent", "JSXChild", "JSXChildren", "JSXElement", "JSXFragment", "JSXImplicitFragment", "JSXMixedChildren", "JSXNested", "JSXNestedChildren", "JSXOptionalClosingElement", "JSXOptionalClosingFragment", "JSXTag", "LeftHandSideExpression", "MemberExpression", "MemberExpressionRest", "Nested", "NestedBindingElement", "NestedBindingElements", "NestedBlockExpression", "NestedBlockExpression", "NestedBlockStatement", "NestedBlockStatements", "NestedClassSignatureElement", "NestedClassSignatureElements", "NestedDeclareElement", "NestedDeclareElements", "NestedElement", "NestedElementList", "NestedImplicitObjectLiteral", "NestedImplicitPropertyDefinition", "NestedImplicitPropertyDefinitions", "NestedInterfaceProperty", "NestedJSXChildExpression", "NestedModuleItem", "NestedModuleItems", "NestedNonAssignmentExtendedExpression", "NestedObject", "NestedPropertyDefinitions", "NewlineBinaryOpAllowed", "NonSingleBracedBlock", "NotDedented", "ObjectLiteral", "PopIndent", "PopJSXStack", "PostfixedExpression", "PostfixedStatement", "PrimaryExpression", "PushIndent", "PushJSXOpeningElement", "PushJSXOpeningFragment", "RestoreAll", "RestoreClassImplicitCall", "RestoreMultiLineImplicitObjectLiteral", "RestoreIndentedApplication", "RestoreTrailingMemberProperty", "RestoreNewlineBinaryOp", "RHS", "Samedent", "ShortCircuitExpression", "SingleLineAssignmentExpression", "SingleLineBinaryOpRHS", "SingleLineComment", "SingleLineStatements", "SnugNamedProperty", "Statement", "StatementListItem", "SuffixedExpression", "SuffixedStatement", "ThinArrowFunction", "TrackIndented", "TrailingMemberExpressions", "TrailingMemberPropertyAllowed", "TypedJSXElement", "TypedJSXFragment", "UnaryExpression", "UpdateExpression"]);
23773
23637
  var compile = function(src, options) {
23774
23638
  var ast, code, events, filename, ref, result, sm;
23775
23639
  if (!options) {