@vitejs/plugin-rsc 0.4.10 → 0.4.12

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