@vitejs/plugin-rsc 0.4.10-alpha.1 → 0.4.10

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 (108) hide show
  1. package/README.md +0 -1
  2. package/package.json +18 -13
  3. package/dist/browser-D8OPzpF5.js +0 -35
  4. package/dist/browser-DjnGtEmB.d.ts +0 -15
  5. package/dist/browser-Dw18EFgE.d.ts +0 -6
  6. package/dist/browser-LizIyxet.js +0 -17
  7. package/dist/browser-QWbIPyhO.js +0 -17
  8. package/dist/browser.d.ts +0 -4
  9. package/dist/browser.js +0 -7
  10. package/dist/client-edAdk2GF.js +0 -23
  11. package/dist/core/browser.d.ts +0 -2
  12. package/dist/core/browser.js +0 -5
  13. package/dist/core/plugin.d.ts +0 -6
  14. package/dist/core/plugin.js +0 -3
  15. package/dist/core/rsc.d.ts +0 -3
  16. package/dist/core/rsc.js +0 -5
  17. package/dist/core/ssr.d.ts +0 -3
  18. package/dist/core/ssr.js +0 -5
  19. package/dist/dist-DEF94lDJ.js +0 -41
  20. package/dist/encryption-utils-BDwwcMVT.js +0 -73
  21. package/dist/extra/browser.d.ts +0 -7
  22. package/dist/extra/browser.js +0 -83
  23. package/dist/extra/rsc.d.ts +0 -2
  24. package/dist/extra/rsc.js +0 -60
  25. package/dist/extra/ssr.d.ts +0 -10
  26. package/dist/extra/ssr.js +0 -35
  27. package/dist/index-BHqtj9tT.d.ts +0 -26
  28. package/dist/index.d.ts +0 -23
  29. package/dist/index.js +0 -8
  30. package/dist/plugin-BZEsXXjV.js +0 -1442
  31. package/dist/plugin-CZbI4rhS.js +0 -24
  32. package/dist/plugin-Dg2agPFN.d.ts +0 -88
  33. package/dist/plugin.d.ts +0 -2
  34. package/dist/plugin.js +0 -8
  35. package/dist/react/browser.d.ts +0 -4
  36. package/dist/react/browser.js +0 -6
  37. package/dist/react/rsc.d.ts +0 -4
  38. package/dist/react/rsc.js +0 -6
  39. package/dist/react/ssr.d.ts +0 -4
  40. package/dist/react/ssr.js +0 -6
  41. package/dist/rpc-tGuLT8PD.js +0 -47
  42. package/dist/rsc-BOV3yNSd.d.ts +0 -12
  43. package/dist/rsc-Cmvt9txp.d.ts +0 -13
  44. package/dist/rsc-DHfL29FT.js +0 -36
  45. package/dist/rsc-DKA6wwTB.js +0 -78
  46. package/dist/rsc-DgrejoNf.d.ts +0 -15
  47. package/dist/rsc-DmPsJrxF.js +0 -42
  48. package/dist/rsc-html-stream/browser.d.ts +0 -4
  49. package/dist/rsc-html-stream/browser.js +0 -7
  50. package/dist/rsc-html-stream/ssr.d.ts +0 -6
  51. package/dist/rsc-html-stream/ssr.js +0 -7
  52. package/dist/rsc.d.ts +0 -13
  53. package/dist/rsc.js +0 -8
  54. package/dist/server-DGTepepH.js +0 -67
  55. package/dist/shared-CEyKoKAb.js +0 -22
  56. package/dist/ssr-BOIYlvSn.js +0 -23
  57. package/dist/ssr-D5pxP29F.js +0 -18
  58. package/dist/ssr-D708H86k.d.ts +0 -7
  59. package/dist/ssr-DgSrGrln.d.ts +0 -9
  60. package/dist/ssr-Do_Ok_bB.js +0 -47
  61. package/dist/ssr.d.ts +0 -4
  62. package/dist/ssr.js +0 -7
  63. package/dist/utils/rpc.d.ts +0 -7
  64. package/dist/utils/rpc.js +0 -3
  65. package/dist/vendor/react-server-dom/LICENSE +0 -21
  66. package/dist/vendor/react-server-dom/README.md +0 -5
  67. package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-client.browser.development.js +0 -2785
  68. package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-client.browser.production.js +0 -1664
  69. package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-client.edge.development.js +0 -2959
  70. package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-client.edge.production.js +0 -1845
  71. package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-client.node.development.js +0 -3002
  72. package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-client.node.production.js +0 -1894
  73. package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-client.node.unbundled.development.js +0 -2964
  74. package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-client.node.unbundled.production.js +0 -1859
  75. package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-node-register.js +0 -69
  76. package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-plugin.js +0 -400
  77. package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-server.browser.development.js +0 -4079
  78. package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-server.browser.production.js +0 -2806
  79. package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-server.edge.development.js +0 -4187
  80. package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-server.edge.production.js +0 -2845
  81. package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-server.node.development.js +0 -4195
  82. package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-server.node.production.js +0 -2902
  83. package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-server.node.unbundled.development.js +0 -4158
  84. package/dist/vendor/react-server-dom/cjs/react-server-dom-webpack-server.node.unbundled.production.js +0 -2868
  85. package/dist/vendor/react-server-dom/client.browser.js +0 -7
  86. package/dist/vendor/react-server-dom/client.edge.js +0 -7
  87. package/dist/vendor/react-server-dom/client.js +0 -3
  88. package/dist/vendor/react-server-dom/client.node.js +0 -7
  89. package/dist/vendor/react-server-dom/client.node.unbundled.js +0 -7
  90. package/dist/vendor/react-server-dom/esm/package.json +0 -3
  91. package/dist/vendor/react-server-dom/esm/react-server-dom-webpack-node-loader.production.js +0 -515
  92. package/dist/vendor/react-server-dom/index.js +0 -12
  93. package/dist/vendor/react-server-dom/node-register.js +0 -3
  94. package/dist/vendor/react-server-dom/package.json +0 -111
  95. package/dist/vendor/react-server-dom/plugin.js +0 -3
  96. package/dist/vendor/react-server-dom/server.browser.js +0 -17
  97. package/dist/vendor/react-server-dom/server.edge.js +0 -18
  98. package/dist/vendor/react-server-dom/server.js +0 -6
  99. package/dist/vendor/react-server-dom/server.node.js +0 -18
  100. package/dist/vendor/react-server-dom/server.node.unbundled.js +0 -18
  101. package/dist/vendor/react-server-dom/static.browser.js +0 -12
  102. package/dist/vendor/react-server-dom/static.edge.js +0 -12
  103. package/dist/vendor/react-server-dom/static.js +0 -6
  104. package/dist/vendor/react-server-dom/static.node.js +0 -12
  105. package/dist/vendor/react-server-dom/static.node.unbundled.js +0 -12
  106. package/dist/vite-utils-CcqBE-C4.js +0 -64
  107. package/dist/vite-utils.d.ts +0 -21
  108. package/dist/vite-utils.js +0 -3
