babel-plugin-react-compiler 19.0.0-beta-a7bf2bd-20241110 → 19.0.0-beta-df7b47d-20241124

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/index.js CHANGED
@@ -7933,7 +7933,8 @@ function requireTokenMap$1() {
7933
7933
  }
7934
7934
  const indexes = [];
7935
7935
  for (const child of children) {
7936
- if (!child) continue;
7936
+ if (child == null) continue;
7937
+ if (child.start == null || child.end == null) continue;
7937
7938
  const childTok = this._findTokensOfNode(child, low, last);
7938
7939
  const high = childTok.first;
7939
7940
  for (let k = low; k < high; k++) indexes.push(k);
@@ -13831,7 +13832,7 @@ function requireLib$k() {
13831
13832
  : picocolors.isColorSupported;
13832
13833
  }
13833
13834
  const compose = (f, g) => v => f(g(v));
13834
- function builDefs(colors) {
13835
+ function buildDefs(colors) {
13835
13836
  return {
13836
13837
  keyword: colors.cyan,
13837
13838
  capitalized: colors.yellow,
@@ -13848,8 +13849,8 @@ function requireLib$k() {
13848
13849
  reset: colors.reset,
13849
13850
  };
13850
13851
  }
13851
- const defsOn = builDefs(picocolors.createColors(true));
13852
- const defsOff = builDefs(picocolors.createColors(false));
13852
+ const defsOn = buildDefs(picocolors.createColors(true));
13853
+ const defsOff = buildDefs(picocolors.createColors(false));
13853
13854
  function getDefs(enabled) {
13854
13855
  return enabled ? defsOn : defsOff;
13855
13856
  }
@@ -15857,6 +15858,7 @@ function requireLib$j() {
15857
15858
  _type: createKeywordLike('type', {startsExpr: startsExpr}),
15858
15859
  _opaque: createKeywordLike('opaque', {startsExpr: startsExpr}),
15859
15860
  name: createToken('name', {startsExpr: startsExpr}),
15861
+ placeholder: createToken('%%', {startsExpr: true}),
15860
15862
  string: createToken('string', {startsExpr: startsExpr}),
15861
15863
  num: createToken('num', {startsExpr: startsExpr}),
15862
15864
  bigint: createToken('bigint', {startsExpr: startsExpr}),
@@ -15868,19 +15870,18 @@ function requireLib$j() {
15868
15870
  jsxText: createToken('jsxText', {beforeExpr: true}),
15869
15871
  jsxTagStart: createToken('jsxTagStart', {startsExpr: true}),
15870
15872
  jsxTagEnd: createToken('jsxTagEnd'),
15871
- placeholder: createToken('%%', {startsExpr: true}),
15872
15873
  };
15873
15874
  function tokenIsIdentifier(token) {
15874
- return token >= 93 && token <= 132;
15875
+ return token >= 93 && token <= 133;
15875
15876
  }
15876
15877
  function tokenKeywordOrIdentifierIsKeyword(token) {
15877
15878
  return token <= 92;
15878
15879
  }
15879
15880
  function tokenIsKeywordOrIdentifier(token) {
15880
- return token >= 58 && token <= 132;
15881
+ return token >= 58 && token <= 133;
15881
15882
  }
15882
15883
  function tokenIsLiteralPropertyName(token) {
15883
- return token >= 58 && token <= 136;
15884
+ return token >= 58 && token <= 137;
15884
15885
  }
15885
15886
  function tokenComesBeforeExpression(token) {
15886
15887
  return tokenBeforeExprs[token];
@@ -15947,7 +15948,7 @@ function requireLib$j() {
15947
15948
  context.push(types.template);
15948
15949
  }
15949
15950
  };
15950
- tokenTypes[142].updateContext = context => {
15951
+ tokenTypes[143].updateContext = context => {
15951
15952
  context.push(types.j_expr, types.j_oTag);
15952
15953
  };
15953
15954
  }
@@ -16636,7 +16637,7 @@ function requireLib$j() {
16636
16637
  this.commentsLen = 0;
16637
16638
  this.commentStack = [];
16638
16639
  this.pos = 0;
16639
- this.type = 139;
16640
+ this.type = 140;
16640
16641
  this.value = null;
16641
16642
  this.start = 0;
16642
16643
  this.end = 0;
@@ -16761,8 +16762,11 @@ function requireLib$j() {
16761
16762
  else this.flags &= -4097;
16762
16763
  }
16763
16764
  curPosition() {
16764
- const index = this.startIndex + this.pos;
16765
- return new Position(this.curLine, index - this.lineStart, index);
16765
+ return new Position(
16766
+ this.curLine,
16767
+ this.pos - this.lineStart,
16768
+ this.pos + this.startIndex
16769
+ );
16766
16770
  }
16767
16771
  clone() {
16768
16772
  const state = new State();
@@ -17134,10 +17138,11 @@ function requireLib$j() {
17134
17138
  const VALID_REGEX_FLAGS = new Set([103, 109, 115, 105, 121, 117, 100, 118]);
17135
17139
  class Token {
17136
17140
  constructor(state) {
17141
+ const startIndex = state.startIndex || 0;
17137
17142
  this.type = state.type;
17138
17143
  this.value = state.value;
17139
- this.start = state.start;
17140
- this.end = state.end;
17144
+ this.start = startIndex + state.start;
17145
+ this.end = startIndex + state.end;
17141
17146
  this.loc = new SourceLocation(state.startLoc, state.endLoc);
17142
17147
  }
17143
17148
  }
@@ -17311,7 +17316,7 @@ function requireLib$j() {
17311
17316
  this.state.start = this.state.pos;
17312
17317
  if (!this.isLookahead) this.state.startLoc = this.state.curPosition();
17313
17318
  if (this.state.pos >= this.length) {
17314
- this.finishToken(139);
17319
+ this.finishToken(140);
17315
17320
  return;
17316
17321
  }
17317
17322
  this.getTokenFromCode(this.codePointAtPos(this.state.pos));
@@ -17334,8 +17339,8 @@ function requireLib$j() {
17334
17339
  const comment = {
17335
17340
  type: 'CommentBlock',
17336
17341
  value: this.input.slice(start + 2, end),
17337
- start: start,
17338
- end: end + commentEnd.length,
17342
+ start: this.sourceToOffsetPos(start),
17343
+ end: this.sourceToOffsetPos(end + commentEnd.length),
17339
17344
  loc: new SourceLocation(startLoc, this.state.curPosition()),
17340
17345
  };
17341
17346
  if (this.options.tokens) this.pushToken(comment);
@@ -17357,8 +17362,8 @@ function requireLib$j() {
17357
17362
  const comment = {
17358
17363
  type: 'CommentLine',
17359
17364
  value: value,
17360
- start: start,
17361
- end: end,
17365
+ start: this.sourceToOffsetPos(start),
17366
+ end: this.sourceToOffsetPos(end),
17362
17367
  loc: new SourceLocation(startLoc, this.state.curPosition()),
17363
17368
  };
17364
17369
  if (this.options.tokens) this.pushToken(comment);
@@ -17503,10 +17508,10 @@ function requireLib$j() {
17503
17508
  }
17504
17509
  } else if (isIdentifierStart(next)) {
17505
17510
  ++this.state.pos;
17506
- this.finishToken(138, this.readWord1(next));
17511
+ this.finishToken(139, this.readWord1(next));
17507
17512
  } else if (next === 92) {
17508
17513
  ++this.state.pos;
17509
- this.finishToken(138, this.readWord1());
17514
+ this.finishToken(139, this.readWord1());
17510
17515
  } else {
17511
17516
  this.finishOp(27, 1);
17512
17517
  }
@@ -17954,7 +17959,7 @@ function requireLib$j() {
17954
17959
  mods += char;
17955
17960
  }
17956
17961
  this.state.pos = pos;
17957
- this.finishToken(137, {pattern: content, flags: mods});
17962
+ this.finishToken(138, {pattern: content, flags: mods});
17958
17963
  }
17959
17964
  readInt(radix, len, forceLen = false, allowNumSeparator = true) {
17960
17965
  const {n: n, pos: pos} = readInt(
@@ -17999,10 +18004,10 @@ function requireLib$j() {
17999
18004
  const str = this.input
18000
18005
  .slice(start, this.state.pos)
18001
18006
  .replace(/[_n]/g, '');
18002
- this.finishToken(135, str);
18007
+ this.finishToken(136, str);
18003
18008
  return;
18004
18009
  }
18005
- this.finishToken(134, val);
18010
+ this.finishToken(135, val);
18006
18011
  }
18007
18012
  readNumber(startsWithDot) {
18008
18013
  const start = this.state.pos;
@@ -18069,15 +18074,15 @@ function requireLib$j() {
18069
18074
  }
18070
18075
  const str = this.input.slice(start, this.state.pos).replace(/[_mn]/g, '');
18071
18076
  if (isBigInt) {
18072
- this.finishToken(135, str);
18077
+ this.finishToken(136, str);
18073
18078
  return;
18074
18079
  }
18075
18080
  if (isDecimal) {
18076
- this.finishToken(136, str);
18081
+ this.finishToken(137, str);
18077
18082
  return;
18078
18083
  }
18079
18084
  const val = isOctal ? parseInt(str, 8) : parseFloat(str);
18080
- this.finishToken(134, val);
18085
+ this.finishToken(135, val);
18081
18086
  }
18082
18087
  readCodePoint(throwOnInvalid) {
18083
18088
  const {code: code, pos: pos} = readCodePoint(
@@ -18108,7 +18113,7 @@ function requireLib$j() {
18108
18113
  this.state.pos = pos + 1;
18109
18114
  this.state.lineStart = lineStart;
18110
18115
  this.state.curLine = curLine;
18111
- this.finishToken(133, str);
18116
+ this.finishToken(134, str);
18112
18117
  }
18113
18118
  readTemplateContinuation() {
18114
18119
  if (!this.match(8)) {
@@ -18140,7 +18145,7 @@ function requireLib$j() {
18140
18145
  this.state.firstInvalidTemplateEscapePos = new Position(
18141
18146
  firstInvalidLoc.curLine,
18142
18147
  firstInvalidLoc.pos - firstInvalidLoc.lineStart,
18143
- firstInvalidLoc.pos
18148
+ this.sourceToOffsetPos(firstInvalidLoc.pos)
18144
18149
  );
18145
18150
  }
18146
18151
  if (this.input.codePointAt(pos) === 96) {
@@ -18524,7 +18529,7 @@ function requireLib$j() {
18524
18529
  }
18525
18530
  }
18526
18531
  canInsertSemicolon() {
18527
- return this.match(139) || this.match(8) || this.hasPrecedingLineBreak();
18532
+ return this.match(140) || this.match(8) || this.hasPrecedingLineBreak();
18528
18533
  }
18529
18534
  hasPrecedingLineBreak() {
18530
18535
  return hasNewLine(
@@ -18997,7 +19002,7 @@ function requireLib$j() {
18997
19002
  );
18998
19003
  }
18999
19004
  finishToken(type, val) {
19000
- if (type !== 133 && type !== 13 && type !== 28) {
19005
+ if (type !== 134 && type !== 13 && type !== 28) {
19001
19006
  if (this.flowPragma === undefined) {
19002
19007
  this.flowPragma = null;
19003
19008
  }
@@ -19133,7 +19138,7 @@ function requireLib$j() {
19133
19138
  }
19134
19139
  flowParseDeclareModule(node) {
19135
19140
  this.scope.enter(0);
19136
- if (this.match(133)) {
19141
+ if (this.match(134)) {
19137
19142
  node.id = super.parseExprAtom();
19138
19143
  } else {
19139
19144
  node.id = this.parseIdentifier();
@@ -19401,7 +19406,7 @@ function requireLib$j() {
19401
19406
  const node = this.startNode();
19402
19407
  node.params = [];
19403
19408
  this.state.inType = true;
19404
- if (this.match(47) || this.match(142)) {
19409
+ if (this.match(47) || this.match(143)) {
19405
19410
  this.next();
19406
19411
  } else {
19407
19412
  this.unexpected();
@@ -19475,7 +19480,7 @@ function requireLib$j() {
19475
19480
  return this.finishNode(node, 'InterfaceTypeAnnotation');
19476
19481
  }
19477
19482
  flowParseObjectPropertyKey() {
19478
- return this.match(134) || this.match(133)
19483
+ return this.match(135) || this.match(134)
19479
19484
  ? super.parseExprAtom()
19480
19485
  : this.parseIdentifier(true);
19481
19486
  }
@@ -19987,7 +19992,7 @@ function requireLib$j() {
19987
19992
  node.typeParameters = null;
19988
19993
  return this.finishNode(node, 'FunctionTypeAnnotation');
19989
19994
  }
19990
- case 133:
19995
+ case 134:
19991
19996
  return this.parseLiteral(
19992
19997
  this.state.value,
19993
19998
  'StringLiteralTypeAnnotation'
@@ -20000,14 +20005,14 @@ function requireLib$j() {
20000
20005
  case 53:
20001
20006
  if (this.state.value === '-') {
20002
20007
  this.next();
20003
- if (this.match(134)) {
20008
+ if (this.match(135)) {
20004
20009
  return this.parseLiteralAtNode(
20005
20010
  -this.state.value,
20006
20011
  'NumberLiteralTypeAnnotation',
20007
20012
  node
20008
20013
  );
20009
20014
  }
20010
- if (this.match(135)) {
20015
+ if (this.match(136)) {
20011
20016
  return this.parseLiteralAtNode(
20012
20017
  -this.state.value,
20013
20018
  'BigIntLiteralTypeAnnotation',
@@ -20021,12 +20026,12 @@ function requireLib$j() {
20021
20026
  }
20022
20027
  this.unexpected();
20023
20028
  return;
20024
- case 134:
20029
+ case 135:
20025
20030
  return this.parseLiteral(
20026
20031
  this.state.value,
20027
20032
  'NumberLiteralTypeAnnotation'
20028
20033
  );
20029
- case 135:
20034
+ case 136:
20030
20035
  return this.parseLiteral(
20031
20036
  this.state.value,
20032
20037
  'BigIntLiteralTypeAnnotation'
@@ -20907,7 +20912,7 @@ function requireLib$j() {
20907
20912
  var _jsx;
20908
20913
  let state = null;
20909
20914
  let jsx;
20910
- if (this.hasPlugin('jsx') && (this.match(142) || this.match(47))) {
20915
+ if (this.hasPlugin('jsx') && (this.match(143) || this.match(47))) {
20911
20916
  state = this.state.clone();
20912
20917
  jsx = this.tryParse(
20913
20918
  () => super.parseMaybeAssign(refExpressionErrors, afterLeftParse),
@@ -21263,14 +21268,14 @@ function requireLib$j() {
21263
21268
  const startLoc = this.state.startLoc;
21264
21269
  const endOfInit = () => this.match(12) || this.match(8);
21265
21270
  switch (this.state.type) {
21266
- case 134: {
21271
+ case 135: {
21267
21272
  const literal = this.parseNumericLiteral(this.state.value);
21268
21273
  if (endOfInit()) {
21269
21274
  return {type: 'number', loc: literal.loc.start, value: literal};
21270
21275
  }
21271
21276
  return {type: 'invalid', loc: startLoc};
21272
21277
  }
21273
- case 133: {
21278
+ case 134: {
21274
21279
  const literal = this.parseStringLiteral(this.state.value);
21275
21280
  if (endOfInit()) {
21276
21281
  return {type: 'string', loc: literal.loc.start, value: literal};
@@ -21883,14 +21888,14 @@ function requireLib$j() {
21883
21888
  if (this.state.pos === this.state.start) {
21884
21889
  if (ch === 60 && this.state.canStartJSXElement) {
21885
21890
  ++this.state.pos;
21886
- this.finishToken(142);
21891
+ this.finishToken(143);
21887
21892
  } else {
21888
21893
  super.getTokenFromCode(ch);
21889
21894
  }
21890
21895
  return;
21891
21896
  }
21892
21897
  out += this.input.slice(chunkStart, this.state.pos);
21893
- this.finishToken(141, out);
21898
+ this.finishToken(142, out);
21894
21899
  return;
21895
21900
  case 38:
21896
21901
  out += this.input.slice(chunkStart, this.state.pos);
@@ -21946,7 +21951,7 @@ function requireLib$j() {
21946
21951
  }
21947
21952
  }
21948
21953
  out += this.input.slice(chunkStart, this.state.pos++);
21949
- this.finishToken(133, out);
21954
+ this.finishToken(134, out);
21950
21955
  }
21951
21956
  jsxReadEntity() {
21952
21957
  const startPos = ++this.state.pos;
@@ -21993,11 +21998,11 @@ function requireLib$j() {
21993
21998
  do {
21994
21999
  ch = this.input.charCodeAt(++this.state.pos);
21995
22000
  } while (isIdentifierChar(ch) || ch === 45);
21996
- this.finishToken(140, this.input.slice(start, this.state.pos));
22001
+ this.finishToken(141, this.input.slice(start, this.state.pos));
21997
22002
  }
21998
22003
  jsxParseIdentifier() {
21999
22004
  const node = this.startNode();
22000
- if (this.match(140)) {
22005
+ if (this.match(141)) {
22001
22006
  node.name = this.state.value;
22002
22007
  } else if (tokenIsKeyword(this.state.type)) {
22003
22008
  node.name = tokenLabelName(this.state.type);
@@ -22042,8 +22047,8 @@ function requireLib$j() {
22042
22047
  this.raise(JsxErrors.AttributeIsEmpty, node);
22043
22048
  }
22044
22049
  return node;
22045
- case 142:
22046
- case 133:
22050
+ case 143:
22051
+ case 134:
22047
22052
  return this.parseExprAtom();
22048
22053
  default:
22049
22054
  throw this.raise(
@@ -22098,7 +22103,7 @@ function requireLib$j() {
22098
22103
  }
22099
22104
  jsxParseOpeningElementAt(startLoc) {
22100
22105
  const node = this.startNodeAt(startLoc);
22101
- if (this.eat(143)) {
22106
+ if (this.eat(144)) {
22102
22107
  return this.finishNode(node, 'JSXOpeningFragment');
22103
22108
  }
22104
22109
  node.name = this.jsxParseElementName();
@@ -22106,21 +22111,21 @@ function requireLib$j() {
22106
22111
  }
22107
22112
  jsxParseOpeningElementAfterName(node) {
22108
22113
  const attributes = [];
22109
- while (!this.match(56) && !this.match(143)) {
22114
+ while (!this.match(56) && !this.match(144)) {
22110
22115
  attributes.push(this.jsxParseAttribute());
22111
22116
  }
22112
22117
  node.attributes = attributes;
22113
22118
  node.selfClosing = this.eat(56);
22114
- this.expect(143);
22119
+ this.expect(144);
22115
22120
  return this.finishNode(node, 'JSXOpeningElement');
22116
22121
  }
22117
22122
  jsxParseClosingElementAt(startLoc) {
22118
22123
  const node = this.startNodeAt(startLoc);
22119
- if (this.eat(143)) {
22124
+ if (this.eat(144)) {
22120
22125
  return this.finishNode(node, 'JSXClosingFragment');
22121
22126
  }
22122
22127
  node.name = this.jsxParseElementName();
22123
- this.expect(143);
22128
+ this.expect(144);
22124
22129
  return this.finishNode(node, 'JSXClosingElement');
22125
22130
  }
22126
22131
  jsxParseElementAt(startLoc) {
@@ -22131,7 +22136,7 @@ function requireLib$j() {
22131
22136
  if (!openingElement.selfClosing) {
22132
22137
  contents: for (;;) {
22133
22138
  switch (this.state.type) {
22134
- case 142:
22139
+ case 143:
22135
22140
  startLoc = this.state.startLoc;
22136
22141
  this.next();
22137
22142
  if (this.eat(56)) {
@@ -22140,7 +22145,7 @@ function requireLib$j() {
22140
22145
  }
22141
22146
  children.push(this.jsxParseElementAt(startLoc));
22142
22147
  break;
22143
- case 141:
22148
+ case 142:
22144
22149
  children.push(this.parseLiteral(this.state.value, 'JSXText'));
22145
22150
  break;
22146
22151
  case 5: {
@@ -22215,13 +22220,13 @@ function requireLib$j() {
22215
22220
  context[context.length - 1] = newContext;
22216
22221
  }
22217
22222
  parseExprAtom(refExpressionErrors) {
22218
- if (this.match(142)) {
22223
+ if (this.match(143)) {
22219
22224
  return this.jsxParseElement();
22220
22225
  } else if (
22221
22226
  this.match(47) &&
22222
22227
  this.input.charCodeAt(this.state.pos) !== 33
22223
22228
  ) {
22224
- this.replaceToken(142);
22229
+ this.replaceToken(143);
22225
22230
  return this.jsxParseElement();
22226
22231
  } else {
22227
22232
  return super.parseExprAtom(refExpressionErrors);
@@ -22244,7 +22249,7 @@ function requireLib$j() {
22244
22249
  }
22245
22250
  if (code === 62) {
22246
22251
  ++this.state.pos;
22247
- this.finishToken(143);
22252
+ this.finishToken(144);
22248
22253
  return;
22249
22254
  }
22250
22255
  if ((code === 34 || code === 39) && context === types.j_oTag) {
@@ -22258,19 +22263,19 @@ function requireLib$j() {
22258
22263
  this.input.charCodeAt(this.state.pos + 1) !== 33
22259
22264
  ) {
22260
22265
  ++this.state.pos;
22261
- this.finishToken(142);
22266
+ this.finishToken(143);
22262
22267
  return;
22263
22268
  }
22264
22269
  super.getTokenFromCode(code);
22265
22270
  }
22266
22271
  updateContext(prevType) {
22267
22272
  const {context: context, type: type} = this.state;
22268
- if (type === 56 && prevType === 142) {
22273
+ if (type === 56 && prevType === 143) {
22269
22274
  context.splice(-2, 2, types.j_cTag);
22270
22275
  this.state.canStartJSXElement = false;
22271
- } else if (type === 142) {
22272
- context.push(types.j_oTag);
22273
22276
  } else if (type === 143) {
22277
+ context.push(types.j_oTag);
22278
+ } else if (type === 144) {
22274
22279
  const out = context[context.length - 1];
22275
22280
  if (
22276
22281
  (out === types.j_oTag && prevType === 56) ||
@@ -22666,7 +22671,7 @@ function requireLib$j() {
22666
22671
  return this.parseBindingRestProperty(this.startNode());
22667
22672
  }
22668
22673
  const prop = this.startNode();
22669
- if (type === 138) {
22674
+ if (type === 139) {
22670
22675
  this.expectPlugin('destructuringPrivate', startLoc);
22671
22676
  this.classScope.usePrivateName(this.state.value, startLoc);
22672
22677
  prop.key = this.parsePrivateName();
@@ -23084,7 +23089,7 @@ function requireLib$j() {
23084
23089
  this.match(5) ||
23085
23090
  this.match(55) ||
23086
23091
  this.match(21) ||
23087
- this.match(138) ||
23092
+ this.match(139) ||
23088
23093
  this.isLiteralPropertyName()
23089
23094
  );
23090
23095
  }
@@ -23293,7 +23298,7 @@ function requireLib$j() {
23293
23298
  const node = this.startNode();
23294
23299
  this.expect(83);
23295
23300
  this.expect(10);
23296
- if (!this.match(133)) {
23301
+ if (!this.match(134)) {
23297
23302
  this.raise(
23298
23303
  TSErrors.UnsupportedImportTypeArgument,
23299
23304
  this.state.startLoc
@@ -23374,7 +23379,7 @@ function requireLib$j() {
23374
23379
  }
23375
23380
  tsParseTypeParameters(parseModifiers) {
23376
23381
  const node = this.startNode();
23377
- if (this.match(47) || this.match(142)) {
23382
+ if (this.match(47) || this.match(143)) {
23378
23383
  this.next();
23379
23384
  } else {
23380
23385
  this.unexpected();
@@ -23772,9 +23777,9 @@ function requireLib$j() {
23772
23777
  tsParseLiteralTypeNode() {
23773
23778
  const node = this.startNode();
23774
23779
  switch (this.state.type) {
23775
- case 134:
23776
23780
  case 135:
23777
- case 133:
23781
+ case 136:
23782
+ case 134:
23778
23783
  case 85:
23779
23784
  case 86:
23780
23785
  node.literal = super.parseExprAtom();
@@ -23803,9 +23808,9 @@ function requireLib$j() {
23803
23808
  }
23804
23809
  tsParseNonArrayType() {
23805
23810
  switch (this.state.type) {
23806
- case 133:
23807
23811
  case 134:
23808
23812
  case 135:
23813
+ case 136:
23809
23814
  case 85:
23810
23815
  case 86:
23811
23816
  return this.tsParseLiteralTypeNode();
@@ -23813,7 +23818,7 @@ function requireLib$j() {
23813
23818
  if (this.state.value === '-') {
23814
23819
  const node = this.startNode();
23815
23820
  const nextToken = this.lookahead();
23816
- if (nextToken.type !== 134 && nextToken.type !== 135) {
23821
+ if (nextToken.type !== 135 && nextToken.type !== 136) {
23817
23822
  this.unexpected();
23818
23823
  }
23819
23824
  node.literal = this.parseMaybeUnary();
@@ -24278,7 +24283,7 @@ function requireLib$j() {
24278
24283
  }
24279
24284
  tsParseEnumMember() {
24280
24285
  const node = this.startNode();
24281
- node.id = this.match(133)
24286
+ node.id = this.match(134)
24282
24287
  ? super.parseStringLiteral(this.state.value)
24283
24288
  : this.parseIdentifier(true);
24284
24289
  if (this.eat(29)) {
@@ -24331,7 +24336,7 @@ function requireLib$j() {
24331
24336
  node.kind = 'global';
24332
24337
  node.global = true;
24333
24338
  node.id = this.parseIdentifier();
24334
- } else if (this.match(133)) {
24339
+ } else if (this.match(134)) {
24335
24340
  node.kind = 'module';
24336
24341
  node.id = super.parseStringLiteral(this.state.value);
24337
24342
  } else {
@@ -24376,7 +24381,7 @@ function requireLib$j() {
24376
24381
  const node = this.startNode();
24377
24382
  this.expectContextual(119);
24378
24383
  this.expect(10);
24379
- if (!this.match(133)) {
24384
+ if (!this.match(134)) {
24380
24385
  this.unexpected();
24381
24386
  }
24382
24387
  node.expression = super.parseExprAtom();
@@ -24506,7 +24511,7 @@ function requireLib$j() {
24506
24511
  break;
24507
24512
  case 'module':
24508
24513
  if (this.tsCheckLineTerminator(next)) {
24509
- if (this.match(133)) {
24514
+ if (this.match(134)) {
24510
24515
  return this.tsParseAmbientExternalModuleDeclaration(node);
24511
24516
  } else if (tokenIsIdentifier(this.state.type)) {
24512
24517
  node.kind = 'module';
@@ -24880,7 +24885,7 @@ function requireLib$j() {
24880
24885
  }
24881
24886
  }
24882
24887
  parseImport(node) {
24883
- if (this.match(133)) {
24888
+ if (this.match(134)) {
24884
24889
  node.importKind = 'value';
24885
24890
  return super.parseImport(node);
24886
24891
  }
@@ -25368,7 +25373,7 @@ function requireLib$j() {
25368
25373
  let state;
25369
25374
  let jsx;
25370
25375
  let typeCast;
25371
- if (this.hasPlugin('jsx') && (this.match(142) || this.match(47))) {
25376
+ if (this.hasPlugin('jsx') && (this.match(143) || this.match(47))) {
25372
25377
  state = this.state.clone();
25373
25378
  jsx = this.tryParse(
25374
25379
  () => super.parseMaybeAssign(refExpressionErrors, afterLeftParse),
@@ -25986,13 +25991,13 @@ function requireLib$j() {
25986
25991
  var placeholders = superClass =>
25987
25992
  class PlaceholdersParserMixin extends superClass {
25988
25993
  parsePlaceholder(expectedNode) {
25989
- if (this.match(144)) {
25994
+ if (this.match(133)) {
25990
25995
  const node = this.startNode();
25991
25996
  this.next();
25992
25997
  this.assertNoSpace();
25993
25998
  node.name = super.parseIdentifier(true);
25994
25999
  this.assertNoSpace();
25995
- this.expect(144);
26000
+ this.expect(133);
25996
26001
  return this.finishPlaceholder(node, expectedNode);
25997
26002
  }
25998
26003
  }
@@ -26006,7 +26011,7 @@ function requireLib$j() {
26006
26011
  }
26007
26012
  getTokenFromCode(code) {
26008
26013
  if (code === 37 && this.input.charCodeAt(this.state.pos + 1) === 37) {
26009
- this.finishOp(144, 2);
26014
+ this.finishOp(133, 2);
26010
26015
  } else {
26011
26016
  super.getTokenFromCode(code);
26012
26017
  }
@@ -26052,7 +26057,7 @@ function requireLib$j() {
26052
26057
  return true;
26053
26058
  }
26054
26059
  const nextToken = this.lookahead();
26055
- if (nextToken.type === 144) {
26060
+ if (nextToken.type === 133) {
26056
26061
  return true;
26057
26062
  }
26058
26063
  return false;
@@ -26103,7 +26108,7 @@ function requireLib$j() {
26103
26108
  const oldStrict = this.state.strict;
26104
26109
  const placeholder = this.parsePlaceholder('Identifier');
26105
26110
  if (placeholder) {
26106
- if (this.match(81) || this.match(144) || this.match(5)) {
26111
+ if (this.match(81) || this.match(133) || this.match(5)) {
26107
26112
  node.id = placeholder;
26108
26113
  } else if (optionalId || !isStatement) {
26109
26114
  node.id = null;
@@ -26151,7 +26156,7 @@ function requireLib$j() {
26151
26156
  if (this.isUnparsedContextual(next, 'from')) {
26152
26157
  if (
26153
26158
  this.input.startsWith(
26154
- tokenLabelName(144),
26159
+ tokenLabelName(133),
26155
26160
  this.nextTokenStartSince(next + 4)
26156
26161
  )
26157
26162
  ) {
@@ -26491,7 +26496,7 @@ function requireLib$j() {
26491
26496
  this.enterInitialScopes();
26492
26497
  this.nextToken();
26493
26498
  const expr = this.parseExpression();
26494
- if (!this.match(139)) {
26499
+ if (!this.match(140)) {
26495
26500
  this.unexpected();
26496
26501
  }
26497
26502
  this.finalizeRemainingComments();
@@ -26630,7 +26635,7 @@ function requireLib$j() {
26630
26635
  return expr;
26631
26636
  }
26632
26637
  parseMaybeUnaryOrPrivate(refExpressionErrors) {
26633
- return this.match(138)
26638
+ return this.match(139)
26634
26639
  ? this.parsePrivateName()
26635
26640
  : this.parseMaybeUnary(refExpressionErrors);
26636
26641
  }
@@ -26906,7 +26911,7 @@ function requireLib$j() {
26906
26911
  if (computed) {
26907
26912
  node.property = this.parseExpression();
26908
26913
  this.expect(3);
26909
- } else if (this.match(138)) {
26914
+ } else if (this.match(139)) {
26910
26915
  if (base.type === 'Super') {
26911
26916
  this.raise(Errors.SuperPrivateField, startLoc);
26912
26917
  }
@@ -27114,11 +27119,11 @@ function requireLib$j() {
27114
27119
  this.readRegexp();
27115
27120
  return this.parseRegExpLiteral(this.state.value);
27116
27121
  }
27117
- case 134:
27118
- return this.parseNumericLiteral(this.state.value);
27119
27122
  case 135:
27123
+ return this.parseNumericLiteral(this.state.value);
27124
+ case 136:
27120
27125
  return this.parseBigIntLiteral(this.state.value);
27121
- case 133:
27126
+ case 134:
27122
27127
  return this.parseStringLiteral(this.state.value);
27123
27128
  case 84:
27124
27129
  return this.parseNullLiteral();
@@ -27177,7 +27182,7 @@ function requireLib$j() {
27177
27182
  throw this.raise(Errors.UnsupportedBind, callee);
27178
27183
  }
27179
27184
  }
27180
- case 138: {
27185
+ case 139: {
27181
27186
  this.raise(Errors.PrivateInExpectedIn, this.state.startLoc, {
27182
27187
  identifierName: this.state.value,
27183
27188
  });
@@ -27216,7 +27221,7 @@ function requireLib$j() {
27216
27221
  break;
27217
27222
  }
27218
27223
  default:
27219
- if (type === 136) {
27224
+ if (type === 137) {
27220
27225
  return this.parseDecimalLiteral(this.state.value);
27221
27226
  }
27222
27227
  if (tokenIsIdentifier(type)) {
@@ -27956,16 +27961,16 @@ function requireLib$j() {
27956
27961
  key = this.parseIdentifier(true);
27957
27962
  } else {
27958
27963
  switch (type) {
27959
- case 134:
27964
+ case 135:
27960
27965
  key = this.parseNumericLiteral(value);
27961
27966
  break;
27962
- case 133:
27967
+ case 134:
27963
27968
  key = this.parseStringLiteral(value);
27964
27969
  break;
27965
- case 135:
27970
+ case 136:
27966
27971
  key = this.parseBigIntLiteral(value);
27967
27972
  break;
27968
- case 138: {
27973
+ case 139: {
27969
27974
  const privateKeyLoc = this.state.startLoc;
27970
27975
  if (refExpressionErrors != null) {
27971
27976
  if (refExpressionErrors.privateKeyLoc === null) {
@@ -27978,7 +27983,7 @@ function requireLib$j() {
27978
27983
  break;
27979
27984
  }
27980
27985
  default:
27981
- if (type === 136) {
27986
+ if (type === 137) {
27982
27987
  key = this.parseDecimalLiteral(value);
27983
27988
  break;
27984
27989
  }
@@ -27986,7 +27991,7 @@ function requireLib$j() {
27986
27991
  }
27987
27992
  }
27988
27993
  prop.key = key;
27989
- if (type !== 138) {
27994
+ if (type !== 139) {
27990
27995
  prop.computed = false;
27991
27996
  }
27992
27997
  }
@@ -28293,7 +28298,7 @@ function requireLib$j() {
28293
28298
  type === 0 ||
28294
28299
  tokenIsTemplate(type) ||
28295
28300
  (type === 102 && !this.state.containsEsc) ||
28296
- type === 137 ||
28301
+ type === 138 ||
28297
28302
  type === 56 ||
28298
28303
  (this.hasPlugin('v8intrinsic') && type === 54)
28299
28304
  );
@@ -28311,7 +28316,7 @@ function requireLib$j() {
28311
28316
  delegating = this.eat(55);
28312
28317
  switch (this.state.type) {
28313
28318
  case 13:
28314
- case 139:
28319
+ case 140:
28315
28320
  case 8:
28316
28321
  case 11:
28317
28322
  case 3:
@@ -28497,13 +28502,13 @@ function requireLib$j() {
28497
28502
  switchLabel = {kind: 2};
28498
28503
  const loneSurrogate = /[\uD800-\uDFFF]/u;
28499
28504
  const keywordRelationalOperator = /in(?:stanceof)?/y;
28500
- function babel7CompatTokens(tokens, input) {
28505
+ function babel7CompatTokens(tokens, input, startIndex) {
28501
28506
  for (let i = 0; i < tokens.length; i++) {
28502
28507
  const token = tokens[i];
28503
28508
  const {type: type} = token;
28504
28509
  if (typeof type === 'number') {
28505
28510
  {
28506
- if (type === 138) {
28511
+ if (type === 139) {
28507
28512
  const {loc: loc, start: start, value: value, end: end} = token;
28508
28513
  const hashEndPos = start + 1;
28509
28514
  const hashEndLoc = createPositionWithColumnOffset(loc.start, 1);
@@ -28538,7 +28543,7 @@ function requireLib$j() {
28538
28543
  1
28539
28544
  );
28540
28545
  let startToken;
28541
- if (input.charCodeAt(start) === 96) {
28546
+ if (input.charCodeAt(start - startIndex) === 96) {
28542
28547
  startToken = new Token({
28543
28548
  type: getExportedToken(22),
28544
28549
  value: '`',
@@ -28620,11 +28625,15 @@ function requireLib$j() {
28620
28625
  file.program = this.parseProgram(program);
28621
28626
  file.comments = this.comments;
28622
28627
  if (this.options.tokens) {
28623
- file.tokens = babel7CompatTokens(this.tokens, this.input);
28628
+ file.tokens = babel7CompatTokens(
28629
+ this.tokens,
28630
+ this.input,
28631
+ this.startIndex
28632
+ );
28624
28633
  }
28625
28634
  return this.finishNode(file, 'File');
28626
28635
  }
28627
- parseProgram(program, end = 139, sourceType = this.options.sourceType) {
28636
+ parseProgram(program, end = 140, sourceType = this.options.sourceType) {
28628
28637
  program.sourceType = sourceType;
28629
28638
  program.interpreter = this.parseInterpreterDirective();
28630
28639
  this.parseBlockBody(program, true, true, end);
@@ -28644,7 +28653,7 @@ function requireLib$j() {
28644
28653
  this.addExtra(program, 'topLevelAwait', this.state.hasTopLevelAwait);
28645
28654
  }
28646
28655
  let finishedProgram;
28647
- if (end === 139) {
28656
+ if (end === 140) {
28648
28657
  finishedProgram = this.finishNode(program, 'Program');
28649
28658
  } else {
28650
28659
  finishedProgram = this.finishNodeAt(
@@ -29039,7 +29048,7 @@ function requireLib$j() {
29039
29048
  while (this.eat(16)) {
29040
29049
  const node = this.startNodeAt(startLoc);
29041
29050
  node.object = expr;
29042
- if (this.match(138)) {
29051
+ if (this.match(139)) {
29043
29052
  this.classScope.usePrivateName(
29044
29053
  this.state.value,
29045
29054
  this.state.startLoc
@@ -29761,7 +29770,7 @@ function requireLib$j() {
29761
29770
  this.parsePropertyNamePrefixOperator(member);
29762
29771
  if (this.eat(55)) {
29763
29772
  method.kind = 'method';
29764
- const isPrivateName = this.match(138);
29773
+ const isPrivateName = this.match(139);
29765
29774
  this.parseClassElementName(method);
29766
29775
  if (isPrivateName) {
29767
29776
  this.pushClassPrivateMethod(classBody, privateMethod, true, false);
@@ -29831,7 +29840,7 @@ function requireLib$j() {
29831
29840
  this.unexpected(maybeQuestionTokenStartLoc);
29832
29841
  }
29833
29842
  method.kind = 'method';
29834
- const isPrivate = this.match(138);
29843
+ const isPrivate = this.match(139);
29835
29844
  this.parseClassElementName(method);
29836
29845
  this.parsePostMemberNameModifiers(publicMember);
29837
29846
  if (isPrivate) {
@@ -29860,7 +29869,7 @@ function requireLib$j() {
29860
29869
  ) {
29861
29870
  this.resetPreviousNodeTrailingComments(key);
29862
29871
  method.kind = maybeContextualKw;
29863
- const isPrivate = this.match(138);
29872
+ const isPrivate = this.match(139);
29864
29873
  this.parseClassElementName(publicMethod);
29865
29874
  if (isPrivate) {
29866
29875
  this.pushClassPrivateMethod(classBody, privateMethod, false, false);
@@ -29881,7 +29890,7 @@ function requireLib$j() {
29881
29890
  } else if (maybeContextualKw === 'accessor' && !this.isLineTerminator()) {
29882
29891
  this.expectPlugin('decoratorAutoAccessors');
29883
29892
  this.resetPreviousNodeTrailingComments(key);
29884
- const isPrivate = this.match(138);
29893
+ const isPrivate = this.match(139);
29885
29894
  this.parseClassElementName(publicProp);
29886
29895
  this.pushClassAccessorProperty(classBody, accessorProp, isPrivate);
29887
29896
  } else if (this.isLineTerminator()) {
@@ -29897,13 +29906,13 @@ function requireLib$j() {
29897
29906
  parseClassElementName(member) {
29898
29907
  const {type: type, value: value} = this.state;
29899
29908
  if (
29900
- (type === 132 || type === 133) &&
29909
+ (type === 132 || type === 134) &&
29901
29910
  member.static &&
29902
29911
  value === 'prototype'
29903
29912
  ) {
29904
29913
  this.raise(Errors.StaticPrototype, this.state.startLoc);
29905
29914
  }
29906
- if (type === 138) {
29915
+ if (type === 139) {
29907
29916
  if (value === 'constructor') {
29908
29917
  this.raise(Errors.ConstructorClassPrivateField, this.state.startLoc);
29909
29918
  }
@@ -30417,7 +30426,7 @@ function requireLib$j() {
30417
30426
  if (this.eat(8)) break;
30418
30427
  }
30419
30428
  const isMaybeTypeOnly = this.isContextual(130);
30420
- const isString = this.match(133);
30429
+ const isString = this.match(134);
30421
30430
  const node = this.startNode();
30422
30431
  node.local = this.parseModuleExportName();
30423
30432
  nodes.push(
@@ -30442,7 +30451,7 @@ function requireLib$j() {
30442
30451
  return this.finishNode(node, 'ExportSpecifier');
30443
30452
  }
30444
30453
  parseModuleExportName() {
30445
- if (this.match(133)) {
30454
+ if (this.match(134)) {
30446
30455
  const result = this.parseStringLiteral(this.state.value);
30447
30456
  const surrogate = loneSurrogate.exec(result.value);
30448
30457
  if (surrogate) {
@@ -30592,7 +30601,7 @@ function requireLib$j() {
30592
30601
  : type !== 12;
30593
30602
  }
30594
30603
  parseImport(node) {
30595
- if (this.match(133)) {
30604
+ if (this.match(134)) {
30596
30605
  return this.parseImportSourceAndAttributes(node);
30597
30606
  }
30598
30607
  return this.parseImportSpecifiersAndAfter(
@@ -30625,7 +30634,7 @@ function requireLib$j() {
30625
30634
  return this.finishNode(node, 'ImportDeclaration');
30626
30635
  }
30627
30636
  parseImportSource() {
30628
- if (!this.match(133)) this.unexpected();
30637
+ if (!this.match(134)) this.unexpected();
30629
30638
  return this.parseExprAtom();
30630
30639
  }
30631
30640
  parseImportSpecifierLocal(node, specifier, type) {
@@ -30654,13 +30663,13 @@ function requireLib$j() {
30654
30663
  );
30655
30664
  }
30656
30665
  attrNames.add(keyName);
30657
- if (this.match(133)) {
30666
+ if (this.match(134)) {
30658
30667
  node.key = this.parseStringLiteral(keyName);
30659
30668
  } else {
30660
30669
  node.key = this.parseIdentifier(true);
30661
30670
  }
30662
30671
  this.expect(14);
30663
- if (!this.match(133)) {
30672
+ if (!this.match(134)) {
30664
30673
  throw this.raise(
30665
30674
  Errors.ModuleAttributeInvalidValue,
30666
30675
  this.state.startLoc
@@ -30688,7 +30697,7 @@ function requireLib$j() {
30688
30697
  }
30689
30698
  attributes.add(node.key.name);
30690
30699
  this.expect(14);
30691
- if (!this.match(133)) {
30700
+ if (!this.match(134)) {
30692
30701
  throw this.raise(
30693
30702
  Errors.ModuleAttributeInvalidValue,
30694
30703
  this.state.startLoc
@@ -30787,7 +30796,7 @@ function requireLib$j() {
30787
30796
  if (this.eat(8)) break;
30788
30797
  }
30789
30798
  const specifier = this.startNode();
30790
- const importedIsString = this.match(133);
30799
+ const importedIsString = this.match(134);
30791
30800
  const isMaybeTypeOnly = this.isContextual(130);
30792
30801
  specifier.imported = this.parseModuleExportName();
30793
30802
  const importSpecifier = this.parseImportSpecifier(
@@ -59213,7 +59222,8 @@ function requireTokenMap() {
59213
59222
  }
59214
59223
  const indexes = [];
59215
59224
  for (const child of children) {
59216
- if (!child) continue;
59225
+ if (child == null) continue;
59226
+ if (child.start == null || child.end == null) continue;
59217
59227
  const childTok = this._findTokensOfNode(child, low, last);
59218
59228
  const high = childTok.first;
59219
59229
  for (let k = low; k < high; k++) indexes.push(k);
@@ -132806,7 +132816,7 @@ function lowerJsxElementName(builder, exprPath) {
132806
132816
  }
132807
132817
  }
132808
132818
  function lowerJsxMemberExpression(builder, exprPath) {
132809
- var _a, _b;
132819
+ var _a, _b, _c;
132810
132820
  const loc =
132811
132821
  (_a = exprPath.node.loc) !== null && _a !== void 0 ? _a : GeneratedSource;
132812
132822
  const object = exprPath.get('object');
@@ -132820,7 +132830,15 @@ function lowerJsxMemberExpression(builder, exprPath) {
132820
132830
  loc: (_b = object.node.loc) !== null && _b !== void 0 ? _b : null,
132821
132831
  suggestions: null,
132822
132832
  });
132823
- objectPlace = lowerIdentifier(builder, object);
132833
+ const kind = getLoadKind(builder, object);
132834
+ objectPlace = lowerValueToTemporary(builder, {
132835
+ kind: kind,
132836
+ place: lowerIdentifier(builder, object),
132837
+ loc:
132838
+ (_c = exprPath.node.loc) !== null && _c !== void 0
132839
+ ? _c
132840
+ : GeneratedSource,
132841
+ });
132824
132842
  }
132825
132843
  const property = exprPath.get('property').node.name;
132826
132844
  return lowerValueToTemporary(builder, {
@@ -134724,130 +134742,138 @@ var _default$2 = plugin$2;
134724
134742
  Immutable.default = _default$2;
134725
134743
  var ReactElement = {};
134726
134744
  var reactIs = {exports: {}};
134727
- var reactIs_production = {};
134728
- var hasRequiredReactIs_production;
134729
- function requireReactIs_production() {
134730
- if (hasRequiredReactIs_production) return reactIs_production;
134731
- hasRequiredReactIs_production = 1;
134732
- var REACT_ELEMENT_TYPE = Symbol.for('react.transitional.element'),
134733
- REACT_PORTAL_TYPE = Symbol.for('react.portal'),
134734
- REACT_FRAGMENT_TYPE = Symbol.for('react.fragment'),
134735
- REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode'),
134736
- REACT_PROFILER_TYPE = Symbol.for('react.profiler');
134737
- var REACT_CONSUMER_TYPE = Symbol.for('react.consumer'),
134738
- REACT_CONTEXT_TYPE = Symbol.for('react.context'),
134739
- REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref'),
134740
- REACT_SUSPENSE_TYPE = Symbol.for('react.suspense'),
134741
- REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list'),
134742
- REACT_MEMO_TYPE = Symbol.for('react.memo'),
134743
- REACT_LAZY_TYPE = Symbol.for('react.lazy'),
134744
- REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen'),
134745
- REACT_CLIENT_REFERENCE = Symbol.for('react.client.reference');
134746
- function typeOf(object) {
134747
- if ('object' === typeof object && null !== object) {
134748
- var $$typeof = object.$$typeof;
134749
- switch ($$typeof) {
134750
- case REACT_ELEMENT_TYPE:
134751
- switch (((object = object.type), object)) {
134752
- case REACT_FRAGMENT_TYPE:
134753
- case REACT_PROFILER_TYPE:
134754
- case REACT_STRICT_MODE_TYPE:
134755
- case REACT_SUSPENSE_TYPE:
134756
- case REACT_SUSPENSE_LIST_TYPE:
134757
- return object;
134745
+ var reactIs_production_min = {};
134746
+ var hasRequiredReactIs_production_min;
134747
+ function requireReactIs_production_min() {
134748
+ if (hasRequiredReactIs_production_min) return reactIs_production_min;
134749
+ hasRequiredReactIs_production_min = 1;
134750
+ var b = 'function' === typeof Symbol && Symbol.for,
134751
+ c = b ? Symbol.for('react.element') : 60103,
134752
+ d = b ? Symbol.for('react.portal') : 60106,
134753
+ e = b ? Symbol.for('react.fragment') : 60107,
134754
+ f = b ? Symbol.for('react.strict_mode') : 60108,
134755
+ g = b ? Symbol.for('react.profiler') : 60114,
134756
+ h = b ? Symbol.for('react.provider') : 60109,
134757
+ k = b ? Symbol.for('react.context') : 60110,
134758
+ l = b ? Symbol.for('react.async_mode') : 60111,
134759
+ m = b ? Symbol.for('react.concurrent_mode') : 60111,
134760
+ n = b ? Symbol.for('react.forward_ref') : 60112,
134761
+ p = b ? Symbol.for('react.suspense') : 60113,
134762
+ q = b ? Symbol.for('react.suspense_list') : 60120,
134763
+ r = b ? Symbol.for('react.memo') : 60115,
134764
+ t = b ? Symbol.for('react.lazy') : 60116,
134765
+ v = b ? Symbol.for('react.block') : 60121,
134766
+ w = b ? Symbol.for('react.fundamental') : 60117,
134767
+ x = b ? Symbol.for('react.responder') : 60118,
134768
+ y = b ? Symbol.for('react.scope') : 60119;
134769
+ function z(a) {
134770
+ if ('object' === typeof a && null !== a) {
134771
+ var u = a.$$typeof;
134772
+ switch (u) {
134773
+ case c:
134774
+ switch (((a = a.type), a)) {
134775
+ case l:
134776
+ case m:
134777
+ case e:
134778
+ case g:
134779
+ case f:
134780
+ case p:
134781
+ return a;
134758
134782
  default:
134759
- switch (((object = object && object.$$typeof), object)) {
134760
- case REACT_CONTEXT_TYPE:
134761
- case REACT_FORWARD_REF_TYPE:
134762
- case REACT_LAZY_TYPE:
134763
- case REACT_MEMO_TYPE:
134764
- return object;
134765
- case REACT_CONSUMER_TYPE:
134766
- return object;
134783
+ switch (((a = a && a.$$typeof), a)) {
134784
+ case k:
134785
+ case n:
134786
+ case t:
134787
+ case r:
134788
+ case h:
134789
+ return a;
134767
134790
  default:
134768
- return $$typeof;
134791
+ return u;
134769
134792
  }
134770
134793
  }
134771
- case REACT_PORTAL_TYPE:
134772
- return $$typeof;
134773
- }
134774
- }
134775
- }
134776
- reactIs_production.ContextConsumer = REACT_CONSUMER_TYPE;
134777
- reactIs_production.ContextProvider = REACT_CONTEXT_TYPE;
134778
- reactIs_production.Element = REACT_ELEMENT_TYPE;
134779
- reactIs_production.ForwardRef = REACT_FORWARD_REF_TYPE;
134780
- reactIs_production.Fragment = REACT_FRAGMENT_TYPE;
134781
- reactIs_production.Lazy = REACT_LAZY_TYPE;
134782
- reactIs_production.Memo = REACT_MEMO_TYPE;
134783
- reactIs_production.Portal = REACT_PORTAL_TYPE;
134784
- reactIs_production.Profiler = REACT_PROFILER_TYPE;
134785
- reactIs_production.StrictMode = REACT_STRICT_MODE_TYPE;
134786
- reactIs_production.Suspense = REACT_SUSPENSE_TYPE;
134787
- reactIs_production.SuspenseList = REACT_SUSPENSE_LIST_TYPE;
134788
- reactIs_production.isContextConsumer = function (object) {
134789
- return typeOf(object) === REACT_CONSUMER_TYPE;
134794
+ case d:
134795
+ return u;
134796
+ }
134797
+ }
134798
+ }
134799
+ function A(a) {
134800
+ return z(a) === m;
134801
+ }
134802
+ reactIs_production_min.AsyncMode = l;
134803
+ reactIs_production_min.ConcurrentMode = m;
134804
+ reactIs_production_min.ContextConsumer = k;
134805
+ reactIs_production_min.ContextProvider = h;
134806
+ reactIs_production_min.Element = c;
134807
+ reactIs_production_min.ForwardRef = n;
134808
+ reactIs_production_min.Fragment = e;
134809
+ reactIs_production_min.Lazy = t;
134810
+ reactIs_production_min.Memo = r;
134811
+ reactIs_production_min.Portal = d;
134812
+ reactIs_production_min.Profiler = g;
134813
+ reactIs_production_min.StrictMode = f;
134814
+ reactIs_production_min.Suspense = p;
134815
+ reactIs_production_min.isAsyncMode = function (a) {
134816
+ return A(a) || z(a) === l;
134790
134817
  };
134791
- reactIs_production.isContextProvider = function (object) {
134792
- return typeOf(object) === REACT_CONTEXT_TYPE;
134818
+ reactIs_production_min.isConcurrentMode = A;
134819
+ reactIs_production_min.isContextConsumer = function (a) {
134820
+ return z(a) === k;
134793
134821
  };
134794
- reactIs_production.isElement = function (object) {
134795
- return (
134796
- 'object' === typeof object &&
134797
- null !== object &&
134798
- object.$$typeof === REACT_ELEMENT_TYPE
134799
- );
134822
+ reactIs_production_min.isContextProvider = function (a) {
134823
+ return z(a) === h;
134800
134824
  };
134801
- reactIs_production.isForwardRef = function (object) {
134802
- return typeOf(object) === REACT_FORWARD_REF_TYPE;
134825
+ reactIs_production_min.isElement = function (a) {
134826
+ return 'object' === typeof a && null !== a && a.$$typeof === c;
134803
134827
  };
134804
- reactIs_production.isFragment = function (object) {
134805
- return typeOf(object) === REACT_FRAGMENT_TYPE;
134828
+ reactIs_production_min.isForwardRef = function (a) {
134829
+ return z(a) === n;
134806
134830
  };
134807
- reactIs_production.isLazy = function (object) {
134808
- return typeOf(object) === REACT_LAZY_TYPE;
134831
+ reactIs_production_min.isFragment = function (a) {
134832
+ return z(a) === e;
134809
134833
  };
134810
- reactIs_production.isMemo = function (object) {
134811
- return typeOf(object) === REACT_MEMO_TYPE;
134834
+ reactIs_production_min.isLazy = function (a) {
134835
+ return z(a) === t;
134812
134836
  };
134813
- reactIs_production.isPortal = function (object) {
134814
- return typeOf(object) === REACT_PORTAL_TYPE;
134837
+ reactIs_production_min.isMemo = function (a) {
134838
+ return z(a) === r;
134815
134839
  };
134816
- reactIs_production.isProfiler = function (object) {
134817
- return typeOf(object) === REACT_PROFILER_TYPE;
134840
+ reactIs_production_min.isPortal = function (a) {
134841
+ return z(a) === d;
134818
134842
  };
134819
- reactIs_production.isStrictMode = function (object) {
134820
- return typeOf(object) === REACT_STRICT_MODE_TYPE;
134843
+ reactIs_production_min.isProfiler = function (a) {
134844
+ return z(a) === g;
134821
134845
  };
134822
- reactIs_production.isSuspense = function (object) {
134823
- return typeOf(object) === REACT_SUSPENSE_TYPE;
134846
+ reactIs_production_min.isStrictMode = function (a) {
134847
+ return z(a) === f;
134824
134848
  };
134825
- reactIs_production.isSuspenseList = function (object) {
134826
- return typeOf(object) === REACT_SUSPENSE_LIST_TYPE;
134849
+ reactIs_production_min.isSuspense = function (a) {
134850
+ return z(a) === p;
134827
134851
  };
134828
- reactIs_production.isValidElementType = function (type) {
134829
- return 'string' === typeof type ||
134830
- 'function' === typeof type ||
134831
- type === REACT_FRAGMENT_TYPE ||
134832
- type === REACT_PROFILER_TYPE ||
134833
- type === REACT_STRICT_MODE_TYPE ||
134834
- type === REACT_SUSPENSE_TYPE ||
134835
- type === REACT_SUSPENSE_LIST_TYPE ||
134836
- type === REACT_OFFSCREEN_TYPE ||
134837
- ('object' === typeof type &&
134838
- null !== type &&
134839
- (type.$$typeof === REACT_LAZY_TYPE ||
134840
- type.$$typeof === REACT_MEMO_TYPE ||
134841
- type.$$typeof === REACT_CONTEXT_TYPE ||
134842
- type.$$typeof === REACT_CONSUMER_TYPE ||
134843
- type.$$typeof === REACT_FORWARD_REF_TYPE ||
134844
- type.$$typeof === REACT_CLIENT_REFERENCE ||
134845
- void 0 !== type.getModuleId))
134846
- ? !0
134847
- : !1;
134852
+ reactIs_production_min.isValidElementType = function (a) {
134853
+ return (
134854
+ 'string' === typeof a ||
134855
+ 'function' === typeof a ||
134856
+ a === e ||
134857
+ a === m ||
134858
+ a === g ||
134859
+ a === f ||
134860
+ a === p ||
134861
+ a === q ||
134862
+ ('object' === typeof a &&
134863
+ null !== a &&
134864
+ (a.$$typeof === t ||
134865
+ a.$$typeof === r ||
134866
+ a.$$typeof === h ||
134867
+ a.$$typeof === k ||
134868
+ a.$$typeof === n ||
134869
+ a.$$typeof === w ||
134870
+ a.$$typeof === x ||
134871
+ a.$$typeof === y ||
134872
+ a.$$typeof === v))
134873
+ );
134848
134874
  };
134849
- reactIs_production.typeOf = typeOf;
134850
- return reactIs_production;
134875
+ reactIs_production_min.typeOf = z;
134876
+ return reactIs_production_min;
134851
134877
  }
134852
134878
  var reactIs_development = {};
134853
134879
  var hasRequiredReactIs_development;
@@ -134856,59 +134882,69 @@ function requireReactIs_development() {
134856
134882
  hasRequiredReactIs_development = 1;
134857
134883
  if (process.env.NODE_ENV !== 'production') {
134858
134884
  (function () {
134859
- var enableScopeAPI = false;
134860
- var enableTransitionTracing = false;
134861
- var enableLegacyHidden = false;
134862
- var enableRenderableContext = true;
134863
- var enableDebugTracing = false;
134864
- var REACT_ELEMENT_TYPE = Symbol.for('react.transitional.element');
134865
- var REACT_PORTAL_TYPE = Symbol.for('react.portal');
134866
- var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
134867
- var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');
134868
- var REACT_PROFILER_TYPE = Symbol.for('react.profiler');
134869
- var REACT_PROVIDER_TYPE = Symbol.for('react.provider');
134870
- var REACT_CONSUMER_TYPE = Symbol.for('react.consumer');
134871
- var REACT_CONTEXT_TYPE = Symbol.for('react.context');
134872
- var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');
134873
- var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');
134874
- var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');
134875
- var REACT_MEMO_TYPE = Symbol.for('react.memo');
134876
- var REACT_LAZY_TYPE = Symbol.for('react.lazy');
134877
- var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');
134878
- var REACT_CLIENT_REFERENCE = Symbol.for('react.client.reference');
134885
+ var hasSymbol = typeof Symbol === 'function' && Symbol.for;
134886
+ var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 60103;
134887
+ var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 60106;
134888
+ var REACT_FRAGMENT_TYPE = hasSymbol
134889
+ ? Symbol.for('react.fragment')
134890
+ : 60107;
134891
+ var REACT_STRICT_MODE_TYPE = hasSymbol
134892
+ ? Symbol.for('react.strict_mode')
134893
+ : 60108;
134894
+ var REACT_PROFILER_TYPE = hasSymbol
134895
+ ? Symbol.for('react.profiler')
134896
+ : 60114;
134897
+ var REACT_PROVIDER_TYPE = hasSymbol
134898
+ ? Symbol.for('react.provider')
134899
+ : 60109;
134900
+ var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 60110;
134901
+ var REACT_ASYNC_MODE_TYPE = hasSymbol
134902
+ ? Symbol.for('react.async_mode')
134903
+ : 60111;
134904
+ var REACT_CONCURRENT_MODE_TYPE = hasSymbol
134905
+ ? Symbol.for('react.concurrent_mode')
134906
+ : 60111;
134907
+ var REACT_FORWARD_REF_TYPE = hasSymbol
134908
+ ? Symbol.for('react.forward_ref')
134909
+ : 60112;
134910
+ var REACT_SUSPENSE_TYPE = hasSymbol
134911
+ ? Symbol.for('react.suspense')
134912
+ : 60113;
134913
+ var REACT_SUSPENSE_LIST_TYPE = hasSymbol
134914
+ ? Symbol.for('react.suspense_list')
134915
+ : 60120;
134916
+ var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 60115;
134917
+ var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 60116;
134918
+ var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 60121;
134919
+ var REACT_FUNDAMENTAL_TYPE = hasSymbol
134920
+ ? Symbol.for('react.fundamental')
134921
+ : 60117;
134922
+ var REACT_RESPONDER_TYPE = hasSymbol
134923
+ ? Symbol.for('react.responder')
134924
+ : 60118;
134925
+ var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 60119;
134879
134926
  function isValidElementType(type) {
134880
- if (typeof type === 'string' || typeof type === 'function') {
134881
- return true;
134882
- }
134883
- if (
134927
+ return (
134928
+ typeof type === 'string' ||
134929
+ typeof type === 'function' ||
134884
134930
  type === REACT_FRAGMENT_TYPE ||
134931
+ type === REACT_CONCURRENT_MODE_TYPE ||
134885
134932
  type === REACT_PROFILER_TYPE ||
134886
- enableDebugTracing ||
134887
134933
  type === REACT_STRICT_MODE_TYPE ||
134888
134934
  type === REACT_SUSPENSE_TYPE ||
134889
134935
  type === REACT_SUSPENSE_LIST_TYPE ||
134890
- enableLegacyHidden ||
134891
- type === REACT_OFFSCREEN_TYPE ||
134892
- enableScopeAPI ||
134893
- enableTransitionTracing
134894
- ) {
134895
- return true;
134896
- }
134897
- if (typeof type === 'object' && type !== null) {
134898
- if (
134899
- type.$$typeof === REACT_LAZY_TYPE ||
134900
- type.$$typeof === REACT_MEMO_TYPE ||
134901
- type.$$typeof === REACT_CONTEXT_TYPE ||
134902
- !enableRenderableContext ||
134903
- type.$$typeof === REACT_CONSUMER_TYPE ||
134904
- type.$$typeof === REACT_FORWARD_REF_TYPE ||
134905
- type.$$typeof === REACT_CLIENT_REFERENCE ||
134906
- type.getModuleId !== undefined
134907
- ) {
134908
- return true;
134909
- }
134910
- }
134911
- return false;
134936
+ (typeof type === 'object' &&
134937
+ type !== null &&
134938
+ (type.$$typeof === REACT_LAZY_TYPE ||
134939
+ type.$$typeof === REACT_MEMO_TYPE ||
134940
+ type.$$typeof === REACT_PROVIDER_TYPE ||
134941
+ type.$$typeof === REACT_CONTEXT_TYPE ||
134942
+ type.$$typeof === REACT_FORWARD_REF_TYPE ||
134943
+ type.$$typeof === REACT_FUNDAMENTAL_TYPE ||
134944
+ type.$$typeof === REACT_RESPONDER_TYPE ||
134945
+ type.$$typeof === REACT_SCOPE_TYPE ||
134946
+ type.$$typeof === REACT_BLOCK_TYPE))
134947
+ );
134912
134948
  }
134913
134949
  function typeOf(object) {
134914
134950
  if (typeof object === 'object' && object !== null) {
@@ -134917,11 +134953,12 @@ function requireReactIs_development() {
134917
134953
  case REACT_ELEMENT_TYPE:
134918
134954
  var type = object.type;
134919
134955
  switch (type) {
134956
+ case REACT_ASYNC_MODE_TYPE:
134957
+ case REACT_CONCURRENT_MODE_TYPE:
134920
134958
  case REACT_FRAGMENT_TYPE:
134921
134959
  case REACT_PROFILER_TYPE:
134922
134960
  case REACT_STRICT_MODE_TYPE:
134923
134961
  case REACT_SUSPENSE_TYPE:
134924
- case REACT_SUSPENSE_LIST_TYPE:
134925
134962
  return type;
134926
134963
  default:
134927
134964
  var $$typeofType = type && type.$$typeof;
@@ -134930,11 +134967,8 @@ function requireReactIs_development() {
134930
134967
  case REACT_FORWARD_REF_TYPE:
134931
134968
  case REACT_LAZY_TYPE:
134932
134969
  case REACT_MEMO_TYPE:
134933
- return $$typeofType;
134934
- case REACT_CONSUMER_TYPE: {
134935
- return $$typeofType;
134936
- }
134937
134970
  case REACT_PROVIDER_TYPE:
134971
+ return $$typeofType;
134938
134972
  default:
134939
134973
  return $$typeof;
134940
134974
  }
@@ -134945,8 +134979,10 @@ function requireReactIs_development() {
134945
134979
  }
134946
134980
  return undefined;
134947
134981
  }
134948
- var ContextConsumer = REACT_CONSUMER_TYPE;
134949
- var ContextProvider = REACT_CONTEXT_TYPE;
134982
+ var AsyncMode = REACT_ASYNC_MODE_TYPE;
134983
+ var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
134984
+ var ContextConsumer = REACT_CONTEXT_TYPE;
134985
+ var ContextProvider = REACT_PROVIDER_TYPE;
134950
134986
  var Element = REACT_ELEMENT_TYPE;
134951
134987
  var ForwardRef = REACT_FORWARD_REF_TYPE;
134952
134988
  var Fragment = REACT_FRAGMENT_TYPE;
@@ -134956,16 +134992,30 @@ function requireReactIs_development() {
134956
134992
  var Profiler = REACT_PROFILER_TYPE;
134957
134993
  var StrictMode = REACT_STRICT_MODE_TYPE;
134958
134994
  var Suspense = REACT_SUSPENSE_TYPE;
134959
- var SuspenseList = REACT_SUSPENSE_LIST_TYPE;
134960
- function isContextConsumer(object) {
134995
+ var hasWarnedAboutDeprecatedIsAsyncMode = false;
134996
+ function isAsyncMode(object) {
134961
134997
  {
134962
- return typeOf(object) === REACT_CONSUMER_TYPE;
134998
+ if (!hasWarnedAboutDeprecatedIsAsyncMode) {
134999
+ hasWarnedAboutDeprecatedIsAsyncMode = true;
135000
+ console['warn'](
135001
+ 'The ReactIs.isAsyncMode() alias has been deprecated, ' +
135002
+ 'and will be removed in React 17+. Update your code to use ' +
135003
+ 'ReactIs.isConcurrentMode() instead. It has the exact same API.'
135004
+ );
135005
+ }
134963
135006
  }
135007
+ return (
135008
+ isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE
135009
+ );
135010
+ }
135011
+ function isConcurrentMode(object) {
135012
+ return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
135013
+ }
135014
+ function isContextConsumer(object) {
135015
+ return typeOf(object) === REACT_CONTEXT_TYPE;
134964
135016
  }
134965
135017
  function isContextProvider(object) {
134966
- {
134967
- return typeOf(object) === REACT_CONTEXT_TYPE;
134968
- }
135018
+ return typeOf(object) === REACT_PROVIDER_TYPE;
134969
135019
  }
134970
135020
  function isElement(object) {
134971
135021
  return (
@@ -134998,9 +135048,8 @@ function requireReactIs_development() {
134998
135048
  function isSuspense(object) {
134999
135049
  return typeOf(object) === REACT_SUSPENSE_TYPE;
135000
135050
  }
135001
- function isSuspenseList(object) {
135002
- return typeOf(object) === REACT_SUSPENSE_LIST_TYPE;
135003
- }
135051
+ reactIs_development.AsyncMode = AsyncMode;
135052
+ reactIs_development.ConcurrentMode = ConcurrentMode;
135004
135053
  reactIs_development.ContextConsumer = ContextConsumer;
135005
135054
  reactIs_development.ContextProvider = ContextProvider;
135006
135055
  reactIs_development.Element = Element;
@@ -135012,7 +135061,8 @@ function requireReactIs_development() {
135012
135061
  reactIs_development.Profiler = Profiler;
135013
135062
  reactIs_development.StrictMode = StrictMode;
135014
135063
  reactIs_development.Suspense = Suspense;
135015
- reactIs_development.SuspenseList = SuspenseList;
135064
+ reactIs_development.isAsyncMode = isAsyncMode;
135065
+ reactIs_development.isConcurrentMode = isConcurrentMode;
135016
135066
  reactIs_development.isContextConsumer = isContextConsumer;
135017
135067
  reactIs_development.isContextProvider = isContextProvider;
135018
135068
  reactIs_development.isElement = isElement;
@@ -135024,7 +135074,6 @@ function requireReactIs_development() {
135024
135074
  reactIs_development.isProfiler = isProfiler;
135025
135075
  reactIs_development.isStrictMode = isStrictMode;
135026
135076
  reactIs_development.isSuspense = isSuspense;
135027
- reactIs_development.isSuspenseList = isSuspenseList;
135028
135077
  reactIs_development.isValidElementType = isValidElementType;
135029
135078
  reactIs_development.typeOf = typeOf;
135030
135079
  })();
@@ -135032,7 +135081,7 @@ function requireReactIs_development() {
135032
135081
  return reactIs_development;
135033
135082
  }
135034
135083
  if (process.env.NODE_ENV === 'production') {
135035
- reactIs.exports = requireReactIs_production();
135084
+ reactIs.exports = requireReactIs_production_min();
135036
135085
  } else {
135037
135086
  reactIs.exports = requireReactIs_development();
135038
135087
  }
@@ -136664,6 +136713,18 @@ const EnvironmentConfigSchema = z.object({
136664
136713
  enablePreserveExistingManualUseMemo: z.boolean().default(false),
136665
136714
  enableForest: z.boolean().default(false),
136666
136715
  enableUseTypeAnnotations: z.boolean().default(false),
136716
+ enableFunctionDependencyRewrite: z.boolean().default(true),
136717
+ enableOptionalDependencies: z.boolean().default(true),
136718
+ inferEffectDependencies: z
136719
+ .nullable(
136720
+ z.array(
136721
+ z.object({
136722
+ function: ExternalFunctionSchema,
136723
+ numRequiredArgs: z.number(),
136724
+ })
136725
+ )
136726
+ )
136727
+ .default(null),
136667
136728
  inlineJsxTransform: ReactElementSymbolSchema.nullable().default(null),
136668
136729
  validateHooksUsage: z.boolean().default(true),
136669
136730
  validateRefAccessDuringRender: z.boolean().default(true),
@@ -136727,6 +136788,19 @@ const testComplexConfigDefaults = {
136727
136788
  source: 'react-compiler-runtime',
136728
136789
  importSpecifierName: 'useContext_withSelector',
136729
136790
  },
136791
+ inferEffectDependencies: [
136792
+ {
136793
+ function: {source: 'react', importSpecifierName: 'useEffect'},
136794
+ numRequiredArgs: 1,
136795
+ },
136796
+ {
136797
+ function: {
136798
+ source: 'shared-runtime',
136799
+ importSpecifierName: 'useSpecialEffect',
136800
+ },
136801
+ numRequiredArgs: 2,
136802
+ },
136803
+ ],
136730
136804
  };
136731
136805
  function parseConfigPragmaForTests(pragma) {
136732
136806
  const maybeConfig = {};
@@ -140883,6 +140957,9 @@ function deadCodeElimination(fn) {
140883
140957
  }
140884
140958
  }
140885
140959
  }
140960
+ retainWhere(fn.context, contextVar =>
140961
+ state.isIdOrNameUsed(contextVar.identifier)
140962
+ );
140886
140963
  }
140887
140964
  let State$2 = class State {
140888
140965
  constructor() {
@@ -140962,25 +141039,25 @@ function rewriteInstruction(instr, state) {
140962
141039
  if (instr.value.kind === 'Destructure') {
140963
141040
  switch (instr.value.lvalue.pattern.kind) {
140964
141041
  case 'ArrayPattern': {
140965
- let nextItems = null;
140966
- const originalItems = instr.value.lvalue.pattern.items;
140967
- for (let i = originalItems.length - 1; i >= 0; i--) {
140968
- const item = originalItems[i];
141042
+ let lastEntryIndex = 0;
141043
+ const items = instr.value.lvalue.pattern.items;
141044
+ for (let i = 0; i < items.length; i++) {
141045
+ const item = items[i];
140969
141046
  if (item.kind === 'Identifier') {
140970
- if (state.isIdOrNameUsed(item.identifier)) {
140971
- nextItems = originalItems.slice(0, i + 1);
140972
- break;
141047
+ if (!state.isIdOrNameUsed(item.identifier)) {
141048
+ items[i] = {kind: 'Hole'};
141049
+ } else {
141050
+ lastEntryIndex = i;
140973
141051
  }
140974
141052
  } else if (item.kind === 'Spread') {
140975
- if (state.isIdOrNameUsed(item.place.identifier)) {
140976
- nextItems = originalItems.slice(0, i + 1);
140977
- break;
141053
+ if (!state.isIdOrNameUsed(item.place.identifier)) {
141054
+ items[i] = {kind: 'Hole'};
141055
+ } else {
141056
+ lastEntryIndex = i;
140978
141057
  }
140979
141058
  }
140980
141059
  }
140981
- if (nextItems !== null) {
140982
- instr.value.lvalue.pattern.items = nextItems;
140983
- }
141060
+ items.length = lastEntryIndex + 1;
140984
141061
  break;
140985
141062
  }
140986
141063
  case 'ObjectPattern': {
@@ -141644,28 +141721,41 @@ function createPropsProperties(
141644
141721
  propAttributes.forEach(prop => {
141645
141722
  switch (prop.kind) {
141646
141723
  case 'JsxAttribute': {
141647
- if (prop.name === 'ref') {
141648
- refProperty = {
141649
- kind: 'ObjectProperty',
141650
- key: {name: 'ref', kind: 'string'},
141651
- type: 'property',
141652
- place: Object.assign({}, prop.place),
141653
- };
141654
- } else if (prop.name === 'key') {
141655
- keyProperty = {
141656
- kind: 'ObjectProperty',
141657
- key: {name: 'key', kind: 'string'},
141658
- type: 'property',
141659
- place: Object.assign({}, prop.place),
141660
- };
141661
- } else {
141662
- const attributeProperty = {
141663
- kind: 'ObjectProperty',
141664
- key: {name: prop.name, kind: 'string'},
141665
- type: 'property',
141666
- place: Object.assign({}, prop.place),
141667
- };
141668
- props.push(attributeProperty);
141724
+ switch (prop.name) {
141725
+ case 'key': {
141726
+ keyProperty = {
141727
+ kind: 'ObjectProperty',
141728
+ key: {name: 'key', kind: 'string'},
141729
+ type: 'property',
141730
+ place: Object.assign({}, prop.place),
141731
+ };
141732
+ break;
141733
+ }
141734
+ case 'ref': {
141735
+ refProperty = {
141736
+ kind: 'ObjectProperty',
141737
+ key: {name: 'ref', kind: 'string'},
141738
+ type: 'property',
141739
+ place: Object.assign({}, prop.place),
141740
+ };
141741
+ const refPropProperty = {
141742
+ kind: 'ObjectProperty',
141743
+ key: {name: 'ref', kind: 'string'},
141744
+ type: 'property',
141745
+ place: Object.assign({}, prop.place),
141746
+ };
141747
+ props.push(refPropProperty);
141748
+ break;
141749
+ }
141750
+ default: {
141751
+ const attributeProperty = {
141752
+ kind: 'ObjectProperty',
141753
+ key: {name: prop.name, kind: 'string'},
141754
+ type: 'property',
141755
+ place: Object.assign({}, prop.place),
141756
+ };
141757
+ props.push(attributeProperty);
141758
+ }
141669
141759
  }
141670
141760
  break;
141671
141761
  }
@@ -149872,12 +149962,18 @@ let Visitor$7 = class Visitor extends ReactiveFunctionVisitor {
149872
149962
  visitPrunedScope(scopeBlock, state) {
149873
149963
  this.traversePrunedScope(scopeBlock, state);
149874
149964
  for (const [id, decl] of scopeBlock.scope.declarations) {
149875
- if (!isPrimitiveType(decl.identifier)) {
149965
+ if (
149966
+ !isPrimitiveType(decl.identifier) &&
149967
+ !isStableRefType(decl.identifier, state)
149968
+ ) {
149876
149969
  state.add(id);
149877
149970
  }
149878
149971
  }
149879
149972
  }
149880
149973
  };
149974
+ function isStableRefType(identifier, reactiveIdentifiers) {
149975
+ return isUseRefType(identifier) && !reactiveIdentifiers.has(identifier.id);
149976
+ }
149881
149977
  function collectReactiveIdentifiers(fn) {
149882
149978
  const visitor = new Visitor$7();
149883
149979
  const state = new Set();
@@ -151411,6 +151507,199 @@ function declareTemporary(env, block, result) {
151411
151507
  },
151412
151508
  });
151413
151509
  }
151510
+ function inferEffectDependencies(fn) {
151511
+ let hasRewrite = false;
151512
+ const fnExpressions = new Map();
151513
+ const autodepFnConfigs = new Map();
151514
+ for (const effectTarget of fn.env.config.inferEffectDependencies) {
151515
+ const moduleTargets = getOrInsertWith(
151516
+ autodepFnConfigs,
151517
+ effectTarget.function.source,
151518
+ () => new Map()
151519
+ );
151520
+ moduleTargets.set(
151521
+ effectTarget.function.importSpecifierName,
151522
+ effectTarget.numRequiredArgs
151523
+ );
151524
+ }
151525
+ const autodepFnLoads = new Map();
151526
+ const scopeInfos = new Map();
151527
+ const reactiveIds = inferReactiveIdentifiers(fn);
151528
+ for (const [, block] of fn.body.blocks) {
151529
+ if (
151530
+ block.terminal.kind === 'scope' ||
151531
+ block.terminal.kind === 'pruned-scope'
151532
+ ) {
151533
+ const scopeBlock = fn.body.blocks.get(block.terminal.block);
151534
+ scopeInfos.set(block.terminal.scope.id, {
151535
+ pruned: block.terminal.kind === 'pruned-scope',
151536
+ deps: block.terminal.scope.dependencies,
151537
+ hasSingleInstr:
151538
+ scopeBlock.instructions.length === 1 &&
151539
+ scopeBlock.terminal.kind === 'goto' &&
151540
+ scopeBlock.terminal.block === block.terminal.fallthrough,
151541
+ });
151542
+ }
151543
+ const rewriteInstrs = new Map();
151544
+ for (const instr of block.instructions) {
151545
+ const {value: value, lvalue: lvalue} = instr;
151546
+ if (value.kind === 'FunctionExpression') {
151547
+ fnExpressions.set(lvalue.identifier.id, instr);
151548
+ } else if (
151549
+ value.kind === 'LoadGlobal' &&
151550
+ value.binding.kind === 'ImportSpecifier'
151551
+ ) {
151552
+ const moduleTargets = autodepFnConfigs.get(value.binding.module);
151553
+ if (moduleTargets != null) {
151554
+ const numRequiredArgs = moduleTargets.get(value.binding.imported);
151555
+ if (numRequiredArgs != null) {
151556
+ autodepFnLoads.set(lvalue.identifier.id, numRequiredArgs);
151557
+ }
151558
+ }
151559
+ } else if (
151560
+ value.kind === 'CallExpression' &&
151561
+ autodepFnLoads.get(value.callee.identifier.id) === value.args.length &&
151562
+ value.args[0].kind === 'Identifier'
151563
+ ) {
151564
+ const fnExpr = fnExpressions.get(value.args[0].identifier.id);
151565
+ if (fnExpr != null) {
151566
+ const scopeInfo =
151567
+ fnExpr.lvalue.identifier.scope != null
151568
+ ? scopeInfos.get(fnExpr.lvalue.identifier.scope.id)
151569
+ : null;
151570
+ CompilerError.invariant(scopeInfo != null, {
151571
+ reason: 'Expected function expression scope to exist',
151572
+ loc: value.loc,
151573
+ });
151574
+ if (scopeInfo.pruned || !scopeInfo.hasSingleInstr) {
151575
+ CompilerError.throwTodo({
151576
+ reason:
151577
+ '[InferEffectDependencies] Expected effect function to have non-pruned scope and its scope to have exactly one instruction',
151578
+ loc: fnExpr.loc,
151579
+ });
151580
+ }
151581
+ const effectDeps = [];
151582
+ const newInstructions = [];
151583
+ for (const dep of scopeInfo.deps) {
151584
+ const {place: place, instructions: instructions} =
151585
+ writeDependencyToInstructions(
151586
+ dep,
151587
+ reactiveIds.has(dep.identifier.id),
151588
+ fn.env,
151589
+ fnExpr.loc
151590
+ );
151591
+ newInstructions.push(...instructions);
151592
+ effectDeps.push(place);
151593
+ }
151594
+ const deps = {
151595
+ kind: 'ArrayExpression',
151596
+ elements: effectDeps,
151597
+ loc: GeneratedSource,
151598
+ };
151599
+ const depsPlace = createTemporaryPlace(fn.env, GeneratedSource);
151600
+ depsPlace.effect = exports.Effect.Read;
151601
+ newInstructions.push({
151602
+ id: makeInstructionId(0),
151603
+ loc: GeneratedSource,
151604
+ lvalue: Object.assign(Object.assign({}, depsPlace), {
151605
+ effect: exports.Effect.Mutate,
151606
+ }),
151607
+ value: deps,
151608
+ });
151609
+ value.args.push(
151610
+ Object.assign(Object.assign({}, depsPlace), {
151611
+ effect: exports.Effect.Freeze,
151612
+ })
151613
+ );
151614
+ rewriteInstrs.set(instr.id, newInstructions);
151615
+ }
151616
+ }
151617
+ }
151618
+ if (rewriteInstrs.size > 0) {
151619
+ hasRewrite = true;
151620
+ const newInstrs = [];
151621
+ for (const instr of block.instructions) {
151622
+ const newInstr = rewriteInstrs.get(instr.id);
151623
+ if (newInstr != null) {
151624
+ newInstrs.push(...newInstr, instr);
151625
+ } else {
151626
+ newInstrs.push(instr);
151627
+ }
151628
+ }
151629
+ block.instructions = newInstrs;
151630
+ }
151631
+ }
151632
+ if (hasRewrite) {
151633
+ markInstructionIds(fn.body);
151634
+ fixScopeAndIdentifierRanges(fn.body);
151635
+ }
151636
+ }
151637
+ function writeDependencyToInstructions(dep, reactive, env, loc) {
151638
+ const instructions = [];
151639
+ let currValue = createTemporaryPlace(env, GeneratedSource);
151640
+ currValue.reactive = reactive;
151641
+ instructions.push({
151642
+ id: makeInstructionId(0),
151643
+ loc: GeneratedSource,
151644
+ lvalue: Object.assign(Object.assign({}, currValue), {
151645
+ effect: exports.Effect.Mutate,
151646
+ }),
151647
+ value: {
151648
+ kind: 'LoadLocal',
151649
+ place: {
151650
+ kind: 'Identifier',
151651
+ identifier: dep.identifier,
151652
+ effect: exports.Effect.Capture,
151653
+ reactive: reactive,
151654
+ loc: loc,
151655
+ },
151656
+ loc: loc,
151657
+ },
151658
+ });
151659
+ for (const path of dep.path) {
151660
+ if (path.optional) {
151661
+ break;
151662
+ }
151663
+ const nextValue = createTemporaryPlace(env, GeneratedSource);
151664
+ nextValue.reactive = reactive;
151665
+ instructions.push({
151666
+ id: makeInstructionId(0),
151667
+ loc: GeneratedSource,
151668
+ lvalue: Object.assign(Object.assign({}, nextValue), {
151669
+ effect: exports.Effect.Mutate,
151670
+ }),
151671
+ value: {
151672
+ kind: 'PropertyLoad',
151673
+ object: Object.assign(Object.assign({}, currValue), {
151674
+ effect: exports.Effect.Capture,
151675
+ }),
151676
+ property: path.property,
151677
+ loc: loc,
151678
+ },
151679
+ });
151680
+ currValue = nextValue;
151681
+ }
151682
+ currValue.effect = exports.Effect.Freeze;
151683
+ return {place: currValue, instructions: instructions};
151684
+ }
151685
+ function inferReactiveIdentifiers(fn) {
151686
+ const reactiveIds = new Set();
151687
+ for (const [, block] of fn.body.blocks) {
151688
+ for (const instr of block.instructions) {
151689
+ for (const place of eachInstructionOperand(instr)) {
151690
+ if (place.reactive) {
151691
+ reactiveIds.add(place.identifier.id);
151692
+ }
151693
+ }
151694
+ }
151695
+ for (const place of eachTerminalOperand(block.terminal)) {
151696
+ if (place.reactive) {
151697
+ reactiveIds.add(place.identifier.id);
151698
+ }
151699
+ }
151700
+ }
151701
+ return reactiveIds;
151702
+ }
151414
151703
  function instructionReordering(fn) {
151415
151704
  var _a;
151416
151705
  const shared = new Map();
@@ -156337,6 +156626,7 @@ class Context {
156337
156626
  this.visitDependency(nextDependency);
156338
156627
  }
156339
156628
  visitDependency(maybeDependency) {
156629
+ var _a;
156340
156630
  const originalDeclaration = __classPrivateFieldGet(
156341
156631
  this,
156342
156632
  _Context_declarations,
@@ -156368,6 +156658,14 @@ class Context {
156368
156658
  }
156369
156659
  });
156370
156660
  }
156661
+ if (
156662
+ isUseRefType(maybeDependency.identifier) &&
156663
+ ((_a = maybeDependency.path.at(0)) === null || _a === void 0
156664
+ ? void 0
156665
+ : _a.property) === 'current'
156666
+ ) {
156667
+ maybeDependency = {identifier: maybeDependency.identifier, path: []};
156668
+ }
156371
156669
  if (
156372
156670
  __classPrivateFieldGet(
156373
156671
  this,
@@ -156411,15 +156709,7 @@ class Context {
156411
156709
  (_Context_checkValidDependency = function _Context_checkValidDependency(
156412
156710
  maybeDependency
156413
156711
  ) {
156414
- var _a, _b;
156415
- if (
156416
- isUseRefType(maybeDependency.identifier) &&
156417
- ((_a = maybeDependency.path.at(0)) === null || _a === void 0
156418
- ? void 0
156419
- : _a.property) === 'current'
156420
- ) {
156421
- return false;
156422
- }
156712
+ var _a;
156423
156713
  if (isRefValueType(maybeDependency.identifier)) {
156424
156714
  return false;
156425
156715
  }
@@ -156428,10 +156718,10 @@ class Context {
156428
156718
  }
156429
156719
  const identifier = maybeDependency.identifier;
156430
156720
  const currentDeclaration =
156431
- (_b = __classPrivateFieldGet(this, _Context_reassignments, 'f').get(
156721
+ (_a = __classPrivateFieldGet(this, _Context_reassignments, 'f').get(
156432
156722
  identifier
156433
- )) !== null && _b !== void 0
156434
- ? _b
156723
+ )) !== null && _a !== void 0
156724
+ ? _a
156435
156725
  : __classPrivateFieldGet(this, _Context_declarations, 'f').get(
156436
156726
  identifier.declarationId
156437
156727
  );
@@ -156514,46 +156804,57 @@ function collectDependencies(
156514
156804
  }
156515
156805
  }
156516
156806
  const scopeTraversal = new ScopeBlockTraversal();
156517
- for (const [blockId, block] of fn.body.blocks) {
156518
- scopeTraversal.recordScopes(block);
156519
- const scopeBlockInfo = scopeTraversal.blockInfos.get(blockId);
156520
- if (
156521
- (scopeBlockInfo === null || scopeBlockInfo === void 0
156522
- ? void 0
156523
- : scopeBlockInfo.kind) === 'begin'
156524
- ) {
156525
- context.enterScope(scopeBlockInfo.scope);
156526
- } else if (
156527
- (scopeBlockInfo === null || scopeBlockInfo === void 0
156528
- ? void 0
156529
- : scopeBlockInfo.kind) === 'end'
156530
- ) {
156531
- context.exitScope(
156532
- scopeBlockInfo.scope,
156533
- scopeBlockInfo === null || scopeBlockInfo === void 0
156807
+ const handleFunction = fn => {
156808
+ for (const [blockId, block] of fn.body.blocks) {
156809
+ scopeTraversal.recordScopes(block);
156810
+ const scopeBlockInfo = scopeTraversal.blockInfos.get(blockId);
156811
+ if (
156812
+ (scopeBlockInfo === null || scopeBlockInfo === void 0
156534
156813
  ? void 0
156535
- : scopeBlockInfo.pruned
156536
- );
156537
- }
156538
- for (const phi of block.phis) {
156539
- for (const operand of phi.operands) {
156540
- const maybeOptionalChain = temporaries.get(operand[1].identifier.id);
156541
- if (maybeOptionalChain) {
156542
- context.visitDependency(maybeOptionalChain);
156814
+ : scopeBlockInfo.kind) === 'begin'
156815
+ ) {
156816
+ context.enterScope(scopeBlockInfo.scope);
156817
+ } else if (
156818
+ (scopeBlockInfo === null || scopeBlockInfo === void 0
156819
+ ? void 0
156820
+ : scopeBlockInfo.kind) === 'end'
156821
+ ) {
156822
+ context.exitScope(scopeBlockInfo.scope, scopeBlockInfo.pruned);
156823
+ }
156824
+ for (const phi of block.phis) {
156825
+ for (const operand of phi.operands) {
156826
+ const maybeOptionalChain = temporaries.get(operand[1].identifier.id);
156827
+ if (maybeOptionalChain) {
156828
+ context.visitDependency(maybeOptionalChain);
156829
+ }
156543
156830
  }
156544
156831
  }
156545
- }
156546
- for (const instr of block.instructions) {
156547
- if (!processedInstrsInOptional.has(instr)) {
156548
- handleInstruction(instr, context);
156832
+ for (const instr of block.instructions) {
156833
+ if (
156834
+ fn.env.config.enableFunctionDependencyRewrite &&
156835
+ (instr.value.kind === 'FunctionExpression' ||
156836
+ instr.value.kind === 'ObjectMethod')
156837
+ ) {
156838
+ context.declare(instr.lvalue.identifier, {
156839
+ id: instr.id,
156840
+ scope: context.currentScope,
156841
+ });
156842
+ const wasInInnerFn = context.inInnerFn;
156843
+ context.inInnerFn = true;
156844
+ handleFunction(instr.value.loweredFunc.func);
156845
+ context.inInnerFn = wasInInnerFn;
156846
+ } else if (!processedInstrsInOptional.has(instr)) {
156847
+ handleInstruction(instr, context);
156848
+ }
156549
156849
  }
156550
- }
156551
- if (!processedInstrsInOptional.has(block.terminal)) {
156552
- for (const place of eachTerminalOperand(block.terminal)) {
156553
- context.visitOperand(place);
156850
+ if (!processedInstrsInOptional.has(block.terminal)) {
156851
+ for (const place of eachTerminalOperand(block.terminal)) {
156852
+ context.visitOperand(place);
156853
+ }
156554
156854
  }
156555
156855
  }
156556
- }
156856
+ };
156857
+ handleFunction(fn);
156557
156858
  return context.deps;
156558
156859
  }
156559
156860
  function outlineJSX(fn) {
@@ -157072,6 +157373,9 @@ function* runWithEnvironment(func, env) {
157072
157373
  assertTerminalPredsExist(hir);
157073
157374
  propagateScopeDependenciesHIR(hir);
157074
157375
  yield log({kind: 'hir', name: 'PropagateScopeDependenciesHIR', value: hir});
157376
+ if (env.config.inferEffectDependencies) {
157377
+ inferEffectDependencies(hir);
157378
+ }
157075
157379
  if (env.config.inlineJsxTransform) {
157076
157380
  inlineJsxTransform(hir, env.config.inlineJsxTransform);
157077
157381
  yield log({kind: 'hir', name: 'inlineJsxTransform', value: hir});
@@ -158316,10 +158620,13 @@ function runBabelPluginReactCompiler(
158316
158620
  }
158317
158621
  exports.CompilerError = CompilerError;
158318
158622
  exports.CompilerErrorDetail = CompilerErrorDetail;
158623
+ exports.OPT_IN_DIRECTIVES = OPT_IN_DIRECTIVES;
158319
158624
  exports.OPT_OUT_DIRECTIVES = OPT_OUT_DIRECTIVES;
158320
158625
  exports.compile = compileFn;
158321
158626
  exports.compileProgram = compileProgram;
158322
158627
  exports.default = BabelPluginReactCompiler;
158628
+ exports.findDirectiveDisablingMemoization = findDirectiveDisablingMemoization;
158629
+ exports.findDirectiveEnablingMemoization = findDirectiveEnablingMemoization;
158323
158630
  exports.parseConfigPragmaForTests = parseConfigPragmaForTests;
158324
158631
  exports.parsePluginOptions = parsePluginOptions;
158325
158632
  exports.printHIR = printHIR;