@danielx/civet 0.10.7 → 0.11.1

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
@@ -29,9 +29,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
29
29
  ));
30
30
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
31
31
 
32
- // ../Hera/dist/machine.js
32
+ // node_modules/@danielx/hera/dist/machine.js
33
33
  var require_machine = __commonJS({
34
- "../Hera/dist/machine.js"(exports2, module2) {
34
+ "node_modules/@danielx/hera/dist/machine.js"(exports2, module2) {
35
35
  "use strict";
36
36
  var __defProp2 = Object.defineProperty;
37
37
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -624,7 +624,7 @@ function addParentPointers(node, parent) {
624
624
  node.parent = parent;
625
625
  }
626
626
  if (node.children) {
627
- for (let ref = node.children, i1 = 0, len1 = ref.length; i1 < len1; i1++) {
627
+ for (let ref = node.children, i1 = 0, len12 = ref.length; i1 < len12; i1++) {
628
628
  const child = ref[i1];
629
629
  addParentPointers(child, node);
630
630
  }
@@ -1608,7 +1608,7 @@ function findChildIndex(parent, child) {
1608
1608
  }
1609
1609
  }
1610
1610
  function arrayRecurse(array) {
1611
- for (let i2 = 0, len1 = array.length; i2 < len1; i2++) {
1611
+ for (let i2 = 0, len12 = array.length; i2 < len12; i2++) {
1612
1612
  const c = array[i2];
1613
1613
  if (c === child || Array.isArray(c) && arrayRecurse(c)) {
1614
1614
  return true;
@@ -1815,7 +1815,7 @@ function adjustBindingElements(elements) {
1815
1815
  const names = elements.flatMap(($2) => $2.names || []);
1816
1816
  const { length } = elements;
1817
1817
  let blockPrefix, restIndex = -1, restCount = 0;
1818
- for (let i2 = 0, len1 = elements.length; i2 < len1; i2++) {
1818
+ for (let i2 = 0, len12 = elements.length; i2 < len12; i2++) {
1819
1819
  const i = i2;
1820
1820
  const { type } = elements[i2];
1821
1821
  if (type === "BindingRestElement") {
@@ -3074,7 +3074,7 @@ function patternBindings(pattern) {
3074
3074
  function recurse(pattern2) {
3075
3075
  switch (pattern2.type) {
3076
3076
  case "ArrayBindingPattern": {
3077
- for (let ref3 = pattern2.elements, i2 = 0, len1 = ref3.length; i2 < len1; i2++) {
3077
+ for (let ref3 = pattern2.elements, i2 = 0, len12 = ref3.length; i2 < len12; i2++) {
3078
3078
  const element = ref3[i2];
3079
3079
  recurse(element);
3080
3080
  }
@@ -4077,14 +4077,23 @@ function expressionizeIteration(exp) {
4077
4077
  if (generator) {
4078
4078
  iterationDefaultBody(statement);
4079
4079
  assignResults(block, (node) => {
4080
+ let star;
4081
+ if (node && typeof node === "object" && "type" in node && node.type === "SpreadElement" && "expression" in node) {
4082
+ const { expression } = node;
4083
+ star = "*";
4084
+ node = expression;
4085
+ }
4080
4086
  return {
4081
4087
  type: "YieldExpression",
4082
4088
  expression: node,
4089
+ star,
4083
4090
  children: [
4084
4091
  {
4085
4092
  type: "Yield",
4086
- token: "yield "
4093
+ children: ["yield"]
4087
4094
  },
4095
+ star,
4096
+ " ",
4088
4097
  node
4089
4098
  ]
4090
4099
  };
@@ -4278,6 +4287,17 @@ function braceBlock(block) {
4278
4287
  }
4279
4288
  }
4280
4289
  }
4290
+ function unbraceBlock(block) {
4291
+ if (block.bare) {
4292
+ return;
4293
+ }
4294
+ let ref;
4295
+ if (block.children[0] === " {" && (ref = block.children)[ref.length - 1] === "}") {
4296
+ block.children.shift();
4297
+ block.children.pop();
4298
+ block.bare = true;
4299
+ }
4300
+ }
4281
4301
  function duplicateBlock(block) {
4282
4302
  const expressions = [...block.expressions];
4283
4303
  let children;
@@ -4376,16 +4396,58 @@ function insertHoistDec(block, node, dec) {
4376
4396
  }
4377
4397
  function processBlocks(statements) {
4378
4398
  insertSemicolon(statements);
4379
- for (let ref = gatherRecursive(statements, ($) => $.type === "BlockStatement"), i2 = 0, len1 = ref.length; i2 < len1; i2++) {
4380
- const { expressions } = ref[i2];
4381
- processBlocks(expressions);
4399
+ for (let ref1 = gatherRecursive(statements, ($) => $.type === "BlockStatement"), i2 = 0, len12 = ref1.length; i2 < len12; i2++) {
4400
+ const block = ref1[i2];
4401
+ let m;
4402
+ if (block.unwrapObject && block.expressions.length === 1 && (m = block.expressions[0][1], typeof m === "object" && m != null && "type" in m && m.type === "ParenthesizedExpression" && "implicit" in m && m.implicit === true && "expression" in m && typeof m.expression === "object" && m.expression != null && "type" in m.expression && m.expression.type === "ObjectExpression")) {
4403
+ const object = block.expressions[0][1].expression;
4404
+ if (!(() => {
4405
+ let results = true;
4406
+ for (const prop of object.properties) {
4407
+ if (!(prop.type === "Property" && prop.implicitName)) {
4408
+ results = false;
4409
+ break;
4410
+ }
4411
+ }
4412
+ return results;
4413
+ })()) {
4414
+ continue;
4415
+ }
4416
+ block.expressions[0][1] = block.expressions[0][1].expression;
4417
+ unbraceBlock(block);
4418
+ for (let ref2 = object.properties, i3 = 0, len22 = ref2.length; i3 < len22; i3++) {
4419
+ const i = i3;
4420
+ const prop = ref2[i3];
4421
+ let m1;
4422
+ if (m1 = prop.name, typeof m1 === "object" && m1 != null && "type" in m1 && m1.type === "ComputedPropertyName" && "implicit" in m1 && m1.implicit === true) {
4423
+ replaceNode(prop.name, prop.name.expression, prop);
4424
+ }
4425
+ if (prop.delim?.implicit) {
4426
+ if (needsPrecedingSemicolon(object.properties[i + 1])) {
4427
+ prop.delim.token = ";";
4428
+ } else {
4429
+ replaceNode(prop.delim, void 0, prop);
4430
+ prop.delim = void 0;
4431
+ }
4432
+ }
4433
+ const colon = prop.children.indexOf(": ");
4434
+ if (colon < 0) {
4435
+ continue;
4436
+ }
4437
+ if (!(prop.children[colon - 1] === prop.name)) {
4438
+ continue;
4439
+ }
4440
+ prop.children.splice(colon - 1, 2);
4441
+ }
4442
+ }
4443
+ processBlocks(block.expressions);
4382
4444
  }
4383
4445
  }
4384
4446
  function insertSemicolon(statements) {
4385
4447
  const l = statements.length;
4386
- for (let i3 = 0, len22 = statements.length; i3 < len22; i3++) {
4387
- const i = i3;
4388
- const s = statements[i3];
4448
+ for (let i4 = 0, len3 = statements.length; i4 < len3; i4++) {
4449
+ const i = i4;
4450
+ const s = statements[i4];
4389
4451
  if (i < l - 1) {
4390
4452
  if (needsPrecedingSemicolon(statements[i + 1][1])) {
4391
4453
  const delim = s[2];
@@ -4403,8 +4465,8 @@ function needsPrecedingSemicolon(exp) {
4403
4465
  return false;
4404
4466
  }
4405
4467
  if (Array.isArray(exp)) {
4406
- for (let i4 = 0, len3 = exp.length; i4 < len3; i4++) {
4407
- const child = exp[i4];
4468
+ for (let i5 = 0, len4 = exp.length; i5 < len4; i5++) {
4469
+ const child = exp[i5];
4408
4470
  if (!(child != null)) {
4409
4471
  continue;
4410
4472
  }
@@ -4450,8 +4512,8 @@ function needsPrecedingSemicolon(exp) {
4450
4512
  function blockContainingStatement(exp) {
4451
4513
  let child = exp;
4452
4514
  let parent = exp.parent;
4453
- let m;
4454
- while (parent != null && (m = parent.type, m === "StatementExpression" || m === "PipelineExpression" || m === "UnwrappedExpression")) {
4515
+ let m2;
4516
+ while (parent != null && (m2 = parent.type, m2 === "StatementExpression" || m2 === "PipelineExpression" || m2 === "UnwrappedExpression")) {
4455
4517
  child = parent;
4456
4518
  parent = parent.parent;
4457
4519
  }
@@ -4504,7 +4566,7 @@ var precedenceMap = /* @__PURE__ */ new Map();
4504
4566
  for (let i1 = 0, len3 = precedenceOrder.length; i1 < len3; i1++) {
4505
4567
  const prec = i1;
4506
4568
  const ops = precedenceOrder[i1];
4507
- for (let i2 = 0, len1 = ops.length; i2 < len1; i2++) {
4569
+ for (let i2 = 0, len12 = ops.length; i2 < len12; i2++) {
4508
4570
  const op = ops[i2];
4509
4571
  precedenceMap.set(op, prec);
4510
4572
  }
@@ -4526,6 +4588,19 @@ function getPrecedence(op) {
4526
4588
  return precedenceMap.get(op.prec ?? op.token) ?? (op.relational ? precedenceRelational : precedenceCustomDefault);
4527
4589
  }
4528
4590
  }
4591
+ function isShortCircuitOp(op) {
4592
+ if (op && typeof op === "object" && "token" in op) {
4593
+ const { token } = op;
4594
+ return isShortCircuitOp(token);
4595
+ } else if (typeof op === "string") {
4596
+ if (op.endsWith("=") && !op.endsWith("==")) {
4597
+ op = op.slice(0, -1);
4598
+ }
4599
+ return op === "||" || op === "&&" || op === "??";
4600
+ } else {
4601
+ return false;
4602
+ }
4603
+ }
4529
4604
  function processBinaryOpExpression($0) {
4530
4605
  return processExpandedBinaryOpExpression(expandChainedComparisons($0));
4531
4606
  }
@@ -4835,7 +4910,7 @@ function processPatternMatching(statements) {
4835
4910
  let isPattern = false;
4836
4911
  if (clauses.some(($4) => $4.type === "PatternClause")) {
4837
4912
  isPattern = true;
4838
- for (let i2 = 0, len1 = clauses.length; i2 < len1; i2++) {
4913
+ for (let i2 = 0, len12 = clauses.length; i2 < len12; i2++) {
4839
4914
  const c = clauses[i2];
4840
4915
  if (!(c.type === "PatternClause" || c.type === "DefaultClause")) {
4841
4916
  errors = true;
@@ -5369,7 +5444,7 @@ function processAssignmentDeclaration(decl, pattern, typeSuffix, ws, assign, e)
5369
5444
  });
5370
5445
  }
5371
5446
  function processDeclarations(statements) {
5372
- for (let ref1 = gatherRecursiveAll(statements, ($) => $.type === "Declaration"), i1 = 0, len1 = ref1.length; i1 < len1; i1++) {
5447
+ for (let ref1 = gatherRecursiveAll(statements, ($) => $.type === "Declaration"), i1 = 0, len12 = ref1.length; i1 < len12; i1++) {
5373
5448
  const declaration = ref1[i1];
5374
5449
  const { bindings } = declaration;
5375
5450
  if (!(bindings != null)) {
@@ -5456,7 +5531,7 @@ function prependStatementExpressionBlock(initializer, statement) {
5456
5531
  }
5457
5532
  const pre = [];
5458
5533
  const statementExp = exp.statement;
5459
- const blockStatement = ["", statementExp];
5534
+ const blockStatement = [ws || "", statementExp, ";"];
5460
5535
  let ref;
5461
5536
  if (statementExp.type === "IterationExpression") {
5462
5537
  if (statementExp.async || statementExp.generator) {
@@ -5478,9 +5553,9 @@ function prependStatementExpressionBlock(initializer, statement) {
5478
5553
  });
5479
5554
  const refDec = {
5480
5555
  type: "Declaration",
5481
- children: ["let ", ref, ";"]
5556
+ children: ["let ", ref]
5482
5557
  };
5483
- pre.unshift(refDec);
5558
+ pre.unshift(["", refDec, ";"]);
5484
5559
  } else {
5485
5560
  wrapIterationReturningResults(statement2, () => void 0);
5486
5561
  ref = initializer.expression = initializer.children[2] = statement2.resultsRef;
@@ -5496,14 +5571,11 @@ function prependStatementExpressionBlock(initializer, statement) {
5496
5571
  });
5497
5572
  const refDec = {
5498
5573
  type: "Declaration",
5499
- children: ["let ", ref, ";"]
5574
+ children: ["let ", ref]
5500
5575
  };
5501
- pre.unshift(refDec);
5502
- if (ws) {
5503
- pre.push(ws);
5504
- }
5576
+ pre.unshift(["", refDec, ";"]);
5505
5577
  }
5506
- statement.children.unshift(pre, blockStatement, ";");
5578
+ statement.children.unshift(...pre, blockStatement);
5507
5579
  updateParentPointers(blockStatement, statement);
5508
5580
  return ref;
5509
5581
  }
@@ -5824,26 +5896,60 @@ function dynamizeImportDeclaration(decl) {
5824
5896
  };
5825
5897
  }
5826
5898
  function dynamizeImportDeclarationExpression($0) {
5827
- const [imp, ws1, named, ws2, from] = $0;
5828
- const object = convertNamedImportsToObject(named);
5829
- const dot = ".";
5830
- return processCallMemberExpression({
5831
- type: "CallExpression",
5899
+ const [imp, ws1, imports, ws2, from] = $0;
5900
+ const awaitExpression = {
5901
+ type: "AwaitExpression",
5832
5902
  children: [
5833
- { type: "Await", children: "await" },
5903
+ { type: "Await", children: ["await"] },
5834
5904
  " ",
5835
5905
  imp,
5836
5906
  trimFirstSpace(ws2),
5837
- dynamizeFromClause(from),
5838
- {
5839
- type: "PropertyGlob",
5840
- dot,
5841
- object,
5842
- children: [ws1, dot, object],
5843
- reversed: true
5844
- }
5907
+ dynamizeFromClause(from)
5845
5908
  ]
5846
- });
5909
+ };
5910
+ const dot = {
5911
+ type: "AccessStart",
5912
+ children: ["."],
5913
+ optional: false
5914
+ };
5915
+ switch (imports?.type) {
5916
+ case "Identifier": {
5917
+ return processCallMemberExpression({
5918
+ type: "CallExpression",
5919
+ children: [
5920
+ parenthesizeExpression(awaitExpression),
5921
+ {
5922
+ type: "PropertyAccess",
5923
+ dot,
5924
+ name: "default",
5925
+ children: [ws1, dot, "default"]
5926
+ }
5927
+ ]
5928
+ });
5929
+ }
5930
+ case "Star": {
5931
+ return parenthesizeExpression(awaitExpression);
5932
+ }
5933
+ case "Declaration": {
5934
+ const object = convertNamedImportsToObject(imports);
5935
+ return processCallMemberExpression({
5936
+ type: "CallExpression",
5937
+ children: [
5938
+ parenthesizeExpression(awaitExpression),
5939
+ {
5940
+ type: "PropertyGlob",
5941
+ dot,
5942
+ object,
5943
+ children: [ws1, dot, object],
5944
+ reversed: true
5945
+ }
5946
+ ]
5947
+ });
5948
+ }
5949
+ default: {
5950
+ throw new Error("Unsupported dynamic import");
5951
+ }
5952
+ }
5847
5953
  }
5848
5954
  function convertWithClause(withClause, extendsClause) {
5849
5955
  let extendsToken, extendsTarget, ws;
@@ -6143,7 +6249,7 @@ function processPipelineExpressions(statements) {
6143
6249
  const children = [ws];
6144
6250
  const comma = blockContainingStatement(s) ? ";" : ",";
6145
6251
  let usingRef = null;
6146
- for (let i2 = 0, len1 = body.length; i2 < len1; i2++) {
6252
+ for (let i2 = 0, len12 = body.length; i2 < len12; i2++) {
6147
6253
  const i = i2;
6148
6254
  const step = body[i2];
6149
6255
  const [leadingComment, pipe, trailingComment, expr] = step;
@@ -6935,7 +7041,7 @@ function dedentBlockSubstitutions($0, tab) {
6935
7041
  }
6936
7042
  const stringPart = (() => {
6937
7043
  const results1 = [];
6938
- for (let i2 = 0, len1 = strWithSubstitutions.length; i2 < len1; i2++) {
7044
+ for (let i2 = 0, len12 = strWithSubstitutions.length; i2 < len12; i2++) {
6939
7045
  const part = strWithSubstitutions[i2];
6940
7046
  results1.push(part.token ?? "s");
6941
7047
  }
@@ -7025,6 +7131,9 @@ function quoteString(str) {
7025
7131
 
7026
7132
  // unplugin-civet:C:\Users\edemaine\Projects\Civet\source\parser\lib.civet.jsx
7027
7133
  var xor = (a, b) => a ? !b && a : b;
7134
+ function len1(arr, length) {
7135
+ return arr.length === length;
7136
+ }
7028
7137
  function addPostfixStatement(statement, ws, post) {
7029
7138
  const expressions = [
7030
7139
  ...post.blockPrefix || [],
@@ -7402,7 +7511,7 @@ function processCallMemberExpression(node) {
7402
7511
  isComma(args[args.length - 1]).token = "";
7403
7512
  }
7404
7513
  let commaCount = 0;
7405
- for (let i2 = 0, len1 = args.length; i2 < len1; i2++) {
7514
+ for (let i2 = 0, len22 = args.length; i2 < len22; i2++) {
7406
7515
  const i = i2;
7407
7516
  let arg = args[i2];
7408
7517
  if (isComma(arg)) {
@@ -7432,19 +7541,22 @@ function processCallMemberExpression(node) {
7432
7541
  }
7433
7542
  }
7434
7543
  }
7435
- for (let i3 = 0, len22 = children.length; i3 < len22; i3++) {
7544
+ for (let i3 = 0, len3 = children.length; i3 < len3; i3++) {
7436
7545
  const i = i3;
7437
7546
  const glob = children[i3];
7438
7547
  if (glob?.type === "PropertyGlob") {
7439
7548
  let prefix = children.slice(0, i);
7440
7549
  const parts = [];
7441
7550
  let ref;
7442
- if (prefix.length > 1 && glob.object.properties.length > 1) {
7551
+ if (needsRef(prefix) && glob.object.properties.length > 1) {
7552
+ if (Array.isArray(prefix) && len1(prefix, 1) && typeof prefix[0] === "object" && prefix[0] != null && "type" in prefix[0] && prefix[0].type === "ParenthesizedExpression" && "implicit" in prefix[0] && prefix[0].implicit === true) {
7553
+ prefix = [prefix[0].expression];
7554
+ }
7443
7555
  ref = makeRef();
7444
7556
  const { refAssignment } = makeRefAssignment(ref, prefix);
7445
7557
  prefix = [makeLeftHandSideExpression(refAssignment)];
7446
7558
  }
7447
- prefix = prefix.concat(glob.dot);
7559
+ let prefixDot = [...prefix, glob.dot];
7448
7560
  for (const part of glob.object.properties) {
7449
7561
  if (part.type === "Error") {
7450
7562
  parts.push(part);
@@ -7457,7 +7569,7 @@ function processCallMemberExpression(node) {
7457
7569
  });
7458
7570
  continue;
7459
7571
  }
7460
- if (part.value && !["CallExpression", "MemberExpression", "Identifier"].includes(part.value.type)) {
7572
+ if (part.value && !["CallExpression", "MemberExpression", "Identifier", "StringLiteral", "ComputedPropertyName"].includes(part.value.type)) {
7461
7573
  parts.push({
7462
7574
  type: "Error",
7463
7575
  message: `Glob pattern must have call or member expression value, found ${JSON.stringify(part.value)}`
@@ -7473,9 +7585,28 @@ function processCallMemberExpression(node) {
7473
7585
  [name, value] = [value, name];
7474
7586
  }
7475
7587
  if (!suppressPrefix) {
7476
- value = prefix.concat(trimFirstSpace(value));
7588
+ if (value.type === "StringLiteral") {
7589
+ value = [
7590
+ ...prefix,
7591
+ {
7592
+ type: "Index",
7593
+ children: ["[", trimFirstSpace(value), "]"]
7594
+ }
7595
+ ];
7596
+ } else if (value.type === "ComputedPropertyName") {
7597
+ value = [
7598
+ ...prefix,
7599
+ {
7600
+ type: "Index",
7601
+ children: [trimFirstSpace(value)]
7602
+ }
7603
+ ];
7604
+ } else {
7605
+ value = [...prefixDot, trimFirstSpace(value)];
7606
+ }
7477
7607
  if (ref != null) {
7478
- prefix = [ref].concat(glob.dot);
7608
+ prefix = [ref];
7609
+ prefixDot = [...prefix, glob.dot];
7479
7610
  }
7480
7611
  }
7481
7612
  if (wValue) value.unshift(wValue);
@@ -7878,7 +8009,7 @@ function processBindingPatternLHS(lhs, tail) {
7878
8009
  );
7879
8010
  }
7880
8011
  function processAssignments(statements) {
7881
- for (let ref8 = gatherRecursiveAll(statements, ($4) => $4.type === "AssignmentExpression" || $4.type === "UpdateExpression"), i5 = 0, len3 = ref8.length; i5 < len3; i5++) {
8012
+ for (let ref8 = gatherRecursiveAll(statements, ($4) => $4.type === "AssignmentExpression" || $4.type === "UpdateExpression"), i5 = 0, len4 = ref8.length; i5 < len4; i5++) {
7882
8013
  let extractAssignment = function(lhs) {
7883
8014
  let expr = lhs;
7884
8015
  while (expr.type === "ParenthesizedExpression") {
@@ -7907,7 +8038,7 @@ function processAssignments(statements) {
7907
8038
  if (!exp.lhs) {
7908
8039
  continue;
7909
8040
  }
7910
- for (let ref10 = exp.lhs, i6 = 0, len4 = ref10.length; i6 < len4; i6++) {
8041
+ for (let ref10 = exp.lhs, i6 = 0, len5 = ref10.length; i6 < len5; i6++) {
7911
8042
  const lhsPart = ref10[i6];
7912
8043
  let ref11;
7913
8044
  if (ref11 = extractAssignment(lhsPart[1])) {
@@ -7952,7 +8083,7 @@ function processAssignments(statements) {
7952
8083
  }
7953
8084
  }
7954
8085
  }
7955
- for (let ref12 = gatherRecursiveAll(statements, ($6) => $6.type === "AssignmentExpression"), i7 = 0, len5 = ref12.length; i7 < len5; i7++) {
8086
+ for (let ref12 = gatherRecursiveAll(statements, ($6) => $6.type === "AssignmentExpression"), i7 = 0, len6 = ref12.length; i7 < len6; i7++) {
7956
8087
  const exp = ref12[i7];
7957
8088
  if (!(exp.names === null)) {
7958
8089
  continue;
@@ -7960,14 +8091,15 @@ function processAssignments(statements) {
7960
8091
  let { lhs: $1, expression: $2 } = exp, tail = [], len3 = $1.length;
7961
8092
  let block;
7962
8093
  let ref13;
7963
- if (blockContainingStatement(exp) && !(ref13 = $1[$1.length - 1])?.[ref13.length - 1]?.special) {
8094
+ let ref14;
8095
+ if (blockContainingStatement(exp) && !(ref13 = $1[$1.length - 1])?.[ref13.length - 1]?.special && !isShortCircuitOp((ref14 = $1[$1.length - 1])?.[ref14.length - 1])) {
7964
8096
  block = makeBlockFragment();
7965
- let ref14;
7966
- if (ref14 = prependStatementExpressionBlock(
8097
+ let ref15;
8098
+ if (ref15 = prependStatementExpressionBlock(
7967
8099
  { type: "Initializer", expression: $2, children: [void 0, void 0, $2] },
7968
8100
  block
7969
8101
  )) {
7970
- const ref = ref14;
8102
+ const ref = ref15;
7971
8103
  exp.children = exp.children.map(($7) => $7 === $2 ? ref : $7);
7972
8104
  $2 = ref;
7973
8105
  } else {
@@ -8023,7 +8155,7 @@ function processAssignments(statements) {
8023
8155
  c[1] = start;
8024
8156
  c[2] = ", ";
8025
8157
  if (end) {
8026
- c[3] = [end, " - ", start];
8158
+ c[3] = [makeLeftHandSideExpression(end), " - ", makeLeftHandSideExpression(start)];
8027
8159
  } else {
8028
8160
  c[3] = ["1/0"];
8029
8161
  }
@@ -8148,9 +8280,9 @@ function unchainOptionalMemberExpression(exp, ref, innerExp) {
8148
8280
  }
8149
8281
  j++;
8150
8282
  }
8151
- let ref15;
8152
- if (ref15 = conditions.length) {
8153
- const l = ref15;
8283
+ let ref16;
8284
+ if (ref16 = conditions.length) {
8285
+ const l = ref16;
8154
8286
  const cs = flatJoin(conditions, " && ");
8155
8287
  return {
8156
8288
  ...exp,
@@ -8186,8 +8318,8 @@ function attachPostfixStatementAsExpression(exp, post) {
8186
8318
  }
8187
8319
  function processTypes(node) {
8188
8320
  const results1 = [];
8189
- for (let ref16 = gatherRecursiveAll(node, ($11) => $11.type === "TypeUnary"), i8 = 0, len6 = ref16.length; i8 < len6; i8++) {
8190
- const unary = ref16[i8];
8321
+ for (let ref17 = gatherRecursiveAll(node, ($11) => $11.type === "TypeUnary"), i8 = 0, len7 = ref17.length; i8 < len7; i8++) {
8322
+ const unary = ref17[i8];
8191
8323
  let suffixIndex = unary.suffix.length - 1;
8192
8324
  const results2 = [];
8193
8325
  while (suffixIndex >= 0) {
@@ -8266,10 +8398,10 @@ function processTypes(node) {
8266
8398
  const outer = unary.suffix.splice(suffixIndex + 1, Infinity);
8267
8399
  const space = getTrimmingSpace(unary);
8268
8400
  inplaceInsertTrimmingSpace(unary, "");
8269
- let ref17;
8270
- if (unary.suffix.length) ref17 = unary;
8271
- else ref17 = unary.t;
8272
- const t = ref17;
8401
+ let ref18;
8402
+ if (unary.suffix.length) ref18 = unary;
8403
+ else ref18 = unary.t;
8404
+ const t = ref18;
8273
8405
  const arg = makeNode({
8274
8406
  type: "TypeArgument",
8275
8407
  ts: true,
@@ -8314,18 +8446,18 @@ function processTypes(node) {
8314
8446
  return results1;
8315
8447
  }
8316
8448
  function processStatementExpressions(statements) {
8317
- for (let ref18 = gatherRecursiveAll(statements, ($12) => $12.type === "StatementExpression"), i9 = 0, len7 = ref18.length; i9 < len7; i9++) {
8318
- const exp = ref18[i9];
8449
+ for (let ref19 = gatherRecursiveAll(statements, ($12) => $12.type === "StatementExpression"), i9 = 0, len8 = ref19.length; i9 < len8; i9++) {
8450
+ const exp = ref19[i9];
8319
8451
  const { maybe, statement } = exp;
8320
8452
  if ((maybe || statement.type === "ThrowStatement") && blockContainingStatement(exp)) {
8321
8453
  replaceNode(exp, statement);
8322
8454
  continue;
8323
8455
  }
8324
- let ref19;
8456
+ let ref20;
8325
8457
  switch (statement.type) {
8326
8458
  case "IfStatement": {
8327
- if (ref19 = expressionizeIfStatement(statement)) {
8328
- const expression = ref19;
8459
+ if (ref20 = expressionizeIfStatement(statement)) {
8460
+ const expression = ref20;
8329
8461
  replaceNode(statement, expression, exp);
8330
8462
  } else {
8331
8463
  replaceNode(statement, wrapIIFE([["", statement]]), exp);
@@ -8384,13 +8516,13 @@ function processNegativeIndexAccess(statements) {
8384
8516
  });
8385
8517
  }
8386
8518
  function processFinallyClauses(statements) {
8387
- for (let ref20 = gatherRecursiveAll(statements, ($) => $.type === "FinallyClause" && $.parent?.type !== "TryStatement"), i10 = 0, len8 = ref20.length; i10 < len8; i10++) {
8388
- let f = ref20[i10];
8389
- let ref21;
8390
- if (!((ref21 = blockContainingStatement(f)) && typeof ref21 === "object" && "block" in ref21 && "index" in ref21)) {
8519
+ for (let ref21 = gatherRecursiveAll(statements, ($) => $.type === "FinallyClause" && $.parent?.type !== "TryStatement"), i10 = 0, len9 = ref21.length; i10 < len9; i10++) {
8520
+ let f = ref21[i10];
8521
+ let ref22;
8522
+ if (!((ref22 = blockContainingStatement(f)) && typeof ref22 === "object" && "block" in ref22 && "index" in ref22)) {
8391
8523
  throw new Error("finally clause must be inside try statement or block");
8392
8524
  }
8393
- const { block, index } = ref21;
8525
+ const { block, index } = ref22;
8394
8526
  const indent = block.expressions[index][0];
8395
8527
  const expressions = block.expressions.slice(index + 1);
8396
8528
  const t = makeNode({
@@ -8462,8 +8594,8 @@ function processBreaksContinues(statements) {
8462
8594
  }
8463
8595
  }
8464
8596
  function processCoffeeClasses(statements) {
8465
- for (let ref22 = gatherRecursiveAll(statements, ($13) => $13.type === "ClassExpression"), i11 = 0, len9 = ref22.length; i11 < len9; i11++) {
8466
- const ce = ref22[i11];
8597
+ for (let ref23 = gatherRecursiveAll(statements, ($13) => $13.type === "ClassExpression"), i11 = 0, len10 = ref23.length; i11 < len10; i11++) {
8598
+ const ce = ref23[i11];
8467
8599
  const { expressions } = ce.body;
8468
8600
  const indent = expressions[0]?.[0] ?? "\n";
8469
8601
  const autoBinds = expressions.filter(($14) => $14[1]?.autoBind);
@@ -8507,7 +8639,7 @@ function processCoffeeClasses(statements) {
8507
8639
  0,
8508
8640
  ...(() => {
8509
8641
  const results3 = [];
8510
- for (let i12 = 0, len10 = autoBinds.length; i12 < len10; i12++) {
8642
+ for (let i12 = 0, len11 = autoBinds.length; i12 < len11; i12++) {
8511
8643
  const [, a] = autoBinds[i12];
8512
8644
  results3.push([indent, ["this.", a.name, " = this.", a.name, ".bind(this)"], ";"]);
8513
8645
  }
@@ -8623,8 +8755,8 @@ async function processProgramAsync(root) {
8623
8755
  function processRepl(root, rootIIFE) {
8624
8756
  const topBlock = gatherRecursive(rootIIFE, ($21) => $21.type === "BlockStatement")[0];
8625
8757
  let i = 0;
8626
- for (let ref23 = gatherRecursiveWithinFunction(topBlock, ($22) => $22.type === "Declaration"), i14 = 0, len11 = ref23.length; i14 < len11; i14++) {
8627
- const decl = ref23[i14];
8758
+ for (let ref24 = gatherRecursiveWithinFunction(topBlock, ($22) => $22.type === "Declaration"), i14 = 0, len12 = ref24.length; i14 < len12; i14++) {
8759
+ const decl = ref24[i14];
8628
8760
  if (!decl.names?.length) {
8629
8761
  continue;
8630
8762
  }
@@ -8637,8 +8769,8 @@ function processRepl(root, rootIIFE) {
8637
8769
  root.expressions.splice(i++, 0, ["", `var ${decl.names.join(",")}`, ";"]);
8638
8770
  }
8639
8771
  }
8640
- for (let ref24 = gatherRecursive(topBlock, ($23) => $23.type === "FunctionExpression"), i15 = 0, len12 = ref24.length; i15 < len12; i15++) {
8641
- const func = ref24[i15];
8772
+ for (let ref25 = gatherRecursive(topBlock, ($23) => $23.type === "FunctionExpression"), i15 = 0, len13 = ref25.length; i15 < len13; i15++) {
8773
+ const func = ref25[i15];
8642
8774
  if (func.name && func.parent?.type === "BlockStatement") {
8643
8775
  if (func.parent === topBlock) {
8644
8776
  replaceNode(func, void 0);
@@ -8650,8 +8782,8 @@ function processRepl(root, rootIIFE) {
8650
8782
  }
8651
8783
  }
8652
8784
  }
8653
- for (let ref25 = gatherRecursiveWithinFunction(topBlock, ($24) => $24.type === "ClassExpression"), i16 = 0, len13 = ref25.length; i16 < len13; i16++) {
8654
- const classExp = ref25[i16];
8785
+ for (let ref26 = gatherRecursiveWithinFunction(topBlock, ($24) => $24.type === "ClassExpression"), i16 = 0, len14 = ref26.length; i16 < len14; i16++) {
8786
+ const classExp = ref26[i16];
8655
8787
  let m8;
8656
8788
  if (classExp.name && classExp.parent === topBlock || (m8 = classExp.parent, typeof m8 === "object" && m8 != null && "type" in m8 && m8.type === "ReturnStatement" && "parent" in m8 && m8.parent === topBlock)) {
8657
8789
  classExp.children.unshift(classExp.name, "=");
@@ -8662,8 +8794,8 @@ function processRepl(root, rootIIFE) {
8662
8794
  function processPlaceholders(statements) {
8663
8795
  const placeholderMap = /* @__PURE__ */ new Map();
8664
8796
  const liftedIfs = /* @__PURE__ */ new Set();
8665
- for (let ref26 = gatherRecursiveAll(statements, ($25) => $25.type === "Placeholder"), i17 = 0, len14 = ref26.length; i17 < len14; i17++) {
8666
- const exp = ref26[i17];
8797
+ for (let ref27 = gatherRecursiveAll(statements, ($25) => $25.type === "Placeholder"), i17 = 0, len15 = ref27.length; i17 < len15; i17++) {
8798
+ const exp = ref27[i17];
8667
8799
  let ancestor;
8668
8800
  if (exp.subtype === ".") {
8669
8801
  ({ ancestor } = findAncestor(
@@ -8772,11 +8904,11 @@ function processPlaceholders(statements) {
8772
8904
  for (const [ancestor, placeholders] of placeholderMap) {
8773
8905
  let ref = makeRef("$");
8774
8906
  let typeSuffix;
8775
- for (let i18 = 0, len15 = placeholders.length; i18 < len15; i18++) {
8907
+ for (let i18 = 0, len16 = placeholders.length; i18 < len16; i18++) {
8776
8908
  const placeholder = placeholders[i18];
8777
8909
  typeSuffix ??= placeholder.typeSuffix;
8778
- let ref27;
8779
- (ref27 = placeholder.children)[ref27.length - 1] = ref;
8910
+ let ref28;
8911
+ (ref28 = placeholder.children)[ref28.length - 1] = ref;
8780
8912
  }
8781
8913
  const { parent } = ancestor;
8782
8914
  const body = maybeUnwrap(ancestor);
@@ -8797,16 +8929,16 @@ function processPlaceholders(statements) {
8797
8929
  }
8798
8930
  case "PipelineExpression": {
8799
8931
  const i = findChildIndex(parent, ancestor);
8800
- let ref28;
8932
+ let ref29;
8801
8933
  if (i === 1) {
8802
- ref28 = ancestor === parent.children[i];
8934
+ ref29 = ancestor === parent.children[i];
8803
8935
  } else if (i === 2) {
8804
- ref28 = ancestor === parent.children[i][findChildIndex(parent.children[i], ancestor)][3];
8936
+ ref29 = ancestor === parent.children[i][findChildIndex(parent.children[i], ancestor)][3];
8805
8937
  } else {
8806
- ref28 = void 0;
8938
+ ref29 = void 0;
8807
8939
  }
8808
8940
  ;
8809
- outer = ref28;
8941
+ outer = ref29;
8810
8942
  break;
8811
8943
  }
8812
8944
  case "AssignmentExpression":
@@ -8824,9 +8956,9 @@ function processPlaceholders(statements) {
8824
8956
  if (typeof parent === "object" && parent != null && "type" in parent && parent.type === "BlockStatement" && "parent" in parent && typeof parent.parent === "object" && parent.parent != null && "type" in parent.parent && parent.parent.type === "ArrowFunction" && "ampersandBlock" in parent.parent && parent.parent.ampersandBlock === true && "body" in parent.parent && parent.parent.body === body) {
8825
8957
  parent.parent.body = fnExp;
8826
8958
  }
8827
- let ref29;
8828
- if (ref29 = getTrimmingSpace(body)) {
8829
- const ws = ref29;
8959
+ let ref30;
8960
+ if (ref30 = getTrimmingSpace(body)) {
8961
+ const ws = ref30;
8830
8962
  inplaceInsertTrimmingSpace(body, "");
8831
8963
  inplacePrepend(ws, fnExp);
8832
8964
  }
@@ -8870,8 +9002,8 @@ function reorderBindingRestProperty(props) {
8870
9002
  }
8871
9003
  ];
8872
9004
  }
8873
- let ref30;
8874
- if (Array.isArray(rest.delim) && (ref30 = rest.delim)[ref30.length - 1]?.token === ",") {
9005
+ let ref31;
9006
+ if (Array.isArray(rest.delim) && (ref31 = rest.delim)[ref31.length - 1]?.token === ",") {
8875
9007
  rest.delim = rest.delim.slice(0, -1);
8876
9008
  rest.children = [...rest.children.slice(0, -1), rest.delim];
8877
9009
  }
@@ -8886,10 +9018,12 @@ function reorderBindingRestProperty(props) {
8886
9018
  }
8887
9019
  function typeOfJSX(node, config2) {
8888
9020
  switch (node.type) {
8889
- case "JSXElement":
9021
+ case "JSXElement": {
8890
9022
  return typeOfJSXElement(node, config2);
8891
- case "JSXFragment":
9023
+ }
9024
+ case "JSXFragment": {
8892
9025
  return typeOfJSXFragment(node, config2);
9026
+ }
8893
9027
  }
8894
9028
  }
8895
9029
  function typeOfJSXElement(node, config2) {
@@ -8897,7 +9031,7 @@ function typeOfJSXElement(node, config2) {
8897
9031
  if (config2.server && !config2.client) {
8898
9032
  return ["string"];
8899
9033
  }
8900
- let { tag } = node;
9034
+ const { tag } = node;
8901
9035
  const clientType = tag[0] === tag[0].toLowerCase() ? [getHelperRef("IntrinsicElements"), '<"', tag, '">'] : ["ReturnType<typeof ", tag, ">"];
8902
9036
  if (config2.server) {
8903
9037
  return ["string", " | ", clientType];
@@ -8912,33 +9046,40 @@ function typeOfJSXFragment(node, config2) {
8912
9046
  if (config2.solid) {
8913
9047
  let type = [];
8914
9048
  let lastType;
8915
- for (let child of node.jsxChildren) {
9049
+ for (const child of node.jsxChildren) {
8916
9050
  switch (child.type) {
8917
- case "JSXText":
8918
- if (lastType !== "JSXText") {
9051
+ case "JSXText": {
9052
+ if (!(lastType === "JSXText")) {
8919
9053
  type.push("string");
8920
9054
  }
9055
+ ;
8921
9056
  break;
8922
- case "JSXElement":
9057
+ }
9058
+ case "JSXElement": {
8923
9059
  type.push(typeOfJSXElement(child, config2));
8924
9060
  break;
8925
- case "JSXFragment":
9061
+ }
9062
+ case "JSXFragment": {
8926
9063
  type.push(...typeOfJSXFragment(child, config2));
8927
9064
  break;
8928
- case "JSXChildExpression":
9065
+ }
9066
+ case "JSXChildExpression": {
8929
9067
  if (child.expression) {
8930
9068
  type.push(["typeof ", child.expression]);
8931
9069
  }
9070
+ ;
8932
9071
  break;
8933
- default:
9072
+ }
9073
+ default: {
8934
9074
  throw new Error(`unknown child in JSXFragment: ${JSON.stringify(child)}`);
9075
+ }
8935
9076
  }
8936
9077
  lastType = child.type;
8937
9078
  }
8938
9079
  if (type.length === 1) {
8939
9080
  return type[0];
8940
9081
  } else {
8941
- type = type.flatMap((t) => [t, ", "]);
9082
+ type = type.flatMap(($26) => [$26, ", "]);
8942
9083
  type.pop();
8943
9084
  return ["[", type, "]"];
8944
9085
  }
@@ -9163,6 +9304,8 @@ var grammar = {
9163
9304
  NonSingleBracedBlock,
9164
9305
  DeclarationOrStatement,
9165
9306
  SingleLineStatements,
9307
+ ObjectSingleLineStatements,
9308
+ BracedObjectSingleLineStatements,
9166
9309
  PostfixedSingleLineStatements,
9167
9310
  PostfixedSingleLineNoCommaStatements,
9168
9311
  NestedBlockStatements,
@@ -9343,6 +9486,10 @@ var grammar = {
9343
9486
  ForbidNewlineBinaryOp,
9344
9487
  RestoreNewlineBinaryOp,
9345
9488
  NewlineBinaryOpAllowed,
9489
+ AllowImplicitFragment,
9490
+ ForbidImplicitFragment,
9491
+ RestoreImplicitFragment,
9492
+ ImplicitFragmentAllowed,
9346
9493
  AllowPipeline,
9347
9494
  ForbidPipeline,
9348
9495
  RestorePipeline,
@@ -9368,11 +9515,15 @@ var grammar = {
9368
9515
  NameSpaceImport,
9369
9516
  NamedImports,
9370
9517
  OperatorNamedImports,
9518
+ DynamicNamedImports,
9519
+ DynamicImportContents,
9371
9520
  FromClause,
9372
9521
  ImportAssertion,
9373
9522
  TypeAndImportSpecifier,
9374
9523
  ImportSpecifier,
9375
9524
  OperatorImportSpecifier,
9525
+ DynamicImportSpecifier,
9526
+ DynamicModuleExportName,
9376
9527
  ImportAsToken,
9377
9528
  ModuleExportName,
9378
9529
  ModuleSpecifier,
@@ -10650,7 +10801,11 @@ function SingleLineBinaryOpRHS(ctx, state2) {
10650
10801
  return (0, import_lib2.$EVENT)(ctx, state2, "SingleLineBinaryOpRHS", SingleLineBinaryOpRHS$0);
10651
10802
  }
10652
10803
  var RHS$0 = ExpressionizedStatementWithTrailingCallExpressions;
10653
- var RHS$1 = UnaryExpression;
10804
+ var RHS$1 = (0, import_lib2.$TS)((0, import_lib2.$S)(ForbidImplicitFragment, (0, import_lib2.$E)(UnaryExpression), RestoreImplicitFragment), function($skip, $loc, $0, $1, $2, $3) {
10805
+ var exp = $2;
10806
+ if (!exp) return $skip;
10807
+ return exp;
10808
+ });
10654
10809
  var RHS$$ = [RHS$0, RHS$1];
10655
10810
  function RHS(ctx, state2) {
10656
10811
  return (0, import_lib2.$EVENT_C)(ctx, state2, "RHS", RHS$$);
@@ -10984,8 +11139,9 @@ var FatArrowBody$0 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$N
10984
11139
  implicitlyReturned: true
10985
11140
  };
10986
11141
  });
10987
- var FatArrowBody$1 = NoCommaBracedOrEmptyBlock;
10988
- var FatArrowBody$$ = [FatArrowBody$0, FatArrowBody$1];
11142
+ var FatArrowBody$1 = BracedObjectSingleLineStatements;
11143
+ var FatArrowBody$2 = NoCommaBracedOrEmptyBlock;
11144
+ var FatArrowBody$$ = [FatArrowBody$0, FatArrowBody$1, FatArrowBody$2];
10989
11145
  function FatArrowBody(ctx, state2) {
10990
11146
  return (0, import_lib2.$EVENT_C)(ctx, state2, "FatArrowBody", FatArrowBody$$);
10991
11147
  }
@@ -11696,10 +11852,10 @@ var CallExpression$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(Super, Arguments
11696
11852
  children: [$1, ...$2, ...rest.flat()]
11697
11853
  });
11698
11854
  });
11699
- var CallExpression$1 = (0, import_lib2.$TS)((0, import_lib2.$S)(Import, _, NamedImports, __, FromClause), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
11855
+ var CallExpression$1 = (0, import_lib2.$TS)((0, import_lib2.$S)(Import, _, DynamicImportContents, __, FromClause), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
11700
11856
  return dynamizeImportDeclarationExpression($0);
11701
11857
  });
11702
- var CallExpression$2 = (0, import_lib2.$TS)((0, import_lib2.$S)(FromClause, __, Import, _, NamedImports), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
11858
+ var CallExpression$2 = (0, import_lib2.$TS)((0, import_lib2.$S)(FromClause, __, Import, _, DynamicImportContents), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
11703
11859
  var from = $1;
11704
11860
  var fws = $2;
11705
11861
  var i = $3;
@@ -13140,7 +13296,7 @@ var OperatorAssociativity$0 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, impor
13140
13296
  function OperatorAssociativity(ctx, state2) {
13141
13297
  return (0, import_lib2.$EVENT)(ctx, state2, "OperatorAssociativity", OperatorAssociativity$0);
13142
13298
  }
13143
- var ThinArrowFunction$0 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$E)((0, import_lib2.$S)(Async, _)), ArrowParameters, (0, import_lib2.$E)(ReturnTypeSuffix), (0, import_lib2.$E)(_), Arrow, NoCommaBracedOrEmptyBlock), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
13299
+ var ThinArrowFunction$0 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$E)((0, import_lib2.$S)(Async, _)), ArrowParameters, (0, import_lib2.$E)(ReturnTypeSuffix), (0, import_lib2.$E)(_), Arrow, (0, import_lib2.$C)(BracedObjectSingleLineStatements, NoCommaBracedOrEmptyBlock)), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6) {
13144
13300
  var async = $1;
13145
13301
  var parameters = $2;
13146
13302
  var returnType = $3;
@@ -13294,8 +13450,9 @@ var ThenBlock$0 = (0, import_lib2.$T)((0, import_lib2.$S)(NoBlock, EmptyBlock),
13294
13450
  return value[1];
13295
13451
  });
13296
13452
  var ThenBlock$1 = ImplicitNestedBlock;
13297
- var ThenBlock$2 = SingleLineStatements;
13298
- var ThenBlock$$ = [ThenBlock$0, ThenBlock$1, ThenBlock$2];
13453
+ var ThenBlock$2 = ObjectSingleLineStatements;
13454
+ var ThenBlock$3 = SingleLineStatements;
13455
+ var ThenBlock$$ = [ThenBlock$0, ThenBlock$1, ThenBlock$2, ThenBlock$3];
13299
13456
  function ThenBlock(ctx, state2) {
13300
13457
  return (0, import_lib2.$EVENT_C)(ctx, state2, "ThenBlock", ThenBlock$$);
13301
13458
  }
@@ -13354,11 +13511,12 @@ var BlockOrEmptyStatement$$ = [BlockOrEmptyStatement$0, BlockOrEmptyStatement$1]
13354
13511
  function BlockOrEmptyStatement(ctx, state2) {
13355
13512
  return (0, import_lib2.$EVENT_C)(ctx, state2, "BlockOrEmptyStatement", BlockOrEmptyStatement$$);
13356
13513
  }
13357
- var BlockOrEmpty$0 = Block;
13358
- var BlockOrEmpty$1 = (0, import_lib2.$T)((0, import_lib2.$S)(NoBlock, EmptyBlock), function(value) {
13514
+ var BlockOrEmpty$0 = ObjectSingleLineStatements;
13515
+ var BlockOrEmpty$1 = Block;
13516
+ var BlockOrEmpty$2 = (0, import_lib2.$T)((0, import_lib2.$S)(NoBlock, EmptyBlock), function(value) {
13359
13517
  return value[1];
13360
13518
  });
13361
- var BlockOrEmpty$$ = [BlockOrEmpty$0, BlockOrEmpty$1];
13519
+ var BlockOrEmpty$$ = [BlockOrEmpty$0, BlockOrEmpty$1, BlockOrEmpty$2];
13362
13520
  function BlockOrEmpty(ctx, state2) {
13363
13521
  return (0, import_lib2.$EVENT_C)(ctx, state2, "BlockOrEmpty", BlockOrEmpty$$);
13364
13522
  }
@@ -13494,6 +13652,26 @@ var SingleLineStatements$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(ForbidNewl
13494
13652
  function SingleLineStatements(ctx, state2) {
13495
13653
  return (0, import_lib2.$EVENT)(ctx, state2, "SingleLineStatements", SingleLineStatements$0);
13496
13654
  }
13655
+ var ObjectSingleLineStatements$0 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$Y)((0, import_lib2.$S)((0, import_lib2.$E)(_), BracedObjectLiteral)), SingleLineStatements), function($skip, $loc, $0, $1, $2) {
13656
+ var block = $2;
13657
+ if (block.bare && block.expressions.length === 1) {
13658
+ const expression = block.expressions[0][1];
13659
+ if (expression.type === "ParenthesizedExpression" && expression.implicit && expression.expression.type === "ObjectExpression") {
13660
+ block = { ...block, unwrapObject: true };
13661
+ }
13662
+ }
13663
+ return block;
13664
+ });
13665
+ function ObjectSingleLineStatements(ctx, state2) {
13666
+ return (0, import_lib2.$EVENT)(ctx, state2, "ObjectSingleLineStatements", ObjectSingleLineStatements$0);
13667
+ }
13668
+ var BracedObjectSingleLineStatements$0 = (0, import_lib2.$TV)(ObjectSingleLineStatements, function($skip, $loc, $0, $1) {
13669
+ var block = $0;
13670
+ return bracedBlock(block);
13671
+ });
13672
+ function BracedObjectSingleLineStatements(ctx, state2) {
13673
+ return (0, import_lib2.$EVENT)(ctx, state2, "BracedObjectSingleLineStatements", BracedObjectSingleLineStatements$0);
13674
+ }
13497
13675
  var PostfixedSingleLineStatements$0 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$Q)((0, import_lib2.$S)((0, import_lib2.$S)((0, import_lib2.$E)(_), (0, import_lib2.$N)(EOS)), StatementListItem, SemicolonDelimiter)), (0, import_lib2.$E)((0, import_lib2.$S)((0, import_lib2.$S)((0, import_lib2.$E)(_), (0, import_lib2.$N)(EOS)), StatementListItem, (0, import_lib2.$E)(SemicolonDelimiter)))), function($skip, $loc, $0, $1, $2) {
13498
13676
  var stmts = $1;
13499
13677
  var last = $2;
@@ -14344,7 +14522,8 @@ var PropertyDefinition$2 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_l
14344
14522
  children: [ws, id],
14345
14523
  name: id,
14346
14524
  names: id.names,
14347
- value: id
14525
+ value: id,
14526
+ implicitName: true
14348
14527
  };
14349
14528
  });
14350
14529
  var PropertyDefinition$3 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$E)(_), MethodDefinition), function($skip, $loc, $0, $1, $2) {
@@ -14403,7 +14582,8 @@ var PropertyDefinition$5 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_l
14403
14582
  if (refAssignment) {
14404
14583
  name = {
14405
14584
  type: "ComputedPropertyName",
14406
- children: [last.children[0], "(", refAssignment, ",", ref, ")", ...last.children.slice(-2)]
14585
+ children: [last.children[0], "(", refAssignment, ",", ref, ")", ...last.children.slice(-2)],
14586
+ implicit: true
14407
14587
  };
14408
14588
  value = {
14409
14589
  ...value,
@@ -14418,7 +14598,8 @@ var PropertyDefinition$5 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_l
14418
14598
  } else {
14419
14599
  name = {
14420
14600
  type: "ComputedPropertyName",
14421
- children: last.children
14601
+ children: last.children,
14602
+ implicit: true
14422
14603
  };
14423
14604
  }
14424
14605
  } else {
@@ -14431,7 +14612,8 @@ var PropertyDefinition$5 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_l
14431
14612
  children: [ws, name, ": ", processUnaryExpression(pre, value, post)],
14432
14613
  name,
14433
14614
  names: [],
14434
- value
14615
+ value,
14616
+ implicitName: true
14435
14617
  };
14436
14618
  });
14437
14619
  var PropertyDefinition$$ = [PropertyDefinition$0, PropertyDefinition$1, PropertyDefinition$2, PropertyDefinition$3, PropertyDefinition$4, PropertyDefinition$5];
@@ -14634,6 +14816,7 @@ function MethodDefinition(ctx, state2) {
14634
14816
  var MethodModifier$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(GetOrSet, (0, import_lib2.$E)(_), (0, import_lib2.$Y)(ClassElementName)), function($skip, $loc, $0, $1, $2, $3) {
14635
14817
  var kind = $1;
14636
14818
  var ws = $2;
14819
+ if (!ws) ws = " ";
14637
14820
  return {
14638
14821
  // no async or generator, because getters and setters can't be
14639
14822
  modifier: {
@@ -15351,7 +15534,7 @@ function ShouldExpressionize(ctx, state2) {
15351
15534
  var NoCommaStatement$0 = KeywordStatement;
15352
15535
  var NoCommaStatement$1 = VariableStatement;
15353
15536
  var NoCommaStatement$2 = IfStatement;
15354
- var NoCommaStatement$3 = IterationStatement;
15537
+ var NoCommaStatement$3 = IterationActualStatement;
15355
15538
  var NoCommaStatement$4 = SwitchStatement;
15356
15539
  var NoCommaStatement$5 = TryStatement;
15357
15540
  var NoCommaStatement$6 = EmptyStatement;
@@ -16383,8 +16566,8 @@ var SingleLineExpressionWithIndentedApplicationForbidden$0 = (0, import_lib2.$TS
16383
16566
  function SingleLineExpressionWithIndentedApplicationForbidden(ctx, state2) {
16384
16567
  return (0, import_lib2.$EVENT)(ctx, state2, "SingleLineExpressionWithIndentedApplicationForbidden", SingleLineExpressionWithIndentedApplicationForbidden$0);
16385
16568
  }
16386
- var ExpressionWithObjectApplicationForbidden$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(ForbidBracedApplication, ForbidIndentedApplication, (0, import_lib2.$E)(Expression), RestoreBracedApplication, RestoreIndentedApplication), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
16387
- var exp = $3;
16569
+ var ExpressionWithObjectApplicationForbidden$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(ForbidBracedApplication, ForbidIndentedApplication, ForbidImplicitFragment, (0, import_lib2.$E)(Expression), RestoreBracedApplication, RestoreIndentedApplication, RestoreImplicitFragment), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7) {
16570
+ var exp = $4;
16388
16571
  if (exp) return exp;
16389
16572
  return $skip;
16390
16573
  });
@@ -16561,6 +16744,33 @@ var NewlineBinaryOpAllowed$0 = (0, import_lib2.$TV)((0, import_lib2.$EXPECT)($L0
16561
16744
  function NewlineBinaryOpAllowed(ctx, state2) {
16562
16745
  return (0, import_lib2.$EVENT)(ctx, state2, "NewlineBinaryOpAllowed", NewlineBinaryOpAllowed$0);
16563
16746
  }
16747
+ var AllowImplicitFragment$0 = (0, import_lib2.$TV)((0, import_lib2.$EXPECT)($L0, 'AllowImplicitFragment ""'), function($skip, $loc, $0, $1) {
16748
+ state.forbidImplicitFragment.push(false);
16749
+ });
16750
+ function AllowImplicitFragment(ctx, state2) {
16751
+ return (0, import_lib2.$EVENT)(ctx, state2, "AllowImplicitFragment", AllowImplicitFragment$0);
16752
+ }
16753
+ var ForbidImplicitFragment$0 = (0, import_lib2.$TV)((0, import_lib2.$EXPECT)($L0, 'ForbidImplicitFragment ""'), function($skip, $loc, $0, $1) {
16754
+ state.forbidImplicitFragment.push(true);
16755
+ });
16756
+ function ForbidImplicitFragment(ctx, state2) {
16757
+ return (0, import_lib2.$EVENT)(ctx, state2, "ForbidImplicitFragment", ForbidImplicitFragment$0);
16758
+ }
16759
+ var RestoreImplicitFragment$0 = (0, import_lib2.$TV)((0, import_lib2.$EXPECT)($L0, 'RestoreImplicitFragment ""'), function($skip, $loc, $0, $1) {
16760
+ state.forbidImplicitFragment.pop();
16761
+ });
16762
+ function RestoreImplicitFragment(ctx, state2) {
16763
+ return (0, import_lib2.$EVENT)(ctx, state2, "RestoreImplicitFragment", RestoreImplicitFragment$0);
16764
+ }
16765
+ var ImplicitFragmentAllowed$0 = (0, import_lib2.$TV)((0, import_lib2.$EXPECT)($L0, 'ImplicitFragmentAllowed ""'), function($skip, $loc, $0, $1) {
16766
+ if (config.verbose) {
16767
+ console.log("forbidImplicitFragment:", state.forbidImplicitFragment);
16768
+ }
16769
+ if (state.implicitFragmentForbidden) return $skip;
16770
+ });
16771
+ function ImplicitFragmentAllowed(ctx, state2) {
16772
+ return (0, import_lib2.$EVENT)(ctx, state2, "ImplicitFragmentAllowed", ImplicitFragmentAllowed$0);
16773
+ }
16564
16774
  var AllowPipeline$0 = (0, import_lib2.$TV)((0, import_lib2.$EXPECT)($L0, 'AllowPipeline ""'), function($skip, $loc, $0, $1) {
16565
16775
  state.forbidPipeline.push(false);
16566
16776
  });
@@ -16588,11 +16798,11 @@ var PipelineAllowed$0 = (0, import_lib2.$TV)((0, import_lib2.$EXPECT)($L0, 'Pipe
16588
16798
  function PipelineAllowed(ctx, state2) {
16589
16799
  return (0, import_lib2.$EVENT)(ctx, state2, "PipelineAllowed", PipelineAllowed$0);
16590
16800
  }
16591
- var AllowAll$0 = (0, import_lib2.$S)(AllowTrailingMemberProperty, AllowBracedApplication, AllowIndentedApplication, AllowClassImplicitCall, AllowNestedBinaryOp, AllowNewlineBinaryOp, AllowPipeline);
16801
+ var AllowAll$0 = (0, import_lib2.$S)(AllowTrailingMemberProperty, AllowBracedApplication, AllowIndentedApplication, AllowClassImplicitCall, AllowNestedBinaryOp, AllowNewlineBinaryOp, AllowImplicitFragment, AllowPipeline);
16592
16802
  function AllowAll(ctx, state2) {
16593
16803
  return (0, import_lib2.$EVENT)(ctx, state2, "AllowAll", AllowAll$0);
16594
16804
  }
16595
- var RestoreAll$0 = (0, import_lib2.$S)(RestoreTrailingMemberProperty, RestoreBracedApplication, RestoreIndentedApplication, RestoreClassImplicitCall, RestoreNestedBinaryOp, RestoreNewlineBinaryOp, RestorePipeline);
16805
+ var RestoreAll$0 = (0, import_lib2.$S)(RestoreTrailingMemberProperty, RestoreBracedApplication, RestoreIndentedApplication, RestoreClassImplicitCall, RestoreNestedBinaryOp, RestoreNewlineBinaryOp, RestoreImplicitFragment, RestorePipeline);
16596
16806
  function RestoreAll(ctx, state2) {
16597
16807
  return (0, import_lib2.$EVENT)(ctx, state2, "RestoreAll", RestoreAll$0);
16598
16808
  }
@@ -16695,7 +16905,11 @@ var MaybeNestedNonPipelineExpression$0 = (0, import_lib2.$TS)((0, import_lib2.$S
16695
16905
  if (!trailing) return expression;
16696
16906
  return [expression, trailing];
16697
16907
  });
16698
- var MaybeNestedNonPipelineExpression$1 = NonPipelineExpression;
16908
+ var MaybeNestedNonPipelineExpression$1 = (0, import_lib2.$TS)((0, import_lib2.$S)(ForbidImplicitFragment, (0, import_lib2.$E)(NonPipelineExpression), RestoreImplicitFragment), function($skip, $loc, $0, $1, $2, $3) {
16909
+ var expression = $2;
16910
+ if (!expression) return $skip;
16911
+ return expression;
16912
+ });
16699
16913
  var MaybeNestedNonPipelineExpression$$ = [MaybeNestedNonPipelineExpression$0, MaybeNestedNonPipelineExpression$1];
16700
16914
  function MaybeNestedNonPipelineExpression(ctx, state2) {
16701
16915
  return (0, import_lib2.$EVENT_C)(ctx, state2, "MaybeNestedNonPipelineExpression", MaybeNestedNonPipelineExpression$$);
@@ -16707,7 +16921,11 @@ var MaybeNestedPostfixedExpression$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(
16707
16921
  if (!trailing) return expression;
16708
16922
  return [expression, trailing];
16709
16923
  });
16710
- var MaybeNestedPostfixedExpression$1 = PostfixedExpression;
16924
+ var MaybeNestedPostfixedExpression$1 = (0, import_lib2.$TS)((0, import_lib2.$S)(ForbidImplicitFragment, (0, import_lib2.$E)(PostfixedExpression), RestoreImplicitFragment), function($skip, $loc, $0, $1, $2, $3) {
16925
+ var expression = $2;
16926
+ if (!expression) return $skip;
16927
+ return expression;
16928
+ });
16711
16929
  var MaybeNestedPostfixedExpression$$ = [MaybeNestedPostfixedExpression$0, MaybeNestedPostfixedExpression$1];
16712
16930
  function MaybeNestedPostfixedExpression(ctx, state2) {
16713
16931
  return (0, import_lib2.$EVENT_C)(ctx, state2, "MaybeNestedPostfixedExpression", MaybeNestedPostfixedExpression$$);
@@ -16730,7 +16948,11 @@ var MaybeNestedExpression$0 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, impor
16730
16948
  if (!trailing) return expression;
16731
16949
  return [expression, trailing];
16732
16950
  });
16733
- var MaybeNestedExpression$1 = Expression;
16951
+ var MaybeNestedExpression$1 = (0, import_lib2.$TS)((0, import_lib2.$S)(ForbidImplicitFragment, (0, import_lib2.$E)(Expression), RestoreImplicitFragment), function($skip, $loc, $0, $1, $2, $3) {
16952
+ var expression = $2;
16953
+ if (!expression) return $skip;
16954
+ return expression;
16955
+ });
16734
16956
  var MaybeNestedExpression$$ = [MaybeNestedExpression$0, MaybeNestedExpression$1];
16735
16957
  function MaybeNestedExpression(ctx, state2) {
16736
16958
  return (0, import_lib2.$EVENT_C)(ctx, state2, "MaybeNestedExpression", MaybeNestedExpression$$);
@@ -16925,6 +17147,24 @@ var OperatorNamedImports$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(OpenBrace,
16925
17147
  function OperatorNamedImports(ctx, state2) {
16926
17148
  return (0, import_lib2.$EVENT)(ctx, state2, "OperatorNamedImports", OperatorNamedImports$0);
16927
17149
  }
17150
+ var DynamicNamedImports$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(OpenBrace, (0, import_lib2.$Q)(DynamicImportSpecifier), (0, import_lib2.$E)((0, import_lib2.$S)(__, Comma)), __, CloseBrace), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
17151
+ var specifiers = $2;
17152
+ return {
17153
+ type: "Declaration",
17154
+ children: $0,
17155
+ specifiers
17156
+ };
17157
+ });
17158
+ function DynamicNamedImports(ctx, state2) {
17159
+ return (0, import_lib2.$EVENT)(ctx, state2, "DynamicNamedImports", DynamicNamedImports$0);
17160
+ }
17161
+ var DynamicImportContents$0 = DynamicNamedImports;
17162
+ var DynamicImportContents$1 = IdentifierName;
17163
+ var DynamicImportContents$2 = Star;
17164
+ var DynamicImportContents$$ = [DynamicImportContents$0, DynamicImportContents$1, DynamicImportContents$2];
17165
+ function DynamicImportContents(ctx, state2) {
17166
+ return (0, import_lib2.$EVENT_C)(ctx, state2, "DynamicImportContents", DynamicImportContents$$);
17167
+ }
16928
17168
  var FromClause$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(From, __, ModuleSpecifier), function($skip, $loc, $0, $1, $2, $3) {
16929
17169
  var module2 = $3;
16930
17170
  if (!Array.isArray(module2)) return $0;
@@ -16946,11 +17186,11 @@ var ImportAssertion$0 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2
16946
17186
  function ImportAssertion(ctx, state2) {
16947
17187
  return (0, import_lib2.$EVENT)(ctx, state2, "ImportAssertion", ImportAssertion$0);
16948
17188
  }
16949
- var TypeAndImportSpecifier$0 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$E)((0, import_lib2.$S)(__, TypeKeyword)), ImportSpecifier), function($skip, $loc, $0, $1, $2) {
16950
- if (!$1) return $2;
16951
- return { ts: true, children: $0, binding: $2.binding };
17189
+ var TypeAndImportSpecifier$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(__, TypeKeyword, ImportSpecifier), function($skip, $loc, $0, $1, $2, $3) {
17190
+ return { ts: true, children: $0, binding: $3.binding };
16952
17191
  });
16953
- var TypeAndImportSpecifier$1 = (0, import_lib2.$TS)((0, import_lib2.$S)(__, Operator, OperatorImportSpecifier), function($skip, $loc, $0, $1, $2, $3) {
17192
+ var TypeAndImportSpecifier$1 = ImportSpecifier;
17193
+ var TypeAndImportSpecifier$2 = (0, import_lib2.$TS)((0, import_lib2.$S)(__, Operator, OperatorImportSpecifier), function($skip, $loc, $0, $1, $2, $3) {
16954
17194
  var ws = $1;
16955
17195
  var spec = $3;
16956
17196
  if (spec.binding.type !== "Identifier") {
@@ -16966,7 +17206,7 @@ var TypeAndImportSpecifier$1 = (0, import_lib2.$TS)((0, import_lib2.$S)(__, Oper
16966
17206
  ]
16967
17207
  };
16968
17208
  });
16969
- var TypeAndImportSpecifier$$ = [TypeAndImportSpecifier$0, TypeAndImportSpecifier$1];
17209
+ var TypeAndImportSpecifier$$ = [TypeAndImportSpecifier$0, TypeAndImportSpecifier$1, TypeAndImportSpecifier$2];
16970
17210
  function TypeAndImportSpecifier(ctx, state2) {
16971
17211
  return (0, import_lib2.$EVENT_C)(ctx, state2, "TypeAndImportSpecifier", TypeAndImportSpecifier$$);
16972
17212
  }
@@ -17013,6 +17253,27 @@ var OperatorImportSpecifier$$ = [OperatorImportSpecifier$0, OperatorImportSpecif
17013
17253
  function OperatorImportSpecifier(ctx, state2) {
17014
17254
  return (0, import_lib2.$EVENT_C)(ctx, state2, "OperatorImportSpecifier", OperatorImportSpecifier$$);
17015
17255
  }
17256
+ var DynamicImportSpecifier$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(__, (0, import_lib2.$E)((0, import_lib2.$S)(TypeKeyword, __, (0, import_lib2.$Y)(DynamicModuleExportName))), DynamicModuleExportName, (0, import_lib2.$E)((0, import_lib2.$S)(ImportAsToken, __, DynamicModuleExportName)), ObjectPropertyDelimiter), function($skip, $loc, $0, $1, $2, $3, $4, $5) {
17257
+ var ts2 = $2;
17258
+ var source = $3;
17259
+ var binding = $4;
17260
+ return {
17261
+ source,
17262
+ binding: binding?.[2],
17263
+ ts: !!ts2,
17264
+ // true causes an error later
17265
+ children: $0
17266
+ };
17267
+ });
17268
+ function DynamicImportSpecifier(ctx, state2) {
17269
+ return (0, import_lib2.$EVENT)(ctx, state2, "DynamicImportSpecifier", DynamicImportSpecifier$0);
17270
+ }
17271
+ var DynamicModuleExportName$0 = ModuleExportName;
17272
+ var DynamicModuleExportName$1 = ComputedPropertyName;
17273
+ var DynamicModuleExportName$$ = [DynamicModuleExportName$0, DynamicModuleExportName$1];
17274
+ function DynamicModuleExportName(ctx, state2) {
17275
+ return (0, import_lib2.$EVENT_C)(ctx, state2, "DynamicModuleExportName", DynamicModuleExportName$$);
17276
+ }
17016
17277
  var ImportAsToken$0 = (0, import_lib2.$S)(__, As);
17017
17278
  var ImportAsToken$1 = (0, import_lib2.$TS)((0, import_lib2.$S)(Loc, __, Colon, (0, import_lib2.$E)((0, import_lib2.$EXPECT)($L17, 'ImportAsToken " "'))), function($skip, $loc, $0, $1, $2, $3, $4) {
17018
17279
  var l = $1;
@@ -18304,7 +18565,7 @@ function SingleQuote(ctx, state2) {
18304
18565
  return (0, import_lib2.$EVENT)(ctx, state2, "SingleQuote", SingleQuote$0);
18305
18566
  }
18306
18567
  var Star$0 = (0, import_lib2.$TV)((0, import_lib2.$EXPECT)($L75, 'Star "*"'), function($skip, $loc, $0, $1) {
18307
- return { $loc, token: $1 };
18568
+ return { $loc, token: $1, type: "Star" };
18308
18569
  });
18309
18570
  function Star(ctx, state2) {
18310
18571
  return (0, import_lib2.$EVENT)(ctx, state2, "Star", Star$0);
@@ -18457,18 +18718,22 @@ var Yield$0 = (0, import_lib2.$TS)((0, import_lib2.$S)((0, import_lib2.$EXPECT)(
18457
18718
  function Yield(ctx, state2) {
18458
18719
  return (0, import_lib2.$EVENT)(ctx, state2, "Yield", Yield$0);
18459
18720
  }
18460
- var JSXImplicitFragment$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(JSXTag, (0, import_lib2.$Q)((0, import_lib2.$S)(Nested, (0, import_lib2.$C)(JSXTag, JSXAngleChild)))), function($skip, $loc, $0, $1, $2) {
18461
- const jsx = $2.length === 0 ? $1 : {
18721
+ var JSXImplicitFragment$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(JSXTag, (0, import_lib2.$E)((0, import_lib2.$S)(ImplicitFragmentAllowed, NestedBinaryOpAllowed, NewlineBinaryOpAllowed, (0, import_lib2.$Q)((0, import_lib2.$S)(Nested, (0, import_lib2.$C)(JSXTag, JSXAngleChild)))))), function($skip, $loc, $0, $1, $2) {
18722
+ var first = $1;
18723
+ var rest = $2;
18724
+ rest = rest ? rest[3] : [];
18725
+ const jsx = rest.length === 0 ? first : {
18462
18726
  type: "JSXFragment",
18463
18727
  children: [
18464
18728
  "<>\n",
18465
18729
  state.currentIndent.token,
18466
- ...$0,
18730
+ first,
18731
+ ...rest,
18467
18732
  "\n",
18468
18733
  state.currentIndent.token,
18469
18734
  "</>"
18470
18735
  ],
18471
- jsxChildren: [$1].concat($2.map(([, tag]) => tag))
18736
+ jsxChildren: [first, ...rest.map(([, tag]) => tag)]
18472
18737
  };
18473
18738
  const type = typeOfJSX(jsx, config);
18474
18739
  return type ? [
@@ -19203,13 +19468,7 @@ var JSXAngleChild$0 = (0, import_lib2.$T)((0, import_lib2.$S)(CloseAngleBracket,
19203
19468
  function JSXAngleChild(ctx, state2) {
19204
19469
  return (0, import_lib2.$EVENT)(ctx, state2, "JSXAngleChild", JSXAngleChild$0);
19205
19470
  }
19206
- var JSXCodeChild$0 = (0, import_lib2.$TS)((0, import_lib2.$S)(InsertInlineOpenBrace, JSXCodeChildExpression, InsertCloseBrace), function($skip, $loc, $0, $1, $2, $3) {
19207
- var open = $1;
19208
- var expression = $2;
19209
- var close = $3;
19210
- if (!expression) return $skip;
19211
- return [open, expression, close];
19212
- });
19471
+ var JSXCodeChild$0 = (0, import_lib2.$S)(InsertInlineOpenBrace, JSXCodeChildExpression, InsertCloseBrace);
19213
19472
  function JSXCodeChild(ctx, state2) {
19214
19473
  return (0, import_lib2.$EVENT)(ctx, state2, "JSXCodeChild", JSXCodeChild$0);
19215
19474
  }
@@ -20873,6 +21132,7 @@ var Reset$0 = (0, import_lib2.$TV)((0, import_lib2.$EXPECT)($L0, 'Reset ""'), fu
20873
21132
  state.forbidTrailingMemberProperty = [false];
20874
21133
  state.forbidNestedBinaryOp = [false];
20875
21134
  state.forbidNewlineBinaryOp = [false];
21135
+ state.forbidImplicitFragment = [false];
20876
21136
  state.forbidPipeline = [false];
20877
21137
  state.JSXTagStack = [void 0];
20878
21138
  state.operators = /* @__PURE__ */ new Map();
@@ -21154,6 +21414,7 @@ var state = {
21154
21414
  forbidTrailingMemberProperty: [false],
21155
21415
  forbidNestedBinaryOp: [false],
21156
21416
  forbidNewlineBinaryOp: [false],
21417
+ forbidImplicitFragment: [false],
21157
21418
  forbidPipeline: [false],
21158
21419
  JSXTagStack: [void 0]
21159
21420
  };
@@ -21205,6 +21466,12 @@ Object.defineProperties(state, {
21205
21466
  return s[s.length - 1];
21206
21467
  }
21207
21468
  },
21469
+ implicitFragmentForbidden: {
21470
+ get() {
21471
+ const { forbidImplicitFragment: s } = state;
21472
+ return s[s.length - 1];
21473
+ }
21474
+ },
21208
21475
  pipelineForbidden: {
21209
21476
  get() {
21210
21477
  const { forbidPipeline: s } = state;
@@ -21227,7 +21494,7 @@ function setOperatorBehavior(name, behavior) {
21227
21494
  }
21228
21495
  }
21229
21496
  function getStateKey() {
21230
- const stateInt = state.currentIndent.level % 256 << 8 | state.classImplicitCallForbidden << 7 | state.indentedApplicationForbidden << 6 | state.bracedApplicationForbidden << 5 | state.trailingMemberPropertyForbidden << 4 | state.nestedBinaryOpForbidden << 3 | state.newlineBinaryOpForbidden << 2 | state.pipelineForbidden << 1 | // This is slightly different than the rest of the state,
21497
+ const stateInt = state.currentIndent.level % 256 << 9 | state.classImplicitCallForbidden << 8 | state.indentedApplicationForbidden << 7 | state.bracedApplicationForbidden << 6 | state.trailingMemberPropertyForbidden << 5 | state.nestedBinaryOpForbidden << 4 | state.newlineBinaryOpForbidden << 3 | state.implicitFragmentForbidden << 2 | state.pipelineForbidden << 1 | // This is slightly different than the rest of the state,
21231
21498
  // since it is affected by the directive prologue and may be hit
21232
21499
  // by the EOL rule early in the parse. Later if we wanted to
21233
21500
  // allow block scoping of the compat directives we would need to
@@ -21327,7 +21594,7 @@ var SourceMap = class {
21327
21594
  const line = ref1[i1];
21328
21595
  results.push((() => {
21329
21596
  const results1 = [];
21330
- for (let i2 = 0, len1 = line.length; i2 < len1; i2++) {
21597
+ for (let i2 = 0, len12 = line.length; i2 < len12; i2++) {
21331
21598
  const entry = line[i2];
21332
21599
  if (entry.length === 4) {
21333
21600
  let [colDelta, sourceFileIndex, srcLine, srcCol] = entry;
@@ -21667,10 +21934,11 @@ var WorkerPool = class {
21667
21934
  const { Worker } = await import("node:worker_threads");
21668
21935
  const path = (await import("node:path")).default;
21669
21936
  const worker = new Worker(path.join(__dirname, "node-worker.mjs"));
21670
- worker.on("message", (response) => {
21937
+ worker.on("message", async (response) => {
21671
21938
  const callback = this.callbacks.get(response.id);
21672
21939
  this.callbacks.delete(response.id);
21673
21940
  if (response.error) {
21941
+ await new Promise((done) => setTimeout(done, 0));
21674
21942
  const message = `${response.error.name}: ${response.error.message}`;
21675
21943
  let ref;
21676
21944
  if (response.error.type in globalThis) {