10332 lines
552 KiB
JavaScript
10332 lines
552 KiB
JavaScript
module.exports = [
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/shared/lib/router/utils/querystring.js [app-ssr] (ecmascript)", ((__turbopack_context__, module, exports) => {
|
|
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
0 && (module.exports = {
|
|
assign: null,
|
|
searchParamsToUrlQuery: null,
|
|
urlQueryToSearchParams: null
|
|
});
|
|
function _export(target, all) {
|
|
for(var name in all)Object.defineProperty(target, name, {
|
|
enumerable: true,
|
|
get: all[name]
|
|
});
|
|
}
|
|
_export(exports, {
|
|
assign: function() {
|
|
return assign;
|
|
},
|
|
searchParamsToUrlQuery: function() {
|
|
return searchParamsToUrlQuery;
|
|
},
|
|
urlQueryToSearchParams: function() {
|
|
return urlQueryToSearchParams;
|
|
}
|
|
});
|
|
function searchParamsToUrlQuery(searchParams) {
|
|
const query = {};
|
|
for (const [key, value] of searchParams.entries()){
|
|
const existing = query[key];
|
|
if (typeof existing === 'undefined') {
|
|
query[key] = value;
|
|
} else if (Array.isArray(existing)) {
|
|
existing.push(value);
|
|
} else {
|
|
query[key] = [
|
|
existing,
|
|
value
|
|
];
|
|
}
|
|
}
|
|
return query;
|
|
}
|
|
function stringifyUrlQueryParam(param) {
|
|
if (typeof param === 'string') {
|
|
return param;
|
|
}
|
|
if (typeof param === 'number' && !isNaN(param) || typeof param === 'boolean') {
|
|
return String(param);
|
|
} else {
|
|
return '';
|
|
}
|
|
}
|
|
function urlQueryToSearchParams(query) {
|
|
const searchParams = new URLSearchParams();
|
|
for (const [key, value] of Object.entries(query)){
|
|
if (Array.isArray(value)) {
|
|
for (const item of value){
|
|
searchParams.append(key, stringifyUrlQueryParam(item));
|
|
}
|
|
} else {
|
|
searchParams.set(key, stringifyUrlQueryParam(value));
|
|
}
|
|
}
|
|
return searchParams;
|
|
}
|
|
function assign(target, ...searchParamsList) {
|
|
for (const searchParams of searchParamsList){
|
|
for (const key of searchParams.keys()){
|
|
target.delete(key);
|
|
}
|
|
for (const [key, value] of searchParams.entries()){
|
|
target.append(key, value);
|
|
}
|
|
}
|
|
return target;
|
|
} //# sourceMappingURL=querystring.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/shared/lib/router/utils/format-url.js [app-ssr] (ecmascript)", ((__turbopack_context__, module, exports) => {
|
|
"use strict";
|
|
|
|
// Format function modified from nodejs
|
|
// Copyright Joyent, Inc. and other Node contributors.
|
|
//
|
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
// copy of this software and associated documentation files (the
|
|
// "Software"), to deal in the Software without restriction, including
|
|
// without limitation the rights to use, copy, modify, merge, publish,
|
|
// distribute, sublicense, and/or sell copies of the Software, and to permit
|
|
// persons to whom the Software is furnished to do so, subject to the
|
|
// following conditions:
|
|
//
|
|
// The above copyright notice and this permission notice shall be included
|
|
// in all copies or substantial portions of the Software.
|
|
//
|
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
|
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
|
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
|
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
|
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
0 && (module.exports = {
|
|
formatUrl: null,
|
|
formatWithValidation: null,
|
|
urlObjectKeys: null
|
|
});
|
|
function _export(target, all) {
|
|
for(var name in all)Object.defineProperty(target, name, {
|
|
enumerable: true,
|
|
get: all[name]
|
|
});
|
|
}
|
|
_export(exports, {
|
|
formatUrl: function() {
|
|
return formatUrl;
|
|
},
|
|
formatWithValidation: function() {
|
|
return formatWithValidation;
|
|
},
|
|
urlObjectKeys: function() {
|
|
return urlObjectKeys;
|
|
}
|
|
});
|
|
const _interop_require_wildcard = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/@swc+helpers@0.5.15/node_modules/@swc/helpers/cjs/_interop_require_wildcard.cjs [app-ssr] (ecmascript)");
|
|
const _querystring = /*#__PURE__*/ _interop_require_wildcard._(__turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/shared/lib/router/utils/querystring.js [app-ssr] (ecmascript)"));
|
|
const slashedProtocols = /https?|ftp|gopher|file/;
|
|
function formatUrl(urlObj) {
|
|
let { auth, hostname } = urlObj;
|
|
let protocol = urlObj.protocol || '';
|
|
let pathname = urlObj.pathname || '';
|
|
let hash = urlObj.hash || '';
|
|
let query = urlObj.query || '';
|
|
let host = false;
|
|
auth = auth ? encodeURIComponent(auth).replace(/%3A/i, ':') + '@' : '';
|
|
if (urlObj.host) {
|
|
host = auth + urlObj.host;
|
|
} else if (hostname) {
|
|
host = auth + (~hostname.indexOf(':') ? `[${hostname}]` : hostname);
|
|
if (urlObj.port) {
|
|
host += ':' + urlObj.port;
|
|
}
|
|
}
|
|
if (query && typeof query === 'object') {
|
|
query = String(_querystring.urlQueryToSearchParams(query));
|
|
}
|
|
let search = urlObj.search || query && `?${query}` || '';
|
|
if (protocol && !protocol.endsWith(':')) protocol += ':';
|
|
if (urlObj.slashes || (!protocol || slashedProtocols.test(protocol)) && host !== false) {
|
|
host = '//' + (host || '');
|
|
if (pathname && pathname[0] !== '/') pathname = '/' + pathname;
|
|
} else if (!host) {
|
|
host = '';
|
|
}
|
|
if (hash && hash[0] !== '#') hash = '#' + hash;
|
|
if (search && search[0] !== '?') search = '?' + search;
|
|
pathname = pathname.replace(/[?#]/g, encodeURIComponent);
|
|
search = search.replace('#', '%23');
|
|
return `${protocol}${host}${pathname}${search}${hash}`;
|
|
}
|
|
const urlObjectKeys = [
|
|
'auth',
|
|
'hash',
|
|
'host',
|
|
'hostname',
|
|
'href',
|
|
'path',
|
|
'pathname',
|
|
'port',
|
|
'protocol',
|
|
'query',
|
|
'search',
|
|
'slashes'
|
|
];
|
|
function formatWithValidation(url) {
|
|
if ("TURBOPACK compile-time truthy", 1) {
|
|
if (url !== null && typeof url === 'object') {
|
|
Object.keys(url).forEach((key)=>{
|
|
if (!urlObjectKeys.includes(key)) {
|
|
console.warn(`Unknown key passed via urlObject into url.format: ${key}`);
|
|
}
|
|
});
|
|
}
|
|
}
|
|
return formatUrl(url);
|
|
} //# sourceMappingURL=format-url.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/use-merged-ref.js [app-ssr] (ecmascript)", ((__turbopack_context__, module, exports) => {
|
|
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
Object.defineProperty(exports, "useMergedRef", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return useMergedRef;
|
|
}
|
|
});
|
|
const _react = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react.js [app-ssr] (ecmascript)");
|
|
function useMergedRef(refA, refB) {
|
|
const cleanupA = (0, _react.useRef)(null);
|
|
const cleanupB = (0, _react.useRef)(null);
|
|
// NOTE: In theory, we could skip the wrapping if only one of the refs is non-null.
|
|
// (this happens often if the user doesn't pass a ref to Link/Form/Image)
|
|
// But this can cause us to leak a cleanup-ref into user code (previously via `<Link legacyBehavior>`),
|
|
// and the user might pass that ref into ref-merging library that doesn't support cleanup refs
|
|
// (because it hasn't been updated for React 19)
|
|
// which can then cause things to blow up, because a cleanup-returning ref gets called with `null`.
|
|
// So in practice, it's safer to be defensive and always wrap the ref, even on React 19.
|
|
return (0, _react.useCallback)((current)=>{
|
|
if (current === null) {
|
|
const cleanupFnA = cleanupA.current;
|
|
if (cleanupFnA) {
|
|
cleanupA.current = null;
|
|
cleanupFnA();
|
|
}
|
|
const cleanupFnB = cleanupB.current;
|
|
if (cleanupFnB) {
|
|
cleanupB.current = null;
|
|
cleanupFnB();
|
|
}
|
|
} else {
|
|
if (refA) {
|
|
cleanupA.current = applyRef(refA, current);
|
|
}
|
|
if (refB) {
|
|
cleanupB.current = applyRef(refB, current);
|
|
}
|
|
}
|
|
}, [
|
|
refA,
|
|
refB
|
|
]);
|
|
}
|
|
function applyRef(refA, current) {
|
|
if (typeof refA === 'function') {
|
|
const cleanup = refA(current);
|
|
if (typeof cleanup === 'function') {
|
|
return cleanup;
|
|
} else {
|
|
return ()=>refA(null);
|
|
}
|
|
} else {
|
|
refA.current = current;
|
|
return ()=>{
|
|
refA.current = null;
|
|
};
|
|
}
|
|
}
|
|
if ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') {
|
|
Object.defineProperty(exports.default, '__esModule', {
|
|
value: true
|
|
});
|
|
Object.assign(exports.default, exports);
|
|
module.exports = exports.default;
|
|
} //# sourceMappingURL=use-merged-ref.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/shared/lib/utils.js [app-ssr] (ecmascript)", ((__turbopack_context__, module, exports) => {
|
|
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
0 && (module.exports = {
|
|
DecodeError: null,
|
|
MiddlewareNotFoundError: null,
|
|
MissingStaticPage: null,
|
|
NormalizeError: null,
|
|
PageNotFoundError: null,
|
|
SP: null,
|
|
ST: null,
|
|
WEB_VITALS: null,
|
|
execOnce: null,
|
|
getDisplayName: null,
|
|
getLocationOrigin: null,
|
|
getURL: null,
|
|
isAbsoluteUrl: null,
|
|
isResSent: null,
|
|
loadGetInitialProps: null,
|
|
normalizeRepeatedSlashes: null,
|
|
stringifyError: null
|
|
});
|
|
function _export(target, all) {
|
|
for(var name in all)Object.defineProperty(target, name, {
|
|
enumerable: true,
|
|
get: all[name]
|
|
});
|
|
}
|
|
_export(exports, {
|
|
DecodeError: function() {
|
|
return DecodeError;
|
|
},
|
|
MiddlewareNotFoundError: function() {
|
|
return MiddlewareNotFoundError;
|
|
},
|
|
MissingStaticPage: function() {
|
|
return MissingStaticPage;
|
|
},
|
|
NormalizeError: function() {
|
|
return NormalizeError;
|
|
},
|
|
PageNotFoundError: function() {
|
|
return PageNotFoundError;
|
|
},
|
|
SP: function() {
|
|
return SP;
|
|
},
|
|
ST: function() {
|
|
return ST;
|
|
},
|
|
WEB_VITALS: function() {
|
|
return WEB_VITALS;
|
|
},
|
|
execOnce: function() {
|
|
return execOnce;
|
|
},
|
|
getDisplayName: function() {
|
|
return getDisplayName;
|
|
},
|
|
getLocationOrigin: function() {
|
|
return getLocationOrigin;
|
|
},
|
|
getURL: function() {
|
|
return getURL;
|
|
},
|
|
isAbsoluteUrl: function() {
|
|
return isAbsoluteUrl;
|
|
},
|
|
isResSent: function() {
|
|
return isResSent;
|
|
},
|
|
loadGetInitialProps: function() {
|
|
return loadGetInitialProps;
|
|
},
|
|
normalizeRepeatedSlashes: function() {
|
|
return normalizeRepeatedSlashes;
|
|
},
|
|
stringifyError: function() {
|
|
return stringifyError;
|
|
}
|
|
});
|
|
const WEB_VITALS = [
|
|
'CLS',
|
|
'FCP',
|
|
'FID',
|
|
'INP',
|
|
'LCP',
|
|
'TTFB'
|
|
];
|
|
function execOnce(fn) {
|
|
let used = false;
|
|
let result;
|
|
return (...args)=>{
|
|
if (!used) {
|
|
used = true;
|
|
result = fn(...args);
|
|
}
|
|
return result;
|
|
};
|
|
}
|
|
// Scheme: https://tools.ietf.org/html/rfc3986#section-3.1
|
|
// Absolute URL: https://tools.ietf.org/html/rfc3986#section-4.3
|
|
const ABSOLUTE_URL_REGEX = /^[a-zA-Z][a-zA-Z\d+\-.]*?:/;
|
|
const isAbsoluteUrl = (url)=>ABSOLUTE_URL_REGEX.test(url);
|
|
function getLocationOrigin() {
|
|
const { protocol, hostname, port } = window.location;
|
|
return `${protocol}//${hostname}${port ? ':' + port : ''}`;
|
|
}
|
|
function getURL() {
|
|
const { href } = window.location;
|
|
const origin = getLocationOrigin();
|
|
return href.substring(origin.length);
|
|
}
|
|
function getDisplayName(Component) {
|
|
return typeof Component === 'string' ? Component : Component.displayName || Component.name || 'Unknown';
|
|
}
|
|
function isResSent(res) {
|
|
return res.finished || res.headersSent;
|
|
}
|
|
function normalizeRepeatedSlashes(url) {
|
|
const urlParts = url.split('?');
|
|
const urlNoQuery = urlParts[0];
|
|
return urlNoQuery // first we replace any non-encoded backslashes with forward
|
|
// then normalize repeated forward slashes
|
|
.replace(/\\/g, '/').replace(/\/\/+/g, '/') + (urlParts[1] ? `?${urlParts.slice(1).join('?')}` : '');
|
|
}
|
|
async function loadGetInitialProps(App, ctx) {
|
|
if ("TURBOPACK compile-time truthy", 1) {
|
|
if (App.prototype?.getInitialProps) {
|
|
const message = `"${getDisplayName(App)}.getInitialProps()" is defined as an instance method - visit https://nextjs.org/docs/messages/get-initial-props-as-an-instance-method for more information.`;
|
|
throw Object.defineProperty(new Error(message), "__NEXT_ERROR_CODE", {
|
|
value: "E394",
|
|
enumerable: false,
|
|
configurable: true
|
|
});
|
|
}
|
|
}
|
|
// when called from _app `ctx` is nested in `ctx`
|
|
const res = ctx.res || ctx.ctx && ctx.ctx.res;
|
|
if (!App.getInitialProps) {
|
|
if (ctx.ctx && ctx.Component) {
|
|
// @ts-ignore pageProps default
|
|
return {
|
|
pageProps: await loadGetInitialProps(ctx.Component, ctx.ctx)
|
|
};
|
|
}
|
|
return {};
|
|
}
|
|
const props = await App.getInitialProps(ctx);
|
|
if (res && isResSent(res)) {
|
|
return props;
|
|
}
|
|
if (!props) {
|
|
const message = `"${getDisplayName(App)}.getInitialProps()" should resolve to an object. But found "${props}" instead.`;
|
|
throw Object.defineProperty(new Error(message), "__NEXT_ERROR_CODE", {
|
|
value: "E394",
|
|
enumerable: false,
|
|
configurable: true
|
|
});
|
|
}
|
|
if ("TURBOPACK compile-time truthy", 1) {
|
|
if (Object.keys(props).length === 0 && !ctx.ctx) {
|
|
console.warn(`${getDisplayName(App)} returned an empty object from \`getInitialProps\`. This de-optimizes and prevents automatic static optimization. https://nextjs.org/docs/messages/empty-object-getInitialProps`);
|
|
}
|
|
}
|
|
return props;
|
|
}
|
|
const SP = typeof performance !== 'undefined';
|
|
const ST = SP && [
|
|
'mark',
|
|
'measure',
|
|
'getEntriesByName'
|
|
].every((method)=>typeof performance[method] === 'function');
|
|
class DecodeError extends Error {
|
|
}
|
|
class NormalizeError extends Error {
|
|
}
|
|
class PageNotFoundError extends Error {
|
|
constructor(page){
|
|
super();
|
|
this.code = 'ENOENT';
|
|
this.name = 'PageNotFoundError';
|
|
this.message = `Cannot find module for page: ${page}`;
|
|
}
|
|
}
|
|
class MissingStaticPage extends Error {
|
|
constructor(page, message){
|
|
super();
|
|
this.message = `Failed to load static file for page: ${page} ${message}`;
|
|
}
|
|
}
|
|
class MiddlewareNotFoundError extends Error {
|
|
constructor(){
|
|
super();
|
|
this.code = 'ENOENT';
|
|
this.message = `Cannot find the middleware module`;
|
|
}
|
|
}
|
|
function stringifyError(error) {
|
|
return JSON.stringify({
|
|
message: error.message,
|
|
stack: error.stack
|
|
});
|
|
} //# sourceMappingURL=utils.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/shared/lib/router/utils/parse-path.js [app-ssr] (ecmascript)", ((__turbopack_context__, module, exports) => {
|
|
"use strict";
|
|
|
|
/**
|
|
* Given a path this function will find the pathname, query and hash and return
|
|
* them. This is useful to parse full paths on the client side.
|
|
* @param path A path to parse e.g. /foo/bar?id=1#hash
|
|
*/ Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
Object.defineProperty(exports, "parsePath", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return parsePath;
|
|
}
|
|
});
|
|
function parsePath(path) {
|
|
const hashIndex = path.indexOf('#');
|
|
const queryIndex = path.indexOf('?');
|
|
const hasQuery = queryIndex > -1 && (hashIndex < 0 || queryIndex < hashIndex);
|
|
if (hasQuery || hashIndex > -1) {
|
|
return {
|
|
pathname: path.substring(0, hasQuery ? queryIndex : hashIndex),
|
|
query: hasQuery ? path.substring(queryIndex, hashIndex > -1 ? hashIndex : undefined) : '',
|
|
hash: hashIndex > -1 ? path.slice(hashIndex) : ''
|
|
};
|
|
}
|
|
return {
|
|
pathname: path,
|
|
query: '',
|
|
hash: ''
|
|
};
|
|
} //# sourceMappingURL=parse-path.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/shared/lib/router/utils/add-path-prefix.js [app-ssr] (ecmascript)", ((__turbopack_context__, module, exports) => {
|
|
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
Object.defineProperty(exports, "addPathPrefix", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return addPathPrefix;
|
|
}
|
|
});
|
|
const _parsepath = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/shared/lib/router/utils/parse-path.js [app-ssr] (ecmascript)");
|
|
function addPathPrefix(path, prefix) {
|
|
if (!path.startsWith('/') || !prefix) {
|
|
return path;
|
|
}
|
|
const { pathname, query, hash } = (0, _parsepath.parsePath)(path);
|
|
return `${prefix}${pathname}${query}${hash}`;
|
|
} //# sourceMappingURL=add-path-prefix.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/shared/lib/router/utils/remove-trailing-slash.js [app-ssr] (ecmascript)", ((__turbopack_context__, module, exports) => {
|
|
"use strict";
|
|
|
|
/**
|
|
* Removes the trailing slash for a given route or page path. Preserves the
|
|
* root page. Examples:
|
|
* - `/foo/bar/` -> `/foo/bar`
|
|
* - `/foo/bar` -> `/foo/bar`
|
|
* - `/` -> `/`
|
|
*/ Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
Object.defineProperty(exports, "removeTrailingSlash", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return removeTrailingSlash;
|
|
}
|
|
});
|
|
function removeTrailingSlash(route) {
|
|
return route.replace(/\/$/, '') || '/';
|
|
} //# sourceMappingURL=remove-trailing-slash.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/normalize-trailing-slash.js [app-ssr] (ecmascript)", ((__turbopack_context__, module, exports) => {
|
|
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
Object.defineProperty(exports, "normalizePathTrailingSlash", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return normalizePathTrailingSlash;
|
|
}
|
|
});
|
|
const _removetrailingslash = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/shared/lib/router/utils/remove-trailing-slash.js [app-ssr] (ecmascript)");
|
|
const _parsepath = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/shared/lib/router/utils/parse-path.js [app-ssr] (ecmascript)");
|
|
const normalizePathTrailingSlash = (path)=>{
|
|
if (!path.startsWith('/') || ("TURBOPACK compile-time value", void 0)) {
|
|
return path;
|
|
}
|
|
const { pathname, query, hash } = (0, _parsepath.parsePath)(path);
|
|
if ("TURBOPACK compile-time falsy", 0) //TURBOPACK unreachable
|
|
;
|
|
return `${(0, _removetrailingslash.removeTrailingSlash)(pathname)}${query}${hash}`;
|
|
};
|
|
if ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') {
|
|
Object.defineProperty(exports.default, '__esModule', {
|
|
value: true
|
|
});
|
|
Object.assign(exports.default, exports);
|
|
module.exports = exports.default;
|
|
} //# sourceMappingURL=normalize-trailing-slash.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/add-base-path.js [app-ssr] (ecmascript)", ((__turbopack_context__, module, exports) => {
|
|
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
Object.defineProperty(exports, "addBasePath", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return addBasePath;
|
|
}
|
|
});
|
|
const _addpathprefix = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/shared/lib/router/utils/add-path-prefix.js [app-ssr] (ecmascript)");
|
|
const _normalizetrailingslash = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/normalize-trailing-slash.js [app-ssr] (ecmascript)");
|
|
const basePath = ("TURBOPACK compile-time value", "") || '';
|
|
function addBasePath(path, required) {
|
|
return (0, _normalizetrailingslash.normalizePathTrailingSlash)(("TURBOPACK compile-time falsy", 0) ? "TURBOPACK unreachable" : (0, _addpathprefix.addPathPrefix)(path, basePath));
|
|
}
|
|
if ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') {
|
|
Object.defineProperty(exports.default, '__esModule', {
|
|
value: true
|
|
});
|
|
Object.assign(exports.default, exports);
|
|
module.exports = exports.default;
|
|
} //# sourceMappingURL=add-base-path.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/shared/lib/utils/warn-once.js [app-ssr] (ecmascript)", ((__turbopack_context__, module, exports) => {
|
|
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
Object.defineProperty(exports, "warnOnce", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return warnOnce;
|
|
}
|
|
});
|
|
let warnOnce = (_)=>{};
|
|
if ("TURBOPACK compile-time truthy", 1) {
|
|
const warnings = new Set();
|
|
warnOnce = (msg)=>{
|
|
if (!warnings.has(msg)) {
|
|
console.warn(msg);
|
|
}
|
|
warnings.add(msg);
|
|
};
|
|
} //# sourceMappingURL=warn-once.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/segment-cache/types.js [app-ssr] (ecmascript)", ((__turbopack_context__, module, exports) => {
|
|
"use strict";
|
|
|
|
/**
|
|
* Shared types and constants for the Segment Cache.
|
|
*/ Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
0 && (module.exports = {
|
|
FetchStrategy: null,
|
|
NavigationResultTag: null,
|
|
PrefetchPriority: null
|
|
});
|
|
function _export(target, all) {
|
|
for(var name in all)Object.defineProperty(target, name, {
|
|
enumerable: true,
|
|
get: all[name]
|
|
});
|
|
}
|
|
_export(exports, {
|
|
FetchStrategy: function() {
|
|
return FetchStrategy;
|
|
},
|
|
NavigationResultTag: function() {
|
|
return NavigationResultTag;
|
|
},
|
|
PrefetchPriority: function() {
|
|
return PrefetchPriority;
|
|
}
|
|
});
|
|
var NavigationResultTag = /*#__PURE__*/ function(NavigationResultTag) {
|
|
NavigationResultTag[NavigationResultTag["MPA"] = 0] = "MPA";
|
|
NavigationResultTag[NavigationResultTag["Success"] = 1] = "Success";
|
|
NavigationResultTag[NavigationResultTag["NoOp"] = 2] = "NoOp";
|
|
NavigationResultTag[NavigationResultTag["Async"] = 3] = "Async";
|
|
return NavigationResultTag;
|
|
}({});
|
|
var PrefetchPriority = /*#__PURE__*/ function(PrefetchPriority) {
|
|
/**
|
|
* Assigned to the most recently hovered/touched link. Special network
|
|
* bandwidth is reserved for this task only. There's only ever one Intent-
|
|
* priority task at a time; when a new Intent task is scheduled, the previous
|
|
* one is bumped down to Default.
|
|
*/ PrefetchPriority[PrefetchPriority["Intent"] = 2] = "Intent";
|
|
/**
|
|
* The default priority for prefetch tasks.
|
|
*/ PrefetchPriority[PrefetchPriority["Default"] = 1] = "Default";
|
|
/**
|
|
* Assigned to tasks when they spawn non-blocking background work, like
|
|
* revalidating a partially cached entry to see if more data is available.
|
|
*/ PrefetchPriority[PrefetchPriority["Background"] = 0] = "Background";
|
|
return PrefetchPriority;
|
|
}({});
|
|
var FetchStrategy = /*#__PURE__*/ function(FetchStrategy) {
|
|
// Deliberately ordered so we can easily compare two segments
|
|
// and determine if one segment is "more specific" than another
|
|
// (i.e. if it's likely that it contains more data)
|
|
FetchStrategy[FetchStrategy["LoadingBoundary"] = 0] = "LoadingBoundary";
|
|
FetchStrategy[FetchStrategy["PPR"] = 1] = "PPR";
|
|
FetchStrategy[FetchStrategy["PPRRuntime"] = 2] = "PPRRuntime";
|
|
FetchStrategy[FetchStrategy["Full"] = 3] = "Full";
|
|
return FetchStrategy;
|
|
}({});
|
|
if ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') {
|
|
Object.defineProperty(exports.default, '__esModule', {
|
|
value: true
|
|
});
|
|
Object.assign(exports.default, exports);
|
|
module.exports = exports.default;
|
|
} //# sourceMappingURL=types.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/segment-cache/cache-key.js [app-ssr] (ecmascript)", ((__turbopack_context__, module, exports) => {
|
|
"use strict";
|
|
|
|
// TypeScript trick to simulate opaque types, like in Flow.
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
Object.defineProperty(exports, "createCacheKey", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return createCacheKey;
|
|
}
|
|
});
|
|
function createCacheKey(originalHref, nextUrl) {
|
|
const originalUrl = new URL(originalHref);
|
|
const cacheKey = {
|
|
pathname: originalUrl.pathname,
|
|
search: originalUrl.search,
|
|
nextUrl: nextUrl
|
|
};
|
|
return cacheKey;
|
|
}
|
|
if ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') {
|
|
Object.defineProperty(exports.default, '__esModule', {
|
|
value: true
|
|
});
|
|
Object.assign(exports.default, exports);
|
|
module.exports = exports.default;
|
|
} //# sourceMappingURL=cache-key.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/shared/lib/app-router-types.js [app-ssr] (ecmascript)", ((__turbopack_context__, module, exports) => {
|
|
"use strict";
|
|
|
|
/**
|
|
* App Router types - Client-safe types for the Next.js App Router
|
|
*
|
|
* This file contains type definitions that can be safely imported
|
|
* by both client-side and server-side code without circular dependencies.
|
|
*/ Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
Object.defineProperty(exports, "HasLoadingBoundary", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return HasLoadingBoundary;
|
|
}
|
|
});
|
|
var HasLoadingBoundary = /*#__PURE__*/ function(HasLoadingBoundary) {
|
|
// There is a loading boundary in this particular segment
|
|
HasLoadingBoundary[HasLoadingBoundary["SegmentHasLoadingBoundary"] = 1] = "SegmentHasLoadingBoundary";
|
|
// There is a loading boundary somewhere in the subtree (but not in
|
|
// this segment)
|
|
HasLoadingBoundary[HasLoadingBoundary["SubtreeHasLoadingBoundary"] = 2] = "SubtreeHasLoadingBoundary";
|
|
// There is no loading boundary in this segment or any of its descendants
|
|
HasLoadingBoundary[HasLoadingBoundary["SubtreeHasNoLoadingBoundary"] = 3] = "SubtreeHasNoLoadingBoundary";
|
|
return HasLoadingBoundary;
|
|
}({}); //# sourceMappingURL=app-router-types.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/match-segments.js [app-ssr] (ecmascript)", ((__turbopack_context__, module, exports) => {
|
|
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
Object.defineProperty(exports, "matchSegment", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return matchSegment;
|
|
}
|
|
});
|
|
const matchSegment = (existingSegment, segment)=>{
|
|
// segment is either Array or string
|
|
if (typeof existingSegment === 'string') {
|
|
if (typeof segment === 'string') {
|
|
// Common case: segment is just a string
|
|
return existingSegment === segment;
|
|
}
|
|
return false;
|
|
}
|
|
if (typeof segment === 'string') {
|
|
return false;
|
|
}
|
|
return existingSegment[0] === segment[0] && existingSegment[1] === segment[1];
|
|
};
|
|
if ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') {
|
|
Object.defineProperty(exports.default, '__esModule', {
|
|
value: true
|
|
});
|
|
Object.assign(exports.default, exports);
|
|
module.exports = exports.default;
|
|
} //# sourceMappingURL=match-segments.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/app-router-headers.js [app-ssr] (ecmascript)", ((__turbopack_context__, module, exports) => {
|
|
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
0 && (module.exports = {
|
|
ACTION_HEADER: null,
|
|
FLIGHT_HEADERS: null,
|
|
NEXT_ACTION_NOT_FOUND_HEADER: null,
|
|
NEXT_DID_POSTPONE_HEADER: null,
|
|
NEXT_HMR_REFRESH_HASH_COOKIE: null,
|
|
NEXT_HMR_REFRESH_HEADER: null,
|
|
NEXT_HTML_REQUEST_ID_HEADER: null,
|
|
NEXT_IS_PRERENDER_HEADER: null,
|
|
NEXT_REQUEST_ID_HEADER: null,
|
|
NEXT_REWRITTEN_PATH_HEADER: null,
|
|
NEXT_REWRITTEN_QUERY_HEADER: null,
|
|
NEXT_ROUTER_PREFETCH_HEADER: null,
|
|
NEXT_ROUTER_SEGMENT_PREFETCH_HEADER: null,
|
|
NEXT_ROUTER_STALE_TIME_HEADER: null,
|
|
NEXT_ROUTER_STATE_TREE_HEADER: null,
|
|
NEXT_RSC_UNION_QUERY: null,
|
|
NEXT_URL: null,
|
|
RSC_CONTENT_TYPE_HEADER: null,
|
|
RSC_HEADER: null
|
|
});
|
|
function _export(target, all) {
|
|
for(var name in all)Object.defineProperty(target, name, {
|
|
enumerable: true,
|
|
get: all[name]
|
|
});
|
|
}
|
|
_export(exports, {
|
|
ACTION_HEADER: function() {
|
|
return ACTION_HEADER;
|
|
},
|
|
FLIGHT_HEADERS: function() {
|
|
return FLIGHT_HEADERS;
|
|
},
|
|
NEXT_ACTION_NOT_FOUND_HEADER: function() {
|
|
return NEXT_ACTION_NOT_FOUND_HEADER;
|
|
},
|
|
NEXT_DID_POSTPONE_HEADER: function() {
|
|
return NEXT_DID_POSTPONE_HEADER;
|
|
},
|
|
NEXT_HMR_REFRESH_HASH_COOKIE: function() {
|
|
return NEXT_HMR_REFRESH_HASH_COOKIE;
|
|
},
|
|
NEXT_HMR_REFRESH_HEADER: function() {
|
|
return NEXT_HMR_REFRESH_HEADER;
|
|
},
|
|
NEXT_HTML_REQUEST_ID_HEADER: function() {
|
|
return NEXT_HTML_REQUEST_ID_HEADER;
|
|
},
|
|
NEXT_IS_PRERENDER_HEADER: function() {
|
|
return NEXT_IS_PRERENDER_HEADER;
|
|
},
|
|
NEXT_REQUEST_ID_HEADER: function() {
|
|
return NEXT_REQUEST_ID_HEADER;
|
|
},
|
|
NEXT_REWRITTEN_PATH_HEADER: function() {
|
|
return NEXT_REWRITTEN_PATH_HEADER;
|
|
},
|
|
NEXT_REWRITTEN_QUERY_HEADER: function() {
|
|
return NEXT_REWRITTEN_QUERY_HEADER;
|
|
},
|
|
NEXT_ROUTER_PREFETCH_HEADER: function() {
|
|
return NEXT_ROUTER_PREFETCH_HEADER;
|
|
},
|
|
NEXT_ROUTER_SEGMENT_PREFETCH_HEADER: function() {
|
|
return NEXT_ROUTER_SEGMENT_PREFETCH_HEADER;
|
|
},
|
|
NEXT_ROUTER_STALE_TIME_HEADER: function() {
|
|
return NEXT_ROUTER_STALE_TIME_HEADER;
|
|
},
|
|
NEXT_ROUTER_STATE_TREE_HEADER: function() {
|
|
return NEXT_ROUTER_STATE_TREE_HEADER;
|
|
},
|
|
NEXT_RSC_UNION_QUERY: function() {
|
|
return NEXT_RSC_UNION_QUERY;
|
|
},
|
|
NEXT_URL: function() {
|
|
return NEXT_URL;
|
|
},
|
|
RSC_CONTENT_TYPE_HEADER: function() {
|
|
return RSC_CONTENT_TYPE_HEADER;
|
|
},
|
|
RSC_HEADER: function() {
|
|
return RSC_HEADER;
|
|
}
|
|
});
|
|
const RSC_HEADER = 'rsc';
|
|
const ACTION_HEADER = 'next-action';
|
|
const NEXT_ROUTER_STATE_TREE_HEADER = 'next-router-state-tree';
|
|
const NEXT_ROUTER_PREFETCH_HEADER = 'next-router-prefetch';
|
|
const NEXT_ROUTER_SEGMENT_PREFETCH_HEADER = 'next-router-segment-prefetch';
|
|
const NEXT_HMR_REFRESH_HEADER = 'next-hmr-refresh';
|
|
const NEXT_HMR_REFRESH_HASH_COOKIE = '__next_hmr_refresh_hash__';
|
|
const NEXT_URL = 'next-url';
|
|
const RSC_CONTENT_TYPE_HEADER = 'text/x-component';
|
|
const FLIGHT_HEADERS = [
|
|
RSC_HEADER,
|
|
NEXT_ROUTER_STATE_TREE_HEADER,
|
|
NEXT_ROUTER_PREFETCH_HEADER,
|
|
NEXT_HMR_REFRESH_HEADER,
|
|
NEXT_ROUTER_SEGMENT_PREFETCH_HEADER
|
|
];
|
|
const NEXT_RSC_UNION_QUERY = '_rsc';
|
|
const NEXT_ROUTER_STALE_TIME_HEADER = 'x-nextjs-stale-time';
|
|
const NEXT_DID_POSTPONE_HEADER = 'x-nextjs-postponed';
|
|
const NEXT_REWRITTEN_PATH_HEADER = 'x-nextjs-rewritten-path';
|
|
const NEXT_REWRITTEN_QUERY_HEADER = 'x-nextjs-rewritten-query';
|
|
const NEXT_IS_PRERENDER_HEADER = 'x-nextjs-prerender';
|
|
const NEXT_ACTION_NOT_FOUND_HEADER = 'x-nextjs-action-not-found';
|
|
const NEXT_REQUEST_ID_HEADER = 'x-nextjs-request-id';
|
|
const NEXT_HTML_REQUEST_ID_HEADER = 'x-nextjs-html-request-id';
|
|
if ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') {
|
|
Object.defineProperty(exports.default, '__esModule', {
|
|
value: true
|
|
});
|
|
Object.assign(exports.default, exports);
|
|
module.exports = exports.default;
|
|
} //# sourceMappingURL=app-router-headers.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react-server-dom-turbopack-client.js [app-ssr] (ecmascript)", ((__turbopack_context__, module, exports) => {
|
|
"use strict";
|
|
|
|
module.exports = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/server/route-modules/app-page/module.compiled.js [app-ssr] (ecmascript)").vendored['react-ssr'].ReactServerDOMTurbopackClient; //# sourceMappingURL=react-server-dom-turbopack-client.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/router-reducer/router-reducer-types.js [app-ssr] (ecmascript)", ((__turbopack_context__, module, exports) => {
|
|
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
0 && (module.exports = {
|
|
ACTION_HMR_REFRESH: null,
|
|
ACTION_NAVIGATE: null,
|
|
ACTION_REFRESH: null,
|
|
ACTION_RESTORE: null,
|
|
ACTION_SERVER_ACTION: null,
|
|
ACTION_SERVER_PATCH: null,
|
|
PrefetchKind: null
|
|
});
|
|
function _export(target, all) {
|
|
for(var name in all)Object.defineProperty(target, name, {
|
|
enumerable: true,
|
|
get: all[name]
|
|
});
|
|
}
|
|
_export(exports, {
|
|
ACTION_HMR_REFRESH: function() {
|
|
return ACTION_HMR_REFRESH;
|
|
},
|
|
ACTION_NAVIGATE: function() {
|
|
return ACTION_NAVIGATE;
|
|
},
|
|
ACTION_REFRESH: function() {
|
|
return ACTION_REFRESH;
|
|
},
|
|
ACTION_RESTORE: function() {
|
|
return ACTION_RESTORE;
|
|
},
|
|
ACTION_SERVER_ACTION: function() {
|
|
return ACTION_SERVER_ACTION;
|
|
},
|
|
ACTION_SERVER_PATCH: function() {
|
|
return ACTION_SERVER_PATCH;
|
|
},
|
|
PrefetchKind: function() {
|
|
return PrefetchKind;
|
|
}
|
|
});
|
|
const ACTION_REFRESH = 'refresh';
|
|
const ACTION_NAVIGATE = 'navigate';
|
|
const ACTION_RESTORE = 'restore';
|
|
const ACTION_SERVER_PATCH = 'server-patch';
|
|
const ACTION_HMR_REFRESH = 'hmr-refresh';
|
|
const ACTION_SERVER_ACTION = 'server-action';
|
|
var PrefetchKind = /*#__PURE__*/ function(PrefetchKind) {
|
|
PrefetchKind["AUTO"] = "auto";
|
|
PrefetchKind["FULL"] = "full";
|
|
PrefetchKind["TEMPORARY"] = "temporary";
|
|
return PrefetchKind;
|
|
}({});
|
|
if ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') {
|
|
Object.defineProperty(exports.default, '__esModule', {
|
|
value: true
|
|
});
|
|
Object.assign(exports.default, exports);
|
|
module.exports = exports.default;
|
|
} //# sourceMappingURL=router-reducer-types.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/shared/lib/is-thenable.js [app-ssr] (ecmascript)", ((__turbopack_context__, module, exports) => {
|
|
"use strict";
|
|
|
|
/**
|
|
* Check to see if a value is Thenable.
|
|
*
|
|
* @param promise the maybe-thenable value
|
|
* @returns true if the value is thenable
|
|
*/ Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
Object.defineProperty(exports, "isThenable", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return isThenable;
|
|
}
|
|
});
|
|
function isThenable(promise) {
|
|
return promise !== null && typeof promise === 'object' && 'then' in promise && typeof promise.then === 'function';
|
|
} //# sourceMappingURL=is-thenable.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/next-devtools/dev-overlay.shim.js [app-ssr] (ecmascript)", ((__turbopack_context__, module, exports) => {
|
|
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
0 && (module.exports = {
|
|
dispatcher: null,
|
|
renderAppDevOverlay: null,
|
|
renderPagesDevOverlay: null
|
|
});
|
|
function _export(target, all) {
|
|
for(var name in all)Object.defineProperty(target, name, {
|
|
enumerable: true,
|
|
get: all[name]
|
|
});
|
|
}
|
|
_export(exports, {
|
|
dispatcher: function() {
|
|
return dispatcher;
|
|
},
|
|
renderAppDevOverlay: function() {
|
|
return renderAppDevOverlay;
|
|
},
|
|
renderPagesDevOverlay: function() {
|
|
return renderPagesDevOverlay;
|
|
}
|
|
});
|
|
function renderAppDevOverlay() {
|
|
throw Object.defineProperty(new Error("Next DevTools: Can't render in this environment. This is a bug in Next.js"), "__NEXT_ERROR_CODE", {
|
|
value: "E697",
|
|
enumerable: false,
|
|
configurable: true
|
|
});
|
|
}
|
|
function renderPagesDevOverlay() {
|
|
throw Object.defineProperty(new Error("Next DevTools: Can't render in this environment. This is a bug in Next.js"), "__NEXT_ERROR_CODE", {
|
|
value: "E697",
|
|
enumerable: false,
|
|
configurable: true
|
|
});
|
|
}
|
|
const dispatcher = new Proxy({}, {
|
|
get: (_, prop)=>{
|
|
return ()=>{
|
|
throw Object.defineProperty(new Error(`Next DevTools: Can't dispatch ${String(prop)} in this environment. This is a bug in Next.js`), "__NEXT_ERROR_CODE", {
|
|
value: "E698",
|
|
enumerable: false,
|
|
configurable: true
|
|
});
|
|
};
|
|
}
|
|
});
|
|
if ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') {
|
|
Object.defineProperty(exports.default, '__esModule', {
|
|
value: true
|
|
});
|
|
Object.assign(exports.default, exports);
|
|
module.exports = exports.default;
|
|
} //# sourceMappingURL=dev-overlay.shim.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/next-devtools/userspace/use-app-dev-rendering-indicator.js [app-ssr] (ecmascript)", ((__turbopack_context__, module, exports) => {
|
|
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
Object.defineProperty(exports, "useAppDevRenderingIndicator", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return useAppDevRenderingIndicator;
|
|
}
|
|
});
|
|
const _react = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react.js [app-ssr] (ecmascript)");
|
|
const _nextdevtools = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/next-devtools/dev-overlay.shim.js [app-ssr] (ecmascript)");
|
|
const useAppDevRenderingIndicator = ()=>{
|
|
const [isPending, startTransition] = (0, _react.useTransition)();
|
|
(0, _react.useEffect)(()=>{
|
|
if (isPending) {
|
|
_nextdevtools.dispatcher.renderingIndicatorShow();
|
|
} else {
|
|
_nextdevtools.dispatcher.renderingIndicatorHide();
|
|
}
|
|
}, [
|
|
isPending
|
|
]);
|
|
return startTransition;
|
|
};
|
|
if ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') {
|
|
Object.defineProperty(exports.default, '__esModule', {
|
|
value: true
|
|
});
|
|
Object.assign(exports.default, exports);
|
|
module.exports = exports.default;
|
|
} //# sourceMappingURL=use-app-dev-rendering-indicator.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/use-action-queue.js [app-ssr] (ecmascript)", ((__turbopack_context__, module, exports) => {
|
|
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
0 && (module.exports = {
|
|
dispatchAppRouterAction: null,
|
|
useActionQueue: null
|
|
});
|
|
function _export(target, all) {
|
|
for(var name in all)Object.defineProperty(target, name, {
|
|
enumerable: true,
|
|
get: all[name]
|
|
});
|
|
}
|
|
_export(exports, {
|
|
dispatchAppRouterAction: function() {
|
|
return dispatchAppRouterAction;
|
|
},
|
|
useActionQueue: function() {
|
|
return useActionQueue;
|
|
}
|
|
});
|
|
const _interop_require_wildcard = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/@swc+helpers@0.5.15/node_modules/@swc/helpers/cjs/_interop_require_wildcard.cjs [app-ssr] (ecmascript)");
|
|
const _react = /*#__PURE__*/ _interop_require_wildcard._(__turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react.js [app-ssr] (ecmascript)"));
|
|
const _isthenable = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/shared/lib/is-thenable.js [app-ssr] (ecmascript)");
|
|
// The app router state lives outside of React, so we can import the dispatch
|
|
// method directly wherever we need it, rather than passing it around via props
|
|
// or context.
|
|
let dispatch = null;
|
|
function dispatchAppRouterAction(action) {
|
|
if (dispatch === null) {
|
|
throw Object.defineProperty(new Error('Internal Next.js error: Router action dispatched before initialization.'), "__NEXT_ERROR_CODE", {
|
|
value: "E668",
|
|
enumerable: false,
|
|
configurable: true
|
|
});
|
|
}
|
|
dispatch(action);
|
|
}
|
|
const __DEV__ = ("TURBOPACK compile-time value", "development") !== 'production';
|
|
const promisesWithDebugInfo = ("TURBOPACK compile-time truthy", 1) ? new WeakMap() : "TURBOPACK unreachable";
|
|
function useActionQueue(actionQueue) {
|
|
const [state, setState] = _react.default.useState(actionQueue.state);
|
|
// Because of a known issue that requires to decode Flight streams inside the
|
|
// render phase, we have to be a bit clever and assign the dispatch method to
|
|
// a module-level variable upon initialization. The useState hook in this
|
|
// module only exists to synchronize state that lives outside of React.
|
|
// Ideally, what we'd do instead is pass the state as a prop to root.render;
|
|
// this is conceptually how we're modeling the app router state, despite the
|
|
// weird implementation details.
|
|
if ("TURBOPACK compile-time truthy", 1) {
|
|
const { useAppDevRenderingIndicator } = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/next-devtools/userspace/use-app-dev-rendering-indicator.js [app-ssr] (ecmascript)");
|
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
const appDevRenderingIndicator = useAppDevRenderingIndicator();
|
|
dispatch = (action)=>{
|
|
appDevRenderingIndicator(()=>{
|
|
actionQueue.dispatch(action, setState);
|
|
});
|
|
};
|
|
} else //TURBOPACK unreachable
|
|
;
|
|
// When navigating to a non-prefetched route, then App Router state will be
|
|
// blocked until the server responds. We need to transfer the `_debugInfo`
|
|
// from the underlying Flight response onto the top-level promise that is
|
|
// passed to React (via `use`) so that the latency is accurately represented
|
|
// in the React DevTools.
|
|
const stateWithDebugInfo = (0, _react.useMemo)(()=>{
|
|
if ("TURBOPACK compile-time falsy", 0) //TURBOPACK unreachable
|
|
;
|
|
if ((0, _isthenable.isThenable)(state)) {
|
|
// useMemo can't be used to cache a Promise since the memoized value is thrown
|
|
// away when we suspend. So we use a WeakMap to cache the Promise with debug info.
|
|
let promiseWithDebugInfo = promisesWithDebugInfo.get(state);
|
|
if (promiseWithDebugInfo === undefined) {
|
|
const debugInfo = [];
|
|
promiseWithDebugInfo = Promise.resolve(state).then((asyncState)=>{
|
|
if (asyncState.debugInfo !== null) {
|
|
debugInfo.push(...asyncState.debugInfo);
|
|
}
|
|
return asyncState;
|
|
});
|
|
promiseWithDebugInfo._debugInfo = debugInfo;
|
|
promisesWithDebugInfo.set(state, promiseWithDebugInfo);
|
|
}
|
|
return promiseWithDebugInfo;
|
|
}
|
|
return state;
|
|
}, [
|
|
state
|
|
]);
|
|
return (0, _isthenable.isThenable)(stateWithDebugInfo) ? (0, _react.use)(stateWithDebugInfo) : stateWithDebugInfo;
|
|
}
|
|
if ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') {
|
|
Object.defineProperty(exports.default, '__esModule', {
|
|
value: true
|
|
});
|
|
Object.assign(exports.default, exports);
|
|
module.exports = exports.default;
|
|
} //# sourceMappingURL=use-action-queue.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/app-call-server.js [app-ssr] (ecmascript)", ((__turbopack_context__, module, exports) => {
|
|
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
Object.defineProperty(exports, "callServer", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return callServer;
|
|
}
|
|
});
|
|
const _react = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react.js [app-ssr] (ecmascript)");
|
|
const _routerreducertypes = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/router-reducer/router-reducer-types.js [app-ssr] (ecmascript)");
|
|
const _useactionqueue = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/use-action-queue.js [app-ssr] (ecmascript)");
|
|
async function callServer(actionId, actionArgs) {
|
|
return new Promise((resolve, reject)=>{
|
|
(0, _react.startTransition)(()=>{
|
|
(0, _useactionqueue.dispatchAppRouterAction)({
|
|
type: _routerreducertypes.ACTION_SERVER_ACTION,
|
|
actionId,
|
|
actionArgs,
|
|
resolve,
|
|
reject
|
|
});
|
|
});
|
|
});
|
|
}
|
|
if ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') {
|
|
Object.defineProperty(exports.default, '__esModule', {
|
|
value: true
|
|
});
|
|
Object.assign(exports.default, exports);
|
|
module.exports = exports.default;
|
|
} //# sourceMappingURL=app-call-server.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/app-find-source-map-url.js [app-ssr] (ecmascript)", ((__turbopack_context__, module, exports) => {
|
|
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
Object.defineProperty(exports, "findSourceMapURL", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return findSourceMapURL;
|
|
}
|
|
});
|
|
const basePath = ("TURBOPACK compile-time value", "") || '';
|
|
const pathname = `${basePath}/__nextjs_source-map`;
|
|
const findSourceMapURL = ("TURBOPACK compile-time truthy", 1) ? function findSourceMapURL(filename) {
|
|
if (filename === '') {
|
|
return null;
|
|
}
|
|
if (filename.startsWith(document.location.origin) && filename.includes('/_next/static')) {
|
|
// This is a request for a client chunk. This can only happen when
|
|
// using Turbopack. In this case, since we control how those source
|
|
// maps are generated, we can safely assume that the sourceMappingURL
|
|
// is relative to the filename, with an added `.map` extension. The
|
|
// browser can just request this file, and it gets served through the
|
|
// normal dev server, without the need to route this through
|
|
// the `/__nextjs_source-map` dev middleware.
|
|
return `${filename}.map`;
|
|
}
|
|
const url = new URL(pathname, document.location.origin);
|
|
url.searchParams.set('filename', filename);
|
|
return url.href;
|
|
} : "TURBOPACK unreachable";
|
|
if ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') {
|
|
Object.defineProperty(exports.default, '__esModule', {
|
|
value: true
|
|
});
|
|
Object.assign(exports.default, exports);
|
|
module.exports = exports.default;
|
|
} //# sourceMappingURL=app-find-source-map-url.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/shared/lib/segment-cache/segment-value-encoding.js [app-ssr] (ecmascript)", ((__turbopack_context__, module, exports) => {
|
|
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
0 && (module.exports = {
|
|
HEAD_REQUEST_KEY: null,
|
|
ROOT_SEGMENT_REQUEST_KEY: null,
|
|
appendSegmentRequestKeyPart: null,
|
|
convertSegmentPathToStaticExportFilename: null,
|
|
createSegmentRequestKeyPart: null
|
|
});
|
|
function _export(target, all) {
|
|
for(var name in all)Object.defineProperty(target, name, {
|
|
enumerable: true,
|
|
get: all[name]
|
|
});
|
|
}
|
|
_export(exports, {
|
|
HEAD_REQUEST_KEY: function() {
|
|
return HEAD_REQUEST_KEY;
|
|
},
|
|
ROOT_SEGMENT_REQUEST_KEY: function() {
|
|
return ROOT_SEGMENT_REQUEST_KEY;
|
|
},
|
|
appendSegmentRequestKeyPart: function() {
|
|
return appendSegmentRequestKeyPart;
|
|
},
|
|
convertSegmentPathToStaticExportFilename: function() {
|
|
return convertSegmentPathToStaticExportFilename;
|
|
},
|
|
createSegmentRequestKeyPart: function() {
|
|
return createSegmentRequestKeyPart;
|
|
}
|
|
});
|
|
const _segment = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/shared/lib/segment.js [app-ssr] (ecmascript)");
|
|
const ROOT_SEGMENT_REQUEST_KEY = '';
|
|
const HEAD_REQUEST_KEY = '/_head';
|
|
function createSegmentRequestKeyPart(segment) {
|
|
if (typeof segment === 'string') {
|
|
if (segment.startsWith(_segment.PAGE_SEGMENT_KEY)) {
|
|
// The Flight Router State type sometimes includes the search params in
|
|
// the page segment. However, the Segment Cache tracks this as a separate
|
|
// key. So, we strip the search params here, and then add them back when
|
|
// the cache entry is turned back into a FlightRouterState. This is an
|
|
// unfortunate consequence of the FlightRouteState being used both as a
|
|
// transport type and as a cache key; we'll address this once more of the
|
|
// Segment Cache implementation has settled.
|
|
// TODO: We should hoist the search params out of the FlightRouterState
|
|
// type entirely, This is our plan for dynamic route params, too.
|
|
return _segment.PAGE_SEGMENT_KEY;
|
|
}
|
|
const safeName = // But params typically don't include the leading slash. We should use
|
|
// a different encoding to avoid this special case.
|
|
segment === '/_not-found' ? '_not-found' : encodeToFilesystemAndURLSafeString(segment);
|
|
// Since this is not a dynamic segment, it's fully encoded. It does not
|
|
// need to be "hydrated" with a param value.
|
|
return safeName;
|
|
}
|
|
const name = segment[0];
|
|
const paramType = segment[2];
|
|
const safeName = encodeToFilesystemAndURLSafeString(name);
|
|
const encodedName = '$' + paramType + '$' + safeName;
|
|
return encodedName;
|
|
}
|
|
function appendSegmentRequestKeyPart(parentRequestKey, parallelRouteKey, childRequestKeyPart) {
|
|
// Aside from being filesystem safe, segment keys are also designed so that
|
|
// each segment and parallel route creates its own subdirectory. Roughly in
|
|
// the same shape as the source app directory. This is mostly just for easier
|
|
// debugging (you can open up the build folder and navigate the output); if
|
|
// we wanted to do we could just use a flat structure.
|
|
// Omit the parallel route key for children, since this is the most
|
|
// common case. Saves some bytes (and it's what the app directory does).
|
|
const slotKey = parallelRouteKey === 'children' ? childRequestKeyPart : `@${encodeToFilesystemAndURLSafeString(parallelRouteKey)}/${childRequestKeyPart}`;
|
|
return parentRequestKey + '/' + slotKey;
|
|
}
|
|
// Define a regex pattern to match the most common characters found in a route
|
|
// param. It excludes anything that might not be cross-platform filesystem
|
|
// compatible, like |. It does not need to be precise because the fallback is to
|
|
// just base64url-encode the whole parameter, which is fine; we just don't do it
|
|
// by default for compactness, and for easier debugging.
|
|
const simpleParamValueRegex = /^[a-zA-Z0-9\-_@]+$/;
|
|
function encodeToFilesystemAndURLSafeString(value) {
|
|
if (simpleParamValueRegex.test(value)) {
|
|
return value;
|
|
}
|
|
// If there are any unsafe characters, base64url-encode the entire value.
|
|
// We also add a ! prefix so it doesn't collide with the simple case.
|
|
const base64url = btoa(value).replace(/\+/g, '-') // Replace '+' with '-'
|
|
.replace(/\//g, '_') // Replace '/' with '_'
|
|
.replace(/=+$/, '') // Remove trailing '='
|
|
;
|
|
return '!' + base64url;
|
|
}
|
|
function convertSegmentPathToStaticExportFilename(segmentPath) {
|
|
return `__next${segmentPath.replace(/\//g, '.')}.txt`;
|
|
} //# sourceMappingURL=segment-value-encoding.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/route-params.js [app-ssr] (ecmascript)", ((__turbopack_context__, module, exports) => {
|
|
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
0 && (module.exports = {
|
|
doesStaticSegmentAppearInURL: null,
|
|
getCacheKeyForDynamicParam: null,
|
|
getParamValueFromCacheKey: null,
|
|
getRenderedPathname: null,
|
|
getRenderedSearch: null,
|
|
parseDynamicParamFromURLPart: null,
|
|
urlSearchParamsToParsedUrlQuery: null,
|
|
urlToUrlWithoutFlightMarker: null
|
|
});
|
|
function _export(target, all) {
|
|
for(var name in all)Object.defineProperty(target, name, {
|
|
enumerable: true,
|
|
get: all[name]
|
|
});
|
|
}
|
|
_export(exports, {
|
|
doesStaticSegmentAppearInURL: function() {
|
|
return doesStaticSegmentAppearInURL;
|
|
},
|
|
getCacheKeyForDynamicParam: function() {
|
|
return getCacheKeyForDynamicParam;
|
|
},
|
|
getParamValueFromCacheKey: function() {
|
|
return getParamValueFromCacheKey;
|
|
},
|
|
getRenderedPathname: function() {
|
|
return getRenderedPathname;
|
|
},
|
|
getRenderedSearch: function() {
|
|
return getRenderedSearch;
|
|
},
|
|
parseDynamicParamFromURLPart: function() {
|
|
return parseDynamicParamFromURLPart;
|
|
},
|
|
urlSearchParamsToParsedUrlQuery: function() {
|
|
return urlSearchParamsToParsedUrlQuery;
|
|
},
|
|
urlToUrlWithoutFlightMarker: function() {
|
|
return urlToUrlWithoutFlightMarker;
|
|
}
|
|
});
|
|
const _segment = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/shared/lib/segment.js [app-ssr] (ecmascript)");
|
|
const _segmentvalueencoding = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/shared/lib/segment-cache/segment-value-encoding.js [app-ssr] (ecmascript)");
|
|
const _approuterheaders = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/app-router-headers.js [app-ssr] (ecmascript)");
|
|
function getRenderedSearch(response) {
|
|
// If the server performed a rewrite, the search params used to render the
|
|
// page will be different from the params in the request URL. In this case,
|
|
// the response will include a header that gives the rewritten search query.
|
|
const rewrittenQuery = response.headers.get(_approuterheaders.NEXT_REWRITTEN_QUERY_HEADER);
|
|
if (rewrittenQuery !== null) {
|
|
return rewrittenQuery === '' ? '' : '?' + rewrittenQuery;
|
|
}
|
|
// If the header is not present, there was no rewrite, so we use the search
|
|
// query of the response URL.
|
|
return urlToUrlWithoutFlightMarker(new URL(response.url)).search;
|
|
}
|
|
function getRenderedPathname(response) {
|
|
// If the server performed a rewrite, the pathname used to render the
|
|
// page will be different from the pathname in the request URL. In this case,
|
|
// the response will include a header that gives the rewritten pathname.
|
|
const rewrittenPath = response.headers.get(_approuterheaders.NEXT_REWRITTEN_PATH_HEADER);
|
|
return rewrittenPath ?? urlToUrlWithoutFlightMarker(new URL(response.url)).pathname;
|
|
}
|
|
function parseDynamicParamFromURLPart(paramType, pathnameParts, partIndex) {
|
|
// This needs to match the behavior in get-dynamic-param.ts.
|
|
switch(paramType){
|
|
// Catchalls
|
|
case 'c':
|
|
{
|
|
// Catchalls receive all the remaining URL parts. If there are no
|
|
// remaining pathname parts, return an empty array.
|
|
return partIndex < pathnameParts.length ? pathnameParts.slice(partIndex).map((s)=>encodeURIComponent(s)) : [];
|
|
}
|
|
// Catchall intercepted
|
|
case 'ci(..)(..)':
|
|
case 'ci(.)':
|
|
case 'ci(..)':
|
|
case 'ci(...)':
|
|
{
|
|
const prefix = paramType.length - 2;
|
|
return partIndex < pathnameParts.length ? pathnameParts.slice(partIndex).map((s, i)=>{
|
|
if (i === 0) {
|
|
return encodeURIComponent(s.slice(prefix));
|
|
}
|
|
return encodeURIComponent(s);
|
|
}) : [];
|
|
}
|
|
// Optional catchalls
|
|
case 'oc':
|
|
{
|
|
// Optional catchalls receive all the remaining URL parts, unless this is
|
|
// the end of the pathname, in which case they return null.
|
|
return partIndex < pathnameParts.length ? pathnameParts.slice(partIndex).map((s)=>encodeURIComponent(s)) : null;
|
|
}
|
|
// Dynamic
|
|
case 'd':
|
|
{
|
|
if (partIndex >= pathnameParts.length) {
|
|
// The route tree expected there to be more parts in the URL than there
|
|
// actually are. This could happen if the x-nextjs-rewritten-path header
|
|
// is incorrectly set, or potentially due to bug in Next.js. TODO:
|
|
// Should this be a hard error? During a prefetch, we can just abort.
|
|
// During a client navigation, we could trigger a hard refresh. But if
|
|
// it happens during initial render, we don't really have any
|
|
// recovery options.
|
|
return '';
|
|
}
|
|
return encodeURIComponent(pathnameParts[partIndex]);
|
|
}
|
|
// Dynamic intercepted
|
|
case 'di(..)(..)':
|
|
case 'di(.)':
|
|
case 'di(..)':
|
|
case 'di(...)':
|
|
{
|
|
const prefix = paramType.length - 2;
|
|
if (partIndex >= pathnameParts.length) {
|
|
// The route tree expected there to be more parts in the URL than there
|
|
// actually are. This could happen if the x-nextjs-rewritten-path header
|
|
// is incorrectly set, or potentially due to bug in Next.js. TODO:
|
|
// Should this be a hard error? During a prefetch, we can just abort.
|
|
// During a client navigation, we could trigger a hard refresh. But if
|
|
// it happens during initial render, we don't really have any
|
|
// recovery options.
|
|
return '';
|
|
}
|
|
return encodeURIComponent(pathnameParts[partIndex].slice(prefix));
|
|
}
|
|
default:
|
|
paramType;
|
|
return '';
|
|
}
|
|
}
|
|
function doesStaticSegmentAppearInURL(segment) {
|
|
// This is not a parameterized segment; however, we need to determine
|
|
// whether or not this segment appears in the URL. For example, this route
|
|
// groups do not appear in the URL, so they should be skipped. Any other
|
|
// special cases must be handled here.
|
|
// TODO: Consider encoding this directly into the router tree instead of
|
|
// inferring it on the client based on the segment type. Something like
|
|
// a `doesAppearInURL` flag in FlightRouterState.
|
|
if (segment === _segmentvalueencoding.ROOT_SEGMENT_REQUEST_KEY || // For some reason, the loader tree sometimes includes extra __PAGE__
|
|
// "layouts" when part of a parallel route. But it's not a leaf node.
|
|
// Otherwise, we wouldn't need this special case because pages are
|
|
// always leaf nodes.
|
|
// TODO: Investigate why the loader produces these fake page segments.
|
|
segment.startsWith(_segment.PAGE_SEGMENT_KEY) || // Route groups.
|
|
segment[0] === '(' && segment.endsWith(')') || segment === _segment.DEFAULT_SEGMENT_KEY || segment === '/_not-found') {
|
|
return false;
|
|
} else {
|
|
// All other segment types appear in the URL
|
|
return true;
|
|
}
|
|
}
|
|
function getCacheKeyForDynamicParam(paramValue, renderedSearch) {
|
|
// This needs to match the logic in get-dynamic-param.ts, until we're able to
|
|
// unify the various implementations so that these are always computed on
|
|
// the client.
|
|
if (typeof paramValue === 'string') {
|
|
// TODO: Refactor or remove this helper function to accept a string rather
|
|
// than the whole segment type. Also we can probably just append the
|
|
// search string instead of turning it into JSON.
|
|
const pageSegmentWithSearchParams = (0, _segment.addSearchParamsIfPageSegment)(paramValue, Object.fromEntries(new URLSearchParams(renderedSearch)));
|
|
return pageSegmentWithSearchParams;
|
|
} else if (paramValue === null) {
|
|
return '';
|
|
} else {
|
|
return paramValue.join('/');
|
|
}
|
|
}
|
|
function urlToUrlWithoutFlightMarker(url) {
|
|
const urlWithoutFlightParameters = new URL(url);
|
|
urlWithoutFlightParameters.searchParams.delete(_approuterheaders.NEXT_RSC_UNION_QUERY);
|
|
if ("TURBOPACK compile-time falsy", 0) //TURBOPACK unreachable
|
|
;
|
|
return urlWithoutFlightParameters;
|
|
}
|
|
function getParamValueFromCacheKey(paramCacheKey, paramType) {
|
|
// Turn the cache key string sent by the server (as part of FlightRouterState)
|
|
// into a value that can be passed to `useParams` and client components.
|
|
const isCatchAll = paramType === 'c' || paramType === 'oc';
|
|
if (isCatchAll) {
|
|
// Catch-all param keys are a concatenation of the path segments.
|
|
// See equivalent logic in `getSelectedParams`.
|
|
// TODO: We should just pass the array directly, rather than concatenate
|
|
// it to a string and then split it back to an array. It needs to be an
|
|
// array in some places, like when passing a key React, but we can convert
|
|
// it at runtime in those places.
|
|
return paramCacheKey.split('/');
|
|
}
|
|
return paramCacheKey;
|
|
}
|
|
function urlSearchParamsToParsedUrlQuery(searchParams) {
|
|
// Converts a URLSearchParams object to the same type used by the server when
|
|
// creating search params props, i.e. the type returned by Node's
|
|
// "querystring" module.
|
|
const result = {};
|
|
for (const [key, value] of searchParams.entries()){
|
|
if (result[key] === undefined) {
|
|
result[key] = value;
|
|
} else if (Array.isArray(result[key])) {
|
|
result[key].push(value);
|
|
} else {
|
|
result[key] = [
|
|
result[key],
|
|
value
|
|
];
|
|
}
|
|
}
|
|
return result;
|
|
}
|
|
if ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') {
|
|
Object.defineProperty(exports.default, '__esModule', {
|
|
value: true
|
|
});
|
|
Object.assign(exports.default, exports);
|
|
module.exports = exports.default;
|
|
} //# sourceMappingURL=route-params.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/router-reducer/create-href-from-url.js [app-ssr] (ecmascript)", ((__turbopack_context__, module, exports) => {
|
|
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
Object.defineProperty(exports, "createHrefFromUrl", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return createHrefFromUrl;
|
|
}
|
|
});
|
|
function createHrefFromUrl(url, includeHash = true) {
|
|
return url.pathname + url.search + (includeHash ? url.hash : '');
|
|
}
|
|
if ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') {
|
|
Object.defineProperty(exports.default, '__esModule', {
|
|
value: true
|
|
});
|
|
Object.assign(exports.default, exports);
|
|
module.exports = exports.default;
|
|
} //# sourceMappingURL=create-href-from-url.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/flight-data-helpers.js [app-ssr] (ecmascript)", ((__turbopack_context__, module, exports) => {
|
|
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
0 && (module.exports = {
|
|
createInitialRSCPayloadFromFallbackPrerender: null,
|
|
getFlightDataPartsFromPath: null,
|
|
getNextFlightSegmentPath: null,
|
|
normalizeFlightData: null,
|
|
prepareFlightRouterStateForRequest: null
|
|
});
|
|
function _export(target, all) {
|
|
for(var name in all)Object.defineProperty(target, name, {
|
|
enumerable: true,
|
|
get: all[name]
|
|
});
|
|
}
|
|
_export(exports, {
|
|
createInitialRSCPayloadFromFallbackPrerender: function() {
|
|
return createInitialRSCPayloadFromFallbackPrerender;
|
|
},
|
|
getFlightDataPartsFromPath: function() {
|
|
return getFlightDataPartsFromPath;
|
|
},
|
|
getNextFlightSegmentPath: function() {
|
|
return getNextFlightSegmentPath;
|
|
},
|
|
normalizeFlightData: function() {
|
|
return normalizeFlightData;
|
|
},
|
|
prepareFlightRouterStateForRequest: function() {
|
|
return prepareFlightRouterStateForRequest;
|
|
}
|
|
});
|
|
const _segment = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/shared/lib/segment.js [app-ssr] (ecmascript)");
|
|
const _routeparams = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/route-params.js [app-ssr] (ecmascript)");
|
|
const _createhreffromurl = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/router-reducer/create-href-from-url.js [app-ssr] (ecmascript)");
|
|
function getFlightDataPartsFromPath(flightDataPath) {
|
|
// Pick the last 4 items from the `FlightDataPath` to get the [tree, seedData, viewport, isHeadPartial].
|
|
const flightDataPathLength = 4;
|
|
// tree, seedData, and head are *always* the last three items in the `FlightDataPath`.
|
|
const [tree, seedData, head, isHeadPartial] = flightDataPath.slice(-flightDataPathLength);
|
|
// The `FlightSegmentPath` is everything except the last three items. For a root render, it won't be present.
|
|
const segmentPath = flightDataPath.slice(0, -flightDataPathLength);
|
|
return {
|
|
// TODO: Unify these two segment path helpers. We are inconsistently pushing an empty segment ("")
|
|
// to the start of the segment path in some places which makes it hard to use solely the segment path.
|
|
// Look for "// TODO-APP: remove ''" in the codebase.
|
|
pathToSegment: segmentPath.slice(0, -1),
|
|
segmentPath,
|
|
// if the `FlightDataPath` corresponds with the root, there'll be no segment path,
|
|
// in which case we default to ''.
|
|
segment: segmentPath[segmentPath.length - 1] ?? '',
|
|
tree,
|
|
seedData,
|
|
head,
|
|
isHeadPartial,
|
|
isRootRender: flightDataPath.length === flightDataPathLength
|
|
};
|
|
}
|
|
function createInitialRSCPayloadFromFallbackPrerender(response, fallbackInitialRSCPayload) {
|
|
// This is a static fallback page. In order to hydrate the page, we need to
|
|
// parse the client params from the URL, but to account for the possibility
|
|
// that the page was rewritten, we need to check the response headers
|
|
// for x-nextjs-rewritten-path or x-nextjs-rewritten-query headers. Since
|
|
// we can't access the headers of the initial document response, the client
|
|
// performs a fetch request to the current location. Since it's possible that
|
|
// the fetch request will be dynamically rewritten to a different path than
|
|
// the initial document, this fetch request delivers _all_ the hydration data
|
|
// for the page; it was not inlined into the document, like it normally
|
|
// would be.
|
|
//
|
|
// TODO: Consider treating the case where fetch is rewritten to a different
|
|
// path from the document as a special deopt case. We should optimistically
|
|
// assume this won't happen, inline the data into the document, and perform
|
|
// a minimal request (like a HEAD or range request) to verify that the
|
|
// response matches. Tricky to get right because we need to account for
|
|
// all the different deployment environments we support, like output:
|
|
// "export" mode, where we currently don't assume that custom response
|
|
// headers are present.
|
|
// Patch the Flight data sent by the server with the correct params parsed
|
|
// from the URL + response object.
|
|
const renderedPathname = (0, _routeparams.getRenderedPathname)(response);
|
|
const renderedSearch = (0, _routeparams.getRenderedSearch)(response);
|
|
const canonicalUrl = (0, _createhreffromurl.createHrefFromUrl)(new URL(location.href));
|
|
const originalFlightDataPath = fallbackInitialRSCPayload.f[0];
|
|
const originalFlightRouterState = originalFlightDataPath[0];
|
|
return {
|
|
b: fallbackInitialRSCPayload.b,
|
|
c: canonicalUrl.split('/'),
|
|
q: renderedSearch,
|
|
i: fallbackInitialRSCPayload.i,
|
|
f: [
|
|
[
|
|
fillInFallbackFlightRouterState(originalFlightRouterState, renderedPathname, renderedSearch),
|
|
originalFlightDataPath[1],
|
|
originalFlightDataPath[2],
|
|
originalFlightDataPath[2]
|
|
]
|
|
],
|
|
m: fallbackInitialRSCPayload.m,
|
|
G: fallbackInitialRSCPayload.G,
|
|
S: fallbackInitialRSCPayload.S
|
|
};
|
|
}
|
|
function fillInFallbackFlightRouterState(flightRouterState, renderedPathname, renderedSearch) {
|
|
const pathnameParts = renderedPathname.split('/').filter((p)=>p !== '');
|
|
const index = 0;
|
|
return fillInFallbackFlightRouterStateImpl(flightRouterState, renderedSearch, pathnameParts, index);
|
|
}
|
|
function fillInFallbackFlightRouterStateImpl(flightRouterState, renderedSearch, pathnameParts, pathnamePartsIndex) {
|
|
const originalSegment = flightRouterState[0];
|
|
let newSegment;
|
|
let doesAppearInURL;
|
|
if (typeof originalSegment === 'string') {
|
|
newSegment = originalSegment;
|
|
doesAppearInURL = (0, _routeparams.doesStaticSegmentAppearInURL)(originalSegment);
|
|
} else {
|
|
const paramName = originalSegment[0];
|
|
const paramType = originalSegment[2];
|
|
const paramValue = (0, _routeparams.parseDynamicParamFromURLPart)(paramType, pathnameParts, pathnamePartsIndex);
|
|
const cacheKey = (0, _routeparams.getCacheKeyForDynamicParam)(paramValue, renderedSearch);
|
|
newSegment = [
|
|
paramName,
|
|
cacheKey,
|
|
paramType
|
|
];
|
|
doesAppearInURL = true;
|
|
}
|
|
// Only increment the index if the segment appears in the URL. If it's a
|
|
// "virtual" segment, like a route group, it remains the same.
|
|
const childPathnamePartsIndex = doesAppearInURL ? pathnamePartsIndex + 1 : pathnamePartsIndex;
|
|
const children = flightRouterState[1];
|
|
const newChildren = {};
|
|
for(let key in children){
|
|
const childFlightRouterState = children[key];
|
|
newChildren[key] = fillInFallbackFlightRouterStateImpl(childFlightRouterState, renderedSearch, pathnameParts, childPathnamePartsIndex);
|
|
}
|
|
const newState = [
|
|
newSegment,
|
|
newChildren,
|
|
null,
|
|
flightRouterState[3],
|
|
flightRouterState[4]
|
|
];
|
|
return newState;
|
|
}
|
|
function getNextFlightSegmentPath(flightSegmentPath) {
|
|
// Since `FlightSegmentPath` is a repeated tuple of `Segment` and `ParallelRouteKey`, we slice off two items
|
|
// to get the next segment path.
|
|
return flightSegmentPath.slice(2);
|
|
}
|
|
function normalizeFlightData(flightData) {
|
|
// FlightData can be a string when the server didn't respond with a proper flight response,
|
|
// or when a redirect happens, to signal to the client that it needs to perform an MPA navigation.
|
|
if (typeof flightData === 'string') {
|
|
return flightData;
|
|
}
|
|
return flightData.map((flightDataPath)=>getFlightDataPartsFromPath(flightDataPath));
|
|
}
|
|
function prepareFlightRouterStateForRequest(flightRouterState, isHmrRefresh) {
|
|
// HMR requests need the complete, unmodified state for proper functionality
|
|
if (isHmrRefresh) {
|
|
return encodeURIComponent(JSON.stringify(flightRouterState));
|
|
}
|
|
return encodeURIComponent(JSON.stringify(stripClientOnlyDataFromFlightRouterState(flightRouterState)));
|
|
}
|
|
/**
|
|
* Recursively strips client-only data from FlightRouterState while preserving
|
|
* server-needed information for proper rendering decisions.
|
|
*/ function stripClientOnlyDataFromFlightRouterState(flightRouterState) {
|
|
const [segment, parallelRoutes, _url, refreshMarker, isRootLayout, hasLoadingBoundary] = flightRouterState;
|
|
// __PAGE__ segments are always fetched from the server, so there's
|
|
// no need to send them up
|
|
const cleanedSegment = stripSearchParamsFromPageSegment(segment);
|
|
// Recursively process parallel routes
|
|
const cleanedParallelRoutes = {};
|
|
for (const [key, childState] of Object.entries(parallelRoutes)){
|
|
cleanedParallelRoutes[key] = stripClientOnlyDataFromFlightRouterState(childState);
|
|
}
|
|
const result = [
|
|
cleanedSegment,
|
|
cleanedParallelRoutes,
|
|
null,
|
|
shouldPreserveRefreshMarker(refreshMarker) ? refreshMarker : null
|
|
];
|
|
// Append optional fields if present
|
|
if (isRootLayout !== undefined) {
|
|
result[4] = isRootLayout;
|
|
}
|
|
if (hasLoadingBoundary !== undefined) {
|
|
result[5] = hasLoadingBoundary;
|
|
}
|
|
return result;
|
|
}
|
|
/**
|
|
* Strips search parameters from __PAGE__ segments to prevent sensitive
|
|
* client-side data from being sent to the server.
|
|
*/ function stripSearchParamsFromPageSegment(segment) {
|
|
if (typeof segment === 'string' && segment.startsWith(_segment.PAGE_SEGMENT_KEY + '?')) {
|
|
return _segment.PAGE_SEGMENT_KEY;
|
|
}
|
|
return segment;
|
|
}
|
|
/**
|
|
* Determines whether the refresh marker should be sent to the server
|
|
* Client-only markers like 'refresh' are stripped, while server-needed markers
|
|
* like 'refetch' and 'inside-shared-layout' are preserved.
|
|
*/ function shouldPreserveRefreshMarker(refreshMarker) {
|
|
return Boolean(refreshMarker && refreshMarker !== 'refresh');
|
|
}
|
|
if ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') {
|
|
Object.defineProperty(exports.default, '__esModule', {
|
|
value: true
|
|
});
|
|
Object.assign(exports.default, exports);
|
|
module.exports = exports.default;
|
|
} //# sourceMappingURL=flight-data-helpers.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/app-build-id.js [app-ssr] (ecmascript)", ((__turbopack_context__, module, exports) => {
|
|
"use strict";
|
|
|
|
// This gets assigned as a side-effect during app initialization. Because it
|
|
// represents the build used to create the JS bundle, it should never change
|
|
// after being set, so we store it in a global variable.
|
|
//
|
|
// When performing RSC requests, if the incoming data has a different build ID,
|
|
// we perform an MPA navigation/refresh to load the updated build and ensure
|
|
// that the client and server in sync.
|
|
// Starts as an empty string. In practice, because setAppBuildId is called
|
|
// during initialization before hydration starts, this will always get
|
|
// reassigned to the actual build ID before it's ever needed by a navigation.
|
|
// If for some reasons it didn't, due to a bug or race condition, then on
|
|
// navigation the build comparision would fail and trigger an MPA navigation.
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
0 && (module.exports = {
|
|
getAppBuildId: null,
|
|
setAppBuildId: null
|
|
});
|
|
function _export(target, all) {
|
|
for(var name in all)Object.defineProperty(target, name, {
|
|
enumerable: true,
|
|
get: all[name]
|
|
});
|
|
}
|
|
_export(exports, {
|
|
getAppBuildId: function() {
|
|
return getAppBuildId;
|
|
},
|
|
setAppBuildId: function() {
|
|
return setAppBuildId;
|
|
}
|
|
});
|
|
let globalBuildId = '';
|
|
function setAppBuildId(buildId) {
|
|
globalBuildId = buildId;
|
|
}
|
|
function getAppBuildId() {
|
|
return globalBuildId;
|
|
}
|
|
if ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') {
|
|
Object.defineProperty(exports.default, '__esModule', {
|
|
value: true
|
|
});
|
|
Object.assign(exports.default, exports);
|
|
module.exports = exports.default;
|
|
} //# sourceMappingURL=app-build-id.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/shared/lib/hash.js [app-ssr] (ecmascript)", ((__turbopack_context__, module, exports) => {
|
|
"use strict";
|
|
|
|
// http://www.cse.yorku.ca/~oz/hash.html
|
|
// More specifically, 32-bit hash via djbxor
|
|
// (ref: https://gist.github.com/eplawless/52813b1d8ad9af510d85?permalink_comment_id=3367765#gistcomment-3367765)
|
|
// This is due to number type differences between rust for turbopack to js number types,
|
|
// where rust does not have easy way to repreesnt js's 53-bit float number type for the matching
|
|
// overflow behavior. This is more `correct` in terms of having canonical hash across different runtime / implementation
|
|
// as can gaurantee determinstic output from 32bit hash.
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
0 && (module.exports = {
|
|
djb2Hash: null,
|
|
hexHash: null
|
|
});
|
|
function _export(target, all) {
|
|
for(var name in all)Object.defineProperty(target, name, {
|
|
enumerable: true,
|
|
get: all[name]
|
|
});
|
|
}
|
|
_export(exports, {
|
|
djb2Hash: function() {
|
|
return djb2Hash;
|
|
},
|
|
hexHash: function() {
|
|
return hexHash;
|
|
}
|
|
});
|
|
function djb2Hash(str) {
|
|
let hash = 5381;
|
|
for(let i = 0; i < str.length; i++){
|
|
const char = str.charCodeAt(i);
|
|
hash = (hash << 5) + hash + char & 0xffffffff;
|
|
}
|
|
return hash >>> 0;
|
|
}
|
|
function hexHash(str) {
|
|
return djb2Hash(str).toString(36).slice(0, 5);
|
|
} //# sourceMappingURL=hash.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/shared/lib/router/utils/cache-busting-search-param.js [app-ssr] (ecmascript)", ((__turbopack_context__, module, exports) => {
|
|
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
Object.defineProperty(exports, "computeCacheBustingSearchParam", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return computeCacheBustingSearchParam;
|
|
}
|
|
});
|
|
const _hash = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/shared/lib/hash.js [app-ssr] (ecmascript)");
|
|
function computeCacheBustingSearchParam(prefetchHeader, segmentPrefetchHeader, stateTreeHeader, nextUrlHeader) {
|
|
if ((prefetchHeader === undefined || prefetchHeader === '0') && segmentPrefetchHeader === undefined && stateTreeHeader === undefined && nextUrlHeader === undefined) {
|
|
return '';
|
|
}
|
|
return (0, _hash.hexHash)([
|
|
prefetchHeader || '0',
|
|
segmentPrefetchHeader || '0',
|
|
stateTreeHeader || '0',
|
|
nextUrlHeader || '0'
|
|
].join(','));
|
|
} //# sourceMappingURL=cache-busting-search-param.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/router-reducer/set-cache-busting-search-param.js [app-ssr] (ecmascript)", ((__turbopack_context__, module, exports) => {
|
|
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
0 && (module.exports = {
|
|
setCacheBustingSearchParam: null,
|
|
setCacheBustingSearchParamWithHash: null
|
|
});
|
|
function _export(target, all) {
|
|
for(var name in all)Object.defineProperty(target, name, {
|
|
enumerable: true,
|
|
get: all[name]
|
|
});
|
|
}
|
|
_export(exports, {
|
|
setCacheBustingSearchParam: function() {
|
|
return setCacheBustingSearchParam;
|
|
},
|
|
setCacheBustingSearchParamWithHash: function() {
|
|
return setCacheBustingSearchParamWithHash;
|
|
}
|
|
});
|
|
const _cachebustingsearchparam = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/shared/lib/router/utils/cache-busting-search-param.js [app-ssr] (ecmascript)");
|
|
const _approuterheaders = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/app-router-headers.js [app-ssr] (ecmascript)");
|
|
const setCacheBustingSearchParam = (url, headers)=>{
|
|
const uniqueCacheKey = (0, _cachebustingsearchparam.computeCacheBustingSearchParam)(headers[_approuterheaders.NEXT_ROUTER_PREFETCH_HEADER], headers[_approuterheaders.NEXT_ROUTER_SEGMENT_PREFETCH_HEADER], headers[_approuterheaders.NEXT_ROUTER_STATE_TREE_HEADER], headers[_approuterheaders.NEXT_URL]);
|
|
setCacheBustingSearchParamWithHash(url, uniqueCacheKey);
|
|
};
|
|
const setCacheBustingSearchParamWithHash = (url, hash)=>{
|
|
/**
|
|
* Note that we intentionally do not use `url.searchParams.set` here:
|
|
*
|
|
* const url = new URL('https://example.com/search?q=custom%20spacing');
|
|
* url.searchParams.set('_rsc', 'abc123');
|
|
* console.log(url.toString()); // Outputs: https://example.com/search?q=custom+spacing&_rsc=abc123
|
|
* ^ <--- this is causing confusion
|
|
* This is in fact intended based on https://url.spec.whatwg.org/#interface-urlsearchparams, but
|
|
* we want to preserve the %20 as %20 if that's what the user passed in, hence the custom
|
|
* logic below.
|
|
*/ const existingSearch = url.search;
|
|
const rawQuery = existingSearch.startsWith('?') ? existingSearch.slice(1) : existingSearch;
|
|
// Always remove any existing cache busting param and add a fresh one to ensure
|
|
// we have the correct value based on current request headers
|
|
const pairs = rawQuery.split('&').filter((pair)=>pair && !pair.startsWith(`${_approuterheaders.NEXT_RSC_UNION_QUERY}=`));
|
|
if (hash.length > 0) {
|
|
pairs.push(`${_approuterheaders.NEXT_RSC_UNION_QUERY}=${hash}`);
|
|
} else {
|
|
pairs.push(`${_approuterheaders.NEXT_RSC_UNION_QUERY}`);
|
|
}
|
|
url.search = pairs.length ? `?${pairs.join('&')}` : '';
|
|
};
|
|
if ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') {
|
|
Object.defineProperty(exports.default, '__esModule', {
|
|
value: true
|
|
});
|
|
Object.assign(exports.default, exports);
|
|
module.exports = exports.default;
|
|
} //# sourceMappingURL=set-cache-busting-search-param.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/router-reducer/fetch-server-response.js [app-ssr] (ecmascript)", ((__turbopack_context__, module, exports) => {
|
|
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
0 && (module.exports = {
|
|
createFetch: null,
|
|
createFromNextReadableStream: null,
|
|
fetchServerResponse: null
|
|
});
|
|
function _export(target, all) {
|
|
for(var name in all)Object.defineProperty(target, name, {
|
|
enumerable: true,
|
|
get: all[name]
|
|
});
|
|
}
|
|
_export(exports, {
|
|
createFetch: function() {
|
|
return createFetch;
|
|
},
|
|
createFromNextReadableStream: function() {
|
|
return createFromNextReadableStream;
|
|
},
|
|
fetchServerResponse: function() {
|
|
return fetchServerResponse;
|
|
}
|
|
});
|
|
const _client = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react-server-dom-turbopack-client.js [app-ssr] (ecmascript)");
|
|
const _approuterheaders = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/app-router-headers.js [app-ssr] (ecmascript)");
|
|
const _appcallserver = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/app-call-server.js [app-ssr] (ecmascript)");
|
|
const _appfindsourcemapurl = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/app-find-source-map-url.js [app-ssr] (ecmascript)");
|
|
const _routerreducertypes = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/router-reducer/router-reducer-types.js [app-ssr] (ecmascript)");
|
|
const _flightdatahelpers = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/flight-data-helpers.js [app-ssr] (ecmascript)");
|
|
const _appbuildid = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/app-build-id.js [app-ssr] (ecmascript)");
|
|
const _setcachebustingsearchparam = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/router-reducer/set-cache-busting-search-param.js [app-ssr] (ecmascript)");
|
|
const _routeparams = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/route-params.js [app-ssr] (ecmascript)");
|
|
const createFromReadableStream = _client.createFromReadableStream;
|
|
const createFromFetch = _client.createFromFetch;
|
|
let createDebugChannel;
|
|
if ("TURBOPACK compile-time falsy", 0) //TURBOPACK unreachable
|
|
;
|
|
function doMpaNavigation(url) {
|
|
return (0, _routeparams.urlToUrlWithoutFlightMarker)(new URL(url, location.origin)).toString();
|
|
}
|
|
let abortController = new AbortController();
|
|
if ("TURBOPACK compile-time falsy", 0) //TURBOPACK unreachable
|
|
;
|
|
async function fetchServerResponse(url, options) {
|
|
const { flightRouterState, nextUrl, prefetchKind } = options;
|
|
const headers = {
|
|
// Enable flight response
|
|
[_approuterheaders.RSC_HEADER]: '1',
|
|
// Provide the current router state
|
|
[_approuterheaders.NEXT_ROUTER_STATE_TREE_HEADER]: (0, _flightdatahelpers.prepareFlightRouterStateForRequest)(flightRouterState, options.isHmrRefresh)
|
|
};
|
|
/**
|
|
* Three cases:
|
|
* - `prefetchKind` is `undefined`, it means it's a normal navigation, so we want to prefetch the page data fully
|
|
* - `prefetchKind` is `full` - we want to prefetch the whole page so same as above
|
|
* - `prefetchKind` is `auto` - if the page is dynamic, prefetch the page data partially, if static prefetch the page data fully
|
|
*/ if (prefetchKind === _routerreducertypes.PrefetchKind.AUTO) {
|
|
headers[_approuterheaders.NEXT_ROUTER_PREFETCH_HEADER] = '1';
|
|
}
|
|
if (("TURBOPACK compile-time value", "development") === 'development' && options.isHmrRefresh) {
|
|
headers[_approuterheaders.NEXT_HMR_REFRESH_HEADER] = '1';
|
|
}
|
|
if (nextUrl) {
|
|
headers[_approuterheaders.NEXT_URL] = nextUrl;
|
|
}
|
|
// In static export mode, we need to modify the URL to request the .txt file,
|
|
// but we should preserve the original URL for the canonical URL and error handling.
|
|
const originalUrl = url;
|
|
try {
|
|
// When creating a "temporary" prefetch (the "on-demand" prefetch that gets created on navigation, if one doesn't exist)
|
|
// we send the request with a "high" priority as it's in response to a user interaction that could be blocking a transition.
|
|
// Otherwise, all other prefetches are sent with a "low" priority.
|
|
// We use "auto" for in all other cases to match the existing default, as this function is shared outside of prefetching.
|
|
const fetchPriority = prefetchKind ? prefetchKind === _routerreducertypes.PrefetchKind.TEMPORARY ? 'high' : 'low' : 'auto';
|
|
if ("TURBOPACK compile-time falsy", 0) //TURBOPACK unreachable
|
|
;
|
|
// Typically, during a navigation, we decode the response using Flight's
|
|
// `createFromFetch` API, which accepts a `fetch` promise.
|
|
// TODO: Remove this check once the old PPR flag is removed
|
|
const isLegacyPPR = ("TURBOPACK compile-time value", false) && !("TURBOPACK compile-time value", false);
|
|
const shouldImmediatelyDecode = !isLegacyPPR;
|
|
const res = await createFetch(url, headers, fetchPriority, shouldImmediatelyDecode, abortController.signal);
|
|
const responseUrl = (0, _routeparams.urlToUrlWithoutFlightMarker)(new URL(res.url));
|
|
const canonicalUrl = res.redirected ? responseUrl : originalUrl;
|
|
const contentType = res.headers.get('content-type') || '';
|
|
const interception = !!res.headers.get('vary')?.includes(_approuterheaders.NEXT_URL);
|
|
const postponed = !!res.headers.get(_approuterheaders.NEXT_DID_POSTPONE_HEADER);
|
|
const staleTimeHeaderSeconds = res.headers.get(_approuterheaders.NEXT_ROUTER_STALE_TIME_HEADER);
|
|
const staleTime = staleTimeHeaderSeconds !== null ? parseInt(staleTimeHeaderSeconds, 10) * 1000 : -1;
|
|
let isFlightResponse = contentType.startsWith(_approuterheaders.RSC_CONTENT_TYPE_HEADER);
|
|
if ("TURBOPACK compile-time falsy", 0) //TURBOPACK unreachable
|
|
;
|
|
// If fetch returns something different than flight response handle it like a mpa navigation
|
|
// If the fetch was not 200, we also handle it like a mpa navigation
|
|
if (!isFlightResponse || !res.ok || !res.body) {
|
|
// in case the original URL came with a hash, preserve it before redirecting to the new URL
|
|
if (url.hash) {
|
|
responseUrl.hash = url.hash;
|
|
}
|
|
return doMpaNavigation(responseUrl.toString());
|
|
}
|
|
// We may navigate to a page that requires a different Webpack runtime.
|
|
// In prod, every page will have the same Webpack runtime.
|
|
// In dev, the Webpack runtime is minimal for each page.
|
|
// We need to ensure the Webpack runtime is updated before executing client-side JS of the new page.
|
|
// TODO: This needs to happen in the Flight Client.
|
|
// Or Webpack needs to include the runtime update in the Flight response as
|
|
// a blocking script.
|
|
if ("TURBOPACK compile-time falsy", 0) //TURBOPACK unreachable
|
|
;
|
|
let flightResponsePromise = res.flightResponse;
|
|
if (flightResponsePromise === null) {
|
|
// Typically, `createFetch` would have already started decoding the
|
|
// Flight response. If it hasn't, though, we need to decode it now.
|
|
// TODO: This should only be reachable if legacy PPR is enabled (i.e. PPR
|
|
// without Cache Components). Remove this branch once legacy PPR
|
|
// is deleted.
|
|
const flightStream = postponed ? createUnclosingPrefetchStream(res.body) : res.body;
|
|
flightResponsePromise = createFromNextReadableStream(flightStream, headers);
|
|
}
|
|
const flightResponse = await flightResponsePromise;
|
|
if ((0, _appbuildid.getAppBuildId)() !== flightResponse.b) {
|
|
return doMpaNavigation(res.url);
|
|
}
|
|
const normalizedFlightData = (0, _flightdatahelpers.normalizeFlightData)(flightResponse.f);
|
|
if (typeof normalizedFlightData === 'string') {
|
|
return doMpaNavigation(normalizedFlightData);
|
|
}
|
|
return {
|
|
flightData: normalizedFlightData,
|
|
canonicalUrl: canonicalUrl,
|
|
renderedSearch: (0, _routeparams.getRenderedSearch)(res),
|
|
couldBeIntercepted: interception,
|
|
prerendered: flightResponse.S,
|
|
postponed,
|
|
staleTime,
|
|
debugInfo: flightResponsePromise._debugInfo ?? null
|
|
};
|
|
} catch (err) {
|
|
if (!abortController.signal.aborted) {
|
|
console.error(`Failed to fetch RSC payload for ${originalUrl}. Falling back to browser navigation.`, err);
|
|
}
|
|
// If fetch fails handle it like a mpa navigation
|
|
// TODO-APP: Add a test for the case where a CORS request fails, e.g. external url redirect coming from the response.
|
|
// See https://github.com/vercel/next.js/issues/43605#issuecomment-1451617521 for a reproduction.
|
|
return originalUrl.toString();
|
|
}
|
|
}
|
|
async function createFetch(url, headers, fetchPriority, shouldImmediatelyDecode, signal) {
|
|
// TODO: In output: "export" mode, the headers do nothing. Omit them (and the
|
|
// cache busting search param) from the request so they're
|
|
// maximally cacheable.
|
|
if ("TURBOPACK compile-time falsy", 0) //TURBOPACK unreachable
|
|
;
|
|
if ("TURBOPACK compile-time falsy", 0) //TURBOPACK unreachable
|
|
;
|
|
if ("TURBOPACK compile-time truthy", 1) {
|
|
if (self.__next_r) {
|
|
headers[_approuterheaders.NEXT_HTML_REQUEST_ID_HEADER] = self.__next_r;
|
|
}
|
|
// Create a new request ID for the server action request. The server uses
|
|
// this to tag debug information sent via WebSocket to the client, which
|
|
// then routes those chunks to the debug channel associated with this ID.
|
|
headers[_approuterheaders.NEXT_REQUEST_ID_HEADER] = crypto.getRandomValues(new Uint32Array(1))[0].toString(16);
|
|
}
|
|
const fetchOptions = {
|
|
// Backwards compat for older browsers. `same-origin` is the default in modern browsers.
|
|
credentials: 'same-origin',
|
|
headers,
|
|
priority: fetchPriority || undefined,
|
|
signal
|
|
};
|
|
// `fetchUrl` is slightly different from `url` because we add a cache-busting
|
|
// search param to it. This should not leak outside of this function, so we
|
|
// track them separately.
|
|
let fetchUrl = new URL(url);
|
|
(0, _setcachebustingsearchparam.setCacheBustingSearchParam)(fetchUrl, headers);
|
|
let fetchPromise = fetch(fetchUrl, fetchOptions);
|
|
// Immediately pass the fetch promise to the Flight client so that the debug
|
|
// info includes the latency from the client to the server. The internal timer
|
|
// in React starts as soon as `createFromFetch` is called.
|
|
//
|
|
// The only case where we don't do this is during a prefetch, because we have
|
|
// to do some extra processing of the response stream (see
|
|
// `createUnclosingPrefetchStream`). But this is fine, because a top-level
|
|
// prefetch response never blocks a navigation; if it hasn't already been
|
|
// written into the cache by the time the navigation happens, the router will
|
|
// go straight to a dynamic request.
|
|
let flightResponsePromise = shouldImmediatelyDecode ? createFromNextFetch(fetchPromise, headers) : null;
|
|
let browserResponse = await fetchPromise;
|
|
// If the server responds with a redirect (e.g. 307), and the redirected
|
|
// location does not contain the cache busting search param set in the
|
|
// original request, the response is likely invalid — when following the
|
|
// redirect, the browser forwards the request headers, but since the cache
|
|
// busting search param is missing, the server will reject the request due to
|
|
// a mismatch.
|
|
//
|
|
// Ideally, we would be able to intercept the redirect response and perform it
|
|
// manually, instead of letting the browser automatically follow it, but this
|
|
// is not allowed by the fetch API.
|
|
//
|
|
// So instead, we must "replay" the redirect by fetching the new location
|
|
// again, but this time we'll append the cache busting search param to prevent
|
|
// a mismatch.
|
|
//
|
|
// TODO: We can optimize Next.js's built-in middleware APIs by returning a
|
|
// custom status code, to prevent the browser from automatically following it.
|
|
//
|
|
// This does not affect Server Action-based redirects; those are encoded
|
|
// differently, as part of the Flight body. It only affects redirects that
|
|
// occur in a middleware or a third-party proxy.
|
|
let redirected = browserResponse.redirected;
|
|
if ("TURBOPACK compile-time falsy", 0) //TURBOPACK unreachable
|
|
;
|
|
// Remove the cache busting search param from the response URL, to prevent it
|
|
// from leaking outside of this function.
|
|
const responseUrl = new URL(browserResponse.url, fetchUrl);
|
|
responseUrl.searchParams.delete(_approuterheaders.NEXT_RSC_UNION_QUERY);
|
|
const rscResponse = {
|
|
url: responseUrl.href,
|
|
// This is true if any redirects occurred, either automatically by the
|
|
// browser, or manually by us. So it's different from
|
|
// `browserResponse.redirected`, which only tells us whether the browser
|
|
// followed a redirect, and only for the last response in the chain.
|
|
redirected,
|
|
// These can be copied from the last browser response we received. We
|
|
// intentionally only expose the subset of fields that are actually used
|
|
// elsewhere in the codebase.
|
|
ok: browserResponse.ok,
|
|
headers: browserResponse.headers,
|
|
body: browserResponse.body,
|
|
status: browserResponse.status,
|
|
// This is the exact promise returned by `createFromFetch`. It contains
|
|
// debug information that we need to transfer to any derived promises that
|
|
// are later rendered by React.
|
|
flightResponse: flightResponsePromise
|
|
};
|
|
return rscResponse;
|
|
}
|
|
function createFromNextReadableStream(flightStream, requestHeaders) {
|
|
return createFromReadableStream(flightStream, {
|
|
callServer: _appcallserver.callServer,
|
|
findSourceMapURL: _appfindsourcemapurl.findSourceMapURL,
|
|
debugChannel: createDebugChannel && createDebugChannel(requestHeaders)
|
|
});
|
|
}
|
|
function createFromNextFetch(promiseForResponse, requestHeaders) {
|
|
return createFromFetch(promiseForResponse, {
|
|
callServer: _appcallserver.callServer,
|
|
findSourceMapURL: _appfindsourcemapurl.findSourceMapURL,
|
|
debugChannel: createDebugChannel && createDebugChannel(requestHeaders)
|
|
});
|
|
}
|
|
function createUnclosingPrefetchStream(originalFlightStream) {
|
|
// When PPR is enabled, prefetch streams may contain references that never
|
|
// resolve, because that's how we encode dynamic data access. In the decoded
|
|
// object returned by the Flight client, these are reified into hanging
|
|
// promises that suspend during render, which is effectively what we want.
|
|
// The UI resolves when it switches to the dynamic data stream
|
|
// (via useDeferredValue(dynamic, static)).
|
|
//
|
|
// However, the Flight implementation currently errors if the server closes
|
|
// the response before all the references are resolved. As a cheat to work
|
|
// around this, we wrap the original stream in a new stream that never closes,
|
|
// and therefore doesn't error.
|
|
const reader = originalFlightStream.getReader();
|
|
return new ReadableStream({
|
|
async pull (controller) {
|
|
while(true){
|
|
const { done, value } = await reader.read();
|
|
if (!done) {
|
|
// Pass to the target stream and keep consuming the Flight response
|
|
// from the server.
|
|
controller.enqueue(value);
|
|
continue;
|
|
}
|
|
// The server stream has closed. Exit, but intentionally do not close
|
|
// the target stream.
|
|
return;
|
|
}
|
|
}
|
|
});
|
|
}
|
|
if ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') {
|
|
Object.defineProperty(exports.default, '__esModule', {
|
|
value: true
|
|
});
|
|
Object.assign(exports.default, exports);
|
|
module.exports = exports.default;
|
|
} //# sourceMappingURL=fetch-server-response.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/segment-cache/lru.js [app-ssr] (ecmascript)", ((__turbopack_context__, module, exports) => {
|
|
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
0 && (module.exports = {
|
|
deleteFromLru: null,
|
|
lruPut: null,
|
|
updateLruSize: null
|
|
});
|
|
function _export(target, all) {
|
|
for(var name in all)Object.defineProperty(target, name, {
|
|
enumerable: true,
|
|
get: all[name]
|
|
});
|
|
}
|
|
_export(exports, {
|
|
deleteFromLru: function() {
|
|
return deleteFromLru;
|
|
},
|
|
lruPut: function() {
|
|
return lruPut;
|
|
},
|
|
updateLruSize: function() {
|
|
return updateLruSize;
|
|
}
|
|
});
|
|
const _cachemap = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/segment-cache/cache-map.js [app-ssr] (ecmascript)");
|
|
let head = null;
|
|
let didScheduleCleanup = false;
|
|
let lruSize = 0;
|
|
// TODO: I chose the max size somewhat arbitrarily. Consider setting this based
|
|
// on navigator.deviceMemory, or some other heuristic. We should make this
|
|
// customizable via the Next.js config, too.
|
|
const maxLruSize = 50 * 1024 * 1024 // 50 MB
|
|
;
|
|
function lruPut(node) {
|
|
if (head === node) {
|
|
// Already at the head
|
|
return;
|
|
}
|
|
const prev = node.prev;
|
|
const next = node.next;
|
|
if (next === null || prev === null) {
|
|
// This is an insertion
|
|
lruSize += node.size;
|
|
// Whenever we add an entry, we need to check if we've exceeded the
|
|
// max size. We don't evict entries immediately; they're evicted later in
|
|
// an asynchronous task.
|
|
ensureCleanupIsScheduled();
|
|
} else {
|
|
// This is a move. Remove from its current position.
|
|
prev.next = next;
|
|
next.prev = prev;
|
|
}
|
|
// Move to the front of the list
|
|
if (head === null) {
|
|
// This is the first entry
|
|
node.prev = node;
|
|
node.next = node;
|
|
} else {
|
|
// Add to the front of the list
|
|
const tail = head.prev;
|
|
node.prev = tail;
|
|
// In practice, this is never null, but that isn't encoded in the type
|
|
if (tail !== null) {
|
|
tail.next = node;
|
|
}
|
|
node.next = head;
|
|
head.prev = node;
|
|
}
|
|
head = node;
|
|
}
|
|
function updateLruSize(node, newNodeSize) {
|
|
// This is a separate function from `put` so that we can resize the entry
|
|
// regardless of whether it's currently being tracked by the LRU.
|
|
const prevNodeSize = node.size;
|
|
node.size = newNodeSize;
|
|
if (node.next === null) {
|
|
// This entry is not currently being tracked by the LRU.
|
|
return;
|
|
}
|
|
// Update the total LRU size
|
|
lruSize = lruSize - prevNodeSize + newNodeSize;
|
|
ensureCleanupIsScheduled();
|
|
}
|
|
function deleteFromLru(deleted) {
|
|
const next = deleted.next;
|
|
const prev = deleted.prev;
|
|
if (next !== null && prev !== null) {
|
|
lruSize -= deleted.size;
|
|
deleted.next = null;
|
|
deleted.prev = null;
|
|
// Remove from the list
|
|
if (head === deleted) {
|
|
// Update the head
|
|
if (next === head) {
|
|
// This was the last entry
|
|
head = null;
|
|
} else {
|
|
head = next;
|
|
}
|
|
} else {
|
|
prev.next = next;
|
|
next.prev = prev;
|
|
}
|
|
} else {
|
|
// Already deleted
|
|
}
|
|
}
|
|
function ensureCleanupIsScheduled() {
|
|
if (didScheduleCleanup || lruSize <= maxLruSize) {
|
|
return;
|
|
}
|
|
didScheduleCleanup = true;
|
|
requestCleanupCallback(cleanup);
|
|
}
|
|
function cleanup() {
|
|
didScheduleCleanup = false;
|
|
// Evict entries until we're at 90% capacity. We can assume this won't
|
|
// infinite loop because even if `maxLruSize` were 0, eventually
|
|
// `deleteFromLru` sets `head` to `null` when we run out entries.
|
|
const ninetyPercentMax = maxLruSize * 0.9;
|
|
while(lruSize > ninetyPercentMax && head !== null){
|
|
const tail = head.prev;
|
|
// In practice, this is never null, but that isn't encoded in the type
|
|
if (tail !== null) {
|
|
// Delete the entry from the map. In turn, this will remove it from
|
|
// the LRU.
|
|
(0, _cachemap.deleteFromCacheMap)(tail.value);
|
|
}
|
|
}
|
|
}
|
|
const requestCleanupCallback = typeof requestIdleCallback === 'function' ? requestIdleCallback : (cb)=>setTimeout(cb, 0);
|
|
if ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') {
|
|
Object.defineProperty(exports.default, '__esModule', {
|
|
value: true
|
|
});
|
|
Object.assign(exports.default, exports);
|
|
module.exports = exports.default;
|
|
} //# sourceMappingURL=lru.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/segment-cache/cache-map.js [app-ssr] (ecmascript)", ((__turbopack_context__, module, exports) => {
|
|
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
0 && (module.exports = {
|
|
Fallback: null,
|
|
createCacheMap: null,
|
|
deleteFromCacheMap: null,
|
|
getFromCacheMap: null,
|
|
isValueExpired: null,
|
|
setInCacheMap: null,
|
|
setSizeInCacheMap: null
|
|
});
|
|
function _export(target, all) {
|
|
for(var name in all)Object.defineProperty(target, name, {
|
|
enumerable: true,
|
|
get: all[name]
|
|
});
|
|
}
|
|
_export(exports, {
|
|
Fallback: function() {
|
|
return Fallback;
|
|
},
|
|
createCacheMap: function() {
|
|
return createCacheMap;
|
|
},
|
|
deleteFromCacheMap: function() {
|
|
return deleteFromCacheMap;
|
|
},
|
|
getFromCacheMap: function() {
|
|
return getFromCacheMap;
|
|
},
|
|
isValueExpired: function() {
|
|
return isValueExpired;
|
|
},
|
|
setInCacheMap: function() {
|
|
return setInCacheMap;
|
|
},
|
|
setSizeInCacheMap: function() {
|
|
return setSizeInCacheMap;
|
|
}
|
|
});
|
|
const _lru = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/segment-cache/lru.js [app-ssr] (ecmascript)");
|
|
const Fallback = {};
|
|
// This is a special internal key that is used for "revalidation" entries. It's
|
|
// an implementation detail that shouldn't leak outside of this module.
|
|
const Revalidation = {};
|
|
function createCacheMap() {
|
|
const cacheMap = {
|
|
parent: null,
|
|
key: null,
|
|
value: null,
|
|
map: null,
|
|
// LRU-related fields
|
|
prev: null,
|
|
next: null,
|
|
size: 0
|
|
};
|
|
return cacheMap;
|
|
}
|
|
function getOrInitialize(cacheMap, keys, isRevalidation) {
|
|
// Go through each level of keys until we find the entry that matches, or
|
|
// create a new entry if one doesn't exist.
|
|
//
|
|
// This function will only return entries that match the keypath _exactly_.
|
|
// Unlike getWithFallback, it will not access fallback entries unless it's
|
|
// explicitly part of the keypath.
|
|
let entry = cacheMap;
|
|
let remainingKeys = keys;
|
|
let key = null;
|
|
while(true){
|
|
const previousKey = key;
|
|
if (remainingKeys !== null) {
|
|
key = remainingKeys.value;
|
|
remainingKeys = remainingKeys.parent;
|
|
} else if (isRevalidation && previousKey !== Revalidation) {
|
|
// During a revalidation, we append an internal "Revalidation" key to
|
|
// the end of the keypath. The "normal" entry is its parent.
|
|
// However, if the parent entry is currently empty, we don't need to store
|
|
// this as a revalidation entry. Just insert the revalidation into the
|
|
// normal slot.
|
|
if (entry.value === null) {
|
|
return entry;
|
|
}
|
|
// Otheriwse, create a child entry.
|
|
key = Revalidation;
|
|
} else {
|
|
break;
|
|
}
|
|
let map = entry.map;
|
|
if (map !== null) {
|
|
const existingEntry = map.get(key);
|
|
if (existingEntry !== undefined) {
|
|
// Found a match. Keep going.
|
|
entry = existingEntry;
|
|
continue;
|
|
}
|
|
} else {
|
|
map = new Map();
|
|
entry.map = map;
|
|
}
|
|
// No entry exists yet at this level. Create a new one.
|
|
const newEntry = {
|
|
parent: entry,
|
|
key,
|
|
value: null,
|
|
map: null,
|
|
// LRU-related fields
|
|
prev: null,
|
|
next: null,
|
|
size: 0
|
|
};
|
|
map.set(key, newEntry);
|
|
entry = newEntry;
|
|
}
|
|
return entry;
|
|
}
|
|
function getFromCacheMap(now, currentCacheVersion, rootEntry, keys, isRevalidation) {
|
|
const entry = getEntryWithFallbackImpl(now, currentCacheVersion, rootEntry, keys, isRevalidation, 0);
|
|
if (entry === null || entry.value === null) {
|
|
return null;
|
|
}
|
|
// This is an LRU access. Move the entry to the front of the list.
|
|
(0, _lru.lruPut)(entry);
|
|
return entry.value;
|
|
}
|
|
function isValueExpired(now, currentCacheVersion, value) {
|
|
return value.staleAt <= now || value.version < currentCacheVersion;
|
|
}
|
|
function lazilyEvictIfNeeded(now, currentCacheVersion, entry) {
|
|
// We have a matching entry, but before we can return it, we need to check if
|
|
// it's still fresh. Otherwise it should be treated the same as a cache miss.
|
|
if (entry.value === null) {
|
|
// This entry has no value, so there's nothing to evict.
|
|
return entry;
|
|
}
|
|
const value = entry.value;
|
|
if (isValueExpired(now, currentCacheVersion, value)) {
|
|
// The value expired. Lazily evict it from the cache, and return null. This
|
|
// is conceptually the same as a cache miss.
|
|
deleteMapEntry(entry);
|
|
return null;
|
|
}
|
|
// The matched entry has not expired. Return it.
|
|
return entry;
|
|
}
|
|
function getEntryWithFallbackImpl(now, currentCacheVersion, entry, keys, isRevalidation, previousKey) {
|
|
// This is similar to getExactEntry, but if an exact match is not found for
|
|
// a key, it will return the fallback entry instead. This is recursive at
|
|
// every level, e.g. an entry with keypath [a, Fallback, c, Fallback] is
|
|
// valid match for [a, b, c, d].
|
|
//
|
|
// It will return the most specific match available.
|
|
let key;
|
|
let remainingKeys;
|
|
if (keys !== null) {
|
|
key = keys.value;
|
|
remainingKeys = keys.parent;
|
|
} else if (isRevalidation && previousKey !== Revalidation) {
|
|
// During a revalidation, we append an internal "Revalidation" key to
|
|
// the end of the keypath.
|
|
key = Revalidation;
|
|
remainingKeys = null;
|
|
} else {
|
|
// There are no more keys. This is the terminal entry.
|
|
// TODO: When performing a lookup during a navigation, as opposed to a
|
|
// prefetch, we may want to skip entries that are Pending if there's also
|
|
// a Fulfilled fallback entry. Tricky to say, though, since if it's
|
|
// already pending, it's likely to stream in soon. Maybe we could do this
|
|
// just on slow connections and offline mode.
|
|
return lazilyEvictIfNeeded(now, currentCacheVersion, entry);
|
|
}
|
|
const map = entry.map;
|
|
if (map !== null) {
|
|
const existingEntry = map.get(key);
|
|
if (existingEntry !== undefined) {
|
|
// Found an exact match for this key. Keep searching.
|
|
const result = getEntryWithFallbackImpl(now, currentCacheVersion, existingEntry, remainingKeys, isRevalidation, key);
|
|
if (result !== null) {
|
|
return result;
|
|
}
|
|
}
|
|
// No match found for this key. Check if there's a fallback.
|
|
const fallbackEntry = map.get(Fallback);
|
|
if (fallbackEntry !== undefined) {
|
|
// Found a fallback for this key. Keep searching.
|
|
return getEntryWithFallbackImpl(now, currentCacheVersion, fallbackEntry, remainingKeys, isRevalidation, key);
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
function setInCacheMap(cacheMap, keys, value, isRevalidation) {
|
|
// Add a value to the map at the given keypath. If the value is already
|
|
// part of the map, it's removed from its previous keypath. (NOTE: This is
|
|
// unlike a regular JS map, but the behavior is intentional.)
|
|
const entry = getOrInitialize(cacheMap, keys, isRevalidation);
|
|
setMapEntryValue(entry, value);
|
|
// This is an LRU access. Move the entry to the front of the list.
|
|
(0, _lru.lruPut)(entry);
|
|
(0, _lru.updateLruSize)(entry, value.size);
|
|
}
|
|
function setMapEntryValue(entry, value) {
|
|
if (entry.value !== null) {
|
|
// There's already a value at the given keypath. Disconnect the old value
|
|
// from the map. We're not calling `deleteMapEntry` here because the
|
|
// entry itself is still in the map. We just want to overwrite its value.
|
|
dropRef(entry.value);
|
|
// Fill the entry with the updated value.
|
|
const emptyEntry = entry;
|
|
emptyEntry.value = null;
|
|
fillEmptyReference(emptyEntry, value);
|
|
} else {
|
|
fillEmptyReference(entry, value);
|
|
}
|
|
}
|
|
function fillEmptyReference(entry, value) {
|
|
// This value may already be in the map at a different keypath.
|
|
// Grab a reference before we overwrite it.
|
|
const oldEntry = value.ref;
|
|
const fullEntry = entry;
|
|
fullEntry.value = value;
|
|
value.ref = fullEntry;
|
|
(0, _lru.updateLruSize)(fullEntry, value.size);
|
|
if (oldEntry !== null && oldEntry !== entry && oldEntry.value === value) {
|
|
// This value is already in the map at a different keypath in the map.
|
|
// Values only exist at a single keypath at a time. Remove it from the
|
|
// previous keypath.
|
|
//
|
|
// Note that only the internal map entry is garbage collected; we don't
|
|
// call `dropRef` here because it's still in the map, just
|
|
// at a new keypath (the one we just set, above).
|
|
deleteMapEntry(oldEntry);
|
|
}
|
|
}
|
|
function deleteFromCacheMap(value) {
|
|
const entry = value.ref;
|
|
if (entry === null) {
|
|
// This value is not a member of any map.
|
|
return;
|
|
}
|
|
dropRef(value);
|
|
deleteMapEntry(entry);
|
|
}
|
|
function dropRef(value) {
|
|
// Drop the value from the map by setting its `ref` backpointer to
|
|
// null. This is a separate operation from `deleteMapEntry` because when
|
|
// re-keying a value we need to be able to delete the old, internal map
|
|
// entry without garbage collecting the value itself.
|
|
value.ref = null;
|
|
}
|
|
function deleteMapEntry(entry) {
|
|
// Delete the entry from the cache.
|
|
const emptyEntry = entry;
|
|
emptyEntry.value = null;
|
|
(0, _lru.deleteFromLru)(entry);
|
|
// Check if we can garbage collect the entry.
|
|
const map = emptyEntry.map;
|
|
if (map === null) {
|
|
// Since this entry has no value, and also no child entries, we can
|
|
// garbage collect it. Remove it from its parent, and keep garbage
|
|
// collecting the parents until we reach a non-empty entry.
|
|
let parent = emptyEntry.parent;
|
|
let key = emptyEntry.key;
|
|
while(parent !== null){
|
|
const parentMap = parent.map;
|
|
if (parentMap !== null) {
|
|
parentMap.delete(key);
|
|
if (parentMap.size === 0) {
|
|
// We just removed the last entry in the parent map.
|
|
parent.map = null;
|
|
if (parent.value === null) {
|
|
// The parent node has no child entries, nor does it have a value
|
|
// on itself. It can be garbage collected. Keep going.
|
|
key = parent.key;
|
|
parent = parent.parent;
|
|
continue;
|
|
}
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
} else {
|
|
// Check if there's a revalidating entry. If so, promote it to a
|
|
// "normal" entry, since the normal one was just deleted.
|
|
const revalidatingEntry = map.get(Revalidation);
|
|
if (revalidatingEntry !== undefined && revalidatingEntry.value !== null) {
|
|
setMapEntryValue(emptyEntry, revalidatingEntry.value);
|
|
}
|
|
}
|
|
}
|
|
function setSizeInCacheMap(value, size) {
|
|
const entry = value.ref;
|
|
if (entry === null) {
|
|
// This value is not a member of any map.
|
|
return;
|
|
}
|
|
// Except during initialization (when the size is set to 0), this is the only
|
|
// place the `size` field should be updated, to ensure it's in sync with the
|
|
// the LRU.
|
|
value.size = size;
|
|
(0, _lru.updateLruSize)(entry, size);
|
|
}
|
|
if ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') {
|
|
Object.defineProperty(exports.default, '__esModule', {
|
|
value: true
|
|
});
|
|
Object.assign(exports.default, exports);
|
|
module.exports = exports.default;
|
|
} //# sourceMappingURL=cache-map.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/segment-cache/vary-path.js [app-ssr] (ecmascript)", ((__turbopack_context__, module, exports) => {
|
|
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
0 && (module.exports = {
|
|
appendLayoutVaryPath: null,
|
|
clonePageVaryPathWithNewSearchParams: null,
|
|
finalizeLayoutVaryPath: null,
|
|
finalizeMetadataVaryPath: null,
|
|
finalizePageVaryPath: null,
|
|
getFulfilledRouteVaryPath: null,
|
|
getRouteVaryPath: null,
|
|
getSegmentVaryPathForRequest: null
|
|
});
|
|
function _export(target, all) {
|
|
for(var name in all)Object.defineProperty(target, name, {
|
|
enumerable: true,
|
|
get: all[name]
|
|
});
|
|
}
|
|
_export(exports, {
|
|
appendLayoutVaryPath: function() {
|
|
return appendLayoutVaryPath;
|
|
},
|
|
clonePageVaryPathWithNewSearchParams: function() {
|
|
return clonePageVaryPathWithNewSearchParams;
|
|
},
|
|
finalizeLayoutVaryPath: function() {
|
|
return finalizeLayoutVaryPath;
|
|
},
|
|
finalizeMetadataVaryPath: function() {
|
|
return finalizeMetadataVaryPath;
|
|
},
|
|
finalizePageVaryPath: function() {
|
|
return finalizePageVaryPath;
|
|
},
|
|
getFulfilledRouteVaryPath: function() {
|
|
return getFulfilledRouteVaryPath;
|
|
},
|
|
getRouteVaryPath: function() {
|
|
return getRouteVaryPath;
|
|
},
|
|
getSegmentVaryPathForRequest: function() {
|
|
return getSegmentVaryPathForRequest;
|
|
}
|
|
});
|
|
const _types = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/segment-cache/types.js [app-ssr] (ecmascript)");
|
|
const _cachemap = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/segment-cache/cache-map.js [app-ssr] (ecmascript)");
|
|
const _segmentvalueencoding = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/shared/lib/segment-cache/segment-value-encoding.js [app-ssr] (ecmascript)");
|
|
function getRouteVaryPath(pathname, search, nextUrl) {
|
|
// requestKey -> searchParams -> nextUrl
|
|
const varyPath = {
|
|
value: pathname,
|
|
parent: {
|
|
value: search,
|
|
parent: {
|
|
value: nextUrl,
|
|
parent: null
|
|
}
|
|
}
|
|
};
|
|
return varyPath;
|
|
}
|
|
function getFulfilledRouteVaryPath(pathname, search, nextUrl, couldBeIntercepted) {
|
|
// This is called when a route's data is fulfilled. The cache entry will be
|
|
// re-keyed based on which inputs the response varies by.
|
|
// requestKey -> searchParams -> nextUrl
|
|
const varyPath = {
|
|
value: pathname,
|
|
parent: {
|
|
value: search,
|
|
parent: {
|
|
value: couldBeIntercepted ? nextUrl : _cachemap.Fallback,
|
|
parent: null
|
|
}
|
|
}
|
|
};
|
|
return varyPath;
|
|
}
|
|
function appendLayoutVaryPath(parentPath, cacheKey) {
|
|
const varyPathPart = {
|
|
value: cacheKey,
|
|
parent: parentPath
|
|
};
|
|
return varyPathPart;
|
|
}
|
|
function finalizeLayoutVaryPath(requestKey, varyPath) {
|
|
const layoutVaryPath = {
|
|
value: requestKey,
|
|
parent: varyPath
|
|
};
|
|
return layoutVaryPath;
|
|
}
|
|
function finalizePageVaryPath(requestKey, renderedSearch, varyPath) {
|
|
// Unlike layouts, a page segment's vary path also includes the search string.
|
|
// requestKey -> searchParams -> pathParams
|
|
const pageVaryPath = {
|
|
value: requestKey,
|
|
parent: {
|
|
value: renderedSearch,
|
|
parent: varyPath
|
|
}
|
|
};
|
|
return pageVaryPath;
|
|
}
|
|
function finalizeMetadataVaryPath(pageRequestKey, renderedSearch, varyPath) {
|
|
// The metadata "segment" is not a real segment because it doesn't exist in
|
|
// the normal structure of the route tree, but in terms of caching, it
|
|
// behaves like a page segment because it varies by all the same params as
|
|
// a page.
|
|
//
|
|
// To keep the protocol for querying the server simple, the request key for
|
|
// the metadata does not include any path information. It's unnecessary from
|
|
// the server's perspective, because unlike page segments, there's only one
|
|
// metadata response per URL, i.e. there's no need to distinguish multiple
|
|
// parallel pages.
|
|
//
|
|
// However, this means the metadata request key is insufficient for
|
|
// caching the the metadata in the client cache, because on the client we
|
|
// use the request key to distinguish the metadata entry from all other
|
|
// page's metadata entries.
|
|
//
|
|
// So instead we create a simulated request key based on the page segment.
|
|
// Conceptually this is equivalent to the request key the server would have
|
|
// assigned the metadata segment if it treated it as part of the actual
|
|
// route structure.
|
|
// If there are multiple parallel pages, we use whichever is the first one.
|
|
// This is fine because the only difference between request keys for
|
|
// different parallel pages are things like route groups and parallel
|
|
// route slots. As long as it's always the same one, it doesn't matter.
|
|
const pageVaryPath = {
|
|
// Append the actual metadata request key to the page request key. Note
|
|
// that we're not using a separate vary path part; it's unnecessary because
|
|
// these are not conceptually separate inputs.
|
|
value: pageRequestKey + _segmentvalueencoding.HEAD_REQUEST_KEY,
|
|
parent: {
|
|
value: renderedSearch,
|
|
parent: varyPath
|
|
}
|
|
};
|
|
return pageVaryPath;
|
|
}
|
|
function getSegmentVaryPathForRequest(fetchStrategy, tree) {
|
|
// This is used for storing pending requests in the cache. We want to choose
|
|
// the most generic vary path based on the strategy used to fetch it, i.e.
|
|
// static/PPR versus runtime prefetching, so that it can be reused as much
|
|
// as possible.
|
|
//
|
|
// We may be able to re-key the response to something even more generic once
|
|
// we receive it — for example, if the server tells us that the response
|
|
// doesn't vary on a particular param — but even before we send the request,
|
|
// we know some params are reusable based on the fetch strategy alone. For
|
|
// example, a static prefetch will never vary on search params.
|
|
//
|
|
// The original vary path with all the params filled in is stored on the
|
|
// route tree object. We will clone this one to create a new vary path
|
|
// where certain params are replaced with Fallback.
|
|
//
|
|
// This result of this function is not stored anywhere. It's only used to
|
|
// access the cache a single time.
|
|
//
|
|
// TODO: Rather than create a new list object just to access the cache, the
|
|
// plan is to add the concept of a "vary mask". This will represent all the
|
|
// params that can be treated as Fallback. (Or perhaps the inverse.)
|
|
const originalVaryPath = tree.varyPath;
|
|
// Only page segments (and the special "metadata" segment, which is treated
|
|
// like a page segment for the purposes of caching) may contain search
|
|
// params. There's no reason to include them in the vary path otherwise.
|
|
if (tree.isPage) {
|
|
// Only a runtime prefetch will include search params in the vary path.
|
|
// Static prefetches never include search params, so they can be reused
|
|
// across all possible search param values.
|
|
const doesVaryOnSearchParams = fetchStrategy === _types.FetchStrategy.Full || fetchStrategy === _types.FetchStrategy.PPRRuntime;
|
|
if (!doesVaryOnSearchParams) {
|
|
// The response from the the server will not vary on search params. Clone
|
|
// the end of the original vary path to replace the search params
|
|
// with Fallback.
|
|
//
|
|
// requestKey -> searchParams -> pathParams
|
|
// ^ This part gets replaced with Fallback
|
|
const searchParamsVaryPath = originalVaryPath.parent;
|
|
const pathParamsVaryPath = searchParamsVaryPath.parent;
|
|
const patchedVaryPath = {
|
|
value: originalVaryPath.value,
|
|
parent: {
|
|
value: _cachemap.Fallback,
|
|
parent: pathParamsVaryPath
|
|
}
|
|
};
|
|
return patchedVaryPath;
|
|
}
|
|
}
|
|
// The request does vary on search params. We don't need to modify anything.
|
|
return originalVaryPath;
|
|
}
|
|
function clonePageVaryPathWithNewSearchParams(originalVaryPath, newSearch) {
|
|
// requestKey -> searchParams -> pathParams
|
|
// ^ This part gets replaced with newSearch
|
|
const searchParamsVaryPath = originalVaryPath.parent;
|
|
const clonedVaryPath = {
|
|
value: originalVaryPath.value,
|
|
parent: {
|
|
value: newSearch,
|
|
parent: searchParamsVaryPath.parent
|
|
}
|
|
};
|
|
return clonedVaryPath;
|
|
}
|
|
if ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') {
|
|
Object.defineProperty(exports.default, '__esModule', {
|
|
value: true
|
|
});
|
|
Object.assign(exports.default, exports);
|
|
module.exports = exports.default;
|
|
} //# sourceMappingURL=vary-path.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/shared/lib/page-path/ensure-leading-slash.js [app-ssr] (ecmascript)", ((__turbopack_context__, module, exports) => {
|
|
"use strict";
|
|
|
|
/**
|
|
* For a given page path, this function ensures that there is a leading slash.
|
|
* If there is not a leading slash, one is added, otherwise it is noop.
|
|
*/ Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
Object.defineProperty(exports, "ensureLeadingSlash", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return ensureLeadingSlash;
|
|
}
|
|
});
|
|
function ensureLeadingSlash(path) {
|
|
return path.startsWith('/') ? path : `/${path}`;
|
|
} //# sourceMappingURL=ensure-leading-slash.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/shared/lib/router/utils/app-paths.js [app-ssr] (ecmascript)", ((__turbopack_context__, module, exports) => {
|
|
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
0 && (module.exports = {
|
|
normalizeAppPath: null,
|
|
normalizeRscURL: null
|
|
});
|
|
function _export(target, all) {
|
|
for(var name in all)Object.defineProperty(target, name, {
|
|
enumerable: true,
|
|
get: all[name]
|
|
});
|
|
}
|
|
_export(exports, {
|
|
normalizeAppPath: function() {
|
|
return normalizeAppPath;
|
|
},
|
|
normalizeRscURL: function() {
|
|
return normalizeRscURL;
|
|
}
|
|
});
|
|
const _ensureleadingslash = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/shared/lib/page-path/ensure-leading-slash.js [app-ssr] (ecmascript)");
|
|
const _segment = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/shared/lib/segment.js [app-ssr] (ecmascript)");
|
|
function normalizeAppPath(route) {
|
|
return (0, _ensureleadingslash.ensureLeadingSlash)(route.split('/').reduce((pathname, segment, index, segments)=>{
|
|
// Empty segments are ignored.
|
|
if (!segment) {
|
|
return pathname;
|
|
}
|
|
// Groups are ignored.
|
|
if ((0, _segment.isGroupSegment)(segment)) {
|
|
return pathname;
|
|
}
|
|
// Parallel segments are ignored.
|
|
if (segment[0] === '@') {
|
|
return pathname;
|
|
}
|
|
// The last segment (if it's a leaf) should be ignored.
|
|
if ((segment === 'page' || segment === 'route') && index === segments.length - 1) {
|
|
return pathname;
|
|
}
|
|
return `${pathname}/${segment}`;
|
|
}, ''));
|
|
}
|
|
function normalizeRscURL(url) {
|
|
return url.replace(/\.rsc($|\?)/, '$1');
|
|
} //# sourceMappingURL=app-paths.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/shared/lib/router/utils/interception-routes.js [app-ssr] (ecmascript)", ((__turbopack_context__, module, exports) => {
|
|
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
0 && (module.exports = {
|
|
INTERCEPTION_ROUTE_MARKERS: null,
|
|
extractInterceptionRouteInformation: null,
|
|
isInterceptionRouteAppPath: null
|
|
});
|
|
function _export(target, all) {
|
|
for(var name in all)Object.defineProperty(target, name, {
|
|
enumerable: true,
|
|
get: all[name]
|
|
});
|
|
}
|
|
_export(exports, {
|
|
INTERCEPTION_ROUTE_MARKERS: function() {
|
|
return INTERCEPTION_ROUTE_MARKERS;
|
|
},
|
|
extractInterceptionRouteInformation: function() {
|
|
return extractInterceptionRouteInformation;
|
|
},
|
|
isInterceptionRouteAppPath: function() {
|
|
return isInterceptionRouteAppPath;
|
|
}
|
|
});
|
|
const _apppaths = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/shared/lib/router/utils/app-paths.js [app-ssr] (ecmascript)");
|
|
const INTERCEPTION_ROUTE_MARKERS = [
|
|
'(..)(..)',
|
|
'(.)',
|
|
'(..)',
|
|
'(...)'
|
|
];
|
|
function isInterceptionRouteAppPath(path) {
|
|
// TODO-APP: add more serious validation
|
|
return path.split('/').find((segment)=>INTERCEPTION_ROUTE_MARKERS.find((m)=>segment.startsWith(m))) !== undefined;
|
|
}
|
|
function extractInterceptionRouteInformation(path) {
|
|
let interceptingRoute;
|
|
let marker;
|
|
let interceptedRoute;
|
|
for (const segment of path.split('/')){
|
|
marker = INTERCEPTION_ROUTE_MARKERS.find((m)=>segment.startsWith(m));
|
|
if (marker) {
|
|
;
|
|
[interceptingRoute, interceptedRoute] = path.split(marker, 2);
|
|
break;
|
|
}
|
|
}
|
|
if (!interceptingRoute || !marker || !interceptedRoute) {
|
|
throw Object.defineProperty(new Error(`Invalid interception route: ${path}. Must be in the format /<intercepting route>/(..|...|..)(..)/<intercepted route>`), "__NEXT_ERROR_CODE", {
|
|
value: "E269",
|
|
enumerable: false,
|
|
configurable: true
|
|
});
|
|
}
|
|
interceptingRoute = (0, _apppaths.normalizeAppPath)(interceptingRoute) // normalize the path, e.g. /(blog)/feed -> /feed
|
|
;
|
|
switch(marker){
|
|
case '(.)':
|
|
// (.) indicates that we should match with sibling routes, so we just need to append the intercepted route to the intercepting route
|
|
if (interceptingRoute === '/') {
|
|
interceptedRoute = `/${interceptedRoute}`;
|
|
} else {
|
|
interceptedRoute = interceptingRoute + '/' + interceptedRoute;
|
|
}
|
|
break;
|
|
case '(..)':
|
|
// (..) indicates that we should match at one level up, so we need to remove the last segment of the intercepting route
|
|
if (interceptingRoute === '/') {
|
|
throw Object.defineProperty(new Error(`Invalid interception route: ${path}. Cannot use (..) marker at the root level, use (.) instead.`), "__NEXT_ERROR_CODE", {
|
|
value: "E207",
|
|
enumerable: false,
|
|
configurable: true
|
|
});
|
|
}
|
|
interceptedRoute = interceptingRoute.split('/').slice(0, -1).concat(interceptedRoute).join('/');
|
|
break;
|
|
case '(...)':
|
|
// (...) will match the route segment in the root directory, so we need to use the root directory to prepend the intercepted route
|
|
interceptedRoute = '/' + interceptedRoute;
|
|
break;
|
|
case '(..)(..)':
|
|
// (..)(..) indicates that we should match at two levels up, so we need to remove the last two segments of the intercepting route
|
|
const splitInterceptingRoute = interceptingRoute.split('/');
|
|
if (splitInterceptingRoute.length <= 2) {
|
|
throw Object.defineProperty(new Error(`Invalid interception route: ${path}. Cannot use (..)(..) marker at the root level or one level up.`), "__NEXT_ERROR_CODE", {
|
|
value: "E486",
|
|
enumerable: false,
|
|
configurable: true
|
|
});
|
|
}
|
|
interceptedRoute = splitInterceptingRoute.slice(0, -2).concat(interceptedRoute).join('/');
|
|
break;
|
|
default:
|
|
throw Object.defineProperty(new Error('Invariant: unexpected marker'), "__NEXT_ERROR_CODE", {
|
|
value: "E112",
|
|
enumerable: false,
|
|
configurable: true
|
|
});
|
|
}
|
|
return {
|
|
interceptingRoute,
|
|
interceptedRoute
|
|
};
|
|
} //# sourceMappingURL=interception-routes.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/router-reducer/compute-changed-path.js [app-ssr] (ecmascript)", ((__turbopack_context__, module, exports) => {
|
|
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
0 && (module.exports = {
|
|
computeChangedPath: null,
|
|
extractPathFromFlightRouterState: null,
|
|
getSelectedParams: null
|
|
});
|
|
function _export(target, all) {
|
|
for(var name in all)Object.defineProperty(target, name, {
|
|
enumerable: true,
|
|
get: all[name]
|
|
});
|
|
}
|
|
_export(exports, {
|
|
computeChangedPath: function() {
|
|
return computeChangedPath;
|
|
},
|
|
extractPathFromFlightRouterState: function() {
|
|
return extractPathFromFlightRouterState;
|
|
},
|
|
getSelectedParams: function() {
|
|
return getSelectedParams;
|
|
}
|
|
});
|
|
const _interceptionroutes = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/shared/lib/router/utils/interception-routes.js [app-ssr] (ecmascript)");
|
|
const _segment = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/shared/lib/segment.js [app-ssr] (ecmascript)");
|
|
const _matchsegments = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/match-segments.js [app-ssr] (ecmascript)");
|
|
const removeLeadingSlash = (segment)=>{
|
|
return segment[0] === '/' ? segment.slice(1) : segment;
|
|
};
|
|
const segmentToPathname = (segment)=>{
|
|
if (typeof segment === 'string') {
|
|
// 'children' is not a valid path -- it's technically a parallel route that corresponds with the current segment's page
|
|
// if we don't skip it, then the computed pathname might be something like `/children` which doesn't make sense.
|
|
if (segment === 'children') return '';
|
|
return segment;
|
|
}
|
|
return segment[1];
|
|
};
|
|
function normalizeSegments(segments) {
|
|
return segments.reduce((acc, segment)=>{
|
|
segment = removeLeadingSlash(segment);
|
|
if (segment === '' || (0, _segment.isGroupSegment)(segment)) {
|
|
return acc;
|
|
}
|
|
return `${acc}/${segment}`;
|
|
}, '') || '/';
|
|
}
|
|
function extractPathFromFlightRouterState(flightRouterState) {
|
|
const segment = Array.isArray(flightRouterState[0]) ? flightRouterState[0][1] : flightRouterState[0];
|
|
if (segment === _segment.DEFAULT_SEGMENT_KEY || _interceptionroutes.INTERCEPTION_ROUTE_MARKERS.some((m)=>segment.startsWith(m))) return undefined;
|
|
if (segment.startsWith(_segment.PAGE_SEGMENT_KEY)) return '';
|
|
const segments = [
|
|
segmentToPathname(segment)
|
|
];
|
|
const parallelRoutes = flightRouterState[1] ?? {};
|
|
const childrenPath = parallelRoutes.children ? extractPathFromFlightRouterState(parallelRoutes.children) : undefined;
|
|
if (childrenPath !== undefined) {
|
|
segments.push(childrenPath);
|
|
} else {
|
|
for (const [key, value] of Object.entries(parallelRoutes)){
|
|
if (key === 'children') continue;
|
|
const childPath = extractPathFromFlightRouterState(value);
|
|
if (childPath !== undefined) {
|
|
segments.push(childPath);
|
|
}
|
|
}
|
|
}
|
|
return normalizeSegments(segments);
|
|
}
|
|
function computeChangedPathImpl(treeA, treeB) {
|
|
const [segmentA, parallelRoutesA] = treeA;
|
|
const [segmentB, parallelRoutesB] = treeB;
|
|
const normalizedSegmentA = segmentToPathname(segmentA);
|
|
const normalizedSegmentB = segmentToPathname(segmentB);
|
|
if (_interceptionroutes.INTERCEPTION_ROUTE_MARKERS.some((m)=>normalizedSegmentA.startsWith(m) || normalizedSegmentB.startsWith(m))) {
|
|
return '';
|
|
}
|
|
if (!(0, _matchsegments.matchSegment)(segmentA, segmentB)) {
|
|
// once we find where the tree changed, we compute the rest of the path by traversing the tree
|
|
return extractPathFromFlightRouterState(treeB) ?? '';
|
|
}
|
|
for(const parallelRouterKey in parallelRoutesA){
|
|
if (parallelRoutesB[parallelRouterKey]) {
|
|
const changedPath = computeChangedPathImpl(parallelRoutesA[parallelRouterKey], parallelRoutesB[parallelRouterKey]);
|
|
if (changedPath !== null) {
|
|
return `${segmentToPathname(segmentB)}/${changedPath}`;
|
|
}
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
function computeChangedPath(treeA, treeB) {
|
|
const changedPath = computeChangedPathImpl(treeA, treeB);
|
|
if (changedPath == null || changedPath === '/') {
|
|
return changedPath;
|
|
}
|
|
// lightweight normalization to remove route groups
|
|
return normalizeSegments(changedPath.split('/'));
|
|
}
|
|
function getSelectedParams(currentTree, params = {}) {
|
|
const parallelRoutes = currentTree[1];
|
|
for (const parallelRoute of Object.values(parallelRoutes)){
|
|
const segment = parallelRoute[0];
|
|
const isDynamicParameter = Array.isArray(segment);
|
|
const segmentValue = isDynamicParameter ? segment[1] : segment;
|
|
if (!segmentValue || segmentValue.startsWith(_segment.PAGE_SEGMENT_KEY)) continue;
|
|
// Ensure catchAll and optional catchall are turned into an array
|
|
const isCatchAll = isDynamicParameter && (segment[2] === 'c' || segment[2] === 'oc');
|
|
if (isCatchAll) {
|
|
params[segment[0]] = segment[1].split('/');
|
|
} else if (isDynamicParameter) {
|
|
params[segment[0]] = segment[1];
|
|
}
|
|
params = getSelectedParams(parallelRoute, params);
|
|
}
|
|
return params;
|
|
}
|
|
if ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') {
|
|
Object.defineProperty(exports.default, '__esModule', {
|
|
value: true
|
|
});
|
|
Object.assign(exports.default, exports);
|
|
module.exports = exports.default;
|
|
} //# sourceMappingURL=compute-changed-path.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/router-reducer/handle-mutable.js [app-ssr] (ecmascript)", ((__turbopack_context__, module, exports) => {
|
|
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
Object.defineProperty(exports, "handleMutable", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return handleMutable;
|
|
}
|
|
});
|
|
const _computechangedpath = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/router-reducer/compute-changed-path.js [app-ssr] (ecmascript)");
|
|
function isNotUndefined(value) {
|
|
return typeof value !== 'undefined';
|
|
}
|
|
function handleMutable(state, mutable) {
|
|
// shouldScroll is true by default, can override to false.
|
|
const shouldScroll = mutable.shouldScroll ?? true;
|
|
let previousNextUrl = state.previousNextUrl;
|
|
let nextUrl = state.nextUrl;
|
|
if (isNotUndefined(mutable.patchedTree)) {
|
|
// If we received a patched tree, we need to compute the changed path.
|
|
const changedPath = (0, _computechangedpath.computeChangedPath)(state.tree, mutable.patchedTree);
|
|
if (changedPath) {
|
|
// If the tree changed, we need to update the nextUrl
|
|
previousNextUrl = nextUrl;
|
|
nextUrl = changedPath;
|
|
} else if (!nextUrl) {
|
|
// if the tree ends up being the same (ie, no changed path), and we don't have a nextUrl, then we should use the canonicalUrl
|
|
nextUrl = state.canonicalUrl;
|
|
}
|
|
// otherwise this will be a no-op and continue to use the existing nextUrl
|
|
}
|
|
return {
|
|
// Set href.
|
|
canonicalUrl: mutable.canonicalUrl ?? state.canonicalUrl,
|
|
renderedSearch: mutable.renderedSearch ?? state.renderedSearch,
|
|
pushRef: {
|
|
pendingPush: isNotUndefined(mutable.pendingPush) ? mutable.pendingPush : state.pushRef.pendingPush,
|
|
mpaNavigation: isNotUndefined(mutable.mpaNavigation) ? mutable.mpaNavigation : state.pushRef.mpaNavigation,
|
|
preserveCustomHistoryState: isNotUndefined(mutable.preserveCustomHistoryState) ? mutable.preserveCustomHistoryState : state.pushRef.preserveCustomHistoryState
|
|
},
|
|
// All navigation requires scroll and focus management to trigger.
|
|
focusAndScrollRef: {
|
|
apply: shouldScroll ? isNotUndefined(mutable?.scrollableSegments) ? true : state.focusAndScrollRef.apply : false,
|
|
onlyHashChange: mutable.onlyHashChange || false,
|
|
hashFragment: shouldScroll ? mutable.hashFragment && mutable.hashFragment !== '' ? decodeURIComponent(mutable.hashFragment.slice(1)) : state.focusAndScrollRef.hashFragment : null,
|
|
segmentPaths: shouldScroll ? mutable?.scrollableSegments ?? state.focusAndScrollRef.segmentPaths : []
|
|
},
|
|
// Apply cache.
|
|
cache: mutable.cache ? mutable.cache : state.cache,
|
|
// Apply patched router state.
|
|
tree: isNotUndefined(mutable.patchedTree) ? mutable.patchedTree : state.tree,
|
|
nextUrl,
|
|
previousNextUrl: previousNextUrl,
|
|
debugInfo: mutable.collectedDebugInfo ?? null
|
|
};
|
|
}
|
|
if ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') {
|
|
Object.defineProperty(exports.default, '__esModule', {
|
|
value: true
|
|
});
|
|
Object.assign(exports.default, exports);
|
|
module.exports = exports.default;
|
|
} //# sourceMappingURL=handle-mutable.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/router-reducer/create-router-cache-key.js [app-ssr] (ecmascript)", ((__turbopack_context__, module, exports) => {
|
|
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
Object.defineProperty(exports, "createRouterCacheKey", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return createRouterCacheKey;
|
|
}
|
|
});
|
|
const _segment = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/shared/lib/segment.js [app-ssr] (ecmascript)");
|
|
function createRouterCacheKey(segment, withoutSearchParameters = false) {
|
|
// if the segment is an array, it means it's a dynamic segment
|
|
// for example, ['lang', 'en', 'd']. We need to convert it to a string to store it as a cache node key.
|
|
if (Array.isArray(segment)) {
|
|
return `${segment[0]}|${segment[1]}|${segment[2]}`;
|
|
}
|
|
// Page segments might have search parameters, ie __PAGE__?foo=bar
|
|
// When `withoutSearchParameters` is true, we only want to return the page segment
|
|
if (withoutSearchParameters && segment.startsWith(_segment.PAGE_SEGMENT_KEY)) {
|
|
return _segment.PAGE_SEGMENT_KEY;
|
|
}
|
|
return segment;
|
|
}
|
|
if ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') {
|
|
Object.defineProperty(exports.default, '__esModule', {
|
|
value: true
|
|
});
|
|
Object.assign(exports.default, exports);
|
|
module.exports = exports.default;
|
|
} //# sourceMappingURL=create-router-cache-key.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/router-reducer/is-navigating-to-new-root-layout.js [app-ssr] (ecmascript)", ((__turbopack_context__, module, exports) => {
|
|
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
Object.defineProperty(exports, "isNavigatingToNewRootLayout", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return isNavigatingToNewRootLayout;
|
|
}
|
|
});
|
|
function isNavigatingToNewRootLayout(currentTree, nextTree) {
|
|
// Compare segments
|
|
const currentTreeSegment = currentTree[0];
|
|
const nextTreeSegment = nextTree[0];
|
|
// If any segment is different before we find the root layout, the root layout has changed.
|
|
// E.g. /same/(group1)/layout.js -> /same/(group2)/layout.js
|
|
// First segment is 'same' for both, keep looking. (group1) changed to (group2) before the root layout was found, it must have changed.
|
|
if (Array.isArray(currentTreeSegment) && Array.isArray(nextTreeSegment)) {
|
|
// Compare dynamic param name and type but ignore the value, different values would not affect the current root layout
|
|
// /[name] - /slug1 and /slug2, both values (slug1 & slug2) still has the same layout /[name]/layout.js
|
|
if (currentTreeSegment[0] !== nextTreeSegment[0] || currentTreeSegment[2] !== nextTreeSegment[2]) {
|
|
return true;
|
|
}
|
|
} else if (currentTreeSegment !== nextTreeSegment) {
|
|
return true;
|
|
}
|
|
// Current tree root layout found
|
|
if (currentTree[4]) {
|
|
// If the next tree doesn't have the root layout flag, it must have changed.
|
|
return !nextTree[4];
|
|
}
|
|
// Current tree didn't have its root layout here, must have changed.
|
|
if (nextTree[4]) {
|
|
return true;
|
|
}
|
|
// We can't assume it's `parallelRoutes.children` here in case the root layout is `app/@something/layout.js`
|
|
// But it's not possible to be more than one parallelRoutes before the root layout is found
|
|
// TODO-APP: change to traverse all parallel routes
|
|
const currentTreeChild = Object.values(currentTree[1])[0];
|
|
const nextTreeChild = Object.values(nextTree[1])[0];
|
|
if (!currentTreeChild || !nextTreeChild) return true;
|
|
return isNavigatingToNewRootLayout(currentTreeChild, nextTreeChild);
|
|
}
|
|
if ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') {
|
|
Object.defineProperty(exports.default, '__esModule', {
|
|
value: true
|
|
});
|
|
Object.assign(exports.default, exports);
|
|
module.exports = exports.default;
|
|
} //# sourceMappingURL=is-navigating-to-new-root-layout.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/router-reducer/ppr-navigations.js [app-ssr] (ecmascript)", ((__turbopack_context__, module, exports) => {
|
|
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
0 && (module.exports = {
|
|
abortTask: null,
|
|
listenForDynamicRequest: null,
|
|
startPPRNavigation: null,
|
|
updateCacheNodeOnPopstateRestoration: null
|
|
});
|
|
function _export(target, all) {
|
|
for(var name in all)Object.defineProperty(target, name, {
|
|
enumerable: true,
|
|
get: all[name]
|
|
});
|
|
}
|
|
_export(exports, {
|
|
abortTask: function() {
|
|
return abortTask;
|
|
},
|
|
listenForDynamicRequest: function() {
|
|
return listenForDynamicRequest;
|
|
},
|
|
startPPRNavigation: function() {
|
|
return startPPRNavigation;
|
|
},
|
|
updateCacheNodeOnPopstateRestoration: function() {
|
|
return updateCacheNodeOnPopstateRestoration;
|
|
}
|
|
});
|
|
const _segment = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/shared/lib/segment.js [app-ssr] (ecmascript)");
|
|
const _matchsegments = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/match-segments.js [app-ssr] (ecmascript)");
|
|
const _createhreffromurl = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/router-reducer/create-href-from-url.js [app-ssr] (ecmascript)");
|
|
const _createroutercachekey = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/router-reducer/create-router-cache-key.js [app-ssr] (ecmascript)");
|
|
const _isnavigatingtonewrootlayout = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/router-reducer/is-navigating-to-new-root-layout.js [app-ssr] (ecmascript)");
|
|
const _navigatereducer = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/router-reducer/reducers/navigate-reducer.js [app-ssr] (ecmascript)");
|
|
const MPA_NAVIGATION_TASK = {
|
|
route: null,
|
|
node: null,
|
|
dynamicRequestTree: null,
|
|
children: null
|
|
};
|
|
function startPPRNavigation(navigatedAt, oldUrl, oldCacheNode, oldRouterState, newRouterState, prefetchData, prefetchHead, isPrefetchHeadPartial, isSamePageNavigation, scrollableSegmentsResult) {
|
|
const segmentPath = [];
|
|
return updateCacheNodeOnNavigation(navigatedAt, oldUrl, oldCacheNode, oldRouterState, newRouterState, false, prefetchData, prefetchHead, isPrefetchHeadPartial, isSamePageNavigation, segmentPath, scrollableSegmentsResult);
|
|
}
|
|
function updateCacheNodeOnNavigation(navigatedAt, oldUrl, oldCacheNode, oldRouterState, newRouterState, didFindRootLayout, prefetchData, prefetchHead, isPrefetchHeadPartial, isSamePageNavigation, segmentPath, scrollableSegmentsResult) {
|
|
// Diff the old and new trees to reuse the shared layouts.
|
|
const oldRouterStateChildren = oldRouterState[1];
|
|
const newRouterStateChildren = newRouterState[1];
|
|
const prefetchDataChildren = prefetchData !== null ? prefetchData[1] : null;
|
|
if (!didFindRootLayout) {
|
|
// We're currently traversing the part of the tree that was also part of
|
|
// the previous route. If we discover a root layout, then we don't need to
|
|
// trigger an MPA navigation. See beginRenderingNewRouteTree for context.
|
|
const isRootLayout = newRouterState[4] === true;
|
|
if (isRootLayout) {
|
|
// Found a matching root layout.
|
|
didFindRootLayout = true;
|
|
}
|
|
}
|
|
const oldParallelRoutes = oldCacheNode.parallelRoutes;
|
|
// Clone the current set of segment children, even if they aren't active in
|
|
// the new tree.
|
|
// TODO: We currently retain all the inactive segments indefinitely, until
|
|
// there's an explicit refresh, or a parent layout is lazily refreshed. We
|
|
// rely on this for popstate navigations, which update the Router State Tree
|
|
// but do not eagerly perform a data fetch, because they expect the segment
|
|
// data to already be in the Cache Node tree. For highly static sites that
|
|
// are mostly read-only, this may happen only rarely, causing memory to
|
|
// leak. We should figure out a better model for the lifetime of inactive
|
|
// segments, so we can maintain instant back/forward navigations without
|
|
// leaking memory indefinitely.
|
|
const prefetchParallelRoutes = new Map(oldParallelRoutes);
|
|
// As we diff the trees, we may sometimes modify (copy-on-write, not mutate)
|
|
// the Route Tree that was returned by the server — for example, in the case
|
|
// of default parallel routes, we preserve the currently active segment. To
|
|
// avoid mutating the original tree, we clone the router state children along
|
|
// the return path.
|
|
let patchedRouterStateChildren = {};
|
|
let taskChildren = null;
|
|
// Most navigations require a request to fetch additional data from the
|
|
// server, either because the data was not already prefetched, or because the
|
|
// target route contains dynamic data that cannot be prefetched.
|
|
//
|
|
// However, if the target route is fully static, and it's already completely
|
|
// loaded into the segment cache, then we can skip the server request.
|
|
//
|
|
// This starts off as `false`, and is set to `true` if any of the child
|
|
// routes requires a dynamic request.
|
|
let needsDynamicRequest = false;
|
|
// As we traverse the children, we'll construct a FlightRouterState that can
|
|
// be sent to the server to request the dynamic data. If it turns out that
|
|
// nothing in the subtree is dynamic (i.e. needsDynamicRequest is false at the
|
|
// end), then this will be discarded.
|
|
// TODO: We can probably optimize the format of this data structure to only
|
|
// include paths that are dynamic. Instead of reusing the
|
|
// FlightRouterState type.
|
|
let dynamicRequestTreeChildren = {};
|
|
for(let parallelRouteKey in newRouterStateChildren){
|
|
const newRouterStateChild = newRouterStateChildren[parallelRouteKey];
|
|
const oldRouterStateChild = oldRouterStateChildren[parallelRouteKey];
|
|
const oldSegmentMapChild = oldParallelRoutes.get(parallelRouteKey);
|
|
const prefetchDataChild = prefetchDataChildren !== null ? prefetchDataChildren[parallelRouteKey] : null;
|
|
const newSegmentChild = newRouterStateChild[0];
|
|
const newSegmentPathChild = segmentPath.concat([
|
|
parallelRouteKey,
|
|
newSegmentChild
|
|
]);
|
|
const newSegmentKeyChild = (0, _createroutercachekey.createRouterCacheKey)(newSegmentChild);
|
|
const oldSegmentChild = oldRouterStateChild !== undefined ? oldRouterStateChild[0] : undefined;
|
|
const oldCacheNodeChild = oldSegmentMapChild !== undefined ? oldSegmentMapChild.get(newSegmentKeyChild) : undefined;
|
|
let taskChild;
|
|
if (newSegmentChild === _segment.DEFAULT_SEGMENT_KEY) {
|
|
// This is another kind of leaf segment — a default route.
|
|
//
|
|
// Default routes have special behavior. When there's no matching segment
|
|
// for a parallel route, Next.js preserves the currently active segment
|
|
// during a client navigation — but not for initial render. The server
|
|
// leaves it to the client to account for this. So we need to handle
|
|
// it here.
|
|
if (oldRouterStateChild !== undefined) {
|
|
// Reuse the existing Router State for this segment. We spawn a "task"
|
|
// just to keep track of the updated router state; unlike most, it's
|
|
// already fulfilled and won't be affected by the dynamic response.
|
|
taskChild = reuseActiveSegmentInDefaultSlot(oldUrl, oldRouterStateChild);
|
|
} else {
|
|
// There's no currently active segment. Switch to the "create" path.
|
|
taskChild = beginRenderingNewRouteTree(navigatedAt, oldRouterStateChild, newRouterStateChild, oldCacheNodeChild, didFindRootLayout, prefetchDataChild !== undefined ? prefetchDataChild : null, prefetchHead, isPrefetchHeadPartial, newSegmentPathChild, scrollableSegmentsResult);
|
|
}
|
|
} else if (isSamePageNavigation && // Check if this is a page segment.
|
|
// TODO: We're not consistent about how we do this check. Some places
|
|
// check if the segment starts with PAGE_SEGMENT_KEY, but most seem to
|
|
// check if there any any children, which is why I'm doing it here. We
|
|
// should probably encode an empty children set as `null` though. Either
|
|
// way, we should update all the checks to be consistent.
|
|
Object.keys(newRouterStateChild[1]).length === 0) {
|
|
// We special case navigations to the exact same URL as the current
|
|
// location. It's a common UI pattern for apps to refresh when you click a
|
|
// link to the current page. So when this happens, we refresh the dynamic
|
|
// data in the page segments.
|
|
//
|
|
// Note that this does not apply if the any part of the hash or search
|
|
// query has changed. This might feel a bit weird but it makes more sense
|
|
// when you consider that the way to trigger this behavior is to click
|
|
// the same link multiple times.
|
|
//
|
|
// TODO: We should probably refresh the *entire* route when this case
|
|
// occurs, not just the page segments. Essentially treating it the same as
|
|
// a refresh() triggered by an action, which is the more explicit way of
|
|
// modeling the UI pattern described above.
|
|
//
|
|
// Also note that this only refreshes the dynamic data, not static/
|
|
// cached data. If the page segment is fully static and prefetched, the
|
|
// request is skipped. (This is also how refresh() works.)
|
|
taskChild = beginRenderingNewRouteTree(navigatedAt, oldRouterStateChild, newRouterStateChild, oldCacheNodeChild, didFindRootLayout, prefetchDataChild !== undefined ? prefetchDataChild : null, prefetchHead, isPrefetchHeadPartial, newSegmentPathChild, scrollableSegmentsResult);
|
|
} else if (oldRouterStateChild !== undefined && oldSegmentChild !== undefined && (0, _matchsegments.matchSegment)(newSegmentChild, oldSegmentChild)) {
|
|
if (oldCacheNodeChild !== undefined && oldRouterStateChild !== undefined) {
|
|
// This segment exists in both the old and new trees. Recursively update
|
|
// the children.
|
|
taskChild = updateCacheNodeOnNavigation(navigatedAt, oldUrl, oldCacheNodeChild, oldRouterStateChild, newRouterStateChild, didFindRootLayout, prefetchDataChild, prefetchHead, isPrefetchHeadPartial, isSamePageNavigation, newSegmentPathChild, scrollableSegmentsResult);
|
|
} else {
|
|
// There's no existing Cache Node for this segment. Switch to the
|
|
// "create" path.
|
|
taskChild = beginRenderingNewRouteTree(navigatedAt, oldRouterStateChild, newRouterStateChild, oldCacheNodeChild, didFindRootLayout, prefetchDataChild !== undefined ? prefetchDataChild : null, prefetchHead, isPrefetchHeadPartial, newSegmentPathChild, scrollableSegmentsResult);
|
|
}
|
|
} else {
|
|
// This is a new tree. Switch to the "create" path.
|
|
taskChild = beginRenderingNewRouteTree(navigatedAt, oldRouterStateChild, newRouterStateChild, oldCacheNodeChild, didFindRootLayout, prefetchDataChild !== undefined ? prefetchDataChild : null, prefetchHead, isPrefetchHeadPartial, newSegmentPathChild, scrollableSegmentsResult);
|
|
}
|
|
if (taskChild !== null) {
|
|
// Recursively propagate up the child tasks.
|
|
if (taskChild.route === null) {
|
|
// One of the child tasks discovered a change to the root layout.
|
|
// Immediately unwind from this recursive traversal.
|
|
return MPA_NAVIGATION_TASK;
|
|
}
|
|
if (taskChildren === null) {
|
|
taskChildren = new Map();
|
|
}
|
|
taskChildren.set(parallelRouteKey, taskChild);
|
|
const newCacheNodeChild = taskChild.node;
|
|
if (newCacheNodeChild !== null) {
|
|
const newSegmentMapChild = new Map(oldSegmentMapChild);
|
|
newSegmentMapChild.set(newSegmentKeyChild, newCacheNodeChild);
|
|
prefetchParallelRoutes.set(parallelRouteKey, newSegmentMapChild);
|
|
}
|
|
// The child tree's route state may be different from the prefetched
|
|
// route sent by the server. We need to clone it as we traverse back up
|
|
// the tree.
|
|
const taskChildRoute = taskChild.route;
|
|
patchedRouterStateChildren[parallelRouteKey] = taskChildRoute;
|
|
const dynamicRequestTreeChild = taskChild.dynamicRequestTree;
|
|
if (dynamicRequestTreeChild !== null) {
|
|
// Something in the child tree is dynamic.
|
|
needsDynamicRequest = true;
|
|
dynamicRequestTreeChildren[parallelRouteKey] = dynamicRequestTreeChild;
|
|
} else {
|
|
dynamicRequestTreeChildren[parallelRouteKey] = taskChildRoute;
|
|
}
|
|
} else {
|
|
// The child didn't change. We can use the prefetched router state.
|
|
patchedRouterStateChildren[parallelRouteKey] = newRouterStateChild;
|
|
dynamicRequestTreeChildren[parallelRouteKey] = newRouterStateChild;
|
|
}
|
|
}
|
|
if (taskChildren === null) {
|
|
// No new tasks were spawned.
|
|
return null;
|
|
}
|
|
const newCacheNode = {
|
|
lazyData: null,
|
|
rsc: oldCacheNode.rsc,
|
|
// We intentionally aren't updating the prefetchRsc field, since this node
|
|
// is already part of the current tree, because it would be weird for
|
|
// prefetch data to be newer than the final data. It probably won't ever be
|
|
// observable anyway, but it could happen if the segment is unmounted then
|
|
// mounted again, because LayoutRouter will momentarily switch to rendering
|
|
// prefetchRsc, via useDeferredValue.
|
|
prefetchRsc: oldCacheNode.prefetchRsc,
|
|
head: oldCacheNode.head,
|
|
prefetchHead: oldCacheNode.prefetchHead,
|
|
loading: oldCacheNode.loading,
|
|
// Everything is cloned except for the children, which we computed above.
|
|
parallelRoutes: prefetchParallelRoutes,
|
|
navigatedAt
|
|
};
|
|
return {
|
|
// Return a cloned copy of the router state with updated children.
|
|
route: patchRouterStateWithNewChildren(newRouterState, patchedRouterStateChildren),
|
|
node: newCacheNode,
|
|
dynamicRequestTree: needsDynamicRequest ? patchRouterStateWithNewChildren(newRouterState, dynamicRequestTreeChildren) : null,
|
|
children: taskChildren
|
|
};
|
|
}
|
|
function beginRenderingNewRouteTree(navigatedAt, oldRouterState, newRouterState, existingCacheNode, didFindRootLayout, prefetchData, possiblyPartialPrefetchHead, isPrefetchHeadPartial, segmentPath, scrollableSegmentsResult) {
|
|
if (!didFindRootLayout) {
|
|
// The route tree changed before we reached a layout. (The highest-level
|
|
// layout in a route tree is referred to as the "root" layout.) This could
|
|
// mean that we're navigating between two different root layouts. When this
|
|
// happens, we perform a full-page (MPA-style) navigation.
|
|
//
|
|
// However, the algorithm for deciding where to start rendering a route
|
|
// (i.e. the one performed in order to reach this function) is stricter
|
|
// than the one used to detect a change in the root layout. So just because
|
|
// we're re-rendering a segment outside of the root layout does not mean we
|
|
// should trigger a full-page navigation.
|
|
//
|
|
// Specifically, we handle dynamic parameters differently: two segments are
|
|
// considered the same even if their parameter values are different.
|
|
//
|
|
// Refer to isNavigatingToNewRootLayout for details.
|
|
//
|
|
// Note that we only have to perform this extra traversal if we didn't
|
|
// already discover a root layout in the part of the tree that is unchanged.
|
|
// In the common case, this branch is skipped completely.
|
|
if (oldRouterState === undefined || (0, _isnavigatingtonewrootlayout.isNavigatingToNewRootLayout)(oldRouterState, newRouterState)) {
|
|
// The root layout changed. Perform a full-page navigation.
|
|
return MPA_NAVIGATION_TASK;
|
|
}
|
|
}
|
|
return createCacheNodeOnNavigation(navigatedAt, newRouterState, existingCacheNode, prefetchData, possiblyPartialPrefetchHead, isPrefetchHeadPartial, segmentPath, scrollableSegmentsResult);
|
|
}
|
|
function createCacheNodeOnNavigation(navigatedAt, routerState, existingCacheNode, prefetchData, possiblyPartialPrefetchHead, isPrefetchHeadPartial, segmentPath, scrollableSegmentsResult) {
|
|
// Same traversal as updateCacheNodeNavigation, but we switch to this path
|
|
// once we reach the part of the tree that was not in the previous route. We
|
|
// don't need to diff against the old tree, we just need to create a new one.
|
|
// The head is assigned to every leaf segment delivered by the server. Based
|
|
// on corresponding logic in fill-lazy-items-till-leaf-with-head.ts
|
|
const routerStateChildren = routerState[1];
|
|
const isLeafSegment = Object.keys(routerStateChildren).length === 0;
|
|
// Even we're rendering inside the "new" part of the target tree, we may have
|
|
// a locally cached segment that we can reuse. This may come from either 1)
|
|
// the CacheNode tree, which lives in React state and is populated by previous
|
|
// navigations; or 2) the prefetch cache, which is a separate cache that is
|
|
// populated by prefetches.
|
|
let rsc;
|
|
let loading;
|
|
let head;
|
|
let cacheNodeNavigatedAt;
|
|
if (existingCacheNode !== undefined && // DYNAMIC_STALETIME_MS defaults to 0, but it can be increased using
|
|
// the experimental.staleTimes.dynamic config. When set, we'll avoid
|
|
// refetching dynamic data if it was fetched within the given threshold.
|
|
existingCacheNode.navigatedAt + _navigatereducer.DYNAMIC_STALETIME_MS > navigatedAt) {
|
|
// We have an existing CacheNode for this segment, and it's not stale. We
|
|
// should reuse it rather than request a new one.
|
|
rsc = existingCacheNode.rsc;
|
|
loading = existingCacheNode.loading;
|
|
head = existingCacheNode.head;
|
|
// Don't update the navigatedAt timestamp, since we're reusing stale data.
|
|
cacheNodeNavigatedAt = existingCacheNode.navigatedAt;
|
|
} else if (prefetchData !== null) {
|
|
// There's no existing CacheNode for this segment, but we do have prefetch
|
|
// data. If the prefetch data is fully static (i.e. does not contain any
|
|
// dynamic holes), we don't need to request it from the server.
|
|
rsc = prefetchData[0];
|
|
loading = prefetchData[2];
|
|
head = isLeafSegment ? possiblyPartialPrefetchHead : null;
|
|
// Even though we're accessing the data from the prefetch cache, this is
|
|
// conceptually a new segment, not a reused one. So we should update the
|
|
// navigatedAt timestamp.
|
|
cacheNodeNavigatedAt = navigatedAt;
|
|
const isPrefetchRscPartial = prefetchData[3];
|
|
if (isPrefetchRscPartial || // Check if the head is partial (only relevant if this is a leaf segment)
|
|
isPrefetchHeadPartial && isLeafSegment) {
|
|
// We only have partial data from this segment. Like missing segments, we
|
|
// must request the full data from the server.
|
|
return spawnPendingTask(navigatedAt, routerState, prefetchData, possiblyPartialPrefetchHead, isPrefetchHeadPartial, segmentPath, scrollableSegmentsResult);
|
|
} else {
|
|
// The prefetch data is fully static, so we can omit it from the
|
|
// navigation request.
|
|
}
|
|
} else {
|
|
// There's no prefetch for this segment. Everything from this point will be
|
|
// requested from the server, even if there are static children below it.
|
|
// Create a terminal task node that will later be fulfilled by
|
|
// server response.
|
|
return spawnPendingTask(navigatedAt, routerState, null, possiblyPartialPrefetchHead, isPrefetchHeadPartial, segmentPath, scrollableSegmentsResult);
|
|
}
|
|
// We already have a full segment we can render, so we don't need to request a
|
|
// new one from the server. Keep traversing down the tree until we reach
|
|
// something that requires a dynamic request.
|
|
const prefetchDataChildren = prefetchData !== null ? prefetchData[1] : null;
|
|
const taskChildren = new Map();
|
|
const existingCacheNodeChildren = existingCacheNode !== undefined ? existingCacheNode.parallelRoutes : null;
|
|
const cacheNodeChildren = new Map(existingCacheNodeChildren);
|
|
let dynamicRequestTreeChildren = {};
|
|
let needsDynamicRequest = false;
|
|
if (isLeafSegment) {
|
|
// The segment path of every leaf segment (i.e. page) is collected into
|
|
// a result array. This is used by the LayoutRouter to scroll to ensure that
|
|
// new pages are visible after a navigation.
|
|
// TODO: We should use a string to represent the segment path instead of
|
|
// an array. We already use a string representation for the path when
|
|
// accessing the Segment Cache, so we can use the same one.
|
|
scrollableSegmentsResult.push(segmentPath);
|
|
} else {
|
|
for(let parallelRouteKey in routerStateChildren){
|
|
const routerStateChild = routerStateChildren[parallelRouteKey];
|
|
const prefetchDataChild = prefetchDataChildren !== null ? prefetchDataChildren[parallelRouteKey] : null;
|
|
const existingSegmentMapChild = existingCacheNodeChildren !== null ? existingCacheNodeChildren.get(parallelRouteKey) : undefined;
|
|
const segmentChild = routerStateChild[0];
|
|
const segmentPathChild = segmentPath.concat([
|
|
parallelRouteKey,
|
|
segmentChild
|
|
]);
|
|
const segmentKeyChild = (0, _createroutercachekey.createRouterCacheKey)(segmentChild);
|
|
const existingCacheNodeChild = existingSegmentMapChild !== undefined ? existingSegmentMapChild.get(segmentKeyChild) : undefined;
|
|
const taskChild = createCacheNodeOnNavigation(navigatedAt, routerStateChild, existingCacheNodeChild, prefetchDataChild, possiblyPartialPrefetchHead, isPrefetchHeadPartial, segmentPathChild, scrollableSegmentsResult);
|
|
taskChildren.set(parallelRouteKey, taskChild);
|
|
const dynamicRequestTreeChild = taskChild.dynamicRequestTree;
|
|
if (dynamicRequestTreeChild !== null) {
|
|
// Something in the child tree is dynamic.
|
|
needsDynamicRequest = true;
|
|
dynamicRequestTreeChildren[parallelRouteKey] = dynamicRequestTreeChild;
|
|
} else {
|
|
dynamicRequestTreeChildren[parallelRouteKey] = routerStateChild;
|
|
}
|
|
const newCacheNodeChild = taskChild.node;
|
|
if (newCacheNodeChild !== null) {
|
|
const newSegmentMapChild = new Map();
|
|
newSegmentMapChild.set(segmentKeyChild, newCacheNodeChild);
|
|
cacheNodeChildren.set(parallelRouteKey, newSegmentMapChild);
|
|
}
|
|
}
|
|
}
|
|
return {
|
|
// Since we're inside a new route tree, unlike the
|
|
// `updateCacheNodeOnNavigation` path, the router state on the children
|
|
// tasks is always the same as the router state we pass in. So we don't need
|
|
// to clone/modify it.
|
|
route: routerState,
|
|
node: {
|
|
lazyData: null,
|
|
// Since this segment is already full, we don't need to use the
|
|
// `prefetchRsc` field.
|
|
rsc,
|
|
prefetchRsc: null,
|
|
head,
|
|
prefetchHead: null,
|
|
loading,
|
|
parallelRoutes: cacheNodeChildren,
|
|
navigatedAt: cacheNodeNavigatedAt
|
|
},
|
|
dynamicRequestTree: needsDynamicRequest ? patchRouterStateWithNewChildren(routerState, dynamicRequestTreeChildren) : null,
|
|
children: taskChildren
|
|
};
|
|
}
|
|
function patchRouterStateWithNewChildren(baseRouterState, newChildren) {
|
|
const clone = [
|
|
baseRouterState[0],
|
|
newChildren
|
|
];
|
|
// Based on equivalent logic in apply-router-state-patch-to-tree, but should
|
|
// confirm whether we need to copy all of these fields. Not sure the server
|
|
// ever sends, e.g. the refetch marker.
|
|
if (2 in baseRouterState) {
|
|
clone[2] = baseRouterState[2];
|
|
}
|
|
if (3 in baseRouterState) {
|
|
clone[3] = baseRouterState[3];
|
|
}
|
|
if (4 in baseRouterState) {
|
|
clone[4] = baseRouterState[4];
|
|
}
|
|
return clone;
|
|
}
|
|
function spawnPendingTask(navigatedAt, routerState, prefetchData, prefetchHead, isPrefetchHeadPartial, segmentPath, scrollableSegmentsResult) {
|
|
// Create a task that will later be fulfilled by data from the server.
|
|
// Clone the prefetched route tree and the `refetch` marker to it. We'll send
|
|
// this to the server so it knows where to start rendering.
|
|
const dynamicRequestTree = patchRouterStateWithNewChildren(routerState, routerState[1]);
|
|
dynamicRequestTree[3] = 'refetch';
|
|
const newTask = {
|
|
route: routerState,
|
|
// Corresponds to the part of the route that will be rendered on the server.
|
|
node: createPendingCacheNode(navigatedAt, routerState, prefetchData, prefetchHead, isPrefetchHeadPartial, segmentPath, scrollableSegmentsResult),
|
|
// Because this is non-null, and it gets propagated up through the parent
|
|
// tasks, the root task will know that it needs to perform a server request.
|
|
dynamicRequestTree,
|
|
children: null
|
|
};
|
|
return newTask;
|
|
}
|
|
function reuseActiveSegmentInDefaultSlot(oldUrl, oldRouterState) {
|
|
// This is a "default" segment. These are never sent by the server during a
|
|
// soft navigation; instead, the client reuses whatever segment was already
|
|
// active in that slot on the previous route. This means if we later need to
|
|
// refresh the segment, it will have to be refetched from the previous route's
|
|
// URL. We store it in the Flight Router State.
|
|
//
|
|
// TODO: We also mark the segment with a "refresh" marker but I think we can
|
|
// get rid of that eventually by making sure we only add URLs to page segments
|
|
// that are reused. Then the presence of the URL alone is enough.
|
|
let reusedRouterState;
|
|
const oldRefreshMarker = oldRouterState[3];
|
|
if (oldRefreshMarker === 'refresh') {
|
|
// This segment was already reused from an even older route. Keep its
|
|
// existing URL and refresh marker.
|
|
reusedRouterState = oldRouterState;
|
|
} else {
|
|
// This segment was not previously reused, and it's not on the new route.
|
|
// So it must have been delivered in the old route.
|
|
reusedRouterState = patchRouterStateWithNewChildren(oldRouterState, oldRouterState[1]);
|
|
reusedRouterState[2] = (0, _createhreffromurl.createHrefFromUrl)(oldUrl);
|
|
reusedRouterState[3] = 'refresh';
|
|
}
|
|
return {
|
|
route: reusedRouterState,
|
|
node: null,
|
|
dynamicRequestTree: null,
|
|
children: null
|
|
};
|
|
}
|
|
function listenForDynamicRequest(task, responsePromise) {
|
|
responsePromise.then((result)=>{
|
|
if (typeof result === 'string') {
|
|
// Happens when navigating to page in `pages` from `app`. We shouldn't
|
|
// get here because should have already handled this during
|
|
// the prefetch.
|
|
return;
|
|
}
|
|
const { flightData, debugInfo } = result;
|
|
for (const normalizedFlightData of flightData){
|
|
const { segmentPath, tree: serverRouterState, seedData: dynamicData, head: dynamicHead } = normalizedFlightData;
|
|
if (!dynamicData) {
|
|
continue;
|
|
}
|
|
writeDynamicDataIntoPendingTask(task, segmentPath, serverRouterState, dynamicData, dynamicHead, debugInfo);
|
|
}
|
|
// Now that we've exhausted all the data we received from the server, if
|
|
// there are any remaining pending tasks in the tree, abort them now.
|
|
// If there's any missing data, it will trigger a lazy fetch.
|
|
abortTask(task, null, debugInfo);
|
|
}, (error)=>{
|
|
// This will trigger an error during render
|
|
abortTask(task, error, null);
|
|
});
|
|
}
|
|
function writeDynamicDataIntoPendingTask(rootTask, segmentPath, serverRouterState, dynamicData, dynamicHead, debugInfo) {
|
|
// The data sent by the server represents only a subtree of the app. We need
|
|
// to find the part of the task tree that matches the server response, and
|
|
// fulfill it using the dynamic data.
|
|
//
|
|
// segmentPath represents the parent path of subtree. It's a repeating pattern
|
|
// of parallel route key and segment:
|
|
//
|
|
// [string, Segment, string, Segment, string, Segment, ...]
|
|
//
|
|
// Iterate through the path and finish any tasks that match this payload.
|
|
let task = rootTask;
|
|
for(let i = 0; i < segmentPath.length; i += 2){
|
|
const parallelRouteKey = segmentPath[i];
|
|
const segment = segmentPath[i + 1];
|
|
const taskChildren = task.children;
|
|
if (taskChildren !== null) {
|
|
const taskChild = taskChildren.get(parallelRouteKey);
|
|
if (taskChild !== undefined) {
|
|
const taskSegment = taskChild.route[0];
|
|
if ((0, _matchsegments.matchSegment)(segment, taskSegment)) {
|
|
// Found a match for this task. Keep traversing down the task tree.
|
|
task = taskChild;
|
|
continue;
|
|
}
|
|
}
|
|
}
|
|
// We didn't find a child task that matches the server data. Exit. We won't
|
|
// abort the task, though, because a different FlightDataPath may be able to
|
|
// fulfill it (see loop in listenForDynamicRequest). We only abort tasks
|
|
// once we've run out of data.
|
|
return;
|
|
}
|
|
finishTaskUsingDynamicDataPayload(task, serverRouterState, dynamicData, dynamicHead, debugInfo);
|
|
}
|
|
function finishTaskUsingDynamicDataPayload(task, serverRouterState, dynamicData, dynamicHead, debugInfo) {
|
|
if (task.dynamicRequestTree === null) {
|
|
// Everything in this subtree is already complete. Bail out.
|
|
return;
|
|
}
|
|
// dynamicData may represent a larger subtree than the task. Before we can
|
|
// finish the task, we need to line them up.
|
|
const taskChildren = task.children;
|
|
const taskNode = task.node;
|
|
if (taskChildren === null) {
|
|
// We've reached the leaf node of the pending task. The server data tree
|
|
// lines up the pending Cache Node tree. We can now switch to the
|
|
// normal algorithm.
|
|
if (taskNode !== null) {
|
|
finishPendingCacheNode(taskNode, task.route, serverRouterState, dynamicData, dynamicHead, debugInfo);
|
|
// Set this to null to indicate that this task is now complete.
|
|
task.dynamicRequestTree = null;
|
|
}
|
|
return;
|
|
}
|
|
// The server returned more data than we need to finish the task. Skip over
|
|
// the extra segments until we reach the leaf task node.
|
|
const serverChildren = serverRouterState[1];
|
|
const dynamicDataChildren = dynamicData[1];
|
|
for(const parallelRouteKey in serverRouterState){
|
|
const serverRouterStateChild = serverChildren[parallelRouteKey];
|
|
const dynamicDataChild = dynamicDataChildren[parallelRouteKey];
|
|
const taskChild = taskChildren.get(parallelRouteKey);
|
|
if (taskChild !== undefined) {
|
|
const taskSegment = taskChild.route[0];
|
|
if ((0, _matchsegments.matchSegment)(serverRouterStateChild[0], taskSegment) && dynamicDataChild !== null && dynamicDataChild !== undefined) {
|
|
// Found a match for this task. Keep traversing down the task tree.
|
|
return finishTaskUsingDynamicDataPayload(taskChild, serverRouterStateChild, dynamicDataChild, dynamicHead, debugInfo);
|
|
}
|
|
}
|
|
// We didn't find a child task that matches the server data. We won't abort
|
|
// the task, though, because a different FlightDataPath may be able to
|
|
// fulfill it (see loop in listenForDynamicRequest). We only abort tasks
|
|
// once we've run out of data.
|
|
}
|
|
}
|
|
function createPendingCacheNode(navigatedAt, routerState, prefetchData, prefetchHead, isPrefetchHeadPartial, segmentPath, scrollableSegmentsResult) {
|
|
const routerStateChildren = routerState[1];
|
|
const prefetchDataChildren = prefetchData !== null ? prefetchData[1] : null;
|
|
const parallelRoutes = new Map();
|
|
for(let parallelRouteKey in routerStateChildren){
|
|
const routerStateChild = routerStateChildren[parallelRouteKey];
|
|
const prefetchDataChild = prefetchDataChildren !== null ? prefetchDataChildren[parallelRouteKey] : null;
|
|
const segmentChild = routerStateChild[0];
|
|
const segmentPathChild = segmentPath.concat([
|
|
parallelRouteKey,
|
|
segmentChild
|
|
]);
|
|
const segmentKeyChild = (0, _createroutercachekey.createRouterCacheKey)(segmentChild);
|
|
const newCacheNodeChild = createPendingCacheNode(navigatedAt, routerStateChild, prefetchDataChild === undefined ? null : prefetchDataChild, prefetchHead, isPrefetchHeadPartial, segmentPathChild, scrollableSegmentsResult);
|
|
const newSegmentMapChild = new Map();
|
|
newSegmentMapChild.set(segmentKeyChild, newCacheNodeChild);
|
|
parallelRoutes.set(parallelRouteKey, newSegmentMapChild);
|
|
}
|
|
// The head is assigned to every leaf segment delivered by the server. Based
|
|
// on corresponding logic in fill-lazy-items-till-leaf-with-head.ts
|
|
const isLeafSegment = parallelRoutes.size === 0;
|
|
if (isLeafSegment) {
|
|
// The segment path of every leaf segment (i.e. page) is collected into
|
|
// a result array. This is used by the LayoutRouter to scroll to ensure that
|
|
// new pages are visible after a navigation.
|
|
// TODO: We should use a string to represent the segment path instead of
|
|
// an array. We already use a string representation for the path when
|
|
// accessing the Segment Cache, so we can use the same one.
|
|
scrollableSegmentsResult.push(segmentPath);
|
|
}
|
|
const maybePrefetchRsc = prefetchData !== null ? prefetchData[0] : null;
|
|
return {
|
|
lazyData: null,
|
|
parallelRoutes: parallelRoutes,
|
|
prefetchRsc: maybePrefetchRsc !== undefined ? maybePrefetchRsc : null,
|
|
prefetchHead: isLeafSegment ? prefetchHead : [
|
|
null,
|
|
null
|
|
],
|
|
// Create a deferred promise. This will be fulfilled once the dynamic
|
|
// response is received from the server.
|
|
rsc: createDeferredRsc(),
|
|
head: isLeafSegment ? createDeferredRsc() : null,
|
|
// TODO: Technically, a loading boundary could contain dynamic data. We must
|
|
// have separate `loading` and `prefetchLoading` fields to handle this, like
|
|
// we do for the segment data and head.
|
|
loading: prefetchData !== null ? prefetchData[2] ?? null : createDeferredRsc(),
|
|
navigatedAt
|
|
};
|
|
}
|
|
function finishPendingCacheNode(cacheNode, taskState, serverState, dynamicData, dynamicHead, debugInfo) {
|
|
// Writes a dynamic response into an existing Cache Node tree. This does _not_
|
|
// create a new tree, it updates the existing tree in-place. So it must follow
|
|
// the Suspense rules of cache safety — it can resolve pending promises, but
|
|
// it cannot overwrite existing data. It can add segments to the tree (because
|
|
// a missing segment will cause the layout router to suspend).
|
|
// but it cannot delete them.
|
|
//
|
|
// We must resolve every promise in the tree, or else it will suspend
|
|
// indefinitely. If we did not receive data for a segment, we will resolve its
|
|
// data promise to `null` to trigger a lazy fetch during render.
|
|
const taskStateChildren = taskState[1];
|
|
const serverStateChildren = serverState[1];
|
|
const dataChildren = dynamicData[1];
|
|
// The router state that we traverse the tree with (taskState) is the same one
|
|
// that we used to construct the pending Cache Node tree. That way we're sure
|
|
// to resolve all the pending promises.
|
|
const parallelRoutes = cacheNode.parallelRoutes;
|
|
for(let parallelRouteKey in taskStateChildren){
|
|
const taskStateChild = taskStateChildren[parallelRouteKey];
|
|
const serverStateChild = serverStateChildren[parallelRouteKey];
|
|
const dataChild = dataChildren[parallelRouteKey];
|
|
const segmentMapChild = parallelRoutes.get(parallelRouteKey);
|
|
const taskSegmentChild = taskStateChild[0];
|
|
const taskSegmentKeyChild = (0, _createroutercachekey.createRouterCacheKey)(taskSegmentChild);
|
|
const cacheNodeChild = segmentMapChild !== undefined ? segmentMapChild.get(taskSegmentKeyChild) : undefined;
|
|
if (cacheNodeChild !== undefined) {
|
|
if (serverStateChild !== undefined && (0, _matchsegments.matchSegment)(taskSegmentChild, serverStateChild[0])) {
|
|
if (dataChild !== undefined && dataChild !== null) {
|
|
// This is the happy path. Recursively update all the children.
|
|
finishPendingCacheNode(cacheNodeChild, taskStateChild, serverStateChild, dataChild, dynamicHead, debugInfo);
|
|
} else {
|
|
// The server never returned data for this segment. Trigger a lazy
|
|
// fetch during render. This shouldn't happen because the Route Tree
|
|
// and the Seed Data tree sent by the server should always be the same
|
|
// shape when part of the same server response.
|
|
abortPendingCacheNode(taskStateChild, cacheNodeChild, null, debugInfo);
|
|
}
|
|
} else {
|
|
// The server never returned data for this segment. Trigger a lazy
|
|
// fetch during render.
|
|
abortPendingCacheNode(taskStateChild, cacheNodeChild, null, debugInfo);
|
|
}
|
|
} else {
|
|
// The server response matches what was expected to receive, but there's
|
|
// no matching Cache Node in the task tree. This is a bug in the
|
|
// implementation because we should have created a node for every
|
|
// segment in the tree that's associated with this task.
|
|
}
|
|
}
|
|
// Use the dynamic data from the server to fulfill the deferred RSC promise
|
|
// on the Cache Node.
|
|
const rsc = cacheNode.rsc;
|
|
const dynamicSegmentData = dynamicData[0];
|
|
if (rsc === null) {
|
|
// This is a lazy cache node. We can overwrite it. This is only safe
|
|
// because we know that the LayoutRouter suspends if `rsc` is `null`.
|
|
cacheNode.rsc = dynamicSegmentData;
|
|
} else if (isDeferredRsc(rsc)) {
|
|
// This is a deferred RSC promise. We can fulfill it with the data we just
|
|
// received from the server. If it was already resolved by a different
|
|
// navigation, then this does nothing because we can't overwrite data.
|
|
rsc.resolve(dynamicSegmentData, debugInfo);
|
|
} else {
|
|
// This is not a deferred RSC promise, nor is it empty, so it must have
|
|
// been populated by a different navigation. We must not overwrite it.
|
|
}
|
|
// If we navigated without a prefetch, then `loading` will be a deferred promise too.
|
|
// Fulfill it using the dynamic response so that we can display the loading boundary.
|
|
const loading = cacheNode.loading;
|
|
if (isDeferredRsc(loading)) {
|
|
const dynamicLoading = dynamicData[2];
|
|
loading.resolve(dynamicLoading, debugInfo);
|
|
}
|
|
// Check if this is a leaf segment. If so, it will have a `head` property with
|
|
// a pending promise that needs to be resolved with the dynamic head from
|
|
// the server.
|
|
const head = cacheNode.head;
|
|
if (isDeferredRsc(head)) {
|
|
head.resolve(dynamicHead, debugInfo);
|
|
}
|
|
}
|
|
function abortTask(task, error, debugInfo) {
|
|
const cacheNode = task.node;
|
|
if (cacheNode === null) {
|
|
// This indicates the task is already complete.
|
|
return;
|
|
}
|
|
const taskChildren = task.children;
|
|
if (taskChildren === null) {
|
|
// Reached the leaf task node. This is the root of a pending cache
|
|
// node tree.
|
|
abortPendingCacheNode(task.route, cacheNode, error, debugInfo);
|
|
} else {
|
|
// This is an intermediate task node. Keep traversing until we reach a
|
|
// task node with no children. That will be the root of the cache node tree
|
|
// that needs to be resolved.
|
|
for (const taskChild of taskChildren.values()){
|
|
abortTask(taskChild, error, debugInfo);
|
|
}
|
|
}
|
|
// Set this to null to indicate that this task is now complete.
|
|
task.dynamicRequestTree = null;
|
|
}
|
|
function abortPendingCacheNode(routerState, cacheNode, error, debugInfo) {
|
|
// For every pending segment in the tree, resolve its `rsc` promise to `null`
|
|
// to trigger a lazy fetch during render.
|
|
//
|
|
// Or, if an error object is provided, it will error instead.
|
|
const routerStateChildren = routerState[1];
|
|
const parallelRoutes = cacheNode.parallelRoutes;
|
|
for(let parallelRouteKey in routerStateChildren){
|
|
const routerStateChild = routerStateChildren[parallelRouteKey];
|
|
const segmentMapChild = parallelRoutes.get(parallelRouteKey);
|
|
if (segmentMapChild === undefined) {
|
|
continue;
|
|
}
|
|
const segmentChild = routerStateChild[0];
|
|
const segmentKeyChild = (0, _createroutercachekey.createRouterCacheKey)(segmentChild);
|
|
const cacheNodeChild = segmentMapChild.get(segmentKeyChild);
|
|
if (cacheNodeChild !== undefined) {
|
|
abortPendingCacheNode(routerStateChild, cacheNodeChild, error, debugInfo);
|
|
} else {
|
|
// This shouldn't happen because we're traversing the same tree that was
|
|
// used to construct the cache nodes in the first place.
|
|
}
|
|
}
|
|
const rsc = cacheNode.rsc;
|
|
if (isDeferredRsc(rsc)) {
|
|
if (error === null) {
|
|
// This will trigger a lazy fetch during render.
|
|
rsc.resolve(null, debugInfo);
|
|
} else {
|
|
// This will trigger an error during rendering.
|
|
rsc.reject(error, debugInfo);
|
|
}
|
|
}
|
|
const loading = cacheNode.loading;
|
|
if (isDeferredRsc(loading)) {
|
|
loading.resolve(null, debugInfo);
|
|
}
|
|
// Check if this is a leaf segment. If so, it will have a `head` property with
|
|
// a pending promise that needs to be resolved. If an error was provided, we
|
|
// will not resolve it with an error, since this is rendered at the root of
|
|
// the app. We want the segment to error, not the entire app.
|
|
const head = cacheNode.head;
|
|
if (isDeferredRsc(head)) {
|
|
head.resolve(null, debugInfo);
|
|
}
|
|
}
|
|
function updateCacheNodeOnPopstateRestoration(oldCacheNode, routerState) {
|
|
// A popstate navigation reads data from the local cache. It does not issue
|
|
// new network requests (unless the cache entries have been evicted). So, we
|
|
// update the cache to drop the prefetch data for any segment whose dynamic
|
|
// data was already received. This prevents an unnecessary flash back to PPR
|
|
// state during a back/forward navigation.
|
|
//
|
|
// This function clones the entire cache node tree and sets the `prefetchRsc`
|
|
// field to `null` to prevent it from being rendered. We can't mutate the node
|
|
// in place because this is a concurrent data structure.
|
|
const routerStateChildren = routerState[1];
|
|
const oldParallelRoutes = oldCacheNode.parallelRoutes;
|
|
const newParallelRoutes = new Map(oldParallelRoutes);
|
|
for(let parallelRouteKey in routerStateChildren){
|
|
const routerStateChild = routerStateChildren[parallelRouteKey];
|
|
const segmentChild = routerStateChild[0];
|
|
const segmentKeyChild = (0, _createroutercachekey.createRouterCacheKey)(segmentChild);
|
|
const oldSegmentMapChild = oldParallelRoutes.get(parallelRouteKey);
|
|
if (oldSegmentMapChild !== undefined) {
|
|
const oldCacheNodeChild = oldSegmentMapChild.get(segmentKeyChild);
|
|
if (oldCacheNodeChild !== undefined) {
|
|
const newCacheNodeChild = updateCacheNodeOnPopstateRestoration(oldCacheNodeChild, routerStateChild);
|
|
const newSegmentMapChild = new Map(oldSegmentMapChild);
|
|
newSegmentMapChild.set(segmentKeyChild, newCacheNodeChild);
|
|
newParallelRoutes.set(parallelRouteKey, newSegmentMapChild);
|
|
}
|
|
}
|
|
}
|
|
// Only show prefetched data if the dynamic data is still pending.
|
|
//
|
|
// Tehnically, what we're actually checking is whether the dynamic network
|
|
// response was received. But since it's a streaming response, this does not
|
|
// mean that all the dynamic data has fully streamed in. It just means that
|
|
// _some_ of the dynamic data was received. But as a heuristic, we assume that
|
|
// the rest dynamic data will stream in quickly, so it's still better to skip
|
|
// the prefetch state.
|
|
const rsc = oldCacheNode.rsc;
|
|
const shouldUsePrefetch = isDeferredRsc(rsc) && rsc.status === 'pending';
|
|
return {
|
|
lazyData: null,
|
|
rsc,
|
|
head: oldCacheNode.head,
|
|
prefetchHead: shouldUsePrefetch ? oldCacheNode.prefetchHead : [
|
|
null,
|
|
null
|
|
],
|
|
prefetchRsc: shouldUsePrefetch ? oldCacheNode.prefetchRsc : null,
|
|
loading: oldCacheNode.loading,
|
|
// These are the cloned children we computed above
|
|
parallelRoutes: newParallelRoutes,
|
|
navigatedAt: oldCacheNode.navigatedAt
|
|
};
|
|
}
|
|
const DEFERRED = Symbol();
|
|
// This type exists to distinguish a DeferredRsc from a Flight promise. It's a
|
|
// compromise to avoid adding an extra field on every Cache Node, which would be
|
|
// awkward because the pre-PPR parts of codebase would need to account for it,
|
|
// too. We can remove it once type Cache Node type is more settled.
|
|
function isDeferredRsc(value) {
|
|
return value && typeof value === 'object' && value.tag === DEFERRED;
|
|
}
|
|
function createDeferredRsc() {
|
|
// Create an unresolved promise that represents data derived from a Flight
|
|
// response. The promise will be resolved later as soon as we start receiving
|
|
// data from the server, i.e. as soon as the Flight client decodes and returns
|
|
// the top-level response object.
|
|
// The `_debugInfo` field contains profiling information. Promises that are
|
|
// created by Flight already have this info added by React; for any derived
|
|
// promise created by the router, we need to transfer the Flight debug info
|
|
// onto the derived promise.
|
|
//
|
|
// The debug info represents the latency between the start of the navigation
|
|
// and the start of rendering. (It does not represent the time it takes for
|
|
// whole stream to finish.)
|
|
const debugInfo = [];
|
|
let resolve;
|
|
let reject;
|
|
const pendingRsc = new Promise((res, rej)=>{
|
|
resolve = res;
|
|
reject = rej;
|
|
});
|
|
pendingRsc.status = 'pending';
|
|
pendingRsc.resolve = (value, responseDebugInfo)=>{
|
|
if (pendingRsc.status === 'pending') {
|
|
const fulfilledRsc = pendingRsc;
|
|
fulfilledRsc.status = 'fulfilled';
|
|
fulfilledRsc.value = value;
|
|
if (responseDebugInfo !== null) {
|
|
// Transfer the debug info to the derived promise.
|
|
debugInfo.push.apply(debugInfo, responseDebugInfo);
|
|
}
|
|
resolve(value);
|
|
}
|
|
};
|
|
pendingRsc.reject = (error, responseDebugInfo)=>{
|
|
if (pendingRsc.status === 'pending') {
|
|
const rejectedRsc = pendingRsc;
|
|
rejectedRsc.status = 'rejected';
|
|
rejectedRsc.reason = error;
|
|
if (responseDebugInfo !== null) {
|
|
// Transfer the debug info to the derived promise.
|
|
debugInfo.push.apply(debugInfo, responseDebugInfo);
|
|
}
|
|
reject(error);
|
|
}
|
|
};
|
|
pendingRsc.tag = DEFERRED;
|
|
pendingRsc._debugInfo = debugInfo;
|
|
return pendingRsc;
|
|
}
|
|
if ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') {
|
|
Object.defineProperty(exports.default, '__esModule', {
|
|
value: true
|
|
});
|
|
Object.assign(exports.default, exports);
|
|
module.exports = exports.default;
|
|
} //# sourceMappingURL=ppr-navigations.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/segment-cache/navigation.js [app-ssr] (ecmascript)", ((__turbopack_context__, module, exports) => {
|
|
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
Object.defineProperty(exports, "navigate", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return navigate;
|
|
}
|
|
});
|
|
const _fetchserverresponse = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/router-reducer/fetch-server-response.js [app-ssr] (ecmascript)");
|
|
const _pprnavigations = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/router-reducer/ppr-navigations.js [app-ssr] (ecmascript)");
|
|
const _createhreffromurl = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/router-reducer/create-href-from-url.js [app-ssr] (ecmascript)");
|
|
const _cache = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/segment-cache/cache.js [app-ssr] (ecmascript)");
|
|
const _cachekey = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/segment-cache/cache-key.js [app-ssr] (ecmascript)");
|
|
const _segment = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/shared/lib/segment.js [app-ssr] (ecmascript)");
|
|
const _types = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/segment-cache/types.js [app-ssr] (ecmascript)");
|
|
function navigate(url, currentUrl, currentCacheNode, currentFlightRouterState, nextUrl, shouldScroll, accumulation) {
|
|
const now = Date.now();
|
|
const href = url.href;
|
|
// We special case navigations to the exact same URL as the current location.
|
|
// It's a common UI pattern for apps to refresh when you click a link to the
|
|
// current page. So when this happens, we refresh the dynamic data in the page
|
|
// segments.
|
|
//
|
|
// Note that this does not apply if the any part of the hash or search query
|
|
// has changed. This might feel a bit weird but it makes more sense when you
|
|
// consider that the way to trigger this behavior is to click the same link
|
|
// multiple times.
|
|
//
|
|
// TODO: We should probably refresh the *entire* route when this case occurs,
|
|
// not just the page segments. Essentially treating it the same as a refresh()
|
|
// triggered by an action, which is the more explicit way of modeling the UI
|
|
// pattern described above.
|
|
//
|
|
// Also note that this only refreshes the dynamic data, not static/ cached
|
|
// data. If the page segment is fully static and prefetched, the request is
|
|
// skipped. (This is also how refresh() works.)
|
|
const isSamePageNavigation = // consider storing the current URL in the router state instead of reading
|
|
// from the location object. In practice I don't think this matters much
|
|
// since we keep them in sync anyway, but having two sources of truth can
|
|
// lead to subtle bugs and race conditions.
|
|
href === window.location.href;
|
|
const cacheKey = (0, _cachekey.createCacheKey)(href, nextUrl);
|
|
const route = (0, _cache.readRouteCacheEntry)(now, cacheKey);
|
|
if (route !== null && route.status === _cache.EntryStatus.Fulfilled) {
|
|
// We have a matching prefetch.
|
|
const snapshot = readRenderSnapshotFromCache(now, route, route.tree);
|
|
const prefetchFlightRouterState = snapshot.flightRouterState;
|
|
const prefetchSeedData = snapshot.seedData;
|
|
const headSnapshot = readHeadSnapshotFromCache(now, route);
|
|
const prefetchHead = headSnapshot.rsc;
|
|
const isPrefetchHeadPartial = headSnapshot.isPartial;
|
|
// TODO: The "canonicalUrl" stored in the cache doesn't include the hash,
|
|
// because hash entries do not vary by hash fragment. However, the one
|
|
// we set in the router state *does* include the hash, and it's used to
|
|
// sync with the actual browser location. To make this less of a refactor
|
|
// hazard, we should always track the hash separately from the rest of
|
|
// the URL.
|
|
const newCanonicalUrl = route.canonicalUrl + url.hash;
|
|
const renderedSearch = route.renderedSearch;
|
|
return navigateUsingPrefetchedRouteTree(now, url, currentUrl, nextUrl, isSamePageNavigation, currentCacheNode, currentFlightRouterState, prefetchFlightRouterState, prefetchSeedData, prefetchHead, isPrefetchHeadPartial, newCanonicalUrl, renderedSearch, shouldScroll, url.hash);
|
|
}
|
|
// There was no matching route tree in the cache. Let's see if we can
|
|
// construct an "optimistic" route tree.
|
|
//
|
|
// Do not construct an optimistic route tree if there was a cache hit, but
|
|
// the entry has a rejected status, since it may have been rejected due to a
|
|
// rewrite or redirect based on the search params.
|
|
//
|
|
// TODO: There are multiple reasons a prefetch might be rejected; we should
|
|
// track them explicitly and choose what to do here based on that.
|
|
if (route === null || route.status !== _cache.EntryStatus.Rejected) {
|
|
const optimisticRoute = (0, _cache.requestOptimisticRouteCacheEntry)(now, url, nextUrl);
|
|
if (optimisticRoute !== null) {
|
|
// We have an optimistic route tree. Proceed with the normal flow.
|
|
const snapshot = readRenderSnapshotFromCache(now, optimisticRoute, optimisticRoute.tree);
|
|
const prefetchFlightRouterState = snapshot.flightRouterState;
|
|
const prefetchSeedData = snapshot.seedData;
|
|
const headSnapshot = readHeadSnapshotFromCache(now, optimisticRoute);
|
|
const prefetchHead = headSnapshot.rsc;
|
|
const isPrefetchHeadPartial = headSnapshot.isPartial;
|
|
const newCanonicalUrl = optimisticRoute.canonicalUrl + url.hash;
|
|
const newRenderedSearch = optimisticRoute.renderedSearch;
|
|
return navigateUsingPrefetchedRouteTree(now, url, currentUrl, nextUrl, isSamePageNavigation, currentCacheNode, currentFlightRouterState, prefetchFlightRouterState, prefetchSeedData, prefetchHead, isPrefetchHeadPartial, newCanonicalUrl, newRenderedSearch, shouldScroll, url.hash);
|
|
}
|
|
}
|
|
// There's no matching prefetch for this route in the cache.
|
|
let collectedDebugInfo = accumulation.collectedDebugInfo ?? [];
|
|
if (accumulation.collectedDebugInfo === undefined) {
|
|
collectedDebugInfo = accumulation.collectedDebugInfo = [];
|
|
}
|
|
return {
|
|
tag: _types.NavigationResultTag.Async,
|
|
data: navigateDynamicallyWithNoPrefetch(now, url, currentUrl, nextUrl, isSamePageNavigation, currentCacheNode, currentFlightRouterState, shouldScroll, url.hash, collectedDebugInfo)
|
|
};
|
|
}
|
|
function navigateUsingPrefetchedRouteTree(now, url, currentUrl, nextUrl, isSamePageNavigation, currentCacheNode, currentFlightRouterState, prefetchFlightRouterState, prefetchSeedData, prefetchHead, isPrefetchHeadPartial, canonicalUrl, renderedSearch, shouldScroll, hash) {
|
|
// Recursively construct a prefetch tree by reading from the Segment Cache. To
|
|
// maintain compatibility, we output the same data structures as the old
|
|
// prefetching implementation: FlightRouterState and CacheNodeSeedData.
|
|
// TODO: Eventually updateCacheNodeOnNavigation (or the equivalent) should
|
|
// read from the Segment Cache directly. It's only structured this way for now
|
|
// so we can share code with the old prefetching implementation.
|
|
const scrollableSegments = [];
|
|
const task = (0, _pprnavigations.startPPRNavigation)(now, currentUrl, currentCacheNode, currentFlightRouterState, prefetchFlightRouterState, prefetchSeedData, prefetchHead, isPrefetchHeadPartial, isSamePageNavigation, scrollableSegments);
|
|
if (task !== null) {
|
|
const dynamicRequestTree = task.dynamicRequestTree;
|
|
if (dynamicRequestTree !== null) {
|
|
const promiseForDynamicServerResponse = (0, _fetchserverresponse.fetchServerResponse)(new URL(canonicalUrl, url.origin), {
|
|
flightRouterState: dynamicRequestTree,
|
|
nextUrl
|
|
});
|
|
(0, _pprnavigations.listenForDynamicRequest)(task, promiseForDynamicServerResponse);
|
|
} else {
|
|
// The prefetched tree does not contain dynamic holes — it's
|
|
// fully static. We can skip the dynamic request.
|
|
}
|
|
return navigationTaskToResult(task, currentCacheNode, canonicalUrl, renderedSearch, scrollableSegments, shouldScroll, hash);
|
|
}
|
|
// The server sent back an empty tree patch. There's nothing to update, except
|
|
// possibly the URL.
|
|
return {
|
|
tag: _types.NavigationResultTag.NoOp,
|
|
data: {
|
|
canonicalUrl,
|
|
shouldScroll
|
|
}
|
|
};
|
|
}
|
|
function navigationTaskToResult(task, currentCacheNode, canonicalUrl, renderedSearch, scrollableSegments, shouldScroll, hash) {
|
|
const flightRouterState = task.route;
|
|
if (flightRouterState === null) {
|
|
// When no router state is provided, it signals that we should perform an
|
|
// MPA navigation.
|
|
return {
|
|
tag: _types.NavigationResultTag.MPA,
|
|
data: canonicalUrl
|
|
};
|
|
}
|
|
const newCacheNode = task.node;
|
|
return {
|
|
tag: _types.NavigationResultTag.Success,
|
|
data: {
|
|
flightRouterState,
|
|
cacheNode: newCacheNode !== null ? newCacheNode : currentCacheNode,
|
|
canonicalUrl,
|
|
renderedSearch,
|
|
scrollableSegments,
|
|
shouldScroll,
|
|
hash
|
|
}
|
|
};
|
|
}
|
|
function readRenderSnapshotFromCache(now, route, tree) {
|
|
let childRouterStates = {};
|
|
let childSeedDatas = {};
|
|
const slots = tree.slots;
|
|
if (slots !== null) {
|
|
for(const parallelRouteKey in slots){
|
|
const childTree = slots[parallelRouteKey];
|
|
const childResult = readRenderSnapshotFromCache(now, route, childTree);
|
|
childRouterStates[parallelRouteKey] = childResult.flightRouterState;
|
|
childSeedDatas[parallelRouteKey] = childResult.seedData;
|
|
}
|
|
}
|
|
let rsc = null;
|
|
let loading = null;
|
|
let isPartial = true;
|
|
const segmentEntry = (0, _cache.readSegmentCacheEntry)(now, tree.varyPath);
|
|
if (segmentEntry !== null) {
|
|
switch(segmentEntry.status){
|
|
case _cache.EntryStatus.Fulfilled:
|
|
{
|
|
// Happy path: a cache hit
|
|
rsc = segmentEntry.rsc;
|
|
loading = segmentEntry.loading;
|
|
isPartial = segmentEntry.isPartial;
|
|
break;
|
|
}
|
|
case _cache.EntryStatus.Pending:
|
|
{
|
|
// We haven't received data for this segment yet, but there's already
|
|
// an in-progress request. Since it's extremely likely to arrive
|
|
// before the dynamic data response, we might as well use it.
|
|
const promiseForFulfilledEntry = (0, _cache.waitForSegmentCacheEntry)(segmentEntry);
|
|
rsc = promiseForFulfilledEntry.then((entry)=>entry !== null ? entry.rsc : null);
|
|
loading = promiseForFulfilledEntry.then((entry)=>entry !== null ? entry.loading : null);
|
|
// Since we don't know yet whether the segment is partial or fully
|
|
// static, we must assume it's partial; we can't skip the
|
|
// dynamic request.
|
|
isPartial = true;
|
|
break;
|
|
}
|
|
case _cache.EntryStatus.Empty:
|
|
case _cache.EntryStatus.Rejected:
|
|
break;
|
|
default:
|
|
segmentEntry;
|
|
}
|
|
}
|
|
// The navigation implementation expects the search params to be
|
|
// included in the segment. However, the Segment Cache tracks search
|
|
// params separately from the rest of the segment key. So we need to
|
|
// add them back here.
|
|
//
|
|
// See corresponding comment in convertFlightRouterStateToTree.
|
|
//
|
|
// TODO: What we should do instead is update the navigation diffing
|
|
// logic to compare search params explicitly. This is a temporary
|
|
// solution until more of the Segment Cache implementation has settled.
|
|
const segment = (0, _segment.addSearchParamsIfPageSegment)(tree.segment, Object.fromEntries(new URLSearchParams(route.renderedSearch)));
|
|
// We don't need this information in a render snapshot, so this can just be a placeholder.
|
|
const hasRuntimePrefetch = false;
|
|
return {
|
|
flightRouterState: [
|
|
segment,
|
|
childRouterStates,
|
|
null,
|
|
null,
|
|
tree.isRootLayout
|
|
],
|
|
seedData: [
|
|
rsc,
|
|
childSeedDatas,
|
|
loading,
|
|
isPartial,
|
|
hasRuntimePrefetch
|
|
]
|
|
};
|
|
}
|
|
function readHeadSnapshotFromCache(now, route) {
|
|
// Same as readRenderSnapshotFromCache, but for the head
|
|
let rsc = null;
|
|
let isPartial = true;
|
|
const segmentEntry = (0, _cache.readSegmentCacheEntry)(now, route.metadata.varyPath);
|
|
if (segmentEntry !== null) {
|
|
switch(segmentEntry.status){
|
|
case _cache.EntryStatus.Fulfilled:
|
|
{
|
|
rsc = segmentEntry.rsc;
|
|
isPartial = segmentEntry.isPartial;
|
|
break;
|
|
}
|
|
case _cache.EntryStatus.Pending:
|
|
{
|
|
const promiseForFulfilledEntry = (0, _cache.waitForSegmentCacheEntry)(segmentEntry);
|
|
rsc = promiseForFulfilledEntry.then((entry)=>entry !== null ? entry.rsc : null);
|
|
isPartial = true;
|
|
break;
|
|
}
|
|
case _cache.EntryStatus.Empty:
|
|
case _cache.EntryStatus.Rejected:
|
|
break;
|
|
default:
|
|
segmentEntry;
|
|
}
|
|
}
|
|
return {
|
|
rsc,
|
|
isPartial
|
|
};
|
|
}
|
|
async function navigateDynamicallyWithNoPrefetch(now, url, currentUrl, nextUrl, isSamePageNavigation, currentCacheNode, currentFlightRouterState, shouldScroll, hash, collectedDebugInfo) {
|
|
// Runs when a navigation happens but there's no cached prefetch we can use.
|
|
// Don't bother to wait for a prefetch response; go straight to a full
|
|
// navigation that contains both static and dynamic data in a single stream.
|
|
// (This is unlike the old navigation implementation, which instead blocks
|
|
// the dynamic request until a prefetch request is received.)
|
|
//
|
|
// To avoid duplication of logic, we're going to pretend that the tree
|
|
// returned by the dynamic request is, in fact, a prefetch tree. Then we can
|
|
// use the same server response to write the actual data into the CacheNode
|
|
// tree. So it's the same flow as the "happy path" (prefetch, then
|
|
// navigation), except we use a single server response for both stages.
|
|
const promiseForDynamicServerResponse = (0, _fetchserverresponse.fetchServerResponse)(url, {
|
|
flightRouterState: currentFlightRouterState,
|
|
nextUrl
|
|
});
|
|
const result = await promiseForDynamicServerResponse;
|
|
if (typeof result === 'string') {
|
|
// This is an MPA navigation.
|
|
const newUrl = result;
|
|
return {
|
|
tag: _types.NavigationResultTag.MPA,
|
|
data: newUrl
|
|
};
|
|
}
|
|
const { flightData, canonicalUrl, renderedSearch, debugInfo: debugInfoFromResponse } = result;
|
|
if (debugInfoFromResponse !== null) {
|
|
collectedDebugInfo.push(...debugInfoFromResponse);
|
|
}
|
|
// Since the response format of dynamic requests and prefetches is slightly
|
|
// different, we'll need to massage the data a bit. Create FlightRouterState
|
|
// tree that simulates what we'd receive as the result of a prefetch.
|
|
const prefetchFlightRouterState = simulatePrefetchTreeUsingDynamicTreePatch(currentFlightRouterState, flightData);
|
|
// In our simulated prefetch payload, we pretend that there's no seed data
|
|
// nor a prefetch head.
|
|
const prefetchSeedData = null;
|
|
const prefetchHead = null;
|
|
const isPrefetchHeadPartial = true;
|
|
// Now we proceed exactly as we would for normal navigation.
|
|
const scrollableSegments = [];
|
|
const task = (0, _pprnavigations.startPPRNavigation)(now, currentUrl, currentCacheNode, currentFlightRouterState, prefetchFlightRouterState, prefetchSeedData, prefetchHead, isPrefetchHeadPartial, isSamePageNavigation, scrollableSegments);
|
|
if (task !== null) {
|
|
// In this case, we've already sent the dynamic request, so we don't
|
|
// actually use the request tree created by `startPPRNavigation`,
|
|
// except to check if it contains dynamic holes.
|
|
//
|
|
// This is almost always true, but it could be false if all the segment data
|
|
// was present in the cache, but the route tree was not. E.g. navigating
|
|
// to a URL that was not prefetched but rewrites to a different URL
|
|
// that was.
|
|
const hasDynamicHoles = task.dynamicRequestTree !== null;
|
|
if (hasDynamicHoles) {
|
|
(0, _pprnavigations.listenForDynamicRequest)(task, promiseForDynamicServerResponse);
|
|
} else {
|
|
// The prefetched tree does not contain dynamic holes — it's
|
|
// fully static. We don't need to process the server response further.
|
|
}
|
|
return navigationTaskToResult(task, currentCacheNode, (0, _createhreffromurl.createHrefFromUrl)(canonicalUrl), renderedSearch, scrollableSegments, shouldScroll, hash);
|
|
}
|
|
// The server sent back an empty tree patch. There's nothing to update, except
|
|
// possibly the URL.
|
|
return {
|
|
tag: _types.NavigationResultTag.NoOp,
|
|
data: {
|
|
canonicalUrl: (0, _createhreffromurl.createHrefFromUrl)(canonicalUrl),
|
|
shouldScroll
|
|
}
|
|
};
|
|
}
|
|
function simulatePrefetchTreeUsingDynamicTreePatch(currentTree, flightData) {
|
|
// Takes the current FlightRouterState and applies the router state patch
|
|
// received from the server, to create a full FlightRouterState tree that we
|
|
// can pretend was returned by a prefetch.
|
|
//
|
|
// (It sounds similar to what applyRouterStatePatch does, but it doesn't need
|
|
// to handle stuff like interception routes or diffing since that will be
|
|
// handled later.)
|
|
let baseTree = currentTree;
|
|
for (const { segmentPath, tree: treePatch } of flightData){
|
|
// If the server sends us multiple tree patches, we only need to clone the
|
|
// base tree when applying the first patch. After the first patch, we can
|
|
// apply the remaining patches in place without copying.
|
|
const canMutateInPlace = baseTree !== currentTree;
|
|
baseTree = simulatePrefetchTreeUsingDynamicTreePatchImpl(baseTree, treePatch, segmentPath, canMutateInPlace, 0);
|
|
}
|
|
return baseTree;
|
|
}
|
|
function simulatePrefetchTreeUsingDynamicTreePatchImpl(baseRouterState, patch, segmentPath, canMutateInPlace, index) {
|
|
if (index === segmentPath.length) {
|
|
// We reached the part of the tree that we need to patch.
|
|
return patch;
|
|
}
|
|
// segmentPath represents the parent path of subtree. It's a repeating
|
|
// pattern of parallel route key and segment:
|
|
//
|
|
// [string, Segment, string, Segment, string, Segment, ...]
|
|
//
|
|
// This path tells us which part of the base tree to apply the tree patch.
|
|
//
|
|
// NOTE: In the case of a fully dynamic request with no prefetch, we receive
|
|
// the FlightRouterState patch in the same request as the dynamic data.
|
|
// Therefore we don't need to worry about diffing the segment values; we can
|
|
// assume the server sent us a correct result.
|
|
const updatedParallelRouteKey = segmentPath[index];
|
|
// const segment: Segment = segmentPath[index + 1] <-- Not used, see note above
|
|
const baseChildren = baseRouterState[1];
|
|
const newChildren = {};
|
|
for(const parallelRouteKey in baseChildren){
|
|
if (parallelRouteKey === updatedParallelRouteKey) {
|
|
const childBaseRouterState = baseChildren[parallelRouteKey];
|
|
newChildren[parallelRouteKey] = simulatePrefetchTreeUsingDynamicTreePatchImpl(childBaseRouterState, patch, segmentPath, canMutateInPlace, // the end of the segment path.
|
|
index + 2);
|
|
} else {
|
|
// This child is not being patched. Copy it over as-is.
|
|
newChildren[parallelRouteKey] = baseChildren[parallelRouteKey];
|
|
}
|
|
}
|
|
if (canMutateInPlace) {
|
|
// We can mutate the base tree in place, because the base tree is already
|
|
// a clone.
|
|
baseRouterState[1] = newChildren;
|
|
return baseRouterState;
|
|
}
|
|
// Clone all the fields except the children.
|
|
//
|
|
// Based on equivalent logic in apply-router-state-patch-to-tree, but should
|
|
// confirm whether we need to copy all of these fields. Not sure the server
|
|
// ever sends, e.g. the refetch marker.
|
|
const clone = [
|
|
baseRouterState[0],
|
|
newChildren
|
|
];
|
|
if (2 in baseRouterState) {
|
|
clone[2] = baseRouterState[2];
|
|
}
|
|
if (3 in baseRouterState) {
|
|
clone[3] = baseRouterState[3];
|
|
}
|
|
if (4 in baseRouterState) {
|
|
clone[4] = baseRouterState[4];
|
|
}
|
|
return clone;
|
|
}
|
|
if ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') {
|
|
Object.defineProperty(exports.default, '__esModule', {
|
|
value: true
|
|
});
|
|
Object.assign(exports.default, exports);
|
|
module.exports = exports.default;
|
|
} //# sourceMappingURL=navigation.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/router-reducer/reducers/navigate-reducer.js [app-ssr] (ecmascript)", ((__turbopack_context__, module, exports) => {
|
|
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
0 && (module.exports = {
|
|
DYNAMIC_STALETIME_MS: null,
|
|
STATIC_STALETIME_MS: null,
|
|
generateSegmentsFromPatch: null,
|
|
handleExternalUrl: null,
|
|
navigateReducer: null
|
|
});
|
|
function _export(target, all) {
|
|
for(var name in all)Object.defineProperty(target, name, {
|
|
enumerable: true,
|
|
get: all[name]
|
|
});
|
|
}
|
|
_export(exports, {
|
|
DYNAMIC_STALETIME_MS: function() {
|
|
return DYNAMIC_STALETIME_MS;
|
|
},
|
|
STATIC_STALETIME_MS: function() {
|
|
return STATIC_STALETIME_MS;
|
|
},
|
|
generateSegmentsFromPatch: function() {
|
|
return generateSegmentsFromPatch;
|
|
},
|
|
handleExternalUrl: function() {
|
|
return handleExternalUrl;
|
|
},
|
|
navigateReducer: function() {
|
|
return navigateReducer;
|
|
}
|
|
});
|
|
const _createhreffromurl = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/router-reducer/create-href-from-url.js [app-ssr] (ecmascript)");
|
|
const _handlemutable = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/router-reducer/handle-mutable.js [app-ssr] (ecmascript)");
|
|
const _navigation = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/segment-cache/navigation.js [app-ssr] (ecmascript)");
|
|
const _types = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/segment-cache/types.js [app-ssr] (ecmascript)");
|
|
const _cache = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/segment-cache/cache.js [app-ssr] (ecmascript)");
|
|
const DYNAMIC_STALETIME_MS = Number(("TURBOPACK compile-time value", "0")) * 1000;
|
|
const STATIC_STALETIME_MS = (0, _cache.getStaleTimeMs)(Number(("TURBOPACK compile-time value", "300")));
|
|
function handleExternalUrl(state, mutable, url, pendingPush) {
|
|
mutable.mpaNavigation = true;
|
|
mutable.canonicalUrl = url;
|
|
mutable.pendingPush = pendingPush;
|
|
mutable.scrollableSegments = undefined;
|
|
return (0, _handlemutable.handleMutable)(state, mutable);
|
|
}
|
|
function generateSegmentsFromPatch(flightRouterPatch) {
|
|
const segments = [];
|
|
const [segment, parallelRoutes] = flightRouterPatch;
|
|
if (Object.keys(parallelRoutes).length === 0) {
|
|
return [
|
|
[
|
|
segment
|
|
]
|
|
];
|
|
}
|
|
for (const [parallelRouteKey, parallelRoute] of Object.entries(parallelRoutes)){
|
|
for (const childSegment of generateSegmentsFromPatch(parallelRoute)){
|
|
// If the segment is empty, it means we are at the root of the tree
|
|
if (segment === '') {
|
|
segments.push([
|
|
parallelRouteKey,
|
|
...childSegment
|
|
]);
|
|
} else {
|
|
segments.push([
|
|
segment,
|
|
parallelRouteKey,
|
|
...childSegment
|
|
]);
|
|
}
|
|
}
|
|
}
|
|
return segments;
|
|
}
|
|
function handleNavigationResult(url, state, mutable, pendingPush, result) {
|
|
switch(result.tag){
|
|
case _types.NavigationResultTag.MPA:
|
|
{
|
|
// Perform an MPA navigation.
|
|
const newUrl = result.data;
|
|
return handleExternalUrl(state, mutable, newUrl, pendingPush);
|
|
}
|
|
case _types.NavigationResultTag.NoOp:
|
|
{
|
|
// The server responded with no change to the current page. However, if
|
|
// the URL changed, we still need to update that.
|
|
const newCanonicalUrl = result.data.canonicalUrl;
|
|
mutable.canonicalUrl = newCanonicalUrl;
|
|
// Check if the only thing that changed was the hash fragment.
|
|
const oldUrl = new URL(state.canonicalUrl, url);
|
|
const onlyHashChange = // navigations are always same-origin.
|
|
url.pathname === oldUrl.pathname && url.search === oldUrl.search && url.hash !== oldUrl.hash;
|
|
if (onlyHashChange) {
|
|
// The only updated part of the URL is the hash.
|
|
mutable.onlyHashChange = true;
|
|
mutable.shouldScroll = result.data.shouldScroll;
|
|
mutable.hashFragment = url.hash;
|
|
// Setting this to an empty array triggers a scroll for all new and
|
|
// updated segments. See `ScrollAndFocusHandler` for more details.
|
|
mutable.scrollableSegments = [];
|
|
}
|
|
return (0, _handlemutable.handleMutable)(state, mutable);
|
|
}
|
|
case _types.NavigationResultTag.Success:
|
|
{
|
|
// Received a new result.
|
|
mutable.cache = result.data.cacheNode;
|
|
mutable.patchedTree = result.data.flightRouterState;
|
|
mutable.renderedSearch = result.data.renderedSearch;
|
|
mutable.canonicalUrl = result.data.canonicalUrl;
|
|
mutable.scrollableSegments = result.data.scrollableSegments;
|
|
mutable.shouldScroll = result.data.shouldScroll;
|
|
mutable.hashFragment = result.data.hash;
|
|
return (0, _handlemutable.handleMutable)(state, mutable);
|
|
}
|
|
case _types.NavigationResultTag.Async:
|
|
{
|
|
return result.data.then((asyncResult)=>handleNavigationResult(url, state, mutable, pendingPush, asyncResult), // TODO: This matches the current behavior but we need to do something
|
|
// better here if the network fails.
|
|
()=>{
|
|
return state;
|
|
});
|
|
}
|
|
default:
|
|
{
|
|
result;
|
|
return state;
|
|
}
|
|
}
|
|
}
|
|
function navigateReducer(state, action) {
|
|
const { url, isExternalUrl, navigateType, shouldScroll } = action;
|
|
const mutable = {};
|
|
const href = (0, _createhreffromurl.createHrefFromUrl)(url);
|
|
const pendingPush = navigateType === 'push';
|
|
mutable.preserveCustomHistoryState = false;
|
|
mutable.pendingPush = pendingPush;
|
|
if (isExternalUrl) {
|
|
return handleExternalUrl(state, mutable, url.toString(), pendingPush);
|
|
}
|
|
// Handles case where `<meta http-equiv="refresh">` tag is present,
|
|
// which will trigger an MPA navigation.
|
|
if (document.getElementById('__next-page-redirect')) {
|
|
return handleExternalUrl(state, mutable, href, pendingPush);
|
|
}
|
|
// Temporary glue code between the router reducer and the new navigation
|
|
// implementation. Eventually we'll rewrite the router reducer to a
|
|
// state machine.
|
|
const currentUrl = new URL(state.canonicalUrl, location.origin);
|
|
const result = (0, _navigation.navigate)(url, currentUrl, state.cache, state.tree, state.nextUrl, shouldScroll, mutable);
|
|
return handleNavigationResult(url, state, mutable, pendingPush, result);
|
|
}
|
|
if ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') {
|
|
Object.defineProperty(exports.default, '__esModule', {
|
|
value: true
|
|
});
|
|
Object.assign(exports.default, exports);
|
|
module.exports = exports.default;
|
|
} //# sourceMappingURL=navigate-reducer.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/shared/lib/segment-cache/output-export-prefetch-encoding.js [app-ssr] (ecmascript)", ((__turbopack_context__, module, exports) => {
|
|
"use strict";
|
|
|
|
// In output: export mode, the build id is added to the start of the HTML
|
|
// document, directly after the doctype declaration. During a prefetch, the
|
|
// client performs a range request to get the build id, so it can check whether
|
|
// the target page belongs to the same build.
|
|
//
|
|
// The first 64 bytes of the document are requested. The exact number isn't
|
|
// too important; it must be larger than the build id + doctype + closing and
|
|
// ending comment markers, but it doesn't need to match the end of the
|
|
// comment exactly.
|
|
//
|
|
// Build ids are 21 bytes long in the default implementation, though this
|
|
// can be overridden in the Next.js config. For the purposes of this check,
|
|
// it's OK to only match the start of the id, so we'll truncate it if exceeds
|
|
// a certain length.
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
0 && (module.exports = {
|
|
DOC_PREFETCH_RANGE_HEADER_VALUE: null,
|
|
doesExportedHtmlMatchBuildId: null,
|
|
insertBuildIdComment: null
|
|
});
|
|
function _export(target, all) {
|
|
for(var name in all)Object.defineProperty(target, name, {
|
|
enumerable: true,
|
|
get: all[name]
|
|
});
|
|
}
|
|
_export(exports, {
|
|
DOC_PREFETCH_RANGE_HEADER_VALUE: function() {
|
|
return DOC_PREFETCH_RANGE_HEADER_VALUE;
|
|
},
|
|
doesExportedHtmlMatchBuildId: function() {
|
|
return doesExportedHtmlMatchBuildId;
|
|
},
|
|
insertBuildIdComment: function() {
|
|
return insertBuildIdComment;
|
|
}
|
|
});
|
|
const DOCTYPE_PREFIX = '<!DOCTYPE html>' // 15 bytes
|
|
;
|
|
const MAX_BUILD_ID_LENGTH = 24;
|
|
const DOC_PREFETCH_RANGE_HEADER_VALUE = 'bytes=0-63';
|
|
function escapeBuildId(buildId) {
|
|
// If the build id is longer than the given limit, it's OK for our purposes
|
|
// to only match the beginning.
|
|
const truncated = buildId.slice(0, MAX_BUILD_ID_LENGTH);
|
|
// Replace hyphens with underscores so it doesn't break the HTML comment.
|
|
// (Unlikely, but if this did happen it would break the whole document.)
|
|
return truncated.replace(/-/g, '_');
|
|
}
|
|
function insertBuildIdComment(originalHtml, buildId) {
|
|
if (buildId.includes('-->') || // React always inserts a doctype at the start of the document. Skip if it
|
|
// isn't present. Shouldn't happen; suggests an issue elsewhere.
|
|
!originalHtml.startsWith(DOCTYPE_PREFIX)) {
|
|
// Return the original HTML unchanged. This means the document will not
|
|
// be prefetched.
|
|
// TODO: The build id comment is currently only used during prefetches, but
|
|
// if we eventually use this mechanism for regular navigations, we may need
|
|
// to error during build if we fail to insert it for some reason.
|
|
return originalHtml;
|
|
}
|
|
// The comment must be inserted after the doctype.
|
|
return originalHtml.replace(DOCTYPE_PREFIX, DOCTYPE_PREFIX + '<!--' + escapeBuildId(buildId) + '-->');
|
|
}
|
|
function doesExportedHtmlMatchBuildId(partialHtmlDocument, buildId) {
|
|
// Check whether the document starts with the expected buildId.
|
|
return partialHtmlDocument.startsWith(DOCTYPE_PREFIX + '<!--' + escapeBuildId(buildId) + '-->');
|
|
} //# sourceMappingURL=output-export-prefetch-encoding.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/segment-cache/cache.js [app-ssr] (ecmascript)", ((__turbopack_context__, module, exports) => {
|
|
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
0 && (module.exports = {
|
|
EntryStatus: null,
|
|
canNewFetchStrategyProvideMoreContent: null,
|
|
convertRouteTreeToFlightRouterState: null,
|
|
createDetachedSegmentCacheEntry: null,
|
|
fetchRouteOnCacheMiss: null,
|
|
fetchSegmentOnCacheMiss: null,
|
|
fetchSegmentPrefetchesUsingDynamicRequest: null,
|
|
getCurrentCacheVersion: null,
|
|
getStaleTimeMs: null,
|
|
overwriteRevalidatingSegmentCacheEntry: null,
|
|
pingInvalidationListeners: null,
|
|
readOrCreateRevalidatingSegmentEntry: null,
|
|
readOrCreateRouteCacheEntry: null,
|
|
readOrCreateSegmentCacheEntry: null,
|
|
readRouteCacheEntry: null,
|
|
readSegmentCacheEntry: null,
|
|
requestOptimisticRouteCacheEntry: null,
|
|
revalidateEntireCache: null,
|
|
upgradeToPendingSegment: null,
|
|
upsertSegmentEntry: null,
|
|
waitForSegmentCacheEntry: null
|
|
});
|
|
function _export(target, all) {
|
|
for(var name in all)Object.defineProperty(target, name, {
|
|
enumerable: true,
|
|
get: all[name]
|
|
});
|
|
}
|
|
_export(exports, {
|
|
EntryStatus: function() {
|
|
return EntryStatus;
|
|
},
|
|
canNewFetchStrategyProvideMoreContent: function() {
|
|
return canNewFetchStrategyProvideMoreContent;
|
|
},
|
|
convertRouteTreeToFlightRouterState: function() {
|
|
return convertRouteTreeToFlightRouterState;
|
|
},
|
|
createDetachedSegmentCacheEntry: function() {
|
|
return createDetachedSegmentCacheEntry;
|
|
},
|
|
fetchRouteOnCacheMiss: function() {
|
|
return fetchRouteOnCacheMiss;
|
|
},
|
|
fetchSegmentOnCacheMiss: function() {
|
|
return fetchSegmentOnCacheMiss;
|
|
},
|
|
fetchSegmentPrefetchesUsingDynamicRequest: function() {
|
|
return fetchSegmentPrefetchesUsingDynamicRequest;
|
|
},
|
|
getCurrentCacheVersion: function() {
|
|
return getCurrentCacheVersion;
|
|
},
|
|
getStaleTimeMs: function() {
|
|
return getStaleTimeMs;
|
|
},
|
|
overwriteRevalidatingSegmentCacheEntry: function() {
|
|
return overwriteRevalidatingSegmentCacheEntry;
|
|
},
|
|
pingInvalidationListeners: function() {
|
|
return pingInvalidationListeners;
|
|
},
|
|
readOrCreateRevalidatingSegmentEntry: function() {
|
|
return readOrCreateRevalidatingSegmentEntry;
|
|
},
|
|
readOrCreateRouteCacheEntry: function() {
|
|
return readOrCreateRouteCacheEntry;
|
|
},
|
|
readOrCreateSegmentCacheEntry: function() {
|
|
return readOrCreateSegmentCacheEntry;
|
|
},
|
|
readRouteCacheEntry: function() {
|
|
return readRouteCacheEntry;
|
|
},
|
|
readSegmentCacheEntry: function() {
|
|
return readSegmentCacheEntry;
|
|
},
|
|
requestOptimisticRouteCacheEntry: function() {
|
|
return requestOptimisticRouteCacheEntry;
|
|
},
|
|
revalidateEntireCache: function() {
|
|
return revalidateEntireCache;
|
|
},
|
|
upgradeToPendingSegment: function() {
|
|
return upgradeToPendingSegment;
|
|
},
|
|
upsertSegmentEntry: function() {
|
|
return upsertSegmentEntry;
|
|
},
|
|
waitForSegmentCacheEntry: function() {
|
|
return waitForSegmentCacheEntry;
|
|
}
|
|
});
|
|
const _approutertypes = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/shared/lib/app-router-types.js [app-ssr] (ecmascript)");
|
|
const _approuterheaders = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/app-router-headers.js [app-ssr] (ecmascript)");
|
|
const _fetchserverresponse = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/router-reducer/fetch-server-response.js [app-ssr] (ecmascript)");
|
|
const _scheduler = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/segment-cache/scheduler.js [app-ssr] (ecmascript)");
|
|
const _varypath = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/segment-cache/vary-path.js [app-ssr] (ecmascript)");
|
|
const _appbuildid = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/app-build-id.js [app-ssr] (ecmascript)");
|
|
const _createhreffromurl = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/router-reducer/create-href-from-url.js [app-ssr] (ecmascript)");
|
|
const _cachekey = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/segment-cache/cache-key.js [app-ssr] (ecmascript)");
|
|
const _routeparams = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/route-params.js [app-ssr] (ecmascript)");
|
|
const _cachemap = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/segment-cache/cache-map.js [app-ssr] (ecmascript)");
|
|
const _segmentvalueencoding = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/shared/lib/segment-cache/segment-value-encoding.js [app-ssr] (ecmascript)");
|
|
const _flightdatahelpers = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/flight-data-helpers.js [app-ssr] (ecmascript)");
|
|
const _navigatereducer = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/router-reducer/reducers/navigate-reducer.js [app-ssr] (ecmascript)");
|
|
const _links = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/links.js [app-ssr] (ecmascript)");
|
|
const _segment = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/shared/lib/segment.js [app-ssr] (ecmascript)");
|
|
const _outputexportprefetchencoding = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/shared/lib/segment-cache/output-export-prefetch-encoding.js [app-ssr] (ecmascript)");
|
|
const _types = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/segment-cache/types.js [app-ssr] (ecmascript)");
|
|
const _promisewithresolvers = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/shared/lib/promise-with-resolvers.js [app-ssr] (ecmascript)");
|
|
function getStaleTimeMs(staleTimeSeconds) {
|
|
return Math.max(staleTimeSeconds, 30) * 1000;
|
|
}
|
|
var EntryStatus = /*#__PURE__*/ function(EntryStatus) {
|
|
EntryStatus[EntryStatus["Empty"] = 0] = "Empty";
|
|
EntryStatus[EntryStatus["Pending"] = 1] = "Pending";
|
|
EntryStatus[EntryStatus["Fulfilled"] = 2] = "Fulfilled";
|
|
EntryStatus[EntryStatus["Rejected"] = 3] = "Rejected";
|
|
return EntryStatus;
|
|
}({});
|
|
const isOutputExportMode = ("TURBOPACK compile-time value", "development") === 'production' && ("TURBOPACK compile-time value", void 0) === 'export';
|
|
const MetadataOnlyRequestTree = [
|
|
'',
|
|
{},
|
|
null,
|
|
'metadata-only'
|
|
];
|
|
let routeCacheMap = (0, _cachemap.createCacheMap)();
|
|
let segmentCacheMap = (0, _cachemap.createCacheMap)();
|
|
// All invalidation listeners for the whole cache are tracked in single set.
|
|
// Since we don't yet support tag or path-based invalidation, there's no point
|
|
// tracking them any more granularly than this. Once we add granular
|
|
// invalidation, that may change, though generally the model is to just notify
|
|
// the listeners and allow the caller to poll the prefetch cache with a new
|
|
// prefetch task if desired.
|
|
let invalidationListeners = null;
|
|
// Incrementing counter used to track cache invalidations.
|
|
let currentCacheVersion = 0;
|
|
function getCurrentCacheVersion() {
|
|
return currentCacheVersion;
|
|
}
|
|
function revalidateEntireCache(nextUrl, tree) {
|
|
// Increment the current cache version. This does not eagerly evict anything
|
|
// from the cache, but because all the entries are versioned, and we check
|
|
// the version when reading from the cache, this effectively causes all
|
|
// entries to be evicted lazily. We do it lazily because in the future,
|
|
// actions like revalidateTag or refresh will not evict the entire cache,
|
|
// but rather some subset of the entries.
|
|
currentCacheVersion++;
|
|
// Start a cooldown before re-prefetching to allow CDN cache propagation.
|
|
(0, _scheduler.startRevalidationCooldown)();
|
|
// Prefetch all the currently visible links again, to re-fill the cache.
|
|
(0, _links.pingVisibleLinks)(nextUrl, tree);
|
|
// Similarly, notify all invalidation listeners (i.e. those passed to
|
|
// `router.prefetch(onInvalidate)`), so they can trigger a new prefetch
|
|
// if needed.
|
|
pingInvalidationListeners(nextUrl, tree);
|
|
}
|
|
function attachInvalidationListener(task) {
|
|
// This function is called whenever a prefetch task reads a cache entry. If
|
|
// the task has an onInvalidate function associated with it — i.e. the one
|
|
// optionally passed to router.prefetch(onInvalidate) — then we attach that
|
|
// listener to the every cache entry that the task reads. Then, if an entry
|
|
// is invalidated, we call the function.
|
|
if (task.onInvalidate !== null) {
|
|
if (invalidationListeners === null) {
|
|
invalidationListeners = new Set([
|
|
task
|
|
]);
|
|
} else {
|
|
invalidationListeners.add(task);
|
|
}
|
|
}
|
|
}
|
|
function notifyInvalidationListener(task) {
|
|
const onInvalidate = task.onInvalidate;
|
|
if (onInvalidate !== null) {
|
|
// Clear the callback from the task object to guarantee it's not called more
|
|
// than once.
|
|
task.onInvalidate = null;
|
|
// This is a user-space function, so we must wrap in try/catch.
|
|
try {
|
|
onInvalidate();
|
|
} catch (error) {
|
|
if (typeof reportError === 'function') {
|
|
reportError(error);
|
|
} else {
|
|
console.error(error);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function pingInvalidationListeners(nextUrl, tree) {
|
|
// The rough equivalent of pingVisibleLinks, but for onInvalidate callbacks.
|
|
// This is called when the Next-Url or the base tree changes, since those
|
|
// may affect the result of a prefetch task. It's also called after a
|
|
// cache invalidation.
|
|
if (invalidationListeners !== null) {
|
|
const tasks = invalidationListeners;
|
|
invalidationListeners = null;
|
|
for (const task of tasks){
|
|
if ((0, _scheduler.isPrefetchTaskDirty)(task, nextUrl, tree)) {
|
|
notifyInvalidationListener(task);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function readRouteCacheEntry(now, key) {
|
|
const varyPath = (0, _varypath.getRouteVaryPath)(key.pathname, key.search, key.nextUrl);
|
|
const isRevalidation = false;
|
|
return (0, _cachemap.getFromCacheMap)(now, getCurrentCacheVersion(), routeCacheMap, varyPath, isRevalidation);
|
|
}
|
|
function readSegmentCacheEntry(now, varyPath) {
|
|
const isRevalidation = false;
|
|
return (0, _cachemap.getFromCacheMap)(now, getCurrentCacheVersion(), segmentCacheMap, varyPath, isRevalidation);
|
|
}
|
|
function readRevalidatingSegmentCacheEntry(now, varyPath) {
|
|
const isRevalidation = true;
|
|
return (0, _cachemap.getFromCacheMap)(now, getCurrentCacheVersion(), segmentCacheMap, varyPath, isRevalidation);
|
|
}
|
|
function waitForSegmentCacheEntry(pendingEntry) {
|
|
// Because the entry is pending, there's already a in-progress request.
|
|
// Attach a promise to the entry that will resolve when the server responds.
|
|
let promiseWithResolvers = pendingEntry.promise;
|
|
if (promiseWithResolvers === null) {
|
|
promiseWithResolvers = pendingEntry.promise = (0, _promisewithresolvers.createPromiseWithResolvers)();
|
|
} else {
|
|
// There's already a promise we can use
|
|
}
|
|
return promiseWithResolvers.promise;
|
|
}
|
|
function readOrCreateRouteCacheEntry(now, task, key) {
|
|
attachInvalidationListener(task);
|
|
const existingEntry = readRouteCacheEntry(now, key);
|
|
if (existingEntry !== null) {
|
|
return existingEntry;
|
|
}
|
|
// Create a pending entry and add it to the cache.
|
|
const pendingEntry = {
|
|
canonicalUrl: null,
|
|
status: 0,
|
|
blockedTasks: null,
|
|
tree: null,
|
|
metadata: null,
|
|
// This is initialized to true because we don't know yet whether the route
|
|
// could be intercepted. It's only set to false once we receive a response
|
|
// from the server.
|
|
couldBeIntercepted: true,
|
|
// Similarly, we don't yet know if the route supports PPR.
|
|
isPPREnabled: false,
|
|
renderedSearch: null,
|
|
// Map-related fields
|
|
ref: null,
|
|
size: 0,
|
|
// Since this is an empty entry, there's no reason to ever evict it. It will
|
|
// be updated when the data is populated.
|
|
staleAt: Infinity,
|
|
version: getCurrentCacheVersion()
|
|
};
|
|
const varyPath = (0, _varypath.getRouteVaryPath)(key.pathname, key.search, key.nextUrl);
|
|
const isRevalidation = false;
|
|
(0, _cachemap.setInCacheMap)(routeCacheMap, varyPath, pendingEntry, isRevalidation);
|
|
return pendingEntry;
|
|
}
|
|
function requestOptimisticRouteCacheEntry(now, requestedUrl, nextUrl) {
|
|
// This function is called during a navigation when there was no matching
|
|
// route tree in the prefetch cache. Before de-opting to a blocking,
|
|
// unprefetched navigation, we will first attempt to construct an "optimistic"
|
|
// route tree by checking the cache for similar routes.
|
|
//
|
|
// Check if there's a route with the same pathname, but with different
|
|
// search params. We can then base our optimistic route tree on this entry.
|
|
//
|
|
// Conceptually, we are simulating what would happen if we did perform a
|
|
// prefetch the requested URL, under the assumption that the server will
|
|
// not redirect or rewrite the request in a different manner than the
|
|
// base route tree. This assumption might not hold, in which case we'll have
|
|
// to recover when we perform the dynamic navigation request. However, this
|
|
// is what would happen if a route were dynamically rewritten/redirected
|
|
// in between the prefetch and the navigation. So the logic needs to exist
|
|
// to handle this case regardless.
|
|
// Look for a route with the same pathname, but with an empty search string.
|
|
// TODO: There's nothing inherently special about the empty search string;
|
|
// it's chosen somewhat arbitrarily, with the rationale that it's the most
|
|
// likely one to exist. But we should update this to match _any_ search
|
|
// string. The plan is to generalize this logic alongside other improvements
|
|
// related to "fallback" cache entries.
|
|
const requestedSearch = requestedUrl.search;
|
|
if (requestedSearch === '') {
|
|
// The caller would have already checked if a route with an empty search
|
|
// string is in the cache. So we can bail out here.
|
|
return null;
|
|
}
|
|
const urlWithoutSearchParams = new URL(requestedUrl);
|
|
urlWithoutSearchParams.search = '';
|
|
const routeWithNoSearchParams = readRouteCacheEntry(now, (0, _cachekey.createCacheKey)(urlWithoutSearchParams.href, nextUrl));
|
|
if (routeWithNoSearchParams === null || routeWithNoSearchParams.status !== 2) {
|
|
// Bail out of constructing an optimistic route tree. This will result in
|
|
// a blocking, unprefetched navigation.
|
|
return null;
|
|
}
|
|
// Now we have a base route tree we can "patch" with our optimistic values.
|
|
// Optimistically assume that redirects for the requested pathname do
|
|
// not vary on the search string. Therefore, if the base route was
|
|
// redirected to a different search string, then the optimistic route
|
|
// should be redirected to the same search string. Otherwise, we use
|
|
// the requested search string.
|
|
const canonicalUrlForRouteWithNoSearchParams = new URL(routeWithNoSearchParams.canonicalUrl, requestedUrl.origin);
|
|
const optimisticCanonicalSearch = canonicalUrlForRouteWithNoSearchParams.search !== '' ? canonicalUrlForRouteWithNoSearchParams.search : requestedSearch;
|
|
// Similarly, optimistically assume that rewrites for the requested
|
|
// pathname do not vary on the search string. Therefore, if the base
|
|
// route was rewritten to a different search string, then the optimistic
|
|
// route should be rewritten to the same search string. Otherwise, we use
|
|
// the requested search string.
|
|
const optimisticRenderedSearch = routeWithNoSearchParams.renderedSearch !== '' ? routeWithNoSearchParams.renderedSearch : requestedSearch;
|
|
const optimisticUrl = new URL(routeWithNoSearchParams.canonicalUrl, location.origin);
|
|
optimisticUrl.search = optimisticCanonicalSearch;
|
|
const optimisticCanonicalUrl = (0, _createhreffromurl.createHrefFromUrl)(optimisticUrl);
|
|
const optimisticRouteTree = createOptimisticRouteTree(routeWithNoSearchParams.tree, optimisticRenderedSearch);
|
|
const optimisticMetadataTree = createOptimisticRouteTree(routeWithNoSearchParams.metadata, optimisticRenderedSearch);
|
|
// Clone the base route tree, and override the relevant fields with our
|
|
// optimistic values.
|
|
const optimisticEntry = {
|
|
canonicalUrl: optimisticCanonicalUrl,
|
|
status: 2,
|
|
// This isn't cloned because it's instance-specific
|
|
blockedTasks: null,
|
|
tree: optimisticRouteTree,
|
|
metadata: optimisticMetadataTree,
|
|
couldBeIntercepted: routeWithNoSearchParams.couldBeIntercepted,
|
|
isPPREnabled: routeWithNoSearchParams.isPPREnabled,
|
|
// Override the rendered search with the optimistic value.
|
|
renderedSearch: optimisticRenderedSearch,
|
|
// Map-related fields
|
|
ref: null,
|
|
size: 0,
|
|
staleAt: routeWithNoSearchParams.staleAt,
|
|
version: routeWithNoSearchParams.version
|
|
};
|
|
// Do not insert this entry into the cache. It only exists so we can
|
|
// perform the current navigation. Just return it to the caller.
|
|
return optimisticEntry;
|
|
}
|
|
function createOptimisticRouteTree(tree, newRenderedSearch) {
|
|
// Create a new route tree that identical to the original one except for
|
|
// the rendered search string, which is contained in the vary path.
|
|
let clonedSlots = null;
|
|
const originalSlots = tree.slots;
|
|
if (originalSlots !== null) {
|
|
clonedSlots = {};
|
|
for(const parallelRouteKey in originalSlots){
|
|
const childTree = originalSlots[parallelRouteKey];
|
|
clonedSlots[parallelRouteKey] = createOptimisticRouteTree(childTree, newRenderedSearch);
|
|
}
|
|
}
|
|
// We only need to clone the vary path if the route is a page.
|
|
if (tree.isPage) {
|
|
return {
|
|
requestKey: tree.requestKey,
|
|
segment: tree.segment,
|
|
varyPath: (0, _varypath.clonePageVaryPathWithNewSearchParams)(tree.varyPath, newRenderedSearch),
|
|
isPage: true,
|
|
slots: clonedSlots,
|
|
isRootLayout: tree.isRootLayout,
|
|
hasLoadingBoundary: tree.hasLoadingBoundary,
|
|
hasRuntimePrefetch: tree.hasRuntimePrefetch
|
|
};
|
|
}
|
|
return {
|
|
requestKey: tree.requestKey,
|
|
segment: tree.segment,
|
|
varyPath: tree.varyPath,
|
|
isPage: false,
|
|
slots: clonedSlots,
|
|
isRootLayout: tree.isRootLayout,
|
|
hasLoadingBoundary: tree.hasLoadingBoundary,
|
|
hasRuntimePrefetch: tree.hasRuntimePrefetch
|
|
};
|
|
}
|
|
function readOrCreateSegmentCacheEntry(now, fetchStrategy, route, tree) {
|
|
const existingEntry = readSegmentCacheEntry(now, tree.varyPath);
|
|
if (existingEntry !== null) {
|
|
return existingEntry;
|
|
}
|
|
// Create a pending entry and add it to the cache.
|
|
const varyPathForRequest = (0, _varypath.getSegmentVaryPathForRequest)(fetchStrategy, tree);
|
|
const pendingEntry = createDetachedSegmentCacheEntry(route.staleAt);
|
|
const isRevalidation = false;
|
|
(0, _cachemap.setInCacheMap)(segmentCacheMap, varyPathForRequest, pendingEntry, isRevalidation);
|
|
return pendingEntry;
|
|
}
|
|
function readOrCreateRevalidatingSegmentEntry(now, fetchStrategy, route, tree) {
|
|
// This function is called when we've already confirmed that a particular
|
|
// segment is cached, but we want to perform another request anyway in case it
|
|
// returns more complete and/or fresher data than we already have. The logic
|
|
// for deciding whether to replace the existing entry is handled elsewhere;
|
|
// this function just handles retrieving a cache entry that we can use to
|
|
// track the revalidation.
|
|
//
|
|
// The reason revalidations are stored in the cache is because we need to be
|
|
// able to dedupe multiple revalidation requests. The reason they have to be
|
|
// handled specially is because we shouldn't overwrite a "normal" entry if
|
|
// one exists at the same keypath. So, for each internal cache location, there
|
|
// is a special "revalidation" slot that is used solely for this purpose.
|
|
//
|
|
// You can think of it as if all the revalidation entries were stored in a
|
|
// separate cache map from the canonical entries, and then transfered to the
|
|
// canonical cache map once the request is complete — this isn't how it's
|
|
// actually implemented, since it's more efficient to store them in the same
|
|
// data structure as the normal entries, but that's how it's modeled
|
|
// conceptually.
|
|
// TODO: Once we implement Fallback behavior for params, where an entry is
|
|
// re-keyed based on response information, we'll need to account for the
|
|
// possibility that the keypath of the previous entry is more generic than
|
|
// the keypath of the revalidating entry. In other words, the server could
|
|
// return a less generic entry upon revalidation. For now, though, this isn't
|
|
// a concern because the keypath is based solely on the prefetch strategy,
|
|
// not on data contained in the response.
|
|
const existingEntry = readRevalidatingSegmentCacheEntry(now, tree.varyPath);
|
|
if (existingEntry !== null) {
|
|
return existingEntry;
|
|
}
|
|
// Create a pending entry and add it to the cache.
|
|
const varyPathForRequest = (0, _varypath.getSegmentVaryPathForRequest)(fetchStrategy, tree);
|
|
const pendingEntry = createDetachedSegmentCacheEntry(route.staleAt);
|
|
const isRevalidation = true;
|
|
(0, _cachemap.setInCacheMap)(segmentCacheMap, varyPathForRequest, pendingEntry, isRevalidation);
|
|
return pendingEntry;
|
|
}
|
|
function overwriteRevalidatingSegmentCacheEntry(fetchStrategy, route, tree) {
|
|
// This function is called when we've already decided to replace an existing
|
|
// revalidation entry. Create a new entry and write it into the cache,
|
|
// overwriting the previous value.
|
|
const varyPathForRequest = (0, _varypath.getSegmentVaryPathForRequest)(fetchStrategy, tree);
|
|
const pendingEntry = createDetachedSegmentCacheEntry(route.staleAt);
|
|
const isRevalidation = true;
|
|
(0, _cachemap.setInCacheMap)(segmentCacheMap, varyPathForRequest, pendingEntry, isRevalidation);
|
|
return pendingEntry;
|
|
}
|
|
function upsertSegmentEntry(now, varyPath, candidateEntry) {
|
|
// We have a new entry that has not yet been inserted into the cache. Before
|
|
// we do so, we need to confirm whether it takes precedence over the existing
|
|
// entry (if one exists).
|
|
// TODO: We should not upsert an entry if its key was invalidated in the time
|
|
// since the request was made. We can do that by passing the "owner" entry to
|
|
// this function and confirming it's the same as `existingEntry`.
|
|
if ((0, _cachemap.isValueExpired)(now, getCurrentCacheVersion(), candidateEntry)) {
|
|
// The entry is expired. We cannot upsert it.
|
|
return null;
|
|
}
|
|
const existingEntry = readSegmentCacheEntry(now, varyPath);
|
|
if (existingEntry !== null) {
|
|
// Don't replace a more specific segment with a less-specific one. A case where this
|
|
// might happen is if the existing segment was fetched via
|
|
// `<Link prefetch={true}>`.
|
|
if (// than the segment we already have in the cache, so it can't have more content.
|
|
candidateEntry.fetchStrategy !== existingEntry.fetchStrategy && !canNewFetchStrategyProvideMoreContent(existingEntry.fetchStrategy, candidateEntry.fetchStrategy) || // The existing entry isn't partial, but the new one is.
|
|
// (TODO: can this be true if `candidateEntry.fetchStrategy >= existingEntry.fetchStrategy`?)
|
|
!existingEntry.isPartial && candidateEntry.isPartial) {
|
|
// We're going to leave revalidating entry in the cache so that it doesn't
|
|
// get revalidated again unnecessarily. Downgrade the Fulfilled entry to
|
|
// Rejected and null out the data so it can be garbage collected. We leave
|
|
// `staleAt` intact to prevent subsequent revalidation attempts only until
|
|
// the entry expires.
|
|
const rejectedEntry = candidateEntry;
|
|
rejectedEntry.status = 3;
|
|
rejectedEntry.loading = null;
|
|
rejectedEntry.rsc = null;
|
|
return null;
|
|
}
|
|
// Evict the existing entry from the cache.
|
|
(0, _cachemap.deleteFromCacheMap)(existingEntry);
|
|
}
|
|
const isRevalidation = false;
|
|
(0, _cachemap.setInCacheMap)(segmentCacheMap, varyPath, candidateEntry, isRevalidation);
|
|
return candidateEntry;
|
|
}
|
|
function createDetachedSegmentCacheEntry(staleAt) {
|
|
const emptyEntry = {
|
|
status: 0,
|
|
// Default to assuming the fetch strategy will be PPR. This will be updated
|
|
// when a fetch is actually initiated.
|
|
fetchStrategy: _types.FetchStrategy.PPR,
|
|
rsc: null,
|
|
loading: null,
|
|
isPartial: true,
|
|
promise: null,
|
|
// Map-related fields
|
|
ref: null,
|
|
size: 0,
|
|
staleAt,
|
|
version: 0
|
|
};
|
|
return emptyEntry;
|
|
}
|
|
function upgradeToPendingSegment(emptyEntry, fetchStrategy) {
|
|
const pendingEntry = emptyEntry;
|
|
pendingEntry.status = 1;
|
|
pendingEntry.fetchStrategy = fetchStrategy;
|
|
// Set the version here, since this is right before the request is initiated.
|
|
// The next time the global cache version is incremented, the entry will
|
|
// effectively be evicted. This happens before initiating the request, rather
|
|
// than when receiving the response, because it's guaranteed to happen
|
|
// before the data is read on the server.
|
|
pendingEntry.version = getCurrentCacheVersion();
|
|
return pendingEntry;
|
|
}
|
|
function pingBlockedTasks(entry) {
|
|
const blockedTasks = entry.blockedTasks;
|
|
if (blockedTasks !== null) {
|
|
for (const task of blockedTasks){
|
|
(0, _scheduler.pingPrefetchTask)(task);
|
|
}
|
|
entry.blockedTasks = null;
|
|
}
|
|
}
|
|
function fulfillRouteCacheEntry(entry, tree, metadataVaryPath, staleAt, couldBeIntercepted, canonicalUrl, renderedSearch, isPPREnabled) {
|
|
// The Head is not actually part of the route tree, but other than that, it's
|
|
// fetched and cached like a segment. Some functions expect a RouteTree
|
|
// object, so rather than fork the logic in all those places, we use this
|
|
// "fake" one.
|
|
const metadata = {
|
|
requestKey: _segmentvalueencoding.HEAD_REQUEST_KEY,
|
|
segment: _segmentvalueencoding.HEAD_REQUEST_KEY,
|
|
varyPath: metadataVaryPath,
|
|
// The metadata isn't really a "page" (though it isn't really a "segment"
|
|
// either) but for the purposes of how this field is used, it behaves like
|
|
// one. If this logic ever gets more complex we can change this to an enum.
|
|
isPage: true,
|
|
slots: null,
|
|
isRootLayout: false,
|
|
hasLoadingBoundary: _approutertypes.HasLoadingBoundary.SubtreeHasNoLoadingBoundary,
|
|
hasRuntimePrefetch: false
|
|
};
|
|
const fulfilledEntry = entry;
|
|
fulfilledEntry.status = 2;
|
|
fulfilledEntry.tree = tree;
|
|
fulfilledEntry.metadata = metadata;
|
|
fulfilledEntry.staleAt = staleAt;
|
|
fulfilledEntry.couldBeIntercepted = couldBeIntercepted;
|
|
fulfilledEntry.canonicalUrl = canonicalUrl;
|
|
fulfilledEntry.renderedSearch = renderedSearch;
|
|
fulfilledEntry.isPPREnabled = isPPREnabled;
|
|
pingBlockedTasks(entry);
|
|
return fulfilledEntry;
|
|
}
|
|
function fulfillSegmentCacheEntry(segmentCacheEntry, rsc, loading, staleAt, isPartial) {
|
|
const fulfilledEntry = segmentCacheEntry;
|
|
fulfilledEntry.status = 2;
|
|
fulfilledEntry.rsc = rsc;
|
|
fulfilledEntry.loading = loading;
|
|
fulfilledEntry.staleAt = staleAt;
|
|
fulfilledEntry.isPartial = isPartial;
|
|
// Resolve any listeners that were waiting for this data.
|
|
if (segmentCacheEntry.promise !== null) {
|
|
segmentCacheEntry.promise.resolve(fulfilledEntry);
|
|
// Free the promise for garbage collection.
|
|
fulfilledEntry.promise = null;
|
|
}
|
|
return fulfilledEntry;
|
|
}
|
|
function rejectRouteCacheEntry(entry, staleAt) {
|
|
const rejectedEntry = entry;
|
|
rejectedEntry.status = 3;
|
|
rejectedEntry.staleAt = staleAt;
|
|
pingBlockedTasks(entry);
|
|
}
|
|
function rejectSegmentCacheEntry(entry, staleAt) {
|
|
const rejectedEntry = entry;
|
|
rejectedEntry.status = 3;
|
|
rejectedEntry.staleAt = staleAt;
|
|
if (entry.promise !== null) {
|
|
// NOTE: We don't currently propagate the reason the prefetch was canceled
|
|
// but we could by accepting a `reason` argument.
|
|
entry.promise.resolve(null);
|
|
entry.promise = null;
|
|
}
|
|
}
|
|
function convertRootTreePrefetchToRouteTree(rootTree, renderedPathname, renderedSearch, acc) {
|
|
// Remove trailing and leading slashes
|
|
const pathnameParts = renderedPathname.split('/').filter((p)=>p !== '');
|
|
const index = 0;
|
|
const rootSegment = _segmentvalueencoding.ROOT_SEGMENT_REQUEST_KEY;
|
|
return convertTreePrefetchToRouteTree(rootTree.tree, rootSegment, null, _segmentvalueencoding.ROOT_SEGMENT_REQUEST_KEY, pathnameParts, index, renderedSearch, acc);
|
|
}
|
|
function convertTreePrefetchToRouteTree(prefetch, segment, partialVaryPath, requestKey, pathnameParts, pathnamePartsIndex, renderedSearch, acc) {
|
|
// Converts the route tree sent by the server into the format used by the
|
|
// cache. The cached version of the tree includes additional fields, such as a
|
|
// cache key for each segment. Since this is frequently accessed, we compute
|
|
// it once instead of on every access. This same cache key is also used to
|
|
// request the segment from the server.
|
|
let slots = null;
|
|
let isPage;
|
|
let varyPath;
|
|
const prefetchSlots = prefetch.slots;
|
|
if (prefetchSlots !== null) {
|
|
isPage = false;
|
|
varyPath = (0, _varypath.finalizeLayoutVaryPath)(requestKey, partialVaryPath);
|
|
slots = {};
|
|
for(let parallelRouteKey in prefetchSlots){
|
|
const childPrefetch = prefetchSlots[parallelRouteKey];
|
|
const childParamName = childPrefetch.name;
|
|
const childParamType = childPrefetch.paramType;
|
|
const childServerSentParamKey = childPrefetch.paramKey;
|
|
let childDoesAppearInURL;
|
|
let childSegment;
|
|
let childPartialVaryPath;
|
|
if (childParamType !== null) {
|
|
// This segment is parameterized. Get the param from the pathname.
|
|
const childParamValue = (0, _routeparams.parseDynamicParamFromURLPart)(childParamType, pathnameParts, pathnamePartsIndex);
|
|
// Assign a cache key to the segment, based on the param value. In the
|
|
// pre-Segment Cache implementation, the server computes this and sends
|
|
// it in the body of the response. In the Segment Cache implementation,
|
|
// the server sends an empty string and we fill it in here.
|
|
// TODO: We're intentionally not adding the search param to page
|
|
// segments here; it's tracked separately and added back during a read.
|
|
// This would clearer if we waited to construct the segment until it's
|
|
// read from the cache, since that's effectively what we're
|
|
// doing anyway.
|
|
const childParamKey = // cacheComponents is enabled.
|
|
childServerSentParamKey !== null ? childServerSentParamKey : (0, _routeparams.getCacheKeyForDynamicParam)(childParamValue, '');
|
|
childPartialVaryPath = (0, _varypath.appendLayoutVaryPath)(partialVaryPath, childParamKey);
|
|
childSegment = [
|
|
childParamName,
|
|
childParamKey,
|
|
childParamType
|
|
];
|
|
childDoesAppearInURL = true;
|
|
} else {
|
|
// This segment does not have a param. Inherit the partial vary path of
|
|
// the parent.
|
|
childPartialVaryPath = partialVaryPath;
|
|
childSegment = childParamName;
|
|
childDoesAppearInURL = (0, _routeparams.doesStaticSegmentAppearInURL)(childParamName);
|
|
}
|
|
// Only increment the index if the segment appears in the URL. If it's a
|
|
// "virtual" segment, like a route group, it remains the same.
|
|
const childPathnamePartsIndex = childDoesAppearInURL ? pathnamePartsIndex + 1 : pathnamePartsIndex;
|
|
const childRequestKeyPart = (0, _segmentvalueencoding.createSegmentRequestKeyPart)(childSegment);
|
|
const childRequestKey = (0, _segmentvalueencoding.appendSegmentRequestKeyPart)(requestKey, parallelRouteKey, childRequestKeyPart);
|
|
slots[parallelRouteKey] = convertTreePrefetchToRouteTree(childPrefetch, childSegment, childPartialVaryPath, childRequestKey, pathnameParts, childPathnamePartsIndex, renderedSearch, acc);
|
|
}
|
|
} else {
|
|
if (requestKey.endsWith(_segment.PAGE_SEGMENT_KEY)) {
|
|
// This is a page segment.
|
|
isPage = true;
|
|
varyPath = (0, _varypath.finalizePageVaryPath)(requestKey, renderedSearch, partialVaryPath);
|
|
// The metadata "segment" is not part the route tree, but it has the same
|
|
// conceptual params as a page segment. Write the vary path into the
|
|
// accumulator object. If there are multiple parallel pages, we use the
|
|
// first one. Which page we choose is arbitrary as long as it's
|
|
// consistently the same one every time every time. See
|
|
// finalizeMetadataVaryPath for more details.
|
|
if (acc.metadataVaryPath === null) {
|
|
acc.metadataVaryPath = (0, _varypath.finalizeMetadataVaryPath)(requestKey, renderedSearch, partialVaryPath);
|
|
}
|
|
} else {
|
|
// This is a layout segment.
|
|
isPage = false;
|
|
varyPath = (0, _varypath.finalizeLayoutVaryPath)(requestKey, partialVaryPath);
|
|
}
|
|
}
|
|
return {
|
|
requestKey,
|
|
segment,
|
|
varyPath,
|
|
// TODO: Cheating the type system here a bit because TypeScript can't tell
|
|
// that the type of isPage and varyPath are consistent. The fix would be to
|
|
// create separate constructors and call the appropriate one from each of
|
|
// the branches above. Just seems a bit overkill only for one field so I'll
|
|
// leave it as-is for now. If isPage were wrong it would break the behavior
|
|
// and we'd catch it quickly, anyway.
|
|
isPage: isPage,
|
|
slots,
|
|
isRootLayout: prefetch.isRootLayout,
|
|
// This field is only relevant to dynamic routes. For a PPR/static route,
|
|
// there's always some partial loading state we can fetch.
|
|
hasLoadingBoundary: _approutertypes.HasLoadingBoundary.SegmentHasLoadingBoundary,
|
|
hasRuntimePrefetch: prefetch.hasRuntimePrefetch
|
|
};
|
|
}
|
|
function convertRootFlightRouterStateToRouteTree(flightRouterState, renderedSearch, acc) {
|
|
return convertFlightRouterStateToRouteTree(flightRouterState, _segmentvalueencoding.ROOT_SEGMENT_REQUEST_KEY, null, renderedSearch, acc);
|
|
}
|
|
function convertFlightRouterStateToRouteTree(flightRouterState, requestKey, parentPartialVaryPath, renderedSearch, acc) {
|
|
const originalSegment = flightRouterState[0];
|
|
let segment;
|
|
let partialVaryPath;
|
|
let isPage;
|
|
let varyPath;
|
|
if (Array.isArray(originalSegment)) {
|
|
isPage = false;
|
|
const paramCacheKey = originalSegment[1];
|
|
partialVaryPath = (0, _varypath.appendLayoutVaryPath)(parentPartialVaryPath, paramCacheKey);
|
|
varyPath = (0, _varypath.finalizeLayoutVaryPath)(requestKey, partialVaryPath);
|
|
segment = originalSegment;
|
|
} else {
|
|
// This segment does not have a param. Inherit the partial vary path of
|
|
// the parent.
|
|
partialVaryPath = parentPartialVaryPath;
|
|
if (requestKey.endsWith(_segment.PAGE_SEGMENT_KEY)) {
|
|
// This is a page segment.
|
|
isPage = true;
|
|
// The navigation implementation expects the search params to be included
|
|
// in the segment. However, in the case of a static response, the search
|
|
// params are omitted. So the client needs to add them back in when reading
|
|
// from the Segment Cache.
|
|
//
|
|
// For consistency, we'll do this for dynamic responses, too.
|
|
//
|
|
// TODO: We should move search params out of FlightRouterState and handle
|
|
// them entirely on the client, similar to our plan for dynamic params.
|
|
segment = _segment.PAGE_SEGMENT_KEY;
|
|
varyPath = (0, _varypath.finalizePageVaryPath)(requestKey, renderedSearch, partialVaryPath);
|
|
// The metadata "segment" is not part the route tree, but it has the same
|
|
// conceptual params as a page segment. Write the vary path into the
|
|
// accumulator object. If there are multiple parallel pages, we use the
|
|
// first one. Which page we choose is arbitrary as long as it's
|
|
// consistently the same one every time every time. See
|
|
// finalizeMetadataVaryPath for more details.
|
|
if (acc.metadataVaryPath === null) {
|
|
acc.metadataVaryPath = (0, _varypath.finalizeMetadataVaryPath)(requestKey, renderedSearch, partialVaryPath);
|
|
}
|
|
} else {
|
|
// This is a layout segment.
|
|
isPage = false;
|
|
segment = originalSegment;
|
|
varyPath = (0, _varypath.finalizeLayoutVaryPath)(requestKey, partialVaryPath);
|
|
}
|
|
}
|
|
let slots = null;
|
|
const parallelRoutes = flightRouterState[1];
|
|
for(let parallelRouteKey in parallelRoutes){
|
|
const childRouterState = parallelRoutes[parallelRouteKey];
|
|
const childSegment = childRouterState[0];
|
|
// TODO: Eventually, the param values will not be included in the response
|
|
// from the server. We'll instead fill them in on the client by parsing
|
|
// the URL. This is where we'll do that.
|
|
const childRequestKeyPart = (0, _segmentvalueencoding.createSegmentRequestKeyPart)(childSegment);
|
|
const childRequestKey = (0, _segmentvalueencoding.appendSegmentRequestKeyPart)(requestKey, parallelRouteKey, childRequestKeyPart);
|
|
const childTree = convertFlightRouterStateToRouteTree(childRouterState, childRequestKey, partialVaryPath, renderedSearch, acc);
|
|
if (slots === null) {
|
|
slots = {
|
|
[parallelRouteKey]: childTree
|
|
};
|
|
} else {
|
|
slots[parallelRouteKey] = childTree;
|
|
}
|
|
}
|
|
return {
|
|
requestKey,
|
|
segment,
|
|
varyPath,
|
|
// TODO: Cheating the type system here a bit because TypeScript can't tell
|
|
// that the type of isPage and varyPath are consistent. The fix would be to
|
|
// create separate constructors and call the appropriate one from each of
|
|
// the branches above. Just seems a bit overkill only for one field so I'll
|
|
// leave it as-is for now. If isPage were wrong it would break the behavior
|
|
// and we'd catch it quickly, anyway.
|
|
isPage: isPage,
|
|
slots,
|
|
isRootLayout: flightRouterState[4] === true,
|
|
hasLoadingBoundary: flightRouterState[5] !== undefined ? flightRouterState[5] : _approutertypes.HasLoadingBoundary.SubtreeHasNoLoadingBoundary,
|
|
// Non-static tree responses are only used by apps that haven't adopted
|
|
// Cache Components. So this is always false.
|
|
hasRuntimePrefetch: false
|
|
};
|
|
}
|
|
function convertRouteTreeToFlightRouterState(routeTree) {
|
|
const parallelRoutes = {};
|
|
if (routeTree.slots !== null) {
|
|
for(const parallelRouteKey in routeTree.slots){
|
|
parallelRoutes[parallelRouteKey] = convertRouteTreeToFlightRouterState(routeTree.slots[parallelRouteKey]);
|
|
}
|
|
}
|
|
const flightRouterState = [
|
|
routeTree.segment,
|
|
parallelRoutes,
|
|
null,
|
|
null,
|
|
routeTree.isRootLayout
|
|
];
|
|
return flightRouterState;
|
|
}
|
|
async function fetchRouteOnCacheMiss(entry, task, key) {
|
|
// This function is allowed to use async/await because it contains the actual
|
|
// fetch that gets issued on a cache miss. Notice it writes the result to the
|
|
// cache entry directly, rather than return data that is then written by
|
|
// the caller.
|
|
const pathname = key.pathname;
|
|
const search = key.search;
|
|
const nextUrl = key.nextUrl;
|
|
const segmentPath = '/_tree';
|
|
const headers = {
|
|
[_approuterheaders.RSC_HEADER]: '1',
|
|
[_approuterheaders.NEXT_ROUTER_PREFETCH_HEADER]: '1',
|
|
[_approuterheaders.NEXT_ROUTER_SEGMENT_PREFETCH_HEADER]: segmentPath
|
|
};
|
|
if (nextUrl !== null) {
|
|
headers[_approuterheaders.NEXT_URL] = nextUrl;
|
|
}
|
|
try {
|
|
const url = new URL(pathname + search, location.origin);
|
|
let response;
|
|
let urlAfterRedirects;
|
|
if ("TURBOPACK compile-time falsy", 0) //TURBOPACK unreachable
|
|
;
|
|
else {
|
|
// "Server" mode. We can use request headers instead of the pathname.
|
|
// TODO: The eventual plan is to get rid of our custom request headers and
|
|
// encode everything into the URL, using a similar strategy to the
|
|
// "output: export" block above.
|
|
response = await fetchPrefetchResponse(url, headers);
|
|
urlAfterRedirects = response !== null && response.redirected ? new URL(response.url) : url;
|
|
}
|
|
if (!response || !response.ok || // 204 is a Cache miss. Though theoretically this shouldn't happen when
|
|
// PPR is enabled, because we always respond to route tree requests, even
|
|
// if it needs to be blockingly generated on demand.
|
|
response.status === 204 || !response.body) {
|
|
// Server responded with an error, or with a miss. We should still cache
|
|
// the response, but we can try again after 10 seconds.
|
|
rejectRouteCacheEntry(entry, Date.now() + 10 * 1000);
|
|
return null;
|
|
}
|
|
// TODO: The canonical URL is the href without the origin. I think
|
|
// historically the reason for this is because the initial canonical URL
|
|
// gets passed as a prop to the top-level React component, which means it
|
|
// needs to be computed during SSR. If it were to include the origin, it
|
|
// would need to always be same as location.origin on the client, to prevent
|
|
// a hydration mismatch. To sidestep this complexity, we omit the origin.
|
|
//
|
|
// However, since this is neither a native URL object nor a fully qualified
|
|
// URL string, we need to be careful about how we use it. To prevent subtle
|
|
// mistakes, we should create a special type for it, instead of just string.
|
|
// Or, we should just use a (readonly) URL object instead. The type of the
|
|
// prop that we pass to seed the initial state does not need to be the same
|
|
// type as the state itself.
|
|
const canonicalUrl = (0, _createhreffromurl.createHrefFromUrl)(urlAfterRedirects);
|
|
// Check whether the response varies based on the Next-Url header.
|
|
const varyHeader = response.headers.get('vary');
|
|
const couldBeIntercepted = varyHeader !== null && varyHeader.includes(_approuterheaders.NEXT_URL);
|
|
// Track when the network connection closes.
|
|
const closed = (0, _promisewithresolvers.createPromiseWithResolvers)();
|
|
// This checks whether the response was served from the per-segment cache,
|
|
// rather than the old prefetching flow. If it fails, it implies that PPR
|
|
// is disabled on this route.
|
|
const routeIsPPREnabled = response.headers.get(_approuterheaders.NEXT_DID_POSTPONE_HEADER) === '2' || // In output: "export" mode, we can't rely on response headers. But if we
|
|
// receive a well-formed response, we can assume it's a static response,
|
|
// because all data is static in this mode.
|
|
isOutputExportMode;
|
|
if (routeIsPPREnabled) {
|
|
const prefetchStream = createPrefetchResponseStream(response.body, closed.resolve, function onResponseSizeUpdate(size) {
|
|
(0, _cachemap.setSizeInCacheMap)(entry, size);
|
|
});
|
|
const serverData = await (0, _fetchserverresponse.createFromNextReadableStream)(prefetchStream, headers);
|
|
if (serverData.buildId !== (0, _appbuildid.getAppBuildId)()) {
|
|
// The server build does not match the client. Treat as a 404. During
|
|
// an actual navigation, the router will trigger an MPA navigation.
|
|
// TODO: Consider moving the build ID to a response header so we can check
|
|
// it before decoding the response, and so there's one way of checking
|
|
// across all response types.
|
|
// TODO: We should cache the fact that this is an MPA navigation.
|
|
rejectRouteCacheEntry(entry, Date.now() + 10 * 1000);
|
|
return null;
|
|
}
|
|
// Get the params that were used to render the target page. These may
|
|
// be different from the params in the request URL, if the page
|
|
// was rewritten.
|
|
const renderedPathname = (0, _routeparams.getRenderedPathname)(response);
|
|
const renderedSearch = (0, _routeparams.getRenderedSearch)(response);
|
|
// Convert the server-sent data into the RouteTree format used by the
|
|
// client cache.
|
|
//
|
|
// During this traversal, we accumulate additional data into this
|
|
// "accumulator" object.
|
|
const acc = {
|
|
metadataVaryPath: null
|
|
};
|
|
const routeTree = convertRootTreePrefetchToRouteTree(serverData, renderedPathname, renderedSearch, acc);
|
|
const metadataVaryPath = acc.metadataVaryPath;
|
|
if (metadataVaryPath === null) {
|
|
rejectRouteCacheEntry(entry, Date.now() + 10 * 1000);
|
|
return null;
|
|
}
|
|
const staleTimeMs = getStaleTimeMs(serverData.staleTime);
|
|
fulfillRouteCacheEntry(entry, routeTree, metadataVaryPath, Date.now() + staleTimeMs, couldBeIntercepted, canonicalUrl, renderedSearch, routeIsPPREnabled);
|
|
} else {
|
|
// PPR is not enabled for this route. The server responds with a
|
|
// different format (FlightRouterState) that we need to convert.
|
|
// TODO: We will unify the responses eventually. I'm keeping the types
|
|
// separate for now because FlightRouterState has so many
|
|
// overloaded concerns.
|
|
const prefetchStream = createPrefetchResponseStream(response.body, closed.resolve, function onResponseSizeUpdate(size) {
|
|
(0, _cachemap.setSizeInCacheMap)(entry, size);
|
|
});
|
|
const serverData = await (0, _fetchserverresponse.createFromNextReadableStream)(prefetchStream, headers);
|
|
if (serverData.b !== (0, _appbuildid.getAppBuildId)()) {
|
|
// The server build does not match the client. Treat as a 404. During
|
|
// an actual navigation, the router will trigger an MPA navigation.
|
|
// TODO: Consider moving the build ID to a response header so we can check
|
|
// it before decoding the response, and so there's one way of checking
|
|
// across all response types.
|
|
// TODO: We should cache the fact that this is an MPA navigation.
|
|
rejectRouteCacheEntry(entry, Date.now() + 10 * 1000);
|
|
return null;
|
|
}
|
|
writeDynamicTreeResponseIntoCache(Date.now(), task, // using the LoadingBoundary fetch strategy, so mark their cache entries accordingly.
|
|
_types.FetchStrategy.LoadingBoundary, response, serverData, entry, couldBeIntercepted, canonicalUrl, routeIsPPREnabled);
|
|
}
|
|
if (!couldBeIntercepted) {
|
|
// This route will never be intercepted. So we can use this entry for all
|
|
// requests to this route, regardless of the Next-Url header. This works
|
|
// because when reading the cache we always check for a valid
|
|
// non-intercepted entry first.
|
|
// Re-key the entry. The `set` implementation handles removing it from
|
|
// its previous position in the cache. We don't need to do anything to
|
|
// update the LRU, because the entry is already in it.
|
|
// TODO: Treat this as an upsert — should check if an entry already
|
|
// exists at the new keypath, and if so, whether we should keep that
|
|
// one instead.
|
|
const fulfilledVaryPath = (0, _varypath.getFulfilledRouteVaryPath)(pathname, search, nextUrl, couldBeIntercepted);
|
|
const isRevalidation = false;
|
|
(0, _cachemap.setInCacheMap)(routeCacheMap, fulfilledVaryPath, entry, isRevalidation);
|
|
}
|
|
// Return a promise that resolves when the network connection closes, so
|
|
// the scheduler can track the number of concurrent network connections.
|
|
return {
|
|
value: null,
|
|
closed: closed.promise
|
|
};
|
|
} catch (error) {
|
|
// Either the connection itself failed, or something bad happened while
|
|
// decoding the response.
|
|
rejectRouteCacheEntry(entry, Date.now() + 10 * 1000);
|
|
return null;
|
|
}
|
|
}
|
|
async function fetchSegmentOnCacheMiss(route, segmentCacheEntry, routeKey, tree) {
|
|
// This function is allowed to use async/await because it contains the actual
|
|
// fetch that gets issued on a cache miss. Notice it writes the result to the
|
|
// cache entry directly, rather than return data that is then written by
|
|
// the caller.
|
|
//
|
|
// Segment fetches are non-blocking so we don't need to ping the scheduler
|
|
// on completion.
|
|
// Use the canonical URL to request the segment, not the original URL. These
|
|
// are usually the same, but the canonical URL will be different if the route
|
|
// tree response was redirected. To avoid an extra waterfall on every segment
|
|
// request, we pass the redirected URL instead of the original one.
|
|
const url = new URL(route.canonicalUrl, location.origin);
|
|
const nextUrl = routeKey.nextUrl;
|
|
const requestKey = tree.requestKey;
|
|
const normalizedRequestKey = requestKey === _segmentvalueencoding.ROOT_SEGMENT_REQUEST_KEY ? // `_index` instead of as an empty string. This should be treated as
|
|
// an implementation detail and not as a stable part of the protocol.
|
|
// It just needs to match the equivalent logic that happens when
|
|
// prerendering the responses. It should not leak outside of Next.js.
|
|
'/_index' : requestKey;
|
|
const headers = {
|
|
[_approuterheaders.RSC_HEADER]: '1',
|
|
[_approuterheaders.NEXT_ROUTER_PREFETCH_HEADER]: '1',
|
|
[_approuterheaders.NEXT_ROUTER_SEGMENT_PREFETCH_HEADER]: normalizedRequestKey
|
|
};
|
|
if (nextUrl !== null) {
|
|
headers[_approuterheaders.NEXT_URL] = nextUrl;
|
|
}
|
|
const requestUrl = ("TURBOPACK compile-time falsy", 0) ? "TURBOPACK unreachable" : url;
|
|
try {
|
|
const response = await fetchPrefetchResponse(requestUrl, headers);
|
|
if (!response || !response.ok || response.status === 204 || // Cache miss
|
|
// This checks whether the response was served from the per-segment cache,
|
|
// rather than the old prefetching flow. If it fails, it implies that PPR
|
|
// is disabled on this route. Theoretically this should never happen
|
|
// because we only issue requests for segments once we've verified that
|
|
// the route supports PPR.
|
|
response.headers.get(_approuterheaders.NEXT_DID_POSTPONE_HEADER) !== '2' && // In output: "export" mode, we can't rely on response headers. But if
|
|
// we receive a well-formed response, we can assume it's a static
|
|
// response, because all data is static in this mode.
|
|
!isOutputExportMode || !response.body) {
|
|
// Server responded with an error, or with a miss. We should still cache
|
|
// the response, but we can try again after 10 seconds.
|
|
rejectSegmentCacheEntry(segmentCacheEntry, Date.now() + 10 * 1000);
|
|
return null;
|
|
}
|
|
// Track when the network connection closes.
|
|
const closed = (0, _promisewithresolvers.createPromiseWithResolvers)();
|
|
// Wrap the original stream in a new stream that never closes. That way the
|
|
// Flight client doesn't error if there's a hanging promise.
|
|
const prefetchStream = createPrefetchResponseStream(response.body, closed.resolve, function onResponseSizeUpdate(size) {
|
|
(0, _cachemap.setSizeInCacheMap)(segmentCacheEntry, size);
|
|
});
|
|
const serverData = await (0, _fetchserverresponse.createFromNextReadableStream)(prefetchStream, headers);
|
|
if (serverData.buildId !== (0, _appbuildid.getAppBuildId)()) {
|
|
// The server build does not match the client. Treat as a 404. During
|
|
// an actual navigation, the router will trigger an MPA navigation.
|
|
// TODO: Consider moving the build ID to a response header so we can check
|
|
// it before decoding the response, and so there's one way of checking
|
|
// across all response types.
|
|
rejectSegmentCacheEntry(segmentCacheEntry, Date.now() + 10 * 1000);
|
|
return null;
|
|
}
|
|
return {
|
|
value: fulfillSegmentCacheEntry(segmentCacheEntry, serverData.rsc, serverData.loading, // So we use the stale time of the route.
|
|
route.staleAt, serverData.isPartial),
|
|
// Return a promise that resolves when the network connection closes, so
|
|
// the scheduler can track the number of concurrent network connections.
|
|
closed: closed.promise
|
|
};
|
|
} catch (error) {
|
|
// Either the connection itself failed, or something bad happened while
|
|
// decoding the response.
|
|
rejectSegmentCacheEntry(segmentCacheEntry, Date.now() + 10 * 1000);
|
|
return null;
|
|
}
|
|
}
|
|
async function fetchSegmentPrefetchesUsingDynamicRequest(task, route, fetchStrategy, dynamicRequestTree, spawnedEntries) {
|
|
const key = task.key;
|
|
const url = new URL(route.canonicalUrl, location.origin);
|
|
const nextUrl = key.nextUrl;
|
|
if (spawnedEntries.size === 1 && spawnedEntries.has(route.metadata.requestKey)) {
|
|
// The only thing pending is the head. Instruct the server to
|
|
// skip over everything else.
|
|
dynamicRequestTree = MetadataOnlyRequestTree;
|
|
}
|
|
const headers = {
|
|
[_approuterheaders.RSC_HEADER]: '1',
|
|
[_approuterheaders.NEXT_ROUTER_STATE_TREE_HEADER]: (0, _flightdatahelpers.prepareFlightRouterStateForRequest)(dynamicRequestTree)
|
|
};
|
|
if (nextUrl !== null) {
|
|
headers[_approuterheaders.NEXT_URL] = nextUrl;
|
|
}
|
|
switch(fetchStrategy){
|
|
case _types.FetchStrategy.Full:
|
|
{
|
|
break;
|
|
}
|
|
case _types.FetchStrategy.PPRRuntime:
|
|
{
|
|
headers[_approuterheaders.NEXT_ROUTER_PREFETCH_HEADER] = '2';
|
|
break;
|
|
}
|
|
case _types.FetchStrategy.LoadingBoundary:
|
|
{
|
|
headers[_approuterheaders.NEXT_ROUTER_PREFETCH_HEADER] = '1';
|
|
break;
|
|
}
|
|
default:
|
|
{
|
|
fetchStrategy;
|
|
}
|
|
}
|
|
try {
|
|
const response = await fetchPrefetchResponse(url, headers);
|
|
if (!response || !response.ok || !response.body) {
|
|
// Server responded with an error, or with a miss. We should still cache
|
|
// the response, but we can try again after 10 seconds.
|
|
rejectSegmentEntriesIfStillPending(spawnedEntries, Date.now() + 10 * 1000);
|
|
return null;
|
|
}
|
|
const renderedSearch = (0, _routeparams.getRenderedSearch)(response);
|
|
if (renderedSearch !== route.renderedSearch) {
|
|
// The search params that were used to render the target page are
|
|
// different from the search params in the request URL. This only happens
|
|
// when there's a dynamic rewrite in between the tree prefetch and the
|
|
// data prefetch.
|
|
// TODO: For now, since this is an edge case, we reject the prefetch, but
|
|
// the proper way to handle this is to evict the stale route tree entry
|
|
// then fill the cache with the new response.
|
|
rejectSegmentEntriesIfStillPending(spawnedEntries, Date.now() + 10 * 1000);
|
|
return null;
|
|
}
|
|
// Track when the network connection closes.
|
|
const closed = (0, _promisewithresolvers.createPromiseWithResolvers)();
|
|
let fulfilledEntries = null;
|
|
const prefetchStream = createPrefetchResponseStream(response.body, closed.resolve, function onResponseSizeUpdate(totalBytesReceivedSoFar) {
|
|
// When processing a dynamic response, we don't know how large each
|
|
// individual segment is, so approximate by assiging each segment
|
|
// the average of the total response size.
|
|
if (fulfilledEntries === null) {
|
|
// Haven't received enough data yet to know which segments
|
|
// were included.
|
|
return;
|
|
}
|
|
const averageSize = totalBytesReceivedSoFar / fulfilledEntries.length;
|
|
for (const entry of fulfilledEntries){
|
|
(0, _cachemap.setSizeInCacheMap)(entry, averageSize);
|
|
}
|
|
});
|
|
const serverData = await (0, _fetchserverresponse.createFromNextReadableStream)(prefetchStream, headers);
|
|
const isResponsePartial = fetchStrategy === _types.FetchStrategy.PPRRuntime ? serverData.rp?.[0] === true : false;
|
|
// Aside from writing the data into the cache, this function also returns
|
|
// the entries that were fulfilled, so we can streamingly update their sizes
|
|
// in the LRU as more data comes in.
|
|
fulfilledEntries = writeDynamicRenderResponseIntoCache(Date.now(), task, fetchStrategy, response, serverData, isResponsePartial, route, spawnedEntries);
|
|
// Return a promise that resolves when the network connection closes, so
|
|
// the scheduler can track the number of concurrent network connections.
|
|
return {
|
|
value: null,
|
|
closed: closed.promise
|
|
};
|
|
} catch (error) {
|
|
rejectSegmentEntriesIfStillPending(spawnedEntries, Date.now() + 10 * 1000);
|
|
return null;
|
|
}
|
|
}
|
|
function writeDynamicTreeResponseIntoCache(now, task, fetchStrategy, response, serverData, entry, couldBeIntercepted, canonicalUrl, routeIsPPREnabled) {
|
|
// Get the URL that was used to render the target page. This may be different
|
|
// from the URL in the request URL, if the page was rewritten.
|
|
const renderedSearch = (0, _routeparams.getRenderedSearch)(response);
|
|
const normalizedFlightDataResult = (0, _flightdatahelpers.normalizeFlightData)(serverData.f);
|
|
if (// MPA navigation.
|
|
typeof normalizedFlightDataResult === 'string' || normalizedFlightDataResult.length !== 1) {
|
|
rejectRouteCacheEntry(entry, now + 10 * 1000);
|
|
return;
|
|
}
|
|
const flightData = normalizedFlightDataResult[0];
|
|
if (!flightData.isRootRender) {
|
|
// Unexpected response format.
|
|
rejectRouteCacheEntry(entry, now + 10 * 1000);
|
|
return;
|
|
}
|
|
const flightRouterState = flightData.tree;
|
|
// For runtime prefetches, stale time is in the payload at rp[1].
|
|
// For other responses, fall back to the header.
|
|
const staleTimeSeconds = typeof serverData.rp?.[1] === 'number' ? serverData.rp[1] : parseInt(response.headers.get(_approuterheaders.NEXT_ROUTER_STALE_TIME_HEADER) ?? '', 10);
|
|
const staleTimeMs = !isNaN(staleTimeSeconds) ? getStaleTimeMs(staleTimeSeconds) : _navigatereducer.STATIC_STALETIME_MS;
|
|
// If the response contains dynamic holes, then we must conservatively assume
|
|
// that any individual segment might contain dynamic holes, and also the
|
|
// head. If it did not contain dynamic holes, then we can assume every segment
|
|
// and the head is completely static.
|
|
const isResponsePartial = response.headers.get(_approuterheaders.NEXT_DID_POSTPONE_HEADER) === '1';
|
|
// Convert the server-sent data into the RouteTree format used by the
|
|
// client cache.
|
|
//
|
|
// During this traversal, we accumulate additional data into this
|
|
// "accumulator" object.
|
|
const acc = {
|
|
metadataVaryPath: null
|
|
};
|
|
const routeTree = convertRootFlightRouterStateToRouteTree(flightRouterState, renderedSearch, acc);
|
|
const metadataVaryPath = acc.metadataVaryPath;
|
|
if (metadataVaryPath === null) {
|
|
rejectRouteCacheEntry(entry, now + 10 * 1000);
|
|
return;
|
|
}
|
|
const fulfilledEntry = fulfillRouteCacheEntry(entry, routeTree, metadataVaryPath, now + staleTimeMs, couldBeIntercepted, canonicalUrl, renderedSearch, routeIsPPREnabled);
|
|
// If the server sent segment data as part of the response, we should write
|
|
// it into the cache to prevent a second, redundant prefetch request.
|
|
//
|
|
// TODO: When `clientSegmentCache` is enabled, the server does not include
|
|
// segment data when responding to a route tree prefetch request. However,
|
|
// when `clientSegmentCache` is set to "client-only", and PPR is enabled (or
|
|
// the page is fully static), the normal check is bypassed and the server
|
|
// responds with the full page. This is a temporary situation until we can
|
|
// remove the "client-only" option. Then, we can delete this function call.
|
|
writeDynamicRenderResponseIntoCache(now, task, fetchStrategy, response, serverData, isResponsePartial, fulfilledEntry, null);
|
|
}
|
|
function rejectSegmentEntriesIfStillPending(entries, staleAt) {
|
|
const fulfilledEntries = [];
|
|
for (const entry of entries.values()){
|
|
if (entry.status === 1) {
|
|
rejectSegmentCacheEntry(entry, staleAt);
|
|
} else if (entry.status === 2) {
|
|
fulfilledEntries.push(entry);
|
|
}
|
|
}
|
|
return fulfilledEntries;
|
|
}
|
|
function writeDynamicRenderResponseIntoCache(now, task, fetchStrategy, response, serverData, isResponsePartial, route, spawnedEntries) {
|
|
if (serverData.b !== (0, _appbuildid.getAppBuildId)()) {
|
|
// The server build does not match the client. Treat as a 404. During
|
|
// an actual navigation, the router will trigger an MPA navigation.
|
|
// TODO: Consider moving the build ID to a response header so we can check
|
|
// it before decoding the response, and so there's one way of checking
|
|
// across all response types.
|
|
if (spawnedEntries !== null) {
|
|
rejectSegmentEntriesIfStillPending(spawnedEntries, now + 10 * 1000);
|
|
}
|
|
return null;
|
|
}
|
|
const flightDatas = (0, _flightdatahelpers.normalizeFlightData)(serverData.f);
|
|
if (typeof flightDatas === 'string') {
|
|
// This means navigating to this route will result in an MPA navigation.
|
|
// TODO: We should cache this, too, so that the MPA navigation is immediate.
|
|
return null;
|
|
}
|
|
// For runtime prefetches, stale time is in the payload at rp[1].
|
|
// For other responses, fall back to the header.
|
|
const staleTimeSeconds = typeof serverData.rp?.[1] === 'number' ? serverData.rp[1] : parseInt(response.headers.get(_approuterheaders.NEXT_ROUTER_STALE_TIME_HEADER) ?? '', 10);
|
|
const staleTimeMs = !isNaN(staleTimeSeconds) ? getStaleTimeMs(staleTimeSeconds) : _navigatereducer.STATIC_STALETIME_MS;
|
|
const staleAt = now + staleTimeMs;
|
|
for (const flightData of flightDatas){
|
|
const seedData = flightData.seedData;
|
|
if (seedData !== null) {
|
|
// The data sent by the server represents only a subtree of the app. We
|
|
// need to find the part of the task tree that matches the response.
|
|
//
|
|
// segmentPath represents the parent path of subtree. It's a repeating
|
|
// pattern of parallel route key and segment:
|
|
//
|
|
// [string, Segment, string, Segment, string, Segment, ...]
|
|
const segmentPath = flightData.segmentPath;
|
|
let tree = route.tree;
|
|
for(let i = 0; i < segmentPath.length; i += 2){
|
|
const parallelRouteKey = segmentPath[i];
|
|
if (tree?.slots?.[parallelRouteKey] !== undefined) {
|
|
tree = tree.slots[parallelRouteKey];
|
|
} else {
|
|
if (spawnedEntries !== null) {
|
|
rejectSegmentEntriesIfStillPending(spawnedEntries, now + 10 * 1000);
|
|
}
|
|
return null;
|
|
}
|
|
}
|
|
writeSeedDataIntoCache(now, task, fetchStrategy, route, tree, staleAt, seedData, isResponsePartial, spawnedEntries);
|
|
}
|
|
const head = flightData.head;
|
|
if (head !== null) {
|
|
fulfillEntrySpawnedByRuntimePrefetch(now, fetchStrategy, route, head, null, flightData.isHeadPartial, staleAt, route.metadata, spawnedEntries);
|
|
}
|
|
}
|
|
// Any entry that's still pending was intentionally not rendered by the
|
|
// server, because it was inside the loading boundary. Mark them as rejected
|
|
// so we know not to fetch them again.
|
|
// TODO: If PPR is enabled on some routes but not others, then it's possible
|
|
// that a different page is able to do a per-segment prefetch of one of the
|
|
// segments we're marking as rejected here. We should mark on the segment
|
|
// somehow that the reason for the rejection is because of a non-PPR prefetch.
|
|
// That way a per-segment prefetch knows to disregard the rejection.
|
|
if (spawnedEntries !== null) {
|
|
const fulfilledEntries = rejectSegmentEntriesIfStillPending(spawnedEntries, now + 10 * 1000);
|
|
return fulfilledEntries;
|
|
}
|
|
return null;
|
|
}
|
|
function writeSeedDataIntoCache(now, task, fetchStrategy, route, tree, staleAt, seedData, isResponsePartial, entriesOwnedByCurrentTask) {
|
|
// This function is used to write the result of a runtime server request
|
|
// (CacheNodeSeedData) into the prefetch cache.
|
|
const rsc = seedData[0];
|
|
const loading = seedData[2];
|
|
const isPartial = rsc === null || isResponsePartial;
|
|
fulfillEntrySpawnedByRuntimePrefetch(now, fetchStrategy, route, rsc, loading, isPartial, staleAt, tree, entriesOwnedByCurrentTask);
|
|
// Recursively write the child data into the cache.
|
|
const slots = tree.slots;
|
|
if (slots !== null) {
|
|
const seedDataChildren = seedData[1];
|
|
for(const parallelRouteKey in slots){
|
|
const childTree = slots[parallelRouteKey];
|
|
const childSeedData = seedDataChildren[parallelRouteKey];
|
|
if (childSeedData !== null && childSeedData !== undefined) {
|
|
writeSeedDataIntoCache(now, task, fetchStrategy, route, childTree, staleAt, childSeedData, isResponsePartial, entriesOwnedByCurrentTask);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function fulfillEntrySpawnedByRuntimePrefetch(now, fetchStrategy, route, rsc, loading, isPartial, staleAt, tree, entriesOwnedByCurrentTask) {
|
|
// We should only write into cache entries that are owned by us. Or create
|
|
// a new one and write into that. We must never write over an entry that was
|
|
// created by a different task, because that causes data races.
|
|
const ownedEntry = entriesOwnedByCurrentTask !== null ? entriesOwnedByCurrentTask.get(tree.requestKey) : undefined;
|
|
if (ownedEntry !== undefined) {
|
|
fulfillSegmentCacheEntry(ownedEntry, rsc, loading, staleAt, isPartial);
|
|
} else {
|
|
// There's no matching entry. Attempt to create a new one.
|
|
const possiblyNewEntry = readOrCreateSegmentCacheEntry(now, fetchStrategy, route, tree);
|
|
if (possiblyNewEntry.status === 0) {
|
|
// Confirmed this is a new entry. We can fulfill it.
|
|
const newEntry = possiblyNewEntry;
|
|
fulfillSegmentCacheEntry(upgradeToPendingSegment(newEntry, fetchStrategy), rsc, loading, staleAt, isPartial);
|
|
} else {
|
|
// There was already an entry in the cache. But we may be able to
|
|
// replace it with the new one from the server.
|
|
const newEntry = fulfillSegmentCacheEntry(upgradeToPendingSegment(createDetachedSegmentCacheEntry(staleAt), fetchStrategy), rsc, loading, staleAt, isPartial);
|
|
upsertSegmentEntry(now, (0, _varypath.getSegmentVaryPathForRequest)(fetchStrategy, tree), newEntry);
|
|
}
|
|
}
|
|
}
|
|
async function fetchPrefetchResponse(url, headers) {
|
|
const fetchPriority = 'low';
|
|
// When issuing a prefetch request, don't immediately decode the response; we
|
|
// use the lower level `createFromResponse` API instead because we need to do
|
|
// some extra processing of the response stream. See
|
|
// `createPrefetchResponseStream` for more details.
|
|
const shouldImmediatelyDecode = false;
|
|
const response = await (0, _fetchserverresponse.createFetch)(url, headers, fetchPriority, shouldImmediatelyDecode);
|
|
if (!response.ok) {
|
|
return null;
|
|
}
|
|
// Check the content type
|
|
if ("TURBOPACK compile-time falsy", 0) {
|
|
// In output: "export" mode, we relaxed about the content type, since it's
|
|
// not Next.js that's serving the response. If the status is OK, assume the
|
|
// response is valid. If it's not a valid response, the Flight client won't
|
|
// be able to decode it, and we'll treat it as a miss.
|
|
} else {
|
|
const contentType = response.headers.get('content-type');
|
|
const isFlightResponse = contentType && contentType.startsWith(_approuterheaders.RSC_CONTENT_TYPE_HEADER);
|
|
if (!isFlightResponse) {
|
|
return null;
|
|
}
|
|
}
|
|
return response;
|
|
}
|
|
function createPrefetchResponseStream(originalFlightStream, onStreamClose, onResponseSizeUpdate) {
|
|
// When PPR is enabled, prefetch streams may contain references that never
|
|
// resolve, because that's how we encode dynamic data access. In the decoded
|
|
// object returned by the Flight client, these are reified into hanging
|
|
// promises that suspend during render, which is effectively what we want.
|
|
// The UI resolves when it switches to the dynamic data stream
|
|
// (via useDeferredValue(dynamic, static)).
|
|
//
|
|
// However, the Flight implementation currently errors if the server closes
|
|
// the response before all the references are resolved. As a cheat to work
|
|
// around this, we wrap the original stream in a new stream that never closes,
|
|
// and therefore doesn't error.
|
|
//
|
|
// While processing the original stream, we also incrementally update the size
|
|
// of the cache entry in the LRU.
|
|
let totalByteLength = 0;
|
|
const reader = originalFlightStream.getReader();
|
|
return new ReadableStream({
|
|
async pull (controller) {
|
|
while(true){
|
|
const { done, value } = await reader.read();
|
|
if (!done) {
|
|
// Pass to the target stream and keep consuming the Flight response
|
|
// from the server.
|
|
controller.enqueue(value);
|
|
// Incrementally update the size of the cache entry in the LRU.
|
|
// NOTE: Since prefetch responses are delivered in a single chunk,
|
|
// it's not really necessary to do this streamingly, but I'm doing it
|
|
// anyway in case this changes in the future.
|
|
totalByteLength += value.byteLength;
|
|
onResponseSizeUpdate(totalByteLength);
|
|
continue;
|
|
}
|
|
// The server stream has closed. Exit, but intentionally do not close
|
|
// the target stream. We do notify the caller, though.
|
|
onStreamClose();
|
|
return;
|
|
}
|
|
}
|
|
});
|
|
}
|
|
function addSegmentPathToUrlInOutputExportMode(url, segmentPath) {
|
|
if ("TURBOPACK compile-time falsy", 0) //TURBOPACK unreachable
|
|
;
|
|
return url;
|
|
}
|
|
function canNewFetchStrategyProvideMoreContent(currentStrategy, newStrategy) {
|
|
return currentStrategy < newStrategy;
|
|
}
|
|
if ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') {
|
|
Object.defineProperty(exports.default, '__esModule', {
|
|
value: true
|
|
});
|
|
Object.assign(exports.default, exports);
|
|
module.exports = exports.default;
|
|
} //# sourceMappingURL=cache.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/segment-cache/scheduler.js [app-ssr] (ecmascript)", ((__turbopack_context__, module, exports) => {
|
|
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
0 && (module.exports = {
|
|
cancelPrefetchTask: null,
|
|
isPrefetchTaskDirty: null,
|
|
pingPrefetchTask: null,
|
|
reschedulePrefetchTask: null,
|
|
schedulePrefetchTask: null,
|
|
startRevalidationCooldown: null
|
|
});
|
|
function _export(target, all) {
|
|
for(var name in all)Object.defineProperty(target, name, {
|
|
enumerable: true,
|
|
get: all[name]
|
|
});
|
|
}
|
|
_export(exports, {
|
|
cancelPrefetchTask: function() {
|
|
return cancelPrefetchTask;
|
|
},
|
|
isPrefetchTaskDirty: function() {
|
|
return isPrefetchTaskDirty;
|
|
},
|
|
pingPrefetchTask: function() {
|
|
return pingPrefetchTask;
|
|
},
|
|
reschedulePrefetchTask: function() {
|
|
return reschedulePrefetchTask;
|
|
},
|
|
schedulePrefetchTask: function() {
|
|
return schedulePrefetchTask;
|
|
},
|
|
startRevalidationCooldown: function() {
|
|
return startRevalidationCooldown;
|
|
}
|
|
});
|
|
const _approutertypes = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/shared/lib/app-router-types.js [app-ssr] (ecmascript)");
|
|
const _matchsegments = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/match-segments.js [app-ssr] (ecmascript)");
|
|
const _cache = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/segment-cache/cache.js [app-ssr] (ecmascript)");
|
|
const _varypath = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/segment-cache/vary-path.js [app-ssr] (ecmascript)");
|
|
const _cachekey = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/segment-cache/cache-key.js [app-ssr] (ecmascript)");
|
|
const _types = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/segment-cache/types.js [app-ssr] (ecmascript)");
|
|
const _segment = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/shared/lib/segment.js [app-ssr] (ecmascript)");
|
|
const scheduleMicrotask = typeof queueMicrotask === 'function' ? queueMicrotask : (fn)=>Promise.resolve().then(fn).catch((error)=>setTimeout(()=>{
|
|
throw error;
|
|
}));
|
|
const taskHeap = [];
|
|
let inProgressRequests = 0;
|
|
let sortIdCounter = 0;
|
|
let didScheduleMicrotask = false;
|
|
// The most recently hovered (or touched, etc) link, i.e. the most recent task
|
|
// scheduled at Intent priority. There's only ever a single task at Intent
|
|
// priority at a time. We reserve special network bandwidth for this task only.
|
|
let mostRecentlyHoveredLink = null;
|
|
// CDN cache propagation delay after revalidation (in milliseconds)
|
|
const REVALIDATION_COOLDOWN_MS = 300;
|
|
// Timeout handle for the revalidation cooldown. When non-null, prefetch
|
|
// requests are blocked to allow CDN cache propagation.
|
|
let revalidationCooldownTimeoutHandle = null;
|
|
function startRevalidationCooldown() {
|
|
// Clear any existing timeout in case multiple revalidations happen
|
|
// in quick succession.
|
|
if (revalidationCooldownTimeoutHandle !== null) {
|
|
clearTimeout(revalidationCooldownTimeoutHandle);
|
|
}
|
|
// Schedule the cooldown to expire after the delay.
|
|
revalidationCooldownTimeoutHandle = setTimeout(()=>{
|
|
revalidationCooldownTimeoutHandle = null;
|
|
// Retry the prefetch queue now that the cooldown has expired.
|
|
ensureWorkIsScheduled();
|
|
}, REVALIDATION_COOLDOWN_MS);
|
|
}
|
|
function schedulePrefetchTask(key, treeAtTimeOfPrefetch, fetchStrategy, priority, onInvalidate) {
|
|
// Spawn a new prefetch task
|
|
const task = {
|
|
key,
|
|
treeAtTimeOfPrefetch,
|
|
cacheVersion: (0, _cache.getCurrentCacheVersion)(),
|
|
priority,
|
|
phase: 1,
|
|
hasBackgroundWork: false,
|
|
spawnedRuntimePrefetches: null,
|
|
fetchStrategy,
|
|
sortId: sortIdCounter++,
|
|
isCanceled: false,
|
|
onInvalidate,
|
|
_heapIndex: -1
|
|
};
|
|
trackMostRecentlyHoveredLink(task);
|
|
heapPush(taskHeap, task);
|
|
// Schedule an async task to process the queue.
|
|
//
|
|
// The main reason we process the queue in an async task is for batching.
|
|
// It's common for a single JS task/event to trigger multiple prefetches.
|
|
// By deferring to a microtask, we only process the queue once per JS task.
|
|
// If they have different priorities, it also ensures they are processed in
|
|
// the optimal order.
|
|
ensureWorkIsScheduled();
|
|
return task;
|
|
}
|
|
function cancelPrefetchTask(task) {
|
|
// Remove the prefetch task from the queue. If the task already completed,
|
|
// then this is a no-op.
|
|
//
|
|
// We must also explicitly mark the task as canceled so that a blocked task
|
|
// does not get added back to the queue when it's pinged by the network.
|
|
task.isCanceled = true;
|
|
heapDelete(taskHeap, task);
|
|
}
|
|
function reschedulePrefetchTask(task, treeAtTimeOfPrefetch, fetchStrategy, priority) {
|
|
// Bump the prefetch task to the top of the queue, as if it were a fresh
|
|
// task. This is essentially the same as canceling the task and scheduling
|
|
// a new one, except it reuses the original object.
|
|
//
|
|
// The primary use case is to increase the priority of a Link-initated
|
|
// prefetch on hover.
|
|
// Un-cancel the task, in case it was previously canceled.
|
|
task.isCanceled = false;
|
|
task.phase = 1;
|
|
// Assign a new sort ID to move it ahead of all other tasks at the same
|
|
// priority level. (Higher sort IDs are processed first.)
|
|
task.sortId = sortIdCounter++;
|
|
task.priority = // Intent priority, even if the rescheduled priority is lower.
|
|
task === mostRecentlyHoveredLink ? _types.PrefetchPriority.Intent : priority;
|
|
task.treeAtTimeOfPrefetch = treeAtTimeOfPrefetch;
|
|
task.fetchStrategy = fetchStrategy;
|
|
trackMostRecentlyHoveredLink(task);
|
|
if (task._heapIndex !== -1) {
|
|
// The task is already in the queue.
|
|
heapResift(taskHeap, task);
|
|
} else {
|
|
heapPush(taskHeap, task);
|
|
}
|
|
ensureWorkIsScheduled();
|
|
}
|
|
function isPrefetchTaskDirty(task, nextUrl, tree) {
|
|
// This is used to quickly bail out of a prefetch task if the result is
|
|
// guaranteed to not have changed since the task was initiated. This is
|
|
// strictly an optimization — theoretically, if it always returned true, no
|
|
// behavior should change because a full prefetch task will effectively
|
|
// perform the same checks.
|
|
const currentCacheVersion = (0, _cache.getCurrentCacheVersion)();
|
|
return task.cacheVersion !== currentCacheVersion || task.treeAtTimeOfPrefetch !== tree || task.key.nextUrl !== nextUrl;
|
|
}
|
|
function trackMostRecentlyHoveredLink(task) {
|
|
// Track the mostly recently hovered link, i.e. the most recently scheduled
|
|
// task at Intent priority. There must only be one such task at a time.
|
|
if (task.priority === _types.PrefetchPriority.Intent && task !== mostRecentlyHoveredLink) {
|
|
if (mostRecentlyHoveredLink !== null) {
|
|
// Bump the previously hovered link's priority down to Default.
|
|
if (mostRecentlyHoveredLink.priority !== _types.PrefetchPriority.Background) {
|
|
mostRecentlyHoveredLink.priority = _types.PrefetchPriority.Default;
|
|
heapResift(taskHeap, mostRecentlyHoveredLink);
|
|
}
|
|
}
|
|
mostRecentlyHoveredLink = task;
|
|
}
|
|
}
|
|
function ensureWorkIsScheduled() {
|
|
if (didScheduleMicrotask) {
|
|
// Already scheduled a task to process the queue
|
|
return;
|
|
}
|
|
didScheduleMicrotask = true;
|
|
scheduleMicrotask(processQueueInMicrotask);
|
|
}
|
|
/**
|
|
* Checks if we've exceeded the maximum number of concurrent prefetch requests,
|
|
* to avoid saturating the browser's internal network queue. This is a
|
|
* cooperative limit — prefetch tasks should check this before issuing
|
|
* new requests.
|
|
*
|
|
* Also checks if we're within the revalidation cooldown window, during which
|
|
* prefetch requests are delayed to allow CDN cache propagation.
|
|
*/ function hasNetworkBandwidth(task) {
|
|
// Check if we're within the revalidation cooldown window
|
|
if (revalidationCooldownTimeoutHandle !== null) {
|
|
// We're within the cooldown window. Return false to prevent prefetching.
|
|
// When the cooldown expires, the timeout will call ensureWorkIsScheduled()
|
|
// to retry the queue.
|
|
return false;
|
|
}
|
|
// TODO: Also check if there's an in-progress navigation. We should never
|
|
// add prefetch requests to the network queue if an actual navigation is
|
|
// taking place, to ensure there's sufficient bandwidth for render-blocking
|
|
// data and resources.
|
|
// TODO: Consider reserving some amount of bandwidth for static prefetches.
|
|
if (task.priority === _types.PrefetchPriority.Intent) {
|
|
// The most recently hovered link is allowed to exceed the default limit.
|
|
//
|
|
// The goal is to always have enough bandwidth to start a new prefetch
|
|
// request when hovering over a link.
|
|
//
|
|
// However, because we don't abort in-progress requests, it's still possible
|
|
// we'll run out of bandwidth. When links are hovered in quick succession,
|
|
// there could be multiple hover requests running simultaneously.
|
|
return inProgressRequests < 12;
|
|
}
|
|
// The default limit is lower than the limit for a hovered link.
|
|
return inProgressRequests < 4;
|
|
}
|
|
function spawnPrefetchSubtask(prefetchSubtask) {
|
|
// When the scheduler spawns an async task, we don't await its result.
|
|
// Instead, the async task writes its result directly into the cache, then
|
|
// pings the scheduler to continue.
|
|
//
|
|
// We process server responses streamingly, so the prefetch subtask will
|
|
// likely resolve before we're finished receiving all the data. The subtask
|
|
// result includes a promise that resolves once the network connection is
|
|
// closed. The scheduler uses this to control network bandwidth by tracking
|
|
// and limiting the number of concurrent requests.
|
|
inProgressRequests++;
|
|
return prefetchSubtask.then((result)=>{
|
|
if (result === null) {
|
|
// The prefetch task errored before it could start processing the
|
|
// network stream. Assume the connection is closed.
|
|
onPrefetchConnectionClosed();
|
|
return null;
|
|
}
|
|
// Wait for the connection to close before freeing up more bandwidth.
|
|
result.closed.then(onPrefetchConnectionClosed);
|
|
return result.value;
|
|
});
|
|
}
|
|
function onPrefetchConnectionClosed() {
|
|
inProgressRequests--;
|
|
// Notify the scheduler that we have more bandwidth, and can continue
|
|
// processing tasks.
|
|
ensureWorkIsScheduled();
|
|
}
|
|
function pingPrefetchTask(task) {
|
|
// "Ping" a prefetch that's already in progress to notify it of new data.
|
|
if (task.isCanceled || // Check if prefetch is already queued.
|
|
task._heapIndex !== -1) {
|
|
return;
|
|
}
|
|
// Add the task back to the queue.
|
|
heapPush(taskHeap, task);
|
|
ensureWorkIsScheduled();
|
|
}
|
|
function processQueueInMicrotask() {
|
|
didScheduleMicrotask = false;
|
|
// We aim to minimize how often we read the current time. Since nearly all
|
|
// functions in the prefetch scheduler are synchronous, we can read the time
|
|
// once and pass it as an argument wherever it's needed.
|
|
const now = Date.now();
|
|
// Process the task queue until we run out of network bandwidth.
|
|
let task = heapPeek(taskHeap);
|
|
while(task !== null && hasNetworkBandwidth(task)){
|
|
task.cacheVersion = (0, _cache.getCurrentCacheVersion)();
|
|
const exitStatus = pingRoute(now, task);
|
|
// These fields are only valid for a single attempt. Reset them after each
|
|
// iteration of the task queue.
|
|
const hasBackgroundWork = task.hasBackgroundWork;
|
|
task.hasBackgroundWork = false;
|
|
task.spawnedRuntimePrefetches = null;
|
|
switch(exitStatus){
|
|
case 0:
|
|
// The task yielded because there are too many requests in progress.
|
|
// Stop processing tasks until we have more bandwidth.
|
|
return;
|
|
case 1:
|
|
// The task is blocked. It needs more data before it can proceed.
|
|
// Keep the task out of the queue until the server responds.
|
|
heapPop(taskHeap);
|
|
// Continue to the next task
|
|
task = heapPeek(taskHeap);
|
|
continue;
|
|
case 2:
|
|
if (task.phase === 1) {
|
|
// Finished prefetching the route tree. Proceed to prefetching
|
|
// the segments.
|
|
task.phase = 0;
|
|
heapResift(taskHeap, task);
|
|
} else if (hasBackgroundWork) {
|
|
// The task spawned additional background work. Reschedule the task
|
|
// at background priority.
|
|
task.priority = _types.PrefetchPriority.Background;
|
|
heapResift(taskHeap, task);
|
|
} else {
|
|
// The prefetch is complete. Continue to the next task.
|
|
heapPop(taskHeap);
|
|
}
|
|
task = heapPeek(taskHeap);
|
|
continue;
|
|
default:
|
|
exitStatus;
|
|
}
|
|
}
|
|
}
|
|
/**
|
|
* Check this during a prefetch task to determine if background work can be
|
|
* performed. If so, it evaluates to `true`. Otherwise, it returns `false`,
|
|
* while also scheduling a background task to run later. Usage:
|
|
*
|
|
* @example
|
|
* if (background(task)) {
|
|
* // Perform background-pri work
|
|
* }
|
|
*/ function background(task) {
|
|
if (task.priority === _types.PrefetchPriority.Background) {
|
|
return true;
|
|
}
|
|
task.hasBackgroundWork = true;
|
|
return false;
|
|
}
|
|
function pingRoute(now, task) {
|
|
const key = task.key;
|
|
const route = (0, _cache.readOrCreateRouteCacheEntry)(now, task, key);
|
|
const exitStatus = pingRootRouteTree(now, task, route);
|
|
if (exitStatus !== 0 && key.search !== '') {
|
|
// If the URL has a non-empty search string, also prefetch the pathname
|
|
// without the search string. We use the searchless route tree as a base for
|
|
// optimistic routing; see requestOptimisticRouteCacheEntry for details.
|
|
//
|
|
// Note that we don't need to prefetch any of the segment data. Just the
|
|
// route tree.
|
|
//
|
|
// TODO: This is a temporary solution; the plan is to replace this by adding
|
|
// a wildcard lookup method to the TupleMap implementation. This is
|
|
// non-trivial to implement because it needs to account for things like
|
|
// fallback route entries, hence this temporary workaround.
|
|
const url = new URL(key.pathname, location.origin);
|
|
const keyWithoutSearch = (0, _cachekey.createCacheKey)(url.href, key.nextUrl);
|
|
const routeWithoutSearch = (0, _cache.readOrCreateRouteCacheEntry)(now, task, keyWithoutSearch);
|
|
switch(routeWithoutSearch.status){
|
|
case _cache.EntryStatus.Empty:
|
|
{
|
|
if (background(task)) {
|
|
routeWithoutSearch.status = _cache.EntryStatus.Pending;
|
|
spawnPrefetchSubtask((0, _cache.fetchRouteOnCacheMiss)(routeWithoutSearch, task, keyWithoutSearch));
|
|
}
|
|
break;
|
|
}
|
|
case _cache.EntryStatus.Pending:
|
|
case _cache.EntryStatus.Fulfilled:
|
|
case _cache.EntryStatus.Rejected:
|
|
{
|
|
break;
|
|
}
|
|
default:
|
|
routeWithoutSearch;
|
|
}
|
|
}
|
|
return exitStatus;
|
|
}
|
|
function pingRootRouteTree(now, task, route) {
|
|
switch(route.status){
|
|
case _cache.EntryStatus.Empty:
|
|
{
|
|
// Route is not yet cached, and there's no request already in progress.
|
|
// Spawn a task to request the route, load it into the cache, and ping
|
|
// the task to continue.
|
|
// TODO: There are multiple strategies in the <Link> API for prefetching
|
|
// a route. Currently we've only implemented the main one: per-segment,
|
|
// static-data only.
|
|
//
|
|
// There's also `<Link prefetch={true}>`
|
|
// which prefetch both static *and* dynamic data.
|
|
// Similarly, we need to fallback to the old, per-page
|
|
// behavior if PPR is disabled for a route (via the incremental opt-in).
|
|
//
|
|
// Those cases will be handled here.
|
|
spawnPrefetchSubtask((0, _cache.fetchRouteOnCacheMiss)(route, task, task.key));
|
|
// If the request takes longer than a minute, a subsequent request should
|
|
// retry instead of waiting for this one. When the response is received,
|
|
// this value will be replaced by a new value based on the stale time sent
|
|
// from the server.
|
|
// TODO: We should probably also manually abort the fetch task, to reclaim
|
|
// server bandwidth.
|
|
route.staleAt = now + 60 * 1000;
|
|
// Upgrade to Pending so we know there's already a request in progress
|
|
route.status = _cache.EntryStatus.Pending;
|
|
// Intentional fallthrough to the Pending branch
|
|
}
|
|
case _cache.EntryStatus.Pending:
|
|
{
|
|
// Still pending. We can't start prefetching the segments until the route
|
|
// tree has loaded. Add the task to the set of blocked tasks so that it
|
|
// is notified when the route tree is ready.
|
|
const blockedTasks = route.blockedTasks;
|
|
if (blockedTasks === null) {
|
|
route.blockedTasks = new Set([
|
|
task
|
|
]);
|
|
} else {
|
|
blockedTasks.add(task);
|
|
}
|
|
return 1;
|
|
}
|
|
case _cache.EntryStatus.Rejected:
|
|
{
|
|
// Route tree failed to load. Treat as a 404.
|
|
return 2;
|
|
}
|
|
case _cache.EntryStatus.Fulfilled:
|
|
{
|
|
if (task.phase !== 0) {
|
|
// Do not prefetch segment data until we've entered the segment phase.
|
|
return 2;
|
|
}
|
|
// Recursively fill in the segment tree.
|
|
if (!hasNetworkBandwidth(task)) {
|
|
// Stop prefetching segments until there's more bandwidth.
|
|
return 0;
|
|
}
|
|
const tree = route.tree;
|
|
// A task's fetch strategy gets set to `PPR` for any "auto" prefetch.
|
|
// If it turned out that the route isn't PPR-enabled, we need to use `LoadingBoundary` instead.
|
|
// We don't need to do this for runtime prefetches, because those are only available in
|
|
// `cacheComponents`, where every route is PPR.
|
|
const fetchStrategy = task.fetchStrategy === _types.FetchStrategy.PPR ? route.isPPREnabled ? _types.FetchStrategy.PPR : _types.FetchStrategy.LoadingBoundary : task.fetchStrategy;
|
|
switch(fetchStrategy){
|
|
case _types.FetchStrategy.PPR:
|
|
{
|
|
// For Cache Components pages, each segment may be prefetched
|
|
// statically or using a runtime request, based on various
|
|
// configurations and heuristics. We'll do this in two passes: first
|
|
// traverse the tree and perform all the static prefetches.
|
|
//
|
|
// Then, if there are any segments that need a runtime request,
|
|
// do another pass to perform a runtime prefetch.
|
|
pingStaticHead(now, task, route);
|
|
const exitStatus = pingSharedPartOfCacheComponentsTree(now, task, route, task.treeAtTimeOfPrefetch, tree);
|
|
if (exitStatus === 0) {
|
|
// Child yielded without finishing.
|
|
return 0;
|
|
}
|
|
const spawnedRuntimePrefetches = task.spawnedRuntimePrefetches;
|
|
if (spawnedRuntimePrefetches !== null) {
|
|
// During the first pass, we discovered segments that require a
|
|
// runtime prefetch. Do a second pass to construct a request tree.
|
|
const spawnedEntries = new Map();
|
|
pingRuntimeHead(now, task, route, spawnedEntries, _types.FetchStrategy.PPRRuntime);
|
|
const requestTree = pingRuntimePrefetches(now, task, route, tree, spawnedRuntimePrefetches, spawnedEntries);
|
|
let needsDynamicRequest = spawnedEntries.size > 0;
|
|
if (needsDynamicRequest) {
|
|
// Perform a dynamic prefetch request and populate the cache with
|
|
// the result.
|
|
spawnPrefetchSubtask((0, _cache.fetchSegmentPrefetchesUsingDynamicRequest)(task, route, _types.FetchStrategy.PPRRuntime, requestTree, spawnedEntries));
|
|
}
|
|
}
|
|
return 2;
|
|
}
|
|
case _types.FetchStrategy.Full:
|
|
case _types.FetchStrategy.PPRRuntime:
|
|
case _types.FetchStrategy.LoadingBoundary:
|
|
{
|
|
// Prefetch multiple segments using a single dynamic request.
|
|
// TODO: We can consolidate this branch with previous one by modeling
|
|
// it as if the first segment in the new tree has runtime prefetching
|
|
// enabled. Will do this as a follow-up refactor. Might want to remove
|
|
// the special metatdata case below first. In the meantime, it's not
|
|
// really that much duplication, just would be nice to remove one of
|
|
// these codepaths.
|
|
const spawnedEntries = new Map();
|
|
pingRuntimeHead(now, task, route, spawnedEntries, fetchStrategy);
|
|
const dynamicRequestTree = diffRouteTreeAgainstCurrent(now, task, route, task.treeAtTimeOfPrefetch, tree, spawnedEntries, fetchStrategy);
|
|
let needsDynamicRequest = spawnedEntries.size > 0;
|
|
if (needsDynamicRequest) {
|
|
spawnPrefetchSubtask((0, _cache.fetchSegmentPrefetchesUsingDynamicRequest)(task, route, fetchStrategy, dynamicRequestTree, spawnedEntries));
|
|
}
|
|
return 2;
|
|
}
|
|
default:
|
|
fetchStrategy;
|
|
}
|
|
break;
|
|
}
|
|
default:
|
|
{
|
|
route;
|
|
}
|
|
}
|
|
return 2;
|
|
}
|
|
function pingStaticHead(now, task, route) {
|
|
// The Head data for a page (metadata, viewport) is not really a route
|
|
// segment, in the sense that it doesn't appear in the route tree. But we
|
|
// store it in the cache as if it were, using a special key.
|
|
pingStaticSegmentData(now, task, route, (0, _cache.readOrCreateSegmentCacheEntry)(now, _types.FetchStrategy.PPR, route, route.metadata), task.key, route.metadata);
|
|
}
|
|
function pingRuntimeHead(now, task, route, spawnedEntries, fetchStrategy) {
|
|
pingRouteTreeAndIncludeDynamicData(now, task, route, route.metadata, false, spawnedEntries, // and LoadingBoundary
|
|
fetchStrategy === _types.FetchStrategy.LoadingBoundary ? _types.FetchStrategy.Full : fetchStrategy);
|
|
}
|
|
// TODO: Rename dynamic -> runtime throughout this module
|
|
function pingSharedPartOfCacheComponentsTree(now, task, route, oldTree, newTree) {
|
|
// When Cache Components is enabled (or PPR, or a fully static route when PPR
|
|
// is disabled; those cases are treated equivalently to Cache Components), we
|
|
// start by prefetching each segment individually. Once we reach the "new"
|
|
// part of the tree — the part that doesn't exist on the current page — we
|
|
// may choose to switch to a runtime prefetch instead, based on the
|
|
// information sent by the server in the route tree.
|
|
//
|
|
// The traversal starts in the "shared" part of the tree. Once we reach the
|
|
// "new" part of the tree, we switch to a different traversal,
|
|
// pingNewPartOfCacheComponentsTree.
|
|
// Prefetch this segment's static data.
|
|
const segment = (0, _cache.readOrCreateSegmentCacheEntry)(now, task.fetchStrategy, route, newTree);
|
|
pingStaticSegmentData(now, task, route, segment, task.key, newTree);
|
|
// Recursively ping the children.
|
|
const oldTreeChildren = oldTree[1];
|
|
const newTreeChildren = newTree.slots;
|
|
if (newTreeChildren !== null) {
|
|
for(const parallelRouteKey in newTreeChildren){
|
|
if (!hasNetworkBandwidth(task)) {
|
|
// Stop prefetching segments until there's more bandwidth.
|
|
return 0;
|
|
}
|
|
const newTreeChild = newTreeChildren[parallelRouteKey];
|
|
const newTreeChildSegment = newTreeChild.segment;
|
|
const oldTreeChild = oldTreeChildren[parallelRouteKey];
|
|
const oldTreeChildSegment = oldTreeChild?.[0];
|
|
let childExitStatus;
|
|
if (oldTreeChildSegment !== undefined && doesCurrentSegmentMatchCachedSegment(route, newTreeChildSegment, oldTreeChildSegment)) {
|
|
// We're still in the "shared" part of the tree.
|
|
childExitStatus = pingSharedPartOfCacheComponentsTree(now, task, route, oldTreeChild, newTreeChild);
|
|
} else {
|
|
// We've entered the "new" part of the tree. Switch
|
|
// traversal functions.
|
|
childExitStatus = pingNewPartOfCacheComponentsTree(now, task, route, newTreeChild);
|
|
}
|
|
if (childExitStatus === 0) {
|
|
// Child yielded without finishing.
|
|
return 0;
|
|
}
|
|
}
|
|
}
|
|
return 2;
|
|
}
|
|
function pingNewPartOfCacheComponentsTree(now, task, route, tree) {
|
|
// We're now prefetching in the "new" part of the tree, the part that doesn't
|
|
// exist on the current page. (In other words, we're deeper than the
|
|
// shared layouts.) Segments in here default to being prefetched statically.
|
|
// However, if the server instructs us to, we may switch to a runtime
|
|
// prefetch instead. Traverse the tree and check at each segment.
|
|
if (tree.hasRuntimePrefetch) {
|
|
// This route has a runtime prefetch response. Since we're below the shared
|
|
// layout, everything from this point should be prefetched using a single,
|
|
// combined runtime request, rather than using per-segment static requests.
|
|
// This is true even if some of the child segments are known to be fully
|
|
// static — once we've decided to perform a runtime prefetch, we might as
|
|
// well respond with the static segments in the same roundtrip. (That's how
|
|
// regular navigations work, too.) We'll still skip over segments that are
|
|
// already cached, though.
|
|
//
|
|
// It's the server's responsibility to set a reasonable value of
|
|
// `hasRuntimePrefetch`. Currently it's user-defined, but eventually, the
|
|
// server may send a value of `false` even if the user opts in, if it
|
|
// determines during build that the route is always fully static. There are
|
|
// more optimizations we can do once we implement fallback param
|
|
// tracking, too.
|
|
//
|
|
// Use the task object to collect the segments that need a runtime prefetch.
|
|
// This will signal to the outer task queue that a second traversal is
|
|
// required to construct a request tree.
|
|
if (task.spawnedRuntimePrefetches === null) {
|
|
task.spawnedRuntimePrefetches = new Set([
|
|
tree.requestKey
|
|
]);
|
|
} else {
|
|
task.spawnedRuntimePrefetches.add(tree.requestKey);
|
|
}
|
|
// Then exit the traversal without prefetching anything further.
|
|
return 2;
|
|
}
|
|
// This segment should not be runtime prefetched. Prefetch its static data.
|
|
const segment = (0, _cache.readOrCreateSegmentCacheEntry)(now, task.fetchStrategy, route, tree);
|
|
pingStaticSegmentData(now, task, route, segment, task.key, tree);
|
|
if (tree.slots !== null) {
|
|
if (!hasNetworkBandwidth(task)) {
|
|
// Stop prefetching segments until there's more bandwidth.
|
|
return 0;
|
|
}
|
|
// Recursively ping the children.
|
|
for(const parallelRouteKey in tree.slots){
|
|
const childTree = tree.slots[parallelRouteKey];
|
|
const childExitStatus = pingNewPartOfCacheComponentsTree(now, task, route, childTree);
|
|
if (childExitStatus === 0) {
|
|
// Child yielded without finishing.
|
|
return 0;
|
|
}
|
|
}
|
|
}
|
|
// This segment and all its children have finished prefetching.
|
|
return 2;
|
|
}
|
|
function diffRouteTreeAgainstCurrent(now, task, route, oldTree, newTree, spawnedEntries, fetchStrategy) {
|
|
// This is a single recursive traversal that does multiple things:
|
|
// - Finds the parts of the target route (newTree) that are not part of
|
|
// of the current page (oldTree) by diffing them, using the same algorithm
|
|
// as a real navigation.
|
|
// - Constructs a request tree (FlightRouterState) that describes which
|
|
// segments need to be prefetched and which ones are already cached.
|
|
// - Creates a set of pending cache entries for the segments that need to
|
|
// be prefetched, so that a subsequent prefetch task does not request the
|
|
// same segments again.
|
|
const oldTreeChildren = oldTree[1];
|
|
const newTreeChildren = newTree.slots;
|
|
let requestTreeChildren = {};
|
|
if (newTreeChildren !== null) {
|
|
for(const parallelRouteKey in newTreeChildren){
|
|
const newTreeChild = newTreeChildren[parallelRouteKey];
|
|
const newTreeChildSegment = newTreeChild.segment;
|
|
const oldTreeChild = oldTreeChildren[parallelRouteKey];
|
|
const oldTreeChildSegment = oldTreeChild?.[0];
|
|
if (oldTreeChildSegment !== undefined && doesCurrentSegmentMatchCachedSegment(route, newTreeChildSegment, oldTreeChildSegment)) {
|
|
// This segment is already part of the current route. Keep traversing.
|
|
const requestTreeChild = diffRouteTreeAgainstCurrent(now, task, route, oldTreeChild, newTreeChild, spawnedEntries, fetchStrategy);
|
|
requestTreeChildren[parallelRouteKey] = requestTreeChild;
|
|
} else {
|
|
// This segment is not part of the current route. We're entering a
|
|
// part of the tree that we need to prefetch (unless everything is
|
|
// already cached).
|
|
switch(fetchStrategy){
|
|
case _types.FetchStrategy.LoadingBoundary:
|
|
{
|
|
// When PPR is disabled, we can't prefetch per segment. We must
|
|
// fallback to the old prefetch behavior and send a dynamic request.
|
|
// Only routes that include a loading boundary can be prefetched in
|
|
// this way.
|
|
//
|
|
// This is simlar to a "full" prefetch, but we're much more
|
|
// conservative about which segments to include in the request.
|
|
//
|
|
// The server will only render up to the first loading boundary
|
|
// inside new part of the tree. If there's no loading boundary
|
|
// anywhere in the tree, the server will never return any data, so
|
|
// we can skip the request.
|
|
const subtreeHasLoadingBoundary = newTreeChild.hasLoadingBoundary !== _approutertypes.HasLoadingBoundary.SubtreeHasNoLoadingBoundary;
|
|
const requestTreeChild = subtreeHasLoadingBoundary ? pingPPRDisabledRouteTreeUpToLoadingBoundary(now, task, route, newTreeChild, null, spawnedEntries) : (0, _cache.convertRouteTreeToFlightRouterState)(newTreeChild);
|
|
requestTreeChildren[parallelRouteKey] = requestTreeChild;
|
|
break;
|
|
}
|
|
case _types.FetchStrategy.PPRRuntime:
|
|
{
|
|
// This is a runtime prefetch. Fetch all cacheable data in the tree,
|
|
// not just the static PPR shell.
|
|
const requestTreeChild = pingRouteTreeAndIncludeDynamicData(now, task, route, newTreeChild, false, spawnedEntries, fetchStrategy);
|
|
requestTreeChildren[parallelRouteKey] = requestTreeChild;
|
|
break;
|
|
}
|
|
case _types.FetchStrategy.Full:
|
|
{
|
|
// This is a "full" prefetch. Fetch all the data in the tree, both
|
|
// static and dynamic. We issue roughly the same request that we
|
|
// would during a real navigation. The goal is that once the
|
|
// navigation occurs, the router should not have to fetch any
|
|
// additional data.
|
|
//
|
|
// Although the response will include dynamic data, opting into a
|
|
// Full prefetch — via <Link prefetch={true}> — implicitly
|
|
// instructs the cache to treat the response as "static", or non-
|
|
// dynamic, since the whole point is to cache it for
|
|
// future navigations.
|
|
//
|
|
// Construct a tree (currently a FlightRouterState) that represents
|
|
// which segments need to be prefetched and which ones are already
|
|
// cached. If the tree is empty, then we can exit. Otherwise, we'll
|
|
// send the request tree to the server and use the response to
|
|
// populate the segment cache.
|
|
const requestTreeChild = pingRouteTreeAndIncludeDynamicData(now, task, route, newTreeChild, false, spawnedEntries, fetchStrategy);
|
|
requestTreeChildren[parallelRouteKey] = requestTreeChild;
|
|
break;
|
|
}
|
|
default:
|
|
fetchStrategy;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
const requestTree = [
|
|
newTree.segment,
|
|
requestTreeChildren,
|
|
null,
|
|
null,
|
|
newTree.isRootLayout
|
|
];
|
|
return requestTree;
|
|
}
|
|
function pingPPRDisabledRouteTreeUpToLoadingBoundary(now, task, route, tree, refetchMarkerContext, spawnedEntries) {
|
|
// This function is similar to pingRouteTreeAndIncludeDynamicData, except the
|
|
// server is only going to return a minimal loading state — it will stop
|
|
// rendering at the first loading boundary. Whereas a Full prefetch is
|
|
// intentionally aggressive and tries to pretfetch all the data that will be
|
|
// needed for a navigation, a LoadingBoundary prefetch is much more
|
|
// conservative. For example, it will omit from the request tree any segment
|
|
// that is already cached, regardles of whether it's partial or full. By
|
|
// contrast, a Full prefetch will refetch partial segments.
|
|
// "inside-shared-layout" tells the server where to start looking for a
|
|
// loading boundary.
|
|
let refetchMarker = refetchMarkerContext === null ? 'inside-shared-layout' : null;
|
|
const segment = (0, _cache.readOrCreateSegmentCacheEntry)(now, task.fetchStrategy, route, tree);
|
|
switch(segment.status){
|
|
case _cache.EntryStatus.Empty:
|
|
{
|
|
// This segment is not cached. Add a refetch marker so the server knows
|
|
// to start rendering here.
|
|
// TODO: Instead of a "refetch" marker, we could just omit this subtree's
|
|
// FlightRouterState from the request tree. I think this would probably
|
|
// already work even without any updates to the server. For consistency,
|
|
// though, I'll send the full tree and we'll look into this later as part
|
|
// of a larger redesign of the request protocol.
|
|
// Add the pending cache entry to the result map.
|
|
spawnedEntries.set(tree.requestKey, (0, _cache.upgradeToPendingSegment)(segment, // might not include it in the pending response. If another route is able
|
|
// to issue a per-segment request, we'll do that in the background.
|
|
_types.FetchStrategy.LoadingBoundary));
|
|
if (refetchMarkerContext !== 'refetch') {
|
|
refetchMarker = refetchMarkerContext = 'refetch';
|
|
} else {
|
|
// There's already a parent with a refetch marker, so we don't need
|
|
// to add another one.
|
|
}
|
|
break;
|
|
}
|
|
case _cache.EntryStatus.Fulfilled:
|
|
{
|
|
// The segment is already cached.
|
|
const segmentHasLoadingBoundary = tree.hasLoadingBoundary === _approutertypes.HasLoadingBoundary.SegmentHasLoadingBoundary;
|
|
if (segmentHasLoadingBoundary) {
|
|
// This segment has a loading boundary, which means the server won't
|
|
// render its children. So there's nothing left to prefetch along this
|
|
// path. We can bail out.
|
|
return (0, _cache.convertRouteTreeToFlightRouterState)(tree);
|
|
}
|
|
break;
|
|
}
|
|
case _cache.EntryStatus.Pending:
|
|
{
|
|
break;
|
|
}
|
|
case _cache.EntryStatus.Rejected:
|
|
{
|
|
break;
|
|
}
|
|
default:
|
|
segment;
|
|
}
|
|
const requestTreeChildren = {};
|
|
if (tree.slots !== null) {
|
|
for(const parallelRouteKey in tree.slots){
|
|
const childTree = tree.slots[parallelRouteKey];
|
|
requestTreeChildren[parallelRouteKey] = pingPPRDisabledRouteTreeUpToLoadingBoundary(now, task, route, childTree, refetchMarkerContext, spawnedEntries);
|
|
}
|
|
}
|
|
const requestTree = [
|
|
tree.segment,
|
|
requestTreeChildren,
|
|
null,
|
|
refetchMarker,
|
|
tree.isRootLayout
|
|
];
|
|
return requestTree;
|
|
}
|
|
function pingRouteTreeAndIncludeDynamicData(now, task, route, tree, isInsideRefetchingParent, spawnedEntries, fetchStrategy) {
|
|
// The tree we're constructing is the same shape as the tree we're navigating
|
|
// to. But even though this is a "new" tree, some of the individual segments
|
|
// may be cached as a result of other route prefetches.
|
|
//
|
|
// So we need to find the first uncached segment along each path add an
|
|
// explicit "refetch" marker so the server knows where to start rendering.
|
|
// Once the server starts rendering along a path, it keeps rendering the
|
|
// entire subtree.
|
|
const segment = (0, _cache.readOrCreateSegmentCacheEntry)(now, // and we have to use the former here.
|
|
// We can have a task with `FetchStrategy.PPR` where some of its segments are configured to
|
|
// always use runtime prefetching (via `export const prefetch`), and those should check for
|
|
// entries that include search params.
|
|
fetchStrategy, route, tree);
|
|
let spawnedSegment = null;
|
|
switch(segment.status){
|
|
case _cache.EntryStatus.Empty:
|
|
{
|
|
// This segment is not cached. Include it in the request.
|
|
spawnedSegment = (0, _cache.upgradeToPendingSegment)(segment, fetchStrategy);
|
|
break;
|
|
}
|
|
case _cache.EntryStatus.Fulfilled:
|
|
{
|
|
// The segment is already cached.
|
|
if (segment.isPartial && (0, _cache.canNewFetchStrategyProvideMoreContent)(segment.fetchStrategy, fetchStrategy)) {
|
|
// The cached segment contains dynamic holes, and was prefetched using a less specific strategy than the current one.
|
|
// This means we're in one of these cases:
|
|
// - we have a static prefetch, and we're doing a runtime prefetch
|
|
// - we have a static or runtime prefetch, and we're doing a Full prefetch (or a navigation).
|
|
// In either case, we need to include it in the request to get a more specific (or full) version.
|
|
spawnedSegment = pingFullSegmentRevalidation(now, route, tree, fetchStrategy);
|
|
}
|
|
break;
|
|
}
|
|
case _cache.EntryStatus.Pending:
|
|
case _cache.EntryStatus.Rejected:
|
|
{
|
|
// There's either another prefetch currently in progress, or the previous
|
|
// attempt failed. If the new strategy can provide more content, fetch it again.
|
|
if ((0, _cache.canNewFetchStrategyProvideMoreContent)(segment.fetchStrategy, fetchStrategy)) {
|
|
spawnedSegment = pingFullSegmentRevalidation(now, route, tree, fetchStrategy);
|
|
}
|
|
break;
|
|
}
|
|
default:
|
|
segment;
|
|
}
|
|
const requestTreeChildren = {};
|
|
if (tree.slots !== null) {
|
|
for(const parallelRouteKey in tree.slots){
|
|
const childTree = tree.slots[parallelRouteKey];
|
|
requestTreeChildren[parallelRouteKey] = pingRouteTreeAndIncludeDynamicData(now, task, route, childTree, isInsideRefetchingParent || spawnedSegment !== null, spawnedEntries, fetchStrategy);
|
|
}
|
|
}
|
|
if (spawnedSegment !== null) {
|
|
// Add the pending entry to the result map.
|
|
spawnedEntries.set(tree.requestKey, spawnedSegment);
|
|
}
|
|
// Don't bother to add a refetch marker if one is already present in a parent.
|
|
const refetchMarker = !isInsideRefetchingParent && spawnedSegment !== null ? 'refetch' : null;
|
|
const requestTree = [
|
|
tree.segment,
|
|
requestTreeChildren,
|
|
null,
|
|
refetchMarker,
|
|
tree.isRootLayout
|
|
];
|
|
return requestTree;
|
|
}
|
|
function pingRuntimePrefetches(now, task, route, tree, spawnedRuntimePrefetches, spawnedEntries) {
|
|
// Construct a request tree (FlightRouterState) for a runtime prefetch. If
|
|
// a segment is part of the runtime prefetch, the tree is constructed by
|
|
// diffing against what's already in the prefetch cache. Otherwise, we send
|
|
// a regular FlightRouterState with no special markers.
|
|
//
|
|
// See pingRouteTreeAndIncludeDynamicData for details.
|
|
if (spawnedRuntimePrefetches.has(tree.requestKey)) {
|
|
// This segment needs a runtime prefetch.
|
|
return pingRouteTreeAndIncludeDynamicData(now, task, route, tree, false, spawnedEntries, _types.FetchStrategy.PPRRuntime);
|
|
}
|
|
let requestTreeChildren = {};
|
|
const slots = tree.slots;
|
|
if (slots !== null) {
|
|
for(const parallelRouteKey in slots){
|
|
const childTree = slots[parallelRouteKey];
|
|
requestTreeChildren[parallelRouteKey] = pingRuntimePrefetches(now, task, route, childTree, spawnedRuntimePrefetches, spawnedEntries);
|
|
}
|
|
}
|
|
// This segment is not part of the runtime prefetch. Clone the base tree.
|
|
const requestTree = [
|
|
tree.segment,
|
|
requestTreeChildren,
|
|
null,
|
|
null
|
|
];
|
|
return requestTree;
|
|
}
|
|
function pingStaticSegmentData(now, task, route, segment, routeKey, tree) {
|
|
switch(segment.status){
|
|
case _cache.EntryStatus.Empty:
|
|
// Upgrade to Pending so we know there's already a request in progress
|
|
spawnPrefetchSubtask((0, _cache.fetchSegmentOnCacheMiss)(route, (0, _cache.upgradeToPendingSegment)(segment, _types.FetchStrategy.PPR), routeKey, tree));
|
|
break;
|
|
case _cache.EntryStatus.Pending:
|
|
{
|
|
// There's already a request in progress. Depending on what kind of
|
|
// request it is, we may want to revalidate it.
|
|
switch(segment.fetchStrategy){
|
|
case _types.FetchStrategy.PPR:
|
|
case _types.FetchStrategy.PPRRuntime:
|
|
case _types.FetchStrategy.Full:
|
|
break;
|
|
case _types.FetchStrategy.LoadingBoundary:
|
|
// There's a pending request, but because it's using the old
|
|
// prefetching strategy, we can't be sure if it will be fulfilled by
|
|
// the response — it might be inside the loading boundary. Perform
|
|
// a revalidation, but because it's speculative, wait to do it at
|
|
// background priority.
|
|
if (background(task)) {
|
|
// TODO: Instead of speculatively revalidating, consider including
|
|
// `hasLoading` in the route tree prefetch response.
|
|
pingPPRSegmentRevalidation(now, route, routeKey, tree);
|
|
}
|
|
break;
|
|
default:
|
|
segment.fetchStrategy;
|
|
}
|
|
break;
|
|
}
|
|
case _cache.EntryStatus.Rejected:
|
|
{
|
|
// The existing entry in the cache was rejected. Depending on how it
|
|
// was originally fetched, we may or may not want to revalidate it.
|
|
switch(segment.fetchStrategy){
|
|
case _types.FetchStrategy.PPR:
|
|
case _types.FetchStrategy.PPRRuntime:
|
|
case _types.FetchStrategy.Full:
|
|
break;
|
|
case _types.FetchStrategy.LoadingBoundary:
|
|
// There's a rejected entry, but it was fetched using the loading
|
|
// boundary strategy. So the reason it wasn't returned by the server
|
|
// might just be because it was inside a loading boundary. Or because
|
|
// there was a dynamic rewrite. Revalidate it using the per-
|
|
// segment strategy.
|
|
//
|
|
// Because a rejected segment will definitely prevent the segment (and
|
|
// all of its children) from rendering, we perform this revalidation
|
|
// immediately instead of deferring it to a background task.
|
|
pingPPRSegmentRevalidation(now, route, routeKey, tree);
|
|
break;
|
|
default:
|
|
segment.fetchStrategy;
|
|
}
|
|
break;
|
|
}
|
|
case _cache.EntryStatus.Fulfilled:
|
|
break;
|
|
default:
|
|
segment;
|
|
}
|
|
// Segments do not have dependent tasks, so once the prefetch is initiated,
|
|
// there's nothing else for us to do (except write the server data into the
|
|
// entry, which is handled by `fetchSegmentOnCacheMiss`).
|
|
}
|
|
function pingPPRSegmentRevalidation(now, route, routeKey, tree) {
|
|
const revalidatingSegment = (0, _cache.readOrCreateRevalidatingSegmentEntry)(now, _types.FetchStrategy.PPR, route, tree);
|
|
switch(revalidatingSegment.status){
|
|
case _cache.EntryStatus.Empty:
|
|
// Spawn a prefetch request and upsert the segment into the cache
|
|
// upon completion.
|
|
upsertSegmentOnCompletion(spawnPrefetchSubtask((0, _cache.fetchSegmentOnCacheMiss)(route, (0, _cache.upgradeToPendingSegment)(revalidatingSegment, _types.FetchStrategy.PPR), routeKey, tree)), (0, _varypath.getSegmentVaryPathForRequest)(_types.FetchStrategy.PPR, tree));
|
|
break;
|
|
case _cache.EntryStatus.Pending:
|
|
break;
|
|
case _cache.EntryStatus.Fulfilled:
|
|
case _cache.EntryStatus.Rejected:
|
|
break;
|
|
default:
|
|
revalidatingSegment;
|
|
}
|
|
}
|
|
function pingFullSegmentRevalidation(now, route, tree, fetchStrategy) {
|
|
const revalidatingSegment = (0, _cache.readOrCreateRevalidatingSegmentEntry)(now, fetchStrategy, route, tree);
|
|
if (revalidatingSegment.status === _cache.EntryStatus.Empty) {
|
|
// During a Full/PPRRuntime prefetch, a single dynamic request is made for all the
|
|
// segments that we need. So we don't initiate a request here directly. By
|
|
// returning a pending entry from this function, it signals to the caller
|
|
// that this segment should be included in the request that's sent to
|
|
// the server.
|
|
const pendingSegment = (0, _cache.upgradeToPendingSegment)(revalidatingSegment, fetchStrategy);
|
|
upsertSegmentOnCompletion((0, _cache.waitForSegmentCacheEntry)(pendingSegment), (0, _varypath.getSegmentVaryPathForRequest)(fetchStrategy, tree));
|
|
return pendingSegment;
|
|
} else {
|
|
// There's already a revalidation in progress.
|
|
const nonEmptyRevalidatingSegment = revalidatingSegment;
|
|
if ((0, _cache.canNewFetchStrategyProvideMoreContent)(nonEmptyRevalidatingSegment.fetchStrategy, fetchStrategy)) {
|
|
// The existing revalidation was fetched using a less specific strategy.
|
|
// Reset it and start a new revalidation.
|
|
const emptySegment = (0, _cache.overwriteRevalidatingSegmentCacheEntry)(fetchStrategy, route, tree);
|
|
const pendingSegment = (0, _cache.upgradeToPendingSegment)(emptySegment, fetchStrategy);
|
|
upsertSegmentOnCompletion((0, _cache.waitForSegmentCacheEntry)(pendingSegment), (0, _varypath.getSegmentVaryPathForRequest)(fetchStrategy, tree));
|
|
return pendingSegment;
|
|
}
|
|
switch(nonEmptyRevalidatingSegment.status){
|
|
case _cache.EntryStatus.Pending:
|
|
// There's already an in-progress prefetch that includes this segment.
|
|
return null;
|
|
case _cache.EntryStatus.Fulfilled:
|
|
case _cache.EntryStatus.Rejected:
|
|
// A previous revalidation attempt finished, but we chose not to replace
|
|
// the existing entry in the cache. Don't try again until or unless the
|
|
// revalidation entry expires.
|
|
return null;
|
|
default:
|
|
nonEmptyRevalidatingSegment;
|
|
return null;
|
|
}
|
|
}
|
|
}
|
|
const noop = ()=>{};
|
|
function upsertSegmentOnCompletion(promise, varyPath) {
|
|
// Wait for a segment to finish loading, then upsert it into the cache
|
|
promise.then((fulfilled)=>{
|
|
if (fulfilled !== null) {
|
|
// Received new data. Attempt to replace the existing entry in the cache.
|
|
(0, _cache.upsertSegmentEntry)(Date.now(), varyPath, fulfilled);
|
|
}
|
|
}, noop);
|
|
}
|
|
function doesCurrentSegmentMatchCachedSegment(route, currentSegment, cachedSegment) {
|
|
if (cachedSegment === _segment.PAGE_SEGMENT_KEY) {
|
|
// In the FlightRouterState stored by the router, the page segment has the
|
|
// rendered search params appended to the name of the segment. In the
|
|
// prefetch cache, however, this is stored separately. So, when comparing
|
|
// the router's current FlightRouterState to the cached FlightRouterState,
|
|
// we need to make sure we compare both parts of the segment.
|
|
// TODO: This is not modeled clearly. We use the same type,
|
|
// FlightRouterState, for both the CacheNode tree _and_ the prefetch cache
|
|
// _and_ the server response format, when conceptually those are three
|
|
// different things and treated in different ways. We should encode more of
|
|
// this information into the type design so mistakes are less likely.
|
|
return currentSegment === (0, _segment.addSearchParamsIfPageSegment)(_segment.PAGE_SEGMENT_KEY, Object.fromEntries(new URLSearchParams(route.renderedSearch)));
|
|
}
|
|
// Non-page segments are compared using the same function as the server
|
|
return (0, _matchsegments.matchSegment)(cachedSegment, currentSegment);
|
|
}
|
|
// -----------------------------------------------------------------------------
|
|
// The remainder of the module is a MinHeap implementation. Try not to put any
|
|
// logic below here unless it's related to the heap algorithm. We can extract
|
|
// this to a separate module if/when we need multiple kinds of heaps.
|
|
// -----------------------------------------------------------------------------
|
|
function compareQueuePriority(a, b) {
|
|
// Since the queue is a MinHeap, this should return a positive number if b is
|
|
// higher priority than a, and a negative number if a is higher priority
|
|
// than b.
|
|
// `priority` is an integer, where higher numbers are higher priority.
|
|
const priorityDiff = b.priority - a.priority;
|
|
if (priorityDiff !== 0) {
|
|
return priorityDiff;
|
|
}
|
|
// If the priority is the same, check which phase the prefetch is in — is it
|
|
// prefetching the route tree, or the segments? Route trees are prioritized.
|
|
const phaseDiff = b.phase - a.phase;
|
|
if (phaseDiff !== 0) {
|
|
return phaseDiff;
|
|
}
|
|
// Finally, check the insertion order. `sortId` is an incrementing counter
|
|
// assigned to prefetches. We want to process the newest prefetches first.
|
|
return b.sortId - a.sortId;
|
|
}
|
|
function heapPush(heap, node) {
|
|
const index = heap.length;
|
|
heap.push(node);
|
|
node._heapIndex = index;
|
|
heapSiftUp(heap, node, index);
|
|
}
|
|
function heapPeek(heap) {
|
|
return heap.length === 0 ? null : heap[0];
|
|
}
|
|
function heapPop(heap) {
|
|
if (heap.length === 0) {
|
|
return null;
|
|
}
|
|
const first = heap[0];
|
|
first._heapIndex = -1;
|
|
const last = heap.pop();
|
|
if (last !== first) {
|
|
heap[0] = last;
|
|
last._heapIndex = 0;
|
|
heapSiftDown(heap, last, 0);
|
|
}
|
|
return first;
|
|
}
|
|
function heapDelete(heap, node) {
|
|
const index = node._heapIndex;
|
|
if (index !== -1) {
|
|
node._heapIndex = -1;
|
|
if (heap.length !== 0) {
|
|
const last = heap.pop();
|
|
if (last !== node) {
|
|
heap[index] = last;
|
|
last._heapIndex = index;
|
|
heapSiftDown(heap, last, index);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function heapResift(heap, node) {
|
|
const index = node._heapIndex;
|
|
if (index !== -1) {
|
|
if (index === 0) {
|
|
heapSiftDown(heap, node, 0);
|
|
} else {
|
|
const parentIndex = index - 1 >>> 1;
|
|
const parent = heap[parentIndex];
|
|
if (compareQueuePriority(parent, node) > 0) {
|
|
// The parent is larger. Sift up.
|
|
heapSiftUp(heap, node, index);
|
|
} else {
|
|
// The parent is smaller (or equal). Sift down.
|
|
heapSiftDown(heap, node, index);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function heapSiftUp(heap, node, i) {
|
|
let index = i;
|
|
while(index > 0){
|
|
const parentIndex = index - 1 >>> 1;
|
|
const parent = heap[parentIndex];
|
|
if (compareQueuePriority(parent, node) > 0) {
|
|
// The parent is larger. Swap positions.
|
|
heap[parentIndex] = node;
|
|
node._heapIndex = parentIndex;
|
|
heap[index] = parent;
|
|
parent._heapIndex = index;
|
|
index = parentIndex;
|
|
} else {
|
|
// The parent is smaller. Exit.
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
function heapSiftDown(heap, node, i) {
|
|
let index = i;
|
|
const length = heap.length;
|
|
const halfLength = length >>> 1;
|
|
while(index < halfLength){
|
|
const leftIndex = (index + 1) * 2 - 1;
|
|
const left = heap[leftIndex];
|
|
const rightIndex = leftIndex + 1;
|
|
const right = heap[rightIndex];
|
|
// If the left or right node is smaller, swap with the smaller of those.
|
|
if (compareQueuePriority(left, node) < 0) {
|
|
if (rightIndex < length && compareQueuePriority(right, left) < 0) {
|
|
heap[index] = right;
|
|
right._heapIndex = index;
|
|
heap[rightIndex] = node;
|
|
node._heapIndex = rightIndex;
|
|
index = rightIndex;
|
|
} else {
|
|
heap[index] = left;
|
|
left._heapIndex = index;
|
|
heap[leftIndex] = node;
|
|
node._heapIndex = leftIndex;
|
|
index = leftIndex;
|
|
}
|
|
} else if (rightIndex < length && compareQueuePriority(right, node) < 0) {
|
|
heap[index] = right;
|
|
right._heapIndex = index;
|
|
heap[rightIndex] = node;
|
|
node._heapIndex = rightIndex;
|
|
index = rightIndex;
|
|
} else {
|
|
// Neither child is smaller. Exit.
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
if ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') {
|
|
Object.defineProperty(exports.default, '__esModule', {
|
|
value: true
|
|
});
|
|
Object.assign(exports.default, exports);
|
|
module.exports = exports.default;
|
|
} //# sourceMappingURL=scheduler.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/links.js [app-ssr] (ecmascript)", ((__turbopack_context__, module, exports) => {
|
|
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
0 && (module.exports = {
|
|
IDLE_LINK_STATUS: null,
|
|
PENDING_LINK_STATUS: null,
|
|
mountFormInstance: null,
|
|
mountLinkInstance: null,
|
|
onLinkVisibilityChanged: null,
|
|
onNavigationIntent: null,
|
|
pingVisibleLinks: null,
|
|
setLinkForCurrentNavigation: null,
|
|
unmountLinkForCurrentNavigation: null,
|
|
unmountPrefetchableInstance: null
|
|
});
|
|
function _export(target, all) {
|
|
for(var name in all)Object.defineProperty(target, name, {
|
|
enumerable: true,
|
|
get: all[name]
|
|
});
|
|
}
|
|
_export(exports, {
|
|
IDLE_LINK_STATUS: function() {
|
|
return IDLE_LINK_STATUS;
|
|
},
|
|
PENDING_LINK_STATUS: function() {
|
|
return PENDING_LINK_STATUS;
|
|
},
|
|
mountFormInstance: function() {
|
|
return mountFormInstance;
|
|
},
|
|
mountLinkInstance: function() {
|
|
return mountLinkInstance;
|
|
},
|
|
onLinkVisibilityChanged: function() {
|
|
return onLinkVisibilityChanged;
|
|
},
|
|
onNavigationIntent: function() {
|
|
return onNavigationIntent;
|
|
},
|
|
pingVisibleLinks: function() {
|
|
return pingVisibleLinks;
|
|
},
|
|
setLinkForCurrentNavigation: function() {
|
|
return setLinkForCurrentNavigation;
|
|
},
|
|
unmountLinkForCurrentNavigation: function() {
|
|
return unmountLinkForCurrentNavigation;
|
|
},
|
|
unmountPrefetchableInstance: function() {
|
|
return unmountPrefetchableInstance;
|
|
}
|
|
});
|
|
const _types = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/segment-cache/types.js [app-ssr] (ecmascript)");
|
|
const _cachekey = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/segment-cache/cache-key.js [app-ssr] (ecmascript)");
|
|
const _scheduler = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/segment-cache/scheduler.js [app-ssr] (ecmascript)");
|
|
const _react = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react.js [app-ssr] (ecmascript)");
|
|
// Tracks the most recently navigated link instance. When null, indicates
|
|
// the current navigation was not initiated by a link click.
|
|
let linkForMostRecentNavigation = null;
|
|
const PENDING_LINK_STATUS = {
|
|
pending: true
|
|
};
|
|
const IDLE_LINK_STATUS = {
|
|
pending: false
|
|
};
|
|
function setLinkForCurrentNavigation(link) {
|
|
(0, _react.startTransition)(()=>{
|
|
linkForMostRecentNavigation?.setOptimisticLinkStatus(IDLE_LINK_STATUS);
|
|
link?.setOptimisticLinkStatus(PENDING_LINK_STATUS);
|
|
linkForMostRecentNavigation = link;
|
|
});
|
|
}
|
|
function unmountLinkForCurrentNavigation(link) {
|
|
if (linkForMostRecentNavigation === link) {
|
|
linkForMostRecentNavigation = null;
|
|
}
|
|
}
|
|
// Use a WeakMap to associate a Link instance with its DOM element. This is
|
|
// used by the IntersectionObserver to track the link's visibility.
|
|
const prefetchable = typeof WeakMap === 'function' ? new WeakMap() : new Map();
|
|
// A Set of the currently visible links. We re-prefetch visible links after a
|
|
// cache invalidation, or when the current URL changes. It's a separate data
|
|
// structure from the WeakMap above because only the visible links need to
|
|
// be enumerated.
|
|
const prefetchableAndVisible = new Set();
|
|
// A single IntersectionObserver instance shared by all <Link> components.
|
|
const observer = typeof IntersectionObserver === 'function' ? new IntersectionObserver(handleIntersect, {
|
|
rootMargin: '200px'
|
|
}) : null;
|
|
function observeVisibility(element, instance) {
|
|
const existingInstance = prefetchable.get(element);
|
|
if (existingInstance !== undefined) {
|
|
// This shouldn't happen because each <Link> component should have its own
|
|
// anchor tag instance, but it's defensive coding to avoid a memory leak in
|
|
// case there's a logical error somewhere else.
|
|
unmountPrefetchableInstance(element);
|
|
}
|
|
// Only track prefetchable links that have a valid prefetch URL
|
|
prefetchable.set(element, instance);
|
|
if (observer !== null) {
|
|
observer.observe(element);
|
|
}
|
|
}
|
|
function coercePrefetchableUrl(href) {
|
|
if ("TURBOPACK compile-time falsy", 0) //TURBOPACK unreachable
|
|
;
|
|
else {
|
|
return null;
|
|
}
|
|
}
|
|
function mountLinkInstance(element, href, router, fetchStrategy, prefetchEnabled, setOptimisticLinkStatus) {
|
|
if (prefetchEnabled) {
|
|
const prefetchURL = coercePrefetchableUrl(href);
|
|
if (prefetchURL !== null) {
|
|
const instance = {
|
|
router,
|
|
fetchStrategy,
|
|
isVisible: false,
|
|
prefetchTask: null,
|
|
prefetchHref: prefetchURL.href,
|
|
setOptimisticLinkStatus
|
|
};
|
|
// We only observe the link's visibility if it's prefetchable. For
|
|
// example, this excludes links to external URLs.
|
|
observeVisibility(element, instance);
|
|
return instance;
|
|
}
|
|
}
|
|
// If the link is not prefetchable, we still create an instance so we can
|
|
// track its optimistic state (i.e. useLinkStatus).
|
|
const instance = {
|
|
router,
|
|
fetchStrategy,
|
|
isVisible: false,
|
|
prefetchTask: null,
|
|
prefetchHref: null,
|
|
setOptimisticLinkStatus
|
|
};
|
|
return instance;
|
|
}
|
|
function mountFormInstance(element, href, router, fetchStrategy) {
|
|
const prefetchURL = coercePrefetchableUrl(href);
|
|
if (prefetchURL === null) {
|
|
// This href is not prefetchable, so we don't track it.
|
|
// TODO: We currently observe/unobserve a form every time its href changes.
|
|
// For Links, this isn't a big deal because the href doesn't usually change,
|
|
// but for forms it's extremely common. We should optimize this.
|
|
return;
|
|
}
|
|
const instance = {
|
|
router,
|
|
fetchStrategy,
|
|
isVisible: false,
|
|
prefetchTask: null,
|
|
prefetchHref: prefetchURL.href,
|
|
setOptimisticLinkStatus: null
|
|
};
|
|
observeVisibility(element, instance);
|
|
}
|
|
function unmountPrefetchableInstance(element) {
|
|
const instance = prefetchable.get(element);
|
|
if (instance !== undefined) {
|
|
prefetchable.delete(element);
|
|
prefetchableAndVisible.delete(instance);
|
|
const prefetchTask = instance.prefetchTask;
|
|
if (prefetchTask !== null) {
|
|
(0, _scheduler.cancelPrefetchTask)(prefetchTask);
|
|
}
|
|
}
|
|
if (observer !== null) {
|
|
observer.unobserve(element);
|
|
}
|
|
}
|
|
function handleIntersect(entries) {
|
|
for (const entry of entries){
|
|
// Some extremely old browsers or polyfills don't reliably support
|
|
// isIntersecting so we check intersectionRatio instead. (Do we care? Not
|
|
// really. But whatever this is fine.)
|
|
const isVisible = entry.intersectionRatio > 0;
|
|
onLinkVisibilityChanged(entry.target, isVisible);
|
|
}
|
|
}
|
|
function onLinkVisibilityChanged(element, isVisible) {
|
|
if ("TURBOPACK compile-time truthy", 1) {
|
|
// Prefetching on viewport is disabled in development for performance
|
|
// reasons, because it requires compiling the target page.
|
|
// TODO: Investigate re-enabling this.
|
|
return;
|
|
}
|
|
//TURBOPACK unreachable
|
|
;
|
|
const instance = undefined;
|
|
}
|
|
function onNavigationIntent(element, unstable_upgradeToDynamicPrefetch) {
|
|
const instance = prefetchable.get(element);
|
|
if (instance === undefined) {
|
|
return;
|
|
}
|
|
// Prefetch the link on hover/touchstart.
|
|
if (instance !== undefined) {
|
|
if ("TURBOPACK compile-time falsy", 0) //TURBOPACK unreachable
|
|
;
|
|
rescheduleLinkPrefetch(instance, _types.PrefetchPriority.Intent);
|
|
}
|
|
}
|
|
function rescheduleLinkPrefetch(instance, priority) {
|
|
// Ensures that app-router-instance is not compiled in the server bundle
|
|
if ("TURBOPACK compile-time falsy", 0) //TURBOPACK unreachable
|
|
;
|
|
}
|
|
function pingVisibleLinks(nextUrl, tree) {
|
|
// For each currently visible link, cancel the existing prefetch task (if it
|
|
// exists) and schedule a new one. This is effectively the same as if all the
|
|
// visible links left and then re-entered the viewport.
|
|
//
|
|
// This is called when the Next-Url or the base tree changes, since those
|
|
// may affect the result of a prefetch task. It's also called after a
|
|
// cache invalidation.
|
|
for (const instance of prefetchableAndVisible){
|
|
const task = instance.prefetchTask;
|
|
if (task !== null && !(0, _scheduler.isPrefetchTaskDirty)(task, nextUrl, tree)) {
|
|
continue;
|
|
}
|
|
// Something changed. Cancel the existing prefetch task and schedule a
|
|
// new one.
|
|
if (task !== null) {
|
|
(0, _scheduler.cancelPrefetchTask)(task);
|
|
}
|
|
const cacheKey = (0, _cachekey.createCacheKey)(instance.prefetchHref, nextUrl);
|
|
instance.prefetchTask = (0, _scheduler.schedulePrefetchTask)(cacheKey, tree, instance.fetchStrategy, _types.PrefetchPriority.Default, null);
|
|
}
|
|
}
|
|
if ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') {
|
|
Object.defineProperty(exports.default, '__esModule', {
|
|
value: true
|
|
});
|
|
Object.assign(exports.default, exports);
|
|
module.exports = exports.default;
|
|
} //# sourceMappingURL=links.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/shared/lib/router/utils/path-has-prefix.js [app-ssr] (ecmascript)", ((__turbopack_context__, module, exports) => {
|
|
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
Object.defineProperty(exports, "pathHasPrefix", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return pathHasPrefix;
|
|
}
|
|
});
|
|
const _parsepath = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/shared/lib/router/utils/parse-path.js [app-ssr] (ecmascript)");
|
|
function pathHasPrefix(path, prefix) {
|
|
if (typeof path !== 'string') {
|
|
return false;
|
|
}
|
|
const { pathname } = (0, _parsepath.parsePath)(path);
|
|
return pathname === prefix || pathname.startsWith(prefix + '/');
|
|
} //# sourceMappingURL=path-has-prefix.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/has-base-path.js [app-ssr] (ecmascript)", ((__turbopack_context__, module, exports) => {
|
|
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
Object.defineProperty(exports, "hasBasePath", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return hasBasePath;
|
|
}
|
|
});
|
|
const _pathhasprefix = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/shared/lib/router/utils/path-has-prefix.js [app-ssr] (ecmascript)");
|
|
const basePath = ("TURBOPACK compile-time value", "") || '';
|
|
function hasBasePath(path) {
|
|
return (0, _pathhasprefix.pathHasPrefix)(path, basePath);
|
|
}
|
|
if ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') {
|
|
Object.defineProperty(exports.default, '__esModule', {
|
|
value: true
|
|
});
|
|
Object.assign(exports.default, exports);
|
|
module.exports = exports.default;
|
|
} //# sourceMappingURL=has-base-path.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/shared/lib/router/utils/is-local-url.js [app-ssr] (ecmascript)", ((__turbopack_context__, module, exports) => {
|
|
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
Object.defineProperty(exports, "isLocalURL", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return isLocalURL;
|
|
}
|
|
});
|
|
const _utils = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/shared/lib/utils.js [app-ssr] (ecmascript)");
|
|
const _hasbasepath = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/has-base-path.js [app-ssr] (ecmascript)");
|
|
function isLocalURL(url) {
|
|
// prevent a hydration mismatch on href for url with anchor refs
|
|
if (!(0, _utils.isAbsoluteUrl)(url)) return true;
|
|
try {
|
|
// absolute urls can be local if they are on the same origin
|
|
const locationOrigin = (0, _utils.getLocationOrigin)();
|
|
const resolved = new URL(url, locationOrigin);
|
|
return resolved.origin === locationOrigin && (0, _hasbasepath.hasBasePath)(resolved.pathname);
|
|
} catch (_) {
|
|
return false;
|
|
}
|
|
} //# sourceMappingURL=is-local-url.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/shared/lib/utils/error-once.js [app-ssr] (ecmascript)", ((__turbopack_context__, module, exports) => {
|
|
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
Object.defineProperty(exports, "errorOnce", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return errorOnce;
|
|
}
|
|
});
|
|
let errorOnce = (_)=>{};
|
|
if ("TURBOPACK compile-time truthy", 1) {
|
|
const errors = new Set();
|
|
errorOnce = (msg)=>{
|
|
if (!errors.has(msg)) {
|
|
console.error(msg);
|
|
}
|
|
errors.add(msg);
|
|
};
|
|
} //# sourceMappingURL=error-once.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/app-dir/link.js [app-ssr] (ecmascript)", ((__turbopack_context__, module, exports) => {
|
|
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
0 && (module.exports = {
|
|
default: null,
|
|
useLinkStatus: null
|
|
});
|
|
function _export(target, all) {
|
|
for(var name in all)Object.defineProperty(target, name, {
|
|
enumerable: true,
|
|
get: all[name]
|
|
});
|
|
}
|
|
_export(exports, {
|
|
/**
|
|
* A React component that extends the HTML `<a>` element to provide
|
|
* [prefetching](https://nextjs.org/docs/app/building-your-application/routing/linking-and-navigating#2-prefetching)
|
|
* and client-side navigation. This is the primary way to navigate between routes in Next.js.
|
|
*
|
|
* @remarks
|
|
* - Prefetching is only enabled in production.
|
|
*
|
|
* @see https://nextjs.org/docs/app/api-reference/components/link
|
|
*/ default: function() {
|
|
return LinkComponent;
|
|
},
|
|
useLinkStatus: function() {
|
|
return useLinkStatus;
|
|
}
|
|
});
|
|
const _interop_require_wildcard = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/@swc+helpers@0.5.15/node_modules/@swc/helpers/cjs/_interop_require_wildcard.cjs [app-ssr] (ecmascript)");
|
|
const _jsxruntime = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react-jsx-runtime.js [app-ssr] (ecmascript)");
|
|
const _react = /*#__PURE__*/ _interop_require_wildcard._(__turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react.js [app-ssr] (ecmascript)"));
|
|
const _formaturl = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/shared/lib/router/utils/format-url.js [app-ssr] (ecmascript)");
|
|
const _approutercontextsharedruntime = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/server/route-modules/app-page/vendored/contexts/app-router-context.js [app-ssr] (ecmascript)");
|
|
const _usemergedref = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/use-merged-ref.js [app-ssr] (ecmascript)");
|
|
const _utils = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/shared/lib/utils.js [app-ssr] (ecmascript)");
|
|
const _addbasepath = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/add-base-path.js [app-ssr] (ecmascript)");
|
|
const _warnonce = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/shared/lib/utils/warn-once.js [app-ssr] (ecmascript)");
|
|
const _links = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/links.js [app-ssr] (ecmascript)");
|
|
const _islocalurl = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/shared/lib/router/utils/is-local-url.js [app-ssr] (ecmascript)");
|
|
const _types = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/client/components/segment-cache/types.js [app-ssr] (ecmascript)");
|
|
const _erroronce = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/shared/lib/utils/error-once.js [app-ssr] (ecmascript)");
|
|
function isModifiedEvent(event) {
|
|
const eventTarget = event.currentTarget;
|
|
const target = eventTarget.getAttribute('target');
|
|
return target && target !== '_self' || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey || // triggers resource download
|
|
event.nativeEvent && event.nativeEvent.which === 2;
|
|
}
|
|
function linkClicked(e, href, as, linkInstanceRef, replace, scroll, onNavigate) {
|
|
if ("TURBOPACK compile-time falsy", 0) //TURBOPACK unreachable
|
|
;
|
|
}
|
|
function formatStringOrUrl(urlObjOrString) {
|
|
if (typeof urlObjOrString === 'string') {
|
|
return urlObjOrString;
|
|
}
|
|
return (0, _formaturl.formatUrl)(urlObjOrString);
|
|
}
|
|
function LinkComponent(props) {
|
|
const [linkStatus, setOptimisticLinkStatus] = (0, _react.useOptimistic)(_links.IDLE_LINK_STATUS);
|
|
let children;
|
|
const linkInstanceRef = (0, _react.useRef)(null);
|
|
const { href: hrefProp, as: asProp, children: childrenProp, prefetch: prefetchProp = null, passHref, replace, shallow, scroll, onClick, onMouseEnter: onMouseEnterProp, onTouchStart: onTouchStartProp, legacyBehavior = false, onNavigate, ref: forwardedRef, unstable_dynamicOnHover, ...restProps } = props;
|
|
children = childrenProp;
|
|
if (legacyBehavior && (typeof children === 'string' || typeof children === 'number')) {
|
|
children = /*#__PURE__*/ (0, _jsxruntime.jsx)("a", {
|
|
children: children
|
|
});
|
|
}
|
|
const router = _react.default.useContext(_approutercontextsharedruntime.AppRouterContext);
|
|
const prefetchEnabled = prefetchProp !== false;
|
|
const fetchStrategy = prefetchProp !== false ? getFetchStrategyFromPrefetchProp(prefetchProp) : _types.FetchStrategy.PPR;
|
|
if ("TURBOPACK compile-time truthy", 1) {
|
|
function createPropError(args) {
|
|
return Object.defineProperty(new Error(`Failed prop type: The prop \`${args.key}\` expects a ${args.expected} in \`<Link>\`, but got \`${args.actual}\` instead.` + (("TURBOPACK compile-time falsy", 0) ? "TURBOPACK unreachable" : '')), "__NEXT_ERROR_CODE", {
|
|
value: "E319",
|
|
enumerable: false,
|
|
configurable: true
|
|
});
|
|
}
|
|
// TypeScript trick for type-guarding:
|
|
const requiredPropsGuard = {
|
|
href: true
|
|
};
|
|
const requiredProps = Object.keys(requiredPropsGuard);
|
|
requiredProps.forEach((key)=>{
|
|
if (key === 'href') {
|
|
if (props[key] == null || typeof props[key] !== 'string' && typeof props[key] !== 'object') {
|
|
throw createPropError({
|
|
key,
|
|
expected: '`string` or `object`',
|
|
actual: props[key] === null ? 'null' : typeof props[key]
|
|
});
|
|
}
|
|
} else {
|
|
// TypeScript trick for type-guarding:
|
|
const _ = key;
|
|
}
|
|
});
|
|
// TypeScript trick for type-guarding:
|
|
const optionalPropsGuard = {
|
|
as: true,
|
|
replace: true,
|
|
scroll: true,
|
|
shallow: true,
|
|
passHref: true,
|
|
prefetch: true,
|
|
unstable_dynamicOnHover: true,
|
|
onClick: true,
|
|
onMouseEnter: true,
|
|
onTouchStart: true,
|
|
legacyBehavior: true,
|
|
onNavigate: true
|
|
};
|
|
const optionalProps = Object.keys(optionalPropsGuard);
|
|
optionalProps.forEach((key)=>{
|
|
const valType = typeof props[key];
|
|
if (key === 'as') {
|
|
if (props[key] && valType !== 'string' && valType !== 'object') {
|
|
throw createPropError({
|
|
key,
|
|
expected: '`string` or `object`',
|
|
actual: valType
|
|
});
|
|
}
|
|
} else if (key === 'onClick' || key === 'onMouseEnter' || key === 'onTouchStart' || key === 'onNavigate') {
|
|
if (props[key] && valType !== 'function') {
|
|
throw createPropError({
|
|
key,
|
|
expected: '`function`',
|
|
actual: valType
|
|
});
|
|
}
|
|
} else if (key === 'replace' || key === 'scroll' || key === 'shallow' || key === 'passHref' || key === 'legacyBehavior' || key === 'unstable_dynamicOnHover') {
|
|
if (props[key] != null && valType !== 'boolean') {
|
|
throw createPropError({
|
|
key,
|
|
expected: '`boolean`',
|
|
actual: valType
|
|
});
|
|
}
|
|
} else if (key === 'prefetch') {
|
|
if (props[key] != null && valType !== 'boolean' && props[key] !== 'auto') {
|
|
throw createPropError({
|
|
key,
|
|
expected: '`boolean | "auto"`',
|
|
actual: valType
|
|
});
|
|
}
|
|
} else {
|
|
// TypeScript trick for type-guarding:
|
|
const _ = key;
|
|
}
|
|
});
|
|
}
|
|
if ("TURBOPACK compile-time truthy", 1) {
|
|
if (props.locale) {
|
|
(0, _warnonce.warnOnce)('The `locale` prop is not supported in `next/link` while using the `app` router. Read more about app router internalization: https://nextjs.org/docs/app/building-your-application/routing/internationalization');
|
|
}
|
|
if (!asProp) {
|
|
let href;
|
|
if (typeof hrefProp === 'string') {
|
|
href = hrefProp;
|
|
} else if (typeof hrefProp === 'object' && typeof hrefProp.pathname === 'string') {
|
|
href = hrefProp.pathname;
|
|
}
|
|
if (href) {
|
|
const hasDynamicSegment = href.split('/').some((segment)=>segment.startsWith('[') && segment.endsWith(']'));
|
|
if (hasDynamicSegment) {
|
|
throw Object.defineProperty(new Error(`Dynamic href \`${href}\` found in <Link> while using the \`/app\` router, this is not supported. Read more: https://nextjs.org/docs/messages/app-dir-dynamic-href`), "__NEXT_ERROR_CODE", {
|
|
value: "E267",
|
|
enumerable: false,
|
|
configurable: true
|
|
});
|
|
}
|
|
}
|
|
}
|
|
}
|
|
const { href, as } = _react.default.useMemo(()=>{
|
|
const resolvedHref = formatStringOrUrl(hrefProp);
|
|
return {
|
|
href: resolvedHref,
|
|
as: asProp ? formatStringOrUrl(asProp) : resolvedHref
|
|
};
|
|
}, [
|
|
hrefProp,
|
|
asProp
|
|
]);
|
|
// This will return the first child, if multiple are provided it will throw an error
|
|
let child;
|
|
if (legacyBehavior) {
|
|
if (children?.$$typeof === Symbol.for('react.lazy')) {
|
|
throw Object.defineProperty(new Error(`\`<Link legacyBehavior>\` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's \`<a>\` tag.`), "__NEXT_ERROR_CODE", {
|
|
value: "E863",
|
|
enumerable: false,
|
|
configurable: true
|
|
});
|
|
}
|
|
if ("TURBOPACK compile-time truthy", 1) {
|
|
if (onClick) {
|
|
console.warn(`"onClick" was passed to <Link> with \`href\` of \`${hrefProp}\` but "legacyBehavior" was set. The legacy behavior requires onClick be set on the child of next/link`);
|
|
}
|
|
if (onMouseEnterProp) {
|
|
console.warn(`"onMouseEnter" was passed to <Link> with \`href\` of \`${hrefProp}\` but "legacyBehavior" was set. The legacy behavior requires onMouseEnter be set on the child of next/link`);
|
|
}
|
|
try {
|
|
child = _react.default.Children.only(children);
|
|
} catch (err) {
|
|
if (!children) {
|
|
throw Object.defineProperty(new Error(`No children were passed to <Link> with \`href\` of \`${hrefProp}\` but one child is required https://nextjs.org/docs/messages/link-no-children`), "__NEXT_ERROR_CODE", {
|
|
value: "E320",
|
|
enumerable: false,
|
|
configurable: true
|
|
});
|
|
}
|
|
throw Object.defineProperty(new Error(`Multiple children were passed to <Link> with \`href\` of \`${hrefProp}\` but only one child is supported https://nextjs.org/docs/messages/link-multiple-children` + (("TURBOPACK compile-time falsy", 0) ? "TURBOPACK unreachable" : '')), "__NEXT_ERROR_CODE", {
|
|
value: "E266",
|
|
enumerable: false,
|
|
configurable: true
|
|
});
|
|
}
|
|
} else //TURBOPACK unreachable
|
|
;
|
|
} else {
|
|
if ("TURBOPACK compile-time truthy", 1) {
|
|
if (children?.type === 'a') {
|
|
throw Object.defineProperty(new Error('Invalid <Link> with <a> child. Please remove <a> or use <Link legacyBehavior>.\nLearn more: https://nextjs.org/docs/messages/invalid-new-link-with-extra-anchor'), "__NEXT_ERROR_CODE", {
|
|
value: "E209",
|
|
enumerable: false,
|
|
configurable: true
|
|
});
|
|
}
|
|
}
|
|
}
|
|
const childRef = legacyBehavior ? child && typeof child === 'object' && child.ref : forwardedRef;
|
|
// Use a callback ref to attach an IntersectionObserver to the anchor tag on
|
|
// mount. In the future we will also use this to keep track of all the
|
|
// currently mounted <Link> instances, e.g. so we can re-prefetch them after
|
|
// a revalidation or refresh.
|
|
const observeLinkVisibilityOnMount = _react.default.useCallback((element)=>{
|
|
if (router !== null) {
|
|
linkInstanceRef.current = (0, _links.mountLinkInstance)(element, href, router, fetchStrategy, prefetchEnabled, setOptimisticLinkStatus);
|
|
}
|
|
return ()=>{
|
|
if (linkInstanceRef.current) {
|
|
(0, _links.unmountLinkForCurrentNavigation)(linkInstanceRef.current);
|
|
linkInstanceRef.current = null;
|
|
}
|
|
(0, _links.unmountPrefetchableInstance)(element);
|
|
};
|
|
}, [
|
|
prefetchEnabled,
|
|
href,
|
|
router,
|
|
fetchStrategy,
|
|
setOptimisticLinkStatus
|
|
]);
|
|
const mergedRef = (0, _usemergedref.useMergedRef)(observeLinkVisibilityOnMount, childRef);
|
|
const childProps = {
|
|
ref: mergedRef,
|
|
onClick (e) {
|
|
if ("TURBOPACK compile-time truthy", 1) {
|
|
if (!e) {
|
|
throw Object.defineProperty(new Error(`Component rendered inside next/link has to pass click event to "onClick" prop.`), "__NEXT_ERROR_CODE", {
|
|
value: "E312",
|
|
enumerable: false,
|
|
configurable: true
|
|
});
|
|
}
|
|
}
|
|
if (!legacyBehavior && typeof onClick === 'function') {
|
|
onClick(e);
|
|
}
|
|
if (legacyBehavior && child.props && typeof child.props.onClick === 'function') {
|
|
child.props.onClick(e);
|
|
}
|
|
if (!router) {
|
|
return;
|
|
}
|
|
if (e.defaultPrevented) {
|
|
return;
|
|
}
|
|
linkClicked(e, href, as, linkInstanceRef, replace, scroll, onNavigate);
|
|
},
|
|
onMouseEnter (e) {
|
|
if (!legacyBehavior && typeof onMouseEnterProp === 'function') {
|
|
onMouseEnterProp(e);
|
|
}
|
|
if (legacyBehavior && child.props && typeof child.props.onMouseEnter === 'function') {
|
|
child.props.onMouseEnter(e);
|
|
}
|
|
if (!router) {
|
|
return;
|
|
}
|
|
if ("TURBOPACK compile-time truthy", 1) {
|
|
return;
|
|
}
|
|
//TURBOPACK unreachable
|
|
;
|
|
const upgradeToDynamicPrefetch = undefined;
|
|
},
|
|
onTouchStart: ("TURBOPACK compile-time falsy", 0) ? "TURBOPACK unreachable" : function onTouchStart(e) {
|
|
if (!legacyBehavior && typeof onTouchStartProp === 'function') {
|
|
onTouchStartProp(e);
|
|
}
|
|
if (legacyBehavior && child.props && typeof child.props.onTouchStart === 'function') {
|
|
child.props.onTouchStart(e);
|
|
}
|
|
if (!router) {
|
|
return;
|
|
}
|
|
if (!prefetchEnabled) {
|
|
return;
|
|
}
|
|
const upgradeToDynamicPrefetch = unstable_dynamicOnHover === true;
|
|
(0, _links.onNavigationIntent)(e.currentTarget, upgradeToDynamicPrefetch);
|
|
}
|
|
};
|
|
// If the url is absolute, we can bypass the logic to prepend the basePath.
|
|
if ((0, _utils.isAbsoluteUrl)(as)) {
|
|
childProps.href = as;
|
|
} else if (!legacyBehavior || passHref || child.type === 'a' && !('href' in child.props)) {
|
|
childProps.href = (0, _addbasepath.addBasePath)(as);
|
|
}
|
|
let link;
|
|
if (legacyBehavior) {
|
|
if ("TURBOPACK compile-time truthy", 1) {
|
|
(0, _erroronce.errorOnce)('`legacyBehavior` is deprecated and will be removed in a future ' + 'release. A codemod is available to upgrade your components:\n\n' + 'npx @next/codemod@latest new-link .\n\n' + 'Learn more: https://nextjs.org/docs/app/building-your-application/upgrading/codemods#remove-a-tags-from-link-components');
|
|
}
|
|
link = /*#__PURE__*/ _react.default.cloneElement(child, childProps);
|
|
} else {
|
|
link = /*#__PURE__*/ (0, _jsxruntime.jsx)("a", {
|
|
...restProps,
|
|
...childProps,
|
|
children: children
|
|
});
|
|
}
|
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(LinkStatusContext.Provider, {
|
|
value: linkStatus,
|
|
children: link
|
|
});
|
|
}
|
|
const LinkStatusContext = /*#__PURE__*/ (0, _react.createContext)(_links.IDLE_LINK_STATUS);
|
|
const useLinkStatus = ()=>{
|
|
return (0, _react.useContext)(LinkStatusContext);
|
|
};
|
|
function getFetchStrategyFromPrefetchProp(prefetchProp) {
|
|
if ("TURBOPACK compile-time falsy", 0) //TURBOPACK unreachable
|
|
;
|
|
else {
|
|
return prefetchProp === null || prefetchProp === 'auto' ? _types.FetchStrategy.PPR : // (although invalid values should've been filtered out by prop validation in dev)
|
|
_types.FetchStrategy.Full;
|
|
}
|
|
}
|
|
if ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') {
|
|
Object.defineProperty(exports.default, '__esModule', {
|
|
value: true
|
|
});
|
|
Object.assign(exports.default, exports);
|
|
module.exports = exports.default;
|
|
} //# sourceMappingURL=link.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/lucide-react@0.454.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/book-open.js [app-ssr] (ecmascript)", ((__turbopack_context__) => {
|
|
"use strict";
|
|
|
|
/**
|
|
* @license lucide-react v0.454.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/ __turbopack_context__.s([
|
|
"default",
|
|
()=>BookOpen
|
|
]);
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$lucide$2d$react$40$0$2e$454$2e$0_react$40$19$2e$2$2e$0$2f$node_modules$2f$lucide$2d$react$2f$dist$2f$esm$2f$createLucideIcon$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/lucide-react@0.454.0_react@19.2.0/node_modules/lucide-react/dist/esm/createLucideIcon.js [app-ssr] (ecmascript)");
|
|
;
|
|
const BookOpen = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$lucide$2d$react$40$0$2e$454$2e$0_react$40$19$2e$2$2e$0$2f$node_modules$2f$lucide$2d$react$2f$dist$2f$esm$2f$createLucideIcon$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["default"])("BookOpen", [
|
|
[
|
|
"path",
|
|
{
|
|
d: "M12 7v14",
|
|
key: "1akyts"
|
|
}
|
|
],
|
|
[
|
|
"path",
|
|
{
|
|
d: "M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",
|
|
key: "ruj8y"
|
|
}
|
|
]
|
|
]);
|
|
;
|
|
//# sourceMappingURL=book-open.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/lucide-react@0.454.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/book-open.js [app-ssr] (ecmascript) <export default as BookOpen>", ((__turbopack_context__) => {
|
|
"use strict";
|
|
|
|
__turbopack_context__.s([
|
|
"BookOpen",
|
|
()=>__TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$lucide$2d$react$40$0$2e$454$2e$0_react$40$19$2e$2$2e$0$2f$node_modules$2f$lucide$2d$react$2f$dist$2f$esm$2f$icons$2f$book$2d$open$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["default"]
|
|
]);
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$lucide$2d$react$40$0$2e$454$2e$0_react$40$19$2e$2$2e$0$2f$node_modules$2f$lucide$2d$react$2f$dist$2f$esm$2f$icons$2f$book$2d$open$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/lucide-react@0.454.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/book-open.js [app-ssr] (ecmascript)");
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/lucide-react@0.454.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/search.js [app-ssr] (ecmascript)", ((__turbopack_context__) => {
|
|
"use strict";
|
|
|
|
/**
|
|
* @license lucide-react v0.454.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/ __turbopack_context__.s([
|
|
"default",
|
|
()=>Search
|
|
]);
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$lucide$2d$react$40$0$2e$454$2e$0_react$40$19$2e$2$2e$0$2f$node_modules$2f$lucide$2d$react$2f$dist$2f$esm$2f$createLucideIcon$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/lucide-react@0.454.0_react@19.2.0/node_modules/lucide-react/dist/esm/createLucideIcon.js [app-ssr] (ecmascript)");
|
|
;
|
|
const Search = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$lucide$2d$react$40$0$2e$454$2e$0_react$40$19$2e$2$2e$0$2f$node_modules$2f$lucide$2d$react$2f$dist$2f$esm$2f$createLucideIcon$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["default"])("Search", [
|
|
[
|
|
"circle",
|
|
{
|
|
cx: "11",
|
|
cy: "11",
|
|
r: "8",
|
|
key: "4ej97u"
|
|
}
|
|
],
|
|
[
|
|
"path",
|
|
{
|
|
d: "m21 21-4.3-4.3",
|
|
key: "1qie3q"
|
|
}
|
|
]
|
|
]);
|
|
;
|
|
//# sourceMappingURL=search.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/lucide-react@0.454.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/search.js [app-ssr] (ecmascript) <export default as Search>", ((__turbopack_context__) => {
|
|
"use strict";
|
|
|
|
__turbopack_context__.s([
|
|
"Search",
|
|
()=>__TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$lucide$2d$react$40$0$2e$454$2e$0_react$40$19$2e$2$2e$0$2f$node_modules$2f$lucide$2d$react$2f$dist$2f$esm$2f$icons$2f$search$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["default"]
|
|
]);
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$lucide$2d$react$40$0$2e$454$2e$0_react$40$19$2e$2$2e$0$2f$node_modules$2f$lucide$2d$react$2f$dist$2f$esm$2f$icons$2f$search$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/lucide-react@0.454.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/search.js [app-ssr] (ecmascript)");
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/lucide-react@0.454.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/bell.js [app-ssr] (ecmascript)", ((__turbopack_context__) => {
|
|
"use strict";
|
|
|
|
/**
|
|
* @license lucide-react v0.454.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/ __turbopack_context__.s([
|
|
"default",
|
|
()=>Bell
|
|
]);
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$lucide$2d$react$40$0$2e$454$2e$0_react$40$19$2e$2$2e$0$2f$node_modules$2f$lucide$2d$react$2f$dist$2f$esm$2f$createLucideIcon$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/lucide-react@0.454.0_react@19.2.0/node_modules/lucide-react/dist/esm/createLucideIcon.js [app-ssr] (ecmascript)");
|
|
;
|
|
const Bell = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$lucide$2d$react$40$0$2e$454$2e$0_react$40$19$2e$2$2e$0$2f$node_modules$2f$lucide$2d$react$2f$dist$2f$esm$2f$createLucideIcon$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["default"])("Bell", [
|
|
[
|
|
"path",
|
|
{
|
|
d: "M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",
|
|
key: "1qo2s2"
|
|
}
|
|
],
|
|
[
|
|
"path",
|
|
{
|
|
d: "M10.3 21a1.94 1.94 0 0 0 3.4 0",
|
|
key: "qgo35s"
|
|
}
|
|
]
|
|
]);
|
|
;
|
|
//# sourceMappingURL=bell.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/lucide-react@0.454.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/bell.js [app-ssr] (ecmascript) <export default as Bell>", ((__turbopack_context__) => {
|
|
"use strict";
|
|
|
|
__turbopack_context__.s([
|
|
"Bell",
|
|
()=>__TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$lucide$2d$react$40$0$2e$454$2e$0_react$40$19$2e$2$2e$0$2f$node_modules$2f$lucide$2d$react$2f$dist$2f$esm$2f$icons$2f$bell$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["default"]
|
|
]);
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$lucide$2d$react$40$0$2e$454$2e$0_react$40$19$2e$2$2e$0$2f$node_modules$2f$lucide$2d$react$2f$dist$2f$esm$2f$icons$2f$bell$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/lucide-react@0.454.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/bell.js [app-ssr] (ecmascript)");
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/lucide-react@0.454.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/settings.js [app-ssr] (ecmascript)", ((__turbopack_context__) => {
|
|
"use strict";
|
|
|
|
/**
|
|
* @license lucide-react v0.454.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/ __turbopack_context__.s([
|
|
"default",
|
|
()=>Settings
|
|
]);
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$lucide$2d$react$40$0$2e$454$2e$0_react$40$19$2e$2$2e$0$2f$node_modules$2f$lucide$2d$react$2f$dist$2f$esm$2f$createLucideIcon$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/lucide-react@0.454.0_react@19.2.0/node_modules/lucide-react/dist/esm/createLucideIcon.js [app-ssr] (ecmascript)");
|
|
;
|
|
const Settings = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$lucide$2d$react$40$0$2e$454$2e$0_react$40$19$2e$2$2e$0$2f$node_modules$2f$lucide$2d$react$2f$dist$2f$esm$2f$createLucideIcon$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["default"])("Settings", [
|
|
[
|
|
"path",
|
|
{
|
|
d: "M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",
|
|
key: "1qme2f"
|
|
}
|
|
],
|
|
[
|
|
"circle",
|
|
{
|
|
cx: "12",
|
|
cy: "12",
|
|
r: "3",
|
|
key: "1v7zrd"
|
|
}
|
|
]
|
|
]);
|
|
;
|
|
//# sourceMappingURL=settings.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/lucide-react@0.454.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/settings.js [app-ssr] (ecmascript) <export default as Settings>", ((__turbopack_context__) => {
|
|
"use strict";
|
|
|
|
__turbopack_context__.s([
|
|
"Settings",
|
|
()=>__TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$lucide$2d$react$40$0$2e$454$2e$0_react$40$19$2e$2$2e$0$2f$node_modules$2f$lucide$2d$react$2f$dist$2f$esm$2f$icons$2f$settings$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["default"]
|
|
]);
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$lucide$2d$react$40$0$2e$454$2e$0_react$40$19$2e$2$2e$0$2f$node_modules$2f$lucide$2d$react$2f$dist$2f$esm$2f$icons$2f$settings$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/lucide-react@0.454.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/settings.js [app-ssr] (ecmascript)");
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/@radix-ui+react-context@1.1.1_@types+react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-context/dist/index.mjs [app-ssr] (ecmascript)", ((__turbopack_context__) => {
|
|
"use strict";
|
|
|
|
// packages/react/context/src/createContext.tsx
|
|
__turbopack_context__.s([
|
|
"createContext",
|
|
()=>createContext2,
|
|
"createContextScope",
|
|
()=>createContextScope
|
|
]);
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$next$40$16$2e$0$2e$3_react$2d$dom$40$19$2e$2$2e$0_react$40$19$2e$2$2e$0_$5f$react$40$19$2e$2$2e$0$2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$ssr$2f$react$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react.js [app-ssr] (ecmascript)");
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$next$40$16$2e$0$2e$3_react$2d$dom$40$19$2e$2$2e$0_react$40$19$2e$2$2e$0_$5f$react$40$19$2e$2$2e$0$2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$ssr$2f$react$2d$jsx$2d$runtime$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react-jsx-runtime.js [app-ssr] (ecmascript)");
|
|
;
|
|
;
|
|
function createContext2(rootComponentName, defaultContext) {
|
|
const Context = __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$next$40$16$2e$0$2e$3_react$2d$dom$40$19$2e$2$2e$0_react$40$19$2e$2$2e$0_$5f$react$40$19$2e$2$2e$0$2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$ssr$2f$react$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["createContext"](defaultContext);
|
|
const Provider = (props)=>{
|
|
const { children, ...context } = props;
|
|
const value = __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$next$40$16$2e$0$2e$3_react$2d$dom$40$19$2e$2$2e$0_react$40$19$2e$2$2e$0_$5f$react$40$19$2e$2$2e$0$2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$ssr$2f$react$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["useMemo"](()=>context, Object.values(context));
|
|
return /* @__PURE__ */ (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$next$40$16$2e$0$2e$3_react$2d$dom$40$19$2e$2$2e$0_react$40$19$2e$2$2e$0_$5f$react$40$19$2e$2$2e$0$2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$ssr$2f$react$2d$jsx$2d$runtime$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["jsx"])(Context.Provider, {
|
|
value,
|
|
children
|
|
});
|
|
};
|
|
Provider.displayName = rootComponentName + "Provider";
|
|
function useContext2(consumerName) {
|
|
const context = __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$next$40$16$2e$0$2e$3_react$2d$dom$40$19$2e$2$2e$0_react$40$19$2e$2$2e$0_$5f$react$40$19$2e$2$2e$0$2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$ssr$2f$react$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["useContext"](Context);
|
|
if (context) return context;
|
|
if (defaultContext !== void 0) return defaultContext;
|
|
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
}
|
|
return [
|
|
Provider,
|
|
useContext2
|
|
];
|
|
}
|
|
function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
let defaultContexts = [];
|
|
function createContext3(rootComponentName, defaultContext) {
|
|
const BaseContext = __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$next$40$16$2e$0$2e$3_react$2d$dom$40$19$2e$2$2e$0_react$40$19$2e$2$2e$0_$5f$react$40$19$2e$2$2e$0$2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$ssr$2f$react$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["createContext"](defaultContext);
|
|
const index = defaultContexts.length;
|
|
defaultContexts = [
|
|
...defaultContexts,
|
|
defaultContext
|
|
];
|
|
const Provider = (props)=>{
|
|
const { scope, children, ...context } = props;
|
|
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
|
const value = __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$next$40$16$2e$0$2e$3_react$2d$dom$40$19$2e$2$2e$0_react$40$19$2e$2$2e$0_$5f$react$40$19$2e$2$2e$0$2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$ssr$2f$react$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["useMemo"](()=>context, Object.values(context));
|
|
return /* @__PURE__ */ (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$next$40$16$2e$0$2e$3_react$2d$dom$40$19$2e$2$2e$0_react$40$19$2e$2$2e$0_$5f$react$40$19$2e$2$2e$0$2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$ssr$2f$react$2d$jsx$2d$runtime$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["jsx"])(Context.Provider, {
|
|
value,
|
|
children
|
|
});
|
|
};
|
|
Provider.displayName = rootComponentName + "Provider";
|
|
function useContext2(consumerName, scope) {
|
|
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
|
const context = __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$next$40$16$2e$0$2e$3_react$2d$dom$40$19$2e$2$2e$0_react$40$19$2e$2$2e$0_$5f$react$40$19$2e$2$2e$0$2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$ssr$2f$react$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["useContext"](Context);
|
|
if (context) return context;
|
|
if (defaultContext !== void 0) return defaultContext;
|
|
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
}
|
|
return [
|
|
Provider,
|
|
useContext2
|
|
];
|
|
}
|
|
const createScope = ()=>{
|
|
const scopeContexts = defaultContexts.map((defaultContext)=>{
|
|
return __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$next$40$16$2e$0$2e$3_react$2d$dom$40$19$2e$2$2e$0_react$40$19$2e$2$2e$0_$5f$react$40$19$2e$2$2e$0$2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$ssr$2f$react$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["createContext"](defaultContext);
|
|
});
|
|
return function useScope(scope) {
|
|
const contexts = scope?.[scopeName] || scopeContexts;
|
|
return __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$next$40$16$2e$0$2e$3_react$2d$dom$40$19$2e$2$2e$0_react$40$19$2e$2$2e$0_$5f$react$40$19$2e$2$2e$0$2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$ssr$2f$react$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["useMemo"](()=>({
|
|
[`__scope${scopeName}`]: {
|
|
...scope,
|
|
[scopeName]: contexts
|
|
}
|
|
}), [
|
|
scope,
|
|
contexts
|
|
]);
|
|
};
|
|
};
|
|
createScope.scopeName = scopeName;
|
|
return [
|
|
createContext3,
|
|
composeContextScopes(createScope, ...createContextScopeDeps)
|
|
];
|
|
}
|
|
function composeContextScopes(...scopes) {
|
|
const baseScope = scopes[0];
|
|
if (scopes.length === 1) return baseScope;
|
|
const createScope = ()=>{
|
|
const scopeHooks = scopes.map((createScope2)=>({
|
|
useScope: createScope2(),
|
|
scopeName: createScope2.scopeName
|
|
}));
|
|
return function useComposedScopes(overrideScopes) {
|
|
const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName })=>{
|
|
const scopeProps = useScope(overrideScopes);
|
|
const currentScope = scopeProps[`__scope${scopeName}`];
|
|
return {
|
|
...nextScopes2,
|
|
...currentScope
|
|
};
|
|
}, {});
|
|
return __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$next$40$16$2e$0$2e$3_react$2d$dom$40$19$2e$2$2e$0_react$40$19$2e$2$2e$0_$5f$react$40$19$2e$2$2e$0$2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$ssr$2f$react$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["useMemo"](()=>({
|
|
[`__scope${baseScope.scopeName}`]: nextScopes
|
|
}), [
|
|
nextScopes
|
|
]);
|
|
};
|
|
};
|
|
createScope.scopeName = baseScope.scopeName;
|
|
return createScope;
|
|
}
|
|
;
|
|
//# sourceMappingURL=index.mjs.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/@radix-ui+react-use-callback-ref@1.1.0_@types+react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs [app-ssr] (ecmascript)", ((__turbopack_context__) => {
|
|
"use strict";
|
|
|
|
// packages/react/use-callback-ref/src/useCallbackRef.tsx
|
|
__turbopack_context__.s([
|
|
"useCallbackRef",
|
|
()=>useCallbackRef
|
|
]);
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$next$40$16$2e$0$2e$3_react$2d$dom$40$19$2e$2$2e$0_react$40$19$2e$2$2e$0_$5f$react$40$19$2e$2$2e$0$2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$ssr$2f$react$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react.js [app-ssr] (ecmascript)");
|
|
;
|
|
function useCallbackRef(callback) {
|
|
const callbackRef = __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$next$40$16$2e$0$2e$3_react$2d$dom$40$19$2e$2$2e$0_react$40$19$2e$2$2e$0_$5f$react$40$19$2e$2$2e$0$2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$ssr$2f$react$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["useRef"](callback);
|
|
__TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$next$40$16$2e$0$2e$3_react$2d$dom$40$19$2e$2$2e$0_react$40$19$2e$2$2e$0_$5f$react$40$19$2e$2$2e$0$2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$ssr$2f$react$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["useEffect"](()=>{
|
|
callbackRef.current = callback;
|
|
});
|
|
return __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$next$40$16$2e$0$2e$3_react$2d$dom$40$19$2e$2$2e$0_react$40$19$2e$2$2e$0_$5f$react$40$19$2e$2$2e$0$2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$ssr$2f$react$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["useMemo"](()=>(...args)=>callbackRef.current?.(...args), []);
|
|
}
|
|
;
|
|
//# sourceMappingURL=index.mjs.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/@radix-ui+react-use-layout-effect@1.1.0_@types+react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs [app-ssr] (ecmascript)", ((__turbopack_context__) => {
|
|
"use strict";
|
|
|
|
// packages/react/use-layout-effect/src/useLayoutEffect.tsx
|
|
__turbopack_context__.s([
|
|
"useLayoutEffect",
|
|
()=>useLayoutEffect2
|
|
]);
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$next$40$16$2e$0$2e$3_react$2d$dom$40$19$2e$2$2e$0_react$40$19$2e$2$2e$0_$5f$react$40$19$2e$2$2e$0$2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$ssr$2f$react$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react.js [app-ssr] (ecmascript)");
|
|
;
|
|
var useLayoutEffect2 = Boolean(globalThis?.document) ? __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$next$40$16$2e$0$2e$3_react$2d$dom$40$19$2e$2$2e$0_react$40$19$2e$2$2e$0_$5f$react$40$19$2e$2$2e$0$2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$ssr$2f$react$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["useLayoutEffect"] : ()=>{};
|
|
;
|
|
//# sourceMappingURL=index.mjs.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react-dom.js [app-ssr] (ecmascript)", ((__turbopack_context__, module, exports) => {
|
|
"use strict";
|
|
|
|
module.exports = __turbopack_context__.r("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/server/route-modules/app-page/module.compiled.js [app-ssr] (ecmascript)").vendored['react-ssr'].ReactDOM; //# sourceMappingURL=react-dom.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/@radix-ui+react-primitive@2.0.1_@types+react-dom@19.2.3_@types+react@19.2.6__@types+rea_4f53963f71a6eb8b0116fe0dd1078946/node_modules/@radix-ui/react-primitive/dist/index.mjs [app-ssr] (ecmascript)", ((__turbopack_context__) => {
|
|
"use strict";
|
|
|
|
// packages/react/primitive/src/Primitive.tsx
|
|
__turbopack_context__.s([
|
|
"Primitive",
|
|
()=>Primitive,
|
|
"Root",
|
|
()=>Root,
|
|
"dispatchDiscreteCustomEvent",
|
|
()=>dispatchDiscreteCustomEvent
|
|
]);
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$next$40$16$2e$0$2e$3_react$2d$dom$40$19$2e$2$2e$0_react$40$19$2e$2$2e$0_$5f$react$40$19$2e$2$2e$0$2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$ssr$2f$react$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react.js [app-ssr] (ecmascript)");
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$next$40$16$2e$0$2e$3_react$2d$dom$40$19$2e$2$2e$0_react$40$19$2e$2$2e$0_$5f$react$40$19$2e$2$2e$0$2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$ssr$2f$react$2d$dom$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react-dom.js [app-ssr] (ecmascript)");
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$radix$2d$ui$2b$react$2d$slot$40$1$2e$1$2e$1_$40$types$2b$react$40$19$2e$2$2e$6_react$40$19$2e$2$2e$0$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$slot$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/@radix-ui+react-slot@1.1.1_@types+react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-slot/dist/index.mjs [app-ssr] (ecmascript)");
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$next$40$16$2e$0$2e$3_react$2d$dom$40$19$2e$2$2e$0_react$40$19$2e$2$2e$0_$5f$react$40$19$2e$2$2e$0$2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$ssr$2f$react$2d$jsx$2d$runtime$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react-jsx-runtime.js [app-ssr] (ecmascript)");
|
|
;
|
|
;
|
|
;
|
|
;
|
|
var NODES = [
|
|
"a",
|
|
"button",
|
|
"div",
|
|
"form",
|
|
"h2",
|
|
"h3",
|
|
"img",
|
|
"input",
|
|
"label",
|
|
"li",
|
|
"nav",
|
|
"ol",
|
|
"p",
|
|
"span",
|
|
"svg",
|
|
"ul"
|
|
];
|
|
var Primitive = NODES.reduce((primitive, node)=>{
|
|
const Node = __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$next$40$16$2e$0$2e$3_react$2d$dom$40$19$2e$2$2e$0_react$40$19$2e$2$2e$0_$5f$react$40$19$2e$2$2e$0$2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$ssr$2f$react$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["forwardRef"]((props, forwardedRef)=>{
|
|
const { asChild, ...primitiveProps } = props;
|
|
const Comp = asChild ? __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$radix$2d$ui$2b$react$2d$slot$40$1$2e$1$2e$1_$40$types$2b$react$40$19$2e$2$2e$6_react$40$19$2e$2$2e$0$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$slot$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["Slot"] : node;
|
|
if ("TURBOPACK compile-time falsy", 0) //TURBOPACK unreachable
|
|
;
|
|
return /* @__PURE__ */ (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$next$40$16$2e$0$2e$3_react$2d$dom$40$19$2e$2$2e$0_react$40$19$2e$2$2e$0_$5f$react$40$19$2e$2$2e$0$2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$ssr$2f$react$2d$jsx$2d$runtime$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["jsx"])(Comp, {
|
|
...primitiveProps,
|
|
ref: forwardedRef
|
|
});
|
|
});
|
|
Node.displayName = `Primitive.${node}`;
|
|
return {
|
|
...primitive,
|
|
[node]: Node
|
|
};
|
|
}, {});
|
|
function dispatchDiscreteCustomEvent(target, event) {
|
|
if (target) __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$next$40$16$2e$0$2e$3_react$2d$dom$40$19$2e$2$2e$0_react$40$19$2e$2$2e$0_$5f$react$40$19$2e$2$2e$0$2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$ssr$2f$react$2d$dom$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["flushSync"](()=>target.dispatchEvent(event));
|
|
}
|
|
var Root = Primitive;
|
|
;
|
|
//# sourceMappingURL=index.mjs.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/@radix-ui+react-avatar@1.1.2_@types+react-dom@19.2.3_@types+react@19.2.6__@types+react@_3ee3dafa662d71951c1a3d5b289c96d1/node_modules/@radix-ui/react-avatar/dist/index.mjs [app-ssr] (ecmascript)", ((__turbopack_context__) => {
|
|
"use strict";
|
|
|
|
__turbopack_context__.s([
|
|
"Avatar",
|
|
()=>Avatar,
|
|
"AvatarFallback",
|
|
()=>AvatarFallback,
|
|
"AvatarImage",
|
|
()=>AvatarImage,
|
|
"Fallback",
|
|
()=>Fallback,
|
|
"Image",
|
|
()=>Image,
|
|
"Root",
|
|
()=>Root,
|
|
"createAvatarScope",
|
|
()=>createAvatarScope
|
|
]);
|
|
// packages/react/avatar/src/Avatar.tsx
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$next$40$16$2e$0$2e$3_react$2d$dom$40$19$2e$2$2e$0_react$40$19$2e$2$2e$0_$5f$react$40$19$2e$2$2e$0$2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$ssr$2f$react$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react.js [app-ssr] (ecmascript)");
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$radix$2d$ui$2b$react$2d$context$40$1$2e$1$2e$1_$40$types$2b$react$40$19$2e$2$2e$6_react$40$19$2e$2$2e$0$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$context$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/@radix-ui+react-context@1.1.1_@types+react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-context/dist/index.mjs [app-ssr] (ecmascript)");
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$radix$2d$ui$2b$react$2d$use$2d$callback$2d$ref$40$1$2e$1$2e$0_$40$types$2b$react$40$19$2e$2$2e$6_react$40$19$2e$2$2e$0$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$use$2d$callback$2d$ref$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/@radix-ui+react-use-callback-ref@1.1.0_@types+react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs [app-ssr] (ecmascript)");
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$radix$2d$ui$2b$react$2d$use$2d$layout$2d$effect$40$1$2e$1$2e$0_$40$types$2b$react$40$19$2e$2$2e$6_react$40$19$2e$2$2e$0$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$use$2d$layout$2d$effect$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/@radix-ui+react-use-layout-effect@1.1.0_@types+react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs [app-ssr] (ecmascript)");
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$radix$2d$ui$2b$react$2d$primitive$40$2$2e$0$2e$1_$40$types$2b$react$2d$dom$40$19$2e$2$2e$3_$40$types$2b$react$40$19$2e$2$2e$6_$5f40$types$2b$rea_4f53963f71a6eb8b0116fe0dd1078946$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$primitive$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/@radix-ui+react-primitive@2.0.1_@types+react-dom@19.2.3_@types+react@19.2.6__@types+rea_4f53963f71a6eb8b0116fe0dd1078946/node_modules/@radix-ui/react-primitive/dist/index.mjs [app-ssr] (ecmascript)");
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$next$40$16$2e$0$2e$3_react$2d$dom$40$19$2e$2$2e$0_react$40$19$2e$2$2e$0_$5f$react$40$19$2e$2$2e$0$2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$ssr$2f$react$2d$jsx$2d$runtime$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react-jsx-runtime.js [app-ssr] (ecmascript)");
|
|
"use client";
|
|
;
|
|
;
|
|
;
|
|
;
|
|
;
|
|
;
|
|
var AVATAR_NAME = "Avatar";
|
|
var [createAvatarContext, createAvatarScope] = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$radix$2d$ui$2b$react$2d$context$40$1$2e$1$2e$1_$40$types$2b$react$40$19$2e$2$2e$6_react$40$19$2e$2$2e$0$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$context$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["createContextScope"])(AVATAR_NAME);
|
|
var [AvatarProvider, useAvatarContext] = createAvatarContext(AVATAR_NAME);
|
|
var Avatar = __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$next$40$16$2e$0$2e$3_react$2d$dom$40$19$2e$2$2e$0_react$40$19$2e$2$2e$0_$5f$react$40$19$2e$2$2e$0$2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$ssr$2f$react$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["forwardRef"]((props, forwardedRef)=>{
|
|
const { __scopeAvatar, ...avatarProps } = props;
|
|
const [imageLoadingStatus, setImageLoadingStatus] = __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$next$40$16$2e$0$2e$3_react$2d$dom$40$19$2e$2$2e$0_react$40$19$2e$2$2e$0_$5f$react$40$19$2e$2$2e$0$2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$ssr$2f$react$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["useState"]("idle");
|
|
return /* @__PURE__ */ (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$next$40$16$2e$0$2e$3_react$2d$dom$40$19$2e$2$2e$0_react$40$19$2e$2$2e$0_$5f$react$40$19$2e$2$2e$0$2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$ssr$2f$react$2d$jsx$2d$runtime$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["jsx"])(AvatarProvider, {
|
|
scope: __scopeAvatar,
|
|
imageLoadingStatus,
|
|
onImageLoadingStatusChange: setImageLoadingStatus,
|
|
children: /* @__PURE__ */ (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$next$40$16$2e$0$2e$3_react$2d$dom$40$19$2e$2$2e$0_react$40$19$2e$2$2e$0_$5f$react$40$19$2e$2$2e$0$2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$ssr$2f$react$2d$jsx$2d$runtime$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["jsx"])(__TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$radix$2d$ui$2b$react$2d$primitive$40$2$2e$0$2e$1_$40$types$2b$react$2d$dom$40$19$2e$2$2e$3_$40$types$2b$react$40$19$2e$2$2e$6_$5f40$types$2b$rea_4f53963f71a6eb8b0116fe0dd1078946$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$primitive$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["Primitive"].span, {
|
|
...avatarProps,
|
|
ref: forwardedRef
|
|
})
|
|
});
|
|
});
|
|
Avatar.displayName = AVATAR_NAME;
|
|
var IMAGE_NAME = "AvatarImage";
|
|
var AvatarImage = __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$next$40$16$2e$0$2e$3_react$2d$dom$40$19$2e$2$2e$0_react$40$19$2e$2$2e$0_$5f$react$40$19$2e$2$2e$0$2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$ssr$2f$react$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["forwardRef"]((props, forwardedRef)=>{
|
|
const { __scopeAvatar, src, onLoadingStatusChange = ()=>{}, ...imageProps } = props;
|
|
const context = useAvatarContext(IMAGE_NAME, __scopeAvatar);
|
|
const imageLoadingStatus = useImageLoadingStatus(src, imageProps.referrerPolicy);
|
|
const handleLoadingStatusChange = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$radix$2d$ui$2b$react$2d$use$2d$callback$2d$ref$40$1$2e$1$2e$0_$40$types$2b$react$40$19$2e$2$2e$6_react$40$19$2e$2$2e$0$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$use$2d$callback$2d$ref$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["useCallbackRef"])((status)=>{
|
|
onLoadingStatusChange(status);
|
|
context.onImageLoadingStatusChange(status);
|
|
});
|
|
(0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$radix$2d$ui$2b$react$2d$use$2d$layout$2d$effect$40$1$2e$1$2e$0_$40$types$2b$react$40$19$2e$2$2e$6_react$40$19$2e$2$2e$0$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$use$2d$layout$2d$effect$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["useLayoutEffect"])(()=>{
|
|
if (imageLoadingStatus !== "idle") {
|
|
handleLoadingStatusChange(imageLoadingStatus);
|
|
}
|
|
}, [
|
|
imageLoadingStatus,
|
|
handleLoadingStatusChange
|
|
]);
|
|
return imageLoadingStatus === "loaded" ? /* @__PURE__ */ (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$next$40$16$2e$0$2e$3_react$2d$dom$40$19$2e$2$2e$0_react$40$19$2e$2$2e$0_$5f$react$40$19$2e$2$2e$0$2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$ssr$2f$react$2d$jsx$2d$runtime$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["jsx"])(__TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$radix$2d$ui$2b$react$2d$primitive$40$2$2e$0$2e$1_$40$types$2b$react$2d$dom$40$19$2e$2$2e$3_$40$types$2b$react$40$19$2e$2$2e$6_$5f40$types$2b$rea_4f53963f71a6eb8b0116fe0dd1078946$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$primitive$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["Primitive"].img, {
|
|
...imageProps,
|
|
ref: forwardedRef,
|
|
src
|
|
}) : null;
|
|
});
|
|
AvatarImage.displayName = IMAGE_NAME;
|
|
var FALLBACK_NAME = "AvatarFallback";
|
|
var AvatarFallback = __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$next$40$16$2e$0$2e$3_react$2d$dom$40$19$2e$2$2e$0_react$40$19$2e$2$2e$0_$5f$react$40$19$2e$2$2e$0$2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$ssr$2f$react$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["forwardRef"]((props, forwardedRef)=>{
|
|
const { __scopeAvatar, delayMs, ...fallbackProps } = props;
|
|
const context = useAvatarContext(FALLBACK_NAME, __scopeAvatar);
|
|
const [canRender, setCanRender] = __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$next$40$16$2e$0$2e$3_react$2d$dom$40$19$2e$2$2e$0_react$40$19$2e$2$2e$0_$5f$react$40$19$2e$2$2e$0$2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$ssr$2f$react$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["useState"](delayMs === void 0);
|
|
__TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$next$40$16$2e$0$2e$3_react$2d$dom$40$19$2e$2$2e$0_react$40$19$2e$2$2e$0_$5f$react$40$19$2e$2$2e$0$2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$ssr$2f$react$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["useEffect"](()=>{
|
|
if (delayMs !== void 0) {
|
|
const timerId = window.setTimeout(()=>setCanRender(true), delayMs);
|
|
return ()=>window.clearTimeout(timerId);
|
|
}
|
|
}, [
|
|
delayMs
|
|
]);
|
|
return canRender && context.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$next$40$16$2e$0$2e$3_react$2d$dom$40$19$2e$2$2e$0_react$40$19$2e$2$2e$0_$5f$react$40$19$2e$2$2e$0$2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$ssr$2f$react$2d$jsx$2d$runtime$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["jsx"])(__TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$radix$2d$ui$2b$react$2d$primitive$40$2$2e$0$2e$1_$40$types$2b$react$2d$dom$40$19$2e$2$2e$3_$40$types$2b$react$40$19$2e$2$2e$6_$5f40$types$2b$rea_4f53963f71a6eb8b0116fe0dd1078946$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$primitive$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["Primitive"].span, {
|
|
...fallbackProps,
|
|
ref: forwardedRef
|
|
}) : null;
|
|
});
|
|
AvatarFallback.displayName = FALLBACK_NAME;
|
|
function useImageLoadingStatus(src, referrerPolicy) {
|
|
const [loadingStatus, setLoadingStatus] = __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$next$40$16$2e$0$2e$3_react$2d$dom$40$19$2e$2$2e$0_react$40$19$2e$2$2e$0_$5f$react$40$19$2e$2$2e$0$2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$ssr$2f$react$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["useState"]("idle");
|
|
(0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$radix$2d$ui$2b$react$2d$use$2d$layout$2d$effect$40$1$2e$1$2e$0_$40$types$2b$react$40$19$2e$2$2e$6_react$40$19$2e$2$2e$0$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$use$2d$layout$2d$effect$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["useLayoutEffect"])(()=>{
|
|
if (!src) {
|
|
setLoadingStatus("error");
|
|
return;
|
|
}
|
|
let isMounted = true;
|
|
const image = new window.Image();
|
|
const updateStatus = (status)=>()=>{
|
|
if (!isMounted) return;
|
|
setLoadingStatus(status);
|
|
};
|
|
setLoadingStatus("loading");
|
|
image.onload = updateStatus("loaded");
|
|
image.onerror = updateStatus("error");
|
|
image.src = src;
|
|
if (referrerPolicy) {
|
|
image.referrerPolicy = referrerPolicy;
|
|
}
|
|
return ()=>{
|
|
isMounted = false;
|
|
};
|
|
}, [
|
|
src,
|
|
referrerPolicy
|
|
]);
|
|
return loadingStatus;
|
|
}
|
|
var Root = Avatar;
|
|
var Image = AvatarImage;
|
|
var Fallback = AvatarFallback;
|
|
;
|
|
//# sourceMappingURL=index.mjs.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/lucide-react@0.454.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/upload.js [app-ssr] (ecmascript)", ((__turbopack_context__) => {
|
|
"use strict";
|
|
|
|
/**
|
|
* @license lucide-react v0.454.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/ __turbopack_context__.s([
|
|
"default",
|
|
()=>Upload
|
|
]);
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$lucide$2d$react$40$0$2e$454$2e$0_react$40$19$2e$2$2e$0$2f$node_modules$2f$lucide$2d$react$2f$dist$2f$esm$2f$createLucideIcon$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/lucide-react@0.454.0_react@19.2.0/node_modules/lucide-react/dist/esm/createLucideIcon.js [app-ssr] (ecmascript)");
|
|
;
|
|
const Upload = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$lucide$2d$react$40$0$2e$454$2e$0_react$40$19$2e$2$2e$0$2f$node_modules$2f$lucide$2d$react$2f$dist$2f$esm$2f$createLucideIcon$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["default"])("Upload", [
|
|
[
|
|
"path",
|
|
{
|
|
d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",
|
|
key: "ih7n3h"
|
|
}
|
|
],
|
|
[
|
|
"polyline",
|
|
{
|
|
points: "17 8 12 3 7 8",
|
|
key: "t8dd8p"
|
|
}
|
|
],
|
|
[
|
|
"line",
|
|
{
|
|
x1: "12",
|
|
x2: "12",
|
|
y1: "3",
|
|
y2: "15",
|
|
key: "widbto"
|
|
}
|
|
]
|
|
]);
|
|
;
|
|
//# sourceMappingURL=upload.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/lucide-react@0.454.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/upload.js [app-ssr] (ecmascript) <export default as Upload>", ((__turbopack_context__) => {
|
|
"use strict";
|
|
|
|
__turbopack_context__.s([
|
|
"Upload",
|
|
()=>__TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$lucide$2d$react$40$0$2e$454$2e$0_react$40$19$2e$2$2e$0$2f$node_modules$2f$lucide$2d$react$2f$dist$2f$esm$2f$icons$2f$upload$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["default"]
|
|
]);
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$lucide$2d$react$40$0$2e$454$2e$0_react$40$19$2e$2$2e$0$2f$node_modules$2f$lucide$2d$react$2f$dist$2f$esm$2f$icons$2f$upload$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/lucide-react@0.454.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/upload.js [app-ssr] (ecmascript)");
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/lucide-react@0.454.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/triangle-alert.js [app-ssr] (ecmascript)", ((__turbopack_context__) => {
|
|
"use strict";
|
|
|
|
/**
|
|
* @license lucide-react v0.454.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/ __turbopack_context__.s([
|
|
"default",
|
|
()=>TriangleAlert
|
|
]);
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$lucide$2d$react$40$0$2e$454$2e$0_react$40$19$2e$2$2e$0$2f$node_modules$2f$lucide$2d$react$2f$dist$2f$esm$2f$createLucideIcon$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/lucide-react@0.454.0_react@19.2.0/node_modules/lucide-react/dist/esm/createLucideIcon.js [app-ssr] (ecmascript)");
|
|
;
|
|
const TriangleAlert = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$lucide$2d$react$40$0$2e$454$2e$0_react$40$19$2e$2$2e$0$2f$node_modules$2f$lucide$2d$react$2f$dist$2f$esm$2f$createLucideIcon$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["default"])("TriangleAlert", [
|
|
[
|
|
"path",
|
|
{
|
|
d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",
|
|
key: "wmoenq"
|
|
}
|
|
],
|
|
[
|
|
"path",
|
|
{
|
|
d: "M12 9v4",
|
|
key: "juzpu7"
|
|
}
|
|
],
|
|
[
|
|
"path",
|
|
{
|
|
d: "M12 17h.01",
|
|
key: "p32p05"
|
|
}
|
|
]
|
|
]);
|
|
;
|
|
//# sourceMappingURL=triangle-alert.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/lucide-react@0.454.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/triangle-alert.js [app-ssr] (ecmascript) <export default as AlertTriangle>", ((__turbopack_context__) => {
|
|
"use strict";
|
|
|
|
__turbopack_context__.s([
|
|
"AlertTriangle",
|
|
()=>__TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$lucide$2d$react$40$0$2e$454$2e$0_react$40$19$2e$2$2e$0$2f$node_modules$2f$lucide$2d$react$2f$dist$2f$esm$2f$icons$2f$triangle$2d$alert$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["default"]
|
|
]);
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$lucide$2d$react$40$0$2e$454$2e$0_react$40$19$2e$2$2e$0$2f$node_modules$2f$lucide$2d$react$2f$dist$2f$esm$2f$icons$2f$triangle$2d$alert$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/lucide-react@0.454.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/triangle-alert.js [app-ssr] (ecmascript)");
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/lucide-react@0.454.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/refresh-cw.js [app-ssr] (ecmascript)", ((__turbopack_context__) => {
|
|
"use strict";
|
|
|
|
/**
|
|
* @license lucide-react v0.454.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/ __turbopack_context__.s([
|
|
"default",
|
|
()=>RefreshCw
|
|
]);
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$lucide$2d$react$40$0$2e$454$2e$0_react$40$19$2e$2$2e$0$2f$node_modules$2f$lucide$2d$react$2f$dist$2f$esm$2f$createLucideIcon$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/lucide-react@0.454.0_react@19.2.0/node_modules/lucide-react/dist/esm/createLucideIcon.js [app-ssr] (ecmascript)");
|
|
;
|
|
const RefreshCw = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$lucide$2d$react$40$0$2e$454$2e$0_react$40$19$2e$2$2e$0$2f$node_modules$2f$lucide$2d$react$2f$dist$2f$esm$2f$createLucideIcon$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["default"])("RefreshCw", [
|
|
[
|
|
"path",
|
|
{
|
|
d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",
|
|
key: "v9h5vc"
|
|
}
|
|
],
|
|
[
|
|
"path",
|
|
{
|
|
d: "M21 3v5h-5",
|
|
key: "1q7to0"
|
|
}
|
|
],
|
|
[
|
|
"path",
|
|
{
|
|
d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",
|
|
key: "3uifl3"
|
|
}
|
|
],
|
|
[
|
|
"path",
|
|
{
|
|
d: "M8 16H3v5",
|
|
key: "1cv678"
|
|
}
|
|
]
|
|
]);
|
|
;
|
|
//# sourceMappingURL=refresh-cw.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/lucide-react@0.454.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/refresh-cw.js [app-ssr] (ecmascript) <export default as RefreshCw>", ((__turbopack_context__) => {
|
|
"use strict";
|
|
|
|
__turbopack_context__.s([
|
|
"RefreshCw",
|
|
()=>__TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$lucide$2d$react$40$0$2e$454$2e$0_react$40$19$2e$2$2e$0$2f$node_modules$2f$lucide$2d$react$2f$dist$2f$esm$2f$icons$2f$refresh$2d$cw$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["default"]
|
|
]);
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$lucide$2d$react$40$0$2e$454$2e$0_react$40$19$2e$2$2e$0$2f$node_modules$2f$lucide$2d$react$2f$dist$2f$esm$2f$icons$2f$refresh$2d$cw$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/lucide-react@0.454.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/refresh-cw.js [app-ssr] (ecmascript)");
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/lucide-react@0.454.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/file-text.js [app-ssr] (ecmascript)", ((__turbopack_context__) => {
|
|
"use strict";
|
|
|
|
/**
|
|
* @license lucide-react v0.454.0 - ISC
|
|
*
|
|
* This source code is licensed under the ISC license.
|
|
* See the LICENSE file in the root directory of this source tree.
|
|
*/ __turbopack_context__.s([
|
|
"default",
|
|
()=>FileText
|
|
]);
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$lucide$2d$react$40$0$2e$454$2e$0_react$40$19$2e$2$2e$0$2f$node_modules$2f$lucide$2d$react$2f$dist$2f$esm$2f$createLucideIcon$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/lucide-react@0.454.0_react@19.2.0/node_modules/lucide-react/dist/esm/createLucideIcon.js [app-ssr] (ecmascript)");
|
|
;
|
|
const FileText = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$lucide$2d$react$40$0$2e$454$2e$0_react$40$19$2e$2$2e$0$2f$node_modules$2f$lucide$2d$react$2f$dist$2f$esm$2f$createLucideIcon$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["default"])("FileText", [
|
|
[
|
|
"path",
|
|
{
|
|
d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",
|
|
key: "1rqfz7"
|
|
}
|
|
],
|
|
[
|
|
"path",
|
|
{
|
|
d: "M14 2v4a2 2 0 0 0 2 2h4",
|
|
key: "tnqrlb"
|
|
}
|
|
],
|
|
[
|
|
"path",
|
|
{
|
|
d: "M10 9H8",
|
|
key: "b1mrlr"
|
|
}
|
|
],
|
|
[
|
|
"path",
|
|
{
|
|
d: "M16 13H8",
|
|
key: "t4e002"
|
|
}
|
|
],
|
|
[
|
|
"path",
|
|
{
|
|
d: "M16 17H8",
|
|
key: "z1uh3a"
|
|
}
|
|
]
|
|
]);
|
|
;
|
|
//# sourceMappingURL=file-text.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/lucide-react@0.454.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/file-text.js [app-ssr] (ecmascript) <export default as FileText>", ((__turbopack_context__) => {
|
|
"use strict";
|
|
|
|
__turbopack_context__.s([
|
|
"FileText",
|
|
()=>__TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$lucide$2d$react$40$0$2e$454$2e$0_react$40$19$2e$2$2e$0$2f$node_modules$2f$lucide$2d$react$2f$dist$2f$esm$2f$icons$2f$file$2d$text$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["default"]
|
|
]);
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$lucide$2d$react$40$0$2e$454$2e$0_react$40$19$2e$2$2e$0$2f$node_modules$2f$lucide$2d$react$2f$dist$2f$esm$2f$icons$2f$file$2d$text$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/lucide-react@0.454.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/file-text.js [app-ssr] (ecmascript)");
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/read-gedcom@0.3.2/node_modules/read-gedcom/dist/es6/parse/error.js [app-ssr] (ecmascript)", ((__turbopack_context__) => {
|
|
"use strict";
|
|
|
|
// See https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work
|
|
__turbopack_context__.s([
|
|
"ErrorDuplicatePointer",
|
|
()=>ErrorDuplicatePointer,
|
|
"ErrorEmptyTree",
|
|
()=>ErrorEmptyTree,
|
|
"ErrorGedcomBase",
|
|
()=>ErrorGedcomBase,
|
|
"ErrorGedcomDecoding",
|
|
()=>ErrorGedcomDecoding,
|
|
"ErrorIndexing",
|
|
()=>ErrorIndexing,
|
|
"ErrorInvalidConcatenation",
|
|
()=>ErrorInvalidConcatenation,
|
|
"ErrorInvalidFileType",
|
|
()=>ErrorInvalidFileType,
|
|
"ErrorInvalidNesting",
|
|
()=>ErrorInvalidNesting,
|
|
"ErrorInvalidRecordDefinition",
|
|
()=>ErrorInvalidRecordDefinition,
|
|
"ErrorParse",
|
|
()=>ErrorParse,
|
|
"ErrorTokenization",
|
|
()=>ErrorTokenization,
|
|
"ErrorTreeStructure",
|
|
()=>ErrorTreeStructure,
|
|
"ErrorTreeSyntax",
|
|
()=>ErrorTreeSyntax,
|
|
"ErrorUnsupportedCharset",
|
|
()=>ErrorUnsupportedCharset
|
|
]);
|
|
const patchPrototype = (instance, target)=>{
|
|
const proto = target.prototype;
|
|
if (Object.setPrototypeOf) {
|
|
Object.setPrototypeOf(instance, proto);
|
|
} else {
|
|
("TURBOPACK compile-time value", void 0).__proto__ = proto; // eslint-disable-line no-proto
|
|
}
|
|
};
|
|
class ErrorGedcomBase extends Error {
|
|
constructor(message){
|
|
super(message);
|
|
patchPrototype(this, new.target);
|
|
}
|
|
}
|
|
class ErrorParse extends ErrorGedcomBase {
|
|
constructor(message){
|
|
super(message);
|
|
this.message = message;
|
|
patchPrototype(this, new.target);
|
|
}
|
|
}
|
|
class ErrorInvalidFileType extends ErrorParse {
|
|
}
|
|
class ErrorGedcomDecoding extends ErrorParse {
|
|
constructor(message, illegalCode){
|
|
super(message);
|
|
this.illegalCode = illegalCode;
|
|
patchPrototype(this, new.target);
|
|
}
|
|
}
|
|
class ErrorUnsupportedCharset extends ErrorParse {
|
|
constructor(message, charset){
|
|
super(message);
|
|
this.charset = charset;
|
|
patchPrototype(this, new.target);
|
|
}
|
|
}
|
|
class ErrorTokenization extends ErrorParse {
|
|
constructor(message, lineNumber, line){
|
|
super(message);
|
|
this.lineNumber = lineNumber;
|
|
this.line = line;
|
|
patchPrototype(this, new.target);
|
|
}
|
|
}
|
|
class ErrorTreeSyntax extends ErrorParse {
|
|
constructor(message, lineNumber){
|
|
super(message);
|
|
this.lineNumber = lineNumber;
|
|
patchPrototype(this, new.target);
|
|
}
|
|
}
|
|
class ErrorInvalidNesting extends ErrorTreeSyntax {
|
|
constructor(message, lineNumber, currentLevel, level){
|
|
super(message, lineNumber);
|
|
this.lineNumber = lineNumber;
|
|
this.currentLevel = currentLevel;
|
|
this.level = level;
|
|
patchPrototype(this, new.target);
|
|
}
|
|
}
|
|
class ErrorInvalidConcatenation extends ErrorTreeSyntax {
|
|
constructor(message, lineNumber, kind){
|
|
super(message, lineNumber);
|
|
this.lineNumber = lineNumber;
|
|
this.kind = kind;
|
|
patchPrototype(this, new.target);
|
|
}
|
|
}
|
|
class ErrorInvalidRecordDefinition extends ErrorTreeSyntax {
|
|
constructor(message, lineNumber){
|
|
super(message, lineNumber);
|
|
patchPrototype(this, new.target);
|
|
}
|
|
}
|
|
class ErrorTreeStructure extends ErrorParse {
|
|
constructor(message){
|
|
super(message);
|
|
patchPrototype(this, new.target);
|
|
}
|
|
}
|
|
class ErrorEmptyTree extends ErrorTreeStructure {
|
|
constructor(message){
|
|
super(message);
|
|
patchPrototype(this, new.target);
|
|
}
|
|
}
|
|
class ErrorIndexing extends ErrorParse {
|
|
constructor(message){
|
|
super(message);
|
|
patchPrototype(this, new.target);
|
|
}
|
|
}
|
|
class ErrorDuplicatePointer extends ErrorIndexing {
|
|
constructor(message, lineNumber, lineNumberOriginalDefinition, pointer){
|
|
super(message);
|
|
this.lineNumber = lineNumber;
|
|
this.lineNumberOriginalDefinition = lineNumberOriginalDefinition;
|
|
this.pointer = pointer;
|
|
patchPrototype(this, new.target);
|
|
}
|
|
} //# sourceMappingURL=error.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/read-gedcom@0.3.2/node_modules/read-gedcom/dist/es6/parse/tokenizer.js [app-ssr] (ecmascript)", ((__turbopack_context__) => {
|
|
"use strict";
|
|
|
|
__turbopack_context__.s([
|
|
"tokenize",
|
|
()=>tokenize
|
|
]);
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$read$2d$gedcom$40$0$2e$3$2e$2$2f$node_modules$2f$read$2d$gedcom$2f$dist$2f$es6$2f$parse$2f$error$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/read-gedcom@0.3.2/node_modules/read-gedcom/dist/es6/parse/error.js [app-ssr] (ecmascript)");
|
|
;
|
|
const ccAlpha = 'A-Za-z';
|
|
const ccDigit = '0-9', ccNonZeroDigit = '1-9';
|
|
const ccAlphanum = `${ccAlpha}${ccDigit}`;
|
|
const cSpace = ' ';
|
|
const cDelim = `${cSpace}`;
|
|
const gEscapeText = `[${ccAlphanum}][${ccAlphanum}${cSpace}]*`;
|
|
const gEscape = `@#(?:${gEscapeText})@`;
|
|
const gIdentifierString = `[${ccAlphanum}-_]+`; // x: Allow '-' and '_'
|
|
const gLevel = `[${ccNonZeroDigit}][${ccDigit}]+|[${ccDigit}]`;
|
|
const ccDisallowed = '\\x00-\\x08\\x0A-\\x1F'; // x: include \xFF
|
|
const cCR = '\\r', cLF = '\\n';
|
|
const gLineChar = `[^${ccDisallowed}${cCR}${cLF}@]|@`; // x: Allow single at
|
|
const gLineText = `(?:${gLineChar})*`; // x: Allow empty strings
|
|
const gLineItem = `${gEscape}|${gLineText}|${gEscape}[${cDelim}]${gLineText}`;
|
|
const gXRefId = `@${gIdentifierString}@`;
|
|
const gPointer = `${gXRefId}`;
|
|
const gLineValue = `${gPointer}|(?:${gLineItem})`;
|
|
const gTag = `[${ccAlphanum}]+|_[${ccAlphanum}_]+`; // TODO
|
|
const gTerminator = `${cCR}${cLF}?|${cLF}`; // x: Allow \r
|
|
const gGedcomLine = `(${gLevel})(?:${cDelim}(${gXRefId}))?${cDelim}(${gTag})(?:${cDelim}(${gLineValue}))?(${gTerminator}|$)`; // x: Allow no trailing newline
|
|
/**
|
|
* The tokenizer implementation.
|
|
* Processes a file stored as a string, line by line, according to the `gGedcomLine` regular expression.
|
|
* A parameter in the constructor decides whether to raise an error when a line cannot be parsed or to fail silently.
|
|
* Code was not extracted further as a performance tradeoff.
|
|
*/ class GedcomTokenizer {
|
|
constructor(input, strict){
|
|
this.input = input;
|
|
this.strict = strict;
|
|
this.rGedcomLines = new RegExp(`^${gGedcomLine}`, 'gym'); // Must be newly created
|
|
this.linesRead = 0;
|
|
this.charactersRead = 0;
|
|
}
|
|
[Symbol.iterator]() {
|
|
return this;
|
|
}
|
|
next() {
|
|
const result = this.rGedcomLines.exec(this.input);
|
|
if (result === null || result[5].length === 0 && this.charactersRead + result[0].length !== this.input.length) {
|
|
if (result !== null) {
|
|
this.charactersRead += result[0].length;
|
|
}
|
|
const success = this.charactersRead === this.input.length;
|
|
if (this.strict && !success) {
|
|
const printCharactersMax = 256; // Avoid printing a super long line
|
|
const errorLine = this.input.substring(this.charactersRead, Math.min(this.charactersRead + printCharactersMax, this.input.length)).split(/[\r\n]+/, 1)[0];
|
|
throw new __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$read$2d$gedcom$40$0$2e$3$2e$2$2f$node_modules$2f$read$2d$gedcom$2f$dist$2f$es6$2f$parse$2f$error$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["ErrorTokenization"](`Invalid format for line ${this.linesRead + 1}: "${errorLine}"`, this.linesRead + 1, errorLine);
|
|
}
|
|
return {
|
|
done: true,
|
|
value: null
|
|
}; // Return
|
|
} else {
|
|
this.charactersRead += result[0].length; // Includes terminator
|
|
this.linesRead++;
|
|
return {
|
|
done: false,
|
|
value: result
|
|
}; // Yield
|
|
}
|
|
}
|
|
}
|
|
const tokenize = (input, strict = true)=>new GedcomTokenizer(input, strict); //# sourceMappingURL=tokenizer.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/read-gedcom@0.3.2/node_modules/read-gedcom/dist/es6/parse/structurer.js [app-ssr] (ecmascript)", ((__turbopack_context__) => {
|
|
"use strict";
|
|
|
|
__turbopack_context__.s([
|
|
"buildTree",
|
|
()=>buildTree
|
|
]);
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$read$2d$gedcom$40$0$2e$3$2e$2$2f$node_modules$2f$read$2d$gedcom$2f$dist$2f$es6$2f$parse$2f$error$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/read-gedcom@0.3.2/node_modules/read-gedcom/dist/es6/parse/error.js [app-ssr] (ecmascript)");
|
|
;
|
|
const PROGRESS_INTERVAL = 50000;
|
|
const buildTree = (lines, noInlineContinuations = false, progressCallback = null)=>{
|
|
if (progressCallback) {
|
|
progressCallback(0);
|
|
}
|
|
let i = 0;
|
|
let charsRead = 0;
|
|
let currentLevel = -1; // Current level
|
|
const stack = [
|
|
{
|
|
tag: null,
|
|
pointer: null,
|
|
value: null,
|
|
indexSource: -1,
|
|
indexRelative: 0,
|
|
children: []
|
|
}
|
|
];
|
|
for (const line of lines){
|
|
const [lineStr, levelStr, pointer, tag, value] = line;
|
|
// There is an unsolvable ambiguity here, so we just try our best and assume it is correct
|
|
const valueUnescaped = value ? value.replace(/@@/g, '@') : value;
|
|
charsRead += lineStr.length;
|
|
const level = parseInt(levelStr);
|
|
const isSameOrUpperLevel = level <= currentLevel, isDownLevel = level === currentLevel + 1;
|
|
if (level < 0 || !isSameOrUpperLevel && !isDownLevel) {
|
|
throw new __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$read$2d$gedcom$40$0$2e$3$2e$2$2f$node_modules$2f$read$2d$gedcom$2f$dist$2f$es6$2f$parse$2f$error$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["ErrorInvalidNesting"](`Illegal nesting level at line ${i + 1} (current is ${currentLevel}, got ${level})`, i + 1, currentLevel, level);
|
|
}
|
|
const levelDifference = currentLevel - level + 1;
|
|
for(let j = 0; j < levelDifference; j++){
|
|
stack.pop();
|
|
}
|
|
const parent = stack[stack.length - 1];
|
|
const siblings = parent.children;
|
|
if (tag === "CONC" /* Tag.Concatenation */ && !noInlineContinuations) {
|
|
if (pointer) {
|
|
throw new __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$read$2d$gedcom$40$0$2e$3$2e$2$2f$node_modules$2f$read$2d$gedcom$2f$dist$2f$es6$2f$parse$2f$error$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["ErrorInvalidConcatenation"](`Illegal concatenation format at line ${i + 1}`, i + 1, "CONC" /* Tag.Concatenation */ );
|
|
}
|
|
if (!parent) {
|
|
throw new __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$read$2d$gedcom$40$0$2e$3$2e$2$2f$node_modules$2f$read$2d$gedcom$2f$dist$2f$es6$2f$parse$2f$error$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["ErrorInvalidConcatenation"](`Concatenation with no parent at line ${i + 1}`, i + 1, "CONC" /* Tag.Concatenation */ );
|
|
}
|
|
if (parent.value == null) {
|
|
parent.value = '';
|
|
}
|
|
parent.value += valueUnescaped !== null && valueUnescaped !== void 0 ? valueUnescaped : '';
|
|
currentLevel = level - 1;
|
|
} else if (tag === "CONT" /* Tag.Continuation */ && !noInlineContinuations) {
|
|
if (pointer) {
|
|
throw new __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$read$2d$gedcom$40$0$2e$3$2e$2$2f$node_modules$2f$read$2d$gedcom$2f$dist$2f$es6$2f$parse$2f$error$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["ErrorInvalidConcatenation"](`Illegal continuation format at line ${i + 1}`, i + 1, "CONT" /* Tag.Continuation */ );
|
|
}
|
|
if (!parent) {
|
|
throw new __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$read$2d$gedcom$40$0$2e$3$2e$2$2f$node_modules$2f$read$2d$gedcom$2f$dist$2f$es6$2f$parse$2f$error$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["ErrorInvalidConcatenation"](`Continuation with no parent at line ${i + 1}`, i + 1, "CONT" /* Tag.Continuation */ );
|
|
}
|
|
const separator = '\n'; // TODO: hardcoded separator
|
|
if (parent.value == null) {
|
|
parent.value = '';
|
|
}
|
|
parent.value += separator + (valueUnescaped !== null && valueUnescaped !== void 0 ? valueUnescaped : '');
|
|
currentLevel = level - 1;
|
|
} else {
|
|
const child = {
|
|
tag,
|
|
pointer: pointer !== null && pointer !== void 0 ? pointer : null,
|
|
value: valueUnescaped !== null && valueUnescaped !== void 0 ? valueUnescaped : null,
|
|
indexSource: i,
|
|
indexRelative: parent.children.length,
|
|
children: []
|
|
};
|
|
siblings.push(child);
|
|
if (pointer && level > 0) {
|
|
throw new __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$read$2d$gedcom$40$0$2e$3$2e$2$2f$node_modules$2f$read$2d$gedcom$2f$dist$2f$es6$2f$parse$2f$error$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["ErrorInvalidRecordDefinition"](`Record must be a top-level definition at line ${i + 1}`, i + 1);
|
|
}
|
|
stack.push(child);
|
|
currentLevel = level;
|
|
}
|
|
i++;
|
|
if (progressCallback && i % PROGRESS_INTERVAL === 0) {
|
|
progressCallback(charsRead);
|
|
}
|
|
}
|
|
if (progressCallback) {
|
|
progressCallback(charsRead);
|
|
}
|
|
return stack[0]; // The top of the stack is the root node
|
|
}; //# sourceMappingURL=structurer.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/read-gedcom@0.3.2/node_modules/read-gedcom/dist/es6/parse/decoding/common.js [app-ssr] (ecmascript)", ((__turbopack_context__) => {
|
|
"use strict";
|
|
|
|
/**
|
|
* The iteration interval at which the next progress call should be performed.
|
|
*/ __turbopack_context__.s([
|
|
"BYTES_INTERVAL",
|
|
()=>BYTES_INTERVAL
|
|
]);
|
|
const BYTES_INTERVAL = 200000; //# sourceMappingURL=common.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/read-gedcom@0.3.2/node_modules/read-gedcom/dist/es6/parse/decoding/utf.js [app-ssr] (ecmascript)", ((__turbopack_context__) => {
|
|
"use strict";
|
|
|
|
__turbopack_context__.s([
|
|
"BOM_UTF16_BE",
|
|
()=>BOM_UTF16_BE,
|
|
"BOM_UTF16_LE",
|
|
()=>BOM_UTF16_LE,
|
|
"BOM_UTF32_BE",
|
|
()=>BOM_UTF32_BE,
|
|
"BOM_UTF32_LE",
|
|
()=>BOM_UTF32_LE,
|
|
"BOM_UTF8",
|
|
()=>BOM_UTF8,
|
|
"DECODE_UTF16_BE",
|
|
()=>DECODE_UTF16_BE,
|
|
"DECODE_UTF16_LE",
|
|
()=>DECODE_UTF16_LE,
|
|
"DECODE_UTF8",
|
|
()=>DECODE_UTF8,
|
|
"decodeUtf",
|
|
()=>decodeUtf,
|
|
"decodeUtf16be",
|
|
()=>decodeUtf16be,
|
|
"decodeUtf16le",
|
|
()=>decodeUtf16le,
|
|
"decodeUtf8",
|
|
()=>decodeUtf8,
|
|
"decodeUtfBOM",
|
|
()=>decodeUtfBOM
|
|
]);
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$read$2d$gedcom$40$0$2e$3$2e$2$2f$node_modules$2f$read$2d$gedcom$2f$dist$2f$es6$2f$parse$2f$error$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/read-gedcom@0.3.2/node_modules/read-gedcom/dist/es6/parse/error.js [app-ssr] (ecmascript)");
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$read$2d$gedcom$40$0$2e$3$2e$2$2f$node_modules$2f$read$2d$gedcom$2f$dist$2f$es6$2f$parse$2f$decoding$2f$common$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/read-gedcom@0.3.2/node_modules/read-gedcom/dist/es6/parse/decoding/common.js [app-ssr] (ecmascript)");
|
|
;
|
|
;
|
|
const BOM_UTF8 = [
|
|
0xef,
|
|
0xbb,
|
|
0xbf
|
|
];
|
|
const BOM_UTF16_BE = [
|
|
0xfe,
|
|
0xff
|
|
];
|
|
const BOM_UTF16_LE = BOM_UTF16_BE.slice().reverse();
|
|
const BOM_UTF32_BE = [
|
|
0x00,
|
|
0x00,
|
|
0xfe,
|
|
0xff
|
|
];
|
|
const BOM_UTF32_LE = BOM_UTF32_BE.slice().reverse();
|
|
const DECODE_UTF8 = 'utf-8';
|
|
const DECODE_UTF16_BE = 'utf-16be';
|
|
const DECODE_UTF16_LE = 'utf-16le';
|
|
const decodeUtf = (buffer, progressCallback)=>{
|
|
const { output } = decodeUtfBOM(buffer, progressCallback);
|
|
return output;
|
|
};
|
|
const decodeUtf8 = (buffer, progressCallback)=>{
|
|
if (progressCallback) {
|
|
progressCallback(0);
|
|
}
|
|
let outputView = '';
|
|
const byteBuffer = new Uint8Array(buffer);
|
|
let nIdx = 0;
|
|
for(let nPart, nLen = byteBuffer.length; nIdx < nLen; nIdx++){
|
|
nPart = byteBuffer[nIdx];
|
|
outputView += String.fromCharCode(nPart > 251 && nPart < 254 && nIdx + 5 < nLen /* six bytes */ ? (nPart - 252) * 1073741824 + (byteBuffer[++nIdx] - 128 << 24) + (byteBuffer[++nIdx] - 128 << 18) + (byteBuffer[++nIdx] - 128 << 12) + (byteBuffer[++nIdx] - 128 << 6) + byteBuffer[++nIdx] - 128 : nPart > 247 && nPart < 252 && nIdx + 4 < nLen /* five bytes */ ? (nPart - 248 << 24) + (byteBuffer[++nIdx] - 128 << 18) + (byteBuffer[++nIdx] - 128 << 12) + (byteBuffer[++nIdx] - 128 << 6) + byteBuffer[++nIdx] - 128 : nPart > 239 && nPart < 248 && nIdx + 3 < nLen /* four bytes */ ? (nPart - 240 << 18) + (byteBuffer[++nIdx] - 128 << 12) + (byteBuffer[++nIdx] - 128 << 6) + byteBuffer[++nIdx] - 128 : nPart > 223 && nPart < 240 && nIdx + 2 < nLen /* three bytes */ ? (nPart - 224 << 12) + (byteBuffer[++nIdx] - 128 << 6) + byteBuffer[++nIdx] - 128 : nPart > 191 && nPart < 224 && nIdx + 1 < nLen /* two bytes */ ? (nPart - 192 << 6) + byteBuffer[++nIdx] - 128 : /* nPart < 127 ? */ /* one byte */ nPart);
|
|
if (progressCallback && nIdx % __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$read$2d$gedcom$40$0$2e$3$2e$2$2f$node_modules$2f$read$2d$gedcom$2f$dist$2f$es6$2f$parse$2f$decoding$2f$common$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["BYTES_INTERVAL"] === 0) {
|
|
progressCallback(nIdx);
|
|
}
|
|
}
|
|
if (progressCallback) {
|
|
progressCallback(nIdx);
|
|
}
|
|
return outputView;
|
|
};
|
|
const decodeUtf16 = (buffer, isBe, progressCallback)=>{
|
|
if (progressCallback) {
|
|
progressCallback(0);
|
|
}
|
|
let outputView = '';
|
|
const byteBuffer = new Uint8Array(buffer);
|
|
for(let i = 0; i < byteBuffer.length; i += 2){
|
|
const a = byteBuffer[i], b = byteBuffer[i + 1];
|
|
const code = isBe ? a * 16 + b : b * 16 + a;
|
|
outputView += String.fromCharCode(code);
|
|
if (progressCallback && (i + 1) / 2 % __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$read$2d$gedcom$40$0$2e$3$2e$2$2f$node_modules$2f$read$2d$gedcom$2f$dist$2f$es6$2f$parse$2f$decoding$2f$common$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["BYTES_INTERVAL"] === 0) {
|
|
progressCallback(i);
|
|
}
|
|
}
|
|
return outputView;
|
|
};
|
|
const decodeUtf16be = (buffer, progressCallback)=>decodeUtf16(buffer, true, progressCallback);
|
|
const decodeUtf16le = (buffer, progressCallback)=>decodeUtf16(buffer, false, progressCallback);
|
|
const decodeUtfBOM = (buffer, progressCallback)=>{
|
|
if (progressCallback) {
|
|
progressCallback(0);
|
|
}
|
|
const byteBuffer = new Uint8Array(buffer);
|
|
const startsWith = (bom)=>{
|
|
if (byteBuffer.length < bom.length) {
|
|
return false;
|
|
}
|
|
for(let i = 0; i < bom.length; i++){
|
|
if (byteBuffer[i] !== bom[i]) {
|
|
return false;
|
|
}
|
|
}
|
|
return true;
|
|
};
|
|
const boms = [
|
|
[
|
|
DECODE_UTF8,
|
|
BOM_UTF8
|
|
],
|
|
[
|
|
DECODE_UTF16_BE,
|
|
BOM_UTF16_BE
|
|
],
|
|
[
|
|
DECODE_UTF16_LE,
|
|
BOM_UTF16_LE
|
|
]
|
|
];
|
|
const optional = boms.map(([charset, bom])=>({
|
|
charset,
|
|
bom
|
|
})).find(({ bom })=>startsWith(bom));
|
|
if ([
|
|
BOM_UTF32_BE,
|
|
BOM_UTF32_LE
|
|
].some((bom)=>startsWith(bom))) {
|
|
throw new __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$read$2d$gedcom$40$0$2e$3$2e$2$2f$node_modules$2f$read$2d$gedcom$2f$dist$2f$es6$2f$parse$2f$error$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["ErrorUnsupportedCharset"](`Unsupported charset detected from BOM: 'utf-32'`, 'utf-32');
|
|
}
|
|
const bomCharset = optional !== undefined ? optional.charset : null;
|
|
const byteBufferWithoutBOM = optional !== undefined ? byteBuffer.slice(optional.bom.length) : byteBuffer;
|
|
const charset = bomCharset !== null ? bomCharset : DECODE_UTF8; // No BOM = defaults to UTF-8
|
|
let output;
|
|
if (charset === DECODE_UTF8) {
|
|
output = decodeUtf8(byteBufferWithoutBOM);
|
|
} else if (charset === DECODE_UTF16_BE) {
|
|
output = decodeUtf16be(byteBufferWithoutBOM);
|
|
} else if (charset === DECODE_UTF16_LE) {
|
|
output = decodeUtf16le(byteBufferWithoutBOM);
|
|
} else {
|
|
throw new Error();
|
|
}
|
|
if (progressCallback) {
|
|
progressCallback(byteBuffer.length);
|
|
}
|
|
return {
|
|
output,
|
|
bomCharset
|
|
};
|
|
}; //# sourceMappingURL=utf.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/read-gedcom@0.3.2/node_modules/read-gedcom/dist/es6/parse/decoder.js [app-ssr] (ecmascript)", ((__turbopack_context__) => {
|
|
"use strict";
|
|
|
|
__turbopack_context__.s([
|
|
"FileEncoding",
|
|
()=>FileEncoding,
|
|
"detectCharset",
|
|
()=>detectCharset,
|
|
"getFileMetadata",
|
|
()=>getFileMetadata
|
|
]);
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$read$2d$gedcom$40$0$2e$3$2e$2$2f$node_modules$2f$read$2d$gedcom$2f$dist$2f$es6$2f$parse$2f$tokenizer$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/read-gedcom@0.3.2/node_modules/read-gedcom/dist/es6/parse/tokenizer.js [app-ssr] (ecmascript)");
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$read$2d$gedcom$40$0$2e$3$2e$2$2f$node_modules$2f$read$2d$gedcom$2f$dist$2f$es6$2f$parse$2f$structurer$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/read-gedcom@0.3.2/node_modules/read-gedcom/dist/es6/parse/structurer.js [app-ssr] (ecmascript)");
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$read$2d$gedcom$40$0$2e$3$2e$2$2f$node_modules$2f$read$2d$gedcom$2f$dist$2f$es6$2f$parse$2f$decoding$2f$utf$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/read-gedcom@0.3.2/node_modules/read-gedcom/dist/es6/parse/decoding/utf.js [app-ssr] (ecmascript)");
|
|
;
|
|
;
|
|
;
|
|
var FileEncoding;
|
|
(function(FileEncoding) {
|
|
FileEncoding["Utf8"] = "UTF-8";
|
|
FileEncoding["Ansel"] = "ANSEL";
|
|
FileEncoding["Cp1252"] = "Cp1252";
|
|
FileEncoding["Macintosh"] = "Macintosh";
|
|
FileEncoding["Cp850"] = "Cp850";
|
|
FileEncoding["Utf16be"] = "UTF-16be";
|
|
FileEncoding["Utf16le"] = "UTF-16le";
|
|
})(FileEncoding || (FileEncoding = {}));
|
|
const getFileMetadata = (buffer, maxPeekBytes = 5000, maxPeekLines = 200)=>{
|
|
const { output: inputHead, bomCharset } = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$read$2d$gedcom$40$0$2e$3$2e$2$2f$node_modules$2f$read$2d$gedcom$2f$dist$2f$es6$2f$parse$2f$decoding$2f$utf$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["decodeUtfBOM"])(buffer.slice(0, maxPeekBytes)); // Start with UTF-8 since file can contain a BOM
|
|
const hasBOM = bomCharset !== null;
|
|
const it = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$read$2d$gedcom$40$0$2e$3$2e$2$2f$node_modules$2f$read$2d$gedcom$2f$dist$2f$es6$2f$parse$2f$tokenizer$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["tokenize"])(inputHead, false); // Non-strict mode: break silently on error
|
|
let i = 0;
|
|
const array = [];
|
|
for (const line of it){
|
|
if (i >= maxPeekLines) {
|
|
break;
|
|
}
|
|
array.push(line);
|
|
i += 1;
|
|
}
|
|
const tree = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$read$2d$gedcom$40$0$2e$3$2e$2$2f$node_modules$2f$read$2d$gedcom$2f$dist$2f$es6$2f$parse$2f$structurer$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["buildTree"])(array);
|
|
const header = tree.children.filter((c)=>c.tag === "HEAD" /* Tag.Header */ );
|
|
const char = header.flatMap((c)=>c.children.filter((n)=>n.tag === "CHAR" /* Tag.Character */ || n.tag === "CHARACTER" /* TagNonStandard.CharacterAlt */ ));
|
|
const charOpt = char.length > 0 ? char[0].value : null;
|
|
const source = header.flatMap((c)=>c.children.filter((n)=>n.tag === "SOUR" /* Tag.Source */ ));
|
|
const sourceOpt = source.length > 0 ? source[0].value : null;
|
|
const version = source.flatMap((c)=>c.children.filter((n)=>n.tag === "VERS" /* Tag.Version */ ));
|
|
const versionOpt = version.length > 0 ? version[0].value : null;
|
|
return {
|
|
sourceEncoding: charOpt,
|
|
sourceProvider: sourceOpt,
|
|
sourceProviderVersion: versionOpt,
|
|
fileHasBOM: hasBOM
|
|
};
|
|
};
|
|
const detectCharset = (buffer)=>{
|
|
// eslint-disable-next-line
|
|
const { sourceEncoding, sourceProvider, sourceProviderVersion, fileHasBOM } = getFileMetadata(buffer);
|
|
// Estimate an encoding without knowing the provider
|
|
function estimateEncoding() {
|
|
if (sourceEncoding === "UTF-8" /* ValueCharacterEncoding.Utf8 */ ) {
|
|
return "UTF-8" /* FileEncoding.Utf8 */ ;
|
|
} else if (sourceEncoding === "ANSEL" /* ValueCharacterEncoding.Ansel */ ) {
|
|
return "ANSEL" /* FileEncoding.Ansel */ ;
|
|
} else if (sourceEncoding === "ASCII" /* ValueCharacterEncoding.Ascii */ ) {
|
|
return "Cp1252" /* FileEncoding.Cp1252 */ ;
|
|
} else if (sourceEncoding === "ANSI" /* ValueCharacterEncoding.Ansi */ ) {
|
|
return "Cp1252" /* FileEncoding.Cp1252 */ ;
|
|
} else if (sourceEncoding === "UNICODE" /* ValueCharacterEncoding.Unicode */ ) {
|
|
return "UTF-16be" /* FileEncoding.Utf16be */ ; // RFC 2781
|
|
} else if (sourceEncoding === 'WINDOWS' || sourceEncoding === 'IBM WINDOWS') {
|
|
return "Cp1252" /* FileEncoding.Cp1252 */ ;
|
|
} else if (sourceEncoding === 'MACINTOSH') {
|
|
return "Macintosh" /* FileEncoding.Macintosh */ ;
|
|
} else if (sourceEncoding === 'IBMPC') {
|
|
return "Cp850" /* FileEncoding.Cp850 */ ;
|
|
} else if (sourceEncoding === 'MSDOS') {
|
|
return "Cp850" /* FileEncoding.Cp850 */ ;
|
|
} else if (sourceEncoding === 'UNIX') {
|
|
return "Cp1252" /* FileEncoding.Cp1252 */ ;
|
|
} else if (sourceEncoding === 'UTF8') {
|
|
return "UTF-8" /* FileEncoding.Utf8 */ ;
|
|
} else if (sourceEncoding === 'windows-1250') {
|
|
return "Cp1252" /* FileEncoding.Cp1252 */ ;
|
|
} else {
|
|
return "UTF-8" /* FileEncoding.Utf8 */ ; // Defaults to UTF-8
|
|
}
|
|
}
|
|
if (fileHasBOM) {
|
|
return "UTF-8" /* FileEncoding.Utf8 */ ;
|
|
}
|
|
if (sourceProvider === 'GeneWeb') {
|
|
if (sourceEncoding === "ASCII" /* ValueCharacterEncoding.Ascii */ ) {
|
|
return "Cp1252" /* FileEncoding.Cp1252 */ ;
|
|
} else if (sourceEncoding === "UTF-8" /* ValueCharacterEncoding.Utf8 */ ) {
|
|
return "UTF-8" /* FileEncoding.Utf8 */ ;
|
|
} else {
|
|
return estimateEncoding();
|
|
}
|
|
} else if (sourceProvider != null && sourceProvider.startsWith('HEREDIS')) {
|
|
if (sourceEncoding === "ANSI" /* ValueCharacterEncoding.Ansi */ ) {
|
|
return "Cp1252" /* FileEncoding.Cp1252 */ ;
|
|
} else {
|
|
return estimateEncoding();
|
|
}
|
|
} else if (sourceProvider === 'GENEATIQUE') {
|
|
if (sourceEncoding === "ANSEL" /* ValueCharacterEncoding.Ansel */ ) {
|
|
return "ANSEL" /* FileEncoding.Ansel */ ;
|
|
} else {
|
|
return estimateEncoding();
|
|
}
|
|
} else if (sourceProvider === 'Gramps') {
|
|
if (sourceEncoding === "UTF-8" /* ValueCharacterEncoding.Utf8 */ ) {
|
|
return "UTF-8" /* FileEncoding.Utf8 */ ;
|
|
} else {
|
|
return estimateEncoding();
|
|
}
|
|
} else {
|
|
return estimateEncoding();
|
|
}
|
|
}; //# sourceMappingURL=decoder.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/read-gedcom@0.3.2/node_modules/read-gedcom/dist/es6/parse/decoding/ansel.js [app-ssr] (ecmascript)", ((__turbopack_context__) => {
|
|
"use strict";
|
|
|
|
__turbopack_context__.s([
|
|
"decodeAnsel",
|
|
()=>decodeAnsel
|
|
]);
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$read$2d$gedcom$40$0$2e$3$2e$2$2f$node_modules$2f$read$2d$gedcom$2f$dist$2f$es6$2f$parse$2f$error$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/read-gedcom@0.3.2/node_modules/read-gedcom/dist/es6/parse/error.js [app-ssr] (ecmascript)");
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$read$2d$gedcom$40$0$2e$3$2e$2$2f$node_modules$2f$read$2d$gedcom$2f$dist$2f$es6$2f$parse$2f$decoding$2f$common$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/read-gedcom@0.3.2/node_modules/read-gedcom/dist/es6/parse/decoding/common.js [app-ssr] (ecmascript)");
|
|
;
|
|
;
|
|
const ANSEL_KEYS_1 = '8d8ea1a2a3a4a5a6a7a8a9aaabacadaeb0b1b2b3b4b5b6b7b8b9babcbdc0c1c2c3c4c5c6cfe0e1e2e3e4e5e6e7e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfe818889929394c7c8e8bebfcdce';
|
|
const ANSEL_VALUES_1 = '\u200d\u200c\u0141\xd8\xd0\xde\xc6\u0152\u02b9\xb7\u266d\xae\xb1\u01a0\u01af\u02be\xb0\u0142\xf8\u0111\xfe\xe6\u0153\u02ba\u0131\xa3\xf0\u01a1\u01b0\xb0\u2113\u2117\xa9\u266f\xbf\xa1\xdf\u0309\u0300\u0301\u0302\u0303\u0304\u0306\u0307\u030c\u030a\ufe20\ufe21\u0315\u030b\u0310\u0327\u0328\u0323\u0324\u0325\u0333\u0332\u0326\u031c\u032e\ufe22\ufe23\u0313\xfc\x98\x9c\'\u201c\u201d\xdf\u20ac\u0308\u25af\u25aeeo';
|
|
const ANSEL_KEYS_2 = 'e020e041e045e049e04fe055e059e061e065e069e06fe075e079e120e141e145e149e14fe155e157e159e161e165e169e16fe175e177e179e220e241e243e245e247e249e24be24ce24de24ee24fe250e252e253e255e257e259e25ae261e263e265e267e269e26be26ce26de26ee26fe270e272e273e275e277e279e27ae2a5e2b5e320e341e343e345e347e348e349e34ae34fe353e355e357e359e35ae361e363e365e367e368e369e36ae36fe373e375e377e379e37ae420e441e445e449e44ee44fe455e456e459e461e465e469e46ee46fe475e476e479e520e541e545e547e549e54fe555e561e565e567e569e56fe575e5a5e5b5e620e641e645e647e649e64fe655e661e665e667e669e66fe675e720e742e743e744e745e746e747e748e749e74de74ee750e752e753e754e757e758e759e75ae762e763e764e765e766e767e768e76de76ee770e772e773e774e777e778e779e77ae820e841e845e848e849e84fe855e857e858e859e861e865e868e869e86fe874e875e877e878e879e920e941e943e944e945e947e949e94be94ce94ee94fe952e953e954e955e95ae961e963e964e965e967e969e96ae96be96ce96ee96fe972e973e974e975e97aea20ea41ea61ea75ea77ea79eaaded20ee20ee4fee55ee6fee75f020f043f044f047f048f04bf04cf04ef052f053f054f063f064f067f068f06bf06cf06ef072f073f074f120f141f145f149f14ff155f161f165f169f16ff175f241f242f244f245f248f249f24bf24cf24df24ef24ff252f253f254f255f256f257f259f25af261f262f264f265f268f269f26bf26cf26df26ef26ff272f273f274f275f276f277f279f27af355f375f441f461f520f948f968fc20fc41fc43fc45fc4bfc4cfc4ffc51fc54fc56fc61fc63fc65fc6bfc6cfc6ffc71fc74fc76d741d742d743d744d745d746d747d748d749d74ad74bd74cd74dd74ed74fd750d751d752d753d754d755d756d757d758d761d762d763d764d765d766d767d768d769d76ad76bd76cd76dd76ed76fd770d771d772d773d774d775d776d777d778d779d824d841d842d843d844d845d846d847d848d849d84bd84cd84dd84ed84fd850d851d852d853d854d855d856d857d858d85ad861d862d863d864d865d866d867d868d869d86bd86cd86dd86ed86fd870d871d872d873d874d875d876d877d878d87ad920d921d922d923d924d925d926d927d928d929d92ad92bd92cd92dd92ed92fd930d931d932d933d941d942d943d944d945d946d947d948d949d94ad94cd94dd94ed94fd950d951d952d953d954d955d956d957d958d959d95ad961d962d963d964d965d966d967d968d969d96ad96bd96cd96dd96ed96fd970d971d972d973d974d975d976d977d979d97ad97bd97c';
|
|
const ANSEL_VALUES_2 = '\u02c0\u1ea2\u1eba\u1ec8\u1ece\u1ee6\u1ef6\u1ea3\u1ebb\u1ec9\u1ecf\u1ee7\u1ef7\u02cb\xc0\xc8\xcc\xd2\xd9\u1e80\u1ef2\xe0\xe8\xec\xf2\xf9\u1e81\u1ef3\u02ca\xc1\u0106\xc9\u01f4\xcd\u1e30\u0139\u1e3e\u0143\xd3\u1e54\u0154\u015a\xda\u1e82\xdd\u0179\xe1\u0107\xe9\u01f5\xed\u1e31\u013a\u1e3f\u0144\xf3\u1e55\u0155\u015b\xfa\u1e83\xfd\u017a\u01fc\u01fd\u02c6\xc2\u0108\xca\u011c\u0124\xce\u0134\xd4\u015c\xdb\u0174\u0176\u1e90\xe2\u0109\xea\u011d\u0125\xee\u0135\xf4\u015d\xfb\u0175\u0177\u1e91\u02dc\xc3\u1ebc\u0128\xd1\xd5\u0168\u1e7c\u1ef8\xe3\u1ebd\u0129\xf1\xf5\u0169\u1e7d\u1ef9\u02c9\u0100\u0112\u1e20\u012a\u014c\u016a\u0101\u0113\u1e21\u012b\u014d\u016b\u01e2\u01e3\u02d8\u0102\u0114\u011e\u012c\u014e\u016c\u0103\u0115\u011f\u012d\u014f\u016d\u02d9\u1e02\u010a\u1e0a\u0116\u1e1e\u0120\u1e22\u0130\u1e40\u1e44\u1e56\u1e58\u1e60\u1e6a\u1e86\u1e8a\u1e8e\u017b\u1e03\u010b\u1e0b\u0117\u1e1f\u0121\u1e23\u1e41\u1e45\u1e57\u1e59\u1e61\u1e6b\u1e87\u1e8b\u1e8f\u017c\xa8\xc4\xcb\u1e26\xcf\xd6\xdc\u1e84\u1e8c\u0178\xe4\xeb\u1e27\xef\xf6\u1e97\xfc\u1e85\u1e8d\xff\u02c7\u01cd\u010c\u010e\u011a\u01e6\u01cf\u01e8\u013d\u0147\u01d1\u0158\u0160\u0164\u01d3\u017d\u01ce\u010d\u010f\u011b\u01e7\u01d0\u01f0\u01e9\u013e\u0148\u01d2\u0159\u0161\u0165\u01d4\u017e\u02da\xc5\xe5\u016f\u1e98\u1e99\u016e\u02bc\u02dd\u0150\u0170\u0151\u0171\xb8\xc7\u1e10\u0122\u1e28\u0136\u013b\u0145\u0156\u015e\u0162\xe7\u1e11\u0123\u1e29\u0137\u013c\u0146\u0157\u015f\u0163\u02db\u0104\u0118\u012e\u01ea\u0172\u0105\u0119\u012f\u01eb\u0173\u1ea0\u1e04\u1e0c\u1eb8\u1e24\u1eca\u1e32\u1e36\u1e42\u1e46\u1ecc\u1e5a\u1e62\u1e6c\u1ee4\u1e7e\u1e88\u1ef4\u1e92\u1ea1\u1e05\u1e0d\u1eb9\u1e25\u1ecb\u1e33\u1e37\u1e43\u1e47\u1ecd\u1e5b\u1e63\u1e6d\u1ee5\u1e7f\u1e89\u1ef5\u1e93\u1e72\u1e73\u1e00\u1e01\u2017\u1e2a\u1e2b\u0338\u023a\u023b\u0246\ua742\u0141\xd8\ua758\u023e\ua75e\u2c65\u023c\u0247\ua743\u0142\xf8\ua759\u2c66\ua75f\u2550\u2551\u2557\u255d\u255a\u2554\u2563\u2569\u2560\u2566\u256c\u2562\u2567\u255f\u2564\u2561\u2568\u255e\u2565\u256a\u2591\u2592\u2593\u2588\u2500\u2502\u2510\u2518\u2514\u250c\u2524\u2534\u251c\u252c\u253c\u2555\u255b\u2558\u2552\u2556\u255c\u2559\u2553\u256b\u258c\u2580\u2590\u2584\u25aa\u03c2\u0391\u0392\u03a5\u0394\u0395\u03a6\u0393\u03a8\u0399\u039a\u039b\u039c\u039d\u039f\u03a0\u03a7\u03a1\u03a3\u03a4\u03a9\u0398\u0397\u039e\u0396\u03b1\u03b2\u03c5\u03b4\u03b5\u03c6\u03b3\u03c8\u03b9\u03ba\u03bb\u03bc\u03bd\u03bf\u03c0\u03c7\u03c1\u03c3\u03c4\u03c9\u03b8\u03b7\u03be\u03b6\u0e3f\xa2\xa5\u20a7\u0192\xa4\u20a4\u20a0\u20a1\u20a2\u20a3\u20a5\u20a6\u20a8\u20a9\u20aa\u20ac\xb9\xb2\xb3\xaa\xba\xab\xbb\xa6\xb6\xa7\u2310\u2020\u2021\u2122\ufb01\ufb02\u2039\u203a\u2030\u2026\u201c\u201d\u201a\u201e\u2022\u2013\xa0\xb5\xbd\xbc\xbe\u221e\u2205\u2208\u2229\xac\u2261\xd7\u2265\u2264\xf7\u2248\u22c5\u2320\u2321\u221a\u2044\u2018\u2019\u2014\xad\u20ad\u20ae\u20af\u20ab';
|
|
const REPLACEMENT_CHARACTER = '\ufffd';
|
|
const decodeAnsel = (buffer, progressCallback, strict)=>{
|
|
if (progressCallback) {
|
|
progressCallback(0);
|
|
}
|
|
const createTable = (keys, keysStride, values)=>{
|
|
const map = new Map();
|
|
for(let i = 0; i < keys.length; i++){
|
|
map.set(parseInt(keys.substring(i * keysStride, (i + 1) * keysStride), 16), values.charCodeAt(i));
|
|
}
|
|
return map;
|
|
};
|
|
const table1 = createTable(ANSEL_KEYS_1, 2, ANSEL_VALUES_1), table2 = createTable(ANSEL_KEYS_2, 4, ANSEL_VALUES_2);
|
|
const byteBuffer = new Uint8Array(buffer);
|
|
const output = [];
|
|
let i = 0;
|
|
let pending = byteBuffer[i];
|
|
i++;
|
|
while(pending !== undefined){
|
|
const b = pending;
|
|
pending = byteBuffer[i];
|
|
i++;
|
|
if (b < 128) {
|
|
output.push(String.fromCharCode(b));
|
|
} else if (pending !== undefined && (b >= 0xE0 && b <= 0xFF || b >= 0xD7 && b <= 0xD9)) {
|
|
// Two bytes
|
|
const code = b * 256 + pending;
|
|
const u = table2.get(code);
|
|
if (u !== undefined) {
|
|
pending = byteBuffer[i];
|
|
i++;
|
|
output.push(String.fromCharCode(u));
|
|
} else if (!strict) {
|
|
pending = byteBuffer[i];
|
|
i++;
|
|
output.push(REPLACEMENT_CHARACTER);
|
|
} else {
|
|
throw new __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$read$2d$gedcom$40$0$2e$3$2e$2$2f$node_modules$2f$read$2d$gedcom$2f$dist$2f$es6$2f$parse$2f$error$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["ErrorGedcomDecoding"](`Illegal ANSEL character code: ${code}`, code);
|
|
}
|
|
} else {
|
|
// One byte
|
|
const u = table1.get(b);
|
|
const c = String.fromCharCode(u !== undefined ? u : 0xFFFD);
|
|
output.push(c);
|
|
}
|
|
if (progressCallback && i % __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$read$2d$gedcom$40$0$2e$3$2e$2$2f$node_modules$2f$read$2d$gedcom$2f$dist$2f$es6$2f$parse$2f$decoding$2f$common$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["BYTES_INTERVAL"] === 0) {
|
|
progressCallback(i);
|
|
}
|
|
}
|
|
if (progressCallback) {
|
|
progressCallback(i);
|
|
}
|
|
return output.join('');
|
|
}; //# sourceMappingURL=ansel.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/read-gedcom@0.3.2/node_modules/read-gedcom/dist/es6/parse/decoding/cp1252.js [app-ssr] (ecmascript)", ((__turbopack_context__) => {
|
|
"use strict";
|
|
|
|
// https://stackoverflow.com/a/4129920/4413709
|
|
__turbopack_context__.s([
|
|
"decodeCp1252",
|
|
()=>decodeCp1252
|
|
]);
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$read$2d$gedcom$40$0$2e$3$2e$2$2f$node_modules$2f$read$2d$gedcom$2f$dist$2f$es6$2f$parse$2f$decoding$2f$common$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/read-gedcom@0.3.2/node_modules/read-gedcom/dist/es6/parse/decoding/common.js [app-ssr] (ecmascript)");
|
|
;
|
|
const CP1252_TABLE = '\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f\u20ac\ufffd\u201a\u0192\u201e\u2026\u2020\u2021\u02c6\u2030\u0160\u2039\u0152\ufffd\u017d\ufffd\ufffd\u2018\u2019\u201c\u201d\u2022\u2013\u2014\u02dc\u2122\u0161\u203a\u0153\ufffd\u017e\u0178\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff';
|
|
const decodeCp1252 = (buffer, progressCallback)=>{
|
|
if (progressCallback) {
|
|
progressCallback(0);
|
|
}
|
|
const byteBuffer = new Uint8Array(buffer);
|
|
let outputView = '';
|
|
let i = 0;
|
|
for(; i < byteBuffer.length; i++){
|
|
outputView += CP1252_TABLE.charAt(byteBuffer[i]);
|
|
if (progressCallback && i % __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$read$2d$gedcom$40$0$2e$3$2e$2$2f$node_modules$2f$read$2d$gedcom$2f$dist$2f$es6$2f$parse$2f$decoding$2f$common$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["BYTES_INTERVAL"] === 0) {
|
|
progressCallback(i);
|
|
}
|
|
}
|
|
if (progressCallback) {
|
|
progressCallback(i);
|
|
}
|
|
return outputView;
|
|
}; //# sourceMappingURL=cp1252.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/read-gedcom@0.3.2/node_modules/read-gedcom/dist/es6/parse/decoding/cp850.js [app-ssr] (ecmascript)", ((__turbopack_context__) => {
|
|
"use strict";
|
|
|
|
// Generated according to https://en.wikipedia.org/wiki/Code_page_437
|
|
__turbopack_context__.s([
|
|
"decodeCp850",
|
|
()=>decodeCp850
|
|
]);
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$read$2d$gedcom$40$0$2e$3$2e$2$2f$node_modules$2f$read$2d$gedcom$2f$dist$2f$es6$2f$parse$2f$decoding$2f$common$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/read-gedcom@0.3.2/node_modules/read-gedcom/dist/es6/parse/decoding/common.js [app-ssr] (ecmascript)");
|
|
;
|
|
const CP850_TABLE = '\xc7\xfc\xe9\xe2\xe4\xe0\xe5\xe7\xea\xeb\xe8\xef\xee\xec\xc4\xc5\xc9\xe6\xc6\xf4\xf6\xf2\xfb\xf9\xff\xd6\xdc\xf8\xa3\xd8\xd7\u0192\xe1\xed\xf3\xfa\xf1\xd1\xaa\xba\xbf\xae\xac\xbd\xbc\xa1\xab\xbb\u2591\u2592\u2593\u2502\u2524\xc1\xc2\xc0\xa9\u2563\u2551\u2557\u255d\xa2\xa5\u2510\u2514\u2534\u252c\u251c\u2500\u253c\xe3\xc3\u255a\u2554\u2569\u2566\u2560\u2550\u256c\xa4\xf0\xd0\xca\xcb\xc8\u0131\xcd\xce\xcf\u2518\u250c\u2588\u2584\xa6\xcc\u2580\xd3\xdf\xd4\xd2\xf5\xd5\xb5\xfe\xde\xda\xdb\xd9\xfd\xdd\xaf\xb4\xad\xb1\u2017\xbe\xb6\xa7\xf7\xb8\xb0\xa8\xb7\xb9\xb3\xb2';
|
|
const decodeCp850 = (buffer, progressCallback)=>{
|
|
if (progressCallback) {
|
|
progressCallback(0);
|
|
}
|
|
const byteBuffer = new Uint8Array(buffer);
|
|
let outputView = '';
|
|
let i = 0;
|
|
for(; i < byteBuffer.length; i++){
|
|
const code = byteBuffer[i];
|
|
outputView += code < 128 ? String.fromCharCode(code) : CP850_TABLE.charAt(code - 128);
|
|
if (progressCallback && i % __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$read$2d$gedcom$40$0$2e$3$2e$2$2f$node_modules$2f$read$2d$gedcom$2f$dist$2f$es6$2f$parse$2f$decoding$2f$common$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["BYTES_INTERVAL"] === 0) {
|
|
progressCallback(i);
|
|
}
|
|
}
|
|
if (progressCallback) {
|
|
progressCallback(i);
|
|
}
|
|
return outputView;
|
|
}; //# sourceMappingURL=cp850.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/read-gedcom@0.3.2/node_modules/read-gedcom/dist/es6/parse/decoding/macintosh.js [app-ssr] (ecmascript)", ((__turbopack_context__) => {
|
|
"use strict";
|
|
|
|
// Generated according to https://en.wikipedia.org/wiki/Mac_OS_Roman
|
|
__turbopack_context__.s([
|
|
"decodeMacintosh",
|
|
()=>decodeMacintosh
|
|
]);
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$read$2d$gedcom$40$0$2e$3$2e$2$2f$node_modules$2f$read$2d$gedcom$2f$dist$2f$es6$2f$parse$2f$decoding$2f$common$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/read-gedcom@0.3.2/node_modules/read-gedcom/dist/es6/parse/decoding/common.js [app-ssr] (ecmascript)");
|
|
;
|
|
const MACINTOSH_TABLE = '\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10\u2318\u2713\u25c6\uf8ff\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f\xc4\xc5\xc7\xc9\xd1\xd6\xdc\xe1\xe0\xe2\xe4\xe3\xe5\xe7\xe9\xe8\xea\xeb\xed\xec\xee\xef\xf1\xf3\xf2\xf4\xf6\xf5\xfa\xf9\xfb\xfc\u2020\xb0\xa2\xa3\xa7\u2022\xb6\xdf\xae\xa9\u2122\xb4\xa8\u2260\xc6\xd8\u221e\xb1\u2264\u2265\xa5\xb5\u2202\u2211\u220f\u03c0\u222b\xaa\xba\u03a9\xe6\xf8\xbf\xa1\xac\u221a\u0192\u2248\u2206\xab\xbb\u2026\xa0\xc0\xc3\xd5\u0152\u0153\u2013\u2014\u201c\u201d\u2018\u2019\xf7\u25ca\xff\u0178\u2044\u20ac\u2039\u203a\ufb01\ufb02\u2021\xb7\u201a\u201e\u2030\xc2\xca\xc1\xcb\xc8\xcd\xce\xcf\xcc\xd3\xd4\uf8ff\xd2\xda\xdb\xd9\u0131\u02c6\u02dc\xaf\u02d8\u02d9\u02da\xb8\u02dd\u02db\u02c7';
|
|
const decodeMacintosh = (buffer, progressCallback)=>{
|
|
if (progressCallback) {
|
|
progressCallback(0);
|
|
}
|
|
const byteBuffer = new Uint8Array(buffer);
|
|
let outputView = '';
|
|
let i = 0;
|
|
for(; i < byteBuffer.length; i++){
|
|
outputView += MACINTOSH_TABLE.charAt(byteBuffer[i]);
|
|
if (progressCallback && i % __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$read$2d$gedcom$40$0$2e$3$2e$2$2f$node_modules$2f$read$2d$gedcom$2f$dist$2f$es6$2f$parse$2f$decoding$2f$common$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["BYTES_INTERVAL"] === 0) {
|
|
progressCallback(0);
|
|
}
|
|
}
|
|
if (progressCallback) {
|
|
progressCallback(i);
|
|
}
|
|
return outputView;
|
|
}; //# sourceMappingURL=macintosh.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/read-gedcom@0.3.2/node_modules/read-gedcom/dist/es6/parse/indexer.js [app-ssr] (ecmascript)", ((__turbopack_context__) => {
|
|
"use strict";
|
|
|
|
__turbopack_context__.s([
|
|
"indexTree",
|
|
()=>indexTree
|
|
]);
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$read$2d$gedcom$40$0$2e$3$2e$2$2f$node_modules$2f$read$2d$gedcom$2f$dist$2f$es6$2f$parse$2f$error$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/read-gedcom@0.3.2/node_modules/read-gedcom/dist/es6/parse/error.js [app-ssr] (ecmascript)");
|
|
;
|
|
const PROGRESS_TRAVERSE_INTERVAL = 50000;
|
|
const PROGRESS_ITERATE_INTERVAL = 5000;
|
|
const indexTree = (rootNode, noBackwardsReferencesIndex = false, doHideIndex = false, progressCallback = null)=>{
|
|
if (progressCallback) {
|
|
progressCallback();
|
|
}
|
|
let i = 0;
|
|
const stack = [
|
|
[
|
|
rootNode,
|
|
0
|
|
]
|
|
];
|
|
while(stack.length > 0){
|
|
const [node, childIndex] = stack[stack.length - 1]; // Peek
|
|
if (childIndex < node.children.length) {
|
|
stack.push([
|
|
node.children[childIndex],
|
|
0
|
|
]); // Push
|
|
} else {
|
|
// eslint-disable-next-line
|
|
const [node, _] = stack.pop(); // Pop
|
|
if (stack.length > 0) {
|
|
stack[stack.length - 1][1]++; // Next child
|
|
}
|
|
indexNode(node, !doHideIndex); // Index
|
|
if (stack.length === 0) {
|
|
indexRecords(node); // Index records on root node
|
|
}
|
|
}
|
|
i++;
|
|
if (progressCallback && i % PROGRESS_TRAVERSE_INTERVAL === 0) {
|
|
progressCallback();
|
|
}
|
|
}
|
|
if (!noBackwardsReferencesIndex) {
|
|
indexBackwardsReferences(rootNode, progressCallback);
|
|
}
|
|
if (progressCallback) {
|
|
progressCallback();
|
|
}
|
|
};
|
|
const indexNode = (node, enumerable)=>{
|
|
const byTag = {};
|
|
node.children.forEach((child, idx)=>{
|
|
if (child.tag !== null) {
|
|
if (byTag[child.tag] === undefined) {
|
|
byTag[child.tag] = [];
|
|
}
|
|
byTag[child.tag].push(idx);
|
|
}
|
|
});
|
|
Object.defineProperty(node, '_index', {
|
|
enumerable,
|
|
configurable: true,
|
|
writable: true
|
|
});
|
|
node._index = {
|
|
byTag
|
|
};
|
|
};
|
|
const indexRecords = (nodeRoot)=>{
|
|
const byTagPointer = {};
|
|
nodeRoot.children.forEach((child, idx)=>{
|
|
if (child.tag !== null) {
|
|
if (child.pointer !== null) {
|
|
if (byTagPointer[child.tag] === undefined) {
|
|
byTagPointer[child.tag] = {};
|
|
}
|
|
if (byTagPointer[child.tag][child.pointer] !== undefined) {
|
|
throw new __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$read$2d$gedcom$40$0$2e$3$2e$2$2f$node_modules$2f$read$2d$gedcom$2f$dist$2f$es6$2f$parse$2f$error$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["ErrorDuplicatePointer"](`Duplicate pointer: ${child.pointer}`, child.indexSource + 1, nodeRoot.children[byTagPointer[child.tag][child.pointer]].indexSource, child.pointer);
|
|
}
|
|
byTagPointer[child.tag][child.pointer] = idx;
|
|
}
|
|
}
|
|
});
|
|
// We assume that the index is defined
|
|
nodeRoot._index.byTagPointer = byTagPointer;
|
|
};
|
|
const indexBackwardsReferences = (rootNode, progressCallback = null)=>{
|
|
const get = (object, key, def)=>{
|
|
const value = object[key];
|
|
return value != null ? value : def;
|
|
};
|
|
const index = rootNode._index; // We assume that the index is defined
|
|
const families = get(index.byTagPointer, "FAM" /* Tag.Family */ , {});
|
|
const asSpouse = {}, asChild = {};
|
|
Object.values(families).forEach((familyIdx, i)=>{
|
|
const family = rootNode.children[familyIdx];
|
|
const familyIndex = family._index; // Also safe, by assumption
|
|
for (const spouseType of [
|
|
"HUSB" /* Tag.Husband */ ,
|
|
"WIFE" /* Tag.Wife */
|
|
]){
|
|
for (const spouseIdx of get(familyIndex.byTag, spouseType, [])){
|
|
const spouseId = family.children[spouseIdx].value;
|
|
if (spouseId !== null) {
|
|
if (asSpouse[spouseId] !== undefined) {
|
|
asSpouse[spouseId].push(familyIdx);
|
|
} else {
|
|
asSpouse[spouseId] = [
|
|
familyIdx
|
|
];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
for (const childIdx of get(familyIndex.byTag, "CHIL" /* Tag.Child */ , [])){
|
|
const childId = family.children[childIdx].value;
|
|
if (childId !== null) {
|
|
if (asChild[childId] !== undefined) {
|
|
asChild[childId].push(familyIdx);
|
|
} else {
|
|
asChild[childId] = [
|
|
familyIdx
|
|
];
|
|
}
|
|
}
|
|
}
|
|
if (progressCallback && i % PROGRESS_ITERATE_INTERVAL === 0) {
|
|
progressCallback();
|
|
}
|
|
});
|
|
index.asSpouse = asSpouse;
|
|
index.asChild = asChild;
|
|
}; //# sourceMappingURL=indexer.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/read-gedcom@0.3.2/node_modules/read-gedcom/dist/es6/parse/reader.js [app-ssr] (ecmascript)", ((__turbopack_context__) => {
|
|
"use strict";
|
|
|
|
__turbopack_context__.s([
|
|
"parseGedcom",
|
|
()=>parseGedcom
|
|
]);
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$read$2d$gedcom$40$0$2e$3$2e$2$2f$node_modules$2f$read$2d$gedcom$2f$dist$2f$es6$2f$parse$2f$decoder$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/read-gedcom@0.3.2/node_modules/read-gedcom/dist/es6/parse/decoder.js [app-ssr] (ecmascript)");
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$read$2d$gedcom$40$0$2e$3$2e$2$2f$node_modules$2f$read$2d$gedcom$2f$dist$2f$es6$2f$parse$2f$decoding$2f$utf$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/read-gedcom@0.3.2/node_modules/read-gedcom/dist/es6/parse/decoding/utf.js [app-ssr] (ecmascript)");
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$read$2d$gedcom$40$0$2e$3$2e$2$2f$node_modules$2f$read$2d$gedcom$2f$dist$2f$es6$2f$parse$2f$decoding$2f$ansel$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/read-gedcom@0.3.2/node_modules/read-gedcom/dist/es6/parse/decoding/ansel.js [app-ssr] (ecmascript)");
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$read$2d$gedcom$40$0$2e$3$2e$2$2f$node_modules$2f$read$2d$gedcom$2f$dist$2f$es6$2f$parse$2f$decoding$2f$cp1252$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/read-gedcom@0.3.2/node_modules/read-gedcom/dist/es6/parse/decoding/cp1252.js [app-ssr] (ecmascript)");
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$read$2d$gedcom$40$0$2e$3$2e$2$2f$node_modules$2f$read$2d$gedcom$2f$dist$2f$es6$2f$parse$2f$decoding$2f$cp850$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/read-gedcom@0.3.2/node_modules/read-gedcom/dist/es6/parse/decoding/cp850.js [app-ssr] (ecmascript)");
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$read$2d$gedcom$40$0$2e$3$2e$2$2f$node_modules$2f$read$2d$gedcom$2f$dist$2f$es6$2f$parse$2f$decoding$2f$macintosh$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/read-gedcom@0.3.2/node_modules/read-gedcom/dist/es6/parse/decoding/macintosh.js [app-ssr] (ecmascript)");
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$read$2d$gedcom$40$0$2e$3$2e$2$2f$node_modules$2f$read$2d$gedcom$2f$dist$2f$es6$2f$parse$2f$error$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/read-gedcom@0.3.2/node_modules/read-gedcom/dist/es6/parse/error.js [app-ssr] (ecmascript)");
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$read$2d$gedcom$40$0$2e$3$2e$2$2f$node_modules$2f$read$2d$gedcom$2f$dist$2f$es6$2f$parse$2f$indexer$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/read-gedcom@0.3.2/node_modules/read-gedcom/dist/es6/parse/indexer.js [app-ssr] (ecmascript)");
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$read$2d$gedcom$40$0$2e$3$2e$2$2f$node_modules$2f$read$2d$gedcom$2f$dist$2f$es6$2f$parse$2f$structurer$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/read-gedcom@0.3.2/node_modules/read-gedcom/dist/es6/parse/structurer.js [app-ssr] (ecmascript)");
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$read$2d$gedcom$40$0$2e$3$2e$2$2f$node_modules$2f$read$2d$gedcom$2f$dist$2f$es6$2f$parse$2f$tokenizer$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/read-gedcom@0.3.2/node_modules/read-gedcom/dist/es6/parse/tokenizer.js [app-ssr] (ecmascript)");
|
|
;
|
|
;
|
|
;
|
|
;
|
|
;
|
|
;
|
|
const parseGedcom = (buffer, options = {})=>{
|
|
checkMagicHeader(buffer);
|
|
const charset = options.forcedCharset == null ? (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$read$2d$gedcom$40$0$2e$3$2e$2$2f$node_modules$2f$read$2d$gedcom$2f$dist$2f$es6$2f$parse$2f$decoder$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["detectCharset"])(buffer) : options.forcedCharset;
|
|
const callback = options.progressCallback;
|
|
const totalBytes = buffer.byteLength;
|
|
const decodingCallback = callback ? (bytesRead)=>callback(0 /* GedcomReadingPhase.Decoding */ , bytesRead / totalBytes) : undefined;
|
|
let input;
|
|
if (charset === "UTF-8" /* FileEncoding.Utf8 */ || charset === "UTF-16be" /* FileEncoding.Utf16be */ || charset === "UTF-16le" /* FileEncoding.Utf16le */ ) {
|
|
input = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$read$2d$gedcom$40$0$2e$3$2e$2$2f$node_modules$2f$read$2d$gedcom$2f$dist$2f$es6$2f$parse$2f$decoding$2f$utf$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["decodeUtf"])(buffer, decodingCallback);
|
|
} else if (charset === "Cp1252" /* FileEncoding.Cp1252 */ ) {
|
|
input = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$read$2d$gedcom$40$0$2e$3$2e$2$2f$node_modules$2f$read$2d$gedcom$2f$dist$2f$es6$2f$parse$2f$decoding$2f$cp1252$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["decodeCp1252"])(buffer, decodingCallback);
|
|
} else if (charset === "ANSEL" /* FileEncoding.Ansel */ ) {
|
|
input = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$read$2d$gedcom$40$0$2e$3$2e$2$2f$node_modules$2f$read$2d$gedcom$2f$dist$2f$es6$2f$parse$2f$decoding$2f$ansel$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["decodeAnsel"])(buffer, decodingCallback, !!options.doStrictDecoding);
|
|
} else if (charset === "Macintosh" /* FileEncoding.Macintosh */ ) {
|
|
input = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$read$2d$gedcom$40$0$2e$3$2e$2$2f$node_modules$2f$read$2d$gedcom$2f$dist$2f$es6$2f$parse$2f$decoding$2f$macintosh$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["decodeMacintosh"])(buffer, decodingCallback);
|
|
} else if (charset === "Cp850" /* FileEncoding.Cp850 */ ) {
|
|
input = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$read$2d$gedcom$40$0$2e$3$2e$2$2f$node_modules$2f$read$2d$gedcom$2f$dist$2f$es6$2f$parse$2f$decoding$2f$cp850$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["decodeCp850"])(buffer, decodingCallback);
|
|
} else {
|
|
throw new __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$read$2d$gedcom$40$0$2e$3$2e$2$2f$node_modules$2f$read$2d$gedcom$2f$dist$2f$es6$2f$parse$2f$error$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["ErrorUnsupportedCharset"](`Unsupported charset: ${charset}`, charset);
|
|
}
|
|
const totalChars = input.length;
|
|
const tokensIterator = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$read$2d$gedcom$40$0$2e$3$2e$2$2f$node_modules$2f$read$2d$gedcom$2f$dist$2f$es6$2f$parse$2f$tokenizer$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["tokenize"])(input);
|
|
const rootNode = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$read$2d$gedcom$40$0$2e$3$2e$2$2f$node_modules$2f$read$2d$gedcom$2f$dist$2f$es6$2f$parse$2f$structurer$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["buildTree"])(tokensIterator, !!options.noInlineContinuations, callback ? (charsRead)=>callback(1 /* GedcomReadingPhase.TokenizationAndStructuring */ , charsRead / totalChars) : null);
|
|
checkTreeStructure(rootNode);
|
|
if (!options.noIndex) {
|
|
(0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$read$2d$gedcom$40$0$2e$3$2e$2$2f$node_modules$2f$read$2d$gedcom$2f$dist$2f$es6$2f$parse$2f$indexer$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["indexTree"])(rootNode, !!options.noBackwardsReferencesIndex, !!options.doHideIndex, callback ? ()=>callback(2 /* GedcomReadingPhase.Indexing */ , null) : null);
|
|
}
|
|
if (options.doFreeze) {
|
|
if (callback) {
|
|
callback(3 /* GedcomReadingPhase.Freezing */ , 0);
|
|
}
|
|
deepFreeze(rootNode);
|
|
if (callback) {
|
|
callback(3 /* GedcomReadingPhase.Freezing */ , 1);
|
|
}
|
|
}
|
|
return rootNode;
|
|
};
|
|
/**
|
|
* A simple and fast testing procedure to eliminate files that are clearly not Gedcoms.
|
|
* @param buffer The content of the file
|
|
*/ const checkMagicHeader = (buffer)=>{
|
|
const headStr = '0 HEAD';
|
|
const head = [];
|
|
for(let i = 0; i < headStr.length; i++){
|
|
head.push(headStr.charCodeAt(i));
|
|
}
|
|
const byteBuffer = new Uint8Array(buffer);
|
|
const startsWith = (bytes)=>{
|
|
if (byteBuffer.byteLength < bytes.length) {
|
|
return false;
|
|
}
|
|
for(let i = 0; i < bytes.length; i++){
|
|
if (bytes[i] !== byteBuffer[i]) {
|
|
return false;
|
|
}
|
|
}
|
|
return true;
|
|
};
|
|
if (!startsWith(head) && !startsWith(__TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$read$2d$gedcom$40$0$2e$3$2e$2$2f$node_modules$2f$read$2d$gedcom$2f$dist$2f$es6$2f$parse$2f$decoding$2f$utf$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["BOM_UTF8"].concat(head))) {
|
|
const headUtf16 = head.map((b)=>[
|
|
0,
|
|
b
|
|
]);
|
|
if (!startsWith(__TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$read$2d$gedcom$40$0$2e$3$2e$2$2f$node_modules$2f$read$2d$gedcom$2f$dist$2f$es6$2f$parse$2f$decoding$2f$utf$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["BOM_UTF16_BE"].concat(headUtf16.flat())) && !startsWith(__TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$read$2d$gedcom$40$0$2e$3$2e$2$2f$node_modules$2f$read$2d$gedcom$2f$dist$2f$es6$2f$parse$2f$decoding$2f$utf$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["BOM_UTF16_LE"].concat(headUtf16.map((bs)=>bs.slice().reverse()).flat()))) {
|
|
const headUtf32 = head.map((b)=>[
|
|
0,
|
|
0,
|
|
0,
|
|
b
|
|
]);
|
|
if (!startsWith(__TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$read$2d$gedcom$40$0$2e$3$2e$2$2f$node_modules$2f$read$2d$gedcom$2f$dist$2f$es6$2f$parse$2f$decoding$2f$utf$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["BOM_UTF32_BE"].concat(headUtf32.flat())) && !startsWith(__TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$read$2d$gedcom$40$0$2e$3$2e$2$2f$node_modules$2f$read$2d$gedcom$2f$dist$2f$es6$2f$parse$2f$decoding$2f$utf$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["BOM_UTF32_LE"].concat(headUtf32.map((bs)=>bs.slice().reverse()).flat()))) {
|
|
throw new __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$read$2d$gedcom$40$0$2e$3$2e$2$2f$node_modules$2f$read$2d$gedcom$2f$dist$2f$es6$2f$parse$2f$error$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["ErrorInvalidFileType"]('Probably not a Gedcom file');
|
|
}
|
|
}
|
|
}
|
|
};
|
|
/**
|
|
* A simple procedure verifying that the root node starts with a {@link Tag.Header} and ends with a {@link Tag.Trailer}.
|
|
* @param rootNode The root node
|
|
*/ const checkTreeStructure = (rootNode)=>{
|
|
const root = rootNode.children;
|
|
// Assumes that `root.length > 0`
|
|
const header = root[0];
|
|
if (header.tag !== "HEAD" /* Tag.Header */ ) {
|
|
throw new __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$read$2d$gedcom$40$0$2e$3$2e$2$2f$node_modules$2f$read$2d$gedcom$2f$dist$2f$es6$2f$parse$2f$error$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["ErrorTreeStructure"](`First node is not a header (got ${header.tag})`);
|
|
}
|
|
const trailer = root[root.length - 1];
|
|
if (trailer.tag !== "TRLR" /* Tag.Trailer */ ) {
|
|
throw new __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$read$2d$gedcom$40$0$2e$3$2e$2$2f$node_modules$2f$read$2d$gedcom$2f$dist$2f$es6$2f$parse$2f$error$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["ErrorTreeStructure"](`Last node is not a trailer (got ${trailer.tag})`);
|
|
}
|
|
};
|
|
/**
|
|
* Freezes this object to prevent further modifications.
|
|
* @param object The object to be frozen
|
|
*/ const deepFreeze = (object)=>{
|
|
let queue = [
|
|
object
|
|
];
|
|
while(queue.length > 0){
|
|
const next = [];
|
|
queue.forEach((obj)=>{
|
|
if (obj != null && typeof obj === 'object' && !Object.isFrozen(obj)) {
|
|
Object.freeze(obj);
|
|
Object.getOwnPropertyNames(obj).forEach((property)=>next.push(obj[property]));
|
|
}
|
|
});
|
|
queue = next;
|
|
}
|
|
}; //# sourceMappingURL=reader.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/@radix-ui+primitive@1.1.1/node_modules/@radix-ui/primitive/dist/index.mjs [app-ssr] (ecmascript)", ((__turbopack_context__) => {
|
|
"use strict";
|
|
|
|
// packages/core/primitive/src/primitive.tsx
|
|
__turbopack_context__.s([
|
|
"composeEventHandlers",
|
|
()=>composeEventHandlers
|
|
]);
|
|
function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
|
|
return function handleEvent(event) {
|
|
originalEventHandler?.(event);
|
|
if (checkForDefaultPrevented === false || !event.defaultPrevented) {
|
|
return ourEventHandler?.(event);
|
|
}
|
|
};
|
|
}
|
|
;
|
|
//# sourceMappingURL=index.mjs.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/@radix-ui+react-use-controllable-state@1.1.0_@types+react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs [app-ssr] (ecmascript)", ((__turbopack_context__) => {
|
|
"use strict";
|
|
|
|
// packages/react/use-controllable-state/src/useControllableState.tsx
|
|
__turbopack_context__.s([
|
|
"useControllableState",
|
|
()=>useControllableState
|
|
]);
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$next$40$16$2e$0$2e$3_react$2d$dom$40$19$2e$2$2e$0_react$40$19$2e$2$2e$0_$5f$react$40$19$2e$2$2e$0$2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$ssr$2f$react$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react.js [app-ssr] (ecmascript)");
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$radix$2d$ui$2b$react$2d$use$2d$callback$2d$ref$40$1$2e$1$2e$0_$40$types$2b$react$40$19$2e$2$2e$6_react$40$19$2e$2$2e$0$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$use$2d$callback$2d$ref$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/@radix-ui+react-use-callback-ref@1.1.0_@types+react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs [app-ssr] (ecmascript)");
|
|
;
|
|
;
|
|
function useControllableState({ prop, defaultProp, onChange = ()=>{} }) {
|
|
const [uncontrolledProp, setUncontrolledProp] = useUncontrolledState({
|
|
defaultProp,
|
|
onChange
|
|
});
|
|
const isControlled = prop !== void 0;
|
|
const value = isControlled ? prop : uncontrolledProp;
|
|
const handleChange = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$radix$2d$ui$2b$react$2d$use$2d$callback$2d$ref$40$1$2e$1$2e$0_$40$types$2b$react$40$19$2e$2$2e$6_react$40$19$2e$2$2e$0$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$use$2d$callback$2d$ref$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["useCallbackRef"])(onChange);
|
|
const setValue = __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$next$40$16$2e$0$2e$3_react$2d$dom$40$19$2e$2$2e$0_react$40$19$2e$2$2e$0_$5f$react$40$19$2e$2$2e$0$2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$ssr$2f$react$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["useCallback"]((nextValue)=>{
|
|
if (isControlled) {
|
|
const setter = nextValue;
|
|
const value2 = typeof nextValue === "function" ? setter(prop) : nextValue;
|
|
if (value2 !== prop) handleChange(value2);
|
|
} else {
|
|
setUncontrolledProp(nextValue);
|
|
}
|
|
}, [
|
|
isControlled,
|
|
prop,
|
|
setUncontrolledProp,
|
|
handleChange
|
|
]);
|
|
return [
|
|
value,
|
|
setValue
|
|
];
|
|
}
|
|
function useUncontrolledState({ defaultProp, onChange }) {
|
|
const uncontrolledState = __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$next$40$16$2e$0$2e$3_react$2d$dom$40$19$2e$2$2e$0_react$40$19$2e$2$2e$0_$5f$react$40$19$2e$2$2e$0$2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$ssr$2f$react$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["useState"](defaultProp);
|
|
const [value] = uncontrolledState;
|
|
const prevValueRef = __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$next$40$16$2e$0$2e$3_react$2d$dom$40$19$2e$2$2e$0_react$40$19$2e$2$2e$0_$5f$react$40$19$2e$2$2e$0$2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$ssr$2f$react$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["useRef"](value);
|
|
const handleChange = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$radix$2d$ui$2b$react$2d$use$2d$callback$2d$ref$40$1$2e$1$2e$0_$40$types$2b$react$40$19$2e$2$2e$6_react$40$19$2e$2$2e$0$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$use$2d$callback$2d$ref$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["useCallbackRef"])(onChange);
|
|
__TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$next$40$16$2e$0$2e$3_react$2d$dom$40$19$2e$2$2e$0_react$40$19$2e$2$2e$0_$5f$react$40$19$2e$2$2e$0$2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$ssr$2f$react$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["useEffect"](()=>{
|
|
if (prevValueRef.current !== value) {
|
|
handleChange(value);
|
|
prevValueRef.current = value;
|
|
}
|
|
}, [
|
|
value,
|
|
prevValueRef,
|
|
handleChange
|
|
]);
|
|
return uncontrolledState;
|
|
}
|
|
;
|
|
//# sourceMappingURL=index.mjs.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/@radix-ui+react-use-previous@1.1.0_@types+react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-use-previous/dist/index.mjs [app-ssr] (ecmascript)", ((__turbopack_context__) => {
|
|
"use strict";
|
|
|
|
// packages/react/use-previous/src/usePrevious.tsx
|
|
__turbopack_context__.s([
|
|
"usePrevious",
|
|
()=>usePrevious
|
|
]);
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$next$40$16$2e$0$2e$3_react$2d$dom$40$19$2e$2$2e$0_react$40$19$2e$2$2e$0_$5f$react$40$19$2e$2$2e$0$2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$ssr$2f$react$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react.js [app-ssr] (ecmascript)");
|
|
;
|
|
function usePrevious(value) {
|
|
const ref = __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$next$40$16$2e$0$2e$3_react$2d$dom$40$19$2e$2$2e$0_react$40$19$2e$2$2e$0_$5f$react$40$19$2e$2$2e$0$2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$ssr$2f$react$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["useRef"]({
|
|
value,
|
|
previous: value
|
|
});
|
|
return __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$next$40$16$2e$0$2e$3_react$2d$dom$40$19$2e$2$2e$0_react$40$19$2e$2$2e$0_$5f$react$40$19$2e$2$2e$0$2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$ssr$2f$react$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["useMemo"](()=>{
|
|
if (ref.current.value !== value) {
|
|
ref.current.previous = ref.current.value;
|
|
ref.current.value = value;
|
|
}
|
|
return ref.current.previous;
|
|
}, [
|
|
value
|
|
]);
|
|
}
|
|
;
|
|
//# sourceMappingURL=index.mjs.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/@radix-ui+react-use-size@1.1.0_@types+react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-use-size/dist/index.mjs [app-ssr] (ecmascript)", ((__turbopack_context__) => {
|
|
"use strict";
|
|
|
|
// packages/react/use-size/src/useSize.tsx
|
|
__turbopack_context__.s([
|
|
"useSize",
|
|
()=>useSize
|
|
]);
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$next$40$16$2e$0$2e$3_react$2d$dom$40$19$2e$2$2e$0_react$40$19$2e$2$2e$0_$5f$react$40$19$2e$2$2e$0$2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$ssr$2f$react$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react.js [app-ssr] (ecmascript)");
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$radix$2d$ui$2b$react$2d$use$2d$layout$2d$effect$40$1$2e$1$2e$0_$40$types$2b$react$40$19$2e$2$2e$6_react$40$19$2e$2$2e$0$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$use$2d$layout$2d$effect$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/@radix-ui+react-use-layout-effect@1.1.0_@types+react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs [app-ssr] (ecmascript)");
|
|
;
|
|
;
|
|
function useSize(element) {
|
|
const [size, setSize] = __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$next$40$16$2e$0$2e$3_react$2d$dom$40$19$2e$2$2e$0_react$40$19$2e$2$2e$0_$5f$react$40$19$2e$2$2e$0$2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$ssr$2f$react$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["useState"](void 0);
|
|
(0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$radix$2d$ui$2b$react$2d$use$2d$layout$2d$effect$40$1$2e$1$2e$0_$40$types$2b$react$40$19$2e$2$2e$6_react$40$19$2e$2$2e$0$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$use$2d$layout$2d$effect$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["useLayoutEffect"])(()=>{
|
|
if (element) {
|
|
setSize({
|
|
width: element.offsetWidth,
|
|
height: element.offsetHeight
|
|
});
|
|
const resizeObserver = new ResizeObserver((entries)=>{
|
|
if (!Array.isArray(entries)) {
|
|
return;
|
|
}
|
|
if (!entries.length) {
|
|
return;
|
|
}
|
|
const entry = entries[0];
|
|
let width;
|
|
let height;
|
|
if ("borderBoxSize" in entry) {
|
|
const borderSizeEntry = entry["borderBoxSize"];
|
|
const borderSize = Array.isArray(borderSizeEntry) ? borderSizeEntry[0] : borderSizeEntry;
|
|
width = borderSize["inlineSize"];
|
|
height = borderSize["blockSize"];
|
|
} else {
|
|
width = element.offsetWidth;
|
|
height = element.offsetHeight;
|
|
}
|
|
setSize({
|
|
width,
|
|
height
|
|
});
|
|
});
|
|
resizeObserver.observe(element, {
|
|
box: "border-box"
|
|
});
|
|
return ()=>resizeObserver.unobserve(element);
|
|
} else {
|
|
setSize(void 0);
|
|
}
|
|
}, [
|
|
element
|
|
]);
|
|
return size;
|
|
}
|
|
;
|
|
//# sourceMappingURL=index.mjs.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/@radix-ui+react-switch@1.1.2_@types+react-dom@19.2.3_@types+react@19.2.6__@types+react@_54653a3bb17f872d614747b147554763/node_modules/@radix-ui/react-switch/dist/index.mjs [app-ssr] (ecmascript)", ((__turbopack_context__) => {
|
|
"use strict";
|
|
|
|
__turbopack_context__.s([
|
|
"Root",
|
|
()=>Root,
|
|
"Switch",
|
|
()=>Switch,
|
|
"SwitchThumb",
|
|
()=>SwitchThumb,
|
|
"Thumb",
|
|
()=>Thumb,
|
|
"createSwitchScope",
|
|
()=>createSwitchScope
|
|
]);
|
|
// packages/react/switch/src/Switch.tsx
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$next$40$16$2e$0$2e$3_react$2d$dom$40$19$2e$2$2e$0_react$40$19$2e$2$2e$0_$5f$react$40$19$2e$2$2e$0$2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$ssr$2f$react$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react.js [app-ssr] (ecmascript)");
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$radix$2d$ui$2b$primitive$40$1$2e$1$2e$1$2f$node_modules$2f40$radix$2d$ui$2f$primitive$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/@radix-ui+primitive@1.1.1/node_modules/@radix-ui/primitive/dist/index.mjs [app-ssr] (ecmascript)");
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$radix$2d$ui$2b$react$2d$compose$2d$refs$40$1$2e$1$2e$1_$40$types$2b$react$40$19$2e$2$2e$6_react$40$19$2e$2$2e$0$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$compose$2d$refs$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/@radix-ui+react-compose-refs@1.1.1_@types+react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-compose-refs/dist/index.mjs [app-ssr] (ecmascript)");
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$radix$2d$ui$2b$react$2d$context$40$1$2e$1$2e$1_$40$types$2b$react$40$19$2e$2$2e$6_react$40$19$2e$2$2e$0$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$context$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/@radix-ui+react-context@1.1.1_@types+react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-context/dist/index.mjs [app-ssr] (ecmascript)");
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$radix$2d$ui$2b$react$2d$use$2d$controllable$2d$state$40$1$2e$1$2e$0_$40$types$2b$react$40$19$2e$2$2e$6_react$40$19$2e$2$2e$0$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$use$2d$controllable$2d$state$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/@radix-ui+react-use-controllable-state@1.1.0_@types+react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs [app-ssr] (ecmascript)");
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$radix$2d$ui$2b$react$2d$use$2d$previous$40$1$2e$1$2e$0_$40$types$2b$react$40$19$2e$2$2e$6_react$40$19$2e$2$2e$0$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$use$2d$previous$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/@radix-ui+react-use-previous@1.1.0_@types+react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-use-previous/dist/index.mjs [app-ssr] (ecmascript)");
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$radix$2d$ui$2b$react$2d$use$2d$size$40$1$2e$1$2e$0_$40$types$2b$react$40$19$2e$2$2e$6_react$40$19$2e$2$2e$0$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$use$2d$size$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/@radix-ui+react-use-size@1.1.0_@types+react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-use-size/dist/index.mjs [app-ssr] (ecmascript)");
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$radix$2d$ui$2b$react$2d$primitive$40$2$2e$0$2e$1_$40$types$2b$react$2d$dom$40$19$2e$2$2e$3_$40$types$2b$react$40$19$2e$2$2e$6_$5f40$types$2b$rea_4f53963f71a6eb8b0116fe0dd1078946$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$primitive$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/@radix-ui+react-primitive@2.0.1_@types+react-dom@19.2.3_@types+react@19.2.6__@types+rea_4f53963f71a6eb8b0116fe0dd1078946/node_modules/@radix-ui/react-primitive/dist/index.mjs [app-ssr] (ecmascript)");
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$next$40$16$2e$0$2e$3_react$2d$dom$40$19$2e$2$2e$0_react$40$19$2e$2$2e$0_$5f$react$40$19$2e$2$2e$0$2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$ssr$2f$react$2d$jsx$2d$runtime$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react-jsx-runtime.js [app-ssr] (ecmascript)");
|
|
"use client";
|
|
;
|
|
;
|
|
;
|
|
;
|
|
;
|
|
;
|
|
;
|
|
;
|
|
;
|
|
var SWITCH_NAME = "Switch";
|
|
var [createSwitchContext, createSwitchScope] = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$radix$2d$ui$2b$react$2d$context$40$1$2e$1$2e$1_$40$types$2b$react$40$19$2e$2$2e$6_react$40$19$2e$2$2e$0$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$context$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["createContextScope"])(SWITCH_NAME);
|
|
var [SwitchProvider, useSwitchContext] = createSwitchContext(SWITCH_NAME);
|
|
var Switch = __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$next$40$16$2e$0$2e$3_react$2d$dom$40$19$2e$2$2e$0_react$40$19$2e$2$2e$0_$5f$react$40$19$2e$2$2e$0$2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$ssr$2f$react$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["forwardRef"]((props, forwardedRef)=>{
|
|
const { __scopeSwitch, name, checked: checkedProp, defaultChecked, required, disabled, value = "on", onCheckedChange, form, ...switchProps } = props;
|
|
const [button, setButton] = __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$next$40$16$2e$0$2e$3_react$2d$dom$40$19$2e$2$2e$0_react$40$19$2e$2$2e$0_$5f$react$40$19$2e$2$2e$0$2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$ssr$2f$react$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["useState"](null);
|
|
const composedRefs = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$radix$2d$ui$2b$react$2d$compose$2d$refs$40$1$2e$1$2e$1_$40$types$2b$react$40$19$2e$2$2e$6_react$40$19$2e$2$2e$0$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$compose$2d$refs$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["useComposedRefs"])(forwardedRef, (node)=>setButton(node));
|
|
const hasConsumerStoppedPropagationRef = __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$next$40$16$2e$0$2e$3_react$2d$dom$40$19$2e$2$2e$0_react$40$19$2e$2$2e$0_$5f$react$40$19$2e$2$2e$0$2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$ssr$2f$react$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["useRef"](false);
|
|
const isFormControl = button ? form || !!button.closest("form") : true;
|
|
const [checked = false, setChecked] = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$radix$2d$ui$2b$react$2d$use$2d$controllable$2d$state$40$1$2e$1$2e$0_$40$types$2b$react$40$19$2e$2$2e$6_react$40$19$2e$2$2e$0$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$use$2d$controllable$2d$state$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["useControllableState"])({
|
|
prop: checkedProp,
|
|
defaultProp: defaultChecked,
|
|
onChange: onCheckedChange
|
|
});
|
|
return /* @__PURE__ */ (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$next$40$16$2e$0$2e$3_react$2d$dom$40$19$2e$2$2e$0_react$40$19$2e$2$2e$0_$5f$react$40$19$2e$2$2e$0$2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$ssr$2f$react$2d$jsx$2d$runtime$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["jsxs"])(SwitchProvider, {
|
|
scope: __scopeSwitch,
|
|
checked,
|
|
disabled,
|
|
children: [
|
|
/* @__PURE__ */ (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$next$40$16$2e$0$2e$3_react$2d$dom$40$19$2e$2$2e$0_react$40$19$2e$2$2e$0_$5f$react$40$19$2e$2$2e$0$2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$ssr$2f$react$2d$jsx$2d$runtime$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["jsx"])(__TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$radix$2d$ui$2b$react$2d$primitive$40$2$2e$0$2e$1_$40$types$2b$react$2d$dom$40$19$2e$2$2e$3_$40$types$2b$react$40$19$2e$2$2e$6_$5f40$types$2b$rea_4f53963f71a6eb8b0116fe0dd1078946$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$primitive$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["Primitive"].button, {
|
|
type: "button",
|
|
role: "switch",
|
|
"aria-checked": checked,
|
|
"aria-required": required,
|
|
"data-state": getState(checked),
|
|
"data-disabled": disabled ? "" : void 0,
|
|
disabled,
|
|
value,
|
|
...switchProps,
|
|
ref: composedRefs,
|
|
onClick: (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$radix$2d$ui$2b$primitive$40$1$2e$1$2e$1$2f$node_modules$2f40$radix$2d$ui$2f$primitive$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["composeEventHandlers"])(props.onClick, (event)=>{
|
|
setChecked((prevChecked)=>!prevChecked);
|
|
if (isFormControl) {
|
|
hasConsumerStoppedPropagationRef.current = event.isPropagationStopped();
|
|
if (!hasConsumerStoppedPropagationRef.current) event.stopPropagation();
|
|
}
|
|
})
|
|
}),
|
|
isFormControl && /* @__PURE__ */ (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$next$40$16$2e$0$2e$3_react$2d$dom$40$19$2e$2$2e$0_react$40$19$2e$2$2e$0_$5f$react$40$19$2e$2$2e$0$2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$ssr$2f$react$2d$jsx$2d$runtime$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["jsx"])(BubbleInput, {
|
|
control: button,
|
|
bubbles: !hasConsumerStoppedPropagationRef.current,
|
|
name,
|
|
value,
|
|
checked,
|
|
required,
|
|
disabled,
|
|
form,
|
|
style: {
|
|
transform: "translateX(-100%)"
|
|
}
|
|
})
|
|
]
|
|
});
|
|
});
|
|
Switch.displayName = SWITCH_NAME;
|
|
var THUMB_NAME = "SwitchThumb";
|
|
var SwitchThumb = __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$next$40$16$2e$0$2e$3_react$2d$dom$40$19$2e$2$2e$0_react$40$19$2e$2$2e$0_$5f$react$40$19$2e$2$2e$0$2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$ssr$2f$react$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["forwardRef"]((props, forwardedRef)=>{
|
|
const { __scopeSwitch, ...thumbProps } = props;
|
|
const context = useSwitchContext(THUMB_NAME, __scopeSwitch);
|
|
return /* @__PURE__ */ (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$next$40$16$2e$0$2e$3_react$2d$dom$40$19$2e$2$2e$0_react$40$19$2e$2$2e$0_$5f$react$40$19$2e$2$2e$0$2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$ssr$2f$react$2d$jsx$2d$runtime$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["jsx"])(__TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$radix$2d$ui$2b$react$2d$primitive$40$2$2e$0$2e$1_$40$types$2b$react$2d$dom$40$19$2e$2$2e$3_$40$types$2b$react$40$19$2e$2$2e$6_$5f40$types$2b$rea_4f53963f71a6eb8b0116fe0dd1078946$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$primitive$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["Primitive"].span, {
|
|
"data-state": getState(context.checked),
|
|
"data-disabled": context.disabled ? "" : void 0,
|
|
...thumbProps,
|
|
ref: forwardedRef
|
|
});
|
|
});
|
|
SwitchThumb.displayName = THUMB_NAME;
|
|
var BubbleInput = (props)=>{
|
|
const { control, checked, bubbles = true, ...inputProps } = props;
|
|
const ref = __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$next$40$16$2e$0$2e$3_react$2d$dom$40$19$2e$2$2e$0_react$40$19$2e$2$2e$0_$5f$react$40$19$2e$2$2e$0$2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$ssr$2f$react$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["useRef"](null);
|
|
const prevChecked = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$radix$2d$ui$2b$react$2d$use$2d$previous$40$1$2e$1$2e$0_$40$types$2b$react$40$19$2e$2$2e$6_react$40$19$2e$2$2e$0$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$use$2d$previous$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["usePrevious"])(checked);
|
|
const controlSize = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$radix$2d$ui$2b$react$2d$use$2d$size$40$1$2e$1$2e$0_$40$types$2b$react$40$19$2e$2$2e$6_react$40$19$2e$2$2e$0$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$use$2d$size$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["useSize"])(control);
|
|
__TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$next$40$16$2e$0$2e$3_react$2d$dom$40$19$2e$2$2e$0_react$40$19$2e$2$2e$0_$5f$react$40$19$2e$2$2e$0$2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$ssr$2f$react$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["useEffect"](()=>{
|
|
const input = ref.current;
|
|
const inputProto = window.HTMLInputElement.prototype;
|
|
const descriptor = Object.getOwnPropertyDescriptor(inputProto, "checked");
|
|
const setChecked = descriptor.set;
|
|
if (prevChecked !== checked && setChecked) {
|
|
const event = new Event("click", {
|
|
bubbles
|
|
});
|
|
setChecked.call(input, checked);
|
|
input.dispatchEvent(event);
|
|
}
|
|
}, [
|
|
prevChecked,
|
|
checked,
|
|
bubbles
|
|
]);
|
|
return /* @__PURE__ */ (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$next$40$16$2e$0$2e$3_react$2d$dom$40$19$2e$2$2e$0_react$40$19$2e$2$2e$0_$5f$react$40$19$2e$2$2e$0$2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$ssr$2f$react$2d$jsx$2d$runtime$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["jsx"])("input", {
|
|
type: "checkbox",
|
|
"aria-hidden": true,
|
|
defaultChecked: checked,
|
|
...inputProps,
|
|
tabIndex: -1,
|
|
ref,
|
|
style: {
|
|
...props.style,
|
|
...controlSize,
|
|
position: "absolute",
|
|
pointerEvents: "none",
|
|
opacity: 0,
|
|
margin: 0
|
|
}
|
|
});
|
|
};
|
|
function getState(checked) {
|
|
return checked ? "checked" : "unchecked";
|
|
}
|
|
var Root = Switch;
|
|
var Thumb = SwitchThumb;
|
|
;
|
|
//# sourceMappingURL=index.mjs.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/@radix-ui+react-label@2.1.1_@types+react-dom@19.2.3_@types+react@19.2.6__@types+react@1_bd8162f32426f4bdbb2a84f1027e4863/node_modules/@radix-ui/react-label/dist/index.mjs [app-ssr] (ecmascript)", ((__turbopack_context__) => {
|
|
"use strict";
|
|
|
|
__turbopack_context__.s([
|
|
"Label",
|
|
()=>Label,
|
|
"Root",
|
|
()=>Root
|
|
]);
|
|
// packages/react/label/src/Label.tsx
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$next$40$16$2e$0$2e$3_react$2d$dom$40$19$2e$2$2e$0_react$40$19$2e$2$2e$0_$5f$react$40$19$2e$2$2e$0$2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$ssr$2f$react$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react.js [app-ssr] (ecmascript)");
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$radix$2d$ui$2b$react$2d$primitive$40$2$2e$0$2e$1_$40$types$2b$react$2d$dom$40$19$2e$2$2e$3_$40$types$2b$react$40$19$2e$2$2e$6_$5f40$types$2b$rea_4f53963f71a6eb8b0116fe0dd1078946$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$primitive$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/@radix-ui+react-primitive@2.0.1_@types+react-dom@19.2.3_@types+react@19.2.6__@types+rea_4f53963f71a6eb8b0116fe0dd1078946/node_modules/@radix-ui/react-primitive/dist/index.mjs [app-ssr] (ecmascript)");
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$next$40$16$2e$0$2e$3_react$2d$dom$40$19$2e$2$2e$0_react$40$19$2e$2$2e$0_$5f$react$40$19$2e$2$2e$0$2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$ssr$2f$react$2d$jsx$2d$runtime$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/next@16.0.3_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react-jsx-runtime.js [app-ssr] (ecmascript)");
|
|
"use client";
|
|
;
|
|
;
|
|
;
|
|
var NAME = "Label";
|
|
var Label = __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$next$40$16$2e$0$2e$3_react$2d$dom$40$19$2e$2$2e$0_react$40$19$2e$2$2e$0_$5f$react$40$19$2e$2$2e$0$2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$ssr$2f$react$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["forwardRef"]((props, forwardedRef)=>{
|
|
return /* @__PURE__ */ (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$next$40$16$2e$0$2e$3_react$2d$dom$40$19$2e$2$2e$0_react$40$19$2e$2$2e$0_$5f$react$40$19$2e$2$2e$0$2f$node_modules$2f$next$2f$dist$2f$server$2f$route$2d$modules$2f$app$2d$page$2f$vendored$2f$ssr$2f$react$2d$jsx$2d$runtime$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["jsx"])(__TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$radix$2d$ui$2b$react$2d$primitive$40$2$2e$0$2e$1_$40$types$2b$react$2d$dom$40$19$2e$2$2e$3_$40$types$2b$react$40$19$2e$2$2e$6_$5f40$types$2b$rea_4f53963f71a6eb8b0116fe0dd1078946$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$primitive$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["Primitive"].label, {
|
|
...props,
|
|
ref: forwardedRef,
|
|
onMouseDown: (event)=>{
|
|
const target = event.target;
|
|
if (target.closest("button, input, select, textarea")) return;
|
|
props.onMouseDown?.(event);
|
|
if (!event.defaultPrevented && event.detail > 1) event.preventDefault();
|
|
}
|
|
});
|
|
});
|
|
Label.displayName = NAME;
|
|
var Root = Label;
|
|
;
|
|
//# sourceMappingURL=index.mjs.map
|
|
}),
|
|
];
|
|
|
|
//# sourceMappingURL=a0629__pnpm_3d62f45e._.js.map
|