react-server-dom-rspack 0.0.1-alpha.8 → 0.0.1-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +3 -1
  3. package/{vendor/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.development.js → cjs/react-server-dom-rspack-client.browser.development.js} +372 -203
  4. package/{vendor/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.production.js → cjs/react-server-dom-rspack-client.browser.production.js} +133 -83
  5. package/{vendor/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.development.js → cjs/react-server-dom-rspack-client.edge.development.js} +304 -160
  6. package/{vendor/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.production.js → cjs/react-server-dom-rspack-client.edge.production.js} +119 -79
  7. package/{vendor/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.development.js → cjs/react-server-dom-rspack-client.node.development.js} +326 -191
  8. package/{vendor/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.production.js → cjs/react-server-dom-rspack-client.node.production.js} +127 -95
  9. package/{vendor/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.development.js → cjs/react-server-dom-rspack-server.browser.development.js} +263 -297
  10. package/{vendor/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.production.js → cjs/react-server-dom-rspack-server.browser.production.js} +170 -224
  11. package/{vendor/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.development.js → cjs/react-server-dom-rspack-server.edge.development.js} +283 -309
  12. package/{vendor/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.production.js → cjs/react-server-dom-rspack-server.edge.production.js} +186 -231
  13. package/{vendor/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.development.js → cjs/react-server-dom-rspack-server.node.development.js} +543 -522
  14. package/{vendor/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.production.js → cjs/react-server-dom-rspack-server.node.production.js} +197 -243
  15. package/client.browser.js +7 -0
  16. package/client.edge.js +7 -0
  17. package/client.node.js +7 -0
  18. package/{vendor/react-server-dom-webpack/index.js → index.js} +1 -1
  19. package/package.json +66 -128
  20. package/plugin.js +3 -0
  21. package/server.browser.js +24 -0
  22. package/server.edge.js +25 -0
  23. package/{vendor/react-server-dom-webpack/server.node.js → server.node.js} +10 -3
  24. package/static.browser.js +10 -0
  25. package/static.edge.js +10 -0
  26. package/{vendor/react-server-dom-webpack/static.node.js → static.node.js} +2 -2
  27. package/dist/client.browser.d.ts +0 -23
  28. package/dist/client.browser.js +0 -41
  29. package/dist/client.d.ts +0 -1
  30. package/dist/client.edge.d.ts +0 -28
  31. package/dist/client.edge.js +0 -27
  32. package/dist/client.js +0 -1
  33. package/dist/client.node.d.ts +0 -11
  34. package/dist/client.node.js +0 -10
  35. package/dist/index.d.ts +0 -0
  36. package/dist/index.js +0 -2
  37. package/dist/server.browser.d.ts +0 -30
  38. package/dist/server.browser.js +0 -68
  39. package/dist/server.d.ts +0 -0
  40. package/dist/server.edge.d.ts +0 -32
  41. package/dist/server.edge.js +0 -71
  42. package/dist/server.js +0 -3
  43. package/dist/server.node.d.ts +0 -33
  44. package/dist/server.node.js +0 -75
  45. package/dist/types.d.ts +0 -45
  46. package/dist/types.js +0 -1
  47. package/vendor/react-server-dom-webpack/LICENSE +0 -21
  48. package/vendor/react-server-dom-webpack/README.md +0 -5
  49. package/vendor/react-server-dom-webpack/cjs/react-server-dom-webpack-node-register.js +0 -69
  50. package/vendor/react-server-dom-webpack/cjs/react-server-dom-webpack-plugin.js +0 -404
  51. package/vendor/react-server-dom-webpack/client.browser.js +0 -7
  52. package/vendor/react-server-dom-webpack/client.edge.js +0 -7
  53. package/vendor/react-server-dom-webpack/client.node.js +0 -7
  54. package/vendor/react-server-dom-webpack/esm/react-server-dom-webpack-node-loader.production.js +0 -515
  55. package/vendor/react-server-dom-webpack/node-register.js +0 -3
  56. package/vendor/react-server-dom-webpack/package.json +0 -96
  57. package/vendor/react-server-dom-webpack/plugin.js +0 -3
  58. package/vendor/react-server-dom-webpack/server.browser.js +0 -17
  59. package/vendor/react-server-dom-webpack/server.edge.js +0 -18
  60. package/vendor/react-server-dom-webpack/static.browser.js +0 -10
  61. package/vendor/react-server-dom-webpack/static.edge.js +0 -10
  62. /package/{vendor/react-server-dom-webpack/client.js → client.js} +0 -0
  63. /package/{vendor/react-server-dom-webpack/esm → esm}/package.json +0 -0
  64. /package/{vendor/react-server-dom-webpack/server.js → server.js} +0 -0
  65. /package/{vendor/react-server-dom-webpack/static.js → static.js} +0 -0
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license React
3
- * react-server-dom-webpack-server.node.development.js
3
+ * react-server-dom-rspack-server.node.development.js
4
4
  *
5
5
  * Copyright (c) Meta Platforms, Inc. and affiliates.
6
6
  *
@@ -12,6 +12,57 @@
12
12
  "production" !== process.env.NODE_ENV &&
13
13
  (function () {
14
14
  function voidHandler() {}
15
+ function isClientReference(reference) {
16
+ return reference.$$typeof === CLIENT_REFERENCE_TAG$1;
17
+ }
18
+ function bind() {
19
+ var newFn = FunctionBind.apply(this, arguments);
20
+ if (this.$$typeof === SERVER_REFERENCE_TAG) {
21
+ null != arguments[0] &&
22
+ console.error(
23
+ 'Cannot bind "this" of a Server Action. Pass null or undefined as the first argument to .bind().'
24
+ );
25
+ var args = ArraySlice.call(arguments, 1),
26
+ $$typeof = { value: SERVER_REFERENCE_TAG },
27
+ $$id = { value: this.$$id };
28
+ args = { value: this.$$bound ? this.$$bound.concat(args) : args };
29
+ return Object.defineProperties(newFn, {
30
+ $$typeof: $$typeof,
31
+ $$id: $$id,
32
+ $$bound: args,
33
+ $$location: { value: this.$$location, configurable: !0 },
34
+ bind: { value: bind, configurable: !0 }
35
+ });
36
+ }
37
+ return newFn;
38
+ }
39
+ function resolveClientReferenceMetadata(config, clientReference) {
40
+ var modulePath = clientReference.$$id,
41
+ name = "",
42
+ resolvedModuleData = config[modulePath];
43
+ if (resolvedModuleData) name = resolvedModuleData.name;
44
+ else {
45
+ var idx = modulePath.lastIndexOf("#");
46
+ -1 !== idx &&
47
+ ((name = modulePath.slice(idx + 1)),
48
+ (resolvedModuleData = config[modulePath.slice(0, idx)]));
49
+ if (!resolvedModuleData)
50
+ throw Error(
51
+ 'Could not find the module "' +
52
+ modulePath +
53
+ '" in the React Client Manifest. This is probably a bug in the React Server Components bundler.'
54
+ );
55
+ }
56
+ if (!0 === resolvedModuleData.async && !0 === clientReference.$$async)
57
+ throw Error(
58
+ 'The module "' +
59
+ modulePath +
60
+ '" is marked as an async ESM module but was loaded as a CJS proxy. This is probably a bug in the React Server Components bundler.'
61
+ );
62
+ return !0 === resolvedModuleData.async || !0 === clientReference.$$async
63
+ ? [resolvedModuleData.id, resolvedModuleData.chunks, name, 1]
64
+ : [resolvedModuleData.id, resolvedModuleData.chunks, name];
65
+ }
15
66
  function getIteratorFn(maybeIterable) {
16
67
  if (null === maybeIterable || "object" !== typeof maybeIterable)
17
68
  return null;
@@ -51,13 +102,13 @@
51
102
  function writeChunkAndReturn(destination, chunk) {
52
103
  if ("string" === typeof chunk) {
53
104
  if (0 !== chunk.length)
54
- if (2048 < 3 * chunk.length)
105
+ if (4096 < 3 * chunk.length)
55
106
  0 < writtenBytes &&
56
107
  (writeToDestination(
57
108
  destination,
58
109
  currentView.subarray(0, writtenBytes)
59
110
  ),
60
- (currentView = new Uint8Array(2048)),
111
+ (currentView = new Uint8Array(4096)),
61
112
  (writtenBytes = 0)),
62
113
  writeToDestination(destination, chunk);
63
114
  else {
@@ -71,25 +122,25 @@
71
122
  destination,
72
123
  currentView.subarray(0, writtenBytes)
73
124
  ),
74
- (currentView = new Uint8Array(2048)),
125
+ (currentView = new Uint8Array(4096)),
75
126
  (writtenBytes = textEncoder.encodeInto(
76
127
  chunk.slice(read),
77
128
  currentView
78
129
  ).written));
79
- 2048 === writtenBytes &&
130
+ 4096 === writtenBytes &&
80
131
  (writeToDestination(destination, currentView),
81
- (currentView = new Uint8Array(2048)),
132
+ (currentView = new Uint8Array(4096)),
82
133
  (writtenBytes = 0));
83
134
  }
84
135
  } else
85
136
  0 !== chunk.byteLength &&
86
- (2048 < chunk.byteLength
137
+ (4096 < chunk.byteLength
87
138
  ? (0 < writtenBytes &&
88
139
  (writeToDestination(
89
140
  destination,
90
141
  currentView.subarray(0, writtenBytes)
91
142
  ),
92
- (currentView = new Uint8Array(2048)),
143
+ (currentView = new Uint8Array(4096)),
93
144
  (writtenBytes = 0)),
94
145
  writeToDestination(destination, chunk))
95
146
  : ((target = currentView.length - writtenBytes),
@@ -100,13 +151,13 @@
100
151
  (writtenBytes += target),
101
152
  writeToDestination(destination, currentView),
102
153
  (chunk = chunk.subarray(target))),
103
- (currentView = new Uint8Array(2048)),
154
+ (currentView = new Uint8Array(4096)),
104
155
  (writtenBytes = 0)),
105
156
  currentView.set(chunk, writtenBytes),
106
157
  (writtenBytes += chunk.byteLength),
107
- 2048 === writtenBytes &&
158
+ 4096 === writtenBytes &&
108
159
  (writeToDestination(destination, currentView),
109
- (currentView = new Uint8Array(2048)),
160
+ (currentView = new Uint8Array(4096)),
110
161
  (writtenBytes = 0))));
111
162
  return destinationHasCapacity;
112
163
  }