@@ -1,4079 +0,0 @@
1
- /**
2
- * @license React
3
- * react-server-dom-webpack-server.browser.development.js
4
- *
5
- * Copyright (c) Meta Platforms, Inc. and affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */
10
-
11
- "use strict";
12
- "production" !== process.env.NODE_ENV &&
13
- (function () {
14
- function voidHandler() {}
15
- function _defineProperty(obj, key, value) {
16
- a: if ("object" == typeof key && key) {
17
- var e = key[Symbol.toPrimitive];
18
- if (void 0 !== e) {
19
- key = e.call(key, "string");
20
- if ("object" != typeof key) break a;
21
- throw new TypeError("@@toPrimitive must return a primitive value.");
22
- }
23
- key = String(key);
24
- }
25
- key = "symbol" == typeof key ? key : key + "";
26
- key in obj
27
- ? Object.defineProperty(obj, key, {
28
- value: value,
29
- enumerable: !0,
30
- configurable: !0,
31
- writable: !0
32
- })
33
- : (obj[key] = value);
34
- return obj;
35
- }
36
- function scheduleWork(callback) {
37
- taskQueue.push(callback);
38
- channel.port2.postMessage(null);
39
- }
40
- function handleErrorInNextTick(error) {
41
- setTimeout(function () {
42
- throw error;
43
- });
44
- }
45
- function writeChunkAndReturn(destination, chunk) {
46
- if (0 !== chunk.byteLength)
47
- if (2048 < chunk.byteLength)
48
- 0 < writtenBytes &&
49
- (destination.enqueue(
50
- new Uint8Array(currentView.buffer, 0, writtenBytes)
51
- ),
52
- (currentView = new Uint8Array(2048)),
53
- (writtenBytes = 0)),
54
- destination.enqueue(chunk);
55
- else {
56
- var allowableBytes = currentView.length - writtenBytes;
57
- allowableBytes < chunk.byteLength &&
58
- (0 === allowableBytes
59
- ? destination.enqueue(currentView)
60
- : (currentView.set(
61
- chunk.subarray(0, allowableBytes),
62
- writtenBytes
63
- ),
64
- destination.enqueue(currentView),
65
- (chunk = chunk.subarray(allowableBytes))),
66
- (currentView = new Uint8Array(2048)),
67
- (writtenBytes = 0));
68
- currentView.set(chunk, writtenBytes);
69
- writtenBytes += chunk.byteLength;
70
- }
71
- return !0;
72
- }
73
- function stringToChunk(content) {
74
- return textEncoder.encode(content);
75
- }
76
- function byteLengthOfChunk(chunk) {
77
- return chunk.byteLength;
78
- }
79
- function closeWithError(destination, error) {
80
- "function" === typeof destination.error
81
- ? destination.error(error)
82
- : destination.close();
83
- }
84
- function isClientReference(reference) {
85
- return reference.$$typeof === CLIENT_REFERENCE_TAG$1;
86
- }
87
- function registerClientReferenceImpl(proxyImplementation, id, async) {
88
- return Object.defineProperties(proxyImplementation, {
89
- $$typeof: { value: CLIENT_REFERENCE_TAG$1 },
90
- $$id: { value: id },
91
- $$async: { value: async }
92
- });
93
- }
94
- function bind() {
95
- var newFn = FunctionBind.apply(this, arguments);
96
- if (this.$$typeof === SERVER_REFERENCE_TAG) {
97
- null != arguments[0] &&
98
- console.error(
99
- 'Cannot bind "this" of a Server Action. Pass null or undefined as the first argument to .bind().'
100
- );
101
- var args = ArraySlice.call(arguments, 1),
102
- $$typeof = { value: SERVER_REFERENCE_TAG },
103
- $$id = { value: this.$$id };
104
- args = { value: this.$$bound ? this.$$bound.concat(args) : args };
105
- return Object.defineProperties(newFn, {
106
- $$typeof: $$typeof,
107
- $$id: $$id,
108
- $$bound: args,
109
- $$location: { value: this.$$location, configurable: !0 },
110
- bind: { value: bind, configurable: !0 }
111
- });
112
- }
113
- return newFn;
114
- }
115
- function getReference(target, name) {
116
- switch (name) {
117
- case "$$typeof":
118
- return target.$$typeof;
119
- case "$$id":
120
- return target.$$id;
121
- case "$$async":
122
- return target.$$async;
123
- case "name":
124
- return target.name;
125
- case "defaultProps":
126
- return;
127
- case "toJSON":
128
- return;
129
- case Symbol.toPrimitive:
130
- return Object.prototype[Symbol.toPrimitive];
131
- case Symbol.toStringTag:
132
- return Object.prototype[Symbol.toStringTag];
133
- case "__esModule":
134
- var moduleId = target.$$id;
135
- target.default = registerClientReferenceImpl(
136
- function () {
137
- throw Error(
138
- "Attempted to call the default export of " +
139
- moduleId +
140
- " 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."
141
- );
142
- },
143
- target.$$id + "#",
144
- target.$$async
145
- );
146
- return !0;
147
- case "then":
148
- if (target.then) return target.then;
149
- if (target.$$async) return;
150
- var clientReference = registerClientReferenceImpl(
151
- {},
152
- target.$$id,
153
- !0
154
- ),
155
- proxy = new Proxy(clientReference, proxyHandlers$1);
156
- target.status = "fulfilled";
157
- target.value = proxy;
158
- return (target.then = registerClientReferenceImpl(
159
- function (resolve) {
160
- return Promise.resolve(resolve(proxy));
161
- },
162
- target.$$id + "#then",
163
- !1
164
- ));
165
- }
166
- if ("symbol" === typeof name)
167
- throw Error(
168
- "Cannot read Symbol exports. Only named exports are supported on a client module imported on the server."
169
- );
170
- clientReference = target[name];
171
- clientReference ||
172
- ((clientReference = registerClientReferenceImpl(
173
- function () {
174
- throw Error(
175
- "Attempted to call " +
176
- String(name) +
177
- "() from the server but " +
178
- String(name) +
179
- " 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."
180
- );
181
- },
182
- target.$$id + "#" + name,
183
- target.$$async
184
- )),
185
- Object.defineProperty(clientReference, "name", { value: name }),
186
- (clientReference = target[name] =
187
- new Proxy(clientReference, deepProxyHandlers)));
188
- return clientReference;
189
- }
190
- function trimOptions(options) {
191
- if (null == options) return null;
192
- var hasProperties = !1,
193
- trimmed = {},
194
- key;
195
- for (key in options)
196
- null != options[key] &&
197
- ((hasProperties = !0), (trimmed[key] = options[key]));
198
- return hasProperties ? trimmed : null;
199
- }
200
- function parseStackTrace(error, skipFrames) {
201
- a: {
202
- var previousPrepare = Error.prepareStackTrace;
203
- Error.prepareStackTrace = void 0;
204
- try {
205
- var stack = String(error.stack);
206
- break a;
207
- } finally {
208
- Error.prepareStackTrace = previousPrepare;
209
- }
210
- stack = void 0;
211
- }
212
- stack.startsWith("Error: react-stack-top-frame\n") &&
213
- (stack = stack.slice(29));
214
- error = stack.indexOf("react-stack-bottom-frame");
215
- -1 !== error && (error = stack.lastIndexOf("\n", error));
216
- -1 !== error && (stack = stack.slice(0, error));
217
- stack = stack.split("\n");
218
- for (error = []; skipFrames < stack.length; skipFrames++)
219
- if ((previousPrepare = frameRegExp.exec(stack[skipFrames]))) {
220
- var name = previousPrepare[1] || "";
221
- "<anonymous>" === name && (name = "");
222
- var filename = previousPrepare[2] || previousPrepare[5] || "";
223
- "<anonymous>" === filename && (filename = "");
224
- error.push([
225
- name,
226
- filename,
227
- +(previousPrepare[3] || previousPrepare[6]),
228
- +(previousPrepare[4] || previousPrepare[7])
229
- ]);
230
- }
231
- return error;
232
- }
233
- function createTemporaryReference(temporaryReferences, id) {
234
- var reference = Object.defineProperties(
235
- function () {
236
- throw Error(
237
- "Attempted to call a temporary Client Reference from the server but it 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."
238
- );
239
- },
240
- { $$typeof: { value: TEMPORARY_REFERENCE_TAG } }
241
- );
242
- reference = new Proxy(reference, proxyHandlers);
243
- temporaryReferences.set(reference, id);
244
- return reference;
245
- }
246
- function getIteratorFn(maybeIterable) {
247
- if (null === maybeIterable || "object" !== typeof maybeIterable)
248
- return null;
249
- maybeIterable =
250
- (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) ||
251
- maybeIterable["@@iterator"];
252
- return "function" === typeof maybeIterable ? maybeIterable : null;
253
- }
254
- function noop$1() {}
255
- function trackUsedThenable(thenableState, thenable, index) {
256
- index = thenableState[index];
257
- void 0 === index
258
- ? thenableState.push(thenable)
259
- : index !== thenable &&
260
- (thenable.then(noop$1, noop$1), (thenable = index));
261
- switch (thenable.status) {
262
- case "fulfilled":
263
- return thenable.value;
264
- case "rejected":
265
- throw thenable.reason;
266
- default:
267
- "string" === typeof thenable.status
268
- ? thenable.then(noop$1, noop$1)
269
- : ((thenableState = thenable),
270
- (thenableState.status = "pending"),
271
- thenableState.then(
272
- function (fulfilledValue) {
273
- if ("pending" === thenable.status) {
274
- var fulfilledThenable = thenable;
275
- fulfilledThenable.status = "fulfilled";
276
- fulfilledThenable.value = fulfilledValue;
277
- }
278
- },
279
- function (error) {
280
- if ("pending" === thenable.status) {
281
- var rejectedThenable = thenable;
282
- rejectedThenable.status = "rejected";
283
- rejectedThenable.reason = error;
284
- }
285
- }
286
- ));
287
- switch (thenable.status) {
288
- case "fulfilled":
289
- return thenable.value;
290
- case "rejected":
291
- throw thenable.reason;
292
- }
293
- suspendedThenable = thenable;
294
- throw SuspenseException;
295
- }
296
- }
297
- function getSuspendedThenable() {
298
- if (null === suspendedThenable)
299
- throw Error(
300
- "Expected a suspended thenable. This is a bug in React. Please file an issue."
301
- );
302
- var thenable = suspendedThenable;
303
- suspendedThenable = null;
304
- return thenable;
305
- }
306
- function getThenableStateAfterSuspending() {
307
- var state = thenableState || [];
308
- state._componentDebugInfo = currentComponentDebugInfo;
309
- thenableState = currentComponentDebugInfo = null;
310
- return state;
311
- }
312
- function unsupportedHook() {
313
- throw Error("This Hook is not supported in Server Components.");
314
- }
315
- function unsupportedRefresh() {
316
- throw Error(
317
- "Refreshing the cache is not supported in Server Components."
318
- );
319
- }
320
- function unsupportedContext() {
321
- throw Error("Cannot read a Client Context from a Server Component.");
322
- }
323
- function resolveOwner() {
324
- return currentOwner ? currentOwner : null;
325
- }
326
- function resetOwnerStackLimit() {
327
- var now = getCurrentTime();
328
- 1e3 < now - lastResetTime &&
329
- ((ReactSharedInternalsServer.recentlyCreatedOwnerStacks = 0),
330
- (lastResetTime = now));
331
- }
332
- function isObjectPrototype(object) {
333
- if (!object) return !1;
334
- var ObjectPrototype = Object.prototype;
335
- if (object === ObjectPrototype) return !0;
336
- if (getPrototypeOf(object)) return !1;
337
- object = Object.getOwnPropertyNames(object);
338
- for (var i = 0; i < object.length; i++)
339
- if (!(object[i] in ObjectPrototype)) return !1;
340
- return !0;
341
- }
342
- function isSimpleObject(object) {
343
- if (!isObjectPrototype(getPrototypeOf(object))) return !1;
344
- for (
345
- var names = Object.getOwnPropertyNames(object), i = 0;
346
- i < names.length;
347
- i++
348
- ) {
349
- var descriptor = Object.getOwnPropertyDescriptor(object, names[i]);
350
- if (
351
- !descriptor ||
352
- (!descriptor.enumerable &&
353
- (("key" !== names[i] && "ref" !== names[i]) ||
354
- "function" !== typeof descriptor.get))
355
- )
356
- return !1;
357
- }
358
- return !0;
359
- }
360
- function objectName(object) {
361
- return Object.prototype.toString
362
- .call(object)
363
- .replace(/^\[object (.*)\]$/, function (m, p0) {
364
- return p0;
365
- });
366
- }
367
- function describeKeyForErrorMessage(key) {
368
- var encodedKey = JSON.stringify(key);
369
- return '"' + key + '"' === encodedKey ? key : encodedKey;
370
- }
371
- function describeValueForErrorMessage(value) {
372
- switch (typeof value) {
373
- case "string":
374
- return JSON.stringify(
375
- 10 >= value.length ? value : value.slice(0, 10) + "..."
376
- );
377
- case "object":
378
- if (isArrayImpl(value)) return "[...]";
379
- if (null !== value && value.$$typeof === CLIENT_REFERENCE_TAG)
380
- return "client";
381
- value = objectName(value);
382
- return "Object" === value ? "{...}" : value;
383
- case "function":
384
- return value.$$typeof === CLIENT_REFERENCE_TAG
385
- ? "client"
386
- : (value = value.displayName || value.name)
387
- ? "function " + value
388
- : "function";
389
- default:
390
- return String(value);
391
- }
392
- }
393
- function describeElementType(type) {
394
- if ("string" === typeof type) return type;
395
- switch (type) {
396
- case REACT_SUSPENSE_TYPE:
397
- return "Suspense";
398
- case REACT_SUSPENSE_LIST_TYPE:
399
- return "SuspenseList";
400
- }
401
- if ("object" === typeof type)
402
- switch (type.$$typeof) {
403
- case REACT_FORWARD_REF_TYPE:
404
- return describeElementType(type.render);
405
- case REACT_MEMO_TYPE:
406
- return describeElementType(type.type);
407
- case REACT_LAZY_TYPE:
408
- var payload = type._payload;
409
- type = type._init;
410
- try {
411
- return describeElementType(type(payload));
412
- } catch (x) {}
413
- }
414
- return "";
415
- }
416
- function describeObjectForErrorMessage(objectOrArray, expandedName) {
417
- var objKind = objectName(objectOrArray);
418
- if ("Object" !== objKind && "Array" !== objKind) return objKind;
419
- var start = -1,
420
- length = 0;
421
- if (isArrayImpl(objectOrArray))
422
- if (jsxChildrenParents.has(objectOrArray)) {
423
- var type = jsxChildrenParents.get(objectOrArray);
424
- objKind = "<" + describeElementType(type) + ">";
425
- for (var i = 0; i < objectOrArray.length; i++) {
426
- var value = objectOrArray[i];
427
- value =
428
- "string" === typeof value
429
- ? value
430
- : "object" === typeof value && null !== value
431
- ? "{" + describeObjectForErrorMessage(value) + "}"
432
- : "{" + describeValueForErrorMessage(value) + "}";
433
- "" + i === expandedName
434
- ? ((start = objKind.length),
435
- (length = value.length),
436
- (objKind += value))
437
- : (objKind =
438
- 15 > value.length && 40 > objKind.length + value.length
439
- ? objKind + value
440
- : objKind + "{...}");
441
- }
442
- objKind += "</" + describeElementType(type) + ">";
443
- } else {
444
- objKind = "[";
445
- for (type = 0; type < objectOrArray.length; type++)
446
- 0 < type && (objKind += ", "),
447
- (i = objectOrArray[type]),
448
- (i =
449
- "object" === typeof i && null !== i
450
- ? describeObjectForErrorMessage(i)
451
- : describeValueForErrorMessage(i)),
452
- "" + type === expandedName
453
- ? ((start = objKind.length),
454
- (length = i.length),
455
- (objKind += i))
456
- : (objKind =
457
- 10 > i.length && 40 > objKind.length + i.length
458
- ? objKind + i
459
- : objKind + "...");
460
- objKind += "]";
461
- }
462
- else if (objectOrArray.$$typeof === REACT_ELEMENT_TYPE)
463
- objKind = "<" + describeElementType(objectOrArray.type) + "/>";
464
- else {
465
- if (objectOrArray.$$typeof === CLIENT_REFERENCE_TAG) return "client";
466
- if (jsxPropsParents.has(objectOrArray)) {
467
- objKind = jsxPropsParents.get(objectOrArray);
468
- objKind = "<" + (describeElementType(objKind) || "...");
469
- type = Object.keys(objectOrArray);
470
- for (i = 0; i < type.length; i++) {
471
- objKind += " ";
472
- value = type[i];
473
- objKind += describeKeyForErrorMessage(value) + "=";
474
- var _value2 = objectOrArray[value];
475
- var _substr2 =
476
- value === expandedName &&
477
- "object" === typeof _value2 &&
478
- null !== _value2
479
- ? describeObjectForErrorMessage(_value2)
480
- : describeValueForErrorMessage(_value2);
481
- "string" !== typeof _value2 && (_substr2 = "{" + _substr2 + "}");
482
- value === expandedName
483
- ? ((start = objKind.length),
484
- (length = _substr2.length),
485
- (objKind += _substr2))
486
- : (objKind =
487
- 10 > _substr2.length && 40 > objKind.length + _substr2.length
488
- ? objKind + _substr2
489
- : objKind + "...");
490
- }
491
- objKind += ">";
492
- } else {
493
- objKind = "{";
494
- type = Object.keys(objectOrArray);
495
- for (i = 0; i < type.length; i++)
496
- 0 < i && (objKind += ", "),
497
- (value = type[i]),
498
- (objKind += describeKeyForErrorMessage(value) + ": "),
499
- (_value2 = objectOrArray[value]),
500
- (_value2 =
501
- "object" === typeof _value2 && null !== _value2
502
- ? describeObjectForErrorMessage(_value2)
503
- : describeValueForErrorMessage(_value2)),
504
- value === expandedName
505
- ? ((start = objKind.length),
506
- (length = _value2.length),
507
- (objKind += _value2))
508
- : (objKind =
509
- 10 > _value2.length && 40 > objKind.length + _value2.length
510
- ? objKind + _value2
511
- : objKind + "...");
512
- objKind += "}";
513
- }
514
- }
515
- return void 0 === expandedName
516
- ? objKind
517
- : -1 < start && 0 < length
518
- ? ((objectOrArray = " ".repeat(start) + "^".repeat(length)),
519
- "\n " + objKind + "\n " + objectOrArray)
520
- : "\n " + objKind;
521
- }
522
- function defaultFilterStackFrame(filename) {
523
- return (
524
- "" !== filename &&
525
- !filename.startsWith("node:") &&
526
- !filename.includes("node_modules")
527
- );
528
- }
529
- function filterStackTrace(request, error, skipFrames) {
530
- request = request.filterStackFrame;
531
- error = parseStackTrace(error, skipFrames);
532
- for (skipFrames = 0; skipFrames < error.length; skipFrames++) {
533
- var callsite = error[skipFrames],
534
- functionName = callsite[0],
535
- url = callsite[1];
536
- if (url.startsWith("rsc://React/")) {
537
- var envIdx = url.indexOf("/", 12),
538
- suffixIdx = url.lastIndexOf("?");
539
- -1 < envIdx &&
540
- -1 < suffixIdx &&
541
- (url = callsite[1] = url.slice(envIdx + 1, suffixIdx));
542
- }
543
- request(url, functionName) ||
544
- (error.splice(skipFrames, 1), skipFrames--);
545
- }
546
- return error;
547
- }
548
- function patchConsole(consoleInst, methodName) {
549
- var descriptor = Object.getOwnPropertyDescriptor(consoleInst, methodName);
550
- if (
551
- descriptor &&
552
- (descriptor.configurable || descriptor.writable) &&
553
- "function" === typeof descriptor.value
554
- ) {
555
- var originalMethod = descriptor.value;
556
- descriptor = Object.getOwnPropertyDescriptor(originalMethod, "name");
557
- var wrapperMethod = function () {
558
- var request = currentRequest ? currentRequest : null;
559
- if (("assert" !== methodName || !arguments[0]) && null !== request) {
560
- var stack = filterStackTrace(
561
- request,
562
- Error("react-stack-top-frame"),
563
- 1
564
- );
565
- request.pendingChunks++;
566
- var owner = resolveOwner();
567
- emitConsoleChunk(request, methodName, owner, stack, arguments);
568
- }
569
- return originalMethod.apply(this, arguments);
570
- };
571
- descriptor && Object.defineProperty(wrapperMethod, "name", descriptor);
572
- Object.defineProperty(consoleInst, methodName, {
573
- value: wrapperMethod
574
- });
575
- }
576
- }
577
- function getCurrentStackInDEV() {
578
- var owner = resolveOwner();
579
- if (null === owner) return "";
580
- try {
581
- var info = "";
582
- if (owner.owner || "string" !== typeof owner.name) {
583
- for (; owner; ) {
584
- var ownerStack = owner.debugStack;
585
- if (null != ownerStack) {
586
- if ((owner = owner.owner)) {
587
- var JSCompiler_temp_const = info;
588
- var error = ownerStack,
589
- prevPrepareStackTrace = Error.prepareStackTrace;
590
- Error.prepareStackTrace = void 0;
591
- var stack = error.stack;
592
- Error.prepareStackTrace = prevPrepareStackTrace;
593
- stack.startsWith("Error: react-stack-top-frame\n") &&
594
- (stack = stack.slice(29));
595
- var idx = stack.indexOf("\n");
596
- -1 !== idx && (stack = stack.slice(idx + 1));
597
- idx = stack.indexOf("react-stack-bottom-frame");
598
- -1 !== idx && (idx = stack.lastIndexOf("\n", idx));
599
- var JSCompiler_inline_result =
600
- -1 !== idx ? (stack = stack.slice(0, idx)) : "";
601
- info =
602
- JSCompiler_temp_const + ("\n" + JSCompiler_inline_result);
603
- }
604
- } else break;
605
- }
606
- var JSCompiler_inline_result$jscomp$0 = info;
607
- } else {
608
- JSCompiler_temp_const = owner.name;
609
- if (void 0 === prefix)
610
- try {
611
- throw Error();
612
- } catch (x) {
613
- (prefix =
614
- ((error = x.stack.trim().match(/\n( *(at )?)/)) && error[1]) ||
615
- ""),
616
- (suffix =
617
- -1 < x.stack.indexOf("\n at")
618
- ? " (<anonymous>)"
619
- : -1 < x.stack.indexOf("@")
620
- ? "@unknown:0:0"
621
- : "");
622
- }
623
- JSCompiler_inline_result$jscomp$0 =
624
- "\n" + prefix + JSCompiler_temp_const + suffix;
625
- }
626
- } catch (x) {
627
- JSCompiler_inline_result$jscomp$0 =
628
- "\nError generating stack: " + x.message + "\n" + x.stack;
629
- }
630
- return JSCompiler_inline_result$jscomp$0;
631
- }
632
- function defaultErrorHandler(error) {
633
- console.error(error);
634
- }
635
- function defaultPostponeHandler() {}
636
- function RequestInstance(
637
- type,
638
- model,
639
- bundlerConfig,
640
- onError,
641
- identifierPrefix,
642
- onPostpone,
643
- temporaryReferences,
644
- environmentName,
645
- filterStackFrame,
646
- onAllReady,
647
- onFatalError
648
- ) {
649
- if (
650
- null !== ReactSharedInternalsServer.A &&
651
- ReactSharedInternalsServer.A !== DefaultAsyncDispatcher
652
- )
653
- throw Error(
654
- "Currently React only supports one RSC renderer at a time."
655
- );
656
- ReactSharedInternalsServer.A = DefaultAsyncDispatcher;
657
- ReactSharedInternalsServer.getCurrentStack = getCurrentStackInDEV;
658
- var abortSet = new Set(),
659
- pingedTasks = [],
660
- hints = new Set();
661
- this.type = type;
662
- this.status = OPENING;
663
- this.flushScheduled = !1;
664
- this.destination = this.fatalError = null;
665
- this.bundlerConfig = bundlerConfig;
666
- this.cache = new Map();
667
- this.pendingChunks = this.nextChunkId = 0;
668
- this.hints = hints;
669
- this.abortListeners = new Set();
670
- this.abortableTasks = abortSet;
671
- this.pingedTasks = pingedTasks;
672
- this.completedImportChunks = [];
673
- this.completedHintChunks = [];
674
- this.completedRegularChunks = [];
675
- this.completedErrorChunks = [];
676
- this.writtenSymbols = new Map();
677
- this.writtenClientReferences = new Map();
678
- this.writtenServerReferences = new Map();
679
- this.writtenObjects = new WeakMap();
680
- this.temporaryReferences = temporaryReferences;
681
- this.identifierPrefix = identifierPrefix || "";
682
- this.identifierCount = 1;
683
- this.taintCleanupQueue = [];
684
- this.onError = void 0 === onError ? defaultErrorHandler : onError;
685
- this.onPostpone =
686
- void 0 === onPostpone ? defaultPostponeHandler : onPostpone;
687
- this.onAllReady = onAllReady;
688
- this.onFatalError = onFatalError;
689
- this.environmentName =
690
- void 0 === environmentName
691
- ? function () {
692
- return "Server";
693
- }
694
- : "function" !== typeof environmentName
695
- ? function () {
696
- return environmentName;
697
- }
698
- : environmentName;
699
- this.filterStackFrame =
700
- void 0 === filterStackFrame
701
- ? defaultFilterStackFrame
702
- : filterStackFrame;
703
- this.didWarnForKey = null;
704
- type = createTask(this, model, null, !1, abortSet, null, null, null);
705
- pingedTasks.push(type);
706
- }
707
- function noop() {}
708
- function createRequest(
709
- model,
710
- bundlerConfig,
711
- onError,
712
- identifierPrefix,
713
- onPostpone,
714
- temporaryReferences,
715
- environmentName,
716
- filterStackFrame
717
- ) {
718
- resetOwnerStackLimit();
719
- return new RequestInstance(
720
- 20,
721
- model,
722
- bundlerConfig,
723
- onError,
724
- identifierPrefix,
725
- onPostpone,
726
- temporaryReferences,
727
- environmentName,
728
- filterStackFrame,
729
- noop,
730
- noop
731
- );
732
- }
733
- function createPrerenderRequest(
734
- model,
735
- bundlerConfig,
736
- onAllReady,
737
- onFatalError,
738
- onError,
739
- identifierPrefix,
740
- onPostpone,
741
- temporaryReferences,
742
- environmentName,
743
- filterStackFrame
744
- ) {
745
- resetOwnerStackLimit();
746
- return new RequestInstance(
747
- PRERENDER,
748
- model,
749
- bundlerConfig,
750
- onError,
751
- identifierPrefix,
752
- onPostpone,
753
- temporaryReferences,
754
- environmentName,
755
- filterStackFrame,
756
- onAllReady,
757
- onFatalError
758
- );
759
- }
760
- function serializeThenable(request, task, thenable) {
761
- var newTask = createTask(
762
- request,
763
- null,
764
- task.keyPath,
765
- task.implicitSlot,
766
- request.abortableTasks,
767
- task.debugOwner,
768
- task.debugStack,
769
- task.debugTask
770
- );
771
- (task = thenable._debugInfo) &&
772
- forwardDebugInfo(request, newTask.id, task);
773
- switch (thenable.status) {
774
- case "fulfilled":
775
- return (
776
- (newTask.model = thenable.value),
777
- pingTask(request, newTask),
778
- newTask.id
779
- );
780
- case "rejected":
781
- return erroredTask(request, newTask, thenable.reason), newTask.id;
782
- default:
783
- if (request.status === ABORTING)
784
- return (
785
- request.abortableTasks.delete(newTask),
786
- (newTask.status = ABORTED),
787
- (task = stringify(serializeByValueID(request.fatalError))),
788
- emitModelChunk(request, newTask.id, task),
789
- newTask.id
790
- );
791
- "string" !== typeof thenable.status &&
792
- ((thenable.status = "pending"),
793
- thenable.then(
794
- function (fulfilledValue) {
795
- "pending" === thenable.status &&
796
- ((thenable.status = "fulfilled"),
797
- (thenable.value = fulfilledValue));
798
- },
799
- function (error) {
800
- "pending" === thenable.status &&
801
- ((thenable.status = "rejected"), (thenable.reason = error));
802
- }
803
- ));
804
- }
805
- thenable.then(
806
- function (value) {
807
- newTask.model = value;
808
- pingTask(request, newTask);
809
- },
810
- function (reason) {
811
- newTask.status === PENDING$1 &&
812
- (erroredTask(request, newTask, reason), enqueueFlush(request));
813
- }
814
- );
815
- return newTask.id;
816
- }
817
- function serializeReadableStream(request, task, stream) {
818
- function progress(entry) {
819
- if (!aborted)
820
- if (entry.done)
821
- request.abortListeners.delete(abortStream),
822
- (entry = streamTask.id.toString(16) + ":C\n"),
823
- request.completedRegularChunks.push(stringToChunk(entry)),
824
- enqueueFlush(request),
825
- (aborted = !0);
826
- else
827
- try {
828
- (streamTask.model = entry.value),
829
- request.pendingChunks++,
830
- tryStreamTask(request, streamTask),
831
- enqueueFlush(request),
832
- reader.read().then(progress, error);
833
- } catch (x$0) {
834
- error(x$0);
835
- }
836
- }
837
- function error(reason) {
838
- aborted ||
839
- ((aborted = !0),
840
- request.abortListeners.delete(abortStream),
841
- erroredTask(request, streamTask, reason),
842
- enqueueFlush(request),
843
- reader.cancel(reason).then(error, error));
844
- }
845
- function abortStream(reason) {
846
- aborted ||
847
- ((aborted = !0),
848
- request.abortListeners.delete(abortStream),
849
- erroredTask(request, streamTask, reason),
850
- enqueueFlush(request),
851
- reader.cancel(reason).then(error, error));
852
- }
853
- var supportsBYOB = stream.supportsBYOB;
854
- if (void 0 === supportsBYOB)
855
- try {
856
- stream.getReader({ mode: "byob" }).releaseLock(), (supportsBYOB = !0);
857
- } catch (x) {
858
- supportsBYOB = !1;
859
- }
860
- var reader = stream.getReader(),
861
- streamTask = createTask(
862
- request,
863
- task.model,
864
- task.keyPath,
865
- task.implicitSlot,
866
- request.abortableTasks,
867
- task.debugOwner,
868
- task.debugStack,
869
- task.debugTask
870
- );
871
- request.abortableTasks.delete(streamTask);
872
- request.pendingChunks++;
873
- task =
874
- streamTask.id.toString(16) + ":" + (supportsBYOB ? "r" : "R") + "\n";
875
- request.completedRegularChunks.push(stringToChunk(task));
876
- var aborted = !1;
877
- request.abortListeners.add(abortStream);
878
- reader.read().then(progress, error);
879
- return serializeByValueID(streamTask.id);
880
- }
881
- function serializeAsyncIterable(request, task, iterable, iterator) {
882
- function progress(entry) {
883
- if (!aborted)
884
- if (entry.done) {
885
- request.abortListeners.delete(abortIterable);
886
- if (void 0 === entry.value)
887
- var endStreamRow = streamTask.id.toString(16) + ":C\n";
888
- else
889
- try {
890
- var chunkId = outlineModel(request, entry.value);
891
- endStreamRow =
892
- streamTask.id.toString(16) +
893
- ":C" +
894
- stringify(serializeByValueID(chunkId)) +
895
- "\n";
896
- } catch (x) {
897
- error(x);
898
- return;
899
- }
900
- request.completedRegularChunks.push(stringToChunk(endStreamRow));
901
- enqueueFlush(request);
902
- aborted = !0;
903
- } else
904
- try {
905
- (streamTask.model = entry.value),
906
- request.pendingChunks++,
907
- tryStreamTask(request, streamTask),
908
- enqueueFlush(request),
909
- callIteratorInDEV(iterator, progress, error);
910
- } catch (x$1) {
911
- error(x$1);
912
- }
913
- }
914
- function error(reason) {
915
- aborted ||
916
- ((aborted = !0),
917
- request.abortListeners.delete(abortIterable),
918
- erroredTask(request, streamTask, reason),
919
- enqueueFlush(request),
920
- "function" === typeof iterator.throw &&
921
- iterator.throw(reason).then(error, error));
922
- }
923
- function abortIterable(reason) {
924
- aborted ||
925
- ((aborted = !0),
926
- request.abortListeners.delete(abortIterable),
927
- erroredTask(request, streamTask, reason),
928
- enqueueFlush(request),
929
- "function" === typeof iterator.throw &&
930
- iterator.throw(reason).then(error, error));
931
- }
932
- var isIterator = iterable === iterator,
933
- streamTask = createTask(
934
- request,
935
- task.model,
936
- task.keyPath,
937
- task.implicitSlot,
938
- request.abortableTasks,
939
- task.debugOwner,
940
- task.debugStack,
941
- task.debugTask
942
- );
943
- request.abortableTasks.delete(streamTask);
944
- request.pendingChunks++;
945
- task = streamTask.id.toString(16) + ":" + (isIterator ? "x" : "X") + "\n";
946
- request.completedRegularChunks.push(stringToChunk(task));
947
- (iterable = iterable._debugInfo) &&
948
- forwardDebugInfo(request, streamTask.id, iterable);
949
- var aborted = !1;
950
- request.abortListeners.add(abortIterable);
951
- callIteratorInDEV(iterator, progress, error);
952
- return serializeByValueID(streamTask.id);
953
- }
954
- function emitHint(request, code, model) {
955
- model = stringify(model);
956
- code = stringToChunk(":H" + code + model + "\n");
957
- request.completedHintChunks.push(code);
958
- enqueueFlush(request);
959
- }
960
- function readThenable(thenable) {
961
- if ("fulfilled" === thenable.status) return thenable.value;
962
- if ("rejected" === thenable.status) throw thenable.reason;
963
- throw thenable;
964
- }
965
- function createLazyWrapperAroundWakeable(wakeable) {
966
- switch (wakeable.status) {
967
- case "fulfilled":
968
- case "rejected":
969
- break;
970
- default:
971
- "string" !== typeof wakeable.status &&
972
- ((wakeable.status = "pending"),
973
- wakeable.then(
974
- function (fulfilledValue) {
975
- "pending" === wakeable.status &&
976
- ((wakeable.status = "fulfilled"),
977
- (wakeable.value = fulfilledValue));
978
- },
979
- function (error) {
980
- "pending" === wakeable.status &&
981
- ((wakeable.status = "rejected"), (wakeable.reason = error));
982
- }
983
- ));
984
- }
985
- var lazyType = {
986
- $$typeof: REACT_LAZY_TYPE,
987
- _payload: wakeable,
988
- _init: readThenable
989
- };
990
- lazyType._debugInfo = wakeable._debugInfo || [];
991
- return lazyType;
992
- }
993
- function callWithDebugContextInDEV(request, task, callback, arg) {
994
- var componentDebugInfo = {
995
- name: "",
996
- env: task.environmentName,
997
- key: null,
998
- owner: task.debugOwner
999
- };
1000
- componentDebugInfo.stack =
1001
- null === task.debugStack
1002
- ? null
1003
- : filterStackTrace(request, task.debugStack, 1);
1004
- componentDebugInfo.debugStack = task.debugStack;
1005
- request = componentDebugInfo.debugTask = task.debugTask;
1006
- currentOwner = componentDebugInfo;
1007
- try {
1008
- return request ? request.run(callback.bind(null, arg)) : callback(arg);
1009
- } finally {
1010
- currentOwner = null;
1011
- }
1012
- }
1013
- function processServerComponentReturnValue(
1014
- request,
1015
- task,
1016
- Component,
1017
- result
1018
- ) {
1019
- if (
1020
- "object" !== typeof result ||
1021
- null === result ||
1022
- isClientReference(result)
1023
- )
1024
- return result;
1025
- if ("function" === typeof result.then)
1026
- return (
1027
- result.then(function (resolvedValue) {
1028
- "object" === typeof resolvedValue &&
1029
- null !== resolvedValue &&
1030
- resolvedValue.$$typeof === REACT_ELEMENT_TYPE &&
1031
- (resolvedValue._store.validated = 1);
1032
- }, voidHandler),
1033
- "fulfilled" === result.status
1034
- ? result.value
1035
- : createLazyWrapperAroundWakeable(result)
1036
- );
1037
- result.$$typeof === REACT_ELEMENT_TYPE && (result._store.validated = 1);
1038
- var iteratorFn = getIteratorFn(result);
1039
- if (iteratorFn) {
1040
- var multiShot = _defineProperty({}, Symbol.iterator, function () {
1041
- var iterator = iteratorFn.call(result);
1042
- iterator !== result ||
1043
- ("[object GeneratorFunction]" ===
1044
- Object.prototype.toString.call(Component) &&
1045
- "[object Generator]" ===
1046
- Object.prototype.toString.call(result)) ||
1047
- callWithDebugContextInDEV(request, task, function () {
1048
- console.error(
1049
- "Returning an Iterator from a Server Component is not supported since it cannot be looped over more than once. "
1050
- );
1051
- });
1052
- return iterator;
1053
- });
1054
- multiShot._debugInfo = result._debugInfo;
1055
- return multiShot;
1056
- }
1057
- return "function" !== typeof result[ASYNC_ITERATOR] ||
1058
- ("function" === typeof ReadableStream &&
1059
- result instanceof ReadableStream)
1060
- ? result
1061
- : ((multiShot = _defineProperty({}, ASYNC_ITERATOR, function () {
1062
- var iterator = result[ASYNC_ITERATOR]();
1063
- iterator !== result ||
1064
- ("[object AsyncGeneratorFunction]" ===
1065
- Object.prototype.toString.call(Component) &&
1066
- "[object AsyncGenerator]" ===
1067
- Object.prototype.toString.call(result)) ||
1068
- callWithDebugContextInDEV(request, task, function () {
1069
- console.error(
1070
- "Returning an AsyncIterator from a Server Component is not supported since it cannot be looped over more than once. "
1071
- );
1072
- });
1073
- return iterator;
1074
- })),
1075
- (multiShot._debugInfo = result._debugInfo),
1076
- multiShot);
1077
- }
1078
- function renderFunctionComponent(
1079
- request,
1080
- task,
1081
- key,
1082
- Component,
1083
- props,
1084
- validated
1085
- ) {
1086
- var prevThenableState = task.thenableState;
1087
- task.thenableState = null;
1088
- if (null === debugID) return outlineTask(request, task);
1089
- if (null !== prevThenableState)
1090
- var componentDebugInfo = prevThenableState._componentDebugInfo;
1091
- else {
1092
- var componentDebugID = debugID;
1093
- componentDebugInfo = Component.displayName || Component.name || "";
1094
- var componentEnv = (0, request.environmentName)();
1095
- request.pendingChunks++;
1096
- componentDebugInfo = {
1097
- name: componentDebugInfo,
1098
- env: componentEnv,
1099
- key: key,
1100
- owner: task.debugOwner
1101
- };
1102
- componentDebugInfo.stack =
1103
- null === task.debugStack
1104
- ? null
1105
- : filterStackTrace(request, task.debugStack, 1);
1106
- componentDebugInfo.props = props;
1107
- componentDebugInfo.debugStack = task.debugStack;
1108
- componentDebugInfo.debugTask = task.debugTask;
1109
- outlineComponentInfo(request, componentDebugInfo);
1110
- emitDebugChunk(request, componentDebugID, componentDebugInfo);
1111
- task.environmentName = componentEnv;
1112
- 2 === validated &&
1113
- warnForMissingKey(request, key, componentDebugInfo, task.debugTask);
1114
- }
1115
- thenableIndexCounter = 0;
1116
- thenableState = prevThenableState;
1117
- currentComponentDebugInfo = componentDebugInfo;
1118
- props = task.debugTask
1119
- ? task.debugTask.run(
1120
- callComponentInDEV.bind(null, Component, props, componentDebugInfo)
1121
- )
1122
- : callComponentInDEV(Component, props, componentDebugInfo);
1123
- if (request.status === ABORTING)
1124
- throw (
1125
- ("object" !== typeof props ||
1126
- null === props ||
1127
- "function" !== typeof props.then ||
1128
- isClientReference(props) ||
1129
- props.then(voidHandler, voidHandler),
1130
- null)
1131
- );
1132
- props = processServerComponentReturnValue(
1133
- request,
1134
- task,
1135
- Component,
1136
- props
1137
- );
1138
- Component = task.keyPath;
1139
- validated = task.implicitSlot;
1140
- null !== key
1141
- ? (task.keyPath = null === Component ? key : Component + "," + key)
1142
- : null === Component && (task.implicitSlot = !0);
1143
- request = renderModelDestructive(request, task, emptyRoot, "", props);
1144
- task.keyPath = Component;
1145
- task.implicitSlot = validated;
1146
- return request;
1147
- }
1148
- function warnForMissingKey(request, key, componentDebugInfo, debugTask) {
1149
- function logKeyError() {
1150
- console.error(
1151
- 'Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',
1152
- "",
1153
- ""
1154
- );
1155
- }
1156
- key = request.didWarnForKey;
1157
- null == key && (key = request.didWarnForKey = new WeakSet());
1158
- request = componentDebugInfo.owner;
1159
- if (null != request) {
1160
- if (key.has(request)) return;
1161
- key.add(request);
1162
- }
1163
- debugTask
1164
- ? debugTask.run(
1165
- callComponentInDEV.bind(null, logKeyError, null, componentDebugInfo)
1166
- )
1167
- : callComponentInDEV(logKeyError, null, componentDebugInfo);
1168
- }
1169
- function renderFragment(request, task, children) {
1170
- for (var i = 0; i < children.length; i++) {
1171
- var child = children[i];
1172
- null === child ||
1173
- "object" !== typeof child ||
1174
- child.$$typeof !== REACT_ELEMENT_TYPE ||
1175
- null !== child.key ||
1176
- child._store.validated ||
1177
- (child._store.validated = 2);
1178
- }
1179
- if (null !== task.keyPath)
1180
- return (
1181
- (request = [
1182
- REACT_ELEMENT_TYPE,
1183
- REACT_FRAGMENT_TYPE,
1184
- task.keyPath,
1185
- { children: children },
1186
- null,
1187
- null,
1188
- 0
1189
- ]),
1190
- task.implicitSlot ? [request] : request
1191
- );
1192
- if ((i = children._debugInfo)) {
1193
- if (null === debugID) return outlineTask(request, task);
1194
- forwardDebugInfo(request, debugID, i);
1195
- children = Array.from(children);
1196
- }
1197
- return children;
1198
- }
1199
- function renderAsyncFragment(request, task, children, getAsyncIterator) {
1200
- if (null !== task.keyPath)
1201
- return (
1202
- (request = [
1203
- REACT_ELEMENT_TYPE,
1204
- REACT_FRAGMENT_TYPE,
1205
- task.keyPath,
1206
- { children: children },
1207
- null,
1208
- null,
1209
- 0
1210
- ]),
1211
- task.implicitSlot ? [request] : request
1212
- );
1213
- getAsyncIterator = getAsyncIterator.call(children);
1214
- return serializeAsyncIterable(request, task, children, getAsyncIterator);
1215
- }
1216
- function outlineTask(request, task) {
1217
- task = createTask(
1218
- request,
1219
- task.model,
1220
- task.keyPath,
1221
- task.implicitSlot,
1222
- request.abortableTasks,
1223
- task.debugOwner,
1224
- task.debugStack,
1225
- task.debugTask
1226
- );
1227
- retryTask(request, task);
1228
- return task.status === COMPLETED
1229
- ? serializeByValueID(task.id)
1230
- : "$L" + task.id.toString(16);
1231
- }
1232
- function renderElement(request, task, type, key, ref, props, validated) {
1233
- if (null !== ref && void 0 !== ref)
1234
- throw Error(
1235
- "Refs cannot be used in Server Components, nor passed to Client Components."
1236
- );
1237
- jsxPropsParents.set(props, type);
1238
- "object" === typeof props.children &&
1239
- null !== props.children &&
1240
- jsxChildrenParents.set(props.children, type);
1241
- if (
1242
- "function" !== typeof type ||
1243
- isClientReference(type) ||
1244
- type.$$typeof === TEMPORARY_REFERENCE_TAG
1245
- ) {
1246
- if (type === REACT_FRAGMENT_TYPE && null === key)
1247
- return (
1248
- 2 === validated &&
1249
- ((validated = {
1250
- name: "Fragment",
1251
- env: (0, request.environmentName)(),
1252
- key: key,
1253
- owner: task.debugOwner,
1254
- stack:
1255
- null === task.debugStack
1256
- ? null
1257
- : filterStackTrace(request, task.debugStack, 1),
1258
- props: props,
1259
- debugStack: task.debugStack,
1260
- debugTask: task.debugTask
1261
- }),
1262
- warnForMissingKey(request, key, validated, task.debugTask)),
1263
- (validated = task.implicitSlot),
1264
- null === task.keyPath && (task.implicitSlot = !0),
1265
- (request = renderModelDestructive(
1266
- request,
1267
- task,
1268
- emptyRoot,
1269
- "",
1270
- props.children
1271
- )),
1272
- (task.implicitSlot = validated),
1273
- request
1274
- );
1275
- if (
1276
- null != type &&
1277
- "object" === typeof type &&
1278
- !isClientReference(type)
1279
- )
1280
- switch (type.$$typeof) {
1281
- case REACT_LAZY_TYPE:
1282
- type = callLazyInitInDEV(type);
1283
- if (request.status === ABORTING) throw null;
1284
- return renderElement(
1285
- request,
1286
- task,
1287
- type,
1288
- key,
1289
- ref,
1290
- props,
1291
- validated
1292
- );
1293
- case REACT_FORWARD_REF_TYPE:
1294
- return renderFunctionComponent(
1295
- request,
1296
- task,
1297
- key,
1298
- type.render,
1299
- props,
1300
- validated
1301
- );
1302
- case REACT_MEMO_TYPE:
1303
- return renderElement(
1304
- request,
1305
- task,
1306
- type.type,
1307
- key,
1308
- ref,
1309
- props,
1310
- validated
1311
- );
1312
- case REACT_ELEMENT_TYPE:
1313
- type._store.validated = 1;
1314
- }
1315
- } else
1316
- return renderFunctionComponent(
1317
- request,
1318
- task,
1319
- key,
1320
- type,
1321
- props,
1322
- validated
1323
- );
1324
- ref = task.keyPath;
1325
- null === key ? (key = ref) : null !== ref && (key = ref + "," + key);
1326
- null !== task.debugOwner &&
1327
- outlineComponentInfo(request, task.debugOwner);
1328
- request = [
1329
- REACT_ELEMENT_TYPE,
1330
- type,
1331
- key,
1332
- props,
1333
- task.debugOwner,
1334
- null === task.debugStack
1335
- ? null
1336
- : filterStackTrace(request, task.debugStack, 1),
1337
- validated
1338
- ];
1339
- task = task.implicitSlot && null !== key ? [request] : request;
1340
- return task;
1341
- }
1342
- function pingTask(request, task) {
1343
- var pingedTasks = request.pingedTasks;
1344
- pingedTasks.push(task);
1345
- 1 === pingedTasks.length &&
1346
- ((request.flushScheduled = null !== request.destination),
1347
- request.type === PRERENDER || request.status === OPENING
1348
- ? scheduleMicrotask(function () {
1349
- return performWork(request);
1350
- })
1351
- : scheduleWork(function () {
1352
- return performWork(request);
1353
- }));
1354
- }
1355
- function createTask(
1356
- request,
1357
- model,
1358
- keyPath,
1359
- implicitSlot,
1360
- abortSet,
1361
- debugOwner,
1362
- debugStack,
1363
- debugTask
1364
- ) {
1365
- request.pendingChunks++;
1366
- var id = request.nextChunkId++;
1367
- "object" !== typeof model ||
1368
- null === model ||
1369
- null !== keyPath ||
1370
- implicitSlot ||
1371
- request.writtenObjects.set(model, serializeByValueID(id));
1372
- var task = {
1373
- id: id,
1374
- status: PENDING$1,
1375
- model: model,
1376
- keyPath: keyPath,
1377
- implicitSlot: implicitSlot,
1378
- ping: function () {
1379
- return pingTask(request, task);
1380
- },
1381
- toJSON: function (parentPropertyName, value) {
1382
- var parent = this,
1383
- originalValue = parent[parentPropertyName];
1384
- "object" !== typeof originalValue ||
1385
- originalValue === value ||
1386
- originalValue instanceof Date ||
1387
- callWithDebugContextInDEV(request, task, function () {
1388
- "Object" !== objectName(originalValue)
1389
- ? "string" === typeof jsxChildrenParents.get(parent)
1390
- ? console.error(
1391
- "%s objects cannot be rendered as text children. Try formatting it using toString().%s",
1392
- objectName(originalValue),
1393
- describeObjectForErrorMessage(parent, parentPropertyName)
1394
- )
1395
- : console.error(
1396
- "Only plain objects can be passed to Client Components from Server Components. %s objects are not supported.%s",
1397
- objectName(originalValue),
1398
- describeObjectForErrorMessage(parent, parentPropertyName)
1399
- )
1400
- : console.error(
1401
- "Only plain objects can be passed to Client Components from Server Components. Objects with toJSON methods are not supported. Convert it manually to a simple value before passing it to props.%s",
1402
- describeObjectForErrorMessage(parent, parentPropertyName)
1403
- );
1404
- });
1405
- return renderModel(request, task, parent, parentPropertyName, value);
1406
- },
1407
- thenableState: null
1408
- };
1409
- task.environmentName = request.environmentName();
1410
- task.debugOwner = debugOwner;
1411
- task.debugStack = debugStack;
1412
- task.debugTask = debugTask;
1413
- abortSet.add(task);
1414
- return task;
1415
- }
1416
- function serializeByValueID(id) {
1417
- return "$" + id.toString(16);
1418
- }
1419
- function serializeNumber(number) {
1420
- return Number.isFinite(number)
1421
- ? 0 === number && -Infinity === 1 / number
1422
- ? "$-0"
1423
- : number
1424
- : Infinity === number
1425
- ? "$Infinity"
1426
- : -Infinity === number
1427
- ? "$-Infinity"
1428
- : "$NaN";
1429
- }
1430
- function encodeReferenceChunk(request, id, reference) {
1431
- request = stringify(reference);
1432
- id = id.toString(16) + ":" + request + "\n";
1433
- return stringToChunk(id);
1434
- }
1435
- function serializeClientReference(
1436
- request,
1437
- parent,
1438
- parentPropertyName,
1439
- clientReference
1440
- ) {
1441
- var clientReferenceKey = clientReference.$$async
1442
- ? clientReference.$$id + "#async"
1443
- : clientReference.$$id,
1444
- writtenClientReferences = request.writtenClientReferences,
1445
- existingId = writtenClientReferences.get(clientReferenceKey);
1446
- if (void 0 !== existingId)
1447
- return parent[0] === REACT_ELEMENT_TYPE && "1" === parentPropertyName
1448
- ? "$L" + existingId.toString(16)
1449
- : serializeByValueID(existingId);
1450
- try {
1451
- var config = request.bundlerConfig,
1452
- modulePath = clientReference.$$id;
1453
- existingId = "";
1454
- var resolvedModuleData = config[modulePath];
1455
- if (resolvedModuleData) existingId = resolvedModuleData.name;
1456
- else {
1457
- var idx = modulePath.lastIndexOf("#");
1458
- -1 !== idx &&
1459
- ((existingId = modulePath.slice(idx + 1)),
1460
- (resolvedModuleData = config[modulePath.slice(0, idx)]));
1461
- if (!resolvedModuleData)
1462
- throw Error(
1463
- 'Could not find the module "' +
1464
- modulePath +
1465
- '" in the React Client Manifest. This is probably a bug in the React Server Components bundler.'
1466
- );
1467
- }
1468
- if (!0 === resolvedModuleData.async && !0 === clientReference.$$async)
1469
- throw Error(
1470
- 'The module "' +
1471
- modulePath +
1472
- '" 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.'
1473
- );
1474
- var clientReferenceMetadata =
1475
- !0 === resolvedModuleData.async || !0 === clientReference.$$async
1476
- ? [resolvedModuleData.id, resolvedModuleData.chunks, existingId, 1]
1477
- : [resolvedModuleData.id, resolvedModuleData.chunks, existingId];
1478
- request.pendingChunks++;
1479
- var importId = request.nextChunkId++,
1480
- json = stringify(clientReferenceMetadata),
1481
- row = importId.toString(16) + ":I" + json + "\n",
1482
- processedChunk = stringToChunk(row);
1483
- request.completedImportChunks.push(processedChunk);
1484
- writtenClientReferences.set(clientReferenceKey, importId);
1485
- return parent[0] === REACT_ELEMENT_TYPE && "1" === parentPropertyName
1486
- ? "$L" + importId.toString(16)
1487
- : serializeByValueID(importId);
1488
- } catch (x) {
1489
- return (
1490
- request.pendingChunks++,
1491
- (parent = request.nextChunkId++),
1492
- (parentPropertyName = logRecoverableError(request, x, null)),
1493
- emitErrorChunk(request, parent, parentPropertyName, x),
1494
- serializeByValueID(parent)
1495
- );
1496
- }
1497
- }
1498
- function outlineModel(request, value) {
1499
- value = createTask(
1500
- request,
1501
- value,
1502
- null,
1503
- !1,
1504
- request.abortableTasks,
1505
- null,
1506
- null,
1507
- null
1508
- );
1509
- retryTask(request, value);
1510
- return value.id;
1511
- }
1512
- function serializeServerReference(request, serverReference) {
1513
- var writtenServerReferences = request.writtenServerReferences,
1514
- existingId = writtenServerReferences.get(serverReference);
1515
- if (void 0 !== existingId) return "$F" + existingId.toString(16);
1516
- existingId = serverReference.$$bound;
1517
- existingId = null === existingId ? null : Promise.resolve(existingId);
1518
- var id = serverReference.$$id,
1519
- location = null,
1520
- error = serverReference.$$location;
1521
- error &&
1522
- ((error = parseStackTrace(error, 1)),
1523
- 0 < error.length && (location = error[0]));
1524
- existingId =
1525
- null !== location
1526
- ? {
1527
- id: id,
1528
- bound: existingId,
1529
- name:
1530
- "function" === typeof serverReference
1531
- ? serverReference.name
1532
- : "",
1533
- env: (0, request.environmentName)(),
1534
- location: location
1535
- }
1536
- : { id: id, bound: existingId };
1537
- request = outlineModel(request, existingId);
1538
- writtenServerReferences.set(serverReference, request);
1539
- return "$F" + request.toString(16);
1540
- }
1541
- function serializeLargeTextString(request, text) {
1542
- request.pendingChunks++;
1543
- var textId = request.nextChunkId++;
1544
- emitTextChunk(request, textId, text);
1545
- return serializeByValueID(textId);
1546
- }
1547
- function serializeMap(request, map) {
1548
- map = Array.from(map);
1549
- return "$Q" + outlineModel(request, map).toString(16);
1550
- }
1551
- function serializeFormData(request, formData) {
1552
- formData = Array.from(formData.entries());
1553
- return "$K" + outlineModel(request, formData).toString(16);
1554
- }
1555
- function serializeSet(request, set) {
1556
- set = Array.from(set);
1557
- return "$W" + outlineModel(request, set).toString(16);
1558
- }
1559
- function serializeTypedArray(request, tag, typedArray) {
1560
- request.pendingChunks++;
1561
- var bufferId = request.nextChunkId++;
1562
- emitTypedArrayChunk(request, bufferId, tag, typedArray);
1563
- return serializeByValueID(bufferId);
1564
- }
1565
- function serializeBlob(request, blob) {
1566
- function progress(entry) {
1567
- if (!aborted)
1568
- if (entry.done)
1569
- request.abortListeners.delete(abortBlob),
1570
- (aborted = !0),
1571
- pingTask(request, newTask);
1572
- else
1573
- return (
1574
- model.push(entry.value), reader.read().then(progress).catch(error)
1575
- );
1576
- }
1577
- function error(reason) {
1578
- aborted ||
1579
- ((aborted = !0),
1580
- request.abortListeners.delete(abortBlob),
1581
- erroredTask(request, newTask, reason),
1582
- enqueueFlush(request),
1583
- reader.cancel(reason).then(error, error));
1584
- }
1585
- function abortBlob(reason) {
1586
- aborted ||
1587
- ((aborted = !0),
1588
- request.abortListeners.delete(abortBlob),
1589
- erroredTask(request, newTask, reason),
1590
- enqueueFlush(request),
1591
- reader.cancel(reason).then(error, error));
1592
- }
1593
- var model = [blob.type],
1594
- newTask = createTask(
1595
- request,
1596
- model,
1597
- null,
1598
- !1,
1599
- request.abortableTasks,
1600
- null,
1601
- null,
1602
- null
1603
- ),
1604
- reader = blob.stream().getReader(),
1605
- aborted = !1;
1606
- request.abortListeners.add(abortBlob);
1607
- reader.read().then(progress).catch(error);
1608
- return "$B" + newTask.id.toString(16);
1609
- }
1610
- function renderModel(request, task, parent, key, value) {
1611
- var prevKeyPath = task.keyPath,
1612
- prevImplicitSlot = task.implicitSlot;
1613
- try {
1614
- return renderModelDestructive(request, task, parent, key, value);
1615
- } catch (thrownValue) {
1616
- parent = task.model;
1617
- parent =
1618
- "object" === typeof parent &&
1619
- null !== parent &&
1620
- (parent.$$typeof === REACT_ELEMENT_TYPE ||
1621
- parent.$$typeof === REACT_LAZY_TYPE);
1622
- if (request.status === ABORTING)
1623
- return (
1624
- (task.status = ABORTED),
1625
- (task = request.fatalError),
1626
- parent ? "$L" + task.toString(16) : serializeByValueID(task)
1627
- );
1628
- key =
1629
- thrownValue === SuspenseException
1630
- ? getSuspendedThenable()
1631
- : thrownValue;
1632
- if (
1633
- "object" === typeof key &&
1634
- null !== key &&
1635
- "function" === typeof key.then
1636
- )
1637
- return (
1638
- (request = createTask(
1639
- request,
1640
- task.model,
1641
- task.keyPath,
1642
- task.implicitSlot,
1643
- request.abortableTasks,
1644
- task.debugOwner,
1645
- task.debugStack,
1646
- task.debugTask
1647
- )),
1648
- (value = request.ping),
1649
- key.then(value, value),
1650
- (request.thenableState = getThenableStateAfterSuspending()),
1651
- (task.keyPath = prevKeyPath),
1652
- (task.implicitSlot = prevImplicitSlot),
1653
- parent
1654
- ? "$L" + request.id.toString(16)
1655
- : serializeByValueID(request.id)
1656
- );
1657
- task.keyPath = prevKeyPath;
1658
- task.implicitSlot = prevImplicitSlot;
1659
- request.pendingChunks++;
1660
- prevKeyPath = request.nextChunkId++;
1661
- task = logRecoverableError(request, key, task);
1662
- emitErrorChunk(request, prevKeyPath, task, key);
1663
- return parent
1664
- ? "$L" + prevKeyPath.toString(16)
1665
- : serializeByValueID(prevKeyPath);
1666
- }
1667
- }
1668
- function renderModelDestructive(
1669
- request,
1670
- task,
1671
- parent,
1672
- parentPropertyName,
1673
- value
1674
- ) {
1675
- task.model = value;
1676
- if (value === REACT_ELEMENT_TYPE) return "$";
1677
- if (null === value) return null;
1678
- if ("object" === typeof value) {
1679
- switch (value.$$typeof) {
1680
- case REACT_ELEMENT_TYPE:
1681
- var elementReference = null,
1682
- _writtenObjects = request.writtenObjects;
1683
- if (null === task.keyPath && !task.implicitSlot) {
1684
- var _existingReference = _writtenObjects.get(value);
1685
- if (void 0 !== _existingReference)
1686
- if (modelRoot === value) modelRoot = null;
1687
- else return _existingReference;
1688
- else
1689
- -1 === parentPropertyName.indexOf(":") &&
1690
- ((_existingReference = _writtenObjects.get(parent)),
1691
- void 0 !== _existingReference &&
1692
- ((elementReference =
1693
- _existingReference + ":" + parentPropertyName),
1694
- _writtenObjects.set(value, elementReference)));
1695
- }
1696
- if ((_existingReference = value._debugInfo)) {
1697
- if (null === debugID) return outlineTask(request, task);
1698
- forwardDebugInfo(request, debugID, _existingReference);
1699
- }
1700
- _existingReference = value.props;
1701
- var refProp = _existingReference.ref;
1702
- task.debugOwner = value._owner;
1703
- task.debugStack = value._debugStack;
1704
- task.debugTask = value._debugTask;
1705
- request = renderElement(
1706
- request,
1707
- task,
1708
- value.type,
1709
- value.key,
1710
- void 0 !== refProp ? refProp : null,
1711
- _existingReference,
1712
- value._store.validated
1713
- );
1714
- "object" === typeof request &&
1715
- null !== request &&
1716
- null !== elementReference &&
1717
- (_writtenObjects.has(request) ||
1718
- _writtenObjects.set(request, elementReference));
1719
- return request;
1720
- case REACT_LAZY_TYPE:
1721
- task.thenableState = null;
1722
- elementReference = callLazyInitInDEV(value);
1723
- if (request.status === ABORTING) throw null;
1724
- if ((_writtenObjects = value._debugInfo)) {
1725
- if (null === debugID) return outlineTask(request, task);
1726
- forwardDebugInfo(request, debugID, _writtenObjects);
1727
- }
1728
- return renderModelDestructive(
1729
- request,
1730
- task,
1731
- emptyRoot,
1732
- "",
1733
- elementReference
1734
- );
1735
- case REACT_LEGACY_ELEMENT_TYPE:
1736
- throw Error(
1737
- 'A React Element from an older version of React was rendered. This is not supported. It can happen if:\n- Multiple copies of the "react" package is used.\n- A library pre-bundled an old copy of "react" or "react/jsx-runtime".\n- A compiler tries to "inline" JSX instead of using the runtime.'
1738
- );
1739
- }
1740
- if (isClientReference(value))
1741
- return serializeClientReference(
1742
- request,
1743
- parent,
1744
- parentPropertyName,
1745
- value
1746
- );
1747
- if (
1748
- void 0 !== request.temporaryReferences &&
1749
- ((elementReference = request.temporaryReferences.get(value)),
1750
- void 0 !== elementReference)
1751
- )
1752
- return "$T" + elementReference;
1753
- elementReference = request.writtenObjects;
1754
- _writtenObjects = elementReference.get(value);
1755
- if ("function" === typeof value.then) {
1756
- if (void 0 !== _writtenObjects) {
1757
- if (null !== task.keyPath || task.implicitSlot)
1758
- return (
1759
- "$@" + serializeThenable(request, task, value).toString(16)
1760
- );
1761
- if (modelRoot === value) modelRoot = null;
1762
- else return _writtenObjects;
1763
- }
1764
- request = "$@" + serializeThenable(request, task, value).toString(16);
1765
- elementReference.set(value, request);
1766
- return request;
1767
- }
1768
- if (void 0 !== _writtenObjects)
1769
- if (modelRoot === value) modelRoot = null;
1770
- else return _writtenObjects;
1771
- else if (
1772
- -1 === parentPropertyName.indexOf(":") &&
1773
- ((_writtenObjects = elementReference.get(parent)),
1774
- void 0 !== _writtenObjects)
1775
- ) {
1776
- _existingReference = parentPropertyName;
1777
- if (isArrayImpl(parent) && parent[0] === REACT_ELEMENT_TYPE)
1778
- switch (parentPropertyName) {
1779
- case "1":
1780
- _existingReference = "type";
1781
- break;
1782
- case "2":
1783
- _existingReference = "key";
1784
- break;
1785
- case "3":
1786
- _existingReference = "props";
1787
- break;
1788
- case "4":
1789
- _existingReference = "_owner";
1790
- }
1791
- elementReference.set(
1792
- value,
1793
- _writtenObjects + ":" + _existingReference
1794
- );
1795
- }
1796
- if (isArrayImpl(value)) return renderFragment(request, task, value);
1797
- if (value instanceof Map) return serializeMap(request, value);
1798
- if (value instanceof Set) return serializeSet(request, value);
1799
- if ("function" === typeof FormData && value instanceof FormData)
1800
- return serializeFormData(request, value);
1801
- if (value instanceof Error) return serializeErrorValue(request, value);
1802
- if (value instanceof ArrayBuffer)
1803
- return serializeTypedArray(request, "A", new Uint8Array(value));
1804
- if (value instanceof Int8Array)
1805
- return serializeTypedArray(request, "O", value);
1806
- if (value instanceof Uint8Array)
1807
- return serializeTypedArray(request, "o", value);
1808
- if (value instanceof Uint8ClampedArray)
1809
- return serializeTypedArray(request, "U", value);
1810
- if (value instanceof Int16Array)
1811
- return serializeTypedArray(request, "S", value);
1812
- if (value instanceof Uint16Array)
1813
- return serializeTypedArray(request, "s", value);
1814
- if (value instanceof Int32Array)
1815
- return serializeTypedArray(request, "L", value);
1816
- if (value instanceof Uint32Array)
1817
- return serializeTypedArray(request, "l", value);
1818
- if (value instanceof Float32Array)
1819
- return serializeTypedArray(request, "G", value);
1820
- if (value instanceof Float64Array)
1821
- return serializeTypedArray(request, "g", value);
1822
- if (value instanceof BigInt64Array)
1823
- return serializeTypedArray(request, "M", value);
1824
- if (value instanceof BigUint64Array)
1825
- return serializeTypedArray(request, "m", value);
1826
- if (value instanceof DataView)
1827
- return serializeTypedArray(request, "V", value);
1828
- if ("function" === typeof Blob && value instanceof Blob)
1829
- return serializeBlob(request, value);
1830
- if ((elementReference = getIteratorFn(value)))
1831
- return (
1832
- (elementReference = elementReference.call(value)),
1833
- elementReference === value
1834
- ? "$i" +
1835
- outlineModel(request, Array.from(elementReference)).toString(16)
1836
- : renderFragment(request, task, Array.from(elementReference))
1837
- );
1838
- if (
1839
- "function" === typeof ReadableStream &&
1840
- value instanceof ReadableStream
1841
- )
1842
- return serializeReadableStream(request, task, value);
1843
- elementReference = value[ASYNC_ITERATOR];
1844
- if ("function" === typeof elementReference)
1845
- return renderAsyncFragment(request, task, value, elementReference);
1846
- if (value instanceof Date) return "$D" + value.toJSON();
1847
- elementReference = getPrototypeOf(value);
1848
- if (
1849
- elementReference !== ObjectPrototype &&
1850
- (null === elementReference ||
1851
- null !== getPrototypeOf(elementReference))
1852
- )
1853
- throw Error(
1854
- "Only plain objects, and a few built-ins, can be passed to Client Components from Server Components. Classes or null prototypes are not supported." +
1855
- describeObjectForErrorMessage(parent, parentPropertyName)
1856
- );
1857
- if ("Object" !== objectName(value))
1858
- callWithDebugContextInDEV(request, task, function () {
1859
- console.error(
1860
- "Only plain objects can be passed to Client Components from Server Components. %s objects are not supported.%s",
1861
- objectName(value),
1862
- describeObjectForErrorMessage(parent, parentPropertyName)
1863
- );
1864
- });
1865
- else if (!isSimpleObject(value))
1866
- callWithDebugContextInDEV(request, task, function () {
1867
- console.error(
1868
- "Only plain objects can be passed to Client Components from Server Components. Classes or other objects with methods are not supported.%s",
1869
- describeObjectForErrorMessage(parent, parentPropertyName)
1870
- );
1871
- });
1872
- else if (Object.getOwnPropertySymbols) {
1873
- var symbols = Object.getOwnPropertySymbols(value);
1874
- 0 < symbols.length &&
1875
- callWithDebugContextInDEV(request, task, function () {
1876
- console.error(
1877
- "Only plain objects can be passed to Client Components from Server Components. Objects with symbol properties like %s are not supported.%s",
1878
- symbols[0].description,
1879
- describeObjectForErrorMessage(parent, parentPropertyName)
1880
- );
1881
- });
1882
- }
1883
- return value;
1884
- }
1885
- if ("string" === typeof value)
1886
- return "Z" === value[value.length - 1] &&
1887
- parent[parentPropertyName] instanceof Date
1888
- ? "$D" + value
1889
- : 1024 <= value.length && null !== byteLengthOfChunk
1890
- ? serializeLargeTextString(request, value)
1891
- : "$" === value[0]
1892
- ? "$" + value
1893
- : value;
1894
- if ("boolean" === typeof value) return value;
1895
- if ("number" === typeof value) return serializeNumber(value);
1896
- if ("undefined" === typeof value) return "$undefined";
1897
- if ("function" === typeof value) {
1898
- if (isClientReference(value))
1899
- return serializeClientReference(
1900
- request,
1901
- parent,
1902
- parentPropertyName,
1903
- value
1904
- );
1905
- if (value.$$typeof === SERVER_REFERENCE_TAG)
1906
- return serializeServerReference(request, value);
1907
- if (
1908
- void 0 !== request.temporaryReferences &&
1909
- ((request = request.temporaryReferences.get(value)),
1910
- void 0 !== request)
1911
- )
1912
- return "$T" + request;
1913
- if (value.$$typeof === TEMPORARY_REFERENCE_TAG)
1914
- throw Error(
1915
- "Could not reference an opaque temporary reference. This is likely due to misconfiguring the temporaryReferences options on the server."
1916
- );
1917
- if (/^on[A-Z]/.test(parentPropertyName))
1918
- throw Error(
1919
- "Event handlers cannot be passed to Client Component props." +
1920
- describeObjectForErrorMessage(parent, parentPropertyName) +
1921
- "\nIf you need interactivity, consider converting part of this to a Client Component."
1922
- );
1923
- if (
1924
- jsxChildrenParents.has(parent) ||
1925
- (jsxPropsParents.has(parent) && "children" === parentPropertyName)
1926
- )
1927
- throw (
1928
- ((request = value.displayName || value.name || "Component"),
1929
- Error(
1930
- "Functions are not valid as a child of Client Components. This may happen if you return " +
1931
- request +
1932
- " instead of <" +
1933
- request +
1934
- " /> from render. Or maybe you meant to call this function rather than return it." +
1935
- describeObjectForErrorMessage(parent, parentPropertyName)
1936
- ))
1937
- );
1938
- throw Error(
1939
- 'Functions cannot be passed directly to Client Components unless you explicitly expose it by marking it with "use server". Or maybe you meant to call this function rather than return it.' +
1940
- describeObjectForErrorMessage(parent, parentPropertyName)
1941
- );
1942
- }
1943
- if ("symbol" === typeof value) {
1944
- task = request.writtenSymbols;
1945
- elementReference = task.get(value);
1946
- if (void 0 !== elementReference)
1947
- return serializeByValueID(elementReference);
1948
- elementReference = value.description;
1949
- if (Symbol.for(elementReference) !== value)
1950
- throw Error(
1951
- "Only global symbols received from Symbol.for(...) can be passed to Client Components. The symbol Symbol.for(" +
1952
- (value.description + ") cannot be found among global symbols.") +
1953
- describeObjectForErrorMessage(parent, parentPropertyName)
1954
- );
1955
- request.pendingChunks++;
1956
- _writtenObjects = request.nextChunkId++;
1957
- emitSymbolChunk(request, _writtenObjects, elementReference);
1958
- task.set(value, _writtenObjects);
1959
- return serializeByValueID(_writtenObjects);
1960
- }
1961
- if ("bigint" === typeof value) return "$n" + value.toString(10);
1962
- throw Error(
1963
- "Type " +
1964
- typeof value +
1965
- " is not supported in Client Component props." +
1966
- describeObjectForErrorMessage(parent, parentPropertyName)
1967
- );
1968
- }
1969
- function logRecoverableError(request, error, task) {
1970
- var prevRequest = currentRequest;
1971
- currentRequest = null;
1972
- try {
1973
- var onError = request.onError;
1974
- var errorDigest =
1975
- null !== task
1976
- ? callWithDebugContextInDEV(request, task, onError, error)
1977
- : onError(error);
1978
- } finally {
1979
- currentRequest = prevRequest;
1980
- }
1981
- if (null != errorDigest && "string" !== typeof errorDigest)
1982
- throw Error(
1983
- 'onError returned something with a type other than "string". onError should return a string and may return null or undefined but must not return anything else. It received something of type "' +
1984
- typeof errorDigest +
1985
- '" instead'
1986
- );
1987
- return errorDigest || "";
1988
- }
1989
- function fatalError(request, error) {
1990
- var onFatalError = request.onFatalError;
1991
- onFatalError(error);
1992
- null !== request.destination
1993
- ? ((request.status = CLOSED),
1994
- closeWithError(request.destination, error))
1995
- : ((request.status = CLOSING), (request.fatalError = error));
1996
- }
1997
- function serializeErrorValue(request, error) {
1998
- var name = "Error",
1999
- env = (0, request.environmentName)();
2000
- try {
2001
- name = error.name;
2002
- var message = String(error.message);
2003
- var stack = filterStackTrace(request, error, 0);
2004
- var errorEnv = error.environmentName;
2005
- "string" === typeof errorEnv && (env = errorEnv);
2006
- } catch (x) {
2007
- (message =
2008
- "An error occurred but serializing the error message failed."),
2009
- (stack = []);
2010
- }
2011
- return (
2012
- "$Z" +
2013
- outlineModel(request, {
2014
- name: name,
2015
- message: message,
2016
- stack: stack,
2017
- env: env
2018
- }).toString(16)
2019
- );
2020
- }
2021
- function emitErrorChunk(request, id, digest, error) {
2022
- var name = "Error",
2023
- env = (0, request.environmentName)();
2024
- try {
2025
- if (error instanceof Error) {
2026
- name = error.name;
2027
- var message = String(error.message);
2028
- var stack = filterStackTrace(request, error, 0);
2029
- var errorEnv = error.environmentName;
2030
- "string" === typeof errorEnv && (env = errorEnv);
2031
- } else
2032
- (message =
2033
- "object" === typeof error && null !== error
2034
- ? describeObjectForErrorMessage(error)
2035
- : String(error)),
2036
- (stack = []);
2037
- } catch (x) {
2038
- (message =
2039
- "An error occurred but serializing the error message failed."),
2040
- (stack = []);
2041
- }
2042
- digest = {
2043
- digest: digest,
2044
- name: name,
2045
- message: message,
2046
- stack: stack,
2047
- env: env
2048
- };
2049
- id = id.toString(16) + ":E" + stringify(digest) + "\n";
2050
- id = stringToChunk(id);
2051
- request.completedErrorChunks.push(id);
2052
- }
2053
- function emitSymbolChunk(request, id, name) {
2054
- id = encodeReferenceChunk(request, id, "$S" + name);
2055
- request.completedImportChunks.push(id);
2056
- }
2057
- function emitModelChunk(request, id, json) {
2058
- id = id.toString(16) + ":" + json + "\n";
2059
- id = stringToChunk(id);
2060
- request.completedRegularChunks.push(id);
2061
- }
2062
- function emitDebugChunk(request, id, debugInfo) {
2063
- var counter = { objectLimit: 500 };
2064
- debugInfo = stringify(debugInfo, function (parentPropertyName, value) {
2065
- return renderConsoleValue(
2066
- request,
2067
- counter,
2068
- this,
2069
- parentPropertyName,
2070
- value
2071
- );
2072
- });
2073
- id = id.toString(16) + ":D" + debugInfo + "\n";
2074
- id = stringToChunk(id);
2075
- request.completedRegularChunks.push(id);
2076
- }
2077
- function outlineComponentInfo(request, componentInfo) {
2078
- if (!request.writtenObjects.has(componentInfo)) {
2079
- null != componentInfo.owner &&
2080
- outlineComponentInfo(request, componentInfo.owner);
2081
- var objectLimit = 10;
2082
- null != componentInfo.stack &&
2083
- (objectLimit += componentInfo.stack.length);
2084
- objectLimit = { objectLimit: objectLimit };
2085
- var componentDebugInfo = {
2086
- name: componentInfo.name,
2087
- env: componentInfo.env,
2088
- key: componentInfo.key,
2089
- owner: componentInfo.owner
2090
- };
2091
- componentDebugInfo.stack = componentInfo.stack;
2092
- componentDebugInfo.props = componentInfo.props;
2093
- objectLimit = outlineConsoleValue(
2094
- request,
2095
- objectLimit,
2096
- componentDebugInfo
2097
- );
2098
- request.writtenObjects.set(
2099
- componentInfo,
2100
- serializeByValueID(objectLimit)
2101
- );
2102
- }
2103
- }
2104
- function emitTypedArrayChunk(request, id, tag, typedArray) {
2105
- request.pendingChunks++;
2106
- var buffer = new Uint8Array(
2107
- typedArray.buffer,
2108
- typedArray.byteOffset,
2109
- typedArray.byteLength
2110
- );
2111
- typedArray = 2048 < typedArray.byteLength ? buffer.slice() : buffer;
2112
- buffer = typedArray.byteLength;
2113
- id = id.toString(16) + ":" + tag + buffer.toString(16) + ",";
2114
- id = stringToChunk(id);
2115
- request.completedRegularChunks.push(id, typedArray);
2116
- }
2117
- function emitTextChunk(request, id, text) {
2118
- if (null === byteLengthOfChunk)
2119
- throw Error(
2120
- "Existence of byteLengthOfChunk should have already been checked. This is a bug in React."
2121
- );
2122
- request.pendingChunks++;
2123
- text = stringToChunk(text);
2124
- var binaryLength = text.byteLength;
2125
- id = id.toString(16) + ":T" + binaryLength.toString(16) + ",";
2126
- id = stringToChunk(id);
2127
- request.completedRegularChunks.push(id, text);
2128
- }
2129
- function renderConsoleValue(
2130
- request,
2131
- counter,
2132
- parent,
2133
- parentPropertyName,
2134
- value
2135
- ) {
2136
- if (null === value) return null;
2137
- if (value === REACT_ELEMENT_TYPE) return "$";
2138
- if ("object" === typeof value) {
2139
- if (isClientReference(value))
2140
- return serializeClientReference(
2141
- request,
2142
- parent,
2143
- parentPropertyName,
2144
- value
2145
- );
2146
- if (
2147
- void 0 !== request.temporaryReferences &&
2148
- ((parent = request.temporaryReferences.get(value)), void 0 !== parent)
2149
- )
2150
- return "$T" + parent;
2151
- parent = request.writtenObjects.get(value);
2152
- if (void 0 !== parent) return parent;
2153
- if (0 >= counter.objectLimit && !doNotLimit.has(value)) return "$Y";
2154
- counter.objectLimit--;
2155
- switch (value.$$typeof) {
2156
- case REACT_ELEMENT_TYPE:
2157
- null != value._owner && outlineComponentInfo(request, value._owner);
2158
- "object" === typeof value.type &&
2159
- null !== value.type &&
2160
- doNotLimit.add(value.type);
2161
- "object" === typeof value.key &&
2162
- null !== value.key &&
2163
- doNotLimit.add(value.key);
2164
- doNotLimit.add(value.props);
2165
- null !== value._owner && doNotLimit.add(value._owner);
2166
- counter = null;
2167
- if (null != value._debugStack)
2168
- for (
2169
- counter = filterStackTrace(request, value._debugStack, 1),
2170
- doNotLimit.add(counter),
2171
- request = 0;
2172
- request < counter.length;
2173
- request++
2174
- )
2175
- doNotLimit.add(counter[request]);
2176
- return [
2177
- REACT_ELEMENT_TYPE,
2178
- value.type,
2179
- value.key,
2180
- value.props,
2181
- value._owner,
2182
- counter,
2183
- value._store.validated
2184
- ];
2185
- }
2186
- if ("function" === typeof value.then) {
2187
- switch (value.status) {
2188
- case "fulfilled":
2189
- return (
2190
- "$@" +
2191
- outlineConsoleValue(request, counter, value.value).toString(16)
2192
- );
2193
- case "rejected":
2194
- return (
2195
- (counter = value.reason),
2196
- request.pendingChunks++,
2197
- (value = request.nextChunkId++),
2198
- emitErrorChunk(request, value, "", counter),
2199
- "$@" + value.toString(16)
2200
- );
2201
- }
2202
- return "$@";
2203
- }
2204
- if (isArrayImpl(value)) return value;
2205
- if (value instanceof Map) {
2206
- value = Array.from(value);
2207
- counter.objectLimit++;
2208
- for (parent = 0; parent < value.length; parent++) {
2209
- var entry = value[parent];
2210
- doNotLimit.add(entry);
2211
- parentPropertyName = entry[0];
2212
- entry = entry[1];
2213
- "object" === typeof parentPropertyName &&
2214
- null !== parentPropertyName &&
2215
- doNotLimit.add(parentPropertyName);
2216
- "object" === typeof entry &&
2217
- null !== entry &&
2218
- doNotLimit.add(entry);
2219
- }
2220
- return (
2221
- "$Q" + outlineConsoleValue(request, counter, value).toString(16)
2222
- );
2223
- }
2224
- if (value instanceof Set) {
2225
- value = Array.from(value);
2226
- counter.objectLimit++;
2227
- for (parent = 0; parent < value.length; parent++)
2228
- (parentPropertyName = value[parent]),
2229
- "object" === typeof parentPropertyName &&
2230
- null !== parentPropertyName &&
2231
- doNotLimit.add(parentPropertyName);
2232
- return (
2233
- "$W" + outlineConsoleValue(request, counter, value).toString(16)
2234
- );
2235
- }
2236
- return "function" === typeof FormData && value instanceof FormData
2237
- ? serializeFormData(request, value)
2238
- : value instanceof Error
2239
- ? serializeErrorValue(request, value)
2240
- : value instanceof ArrayBuffer
2241
- ? serializeTypedArray(request, "A", new Uint8Array(value))
2242
- : value instanceof Int8Array
2243
- ? serializeTypedArray(request, "O", value)
2244
- : value instanceof Uint8Array
2245
- ? serializeTypedArray(request, "o", value)
2246
- : value instanceof Uint8ClampedArray
2247
- ? serializeTypedArray(request, "U", value)
2248
- : value instanceof Int16Array
2249
- ? serializeTypedArray(request, "S", value)
2250
- : value instanceof Uint16Array
2251
- ? serializeTypedArray(request, "s", value)
2252
- : value instanceof Int32Array
2253
- ? serializeTypedArray(request, "L", value)
2254
- : value instanceof Uint32Array
2255
- ? serializeTypedArray(request, "l", value)
2256
- : value instanceof Float32Array
2257
- ? serializeTypedArray(request, "G", value)
2258
- : value instanceof Float64Array
2259
- ? serializeTypedArray(request, "g", value)
2260
- : value instanceof BigInt64Array
2261
- ? serializeTypedArray(request, "M", value)
2262
- : value instanceof BigUint64Array
2263
- ? serializeTypedArray(request, "m", value)
2264
- : value instanceof DataView
2265
- ? serializeTypedArray(request, "V", value)
2266
- : "function" === typeof Blob &&
2267
- value instanceof Blob
2268
- ? serializeBlob(request, value)
2269
- : getIteratorFn(value)
2270
- ? Array.from(value)
2271
- : value;
2272
- }
2273
- if ("string" === typeof value)
2274
- return "Z" === value[value.length - 1] &&
2275
- parent[parentPropertyName] instanceof Date
2276
- ? "$D" + value
2277
- : 1024 <= value.length
2278
- ? serializeLargeTextString(request, value)
2279
- : "$" === value[0]
2280
- ? "$" + value
2281
- : value;
2282
- if ("boolean" === typeof value) return value;
2283
- if ("number" === typeof value) return serializeNumber(value);
2284
- if ("undefined" === typeof value) return "$undefined";
2285
- if ("function" === typeof value)
2286
- return isClientReference(value)
2287
- ? serializeClientReference(request, parent, parentPropertyName, value)
2288
- : void 0 !== request.temporaryReferences &&
2289
- ((request = request.temporaryReferences.get(value)),
2290
- void 0 !== request)
2291
- ? "$T" + request
2292
- : "$E(" + (Function.prototype.toString.call(value) + ")");
2293
- if ("symbol" === typeof value) {
2294
- counter = request.writtenSymbols.get(value);
2295
- if (void 0 !== counter) return serializeByValueID(counter);
2296
- counter = value.description;
2297
- request.pendingChunks++;
2298
- value = request.nextChunkId++;
2299
- emitSymbolChunk(request, value, counter);
2300
- return serializeByValueID(value);
2301
- }
2302
- return "bigint" === typeof value
2303
- ? "$n" + value.toString(10)
2304
- : value instanceof Date
2305
- ? "$D" + value.toJSON()
2306
- : "unknown type " + typeof value;
2307
- }
2308
- function outlineConsoleValue(request, counter, model) {
2309
- function replacer(parentPropertyName, value) {
2310
- try {
2311
- return renderConsoleValue(
2312
- request,
2313
- counter,
2314
- this,
2315
- parentPropertyName,
2316
- value
2317
- );
2318
- } catch (x) {
2319
- return (
2320
- "Unknown Value: React could not send it from the server.\n" +
2321
- x.message
2322
- );
2323
- }
2324
- }
2325
- "object" === typeof model && null !== model && doNotLimit.add(model);
2326
- try {
2327
- var json = stringify(model, replacer);
2328
- } catch (x) {
2329
- json = stringify(
2330
- "Unknown Value: React could not send it from the server.\n" +
2331
- x.message
2332
- );
2333
- }
2334
- request.pendingChunks++;
2335
- model = request.nextChunkId++;
2336
- json = model.toString(16) + ":" + json + "\n";
2337
- json = stringToChunk(json);
2338
- request.completedRegularChunks.push(json);
2339
- return model;
2340
- }
2341
- function emitConsoleChunk(request, methodName, owner, stackTrace, args) {
2342
- function replacer(parentPropertyName, value) {
2343
- try {
2344
- return renderConsoleValue(
2345
- request,
2346
- counter,
2347
- this,
2348
- parentPropertyName,
2349
- value
2350
- );
2351
- } catch (x) {
2352
- return (
2353
- "Unknown Value: React could not send it from the server.\n" +
2354
- x.message
2355
- );
2356
- }
2357
- }
2358
- var counter = { objectLimit: 500 };
2359
- null != owner && outlineComponentInfo(request, owner);
2360
- var env = (0, request.environmentName)(),
2361
- payload = [methodName, stackTrace, owner, env];
2362
- payload.push.apply(payload, args);
2363
- try {
2364
- var json = stringify(payload, replacer);
2365
- } catch (x) {
2366
- json = stringify(
2367
- [
2368
- methodName,
2369
- stackTrace,
2370
- owner,
2371
- env,
2372
- "Unknown Value: React could not send it from the server.",
2373
- x
2374
- ],
2375
- replacer
2376
- );
2377
- }
2378
- methodName = stringToChunk(":W" + json + "\n");
2379
- request.completedRegularChunks.push(methodName);
2380
- }
2381
- function forwardDebugInfo(request, id, debugInfo) {
2382
- for (var i = 0; i < debugInfo.length; i++)
2383
- "number" !== typeof debugInfo[i].time &&
2384
- (request.pendingChunks++,
2385
- "string" === typeof debugInfo[i].name &&
2386
- outlineComponentInfo(request, debugInfo[i]),
2387
- emitDebugChunk(request, id, debugInfo[i]));
2388
- }
2389
- function emitChunk(request, task, value) {
2390
- var id = task.id;
2391
- "string" === typeof value && null !== byteLengthOfChunk
2392
- ? emitTextChunk(request, id, value)
2393
- : value instanceof ArrayBuffer
2394
- ? emitTypedArrayChunk(request, id, "A", new Uint8Array(value))
2395
- : value instanceof Int8Array
2396
- ? emitTypedArrayChunk(request, id, "O", value)
2397
- : value instanceof Uint8Array
2398
- ? emitTypedArrayChunk(request, id, "o", value)
2399
- : value instanceof Uint8ClampedArray
2400
- ? emitTypedArrayChunk(request, id, "U", value)
2401
- : value instanceof Int16Array
2402
- ? emitTypedArrayChunk(request, id, "S", value)
2403
- : value instanceof Uint16Array
2404
- ? emitTypedArrayChunk(request, id, "s", value)
2405
- : value instanceof Int32Array
2406
- ? emitTypedArrayChunk(request, id, "L", value)
2407
- : value instanceof Uint32Array
2408
- ? emitTypedArrayChunk(request, id, "l", value)
2409
- : value instanceof Float32Array
2410
- ? emitTypedArrayChunk(request, id, "G", value)
2411
- : value instanceof Float64Array
2412
- ? emitTypedArrayChunk(request, id, "g", value)
2413
- : value instanceof BigInt64Array
2414
- ? emitTypedArrayChunk(request, id, "M", value)
2415
- : value instanceof BigUint64Array
2416
- ? emitTypedArrayChunk(request, id, "m", value)
2417
- : value instanceof DataView
2418
- ? emitTypedArrayChunk(request, id, "V", value)
2419
- : ((value = stringify(value, task.toJSON)),
2420
- emitModelChunk(request, task.id, value));
2421
- }
2422
- function erroredTask(request, task, error) {
2423
- request.abortableTasks.delete(task);
2424
- task.status = ERRORED$1;
2425
- var digest = logRecoverableError(request, error, task);
2426
- emitErrorChunk(request, task.id, digest, error);
2427
- }
2428
- function retryTask(request, task) {
2429
- if (task.status === PENDING$1) {
2430
- var prevDebugID = debugID;
2431
- task.status = RENDERING;
2432
- try {
2433
- modelRoot = task.model;
2434
- debugID = task.id;
2435
- var resolvedModel = renderModelDestructive(
2436
- request,
2437
- task,
2438
- emptyRoot,
2439
- "",
2440
- task.model
2441
- );
2442
- debugID = null;
2443
- modelRoot = resolvedModel;
2444
- task.keyPath = null;
2445
- task.implicitSlot = !1;
2446
- var currentEnv = (0, request.environmentName)();
2447
- currentEnv !== task.environmentName &&
2448
- (request.pendingChunks++,
2449
- emitDebugChunk(request, task.id, { env: currentEnv }));
2450
- if ("object" === typeof resolvedModel && null !== resolvedModel)
2451
- request.writtenObjects.set(
2452
- resolvedModel,
2453
- serializeByValueID(task.id)
2454
- ),
2455
- emitChunk(request, task, resolvedModel);
2456
- else {
2457
- var json = stringify(resolvedModel);
2458
- emitModelChunk(request, task.id, json);
2459
- }
2460
- request.abortableTasks.delete(task);
2461
- task.status = COMPLETED;
2462
- } catch (thrownValue) {
2463
- if (request.status === ABORTING) {
2464
- request.abortableTasks.delete(task);
2465
- task.status = ABORTED;
2466
- var model = stringify(serializeByValueID(request.fatalError));
2467
- emitModelChunk(request, task.id, model);
2468
- } else {
2469
- var x =
2470
- thrownValue === SuspenseException
2471
- ? getSuspendedThenable()
2472
- : thrownValue;
2473
- if (
2474
- "object" === typeof x &&
2475
- null !== x &&
2476
- "function" === typeof x.then
2477
- ) {
2478
- task.status = PENDING$1;
2479
- task.thenableState = getThenableStateAfterSuspending();
2480
- var ping = task.ping;
2481
- x.then(ping, ping);
2482
- } else erroredTask(request, task, x);
2483
- }
2484
- } finally {
2485
- debugID = prevDebugID;
2486
- }
2487
- }
2488
- }
2489
- function tryStreamTask(request, task) {
2490
- var prevDebugID = debugID;
2491
- debugID = null;
2492
- try {
2493
- emitChunk(request, task, task.model);
2494
- } finally {
2495
- debugID = prevDebugID;
2496
- }
2497
- }
2498
- function performWork(request) {
2499
- var prevDispatcher = ReactSharedInternalsServer.H;
2500
- ReactSharedInternalsServer.H = HooksDispatcher;
2501
- var prevRequest = currentRequest;
2502
- currentRequest$1 = currentRequest = request;
2503
- var hadAbortableTasks = 0 < request.abortableTasks.size;
2504
- try {
2505
- var pingedTasks = request.pingedTasks;
2506
- request.pingedTasks = [];
2507
- for (var i = 0; i < pingedTasks.length; i++)
2508
- retryTask(request, pingedTasks[i]);
2509
- null !== request.destination &&
2510
- flushCompletedChunks(request, request.destination);
2511
- if (hadAbortableTasks && 0 === request.abortableTasks.size) {
2512
- var onAllReady = request.onAllReady;
2513
- onAllReady();
2514
- }
2515
- } catch (error) {
2516
- logRecoverableError(request, error, null), fatalError(request, error);
2517
- } finally {
2518
- (ReactSharedInternalsServer.H = prevDispatcher),
2519
- (currentRequest$1 = null),
2520
- (currentRequest = prevRequest);
2521
- }
2522
- }
2523
- function flushCompletedChunks(request, destination) {
2524
- currentView = new Uint8Array(2048);
2525
- writtenBytes = 0;
2526
- try {
2527
- for (
2528
- var importsChunks = request.completedImportChunks, i = 0;
2529
- i < importsChunks.length;
2530
- i++
2531
- )
2532
- if (
2533
- (request.pendingChunks--,
2534
- !writeChunkAndReturn(destination, importsChunks[i]))
2535
- ) {
2536
- request.destination = null;
2537
- i++;
2538
- break;
2539
- }
2540
- importsChunks.splice(0, i);
2541
- var hintChunks = request.completedHintChunks;
2542
- for (i = 0; i < hintChunks.length; i++)
2543
- if (!writeChunkAndReturn(destination, hintChunks[i])) {
2544
- request.destination = null;
2545
- i++;
2546
- break;
2547
- }
2548
- hintChunks.splice(0, i);
2549
- var regularChunks = request.completedRegularChunks;
2550
- for (i = 0; i < regularChunks.length; i++)
2551
- if (
2552
- (request.pendingChunks--,
2553
- !writeChunkAndReturn(destination, regularChunks[i]))
2554
- ) {
2555
- request.destination = null;
2556
- i++;
2557
- break;
2558
- }
2559
- regularChunks.splice(0, i);
2560
- var errorChunks = request.completedErrorChunks;
2561
- for (i = 0; i < errorChunks.length; i++)
2562
- if (
2563
- (request.pendingChunks--,
2564
- !writeChunkAndReturn(destination, errorChunks[i]))
2565
- ) {
2566
- request.destination = null;
2567
- i++;
2568
- break;
2569
- }
2570
- errorChunks.splice(0, i);
2571
- } finally {
2572
- (request.flushScheduled = !1),
2573
- currentView &&
2574
- 0 < writtenBytes &&
2575
- (destination.enqueue(
2576
- new Uint8Array(currentView.buffer, 0, writtenBytes)
2577
- ),
2578
- (currentView = null),
2579
- (writtenBytes = 0));
2580
- }
2581
- 0 === request.pendingChunks &&
2582
- ((request.status = CLOSED),
2583
- destination.close(),
2584
- (request.destination = null));
2585
- }
2586
- function startWork(request) {
2587
- request.flushScheduled = null !== request.destination;
2588
- scheduleMicrotask(function () {
2589
- return performWork(request);
2590
- });
2591
- scheduleWork(function () {
2592
- request.status === OPENING && (request.status = 11);
2593
- });
2594
- }
2595
- function enqueueFlush(request) {
2596
- !1 === request.flushScheduled &&
2597
- 0 === request.pingedTasks.length &&
2598
- null !== request.destination &&
2599
- ((request.flushScheduled = !0),
2600
- scheduleWork(function () {
2601
- request.flushScheduled = !1;
2602
- var destination = request.destination;
2603
- destination && flushCompletedChunks(request, destination);
2604
- }));
2605
- }
2606
- function startFlowing(request, destination) {
2607
- if (request.status === CLOSING)
2608
- (request.status = CLOSED),
2609
- closeWithError(destination, request.fatalError);
2610
- else if (request.status !== CLOSED && null === request.destination) {
2611
- request.destination = destination;
2612
- try {
2613
- flushCompletedChunks(request, destination);
2614
- } catch (error) {
2615
- logRecoverableError(request, error, null), fatalError(request, error);
2616
- }
2617
- }
2618
- }
2619
- function abort(request, reason) {
2620
- try {
2621
- 11 >= request.status && (request.status = ABORTING);
2622
- var abortableTasks = request.abortableTasks;
2623
- if (0 < abortableTasks.size) {
2624
- var error =
2625
- void 0 === reason
2626
- ? Error(
2627
- "The render was aborted by the server without a reason."
2628
- )
2629
- : "object" === typeof reason &&
2630
- null !== reason &&
2631
- "function" === typeof reason.then
2632
- ? Error(
2633
- "The render was aborted by the server with a promise."
2634
- )
2635
- : reason,
2636
- digest = logRecoverableError(request, error, null),
2637
- _errorId2 = request.nextChunkId++;
2638
- request.fatalError = _errorId2;
2639
- request.pendingChunks++;
2640
- emitErrorChunk(request, _errorId2, digest, error);
2641
- abortableTasks.forEach(function (task) {
2642
- if (task.status !== RENDERING) {
2643
- task.status = ABORTED;
2644
- var ref = serializeByValueID(_errorId2);
2645
- task = encodeReferenceChunk(request, task.id, ref);
2646
- request.completedErrorChunks.push(task);
2647
- }
2648
- });
2649
- abortableTasks.clear();
2650
- var onAllReady = request.onAllReady;
2651
- onAllReady();
2652
- }
2653
- var abortListeners = request.abortListeners;
2654
- if (0 < abortListeners.size) {
2655
- var _error =
2656
- void 0 === reason
2657
- ? Error("The render was aborted by the server without a reason.")
2658
- : "object" === typeof reason &&
2659
- null !== reason &&
2660
- "function" === typeof reason.then
2661
- ? Error("The render was aborted by the server with a promise.")
2662
- : reason;
2663
- abortListeners.forEach(function (callback) {
2664
- return callback(_error);
2665
- });
2666
- abortListeners.clear();
2667
- }
2668
- null !== request.destination &&
2669
- flushCompletedChunks(request, request.destination);
2670
- } catch (error$2) {
2671
- logRecoverableError(request, error$2, null),
2672
- fatalError(request, error$2);
2673
- }
2674
- }
2675
- function resolveServerReference(bundlerConfig, id) {
2676
- var name = "",
2677
- resolvedModuleData = bundlerConfig[id];
2678
- if (resolvedModuleData) name = resolvedModuleData.name;
2679
- else {
2680
- var idx = id.lastIndexOf("#");
2681
- -1 !== idx &&
2682
- ((name = id.slice(idx + 1)),
2683
- (resolvedModuleData = bundlerConfig[id.slice(0, idx)]));
2684
- if (!resolvedModuleData)
2685
- throw Error(
2686
- 'Could not find the module "' +
2687
- id +
2688
- '" in the React Server Manifest. This is probably a bug in the React Server Components bundler.'
2689
- );
2690
- }
2691
- return resolvedModuleData.async
2692
- ? [resolvedModuleData.id, resolvedModuleData.chunks, name, 1]
2693
- : [resolvedModuleData.id, resolvedModuleData.chunks, name];
2694
- }
2695
- function requireAsyncModule(id) {
2696
- var promise = __webpack_require__(id);
2697
- if ("function" !== typeof promise.then || "fulfilled" === promise.status)
2698
- return null;
2699
- promise.then(
2700
- function (value) {
2701
- promise.status = "fulfilled";
2702
- promise.value = value;
2703
- },
2704
- function (reason) {
2705
- promise.status = "rejected";
2706
- promise.reason = reason;
2707
- }
2708
- );
2709
- return promise;
2710
- }
2711
- function ignoreReject() {}
2712
- function preloadModule(metadata) {
2713
- for (
2714
- var chunks = metadata[1], promises = [], i = 0;
2715
- i < chunks.length;
2716
-
2717
- ) {
2718
- var chunkId = chunks[i++],
2719
- chunkFilename = chunks[i++],
2720
- entry = chunkCache.get(chunkId);
2721
- void 0 === entry
2722
- ? ((chunkFilename = loadChunk(chunkId, chunkFilename)),
2723
- promises.push(chunkFilename),
2724
- (entry = chunkCache.set.bind(chunkCache, chunkId, null)),
2725
- chunkFilename.then(entry, ignoreReject),
2726
- chunkCache.set(chunkId, chunkFilename))
2727
- : null !== entry && promises.push(entry);
2728
- }
2729
- return 4 === metadata.length
2730
- ? 0 === promises.length
2731
- ? requireAsyncModule(metadata[0])
2732
- : Promise.all(promises).then(function () {
2733
- return requireAsyncModule(metadata[0]);
2734
- })
2735
- : 0 < promises.length
2736
- ? Promise.all(promises)
2737
- : null;
2738
- }
2739
- function requireModule(metadata) {
2740
- var moduleExports = __webpack_require__(metadata[0]);
2741
- if (4 === metadata.length && "function" === typeof moduleExports.then)
2742
- if ("fulfilled" === moduleExports.status)
2743
- moduleExports = moduleExports.value;
2744
- else throw moduleExports.reason;
2745
- return "*" === metadata[2]
2746
- ? moduleExports
2747
- : "" === metadata[2]
2748
- ? moduleExports.__esModule
2749
- ? moduleExports.default
2750
- : moduleExports
2751
- : moduleExports[metadata[2]];
2752
- }
2753
- function loadChunk(chunkId, filename) {
2754
- chunkMap.set(chunkId, filename);
2755
- return __webpack_chunk_load__(chunkId);
2756
- }
2757
- function Chunk(status, value, reason, response) {
2758
- this.status = status;
2759
- this.value = value;
2760
- this.reason = reason;
2761
- this._response = response;
2762
- }
2763
- function createPendingChunk(response) {
2764
- return new Chunk("pending", null, null, response);
2765
- }
2766
- function wakeChunk(listeners, value) {
2767
- for (var i = 0; i < listeners.length; i++) (0, listeners[i])(value);
2768
- }
2769
- function triggerErrorOnChunk(chunk, error) {
2770
- if ("pending" !== chunk.status && "blocked" !== chunk.status)
2771
- chunk.reason.error(error);
2772
- else {
2773
- var listeners = chunk.reason;
2774
- chunk.status = "rejected";
2775
- chunk.reason = error;
2776
- null !== listeners && wakeChunk(listeners, error);
2777
- }
2778
- }
2779
- function resolveModelChunk(chunk, value, id) {
2780
- if ("pending" !== chunk.status)
2781
- (chunk = chunk.reason),
2782
- "C" === value[0]
2783
- ? chunk.close("C" === value ? '"$undefined"' : value.slice(1))
2784
- : chunk.enqueueModel(value);
2785
- else {
2786
- var resolveListeners = chunk.value,
2787
- rejectListeners = chunk.reason;
2788
- chunk.status = "resolved_model";
2789
- chunk.value = value;
2790
- chunk.reason = id;
2791
- if (null !== resolveListeners)
2792
- switch ((initializeModelChunk(chunk), chunk.status)) {
2793
- case "fulfilled":
2794
- wakeChunk(resolveListeners, chunk.value);
2795
- break;
2796
- case "pending":
2797
- case "blocked":
2798
- case "cyclic":
2799
- if (chunk.value)
2800
- for (value = 0; value < resolveListeners.length; value++)
2801
- chunk.value.push(resolveListeners[value]);
2802
- else chunk.value = resolveListeners;
2803
- if (chunk.reason) {
2804
- if (rejectListeners)
2805
- for (value = 0; value < rejectListeners.length; value++)
2806
- chunk.reason.push(rejectListeners[value]);
2807
- } else chunk.reason = rejectListeners;
2808
- break;
2809
- case "rejected":
2810
- rejectListeners && wakeChunk(rejectListeners, chunk.reason);
2811
- }
2812
- }
2813
- }
2814
- function createResolvedIteratorResultChunk(response, value, done) {
2815
- return new Chunk(
2816
- "resolved_model",
2817
- (done ? '{"done":true,"value":' : '{"done":false,"value":') +
2818
- value +
2819
- "}",
2820
- -1,
2821
- response
2822
- );
2823
- }
2824
- function resolveIteratorResultChunk(chunk, value, done) {
2825
- resolveModelChunk(
2826
- chunk,
2827
- (done ? '{"done":true,"value":' : '{"done":false,"value":') +
2828
- value +
2829
- "}",
2830
- -1
2831
- );
2832
- }
2833
- function loadServerReference$1(
2834
- response,
2835
- id,
2836
- bound,
2837
- parentChunk,
2838
- parentObject,
2839
- key
2840
- ) {
2841
- var serverReference = resolveServerReference(response._bundlerConfig, id);
2842
- id = preloadModule(serverReference);
2843
- if (bound)
2844
- bound = Promise.all([bound, id]).then(function (_ref) {
2845
- _ref = _ref[0];
2846
- var fn = requireModule(serverReference);
2847
- return fn.bind.apply(fn, [null].concat(_ref));
2848
- });
2849
- else if (id)
2850
- bound = Promise.resolve(id).then(function () {
2851
- return requireModule(serverReference);
2852
- });
2853
- else return requireModule(serverReference);
2854
- bound.then(
2855
- createModelResolver(
2856
- parentChunk,
2857
- parentObject,
2858
- key,
2859
- !1,
2860
- response,
2861
- createModel,
2862
- []
2863
- ),
2864
- createModelReject(parentChunk)
2865
- );
2866
- return null;
2867
- }
2868
- function reviveModel(response, parentObj, parentKey, value, reference) {
2869
- if ("string" === typeof value)
2870
- return parseModelString(
2871
- response,
2872
- parentObj,
2873
- parentKey,
2874
- value,
2875
- reference
2876
- );
2877
- if ("object" === typeof value && null !== value)
2878
- if (
2879
- (void 0 !== reference &&
2880
- void 0 !== response._temporaryReferences &&
2881
- response._temporaryReferences.set(value, reference),
2882
- Array.isArray(value))
2883
- )
2884
- for (var i = 0; i < value.length; i++)
2885
- value[i] = reviveModel(
2886
- response,
2887
- value,
2888
- "" + i,
2889
- value[i],
2890
- void 0 !== reference ? reference + ":" + i : void 0
2891
- );
2892
- else
2893
- for (i in value)
2894
- hasOwnProperty.call(value, i) &&
2895
- ((parentObj =
2896
- void 0 !== reference && -1 === i.indexOf(":")
2897
- ? reference + ":" + i
2898
- : void 0),
2899
- (parentObj = reviveModel(
2900
- response,
2901
- value,
2902
- i,
2903
- value[i],
2904
- parentObj
2905
- )),
2906
- void 0 !== parentObj ? (value[i] = parentObj) : delete value[i]);
2907
- return value;
2908
- }
2909
- function initializeModelChunk(chunk) {
2910
- var prevChunk = initializingChunk,
2911
- prevBlocked = initializingChunkBlockedModel;
2912
- initializingChunk = chunk;
2913
- initializingChunkBlockedModel = null;
2914
- var rootReference =
2915
- -1 === chunk.reason ? void 0 : chunk.reason.toString(16),
2916
- resolvedModel = chunk.value;
2917
- chunk.status = "cyclic";
2918
- chunk.value = null;
2919
- chunk.reason = null;
2920
- try {
2921
- var rawModel = JSON.parse(resolvedModel),
2922
- value = reviveModel(
2923
- chunk._response,
2924
- { "": rawModel },
2925
- "",
2926
- rawModel,
2927
- rootReference
2928
- );
2929
- if (
2930
- null !== initializingChunkBlockedModel &&
2931
- 0 < initializingChunkBlockedModel.deps
2932
- )
2933
- (initializingChunkBlockedModel.value = value),
2934
- (chunk.status = "blocked");
2935
- else {
2936
- var resolveListeners = chunk.value;
2937
- chunk.status = "fulfilled";
2938
- chunk.value = value;
2939
- null !== resolveListeners && wakeChunk(resolveListeners, value);
2940
- }
2941
- } catch (error) {
2942
- (chunk.status = "rejected"), (chunk.reason = error);
2943
- } finally {
2944
- (initializingChunk = prevChunk),
2945
- (initializingChunkBlockedModel = prevBlocked);
2946
- }
2947
- }
2948
- function reportGlobalError(response, error) {
2949
- response._closed = !0;
2950
- response._closedReason = error;
2951
- response._chunks.forEach(function (chunk) {
2952
- "pending" === chunk.status && triggerErrorOnChunk(chunk, error);
2953
- });
2954
- }
2955
- function getChunk(response, id) {
2956
- var chunks = response._chunks,
2957
- chunk = chunks.get(id);
2958
- chunk ||
2959
- ((chunk = response._formData.get(response._prefix + id)),
2960
- (chunk =
2961
- null != chunk
2962
- ? new Chunk("resolved_model", chunk, id, response)
2963
- : response._closed
2964
- ? new Chunk("rejected", null, response._closedReason, response)
2965
- : createPendingChunk(response)),
2966
- chunks.set(id, chunk));
2967
- return chunk;
2968
- }
2969
- function createModelResolver(
2970
- chunk,
2971
- parentObject,
2972
- key,
2973
- cyclic,
2974
- response,
2975
- map,
2976
- path
2977
- ) {
2978
- if (initializingChunkBlockedModel) {
2979
- var blocked = initializingChunkBlockedModel;
2980
- cyclic || blocked.deps++;
2981
- } else
2982
- blocked = initializingChunkBlockedModel = {
2983
- deps: cyclic ? 0 : 1,
2984
- value: null
2985
- };
2986
- return function (value) {
2987
- for (var i = 1; i < path.length; i++) value = value[path[i]];
2988
- parentObject[key] = map(response, value);
2989
- "" === key &&
2990
- null === blocked.value &&
2991
- (blocked.value = parentObject[key]);
2992
- blocked.deps--;
2993
- 0 === blocked.deps &&
2994
- "blocked" === chunk.status &&
2995
- ((value = chunk.value),
2996
- (chunk.status = "fulfilled"),
2997
- (chunk.value = blocked.value),
2998
- null !== value && wakeChunk(value, blocked.value));
2999
- };
3000
- }
3001
- function createModelReject(chunk) {
3002
- return function (error) {
3003
- return triggerErrorOnChunk(chunk, error);
3004
- };
3005
- }
3006
- function getOutlinedModel(response, reference, parentObject, key, map) {
3007
- reference = reference.split(":");
3008
- var id = parseInt(reference[0], 16);
3009
- id = getChunk(response, id);
3010
- switch (id.status) {
3011
- case "resolved_model":
3012
- initializeModelChunk(id);
3013
- }
3014
- switch (id.status) {
3015
- case "fulfilled":
3016
- parentObject = id.value;
3017
- for (key = 1; key < reference.length; key++)
3018
- parentObject = parentObject[reference[key]];
3019
- return map(response, parentObject);
3020
- case "pending":
3021
- case "blocked":
3022
- case "cyclic":
3023
- var parentChunk = initializingChunk;
3024
- id.then(
3025
- createModelResolver(
3026
- parentChunk,
3027
- parentObject,
3028
- key,
3029
- "cyclic" === id.status,
3030
- response,
3031
- map,
3032
- reference
3033
- ),
3034
- createModelReject(parentChunk)
3035
- );
3036
- return null;
3037
- default:
3038
- throw id.reason;
3039
- }
3040
- }
3041
- function createMap(response, model) {
3042
- return new Map(model);
3043
- }
3044
- function createSet(response, model) {
3045
- return new Set(model);
3046
- }
3047
- function extractIterator(response, model) {
3048
- return model[Symbol.iterator]();
3049
- }
3050
- function createModel(response, model) {
3051
- return model;
3052
- }
3053
- function parseTypedArray(
3054
- response,
3055
- reference,
3056
- constructor,
3057
- bytesPerElement,
3058
- parentObject,
3059
- parentKey
3060
- ) {
3061
- reference = parseInt(reference.slice(2), 16);
3062
- reference = response._formData.get(response._prefix + reference);
3063
- reference =
3064
- constructor === ArrayBuffer
3065
- ? reference.arrayBuffer()
3066
- : reference.arrayBuffer().then(function (buffer) {
3067
- return new constructor(buffer);
3068
- });
3069
- bytesPerElement = initializingChunk;
3070
- reference.then(
3071
- createModelResolver(
3072
- bytesPerElement,
3073
- parentObject,
3074
- parentKey,
3075
- !1,
3076
- response,
3077
- createModel,
3078
- []
3079
- ),
3080
- createModelReject(bytesPerElement)
3081
- );
3082
- return null;
3083
- }
3084
- function resolveStream(response, id, stream, controller) {
3085
- var chunks = response._chunks;
3086
- stream = new Chunk("fulfilled", stream, controller, response);
3087
- chunks.set(id, stream);
3088
- response = response._formData.getAll(response._prefix + id);
3089
- for (id = 0; id < response.length; id++)
3090
- (chunks = response[id]),
3091
- "C" === chunks[0]
3092
- ? controller.close(
3093
- "C" === chunks ? '"$undefined"' : chunks.slice(1)
3094
- )
3095
- : controller.enqueueModel(chunks);
3096
- }
3097
- function parseReadableStream(response, reference, type) {
3098
- reference = parseInt(reference.slice(2), 16);
3099
- var controller = null;
3100
- type = new ReadableStream({
3101
- type: type,
3102
- start: function (c) {
3103
- controller = c;
3104
- }
3105
- });
3106
- var previousBlockedChunk = null;
3107
- resolveStream(response, reference, type, {
3108
- enqueueModel: function (json) {
3109
- if (null === previousBlockedChunk) {
3110
- var chunk = new Chunk("resolved_model", json, -1, response);
3111
- initializeModelChunk(chunk);
3112
- "fulfilled" === chunk.status
3113
- ? controller.enqueue(chunk.value)
3114
- : (chunk.then(
3115
- function (v) {
3116
- return controller.enqueue(v);
3117
- },
3118
- function (e) {
3119
- return controller.error(e);
3120
- }
3121
- ),
3122
- (previousBlockedChunk = chunk));
3123
- } else {
3124
- chunk = previousBlockedChunk;
3125
- var _chunk = createPendingChunk(response);
3126
- _chunk.then(
3127
- function (v) {
3128
- return controller.enqueue(v);
3129
- },
3130
- function (e) {
3131
- return controller.error(e);
3132
- }
3133
- );
3134
- previousBlockedChunk = _chunk;
3135
- chunk.then(function () {
3136
- previousBlockedChunk === _chunk && (previousBlockedChunk = null);
3137
- resolveModelChunk(_chunk, json, -1);
3138
- });
3139
- }
3140
- },
3141
- close: function () {
3142
- if (null === previousBlockedChunk) controller.close();
3143
- else {
3144
- var blockedChunk = previousBlockedChunk;
3145
- previousBlockedChunk = null;
3146
- blockedChunk.then(function () {
3147
- return controller.close();
3148
- });
3149
- }
3150
- },
3151
- error: function (error) {
3152
- if (null === previousBlockedChunk) controller.error(error);
3153
- else {
3154
- var blockedChunk = previousBlockedChunk;
3155
- previousBlockedChunk = null;
3156
- blockedChunk.then(function () {
3157
- return controller.error(error);
3158
- });
3159
- }
3160
- }
3161
- });
3162
- return type;
3163
- }
3164
- function asyncIterator() {
3165
- return this;
3166
- }
3167
- function createIterator(next) {
3168
- next = { next: next };
3169
- next[ASYNC_ITERATOR] = asyncIterator;
3170
- return next;
3171
- }
3172
- function parseAsyncIterable(response, reference, iterator) {
3173
- reference = parseInt(reference.slice(2), 16);
3174
- var buffer = [],
3175
- closed = !1,
3176
- nextWriteIndex = 0,
3177
- iterable = _defineProperty({}, ASYNC_ITERATOR, function () {
3178
- var nextReadIndex = 0;
3179
- return createIterator(function (arg) {
3180
- if (void 0 !== arg)
3181
- throw Error(
3182
- "Values cannot be passed to next() of AsyncIterables passed to Client Components."
3183
- );
3184
- if (nextReadIndex === buffer.length) {
3185
- if (closed)
3186
- return new Chunk(
3187
- "fulfilled",
3188
- { done: !0, value: void 0 },
3189
- null,
3190
- response
3191
- );
3192
- buffer[nextReadIndex] = createPendingChunk(response);
3193
- }
3194
- return buffer[nextReadIndex++];
3195
- });
3196
- });
3197
- iterator = iterator ? iterable[ASYNC_ITERATOR]() : iterable;
3198
- resolveStream(response, reference, iterator, {
3199
- enqueueModel: function (value) {
3200
- nextWriteIndex === buffer.length
3201
- ? (buffer[nextWriteIndex] = createResolvedIteratorResultChunk(
3202
- response,
3203
- value,
3204
- !1
3205
- ))
3206
- : resolveIteratorResultChunk(buffer[nextWriteIndex], value, !1);
3207
- nextWriteIndex++;
3208
- },
3209
- close: function (value) {
3210
- closed = !0;
3211
- nextWriteIndex === buffer.length
3212
- ? (buffer[nextWriteIndex] = createResolvedIteratorResultChunk(
3213
- response,
3214
- value,
3215
- !0
3216
- ))
3217
- : resolveIteratorResultChunk(buffer[nextWriteIndex], value, !0);
3218
- for (nextWriteIndex++; nextWriteIndex < buffer.length; )
3219
- resolveIteratorResultChunk(
3220
- buffer[nextWriteIndex++],
3221
- '"$undefined"',
3222
- !0
3223
- );
3224
- },
3225
- error: function (error) {
3226
- closed = !0;
3227
- for (
3228
- nextWriteIndex === buffer.length &&
3229
- (buffer[nextWriteIndex] = createPendingChunk(response));
3230
- nextWriteIndex < buffer.length;
3231
-
3232
- )
3233
- triggerErrorOnChunk(buffer[nextWriteIndex++], error);
3234
- }
3235
- });
3236
- return iterator;
3237
- }
3238
- function parseModelString(response, obj, key, value, reference) {
3239
- if ("$" === value[0]) {
3240
- switch (value[1]) {
3241
- case "$":
3242
- return value.slice(1);
3243
- case "@":
3244
- return (
3245
- (obj = parseInt(value.slice(2), 16)), getChunk(response, obj)
3246
- );
3247
- case "F":
3248
- return (
3249
- (value = value.slice(2)),
3250
- (value = getOutlinedModel(
3251
- response,
3252
- value,
3253
- obj,
3254
- key,
3255
- createModel
3256
- )),
3257
- loadServerReference$1(
3258
- response,
3259
- value.id,
3260
- value.bound,
3261
- initializingChunk,
3262
- obj,
3263
- key
3264
- )
3265
- );
3266
- case "T":
3267
- if (
3268
- void 0 === reference ||
3269
- void 0 === response._temporaryReferences
3270
- )
3271
- throw Error(
3272
- "Could not reference an opaque temporary reference. This is likely due to misconfiguring the temporaryReferences options on the server."
3273
- );
3274
- return createTemporaryReference(
3275
- response._temporaryReferences,
3276
- reference
3277
- );
3278
- case "Q":
3279
- return (
3280
- (value = value.slice(2)),
3281
- getOutlinedModel(response, value, obj, key, createMap)
3282
- );
3283
- case "W":
3284
- return (
3285
- (value = value.slice(2)),
3286
- getOutlinedModel(response, value, obj, key, createSet)
3287
- );
3288
- case "K":
3289
- obj = value.slice(2);
3290
- var formPrefix = response._prefix + obj + "_",
3291
- data = new FormData();
3292
- response._formData.forEach(function (entry, entryKey) {
3293
- entryKey.startsWith(formPrefix) &&
3294
- data.append(entryKey.slice(formPrefix.length), entry);
3295
- });
3296
- return data;
3297
- case "i":
3298
- return (
3299
- (value = value.slice(2)),
3300
- getOutlinedModel(response, value, obj, key, extractIterator)
3301
- );
3302
- case "I":
3303
- return Infinity;
3304
- case "-":
3305
- return "$-0" === value ? -0 : -Infinity;
3306
- case "N":
3307
- return NaN;
3308
- case "u":
3309
- return;
3310
- case "D":
3311
- return new Date(Date.parse(value.slice(2)));
3312
- case "n":
3313
- return BigInt(value.slice(2));
3314
- }
3315
- switch (value[1]) {
3316
- case "A":
3317
- return parseTypedArray(response, value, ArrayBuffer, 1, obj, key);
3318
- case "O":
3319
- return parseTypedArray(response, value, Int8Array, 1, obj, key);
3320
- case "o":
3321
- return parseTypedArray(response, value, Uint8Array, 1, obj, key);
3322
- case "U":
3323
- return parseTypedArray(
3324
- response,
3325
- value,
3326
- Uint8ClampedArray,
3327
- 1,
3328
- obj,
3329
- key
3330
- );
3331
- case "S":
3332
- return parseTypedArray(response, value, Int16Array, 2, obj, key);
3333
- case "s":
3334
- return parseTypedArray(response, value, Uint16Array, 2, obj, key);
3335
- case "L":
3336
- return parseTypedArray(response, value, Int32Array, 4, obj, key);
3337
- case "l":
3338
- return parseTypedArray(response, value, Uint32Array, 4, obj, key);
3339
- case "G":
3340
- return parseTypedArray(response, value, Float32Array, 4, obj, key);
3341
- case "g":
3342
- return parseTypedArray(response, value, Float64Array, 8, obj, key);
3343
- case "M":
3344
- return parseTypedArray(response, value, BigInt64Array, 8, obj, key);
3345
- case "m":
3346
- return parseTypedArray(
3347
- response,
3348
- value,
3349
- BigUint64Array,
3350
- 8,
3351
- obj,
3352
- key
3353
- );
3354
- case "V":
3355
- return parseTypedArray(response, value, DataView, 1, obj, key);
3356
- case "B":
3357
- return (
3358
- (obj = parseInt(value.slice(2), 16)),
3359
- response._formData.get(response._prefix + obj)
3360
- );
3361
- }
3362
- switch (value[1]) {
3363
- case "R":
3364
- return parseReadableStream(response, value, void 0);
3365
- case "r":
3366
- return parseReadableStream(response, value, "bytes");
3367
- case "X":
3368
- return parseAsyncIterable(response, value, !1);
3369
- case "x":
3370
- return parseAsyncIterable(response, value, !0);
3371
- }
3372
- value = value.slice(1);
3373
- return getOutlinedModel(response, value, obj, key, createModel);
3374
- }
3375
- return value;
3376
- }
3377
- function createResponse(
3378
- bundlerConfig,
3379
- formFieldPrefix,
3380
- temporaryReferences
3381
- ) {
3382
- var backingFormData =
3383
- 3 < arguments.length && void 0 !== arguments[3]
3384
- ? arguments[3]
3385
- : new FormData(),
3386
- chunks = new Map();
3387
- return {
3388
- _bundlerConfig: bundlerConfig,
3389
- _prefix: formFieldPrefix,
3390
- _formData: backingFormData,
3391
- _chunks: chunks,
3392
- _closed: !1,
3393
- _closedReason: null,
3394
- _temporaryReferences: temporaryReferences
3395
- };
3396
- }
3397
- function close(response) {
3398
- reportGlobalError(response, Error("Connection closed."));
3399
- }
3400
- function loadServerReference(bundlerConfig, id, bound) {
3401
- var serverReference = resolveServerReference(bundlerConfig, id);
3402
- bundlerConfig = preloadModule(serverReference);
3403
- return bound
3404
- ? Promise.all([bound, bundlerConfig]).then(function (_ref) {
3405
- _ref = _ref[0];
3406
- var fn = requireModule(serverReference);
3407
- return fn.bind.apply(fn, [null].concat(_ref));
3408
- })
3409
- : bundlerConfig
3410
- ? Promise.resolve(bundlerConfig).then(function () {
3411
- return requireModule(serverReference);
3412
- })
3413
- : Promise.resolve(requireModule(serverReference));
3414
- }
3415
- function decodeBoundActionMetaData(body, serverManifest, formFieldPrefix) {
3416
- body = createResponse(serverManifest, formFieldPrefix, void 0, body);
3417
- close(body);
3418
- body = getChunk(body, 0);
3419
- body.then(function () {});
3420
- if ("fulfilled" !== body.status) throw body.reason;
3421
- return body.value;
3422
- }
3423
- var ReactDOM = require("react-dom"),
3424
- React = require("react"),
3425
- channel = new MessageChannel(),
3426
- taskQueue = [];
3427
- channel.port1.onmessage = function () {
3428
- var task = taskQueue.shift();
3429
- task && task();
3430
- };
3431
- var LocalPromise = Promise,
3432
- scheduleMicrotask =
3433
- "function" === typeof queueMicrotask
3434
- ? queueMicrotask
3435
- : function (callback) {
3436
- LocalPromise.resolve(null)
3437
- .then(callback)
3438
- .catch(handleErrorInNextTick);
3439
- },
3440
- currentView = null,
3441
- writtenBytes = 0,
3442
- textEncoder = new TextEncoder(),
3443
- CLIENT_REFERENCE_TAG$1 = Symbol.for("react.client.reference"),
3444
- SERVER_REFERENCE_TAG = Symbol.for("react.server.reference"),
3445
- FunctionBind = Function.prototype.bind,
3446
- ArraySlice = Array.prototype.slice,
3447
- PROMISE_PROTOTYPE = Promise.prototype,
3448
- deepProxyHandlers = {
3449
- get: function (target, name) {
3450
- switch (name) {
3451
- case "$$typeof":
3452
- return target.$$typeof;
3453
- case "$$id":
3454
- return target.$$id;
3455
- case "$$async":
3456
- return target.$$async;
3457
- case "name":
3458
- return target.name;
3459
- case "displayName":
3460
- return;
3461
- case "defaultProps":
3462
- return;
3463
- case "toJSON":
3464
- return;
3465
- case Symbol.toPrimitive:
3466
- return Object.prototype[Symbol.toPrimitive];
3467
- case Symbol.toStringTag:
3468
- return Object.prototype[Symbol.toStringTag];
3469
- case "Provider":
3470
- throw Error(
3471
- "Cannot render a Client Context Provider on the Server. Instead, you can export a Client Component wrapper that itself renders a Client Context Provider."
3472
- );
3473
- case "then":
3474
- throw Error(
3475
- "Cannot await or return from a thenable. You cannot await a client module from a server component."
3476
- );
3477
- }
3478
- throw Error(
3479
- "Cannot access " +
3480
- (String(target.name) + "." + String(name)) +
3481
- " on the server. You cannot dot into a client module from a server component. You can only pass the imported name through."
3482
- );
3483
- },
3484
- set: function () {
3485
- throw Error("Cannot assign to a client module from a server module.");
3486
- }
3487
- },
3488
- proxyHandlers$1 = {
3489
- get: function (target, name) {
3490
- return getReference(target, name);
3491
- },
3492
- getOwnPropertyDescriptor: function (target, name) {
3493
- var descriptor = Object.getOwnPropertyDescriptor(target, name);
3494
- descriptor ||
3495
- ((descriptor = {
3496
- value: getReference(target, name),
3497
- writable: !1,
3498
- configurable: !1,
3499
- enumerable: !1
3500
- }),
3501
- Object.defineProperty(target, name, descriptor));
3502
- return descriptor;
3503
- },
3504
- getPrototypeOf: function () {
3505
- return PROMISE_PROTOTYPE;
3506
- },
3507
- set: function () {
3508
- throw Error("Cannot assign to a client module from a server module.");
3509
- }
3510
- },
3511
- ReactDOMSharedInternals =
3512
- ReactDOM.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
3513
- previousDispatcher = ReactDOMSharedInternals.d;
3514
- ReactDOMSharedInternals.d = {
3515
- f: previousDispatcher.f,
3516
- r: previousDispatcher.r,
3517
- D: function (href) {
3518
- if ("string" === typeof href && href) {
3519
- var request = currentRequest ? currentRequest : null;
3520
- if (request) {
3521
- var hints = request.hints,
3522
- key = "D|" + href;
3523
- hints.has(key) || (hints.add(key), emitHint(request, "D", href));
3524
- } else previousDispatcher.D(href);
3525
- }
3526
- },
3527
- C: function (href, crossOrigin) {
3528
- if ("string" === typeof href) {
3529
- var request = currentRequest ? currentRequest : null;
3530
- if (request) {
3531
- var hints = request.hints,
3532
- key =
3533
- "C|" +
3534
- (null == crossOrigin ? "null" : crossOrigin) +
3535
- "|" +
3536
- href;
3537
- hints.has(key) ||
3538
- (hints.add(key),
3539
- "string" === typeof crossOrigin
3540
- ? emitHint(request, "C", [href, crossOrigin])
3541
- : emitHint(request, "C", href));
3542
- } else previousDispatcher.C(href, crossOrigin);
3543
- }
3544
- },
3545
- L: function (href, as, options) {
3546
- if ("string" === typeof href) {
3547
- var request = currentRequest ? currentRequest : null;
3548
- if (request) {
3549
- var hints = request.hints,
3550
- key = "L";
3551
- if ("image" === as && options) {
3552
- var imageSrcSet = options.imageSrcSet,
3553
- imageSizes = options.imageSizes,
3554
- uniquePart = "";
3555
- "string" === typeof imageSrcSet && "" !== imageSrcSet
3556
- ? ((uniquePart += "[" + imageSrcSet + "]"),
3557
- "string" === typeof imageSizes &&
3558
- (uniquePart += "[" + imageSizes + "]"))
3559
- : (uniquePart += "[][]" + href);
3560
- key += "[image]" + uniquePart;
3561
- } else key += "[" + as + "]" + href;
3562
- hints.has(key) ||
3563
- (hints.add(key),
3564
- (options = trimOptions(options))
3565
- ? emitHint(request, "L", [href, as, options])
3566
- : emitHint(request, "L", [href, as]));
3567
- } else previousDispatcher.L(href, as, options);
3568
- }
3569
- },
3570
- m: function (href, options) {
3571
- if ("string" === typeof href) {
3572
- var request = currentRequest ? currentRequest : null;
3573
- if (request) {
3574
- var hints = request.hints,
3575
- key = "m|" + href;
3576
- if (hints.has(key)) return;
3577
- hints.add(key);
3578
- return (options = trimOptions(options))
3579
- ? emitHint(request, "m", [href, options])
3580
- : emitHint(request, "m", href);
3581
- }
3582
- previousDispatcher.m(href, options);
3583
- }
3584
- },
3585
- X: function (src, options) {
3586
- if ("string" === typeof src) {
3587
- var request = currentRequest ? currentRequest : null;
3588
- if (request) {
3589
- var hints = request.hints,
3590
- key = "X|" + src;
3591
- if (hints.has(key)) return;
3592
- hints.add(key);
3593
- return (options = trimOptions(options))
3594
- ? emitHint(request, "X", [src, options])
3595
- : emitHint(request, "X", src);
3596
- }
3597
- previousDispatcher.X(src, options);
3598
- }
3599
- },
3600
- S: function (href, precedence, options) {
3601
- if ("string" === typeof href) {
3602
- var request = currentRequest ? currentRequest : null;
3603
- if (request) {
3604
- var hints = request.hints,
3605
- key = "S|" + href;
3606
- if (hints.has(key)) return;
3607
- hints.add(key);
3608
- return (options = trimOptions(options))
3609
- ? emitHint(request, "S", [
3610
- href,
3611
- "string" === typeof precedence ? precedence : 0,
3612
- options
3613
- ])
3614
- : "string" === typeof precedence
3615
- ? emitHint(request, "S", [href, precedence])
3616
- : emitHint(request, "S", href);
3617
- }
3618
- previousDispatcher.S(href, precedence, options);
3619
- }
3620
- },
3621
- M: function (src, options) {
3622
- if ("string" === typeof src) {
3623
- var request = currentRequest ? currentRequest : null;
3624
- if (request) {
3625
- var hints = request.hints,
3626
- key = "M|" + src;
3627
- if (hints.has(key)) return;
3628
- hints.add(key);
3629
- return (options = trimOptions(options))
3630
- ? emitHint(request, "M", [src, options])
3631
- : emitHint(request, "M", src);
3632
- }
3633
- previousDispatcher.M(src, options);
3634
- }
3635
- }
3636
- };
3637
- var frameRegExp =
3638
- /^ {3} at (?:(.+) \((?:(.+):(\d+):(\d+)|<anonymous>)\)|(?:async )?(.+):(\d+):(\d+)|<anonymous>)$/,
3639
- TEMPORARY_REFERENCE_TAG = Symbol.for("react.temporary.reference"),
3640
- proxyHandlers = {
3641
- get: function (target, name) {
3642
- switch (name) {
3643
- case "$$typeof":
3644
- return target.$$typeof;
3645
- case "name":
3646
- return;
3647
- case "displayName":
3648
- return;
3649
- case "defaultProps":
3650
- return;
3651
- case "toJSON":
3652
- return;
3653
- case Symbol.toPrimitive:
3654
- return Object.prototype[Symbol.toPrimitive];
3655
- case Symbol.toStringTag:
3656
- return Object.prototype[Symbol.toStringTag];
3657
- case "Provider":
3658
- throw Error(
3659
- "Cannot render a Client Context Provider on the Server. Instead, you can export a Client Component wrapper that itself renders a Client Context Provider."
3660
- );
3661
- }
3662
- throw Error(
3663
- "Cannot access " +
3664
- String(name) +
3665
- " on the server. You cannot dot into a temporary client reference from a server component. You can only pass the value through to the client."
3666
- );
3667
- },
3668
- set: function () {
3669
- throw Error(
3670
- "Cannot assign to a temporary client reference from a server module."
3671
- );
3672
- }
3673
- },
3674
- REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"),
3675
- REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
3676
- REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
3677
- REACT_CONTEXT_TYPE = Symbol.for("react.context"),
3678
- REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
3679
- REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"),
3680
- REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"),
3681
- REACT_MEMO_TYPE = Symbol.for("react.memo"),
3682
- REACT_LAZY_TYPE = Symbol.for("react.lazy"),
3683
- REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel");
3684
- Symbol.for("react.postpone");
3685
- var MAYBE_ITERATOR_SYMBOL = Symbol.iterator,
3686
- ASYNC_ITERATOR = Symbol.asyncIterator,
3687
- SuspenseException = Error(
3688
- "Suspense Exception: This is not a real error! It's an implementation detail of `use` to interrupt the current render. You must either rethrow it immediately, or move the `use` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary, or call the promise's `.catch` method and pass the result to `use`."
3689
- ),
3690
- suspendedThenable = null,
3691
- currentRequest$1 = null,
3692
- thenableIndexCounter = 0,
3693
- thenableState = null,
3694
- currentComponentDebugInfo = null,
3695
- HooksDispatcher = {
3696
- readContext: unsupportedContext,
3697
- use: function (usable) {
3698
- if (
3699
- (null !== usable && "object" === typeof usable) ||
3700
- "function" === typeof usable
3701
- ) {
3702
- if ("function" === typeof usable.then) {
3703
- var index = thenableIndexCounter;
3704
- thenableIndexCounter += 1;
3705
- null === thenableState && (thenableState = []);
3706
- return trackUsedThenable(thenableState, usable, index);
3707
- }
3708
- usable.$$typeof === REACT_CONTEXT_TYPE && unsupportedContext();
3709
- }
3710
- if (isClientReference(usable)) {
3711
- if (
3712
- null != usable.value &&
3713
- usable.value.$$typeof === REACT_CONTEXT_TYPE
3714
- )
3715
- throw Error(
3716
- "Cannot read a Client Context from a Server Component."
3717
- );
3718
- throw Error("Cannot use() an already resolved Client Reference.");
3719
- }
3720
- throw Error(
3721
- "An unsupported type was passed to use(): " + String(usable)
3722
- );
3723
- },
3724
- useCallback: function (callback) {
3725
- return callback;
3726
- },
3727
- useContext: unsupportedContext,
3728
- useEffect: unsupportedHook,
3729
- useImperativeHandle: unsupportedHook,
3730
- useLayoutEffect: unsupportedHook,
3731
- useInsertionEffect: unsupportedHook,
3732
- useMemo: function (nextCreate) {
3733
- return nextCreate();
3734
- },
3735
- useReducer: unsupportedHook,
3736
- useRef: unsupportedHook,
3737
- useState: unsupportedHook,
3738
- useDebugValue: function () {},
3739
- useDeferredValue: unsupportedHook,
3740
- useTransition: unsupportedHook,
3741
- useSyncExternalStore: unsupportedHook,
3742
- useId: function () {
3743
- if (null === currentRequest$1)
3744
- throw Error("useId can only be used while React is rendering");
3745
- var id = currentRequest$1.identifierCount++;
3746
- return (
3747
- ":" +
3748
- currentRequest$1.identifierPrefix +
3749
- "S" +
3750
- id.toString(32) +
3751
- ":"
3752
- );
3753
- },
3754
- useHostTransitionStatus: unsupportedHook,
3755
- useFormState: unsupportedHook,
3756
- useActionState: unsupportedHook,
3757
- useOptimistic: unsupportedHook,
3758
- useMemoCache: function (size) {
3759
- for (var data = Array(size), i = 0; i < size; i++)
3760
- data[i] = REACT_MEMO_CACHE_SENTINEL;
3761
- return data;
3762
- },
3763
- useCacheRefresh: function () {
3764
- return unsupportedRefresh;
3765
- }
3766
- },
3767
- currentOwner = null,
3768
- DefaultAsyncDispatcher = {
3769
- getCacheForType: function (resourceType) {
3770
- var cache = (cache = currentRequest ? currentRequest : null)
3771
- ? cache.cache
3772
- : new Map();
3773
- var entry = cache.get(resourceType);
3774
- void 0 === entry &&
3775
- ((entry = resourceType()), cache.set(resourceType, entry));
3776
- return entry;
3777
- }
3778
- };
3779
- DefaultAsyncDispatcher.getOwner = resolveOwner;
3780
- var ReactSharedInternalsServer =
3781
- React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
3782
- if (!ReactSharedInternalsServer)
3783
- throw Error(
3784
- 'The "react" package in this environment is not configured correctly. The "react-server" condition must be enabled in any environment that runs React Server Components.'
3785
- );
3786
- var prefix, suffix;
3787
- new ("function" === typeof WeakMap ? WeakMap : Map)();
3788
- var lastResetTime = 0;
3789
- if (
3790
- "object" === typeof performance &&
3791
- "function" === typeof performance.now
3792
- ) {
3793
- var localPerformance = performance;
3794
- var getCurrentTime = function () {
3795
- return localPerformance.now();
3796
- };
3797
- } else {
3798
- var localDate = Date;
3799
- getCurrentTime = function () {
3800
- return localDate.now();
3801
- };
3802
- }
3803
- var callComponent = {
3804
- "react-stack-bottom-frame": function (
3805
- Component,
3806
- props,
3807
- componentDebugInfo
3808
- ) {
3809
- currentOwner = componentDebugInfo;
3810
- try {
3811
- return Component(props, void 0);
3812
- } finally {
3813
- currentOwner = null;
3814
- }
3815
- }
3816
- },
3817
- callComponentInDEV =
3818
- callComponent["react-stack-bottom-frame"].bind(callComponent),
3819
- callLazyInit = {
3820
- "react-stack-bottom-frame": function (lazy) {
3821
- var init = lazy._init;
3822
- return init(lazy._payload);
3823
- }
3824
- },
3825
- callLazyInitInDEV =
3826
- callLazyInit["react-stack-bottom-frame"].bind(callLazyInit),
3827
- callIterator = {
3828
- "react-stack-bottom-frame": function (iterator, progress, error) {
3829
- iterator.next().then(progress, error);
3830
- }
3831
- },
3832
- callIteratorInDEV =
3833
- callIterator["react-stack-bottom-frame"].bind(callIterator),
3834
- isArrayImpl = Array.isArray,
3835
- getPrototypeOf = Object.getPrototypeOf,
3836
- jsxPropsParents = new WeakMap(),
3837
- jsxChildrenParents = new WeakMap(),
3838
- CLIENT_REFERENCE_TAG = Symbol.for("react.client.reference"),
3839
- doNotLimit = new WeakSet();
3840
- "object" === typeof console &&
3841
- null !== console &&
3842
- (patchConsole(console, "assert"),
3843
- patchConsole(console, "debug"),
3844
- patchConsole(console, "dir"),
3845
- patchConsole(console, "dirxml"),
3846
- patchConsole(console, "error"),
3847
- patchConsole(console, "group"),
3848
- patchConsole(console, "groupCollapsed"),
3849
- patchConsole(console, "groupEnd"),
3850
- patchConsole(console, "info"),
3851
- patchConsole(console, "log"),
3852
- patchConsole(console, "table"),
3853
- patchConsole(console, "trace"),
3854
- patchConsole(console, "warn"));
3855
- var ObjectPrototype = Object.prototype,
3856
- stringify = JSON.stringify,
3857
- PENDING$1 = 0,
3858
- COMPLETED = 1,
3859
- ABORTED = 3,
3860
- ERRORED$1 = 4,
3861
- RENDERING = 5,
3862
- OPENING = 10,
3863
- ABORTING = 12,
3864
- CLOSING = 13,
3865
- CLOSED = 14,
3866
- PRERENDER = 21,
3867
- currentRequest = null,
3868
- debugID = null,
3869
- modelRoot = !1,
3870
- emptyRoot = {},
3871
- chunkCache = new Map(),
3872
- chunkMap = new Map(),
3873
- webpackGetChunkFilename = __webpack_require__.u;
3874
- __webpack_require__.u = function (chunkId) {
3875
- var flightChunk = chunkMap.get(chunkId);
3876
- return void 0 !== flightChunk
3877
- ? flightChunk
3878
- : webpackGetChunkFilename(chunkId);
3879
- };
3880
- var hasOwnProperty = Object.prototype.hasOwnProperty;
3881
- Chunk.prototype = Object.create(Promise.prototype);
3882
- Chunk.prototype.then = function (resolve, reject) {
3883
- switch (this.status) {
3884
- case "resolved_model":
3885
- initializeModelChunk(this);
3886
- }
3887
- switch (this.status) {
3888
- case "fulfilled":
3889
- resolve(this.value);
3890
- break;
3891
- case "pending":
3892
- case "blocked":
3893
- case "cyclic":
3894
- resolve &&
3895
- (null === this.value && (this.value = []),
3896
- this.value.push(resolve));
3897
- reject &&
3898
- (null === this.reason && (this.reason = []),
3899
- this.reason.push(reject));
3900
- break;
3901
- default:
3902
- reject(this.reason);
3903
- }
3904
- };
3905
- var initializingChunk = null,
3906
- initializingChunkBlockedModel = null;
3907
- exports.createClientModuleProxy = function (moduleId) {
3908
- moduleId = registerClientReferenceImpl({}, moduleId, !1);
3909
- return new Proxy(moduleId, proxyHandlers$1);
3910
- };
3911
- exports.createTemporaryReferenceSet = function () {
3912
- return new WeakMap();
3913
- };
3914
- exports.decodeAction = function (body, serverManifest) {
3915
- var formData = new FormData(),
3916
- action = null;
3917
- body.forEach(function (value, key) {
3918
- key.startsWith("$ACTION_")
3919
- ? key.startsWith("$ACTION_REF_")
3920
- ? ((value = "$ACTION_" + key.slice(12) + ":"),
3921
- (value = decodeBoundActionMetaData(body, serverManifest, value)),
3922
- (action = loadServerReference(
3923
- serverManifest,
3924
- value.id,
3925
- value.bound
3926
- )))
3927
- : key.startsWith("$ACTION_ID_") &&
3928
- ((value = key.slice(11)),
3929
- (action = loadServerReference(serverManifest, value, null)))
3930
- : formData.append(key, value);
3931
- });
3932
- return null === action
3933
- ? null
3934
- : action.then(function (fn) {
3935
- return fn.bind(null, formData);
3936
- });
3937
- };
3938
- exports.decodeFormState = function (actionResult, body, serverManifest) {
3939
- var keyPath = body.get("$ACTION_KEY");
3940
- if ("string" !== typeof keyPath) return Promise.resolve(null);
3941
- var metaData = null;
3942
- body.forEach(function (value, key) {
3943
- key.startsWith("$ACTION_REF_") &&
3944
- ((value = "$ACTION_" + key.slice(12) + ":"),
3945
- (metaData = decodeBoundActionMetaData(body, serverManifest, value)));
3946
- });
3947
- if (null === metaData) return Promise.resolve(null);
3948
- var referenceId = metaData.id;
3949
- return Promise.resolve(metaData.bound).then(function (bound) {
3950
- return null === bound
3951
- ? null
3952
- : [actionResult, keyPath, referenceId, bound.length - 1];
3953
- });
3954
- };
3955
- exports.decodeReply = function (body, webpackMap, options) {
3956
- if ("string" === typeof body) {
3957
- var form = new FormData();
3958
- form.append("0", body);
3959
- body = form;
3960
- }
3961
- body = createResponse(
3962
- webpackMap,
3963
- "",
3964
- options ? options.temporaryReferences : void 0,
3965
- body
3966
- );
3967
- webpackMap = getChunk(body, 0);
3968
- close(body);
3969
- return webpackMap;
3970
- };
3971
- exports.registerClientReference = function (
3972
- proxyImplementation,
3973
- id,
3974
- exportName
3975
- ) {
3976
- return registerClientReferenceImpl(
3977
- proxyImplementation,
3978
- id + "#" + exportName,
3979
- !1
3980
- );
3981
- };
3982
- exports.registerServerReference = function (reference, id, exportName) {
3983
- return Object.defineProperties(reference, {
3984
- $$typeof: { value: SERVER_REFERENCE_TAG },
3985
- $$id: {
3986
- value: null === exportName ? id : id + "#" + exportName,
3987
- configurable: !0
3988
- },
3989
- $$bound: { value: null, configurable: !0 },
3990
- $$location: { value: Error("react-stack-top-frame"), configurable: !0 },
3991
- bind: { value: bind, configurable: !0 }
3992
- });
3993
- };
3994
- exports.renderToReadableStream = function (model, webpackMap, options) {
3995
- var request = createRequest(
3996
- model,
3997
- webpackMap,
3998
- options ? options.onError : void 0,
3999
- options ? options.identifierPrefix : void 0,
4000
- options ? options.onPostpone : void 0,
4001
- options ? options.temporaryReferences : void 0,
4002
- options ? options.environmentName : void 0,
4003
- options ? options.filterStackFrame : void 0
4004
- );
4005
- if (options && options.signal) {
4006
- var signal = options.signal;
4007
- if (signal.aborted) abort(request, signal.reason);
4008
- else {
4009
- var listener = function () {
4010
- abort(request, signal.reason);
4011
- signal.removeEventListener("abort", listener);
4012
- };
4013
- signal.addEventListener("abort", listener);
4014
- }
4015
- }
4016
- return new ReadableStream(
4017
- {
4018
- type: "bytes",
4019
- start: function () {
4020
- startWork(request);
4021
- },
4022
- pull: function (controller) {
4023
- startFlowing(request, controller);
4024
- },
4025
- cancel: function (reason) {
4026
- request.destination = null;
4027
- abort(request, reason);
4028
- }
4029
- },
4030
- { highWaterMark: 0 }
4031
- );
4032
- };
4033
- exports.unstable_prerender = function (model, webpackMap, options) {
4034
- return new Promise(function (resolve, reject) {
4035
- var request = createPrerenderRequest(
4036
- model,
4037
- webpackMap,
4038
- function () {
4039
- var stream = new ReadableStream(
4040
- {
4041
- type: "bytes",
4042
- start: function () {
4043
- startWork(request);
4044
- },
4045
- pull: function (controller) {
4046
- startFlowing(request, controller);
4047
- },
4048
- cancel: function (reason) {
4049
- request.destination = null;
4050
- abort(request, reason);
4051
- }
4052
- },
4053
- { highWaterMark: 0 }
4054
- );
4055
- resolve({ prelude: stream });
4056
- },
4057
- reject,
4058
- options ? options.onError : void 0,
4059
- options ? options.identifierPrefix : void 0,
4060
- options ? options.onPostpone : void 0,
4061
- options ? options.temporaryReferences : void 0,
4062
- options ? options.environmentName : void 0,
4063
- options ? options.filterStackFrame : void 0
4064
- );
4065
- if (options && options.signal) {
4066
- var signal = options.signal;
4067
- if (signal.aborted) abort(request, signal.reason);
4068
- else {
4069
- var listener = function () {
4070
- abort(request, signal.reason);
4071
- signal.removeEventListener("abort", listener);
4072
- };
4073
- signal.addEventListener("abort", listener);
4074
- }
4075
- }
4076
- startWork(request);
4077
- });
4078
- };
4079
- })();