@shopify/hydrogen 1.2.0 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/esnext/components/CartProvider/CartProvider.client.js +6 -0
- package/dist/esnext/components/CartProvider/cart-queries.d.ts +1 -1
- package/dist/esnext/components/CartProvider/cart-queries.js +1 -0
- package/dist/esnext/components/ExternalVideo/ExternalVideo.js +2 -2
- package/dist/esnext/components/Image/Image.d.ts +1 -1
- package/dist/esnext/components/Image/Image.js +4 -4
- package/dist/esnext/components/Image/index.d.ts +1 -1
- package/dist/esnext/components/index.d.ts +1 -1
- package/dist/esnext/components/index.js +1 -1
- package/dist/esnext/constants.d.ts +1 -0
- package/dist/esnext/constants.js +1 -0
- package/dist/esnext/entry-client.js +1 -1
- package/dist/esnext/entry-server.js +30 -28
- package/dist/esnext/experimental.d.ts +1 -0
- package/dist/esnext/experimental.js +1 -0
- package/dist/esnext/foundation/Cache/cache.js +0 -1
- package/dist/esnext/foundation/HydrogenRequest/HydrogenRequest.server.d.ts +1 -0
- package/dist/esnext/foundation/HydrogenRequest/HydrogenRequest.server.js +1 -0
- package/dist/esnext/foundation/HydrogenResponse/HydrogenResponse.server.d.ts +4 -2
- package/dist/esnext/foundation/HydrogenResponse/HydrogenResponse.server.js +17 -16
- package/dist/esnext/foundation/ServerPropsProvider/ServerPropsProvider.js +1 -3
- package/dist/esnext/foundation/fetchSync/ResponseSync.d.ts +2 -1
- package/dist/esnext/foundation/fetchSync/ResponseSync.js +14 -2
- package/dist/esnext/foundation/session/session-types.d.ts +2 -0
- package/dist/esnext/foundation/session/session.d.ts +3 -0
- package/dist/esnext/foundation/session/session.js +16 -0
- package/dist/esnext/foundation/useQuery/hooks.d.ts +3 -0
- package/dist/esnext/foundation/useQuery/hooks.js +1 -1
- package/dist/esnext/foundation/useSession/useSession.d.ts +1 -0
- package/dist/esnext/foundation/useSession/useSession.js +13 -0
- package/dist/esnext/framework/plugin.js +6 -5
- package/dist/esnext/framework/plugins/vite-plugin-assets-version.d.ts +2 -0
- package/dist/esnext/framework/plugins/vite-plugin-assets-version.js +12 -0
- package/dist/esnext/framework/plugins/vite-plugin-client-imports.js +6 -3
- package/dist/esnext/framework/plugins/vite-plugin-css-modules-rsc.js +3 -0
- package/dist/esnext/framework/plugins/vite-plugin-css-rsc.js +8 -5
- package/dist/esnext/framework/plugins/vite-plugin-hydration-auto-import.js +7 -1
- package/dist/{node/framework/plugins/vite-plugin-purge-query-cache.d.ts → esnext/framework/plugins/vite-plugin-hydrogen-client-components-cache.d.ts} +1 -1
- package/dist/esnext/framework/plugins/{vite-plugin-hydrogen-client-middleware.js → vite-plugin-hydrogen-client-components-cache.js} +2 -2
- package/dist/esnext/framework/plugins/vite-plugin-hydrogen-config.d.ts +2 -1
- package/dist/esnext/framework/plugins/vite-plugin-hydrogen-config.js +104 -90
- package/dist/esnext/framework/plugins/vite-plugin-hydrogen-middleware.js +6 -6
- package/dist/esnext/framework/plugins/vite-plugin-hydrogen-suppress-warnings.js +5 -0
- package/dist/esnext/framework/plugins/vite-plugin-hydrogen-virtual-files.js +45 -7
- package/dist/esnext/framework/plugins/vite-plugin-platform-entry.js +14 -1
- package/dist/esnext/framework/plugins/vite-plugin-ssr-interop.js +5 -1
- package/dist/esnext/framework/types.d.ts +1 -0
- package/dist/esnext/framework/viteception.js +7 -1
- package/dist/esnext/storefront-api-types.d.ts +38 -31
- package/dist/esnext/storefront-api-types.js +4 -2
- package/dist/esnext/types.d.ts +2 -1
- package/dist/esnext/utilities/apiRoutes.d.ts +2 -0
- package/dist/esnext/utilities/apiRoutes.js +12 -1
- package/dist/esnext/utilities/fetch.js +4 -1
- package/dist/esnext/utilities/log/log.js +20 -5
- package/dist/esnext/utilities/log/utils.js +1 -1
- package/dist/esnext/utilities/template.d.ts +7 -6
- package/dist/esnext/utilities/template.js +39 -1
- package/dist/esnext/utilities/vite.d.ts +1 -0
- package/dist/esnext/utilities/vite.js +4 -0
- package/dist/esnext/version.d.ts +1 -1
- package/dist/esnext/version.js +1 -1
- package/dist/node/foundation/session/session-types.d.ts +2 -0
- package/dist/node/framework/plugin.js +6 -5
- package/dist/node/framework/plugins/vite-plugin-assets-version.d.ts +2 -0
- package/dist/node/framework/plugins/vite-plugin-assets-version.js +15 -0
- package/dist/node/framework/plugins/vite-plugin-client-imports.js +6 -3
- package/dist/node/framework/plugins/vite-plugin-css-modules-rsc.js +3 -0
- package/dist/node/framework/plugins/vite-plugin-css-rsc.js +8 -5
- package/dist/node/framework/plugins/vite-plugin-hydration-auto-import.js +7 -1
- package/dist/{esnext/framework/plugins/vite-plugin-purge-query-cache.d.ts → node/framework/plugins/vite-plugin-hydrogen-client-components-cache.d.ts} +1 -1
- package/dist/node/framework/plugins/{vite-plugin-hydrogen-client-middleware.js → vite-plugin-hydrogen-client-components-cache.js} +2 -2
- package/dist/node/framework/plugins/vite-plugin-hydrogen-config.d.ts +2 -1
- package/dist/node/framework/plugins/vite-plugin-hydrogen-config.js +107 -90
- package/dist/node/framework/plugins/vite-plugin-hydrogen-middleware.js +6 -6
- package/dist/node/framework/plugins/vite-plugin-hydrogen-suppress-warnings.js +5 -0
- package/dist/node/framework/plugins/vite-plugin-hydrogen-virtual-files.js +45 -7
- package/dist/node/framework/plugins/vite-plugin-platform-entry.js +14 -1
- package/dist/node/framework/plugins/vite-plugin-ssr-interop.js +5 -1
- package/dist/node/framework/types.d.ts +1 -0
- package/dist/node/framework/viteception.js +7 -1
- package/dist/node/utilities/vite.d.ts +1 -0
- package/dist/node/utilities/vite.js +30 -0
- package/package.json +7 -6
- package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-plugin.js +36 -25
- package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-writer.browser.development.server.js +105 -29
- package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-writer.browser.production.min.server.js +30 -29
- package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-writer.node.development.server.js +92 -29
- package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-writer.node.production.min.server.js +31 -29
- package/vendor/react-server-dom-vite/esm/react-server-dom-vite-plugin.js +29 -18
- package/vendor/react-server-dom-vite/esm/react-server-dom-vite-writer.browser.server.js +105 -29
- package/vendor/react-server-dom-vite/esm/react-server-dom-vite-writer.node.server.js +92 -29
- package/vendor/react-server-dom-vite/package.json +2 -2
- package/dist/esnext/framework/plugins/vite-plugin-hydrogen-client-middleware.d.ts +0 -9
- package/dist/esnext/framework/plugins/vite-plugin-purge-query-cache.js +0 -11
- package/dist/node/framework/plugins/vite-plugin-hydrogen-client-middleware.d.ts +0 -9
- package/dist/node/framework/plugins/vite-plugin-purge-query-cache.js +0 -16
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
|
|
15
15
|
var esModuleLexer = require('es-module-lexer');
|
|
16
16
|
var MagicString = require('magic-string');
|
|
17
|
-
var vite = require('vite');
|
|
18
17
|
var fs = require('fs');
|
|
19
18
|
var path = require('path');
|
|
19
|
+
var vite = require('vite');
|
|
20
20
|
|
|
21
21
|
function _unsupportedIterableToArray(o, minLen) {
|
|
22
22
|
if (!o) return;
|
|
@@ -94,6 +94,10 @@ function _createForOfIteratorHelper(o, allowArrayLike) {
|
|
|
94
94
|
|
|
95
95
|
var assign = Object.assign;
|
|
96
96
|
|
|
97
|
+
var normalizePath = vite.normalizePath,
|
|
98
|
+
transformWithEsbuild = vite.transformWithEsbuild,
|
|
99
|
+
createServer = vite.createServer;
|
|
100
|
+
var isVite3 = vite.version && vite.version.startsWith('3.');
|
|
97
101
|
var rscViteFileRE = /\/react-server-dom-vite.js/;
|
|
98
102
|
var noProxyRE = /[&?]no-proxy($|&)/;
|
|
99
103
|
|
|
@@ -128,10 +132,10 @@ function ReactFlightVitePlugin() {
|
|
|
128
132
|
enforce: 'pre',
|
|
129
133
|
buildStart: function () {
|
|
130
134
|
// Let other plugins differentiate between pure SSR and RSC builds
|
|
131
|
-
if (config?.build?.ssr) process.env.
|
|
135
|
+
if (config?.build?.ssr) process.env.VITE_RSC_BUILD = 'true';
|
|
132
136
|
},
|
|
133
137
|
buildEnd: function () {
|
|
134
|
-
if (config?.build?.ssr) delete process.env.
|
|
138
|
+
if (config?.build?.ssr) delete process.env.VITE_RSC_BUILD;
|
|
135
139
|
},
|
|
136
140
|
configureServer: function (_server) {
|
|
137
141
|
server = _server;
|
|
@@ -267,11 +271,11 @@ function ReactFlightVitePlugin() {
|
|
|
267
271
|
var injectGlobs = function (clientComponents) {
|
|
268
272
|
var importerPath = path.dirname(id);
|
|
269
273
|
var importers = clientComponents.map(function (absolutePath) {
|
|
270
|
-
return
|
|
274
|
+
return normalizePath(path.relative(importerPath, absolutePath));
|
|
271
275
|
});
|
|
272
276
|
var injectedGlobs = "Object.assign(Object.create(null), " + importers.map(function (glob) {
|
|
273
277
|
return (// Mark the globs to modify the result after Vite resolves them.
|
|
274
|
-
"\n/* HASH_BEGIN */ " + ("import.meta.glob('" +
|
|
278
|
+
"\n/* HASH_BEGIN */ " + ("import.meta.glob('" + normalizePath(glob) + "') /* HASH_END */")
|
|
275
279
|
);
|
|
276
280
|
}).join(', ') + ");";
|
|
277
281
|
s.replace(INJECTING_RE, injectedGlobs);
|
|
@@ -302,7 +306,7 @@ function ReactFlightVitePlugin() {
|
|
|
302
306
|
throw new Error('[react-server-dom-vite] Parameter serverBuildEntries is required for client build');
|
|
303
307
|
}
|
|
304
308
|
|
|
305
|
-
return findClientBoundariesForClientBuild(serverBuildEntries, optimizeBoundaries !== false).then(injectGlobs);
|
|
309
|
+
return findClientBoundariesForClientBuild(serverBuildEntries, optimizeBoundaries !== false, config.root).then(injectGlobs);
|
|
306
310
|
}
|
|
307
311
|
},
|
|
308
312
|
handleHotUpdate: function (_ref2) {
|
|
@@ -358,7 +362,7 @@ async function proxyClientComponent(filepath, src) {
|
|
|
358
362
|
src = await fs.promises.readFile(filepath, 'utf-8');
|
|
359
363
|
}
|
|
360
364
|
|
|
361
|
-
var _await$transformWithE = await
|
|
365
|
+
var _await$transformWithE = await transformWithEsbuild(src, filepath),
|
|
362
366
|
code = _await$transformWithE.code;
|
|
363
367
|
|
|
364
368
|
var _parse = esModuleLexer.parse(code),
|
|
@@ -405,13 +409,16 @@ function findClientBoundaries(moduleGraph) {
|
|
|
405
409
|
return clientBoundaries;
|
|
406
410
|
}
|
|
407
411
|
|
|
408
|
-
async function findClientBoundariesForClientBuild(serverEntries, optimizeBoundaries) {
|
|
412
|
+
async function findClientBoundariesForClientBuild(serverEntries, optimizeBoundaries, root) {
|
|
409
413
|
// Viteception
|
|
410
|
-
var server = await
|
|
414
|
+
var server = await createServer({
|
|
415
|
+
root: root,
|
|
411
416
|
clearScreen: false,
|
|
412
417
|
server: {
|
|
413
|
-
middlewareMode: 'ssr'
|
|
414
|
-
|
|
418
|
+
middlewareMode: isVite3 ? true : 'ssr',
|
|
419
|
+
hmr: false
|
|
420
|
+
},
|
|
421
|
+
appType: 'custom'
|
|
415
422
|
});
|
|
416
423
|
|
|
417
424
|
try {
|
|
@@ -434,9 +441,10 @@ var hashImportsPlugin = {
|
|
|
434
441
|
if (rscViteFileRE.test(id)) {
|
|
435
442
|
var s = new MagicString(code);
|
|
436
443
|
s.replace(/\/\*\s*HASH_BEGIN\s*\*\/\s*([^]+?)\/\*\s*HASH_END\s*\*\//gm, function (_, imports) {
|
|
437
|
-
return imports.trim().replace(/"([^"]+?)":/gm, function (
|
|
444
|
+
return imports.trim().replace(/"([^"]+?)":/gm, function (all, relativePath) {
|
|
445
|
+
if (relativePath === '__VITE_PRELOAD__') return all;
|
|
438
446
|
var absolutePath = path.resolve(path.dirname(id.split('?')[0]), relativePath);
|
|
439
|
-
return "\"" + getComponentId(
|
|
447
|
+
return "\"" + getComponentId(normalizePath(absolutePath)) + "\":";
|
|
440
448
|
});
|
|
441
449
|
});
|
|
442
450
|
return {
|
|
@@ -528,17 +536,20 @@ function isDirectImportInServer(originalMod, currentMod, accModInfo) {
|
|
|
528
536
|
});
|
|
529
537
|
}
|
|
530
538
|
|
|
531
|
-
|
|
532
|
-
|
|
539
|
+
var RESOLVE_EXTENSIONS = ['', '.js', '.ts', '.jsx', '.tsx', '/index', '/index.js', '/index.ts', '/index.jsx', '/index.tsx']; // Resolve relative paths and aliases. Examples:
|
|
540
|
+
// - import {XYZ} from '~/components' => import {XYZ} from '<absolute>/src/components/index.ts'
|
|
541
|
+
// - import {XYZ} from '/src/component.client' => import {XYZ} from '<absolute>/src/component.client.jsx'`
|
|
533
542
|
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
543
|
+
function resolveModPath(modPath, dirname) {
|
|
544
|
+
var extensions = /\.[jt]sx?$/.test(modPath) ? [''] : RESOLVE_EXTENSIONS;
|
|
545
|
+
|
|
546
|
+
for (var i = 0; i < extensions.length; i++) {
|
|
547
|
+
var extension = extensions[i];
|
|
548
|
+
|
|
549
|
+
try {
|
|
550
|
+
var absolutePath = modPath.startsWith('.') ? normalizePath(path.resolve(dirname, modPath)) : modPath;
|
|
551
|
+
return normalizePath(require.resolve(absolutePath + extension));
|
|
552
|
+
} catch (error) {// Do not throw, this is likely a virtual module or another exception
|
|
542
553
|
}
|
|
543
554
|
}
|
|
544
555
|
}
|
|
@@ -550,7 +561,7 @@ function augmentModuleGraph(moduleGraph, id, code, root, resolveAlias) {
|
|
|
550
561
|
var _id$split = id.split('?'),
|
|
551
562
|
source = _id$split[0];
|
|
552
563
|
|
|
553
|
-
var dirname =
|
|
564
|
+
var dirname = normalizePath(path.dirname(source));
|
|
554
565
|
|
|
555
566
|
var _parse2 = esModuleLexer.parse(code),
|
|
556
567
|
rawImports = _parse2[0],
|
|
@@ -581,7 +592,7 @@ function augmentModuleGraph(moduleGraph, id, code, root, resolveAlias) {
|
|
|
581
592
|
|
|
582
593
|
if (modPath && modPath.startsWith('/src/')) {
|
|
583
594
|
// Vite default alias
|
|
584
|
-
modPath =
|
|
595
|
+
modPath = normalizePath(path.join(root, modPath));
|
|
585
596
|
}
|
|
586
597
|
|
|
587
598
|
var resolvedPath = resolveModPath(modPath, dirname);
|
package/vendor/react-server-dom-vite/cjs/react-server-dom-vite-writer.browser.development.server.js
CHANGED
|
@@ -168,6 +168,11 @@ function processModelChunk(request, id, model) {
|
|
|
168
168
|
var row = serializeRowHeader('J', id) + json + '\n';
|
|
169
169
|
return stringToChunk(row);
|
|
170
170
|
}
|
|
171
|
+
function processReferenceChunk(request, id, reference) {
|
|
172
|
+
var json = stringify(reference);
|
|
173
|
+
var row = serializeRowHeader('J', id) + json + '\n';
|
|
174
|
+
return stringToChunk(row);
|
|
175
|
+
}
|
|
171
176
|
function processModuleChunk(request, id, moduleMetaData) {
|
|
172
177
|
var json = stringify(moduleMetaData);
|
|
173
178
|
var row = serializeRowHeader('M', id) + json + '\n';
|
|
@@ -510,6 +515,7 @@ var startInlineScript = stringToPrecomputedChunk('<script>');
|
|
|
510
515
|
var endInlineScript = stringToPrecomputedChunk('</script>');
|
|
511
516
|
var startScriptSrc = stringToPrecomputedChunk('<script src="');
|
|
512
517
|
var startModuleSrc = stringToPrecomputedChunk('<script type="module" src="');
|
|
518
|
+
var scriptIntegirty = stringToPrecomputedChunk('" integrity="');
|
|
513
519
|
var endAsyncScript = stringToPrecomputedChunk('" async=""></script>');
|
|
514
520
|
|
|
515
521
|
var textSeparator = stringToPrecomputedChunk('<!-- -->');
|
|
@@ -987,6 +993,10 @@ function getOrCreateServerContext(globalName) {
|
|
|
987
993
|
return ContextRegistry[globalName];
|
|
988
994
|
}
|
|
989
995
|
|
|
996
|
+
var PENDING = 0;
|
|
997
|
+
var COMPLETED = 1;
|
|
998
|
+
var ABORTED = 3;
|
|
999
|
+
var ERRORED = 4;
|
|
990
1000
|
var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
|
|
991
1001
|
|
|
992
1002
|
function defaultErrorHandler(error) {
|
|
@@ -997,7 +1007,8 @@ var OPEN = 0;
|
|
|
997
1007
|
var CLOSING = 1;
|
|
998
1008
|
var CLOSED = 2;
|
|
999
1009
|
function createRequest(model, bundlerConfig, onError, context, identifierPrefix) {
|
|
1000
|
-
var
|
|
1010
|
+
var abortSet = new Set();
|
|
1011
|
+
var pingedTasks = [];
|
|
1001
1012
|
var request = {
|
|
1002
1013
|
status: OPEN,
|
|
1003
1014
|
fatalError: null,
|
|
@@ -1006,7 +1017,8 @@ function createRequest(model, bundlerConfig, onError, context, identifierPrefix)
|
|
|
1006
1017
|
cache: new Map(),
|
|
1007
1018
|
nextChunkId: 0,
|
|
1008
1019
|
pendingChunks: 0,
|
|
1009
|
-
|
|
1020
|
+
abortableTasks: abortSet,
|
|
1021
|
+
pingedTasks: pingedTasks,
|
|
1010
1022
|
completedModuleChunks: [],
|
|
1011
1023
|
completedJSONChunks: [],
|
|
1012
1024
|
completedErrorChunks: [],
|
|
@@ -1022,8 +1034,8 @@ function createRequest(model, bundlerConfig, onError, context, identifierPrefix)
|
|
|
1022
1034
|
};
|
|
1023
1035
|
request.pendingChunks++;
|
|
1024
1036
|
var rootContext = createRootContext(context);
|
|
1025
|
-
var
|
|
1026
|
-
|
|
1037
|
+
var rootTask = createTask(request, model, rootContext, abortSet);
|
|
1038
|
+
pingedTasks.push(rootTask);
|
|
1027
1039
|
return request;
|
|
1028
1040
|
}
|
|
1029
1041
|
|
|
@@ -1121,28 +1133,30 @@ function attemptResolveElement(type, key, ref, props) {
|
|
|
1121
1133
|
throw new Error("Unsupported server component type: " + describeValueForErrorMessage(type));
|
|
1122
1134
|
}
|
|
1123
1135
|
|
|
1124
|
-
function
|
|
1125
|
-
var
|
|
1126
|
-
|
|
1136
|
+
function pingTask(request, task) {
|
|
1137
|
+
var pingedTasks = request.pingedTasks;
|
|
1138
|
+
pingedTasks.push(task);
|
|
1127
1139
|
|
|
1128
|
-
if (
|
|
1140
|
+
if (pingedTasks.length === 1) {
|
|
1129
1141
|
scheduleWork(function () {
|
|
1130
1142
|
return performWork(request);
|
|
1131
1143
|
});
|
|
1132
1144
|
}
|
|
1133
1145
|
}
|
|
1134
1146
|
|
|
1135
|
-
function
|
|
1147
|
+
function createTask(request, model, context, abortSet) {
|
|
1136
1148
|
var id = request.nextChunkId++;
|
|
1137
|
-
var
|
|
1149
|
+
var task = {
|
|
1138
1150
|
id: id,
|
|
1151
|
+
status: PENDING,
|
|
1139
1152
|
model: model,
|
|
1140
1153
|
context: context,
|
|
1141
1154
|
ping: function () {
|
|
1142
|
-
return
|
|
1155
|
+
return pingTask(request, task);
|
|
1143
1156
|
}
|
|
1144
1157
|
};
|
|
1145
|
-
|
|
1158
|
+
abortSet.add(task);
|
|
1159
|
+
return task;
|
|
1146
1160
|
}
|
|
1147
1161
|
|
|
1148
1162
|
function serializeByValueID(id) {
|
|
@@ -1377,12 +1391,12 @@ function resolveModelToJSON(request, parent, key, value) {
|
|
|
1377
1391
|
}
|
|
1378
1392
|
} catch (x) {
|
|
1379
1393
|
if (typeof x === 'object' && x !== null && typeof x.then === 'function') {
|
|
1380
|
-
// Something suspended, we'll need to create a new
|
|
1394
|
+
// Something suspended, we'll need to create a new task and resolve it later.
|
|
1381
1395
|
request.pendingChunks++;
|
|
1382
|
-
var
|
|
1383
|
-
var ping =
|
|
1396
|
+
var newTask = createTask(request, value, getActiveContext(), request.abortableTasks);
|
|
1397
|
+
var ping = newTask.ping;
|
|
1384
1398
|
x.then(ping, ping);
|
|
1385
|
-
return serializeByRefID(
|
|
1399
|
+
return serializeByRefID(newTask.id);
|
|
1386
1400
|
} else {
|
|
1387
1401
|
logRecoverableError(request, x); // Something errored. We'll still send everything we have up until this point.
|
|
1388
1402
|
// We'll replace this element with a lazy reference that throws on the client
|
|
@@ -1590,34 +1604,43 @@ function emitProviderChunk(request, id, contextName) {
|
|
|
1590
1604
|
request.completedJSONChunks.push(processedChunk);
|
|
1591
1605
|
}
|
|
1592
1606
|
|
|
1593
|
-
function
|
|
1594
|
-
|
|
1607
|
+
function retryTask(request, task) {
|
|
1608
|
+
if (task.status !== PENDING) {
|
|
1609
|
+
// We completed this by other means before we had a chance to retry it.
|
|
1610
|
+
return;
|
|
1611
|
+
}
|
|
1612
|
+
|
|
1613
|
+
switchContext(task.context);
|
|
1595
1614
|
|
|
1596
1615
|
try {
|
|
1597
|
-
var _value3 =
|
|
1616
|
+
var _value3 = task.model;
|
|
1598
1617
|
|
|
1599
1618
|
while (typeof _value3 === 'object' && _value3 !== null && _value3.$$typeof === REACT_ELEMENT_TYPE) {
|
|
1600
1619
|
// TODO: Concatenate keys of parents onto children.
|
|
1601
1620
|
var element = _value3; // Attempt to render the server component.
|
|
1602
|
-
// Doing this here lets us reuse this same
|
|
1621
|
+
// Doing this here lets us reuse this same task if the next component
|
|
1603
1622
|
// also suspends.
|
|
1604
1623
|
|
|
1605
|
-
|
|
1624
|
+
task.model = _value3;
|
|
1606
1625
|
_value3 = attemptResolveElement(element.type, element.key, element.ref, element.props);
|
|
1607
1626
|
}
|
|
1608
1627
|
|
|
1609
|
-
var processedChunk = processModelChunk(request,
|
|
1628
|
+
var processedChunk = processModelChunk(request, task.id, _value3);
|
|
1610
1629
|
request.completedJSONChunks.push(processedChunk);
|
|
1630
|
+
request.abortableTasks.delete(task);
|
|
1631
|
+
task.status = COMPLETED;
|
|
1611
1632
|
} catch (x) {
|
|
1612
1633
|
if (typeof x === 'object' && x !== null && typeof x.then === 'function') {
|
|
1613
1634
|
// Something suspended again, let's pick it back up later.
|
|
1614
|
-
var ping =
|
|
1635
|
+
var ping = task.ping;
|
|
1615
1636
|
x.then(ping, ping);
|
|
1616
1637
|
return;
|
|
1617
1638
|
} else {
|
|
1639
|
+
request.abortableTasks.delete(task);
|
|
1640
|
+
task.status = ERRORED;
|
|
1618
1641
|
logRecoverableError(request, x); // This errored, we need to serialize this error to the
|
|
1619
1642
|
|
|
1620
|
-
emitErrorChunk(request,
|
|
1643
|
+
emitErrorChunk(request, task.id, x);
|
|
1621
1644
|
}
|
|
1622
1645
|
}
|
|
1623
1646
|
}
|
|
@@ -1630,12 +1653,12 @@ function performWork(request) {
|
|
|
1630
1653
|
prepareToUseHooksForRequest(request);
|
|
1631
1654
|
|
|
1632
1655
|
try {
|
|
1633
|
-
var
|
|
1634
|
-
request.
|
|
1656
|
+
var pingedTasks = request.pingedTasks;
|
|
1657
|
+
request.pingedTasks = [];
|
|
1635
1658
|
|
|
1636
|
-
for (var i = 0; i <
|
|
1637
|
-
var
|
|
1638
|
-
|
|
1659
|
+
for (var i = 0; i < pingedTasks.length; i++) {
|
|
1660
|
+
var task = pingedTasks[i];
|
|
1661
|
+
retryTask(request, task);
|
|
1639
1662
|
}
|
|
1640
1663
|
|
|
1641
1664
|
if (request.destination !== null) {
|
|
@@ -1651,6 +1674,15 @@ function performWork(request) {
|
|
|
1651
1674
|
}
|
|
1652
1675
|
}
|
|
1653
1676
|
|
|
1677
|
+
function abortTask(task, request, errorId) {
|
|
1678
|
+
task.status = ABORTED; // Instead of emitting an error per task.id, we emit a model that only
|
|
1679
|
+
// has a single value referencing the error.
|
|
1680
|
+
|
|
1681
|
+
var ref = serializeByValueID(errorId);
|
|
1682
|
+
var processedChunk = processReferenceChunk(request, task.id, ref);
|
|
1683
|
+
request.completedJSONChunks.push(processedChunk);
|
|
1684
|
+
}
|
|
1685
|
+
|
|
1654
1686
|
function flushCompletedChunks(request, destination) {
|
|
1655
1687
|
beginWriting();
|
|
1656
1688
|
|
|
@@ -1750,6 +1782,34 @@ function startFlowing(request, destination) {
|
|
|
1750
1782
|
logRecoverableError(request, error);
|
|
1751
1783
|
fatalError(request, error);
|
|
1752
1784
|
}
|
|
1785
|
+
} // This is called to early terminate a request. It creates an error at all pending tasks.
|
|
1786
|
+
|
|
1787
|
+
function abort(request, reason) {
|
|
1788
|
+
try {
|
|
1789
|
+
var abortableTasks = request.abortableTasks;
|
|
1790
|
+
|
|
1791
|
+
if (abortableTasks.size > 0) {
|
|
1792
|
+
// We have tasks to abort. We'll emit one error row and then emit a reference
|
|
1793
|
+
// to that row from every row that's still remaining.
|
|
1794
|
+
var _error = reason === undefined ? new Error('The render was aborted by the server without a reason.') : reason;
|
|
1795
|
+
|
|
1796
|
+
logRecoverableError(request, _error);
|
|
1797
|
+
request.pendingChunks++;
|
|
1798
|
+
var errorId = request.nextChunkId++;
|
|
1799
|
+
emitErrorChunk(request, errorId, _error);
|
|
1800
|
+
abortableTasks.forEach(function (task) {
|
|
1801
|
+
return abortTask(task, request, errorId);
|
|
1802
|
+
});
|
|
1803
|
+
abortableTasks.clear();
|
|
1804
|
+
}
|
|
1805
|
+
|
|
1806
|
+
if (request.destination !== null) {
|
|
1807
|
+
flushCompletedChunks(request, request.destination);
|
|
1808
|
+
}
|
|
1809
|
+
} catch (error) {
|
|
1810
|
+
logRecoverableError(request, error);
|
|
1811
|
+
fatalError(request, error);
|
|
1812
|
+
}
|
|
1753
1813
|
}
|
|
1754
1814
|
|
|
1755
1815
|
function importServerContexts(contexts) {
|
|
@@ -1787,6 +1847,22 @@ function renderToReadableStream(model, options) {
|
|
|
1787
1847
|
}
|
|
1788
1848
|
}), {}, // Manifest, not used
|
|
1789
1849
|
options ? options.onError : undefined, options ? options.context : undefined, options ? options.identifierPrefix : undefined);
|
|
1850
|
+
|
|
1851
|
+
if (options && options.signal) {
|
|
1852
|
+
var signal = options.signal;
|
|
1853
|
+
|
|
1854
|
+
if (signal.aborted) {
|
|
1855
|
+
abort(request, signal.reason);
|
|
1856
|
+
} else {
|
|
1857
|
+
var listener = function () {
|
|
1858
|
+
abort(request, signal.reason);
|
|
1859
|
+
signal.removeEventListener('abort', listener);
|
|
1860
|
+
};
|
|
1861
|
+
|
|
1862
|
+
signal.addEventListener('abort', listener);
|
|
1863
|
+
}
|
|
1864
|
+
}
|
|
1865
|
+
|
|
1790
1866
|
var stream = new ReadableStream({
|
|
1791
1867
|
type: 'bytes',
|
|
1792
1868
|
start: function (controller) {
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
9
|
*/
|
|
10
|
-
'use strict';var e=require("react"),aa=Object.assign,
|
|
10
|
+
'use strict';var e=require("react"),aa=Object.assign,l=null,n=0;function p(a,b){if(0!==b.length)if(512<b.length)0<n&&(a.enqueue(new Uint8Array(l.buffer,0,n)),l=new Uint8Array(512),n=0),a.enqueue(b);else{var d=l.length-n;d<b.length&&(0===d?a.enqueue(l):(l.set(b.subarray(0,d),n),a.enqueue(l),b=b.subarray(d)),l=new Uint8Array(512),n=0);l.set(b,n);n+=b.length}return!0}var q=new TextEncoder;function r(a){return q.encode(a)}function u(a,b){"function"===typeof a.error?a.error(b):a.close()}
|
|
11
11
|
var w=JSON.stringify,ba=Symbol.for("react.module.reference");function x(a){return"string"===typeof a?!!globalThis.__STRING_REFERENCE_INDEX[a]:a.$$typeof===ba}var y=Symbol.for("react.element"),ca=Symbol.for("react.fragment"),z=Symbol.for("react.provider"),da=Symbol.for("react.forward_ref"),ea=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),B=Symbol.for("react.default_value");
|
|
12
12
|
function C(a,b,d,c,f,g,h){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=c;this.attributeNamespace=f;this.mustUseProperty=d;this.propertyName=a;this.type=b;this.sanitizeURL=g;this.removeEmptyString=h}var D="children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ");D.push("innerText","textContent");D.forEach(function(a){new C(a,0,!1,a,null,!1,!1)});
|
|
13
13
|
[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){new C(a[0],1,!1,a[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(a){new C(a,2,!1,a.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){new C(a,2,!1,a,null,!1,!1)});
|
|
@@ -17,31 +17,32 @@ function C(a,b,d,c,f,g,h){this.acceptsBooleans=2===b||3===b||4===b;this.attribut
|
|
|
17
17
|
F);new C(b,1,!1,a,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var b=a.replace(E,F);new C(b,1,!1,a,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(a){var b=a.replace(E,F);new C(b,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(a){new C(a,1,!1,a.toLowerCase(),null,!1,!1)});
|
|
18
18
|
new C("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(a){new C(a,1,!1,a.toLowerCase(),null,!0,!0)});
|
|
19
19
|
var G={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,
|
|
20
|
-
fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},fa=["Webkit","ms","Moz","O"];Object.keys(G).forEach(function(a){fa.forEach(function(b){b=b+a.charAt(0).toUpperCase()+a.substring(1);G[b]=G[a]})});var
|
|
21
|
-
r("/>");r(' selected=""');r("\n");r("<!DOCTYPE html>");r("</");r(">");r('<template id="');r('"></template>');r("\x3c!--$--\x3e");r('\x3c!--$?--\x3e<template id="');r('"></template>');r("\x3c!--$!--\x3e");r("\x3c!--/$--\x3e");r("<template");r('"');r(' data-dgst="');r(' data-msg="');r(' data-stck="');r("></template>");r('<div hidden id="');r('">');r("</div>");r('<svg aria-hidden="true" style="display:none" id="');r('">');r("</svg>");r('<math aria-hidden="true" style="display:none" id="');
|
|
22
|
-
r('<table hidden id="');r('">');r("</table>");r('<table hidden><tbody id="');r('">');r("</tbody></table>");r('<table hidden><tr id="');r('">');r("</tr></table>");r('<table hidden><colgroup id="');r('">');r("</colgroup></table>");r('function $RS(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)};$RS("');r('$RS("');r('","');r('")\x3c/script>');r('function $RC(a,b){a=document.getElementById(a);b=document.getElementById(b);b.parentNode.removeChild(b);if(a){a=a.previousSibling;var f=a.parentNode,c=a.nextSibling,e=0;do{if(c&&8===c.nodeType){var d=c.data;if("/$"===d)if(0===e)break;else e--;else"$"!==d&&"$?"!==d&&"$!"!==d||e++}d=c.nextSibling;f.removeChild(c);c=d}while(c);for(;b.firstChild;)f.insertBefore(b.firstChild,c);a.data="$";a._reactRetry&&a._reactRetry()}};$RC("');
|
|
23
|
-
r('$RC("');r('","');r('")\x3c/script>');r('function $RX(b,c,d,e){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),b._reactRetry&&b._reactRetry())};$RX("');r('$RX("');r('"');r(")\x3c/script>");r(",");var
|
|
24
|
-
function
|
|
25
|
-
function
|
|
26
|
-
function
|
|
27
|
-
function
|
|
28
|
-
var
|
|
29
|
-
function
|
|
30
|
-
function
|
|
31
|
-
function
|
|
32
|
-
c.value),[y,a,b,{value:c.value,children:c.children,__pop:
|
|
33
|
-
function
|
|
34
|
-
function
|
|
35
|
-
function
|
|
36
|
-
x(c)){if(x(c)){f=c;"string"===typeof f&&(f=globalThis.__STRING_REFERENCE_INDEX[f]);f=f.filepath+"#"+f.name;g=a.writtenModules;var h=g.get(f);if(void 0!==h)return b[0]===y&&"1"===d?"@"+h.toString(16):"$"+h.toString(16);try{"string"===typeof c&&(c=globalThis.__STRING_REFERENCE_INDEX[c]);var
|
|
37
|
-
"$"+
|
|
38
|
-
a.context._defaultValue:d;
|
|
39
|
-
(
|
|
40
|
-
d=a.nextChunkId++;b=w(
|
|
41
|
-
function
|
|
42
|
-
function
|
|
43
|
-
v),
|
|
44
|
-
function
|
|
45
|
-
a.pendingChunks&&b.close()}function
|
|
46
|
-
|
|
47
|
-
a)
|
|
20
|
+
fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},fa=["Webkit","ms","Moz","O"];Object.keys(G).forEach(function(a){fa.forEach(function(b){b=b+a.charAt(0).toUpperCase()+a.substring(1);G[b]=G[a]})});var ha=Array.isArray;r("<script>");r("\x3c/script>");r('<script src="');r('<script type="module" src="');r('" integrity="');r('" async="">\x3c/script>');r("\x3c!-- --\x3e");r(' style="');r(":");r(";");r(" ");r('="');r('"');
|
|
21
|
+
r('=""');r(">");r("/>");r(' selected=""');r("\n");r("<!DOCTYPE html>");r("</");r(">");r('<template id="');r('"></template>');r("\x3c!--$--\x3e");r('\x3c!--$?--\x3e<template id="');r('"></template>');r("\x3c!--$!--\x3e");r("\x3c!--/$--\x3e");r("<template");r('"');r(' data-dgst="');r(' data-msg="');r(' data-stck="');r("></template>");r('<div hidden id="');r('">');r("</div>");r('<svg aria-hidden="true" style="display:none" id="');r('">');r("</svg>");r('<math aria-hidden="true" style="display:none" id="');
|
|
22
|
+
r('">');r("</math>");r('<table hidden id="');r('">');r("</table>");r('<table hidden><tbody id="');r('">');r("</tbody></table>");r('<table hidden><tr id="');r('">');r("</tr></table>");r('<table hidden><colgroup id="');r('">');r("</colgroup></table>");r('function $RS(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)};$RS("');r('$RS("');r('","');r('")\x3c/script>');r('function $RC(a,b){a=document.getElementById(a);b=document.getElementById(b);b.parentNode.removeChild(b);if(a){a=a.previousSibling;var f=a.parentNode,c=a.nextSibling,e=0;do{if(c&&8===c.nodeType){var d=c.data;if("/$"===d)if(0===e)break;else e--;else"$"!==d&&"$?"!==d&&"$!"!==d||e++}d=c.nextSibling;f.removeChild(c);c=d}while(c);for(;b.firstChild;)f.insertBefore(b.firstChild,c);a.data="$";a._reactRetry&&a._reactRetry()}};$RC("');
|
|
23
|
+
r('$RC("');r('","');r('")\x3c/script>');r('function $RX(b,c,d,e){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),b._reactRetry&&b._reactRetry())};$RX("');r('$RX("');r('"');r(")\x3c/script>");r(",");var H=null;
|
|
24
|
+
function I(a,b){if(a!==b){a.context._currentValue=a.parentValue;a=a.parent;var d=b.parent;if(null===a){if(null!==d)throw Error("The stacks must reach the root at the same time. This is a bug in React.");}else{if(null===d)throw Error("The stacks must reach the root at the same time. This is a bug in React.");I(a,d);b.context._currentValue=b.value}}}function ia(a){a.context._currentValue=a.parentValue;a=a.parent;null!==a&&ia(a)}
|
|
25
|
+
function ja(a){var b=a.parent;null!==b&&ja(b);a.context._currentValue=a.value}function ka(a,b){a.context._currentValue=a.parentValue;a=a.parent;if(null===a)throw Error("The depth must equal at least at zero before reaching the root. This is a bug in React.");a.depth===b.depth?I(a,b):ka(a,b)}
|
|
26
|
+
function la(a,b){var d=b.parent;if(null===d)throw Error("The depth must equal at least at zero before reaching the root. This is a bug in React.");a.depth===d.depth?I(a,d):la(a,d);b.context._currentValue=b.value}function J(a){var b=H;b!==a&&(null===b?ja(a):null===a?ia(b):b.depth===a.depth?I(b,a):b.depth>a.depth?ka(b,a):la(b,a),H=a)}function na(a,b){var d=a._currentValue;a._currentValue=b;var c=H;return H=a={parent:c,depth:null===c?0:c.depth+1,context:a,parentValue:d,value:b}}var K=null;
|
|
27
|
+
function oa(a){return a._currentValue}
|
|
28
|
+
var ra={useMemo:function(a){return a()},useCallback:function(a){return a},useDebugValue:function(){},useDeferredValue:L,useTransition:L,getCacheForType:function(a){if(!M)throw Error("Reading the cache is only supported while rendering.");var b=M.get(a);void 0===b&&(b=a(),M.set(a,b));return b},readContext:oa,useContext:oa,useReducer:L,useRef:L,useState:L,useInsertionEffect:L,useLayoutEffect:L,useImperativeHandle:L,useEffect:L,useId:pa,useMutableSource:L,useSyncExternalStore:L,useCacheRefresh:function(){return qa}};
|
|
29
|
+
function L(){throw Error("This Hook is not supported in Server Components.");}function qa(){if(!M)throw Error("Refreshing the cache is not supported in Server Components.");}var M=null;function pa(){if(null===K)throw Error("useId can only be used while React is rendering");var a=K.identifierCount++;return":"+K.identifierPrefix+"S"+a.toString(32)+":"}var sa=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,N=sa.ContextRegistry,O=sa.ReactCurrentDispatcher;function ta(a){console.error(a)}
|
|
30
|
+
function ua(a,b,d,c,f){var g=new Set,h=[],k={status:0,fatalError:null,destination:null,bundlerConfig:b,cache:new Map,nextChunkId:0,pendingChunks:0,abortableTasks:g,pingedTasks:h,completedModuleChunks:[],completedJSONChunks:[],completedErrorChunks:[],writtenSymbols:new Map,writtenModules:new Map,writtenProviders:new Map,identifierPrefix:f||"",identifierCount:1,onError:void 0===d?ta:d,toJSON:function(a,b){return va(k,this,a,b)}};k.pendingChunks++;b=wa(c);a=xa(k,a,b,g);h.push(a);return k}var ya={};
|
|
31
|
+
function P(a,b,d,c){if(null!==d&&void 0!==d)throw Error("Refs cannot be used in server components, nor passed to client components.");if("function"===typeof a)return x(a)?[y,a,b,c]:a(c);if("string"===typeof a)return[y,a,b,c];if("symbol"===typeof a)return a===ca?c.children:[y,a,b,c];if(null!=a&&"object"===typeof a){if(x(a))return[y,a,b,c];switch(a.$$typeof){case A:var f=a._init;a=f(a._payload);return P(a,b,d,c);case da:return b=a.render,b(c,void 0);case ea:return P(a.type,b,d,c);case z:return na(a._context,
|
|
32
|
+
c.value),[y,a,b,{value:c.value,children:c.children,__pop:ya}]}}throw Error("Unsupported server component type: "+R(a));}function xa(a,b,d,c){var f={id:a.nextChunkId++,status:0,model:b,context:d,ping:function(){var b=a.pingedTasks;b.push(f);1===b.length&&za(a)}};c.add(f);return f}function Aa(a){return Object.prototype.toString.call(a).replace(/^\[object (.*)\]$/,function(a,d){return d})}function U(a){var b=JSON.stringify(a);return'"'+a+'"'===b?a:b}
|
|
33
|
+
function R(a){switch(typeof a){case "string":return JSON.stringify(10>=a.length?a:a.substr(0,10)+"...");case "object":if(ha(a))return"[...]";a=Aa(a);return"Object"===a?"{...}":a;case "function":return"function";default:return String(a)}}
|
|
34
|
+
function V(a,b){if(ha(a)){for(var d="[",c=0;c<a.length;c++){0<c&&(d+=", ");if(6<c){d+="...";break}var f=a[c];d=""+c===b&&"object"===typeof f&&null!==f?d+V(f):d+R(f)}return d+"]"}d="{";c=Object.keys(a);for(f=0;f<c.length;f++){0<f&&(d+=", ");if(6<f){d+="...";break}var g=c[f];d+=U(g)+": ";var h=a[g];d=g===b&&"object"===typeof h&&null!==h?d+V(h):d+R(h)}return d+"}"}
|
|
35
|
+
function va(a,b,d,c){switch(c){case y:return"$"}for(;"object"===typeof c&&null!==c&&(c.$$typeof===y||c.$$typeof===A);)try{switch(c.$$typeof){case y:var f=c;c=P(f.type,f.key,f.ref,f.props);break;case A:var g=c._init;c=g(c._payload)}}catch(t){if("object"===typeof t&&null!==t&&"function"===typeof t.then)return a.pendingChunks++,a=xa(a,c,H,a.abortableTasks),d=a.ping,t.then(d,d),"@"+a.id.toString(16);W(a,t);a.pendingChunks++;d=a.nextChunkId++;X(a,d,t);return"@"+d.toString(16)}if(null==c)return c;if("object"===
|
|
36
|
+
typeof c||x(c)){if(x(c)){f=c;"string"===typeof f&&(f=globalThis.__STRING_REFERENCE_INDEX[f]);f=f.filepath+"#"+f.name;g=a.writtenModules;var h=g.get(f);if(void 0!==h)return b[0]===y&&"1"===d?"@"+h.toString(16):"$"+h.toString(16);try{"string"===typeof c&&(c=globalThis.__STRING_REFERENCE_INDEX[c]);var k={id:c.filepath,name:c.name};a.pendingChunks++;var m=a.nextChunkId++,Q=w(k),S="M"+m.toString(16)+":"+Q+"\n";var T=q.encode(S);a.completedModuleChunks.push(T);g.set(f,m);return b[0]===y&&"1"===d?"@"+m.toString(16):
|
|
37
|
+
"$"+m.toString(16)}catch(t){return a.pendingChunks++,d=a.nextChunkId++,X(a,d,t),"$"+d.toString(16)}}else{if(c.$$typeof===z)return b=c._context._globalName,c=a.writtenProviders,d=c.get(d),void 0===d&&(a.pendingChunks++,d=a.nextChunkId++,c.set(b,d),b="P"+d.toString(16)+":"+b+"\n",b=q.encode(b),a.completedJSONChunks.push(b)),"$"+d.toString(16);if(c===ya){a=H;if(null===a)throw Error("Tried to pop a Context at the root of the app. This is a bug in React.");d=a.parentValue;a.context._currentValue=d===B?
|
|
38
|
+
a.context._defaultValue:d;H=a.parent;return}}return c}if("string"===typeof c)return a="$"===c[0]||"@"===c[0]?"$"+c:c,a;if("boolean"===typeof c||"number"===typeof c||"undefined"===typeof c)return c;if("function"===typeof c){if(/^on[A-Z]/.test(d))throw Error("Event handlers cannot be passed to client component props. Remove "+(U(d)+" from these props if possible: "+V(b)+"\nIf you need interactivity, consider converting part of this to a client component."));throw Error("Functions cannot be passed directly to client components because they're not serializable. Remove "+
|
|
39
|
+
(U(d)+" ("+(c.displayName||c.name||"function")+") from this object, or avoid the entire object: "+V(b)));}if("symbol"===typeof c){k=a.writtenSymbols;m=k.get(c);if(void 0!==m)return"$"+m.toString(16);m=c.description;if(Symbol.for(m)!==c)throw Error("Only global symbols received from Symbol.for(...) can be passed to client components. The symbol Symbol.for("+(c.description+") cannot be found among global symbols. Remove ")+(U(d)+" from this object, or avoid the entire object: "+V(b)));a.pendingChunks++;
|
|
40
|
+
d=a.nextChunkId++;b=w(m);b="S"+d.toString(16)+":"+b+"\n";b=q.encode(b);a.completedModuleChunks.push(b);k.set(c,d);return"$"+d.toString(16)}if("bigint"===typeof c)throw Error("BigInt ("+c+") is not yet supported in client component props. Remove "+(U(d)+" from this object or use a plain number instead: "+V(b)));throw Error("Type "+typeof c+" is not supported in client component props. Remove "+(U(d)+" from this object, or avoid the entire object: "+V(b)));}function W(a,b){a=a.onError;a(b)}
|
|
41
|
+
function Y(a,b){null!==a.destination?(a.status=2,u(a.destination,b)):(a.status=1,a.fatalError=b)}function X(a,b,d){var c="";try{if(d instanceof Error){var f=String(d.message);c=String(d.stack)}else f="Error: "+d}catch(g){f="An error occurred but serializing the error message failed."}d={message:f,stack:c};b="E"+b.toString(16)+":"+w(d)+"\n";b=q.encode(b);a.completedErrorChunks.push(b)}
|
|
42
|
+
function za(a){var b=O.current,d=M;O.current=ra;M=a.cache;K=a;try{var c=a.pingedTasks;a.pingedTasks=[];for(var f=0;f<c.length;f++){var g=c[f];var h=a;if(0===g.status){J(g.context);try{for(var k=g.model;"object"===typeof k&&null!==k&&k.$$typeof===y;){var m=k;g.model=k;k=P(m.type,m.key,m.ref,m.props)}var Q=g.id,S=w(k,h.toJSON),T="J"+Q.toString(16)+":"+S+"\n";var t=q.encode(T);h.completedJSONChunks.push(t);h.abortableTasks.delete(g);g.status=1}catch(v){if("object"===typeof v&&null!==v&&"function"===
|
|
43
|
+
typeof v.then){var ma=g.ping;v.then(ma,ma)}else h.abortableTasks.delete(g),g.status=4,W(h,v),X(h,g.id,v)}}}null!==a.destination&&Z(a,a.destination)}catch(v){W(a,v),Y(a,v)}finally{O.current=b,M=d,K=null}}
|
|
44
|
+
function Z(a,b){l=new Uint8Array(512);n=0;try{for(var d=a.completedModuleChunks,c=0;c<d.length;c++)if(a.pendingChunks--,!p(b,d[c])){a.destination=null;c++;break}d.splice(0,c);var f=a.completedJSONChunks;for(c=0;c<f.length;c++)if(a.pendingChunks--,!p(b,f[c])){a.destination=null;c++;break}f.splice(0,c);var g=a.completedErrorChunks;for(c=0;c<g.length;c++)if(a.pendingChunks--,!p(b,g[c])){a.destination=null;c++;break}g.splice(0,c)}finally{l&&0<n&&(b.enqueue(new Uint8Array(l.buffer,0,n)),l=null,n=0)}0===
|
|
45
|
+
a.pendingChunks&&b.close()}function Ba(a,b){try{var d=a.abortableTasks;if(0<d.size){var c=void 0===b?Error("The render was aborted by the server without a reason."):b;W(a,c);a.pendingChunks++;var f=a.nextChunkId++;X(a,f,c);d.forEach(function(b){b.status=3;var c="$"+f.toString(16);b=b.id;c=w(c);c="J"+b.toString(16)+":"+c+"\n";c=q.encode(c);a.completedJSONChunks.push(c)});d.clear()}null!==a.destination&&Z(a,a.destination)}catch(g){W(a,g),Y(a,g)}}
|
|
46
|
+
function wa(a){if(a){var b=H;J(null);for(var d=0;d<a.length;d++){var c=a[d],f=c[0];c=c[1];N[f]||(N[f]=e.createServerContext(f,B));na(N[f],c)}a=H;J(b);return a}return null}
|
|
47
|
+
exports.renderToReadableStream=function(a,b){var d=ua(aa({},a,{$$typeof:Symbol.for("react.element"),props:{children:a},type:function(){e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentDispatcher.current.isRsc=!0;return a}}),{},b?b.onError:void 0,b?b.context:void 0,b?b.identifierPrefix:void 0);if(b&&b.signal){var c=b.signal;if(c.aborted)Ba(d,c.reason);else{var f=function(){Ba(d,c.reason);c.removeEventListener("abort",f)};c.addEventListener("abort",f)}}return new ReadableStream({type:"bytes",
|
|
48
|
+
start:function(){za(d)},pull:function(a){if(1===d.status)d.status=2,u(a,d.fatalError);else if(2!==d.status&&null===d.destination){d.destination=a;try{Z(d,a)}catch(h){W(d,h),Y(d,h)}}},cancel:function(){}},{highWaterMark:0})};
|