@@ -123,141 +174,6 @@
123
174
  ? Buffer.byteLength(chunk, "utf8")
124
175
  : chunk.byteLength;
125
176
  }
126
- function isClientReference(reference) {
127
- return reference.$$typeof === CLIENT_REFERENCE_TAG$1;
128
- }
129
- function registerClientReferenceImpl(proxyImplementation, id, async) {
130
- return Object.defineProperties(proxyImplementation, {
131
- $$typeof: { value: CLIENT_REFERENCE_TAG$1 },
132
- $$id: { value: id },
133
- $$async: { value: async }
134
- });
135
- }
136
- function bind() {
137
- var newFn = FunctionBind.apply(this, arguments);
138
- if (this.$$typeof === SERVER_REFERENCE_TAG) {
139
- null != arguments[0] &&
140
- console.error(
141
- 'Cannot bind "this" of a Server Action. Pass null or undefined as the first argument to .bind().'
142
- );
143
- var args = ArraySlice.call(arguments, 1),
144
- $$typeof = { value: SERVER_REFERENCE_TAG },
145
- $$id = { value: this.$$id };
146
- args = { value: this.$$bound ? this.$$bound.concat(args) : args };
147
- return Object.defineProperties(newFn, {
148
- $$typeof: $$typeof,
149
- $$id: $$id,
150
- $$bound: args,
151
- $$location: { value: this.$$location, configurable: !0 },
152
- bind: { value: bind, configurable: !0 }
153
- });
154
- }
155
- return newFn;
156
- }
157
- function getReference(target, name) {
158
- switch (name) {
159
- case "$$typeof":
160
- return target.$$typeof;
161
- case "$$id":
162
- return target.$$id;
163
- case "$$async":
164
- return target.$$async;
165
- case "name":
166
- return target.name;
167
- case "defaultProps":
168
- return;
169
- case "_debugInfo":
170
- return;
171
- case "toJSON":
172
- return;
173
- case Symbol.toPrimitive:
174
- return Object.prototype[Symbol.toPrimitive];
175
- case Symbol.toStringTag:
176
- return Object.prototype[Symbol.toStringTag];
177
- case "__esModule":
178
- var moduleId = target.$$id;
179
- target.default = registerClientReferenceImpl(
180
- function () {
181
- throw Error(
182
- "Attempted to call the default export of " +
183
- moduleId +
184
- " from the server but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."
185
- );
186
- },
187
- target.$$id + "#",
188
- target.$$async
189
- );
190
- return !0;
191
- case "then":
192
- if (target.then) return target.then;
193
- if (target.$$async) return;
194
- var clientReference = registerClientReferenceImpl(
195
- {},
196
- target.$$id,
197
- !0
198
- ),
199
- proxy = new Proxy(clientReference, proxyHandlers$1);
200
- target.status = "fulfilled";
201
- target.value = proxy;
202
- return (target.then = registerClientReferenceImpl(
203
- function (resolve) {
204
- return Promise.resolve(resolve(proxy));
205
- },
206
- target.$$id + "#then",
207
- !1
208
- ));
209
- }
210
- if ("symbol" === typeof name)
211
- throw Error(
212
- "Cannot read Symbol exports. Only named exports are supported on a client module imported on the server."
213
- );
214
- clientReference = target[name];
215
- clientReference ||
216
- ((clientReference = registerClientReferenceImpl(
217
- function () {
218
- throw Error(
219
- "Attempted to call " +
220
- String(name) +
221
- "() from the server but " +
222
- String(name) +
223
- " is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."
224
- );
225
- },
226
- target.$$id + "#" + name,
227
- target.$$async
228
- )),
229
- Object.defineProperty(clientReference, "name", { value: name }),
230
- (clientReference = target[name] =
231
- new Proxy(clientReference, deepProxyHandlers)));
232
- return clientReference;
233
- }
234
- function resolveClientReferenceMetadata(config, clientReference) {
235
- var modulePath = clientReference.$$id,
236
- name = "",
237
- resolvedModuleData = config[modulePath];
238
- if (resolvedModuleData) name = resolvedModuleData.name;
239
- else {
240
- var idx = modulePath.lastIndexOf("#");
241
- -1 !== idx &&
242
- ((name = modulePath.slice(idx + 1)),
243
- (resolvedModuleData = config[modulePath.slice(0, idx)]));
244
- if (!resolvedModuleData)
245
- throw Error(
246
- 'Could not find the module "' +
247
- modulePath +
248
- '" in the React Client Manifest. This is probably a bug in the React Server Components bundler.'
249
- );
250
- }
251
- if (!0 === resolvedModuleData.async && !0 === clientReference.$$async)
252
- throw Error(
253
- 'The module "' +
254
- modulePath +
255
- '" is marked as an async ESM module but was loaded as a CJS proxy. This is probably a bug in the React Server Components bundler.'
256
- );
257
- return !0 === resolvedModuleData.async || !0 === clientReference.$$async
258
- ? [resolvedModuleData.id, resolvedModuleData.chunks, name, 1]
259
- : [resolvedModuleData.id, resolvedModuleData.chunks, name];
260
- }
261
177
  function preload(href, as, options) {
262
178
  if ("string" === typeof href) {
263
179
  var request = resolveRequest();
@@ -388,7 +304,7 @@
388
304
  });
389
305
  break;
390
306
  case "stylesheet":
391
- preload(srcSet, "stylesheet", {
307
+ preload(srcSet, "style", {
392
308
  crossOrigin: props.crossOrigin,
393
309
  integrity: props.integrity,
394
310
  nonce: props.nonce,
@@ -726,6 +642,8 @@
726
642
  return "Suspense";
727
643
  case REACT_SUSPENSE_LIST_TYPE:
728
644
  return "SuspenseList";
645
+ case REACT_VIEW_TRANSITION_TYPE:
646
+ return "ViewTransition";
729
647
  }
730
648
  if ("object" === typeof type)
731
649
  switch (type.$$typeof) {
@@ -904,7 +822,8 @@
904
822
  columnNumber = callsite[3];
905
823
  if (
906
824
  !callsite[6] &&
907
- request(url, functionName, lineNumber, columnNumber)
825
+ request(url, functionName, lineNumber, columnNumber) &&
826
+ "" !== url
908
827
  )
909
828
  return !0;
910
829
  }
@@ -921,8 +840,10 @@
921
840
  case "Function.resolve":
922
841
  case "Function.all":
923
842
  case "Function.allSettled":
843
+ case "Function.any":
924
844
  case "Function.race":
925
845
  case "Function.try":
846
+ case "Function.withResolvers":
926
847
  return !0;
927
848
  default:
928
849
  return !1;
@@ -941,7 +862,7 @@
941
862
  stack = stack[firstFrame];
942
863
  firstFrame = stack[0];
943
864
  var url = devirtualizeURL(stack[1]);
944
- return request(url, firstFrame, stack[2], stack[3]);
865
+ return request(url, firstFrame, stack[2], stack[3]) && "" !== url;
945
866
  }
946
867
  return !1;
947
868
  }
@@ -1080,7 +1001,6 @@
1080
1001
  model,
1081
1002
  bundlerConfig,
1082
1003
  onError,
1083
- onPostpone,
1084
1004
  onAllReady,
1085
1005
  onFatalError,
1086
1006
  identifierPrefix,
@@ -1125,8 +1045,6 @@
1125
1045
  this.identifierCount = 1;
1126
1046
  this.taintCleanupQueue = [];
1127
1047
  this.onError = void 0 === onError ? defaultErrorHandler : onError;
1128
- this.onPostpone =
1129
- void 0 === onPostpone ? defaultPostponeHandler : onPostpone;
1130
1048
  this.onAllReady = onAllReady;
1131
1049
  this.onFatalError = onFatalError;
1132
1050
  this.pendingDebugChunks = 0;
@@ -1173,7 +1091,6 @@
1173
1091
  bundlerConfig,
1174
1092
  onError,
1175
1093
  identifierPrefix,
1176
- onPostpone,
1177
1094
  temporaryReferences,
1178
1095
  environmentName,
1179
1096
  filterStackFrame,
@@ -1185,7 +1102,6 @@
1185
1102
  model,
1186
1103
  bundlerConfig,
1187
1104
  onError,
1188
- onPostpone,
1189
1105
  noop,
1190
1106
  noop,
1191
1107
  identifierPrefix,
@@ -1202,7 +1118,6 @@
1202
1118
  onFatalError,
1203
1119
  onError,
1204
1120
  identifierPrefix,
1205
- onPostpone,
1206
1121
  temporaryReferences,
1207
1122
  environmentName,
1208
1123
  filterStackFrame,
@@ -1214,7 +1129,6 @@
1214
1129
  model,
1215
1130
  bundlerConfig,
1216
1131
  onError,
1217
- onPostpone,
1218
1132
  onAllReady,
1219
1133
  onFatalError,
1220
1134
  identifierPrefix,
@@ -1262,7 +1176,23 @@
1262
1176
  ((cancelled = !0),
1263
1177
  request.status === ABORTING
1264
1178
  ? emitDebugHaltChunk(request, id)
1265
- : emitOutlinedDebugModelChunk(request, id, counter, value),
1179
+ : (isArrayImpl(value) && 200 < value.length) ||
1180
+ ((value instanceof ArrayBuffer ||
1181
+ value instanceof Int8Array ||
1182
+ value instanceof Uint8Array ||
1183
+ value instanceof Uint8ClampedArray ||
1184
+ value instanceof Int16Array ||
1185
+ value instanceof Uint16Array ||
1186
+ value instanceof Int32Array ||
1187
+ value instanceof Uint32Array ||
1188
+ value instanceof Float32Array ||
1189
+ value instanceof Float64Array ||
1190
+ value instanceof BigInt64Array ||
1191
+ value instanceof BigUint64Array ||
1192
+ value instanceof DataView) &&
1193
+ 1e3 < value.byteLength)
1194
+ ? emitDebugHaltChunk(request, id)
1195
+ : emitOutlinedDebugModelChunk(request, id, counter, value),
1266
1196
  enqueueFlush(request));
1267
1197
  },
1268
1198
  function (reason) {
@@ -1394,9 +1324,17 @@
1394
1324
  callOnAllReadyIfReady(request);
1395
1325
  else
1396
1326
  try {
1397
- (streamTask.model = entry.value),
1398
- request.pendingChunks++,
1399
- tryStreamTask(request, streamTask),
1327
+ request.pendingChunks++,
1328
+ (streamTask.model = entry.value),
1329
+ isByteStream
1330
+ ? emitTypedArrayChunk(
1331
+ request,
1332
+ streamTask.id,
1333
+ "b",
1334
+ streamTask.model,
1335
+ !1
1336
+ )
1337
+ : tryStreamTask(request, streamTask),
1400
1338
  enqueueFlush(request),
1401
1339
  reader.read().then(progress, error);
1402
1340
  } catch (x$0) {
@@ -1433,7 +1371,8 @@
1433
1371
  } catch (x) {
1434
1372
  supportsBYOB = !1;
1435
1373
  }
1436
- var reader = stream.getReader(),
1374
+ var isByteStream = supportsBYOB,
1375
+ reader = stream.getReader(),
1437
1376
  streamTask = createTask(
1438
1377
  request,
1439
1378
  task.model,
@@ -1448,7 +1387,7 @@
1448
1387
  );
1449
1388
  request.pendingChunks++;
1450
1389
  task =
1451
- streamTask.id.toString(16) + ":" + (supportsBYOB ? "r" : "R") + "\n";
1390
+ streamTask.id.toString(16) + ":" + (isByteStream ? "r" : "R") + "\n";
1452
1391
  request.completedRegularChunks.push(task);
1453
1392
  request.cacheController.signal.addEventListener("abort", abortStream);
1454
1393
  reader.read().then(progress, error);
@@ -1763,7 +1702,12 @@
1763
1702
  Component = task.keyPath;
1764
1703
  componentDebugInfo = task.implicitSlot;
1765
1704
  null !== key
1766
- ? (task.keyPath = null === Component ? key : Component + "," + key)
1705
+ ? (task.keyPath =
1706
+ key === REACT_OPTIMISTIC_KEY || Component === REACT_OPTIMISTIC_KEY
1707
+ ? REACT_OPTIMISTIC_KEY
1708
+ : null === Component
1709
+ ? key
1710
+ : Component + "," + key)
1767
1711
  : null === Component && (task.implicitSlot = !0);
1768
1712
  request = renderModelDestructive(request, task, emptyRoot, "", props);
1769
1713
  task.keyPath = Component;
@@ -1992,7 +1936,13 @@
1992
1936
  validated
1993
1937
  );
1994
1938
  ref = task.keyPath;
1995
- null === key ? (key = ref) : null !== ref && (key = ref + "," + key);
1939
+ null === key
1940
+ ? (key = ref)
1941
+ : null !== ref &&
1942
+ (key =
1943
+ ref === REACT_OPTIMISTIC_KEY || key === REACT_OPTIMISTIC_KEY
1944
+ ? REACT_OPTIMISTIC_KEY
1945
+ : ref + "," + key);
1996
1946
  newFormatContext = null;
1997
1947
  ref = task.debugOwner;
1998
1948
  null !== ref && outlineComponentInfo(request, ref);
@@ -2021,114 +1971,146 @@
2021
1971
  return task;
2022
1972
  }
2023
1973
  function visitAsyncNode(request, task, node, visited, cutOff) {
2024
- if (visited.has(node)) return null;
2025
- visited.add(node);
2026
- var previousIONode = null;
2027
- if (
2028
- null !== node.previous &&
2029
- node.end > request.timeOrigin &&
2030
- ((previousIONode = visitAsyncNode(
2031
- request,
2032
- task,
2033
- node.previous,
2034
- visited,
2035
- cutOff
2036
- )),
2037
- void 0 === previousIONode)
2038
- )
2039
- return;
2040
- switch (node.tag) {
2041
- case 0:
2042
- return node;
2043
- case 3:
2044
- return previousIONode;
2045
- case 1:
2046
- if (node.end <= request.timeOrigin) return previousIONode;
2047
- var awaited = node.awaited;
2048
- if (null !== awaited) {
2049
- cutOff = visitAsyncNode(request, task, awaited, visited, cutOff);
2050
- if (void 0 === cutOff) break;
2051
- null !== cutOff
2052
- ? (previousIONode =
2053
- 1 === cutOff.tag
2054
- ? cutOff
2055
- : null !== node.stack &&
2056
- hasUnfilteredFrame(request, node.stack)
2057
- ? node
2058
- : cutOff)
2059
- : request.status === ABORTING &&
2060
- node.start < request.abortTime &&
2061
- node.end > request.abortTime &&
2062
- null !== node.stack &&
2063
- hasUnfilteredFrame(request, node.stack) &&
2064
- (previousIONode = node);
2065
- }
2066
- node = node.promise.deref();
2067
- void 0 !== node &&
2068
- ((node = node._debugInfo),
2069
- null == node ||
2070
- visited.has(node) ||
2071
- (visited.add(node), forwardDebugInfo(request, task, node)));
2072
- return previousIONode;
2073
- case 4:
2074
- return previousIONode;
2075
- case 2:
2076
- awaited = node.awaited;
2077
- if (null !== awaited) {
2078
- var _ioNode = visitAsyncNode(
2079
- request,
2080
- task,
2081
- awaited,
2082
- visited,
2083
- cutOff
2084
- );
2085
- if (void 0 === _ioNode) break;
2086
- if (null !== _ioNode) {
2087
- var startTime = node.start,
2088
- endTime = node.end;
2089
- if (endTime <= request.timeOrigin) return null;
2090
- startTime < cutOff
2091
- ? ((previousIONode = _ioNode),
2092
- null !== node.stack &&
2093
- isAwaitInUserspace(request, node.stack) &&
2094
- void 0 !==
2095
- (null === awaited.promise
2096
- ? void 0
2097
- : awaited.promise.deref()) &&
2098
- serializeIONode(request, _ioNode, awaited.promise))
2099
- : null !== node.stack && isAwaitInUserspace(request, node.stack)
2100
- ? (request.status === ABORTING &&
2101
- startTime > request.abortTime) ||
2102
- (serializeIONode(request, _ioNode, awaited.promise),
2103
- null != node.owner &&
2104
- outlineComponentInfo(request, node.owner),
2105
- (cutOff = (0, request.environmentName)()),
2106
- advanceTaskTime(request, task, startTime),
2107
- request.pendingChunks++,
2108
- emitDebugChunk(request, task.id, {
2109
- awaited: _ioNode,
2110
- env: cutOff,
2111
- owner: node.owner,
2112
- stack:
2113
- null === node.stack
2114
- ? null
2115
- : filterStackTrace(request, node.stack)
2116
- }),
2117
- markOperationEndTime(request, task, endTime),
2118
- request.status === ABORTING && (previousIONode = void 0))
2119
- : (previousIONode = _ioNode);
2120
- }
2121
- }
2122
- node = node.promise.deref();
2123
- void 0 !== node &&
2124
- ((node = node._debugInfo),
2125
- null == node ||
2126
- visited.has(node) ||
2127
- (visited.add(node), forwardDebugInfo(request, task, node)));
2128
- return previousIONode;
2129
- default:
2130
- throw Error("Unknown AsyncSequence tag. This is a bug in React.");
1974
+ if (visited.has(node)) return visited.get(node);
1975
+ visited.set(node, null);
1976
+ a: if (0 <= node.end && node.end <= request.timeOrigin) request = null;
1977
+ else {
1978
+ var previousIONode = null;
1979
+ if (
1980
+ null !== node.previous &&
1981
+ ((previousIONode = visitAsyncNode(
1982
+ request,
1983
+ task,
1984
+ node.previous,
1985
+ visited,
1986
+ cutOff
1987
+ )),
1988
+ void 0 === previousIONode)
1989
+ ) {
1990
+ request = void 0;
1991
+ break a;
1992
+ }
1993
+ switch (node.tag) {
1994
+ case 0:
1995
+ request = node;
1996
+ break;
1997
+ case 3:
1998
+ request = previousIONode;
1999
+ break;
2000
+ case 1:
2001
+ var awaited = node.awaited,
2002
+ promise = node.promise.deref();
2003
+ if (null !== awaited)
2004
+ if (
2005
+ ((cutOff = visitAsyncNode(
2006
+ request,
2007
+ task,
2008
+ awaited,
2009
+ visited,
2010
+ cutOff
2011
+ )),
2012
+ void 0 === cutOff)
2013
+ ) {
2014
+ request = void 0;
2015
+ break;
2016
+ } else
2017
+ null !== cutOff
2018
+ ? (previousIONode =
2019
+ 1 === cutOff.tag
2020
+ ? cutOff
2021
+ : (null !== node.stack &&
2022
+ hasUnfilteredFrame(request, node.stack)) ||
2023
+ (void 0 !== promise &&
2024
+ "string" === typeof promise.displayName &&
2025
+ (null === cutOff.stack ||
2026
+ !hasUnfilteredFrame(request, cutOff.stack)))
2027
+ ? node
2028
+ : cutOff)
2029
+ : request.status === ABORTING &&
2030
+ node.start < request.abortTime &&
2031
+ node.end > request.abortTime &&
2032
+ ((null !== node.stack &&
2033
+ hasUnfilteredFrame(request, node.stack)) ||
2034
+ (void 0 !== promise &&
2035
+ "string" === typeof promise.displayName)) &&
2036
+ (previousIONode = node);
2037
+ void 0 !== promise &&
2038
+ ((cutOff = promise._debugInfo),
2039
+ null == cutOff ||
2040
+ visited.has(cutOff) ||
2041
+ (visited.set(cutOff, null),
2042
+ forwardDebugInfo(request, task, cutOff)));
2043
+ request = previousIONode;
2044
+ break;
2045
+ case 4:
2046
+ request = previousIONode;
2047
+ break;
2048
+ case 2:
2049
+ awaited = node.awaited;
2050
+ if (null !== awaited)
2051
+ if (
2052
+ ((promise = visitAsyncNode(
2053
+ request,
2054
+ task,
2055
+ awaited,
2056
+ visited,
2057
+ cutOff
2058
+ )),
2059
+ void 0 === promise)
2060
+ ) {
2061
+ request = void 0;
2062
+ break;
2063
+ } else if (null !== promise) {
2064
+ var startTime = node.start,
2065
+ endTime = node.end;
2066
+ startTime < cutOff
2067
+ ? ((previousIONode = promise),
2068
+ null !== node.stack &&
2069
+ isAwaitInUserspace(request, node.stack) &&
2070
+ void 0 !==
2071
+ (null === awaited.promise
2072
+ ? void 0
2073
+ : awaited.promise.deref()) &&
2074
+ serializeIONode(request, promise, awaited.promise))
2075
+ : null !== node.stack &&
2076
+ isAwaitInUserspace(request, node.stack)
2077
+ ? (request.status === ABORTING &&
2078
+ startTime > request.abortTime) ||
2079
+ (serializeIONode(request, promise, awaited.promise),
2080
+ visited.set(promise, null),
2081
+ null != node.owner &&
2082
+ outlineComponentInfo(request, node.owner),
2083
+ (cutOff = (0, request.environmentName)()),
2084
+ advanceTaskTime(request, task, startTime),
2085
+ request.pendingChunks++,
2086
+ emitDebugChunk(request, task.id, {
2087
+ awaited: promise,
2088
+ env: cutOff,
2089
+ owner: node.owner,
2090
+ stack:
2091
+ null === node.stack
2092
+ ? null
2093
+ : filterStackTrace(request, node.stack)
2094
+ }),
2095
+ markOperationEndTime(request, task, endTime),
2096
+ request.status === ABORTING && (previousIONode = void 0))
2097
+ : (previousIONode = promise);
2098
+ }
2099
+ cutOff = node.promise.deref();
2100
+ void 0 !== cutOff &&
2101
+ ((cutOff = cutOff._debugInfo),
2102
+ null == cutOff ||
2103
+ visited.has(cutOff) ||
2104
+ (visited.set(cutOff, null),
2105
+ forwardDebugInfo(request, task, cutOff)));
2106
+ request = previousIONode;
2107
+ break;
2108
+ default:
2109
+ throw Error("Unknown AsyncSequence tag. This is a bug in React.");
2110
+ }
2131
2111
  }
2112
+ null !== request && visited.set(node, request);
2113
+ return request;
2132
2114
  }
2133
2115
  function emitAsyncSequence(
2134
2116
  request,
@@ -2138,8 +2120,8 @@
2138
2120
  owner,
2139
2121
  stack
2140
2122
  ) {
2141
- var visited = new Set();
2142
- alreadyForwardedDebugInfo && visited.add(alreadyForwardedDebugInfo);
2123
+ var visited = new Map();
2124
+ alreadyForwardedDebugInfo && visited.set(alreadyForwardedDebugInfo, null);
2143
2125
  node = visitAsyncNode(request, task, node, visited, task.time);
2144
2126
  void 0 !== node &&
2145
2127
  null !== node &&
@@ -2427,6 +2409,8 @@
2427
2409
  return serializeByValueID(bufferId);
2428
2410
  }
2429
2411
  function serializeDebugTypedArray(request, tag, typedArray) {
2412
+ if (1e3 < typedArray.byteLength && !doNotLimit.has(typedArray))
2413
+ return serializeDeferredObject(request, typedArray);
2430
2414
  request.pendingDebugChunks++;
2431
2415
  var bufferId = request.nextChunkId++;
2432
2416
  emitTypedArrayChunk(request, bufferId, tag, typedArray, !0);
@@ -2634,7 +2618,9 @@
2634
2618
  void 0 === value._debugTask
2635
2619
  ) {
2636
2620
  var key = "";
2637
- null !== value.key && (key = ' key="' + value.key + '"');
2621
+ null !== value.key &&
2622
+ value.key !== REACT_OPTIMISTIC_KEY &&
2623
+ (key = ' key="' + value.key + '"');
2638
2624
  console.error(
2639
2625
  "Attempted to render <%s%s> without development properties. This is not supported. It can happen if:\n- The element is created with a production version of React but rendered in development.\n- The element was cloned with a custom function instead of `React.cloneElement`.\nThe props of this element may help locate this element: %o",
2640
2626
  value.type,
@@ -2790,7 +2776,7 @@
2790
2776
  if (value instanceof Date) return "$D" + value.toJSON();
2791
2777
  elementReference = getPrototypeOf(value);
2792
2778
  if (
2793
- elementReference !== ObjectPrototype &&
2779
+ elementReference !== ObjectPrototype$1 &&
2794
2780
  (null === elementReference ||
2795
2781
  null !== getPrototypeOf(elementReference))
2796
2782
  )
@@ -3027,12 +3013,15 @@
3027
3013
  function emitDebugChunk(request, id, debugInfo) {
3028
3014
  var json = serializeDebugModel(request, 500, debugInfo);
3029
3015
  null !== request.debugDestination
3030
- ? ((debugInfo = request.nextChunkId++),
3031
- (json = debugInfo.toString(16) + ":" + json + "\n"),
3032
- request.pendingDebugChunks++,
3033
- request.completedDebugChunks.push(json),
3034
- (id = id.toString(16) + ':D"$' + debugInfo.toString(16) + '"\n'),
3035
- request.completedRegularChunks.push(id))
3016
+ ? '"' === json[0] && "$" === json[1]
3017
+ ? ((id = id.toString(16) + ":D" + json + "\n"),
3018
+ request.completedRegularChunks.push(id))
3019
+ : ((debugInfo = request.nextChunkId++),
3020
+ (json = debugInfo.toString(16) + ":" + json + "\n"),
3021
+ request.pendingDebugChunks++,
3022
+ request.completedDebugChunks.push(json),
3023
+ (id = id.toString(16) + ':D"$' + debugInfo.toString(16) + '"\n'),
3024
+ request.completedRegularChunks.push(id))
3036
3025
  : ((id = id.toString(16) + ":D" + json + "\n"),
3037
3026
  request.completedRegularChunks.push(id));
3038
3027
  }
@@ -3097,55 +3086,62 @@
3097
3086
  if (void 0 !== existingRef) return existingRef;
3098
3087
  existingRef = null;
3099
3088
  var name = "";
3089
+ if (null !== ioNode.promise) {
3090
+ var promise = ioNode.promise.deref();
3091
+ void 0 !== promise &&
3092
+ "string" === typeof promise.displayName &&
3093
+ (name = promise.displayName);
3094
+ }
3100
3095
  if (null !== ioNode.stack) {
3101
3096
  a: {
3102
3097
  existingRef = ioNode.stack;
3103
- for (name = 0; name < existingRef.length; name++) {
3104
- var callsite = existingRef[name];
3098
+ for (promise = 0; promise < existingRef.length; promise++) {
3099
+ var callsite = existingRef[promise];
3105
3100
  if (!isPromiseCreationInternal(callsite[1], callsite[0])) {
3106
- name = 0 < name ? existingRef.slice(name) : existingRef;
3101
+ promise = 0 < promise ? existingRef.slice(promise) : existingRef;
3107
3102
  break a;
3108
3103
  }
3109
3104
  }
3110
- name = [];
3105
+ promise = [];
3111
3106
  }
3112
- existingRef = filterStackTrace(request, name);
3113
- a: {
3114
- callsite = "";
3115
- for (
3116
- var filterStackFrame = request.filterStackFrame, i = 0;
3117
- i < name.length;
3118
- i++
3119
- ) {
3120
- var callsite$jscomp$0 = name[i],
3121
- functionName = callsite$jscomp$0[0],
3122
- url = devirtualizeURL(callsite$jscomp$0[1]);
3123
- if (
3124
- filterStackFrame(
3125
- url,
3126
- functionName,
3127
- callsite$jscomp$0[2],
3128
- callsite$jscomp$0[3]
3129
- )
3130
- ) {
3131
- if ("" === callsite) {
3132
- name = functionName;
3107
+ existingRef = filterStackTrace(request, promise);
3108
+ if ("" === name) {
3109
+ a: {
3110
+ name = promise;
3111
+ promise = "";
3112
+ callsite = request.filterStackFrame;
3113
+ for (var i = 0; i < name.length; i++) {
3114
+ var callsite$jscomp$0 = name[i],
3115
+ functionName = callsite$jscomp$0[0],
3116
+ url = devirtualizeURL(callsite$jscomp$0[1]);
3117
+ if (
3118
+ callsite(
3119
+ url,
3120
+ functionName,
3121
+ callsite$jscomp$0[2],
3122
+ callsite$jscomp$0[3]
3123
+ ) &&
3124
+ "" !== url
3125
+ ) {
3126
+ if ("" === promise) {
3127
+ name = functionName;
3128
+ break a;
3129
+ }
3130
+ name = promise;
3133
3131
  break a;
3134
- }
3135
- name = callsite;
3136
- break a;
3137
- } else callsite = functionName;
3132
+ } else promise = functionName;
3133
+ }
3134
+ name = "";
3138
3135
  }
3139
- name = "";
3136
+ name.startsWith("Window.")
3137
+ ? (name = name.slice(7))
3138
+ : name.startsWith("<anonymous>.") && (name = name.slice(7));
3140
3139
  }
3141
- name.startsWith("Window.")
3142
- ? (name = name.slice(7))
3143
- : name.startsWith("<anonymous>.") && (name = name.slice(7));
3144
3140
  }
3145
- callsite = ioNode.owner;
3146
- null != callsite && outlineComponentInfo(request, callsite);
3147
- filterStackFrame = void 0;
3148
- null !== promiseRef && (filterStackFrame = promiseRef.deref());
3141
+ promise = ioNode.owner;
3142
+ null != promise && outlineComponentInfo(request, promise);
3143
+ callsite = void 0;
3144
+ null !== promiseRef && (callsite = promiseRef.deref());
3149
3145
  promiseRef = (0, request.environmentName)();
3150
3146
  i = 3 === ioNode.tag ? request.abortTime : ioNode.end;
3151
3147
  request.pendingDebugChunks++;
@@ -3156,9 +3152,9 @@
3156
3152
  name,
3157
3153
  ioNode.start,
3158
3154
  i,
3159
- filterStackFrame,
3160
- promiseRef,
3161
3155
  callsite,
3156
+ promiseRef,
3157
+ promise,
3162
3158
  existingRef
3163
3159
  );
3164
3160
  promiseRef = serializeByValueID(callsite$jscomp$0);
@@ -3367,7 +3363,11 @@
3367
3363
  }
3368
3364
  if ("function" === typeof value.then)
3369
3365
  return serializeDebugThenable(request, counter, value);
3370
- if (isArrayImpl(value)) return value;
3366
+ if (isArrayImpl(value))
3367
+ return 200 < value.length && !doNotLimit.has(value)
3368
+ ? serializeDeferredObject(request, value)
3369
+ : value;
3370
+ if (value instanceof Date) return "$D" + value.toJSON();
3371
3371
  if (value instanceof Map) {
3372
3372
  value = Array.from(value);
3373
3373
  counter.objectLimit++;
@@ -3454,7 +3454,7 @@
3454
3454
  return serializeDebugBlob(request, value);
3455
3455
  if (getIteratorFn(value)) return Array.from(value);
3456
3456
  request = getPrototypeOf(value);
3457
- if (request !== ObjectPrototype && null !== request) {
3457
+ if (request !== ObjectPrototype$1 && null !== request) {
3458
3458
  counter = Object.create(null);
3459
3459
  for (env in value)
3460
3460
  if (hasOwnProperty.call(value, env) || isGetter(request, env))
@@ -3470,11 +3470,6 @@
3470
3470
  return value;
3471
3471
  }
3472
3472
  if ("string" === typeof value) {
3473
- if (
3474
- "Z" === value[value.length - 1] &&
3475
- parent[parentPropertyName] instanceof Date
3476
- )
3477
- return "$D" + value;
3478
3473
  if (1024 <= value.length) {
3479
3474
  if (0 >= counter.objectLimit)
3480
3475
  return serializeDeferredObject(request, value);
@@ -3536,19 +3531,17 @@
3536
3531
  }
3537
3532
  return "bigint" === typeof value
3538
3533
  ? "$n" + value.toString(10)
3539
- : value instanceof Date
3540
- ? "$D" + value.toJSON()
3541
- : "unknown type " + typeof value;
3534
+ : "unknown type " + typeof value;
3542
3535
  }
3543
3536
  function serializeDebugModel(request, objectLimit, model) {
3544
- function replacer(parentPropertyName, value) {
3537
+ function replacer(parentPropertyName) {
3545
3538
  try {
3546
3539
  return renderDebugModel(
3547
3540
  request,
3548
3541
  counter,
3549
3542
  this,
3550
3543
  parentPropertyName,
3551
- value
3544
+ this[parentPropertyName]
3552
3545
  );
3553
3546
  } catch (x) {
3554
3547
  return (
@@ -3572,14 +3565,14 @@
3572
3565
  }
3573
3566
  }
3574
3567
  function emitOutlinedDebugModelChunk(request, id, counter, model) {
3575
- function replacer(parentPropertyName, value) {
3568
+ function replacer(parentPropertyName) {
3576
3569
  try {
3577
3570
  return renderDebugModel(
3578
3571
  request,
3579
3572
  counter,
3580
3573
  this,
3581
3574
  parentPropertyName,
3582
- value
3575
+ this[parentPropertyName]
3583
3576
  );
3584
3577
  } catch (x) {
3585
3578
  return (
@@ -3644,6 +3637,8 @@
3644
3637
  parseStackTrace(ioInfo$jscomp$0.debugStack, 1)
3645
3638
  )
3646
3639
  : ioInfo$jscomp$0.stack;
3640
+ var env = ioInfo$jscomp$0.env;
3641
+ null == env && (env = (0, request.environmentName)());
3647
3642
  emitIOInfoChunk(
3648
3643
  request,
3649
3644
  id$jscomp$0,
@@ -3651,7 +3646,7 @@
3651
3646
  ioInfo$jscomp$0.start,
3652
3647
  ioInfo$jscomp$0.end,
3653
3648
  ioInfo$jscomp$0.value,
3654
- ioInfo$jscomp$0.env,
3649
+ env,
3655
3650
  owner,
3656
3651
  debugStack
3657
3652
  );
@@ -3670,7 +3665,10 @@
3670
3665
  )
3671
3666
  : info.stack;
3672
3667
  ioInfo = { awaited: ioInfo };
3673
- null != info.env && (ioInfo.env = info.env);
3668
+ ioInfo.env =
3669
+ null != info.env
3670
+ ? info.env
3671
+ : (0, request$jscomp$0.environmentName)();
3674
3672
  null != info.owner && (ioInfo.owner = info.owner);
3675
3673
  null != debugStack && (ioInfo.stack = debugStack);
3676
3674
  request$jscomp$0.pendingChunks++;
@@ -3947,7 +3945,7 @@
3947
3945
  function flushCompletedChunks(request) {
3948
3946
  if (null !== request.debugDestination) {
3949
3947
  var debugDestination = request.debugDestination;
3950
- currentView = new Uint8Array(2048);
3948
+ currentView = new Uint8Array(4096);
3951
3949
  writtenBytes = 0;
3952
3950
  destinationHasCapacity = !0;
3953
3951
  try {
@@ -3966,7 +3964,7 @@
3966
3964
  }
3967
3965
  debugDestination = request.destination;
3968
3966
  if (null !== debugDestination) {
3969
- currentView = new Uint8Array(2048);
3967
+ currentView = new Uint8Array(4096);
3970
3968
  writtenBytes = 0;
3971
3969
  destinationHasCapacity = !0;
3972
3970
  try {
@@ -4176,15 +4174,15 @@
4176
4174
  )
4177
4175
  : reason,
4178
4176
  digest = logRecoverableError(request, error, null),
4179
- _errorId2 = request.nextChunkId++;
4180
- request.fatalError = _errorId2;
4177
+ errorId = request.nextChunkId++;
4178
+ request.fatalError = errorId;
4181
4179
  request.pendingChunks++;
4182
- emitErrorChunk(request, _errorId2, digest, error, !1, null);
4180
+ emitErrorChunk(request, errorId, digest, error, !1, null);
4183
4181
  abortableTasks.forEach(function (task) {
4184
- return abortTask(task, request, _errorId2);
4182
+ return abortTask(task, request, errorId);
4185
4183
  });
4186
4184
  setImmediate(function () {
4187
- return finishAbort(request, abortableTasks, _errorId2);
4185
+ return finishAbort(request, abortableTasks, errorId);
4188
4186
  });
4189
4187
  }
4190
4188
  else {
@@ -4314,10 +4312,15 @@
4314
4312
 
4315
4313
  ) {
4316
4314
  var chunkId = chunks[i++];
4317
- i++;
4318
- var thenable = __webpack_chunk_load__(chunkId);
4319
- promises.push(thenable);
4320
- thenable.catch(ignoreReject);
4315
+ chunks[i++];
4316
+ var entry = chunkCache.get(chunkId);
4317
+ if (void 0 === entry) {
4318
+ entry = __webpack_chunk_load__(chunkId);
4319
+ promises.push(entry);
4320
+ var resolve = chunkCache.set.bind(chunkCache, chunkId, null);
4321
+ entry.then(resolve, ignoreReject);
4322
+ chunkCache.set(chunkId, entry);
4323
+ } else null !== entry && promises.push(entry);
4321
4324
  }
4322
4325
  return 4 === metadata.length
4323
4326
  ? 0 === promises.length
@@ -4677,8 +4680,10 @@
4677
4680
  var name = path[i];
4678
4681
  if (
4679
4682
  "object" !== typeof value ||
4680
- !hasOwnProperty.call(value, name) ||
4681
- value instanceof Promise
4683
+ null === value ||
4684
+ (getPrototypeOf(value) !== ObjectPrototype &&
4685
+ getPrototypeOf(value) !== ArrayPrototype) ||
4686
+ !hasOwnProperty.call(value, name)
4682
4687
  )
4683
4688
  throw Error("Invalid reference.");
4684
4689
  value = value[name];
@@ -4726,8 +4731,10 @@
4726
4731
  var name = reference[i];
4727
4732
  if (
4728
4733
  "object" !== typeof id ||
4729
- !hasOwnProperty.call(id, name) ||
4730
- id instanceof Promise
4734
+ null === id ||
4735
+ (getPrototypeOf(id) !== ObjectPrototype &&
4736
+ getPrototypeOf(id) !== ArrayPrototype) ||
4737
+ !hasOwnProperty.call(id, name)
4731
4738
  )
4732
4739
  throw Error("Invalid reference.");
4733
4740
  id = id[name];
@@ -5364,6 +5371,34 @@
5364
5371
  var async_hooks = require("async_hooks"),
5365
5372
  ReactDOM = require("react-dom"),
5366
5373
  React = require("react"),
5374
+ assign = Object.assign,
5375
+ CLIENT_REFERENCE_TAG$1 = Symbol.for("react.client.reference"),
5376
+ SERVER_REFERENCE_TAG = Symbol.for("react.server.reference"),
5377
+ FunctionBind = Function.prototype.bind,
5378
+ ArraySlice = Array.prototype.slice,
5379
+ serverReferenceToString = {
5380
+ value: function () {
5381
+ return "function () { [omitted code] }";
5382
+ },
5383
+ configurable: !0,
5384
+ writable: !0
5385
+ },
5386
+ currentStrategy = {
5387
+ encrypt: function (_actionId) {
5388
+ for (
5389
+ var _len = arguments.length,
5390
+ args = Array(1 < _len ? _len - 1 : 0),
5391
+ _key = 1;
5392
+ _key < _len;
5393
+ _key++
5394
+ )
5395
+ args[_key - 1] = arguments[_key];
5396
+ return Promise.resolve(args);
5397
+ },
5398
+ decrypt: function (_actionId, payloadPromise) {
5399
+ return payloadPromise;
5400
+ }
5401
+ },
5367
5402
  REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"),
5368
5403
  REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
5369
5404
  REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
@@ -5373,92 +5408,16 @@
5373
5408
  REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"),
5374
5409
  REACT_MEMO_TYPE = Symbol.for("react.memo"),
5375
5410
  REACT_LAZY_TYPE = Symbol.for("react.lazy"),
5376
- REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel");
5377
- Symbol.for("react.postpone");
5378
- var MAYBE_ITERATOR_SYMBOL = Symbol.iterator,
5411
+ REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel"),
5412
+ REACT_VIEW_TRANSITION_TYPE = Symbol.for("react.view_transition"),
5413
+ MAYBE_ITERATOR_SYMBOL = Symbol.iterator,
5379
5414
  ASYNC_ITERATOR = Symbol.asyncIterator,
5415
+ REACT_OPTIMISTIC_KEY = Symbol.for("react.optimistic_key"),
5380
5416
  scheduleMicrotask = queueMicrotask,
5381
5417
  currentView = null,
5382
5418
  writtenBytes = 0,
5383
5419
  destinationHasCapacity = !0,
5384
5420
  textEncoder = new util.TextEncoder(),
5385
- CLIENT_REFERENCE_TAG$1 = Symbol.for("react.client.reference"),
5386
- SERVER_REFERENCE_TAG = Symbol.for("react.server.reference"),
5387
- FunctionBind = Function.prototype.bind,
5388
- ArraySlice = Array.prototype.slice,
5389
- serverReferenceToString = {
5390
- value: function () {
5391
- return "function () { [omitted code] }";
5392
- },
5393
- configurable: !0,
5394
- writable: !0
5395
- },
5396
- PROMISE_PROTOTYPE = Promise.prototype,
5397
- deepProxyHandlers = {
5398
- get: function (target, name) {
5399
- switch (name) {
5400
- case "$$typeof":
5401
- return target.$$typeof;
5402
- case "$$id":
5403
- return target.$$id;
5404
- case "$$async":
5405
- return target.$$async;
5406
- case "name":
5407
- return target.name;
5408
- case "displayName":
5409
- return;
5410
- case "defaultProps":
5411
- return;
5412
- case "_debugInfo":
5413
- return;
5414
- case "toJSON":
5415
- return;
5416
- case Symbol.toPrimitive:
5417
- return Object.prototype[Symbol.toPrimitive];
5418
- case Symbol.toStringTag:
5419
- return Object.prototype[Symbol.toStringTag];
5420
- case "Provider":
5421
- throw Error(
5422
- "Cannot render a Client Context Provider on the Server. Instead, you can export a Client Component wrapper that itself renders a Client Context Provider."
5423
- );
5424
- case "then":
5425
- throw Error(
5426
- "Cannot await or return from a thenable. You cannot await a client module from a server component."
5427
- );
5428
- }
5429
- throw Error(
5430
- "Cannot access " +
5431
- (String(target.name) + "." + String(name)) +
5432
- " on the server. You cannot dot into a client module from a server component. You can only pass the imported name through."
5433
- );
5434
- },
5435
- set: function () {
5436
- throw Error("Cannot assign to a client module from a server module.");
5437
- }
5438
- },
5439
- proxyHandlers$1 = {
5440
- get: function (target, name) {
5441
- return getReference(target, name);
5442
- },
5443
- getOwnPropertyDescriptor: function (target, name) {
5444
- var descriptor = Object.getOwnPropertyDescriptor(target, name);
5445
- descriptor ||
5446
- ((descriptor = {
5447
- value: getReference(target, name),
5448
- writable: !1,
5449
- configurable: !1,
5450
- enumerable: !1
5451
- }),
5452
- Object.defineProperty(target, name, descriptor));
5453
- return descriptor;
5454
- },
5455
- getPrototypeOf: function () {
5456
- return PROMISE_PROTOTYPE;
5457
- },
5458
- set: function () {
5459
- throw Error("Cannot assign to a client module from a server module.");
5460
- }
5461
- },
5462
5421
  ReactDOMSharedInternals =
5463
5422
  ReactDOM.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
5464
5423
  previousDispatcher = ReactDOMSharedInternals.d;
@@ -5809,67 +5768,76 @@
5809
5768
  previous: null
5810
5769
  });
5811
5770
  else if (
5812
- "Microtask" !== type &&
5813
- "TickObject" !== type &&
5814
- "Immediate" !== type
5815
- )
5816
- if (void 0 === trigger)
5817
- (trigger = resolveOwner()),
5818
- (trigger = {
5819
- tag: 0,
5820
- owner: trigger,
5821
- stack:
5822
- null === trigger
5823
- ? parseStackTracePrivate(Error(), 3)
5824
- : null,
5825
- start: performance.now(),
5826
- end: -1.1,
5827
- promise: null,
5828
- awaited: null,
5829
- previous: null
5830
- });
5831
- else {
5832
- if (2 === trigger.tag || 4 === trigger.tag)
5833
- (resource = resolveOwner()),
5834
- (trigger = {
5835
- tag: 0,
5836
- owner: resource,
5837
- stack:
5838
- null === resource
5839
- ? parseStackTracePrivate(Error(), 3)
5840
- : null,
5841
- start: performance.now(),
5842
- end: -1.1,
5843
- promise: null,
5844
- awaited: null,
5845
- previous: trigger
5846
- });
5847
- }
5848
- else if (void 0 === trigger) return;
5771
+ "bound-anonymous-fn" === type ||
5772
+ "Microtask" === type ||
5773
+ "TickObject" === type ||
5774
+ "Immediate" === type
5775
+ ) {
5776
+ if (void 0 === trigger) return;
5777
+ } else if (void 0 === trigger)
5778
+ (trigger = resolveOwner()),
5779
+ (trigger = {
5780
+ tag: 0,
5781
+ owner: trigger,
5782
+ stack:
5783
+ null === trigger
5784
+ ? parseStackTracePrivate(Error(), 3)
5785
+ : null,
5786
+ start: performance.now(),
5787
+ end: -1.1,
5788
+ promise: null,
5789
+ awaited: null,
5790
+ previous: null
5791
+ });
5792
+ else if (2 === trigger.tag || 4 === trigger.tag)
5793
+ (resource = resolveOwner()),
5794
+ (trigger = {
5795
+ tag: 0,
5796
+ owner: resource,
5797
+ stack:
5798
+ null === resource
5799
+ ? parseStackTracePrivate(Error(), 3)
5800
+ : null,
5801
+ start: performance.now(),
5802
+ end: -1.1,
5803
+ promise: null,
5804
+ awaited: null,
5805
+ previous: trigger
5806
+ });
5849
5807
  pendingOperations.set(asyncId, trigger);
5850
5808
  },
5851
5809
  before: function (asyncId) {
5852
- asyncId = pendingOperations.get(asyncId);
5853
- if (void 0 !== asyncId)
5854
- switch (asyncId.tag) {
5810
+ var node = pendingOperations.get(asyncId);
5811
+ if (void 0 !== node)
5812
+ switch (node.tag) {
5855
5813
  case 0:
5856
5814
  lastRanAwait = null;
5857
- asyncId.end = performance.now();
5815
+ 0 > node.end
5816
+ ? (node.end = performance.now())
5817
+ : ((node = {
5818
+ tag: 0,
5819
+ owner: node.owner,
5820
+ stack: node.stack,
5821
+ start: node.start,
5822
+ end: performance.now(),
5823
+ promise: node.promise,
5824
+ awaited: node.awaited,
5825
+ previous: node.previous
5826
+ }),
5827
+ pendingOperations.set(asyncId, node));
5858
5828
  break;
5859
5829
  case 4:
5860
5830
  lastRanAwait = resolvePromiseOrAwaitNode(
5861
- asyncId,
5831
+ node,
5862
5832
  performance.now()
5863
5833
  );
5864
5834
  break;
5865
5835
  case 2:
5866
- lastRanAwait = asyncId;
5836
+ lastRanAwait = node;
5867
5837
  break;
5868
5838
  case 3:
5869
- resolvePromiseOrAwaitNode(
5870
- asyncId,
5871
- performance.now()
5872
- ).previous = lastRanAwait;
5839
+ resolvePromiseOrAwaitNode(node, performance.now()).previous =
5840
+ lastRanAwait;
5873
5841
  lastRanAwait = null;
5874
5842
  break;
5875
5843
  default:
@@ -5935,11 +5903,10 @@
5935
5903
  patchConsole(console, "table"),
5936
5904
  patchConsole(console, "trace"),
5937
5905
  patchConsole(console, "warn"));
5938
- var ObjectPrototype = Object.prototype,
5906
+ var ObjectPrototype$1 = Object.prototype,
5939
5907
  stringify = JSON.stringify,
5940
5908
  ABORTING = 12,
5941
5909
  CLOSED = 14,
5942
- defaultPostponeHandler = noop,
5943
5910
  currentRequest = null,
5944
5911
  canEmitDebugInfo = !1,
5945
5912
  serializedSize = 0,
@@ -5950,6 +5917,7 @@
5950
5917
  debugNoOutline = null,
5951
5918
  emptyRoot = {},
5952
5919
  decoderOptions = { stream: !0 },
5920
+ chunkCache = new Map(),
5953
5921
  RESPONSE_SYMBOL = Symbol();
5954
5922
  ReactPromise.prototype = Object.create(Promise.prototype);
5955
5923
  ReactPromise.prototype.then = function (resolve, reject) {
@@ -5961,16 +5929,23 @@
5961
5929
  case "fulfilled":
5962
5930
  if ("function" === typeof resolve) {
5963
5931
  for (
5964
- var inspectedValue = this.value, cycleProtection = 0;
5932
+ var inspectedValue = this.value,
5933
+ cycleProtection = 0,
5934
+ visited = new Set();
5965
5935
  inspectedValue instanceof ReactPromise;
5966
5936
 
5967
5937
  ) {
5968
5938
  cycleProtection++;
5969
- if (inspectedValue === this || 1e3 < cycleProtection) {
5939
+ if (
5940
+ inspectedValue === this ||
5941
+ visited.has(inspectedValue) ||
5942
+ 1e3 < cycleProtection
5943
+ ) {
5970
5944
  "function" === typeof reject &&
5971
5945
  reject(Error("Cannot have cyclic thenables."));
5972
5946
  return;
5973
5947
  }
5948
+ visited.add(inspectedValue);
5974
5949
  if ("fulfilled" === inspectedValue.status)
5975
5950
  inspectedValue = inspectedValue.value;
5976
5951
  else break;
@@ -5991,10 +5966,20 @@
5991
5966
  "function" === typeof reject && reject(this.reason);
5992
5967
  }
5993
5968
  };
5994
- var initializingHandler = null;
5995
- exports.createClientModuleProxy = function (moduleId) {
5996
- moduleId = registerClientReferenceImpl({}, moduleId, !1);
5997
- return new Proxy(moduleId, proxyHandlers$1);
5969
+ var ObjectPrototype = Object.prototype,
5970
+ ArrayPrototype = Array.prototype,
5971
+ initializingHandler = null;
5972
+ exports.createServerEntry = function (value, resource) {
5973
+ var entryJsFiles = __rspack_rsc_manifest__.entryJsFiles || [],
5974
+ entryCssFiles = __rspack_rsc_manifest__.entryCssFiles[resource] || [];
5975
+ ("function" === typeof value ||
5976
+ ("object" === typeof value && null !== value)) &&
5977
+ assign(value, {
5978
+ resource: resource,
5979
+ entryJsFiles: entryJsFiles,
5980
+ entryCssFiles: entryCssFiles
5981
+ });
5982
+ return value;
5998
5983
  };
5999
5984
  exports.createTemporaryReferenceSet = function () {
6000
5985
  return new WeakMap();
@@ -6040,27 +6025,23 @@
6040
6025
  : [actionResult, keyPath, referenceId, bound.length - 1];
6041
6026
  });
6042
6027
  };
6043
- exports.decodeReply = function (body, webpackMap, options) {
6028
+ exports.decodeReply = function (body, options) {
6044
6029
  if ("string" === typeof body) {
6045
6030
  var form = new FormData();
6046
6031
  form.append("0", body);
6047
6032
  body = form;
6048
6033
  }
6049
6034
  body = createResponse(
6050
- webpackMap,
6035
+ __rspack_rsc_manifest__.serverManifest,
6051
6036
  "",
6052
6037
  options ? options.temporaryReferences : void 0,
6053
6038
  body
6054
6039
  );
6055
- webpackMap = getChunk(body, 0);
6040
+ options = getChunk(body, 0);
6056
6041
  close(body);
6057
- return webpackMap;
6042
+ return options;
6058
6043
  };
6059
- exports.decodeReplyFromAsyncIterable = function (
6060
- iterable,
6061
- webpackMap,
6062
- options
6063
- ) {
6044
+ exports.decodeReplyFromAsyncIterable = function (iterable, options) {
6064
6045
  function progress(entry) {
6065
6046
  if (entry.done) close(response);
6066
6047
  else {
@@ -6080,20 +6061,16 @@
6080
6061
  }
6081
6062
  var iterator = iterable[ASYNC_ITERATOR](),
6082
6063
  response = createResponse(
6083
- webpackMap,
6064
+ __rspack_rsc_manifest__.serverManifest,
6084
6065
  "",
6085
6066
  options ? options.temporaryReferences : void 0
6086
6067
  );
6087
6068
  iterator.next().then(progress, error);
6088
6069
  return getChunk(response, 0);
6089
6070
  };
6090
- exports.decodeReplyFromBusboy = function (
6091
- busboyStream,
6092
- webpackMap,
6093
- options
6094
- ) {
6071
+ exports.decodeReplyFromBusboy = function (busboyStream, options) {
6095
6072
  var response = createResponse(
6096
- webpackMap,
6073
+ __rspack_rsc_manifest__.serverManifest,
6097
6074
  "",
6098
6075
  options ? options.temporaryReferences : void 0
6099
6076
  ),
@@ -6119,13 +6096,13 @@
6119
6096
  );
6120
6097
  else {
6121
6098
  pendingFiles++;
6122
- var JSCompiler_object_inline_chunks_263 = [];
6099
+ var JSCompiler_object_inline_chunks_286 = [];
6123
6100
  value.on("data", function (chunk) {
6124
- JSCompiler_object_inline_chunks_263.push(chunk);
6101
+ JSCompiler_object_inline_chunks_286.push(chunk);
6125
6102
  });
6126
6103
  value.on("end", function () {
6127
6104
  try {
6128
- var blob = new Blob(JSCompiler_object_inline_chunks_263, {
6105
+ var blob = new Blob(JSCompiler_object_inline_chunks_286, {
6129
6106
  type: mimeType
6130
6107
  });
6131
6108
  response._formData.append(name, blob, filename);
@@ -6153,11 +6130,56 @@
6153
6130
  });
6154
6131
  return getChunk(response, 0);
6155
6132
  };
6156
- exports.prerender = function (model, webpackMap, options) {
6133
+ exports.decryptServerActionBoundArgs = function (
6134
+ actionId,
6135
+ encryptedPromise
6136
+ ) {
6137
+ return currentStrategy.decrypt(actionId, encryptedPromise);
6138
+ };
6139
+ exports.encryptServerActionBoundArgs = function (actionId) {
6140
+ for (
6141
+ var _currentStrategy,
6142
+ _len2 = arguments.length,
6143
+ args = Array(1 < _len2 ? _len2 - 1 : 0),
6144
+ _key2 = 1;
6145
+ _key2 < _len2;
6146
+ _key2++
6147
+ )
6148
+ args[_key2 - 1] = arguments[_key2];
6149
+ return (_currentStrategy = currentStrategy).encrypt.apply(
6150
+ _currentStrategy,
6151
+ [actionId].concat(args)
6152
+ );
6153
+ };
6154
+ exports.ensureServerActions = function (actions) {
6155
+ for (var i = 0; i < actions.length; i++) {
6156
+ var action = actions[i];
6157
+ if ("function" !== typeof action)
6158
+ throw Error(
6159
+ 'A "use server" file can only export async functions, found ' +
6160
+ typeof action +
6161
+ "."
6162
+ );
6163
+ }
6164
+ };
6165
+ exports.loadServerAction = function (actionId) {
6166
+ var actionModId = __rspack_rsc_manifest__.serverManifest[actionId].id;
6167
+ if (!actionModId)
6168
+ throw Error(
6169
+ 'Failed to find Server Action "' +
6170
+ actionId +
6171
+ '". This request might be from an older or newer deployment.'
6172
+ );
6173
+ actionId = __webpack_require__(actionModId)[actionId];
6174
+ if ("function" !== typeof actionId)
6175
+ throw Error("Server actions must be functions");
6176
+ return actionId;
6177
+ };
6178
+ exports.prerender = function (model, options) {
6157
6179
  return new Promise(function (resolve, reject) {
6158
6180
  var request = createPrerenderRequest(
6159
6181
  model,
6160
- webpackMap,
6182
+ __rspack_rsc_manifest__.clientManifest,
6161
6183
  function () {
6162
6184
  var writable,
6163
6185
  stream = new ReadableStream(
@@ -6184,7 +6206,6 @@
6184
6206
  reject,
6185
6207
  options ? options.onError : void 0,
6186
6208
  options ? options.identifierPrefix : void 0,
6187
- options ? options.onPostpone : void 0,
6188
6209
  options ? options.temporaryReferences : void 0,
6189
6210
  options ? options.environmentName : void 0,
6190
6211
  options ? options.filterStackFrame : void 0,
@@ -6204,11 +6225,11 @@
6204
6225
  startWork(request);
6205
6226
  });
6206
6227
  };
6207
- exports.prerenderToNodeStream = function (model, webpackMap, options) {
6228
+ exports.prerenderToNodeStream = function (model, options) {
6208
6229
  return new Promise(function (resolve, reject) {
6209
6230
  var request = createPrerenderRequest(
6210
6231
  model,
6211
- webpackMap,
6232
+ __rspack_rsc_manifest__.clientManifest,
6212
6233
  function () {
6213
6234
  var readable = new stream.Readable({
6214
6235
  read: function () {
@@ -6221,7 +6242,6 @@
6221
6242
  reject,
6222
6243
  options ? options.onError : void 0,
6223
6244
  options ? options.identifierPrefix : void 0,
6224
- options ? options.onPostpone : void 0,
6225
6245
  options ? options.temporaryReferences : void 0,
6226
6246
  options ? options.environmentName : void 0,
6227
6247
  options ? options.filterStackFrame : void 0,
@@ -6246,11 +6266,11 @@
6246
6266
  id,
6247
6267
  exportName
6248
6268
  ) {
6249
- return registerClientReferenceImpl(
6250
- proxyImplementation,
6251
- id + "#" + exportName,
6252
- !1
6253
- );
6269
+ return Object.defineProperties(proxyImplementation, {
6270
+ $$typeof: { value: CLIENT_REFERENCE_TAG$1 },
6271
+ $$id: { value: id + "#" + exportName },
6272
+ $$async: { value: !1 }
6273
+ });
6254
6274
  };
6255
6275
  exports.registerServerReference = function (reference, id, exportName) {
6256
6276
  return Object.defineProperties(reference, {
@@ -6265,7 +6285,7 @@
6265
6285
  toString: serverReferenceToString
6266
6286
  });
6267
6287
  };
6268
- exports.renderToPipeableStream = function (model, webpackMap, options) {
6288
+ exports.renderToPipeableStream = function (model, options) {
6269
6289
  var debugChannel = options ? options.debugChannel : void 0,
6270
6290
  debugChannelReadable =
6271
6291
  void 0 === debugChannel ||
@@ -6283,10 +6303,9 @@
6283
6303
  : void 0;
6284
6304
  var request = createRequest(
6285
6305
  model,
6286
- webpackMap,
6306
+ __rspack_rsc_manifest__.clientManifest,
6287
6307
  options ? options.onError : void 0,
6288
6308
  options ? options.identifierPrefix : void 0,
6289
- options ? options.onPostpone : void 0,
6290
6309
  options ? options.temporaryReferences : void 0,
6291
6310
  options ? options.environmentName : void 0,
6292
6311
  options ? options.filterStackFrame : void 0,
@@ -6328,7 +6347,7 @@
6328
6347
  }
6329
6348
  };
6330
6349
  };
6331
- exports.renderToReadableStream = function (model, webpackMap, options) {
6350
+ exports.renderToReadableStream = function (model, options) {
6332
6351
  var debugChannelReadable =
6333
6352
  options && options.debugChannel
6334
6353
  ? options.debugChannel.readable
@@ -6339,10 +6358,9 @@
6339
6358
  : void 0,
6340
6359
  request = createRequest(
6341
6360
  model,
6342
- webpackMap,
6361
+ __rspack_rsc_manifest__.clientManifest,
6343
6362
  options ? options.onError : void 0,
6344
6363
  options ? options.identifierPrefix : void 0,
6345
- options ? options.onPostpone : void 0,
6346
6364
  options ? options.temporaryReferences : void 0,
6347
6365
  options ? options.environmentName : void 0,
6348
6366
  options ? options.filterStackFrame : void 0,
@@ -6400,4 +6418,7 @@
6400
6418
  { highWaterMark: 0 }
6401
6419
  );
6402
6420
  };
6421
+ exports.setServerActionBoundArgsEncryption = function (strategy) {
6422
+ currentStrategy = strategy;
6423
+ };
6403
6424
  })();