20087 lines
1.1 MiB
Plaintext
20087 lines
1.1 MiB
Plaintext
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/lucide-react@0.454.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/log-out.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",
|
|
()=>LogOut
|
|
]);
|
|
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 LogOut = (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"])("LogOut", [
|
|
[
|
|
"path",
|
|
{
|
|
d: "M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",
|
|
key: "1uf3rs"
|
|
}
|
|
],
|
|
[
|
|
"polyline",
|
|
{
|
|
points: "16 17 21 12 16 7",
|
|
key: "1gabdz"
|
|
}
|
|
],
|
|
[
|
|
"line",
|
|
{
|
|
x1: "21",
|
|
x2: "9",
|
|
y1: "12",
|
|
y2: "12",
|
|
key: "1uyos4"
|
|
}
|
|
]
|
|
]);
|
|
;
|
|
//# sourceMappingURL=log-out.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/log-out.js [app-ssr] (ecmascript) <export default as LogOut>", ((__turbopack_context__) => {
|
|
"use strict";
|
|
|
|
__turbopack_context__.s([
|
|
"LogOut",
|
|
()=>__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$log$2d$out$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$log$2d$out$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/log-out.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/chevron-down.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",
|
|
()=>ChevronDown
|
|
]);
|
|
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 ChevronDown = (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"])("ChevronDown", [
|
|
[
|
|
"path",
|
|
{
|
|
d: "m6 9 6 6 6-6",
|
|
key: "qrunsl"
|
|
}
|
|
]
|
|
]);
|
|
;
|
|
//# sourceMappingURL=chevron-down.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/chevron-down.js [app-ssr] (ecmascript) <export default as ChevronDown>", ((__turbopack_context__) => {
|
|
"use strict";
|
|
|
|
__turbopack_context__.s([
|
|
"ChevronDown",
|
|
()=>__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$chevron$2d$down$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$chevron$2d$down$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/chevron-down.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/plus.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",
|
|
()=>Plus
|
|
]);
|
|
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 Plus = (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"])("Plus", [
|
|
[
|
|
"path",
|
|
{
|
|
d: "M5 12h14",
|
|
key: "1ays0h"
|
|
}
|
|
],
|
|
[
|
|
"path",
|
|
{
|
|
d: "M12 5v14",
|
|
key: "s699le"
|
|
}
|
|
]
|
|
]);
|
|
;
|
|
//# sourceMappingURL=plus.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/plus.js [app-ssr] (ecmascript) <export default as Plus>", ((__turbopack_context__) => {
|
|
"use strict";
|
|
|
|
__turbopack_context__.s([
|
|
"Plus",
|
|
()=>__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$plus$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$plus$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/plus.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/trash-2.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",
|
|
()=>Trash2
|
|
]);
|
|
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 Trash2 = (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"])("Trash2", [
|
|
[
|
|
"path",
|
|
{
|
|
d: "M3 6h18",
|
|
key: "d0wm0j"
|
|
}
|
|
],
|
|
[
|
|
"path",
|
|
{
|
|
d: "M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",
|
|
key: "4alrt4"
|
|
}
|
|
],
|
|
[
|
|
"path",
|
|
{
|
|
d: "M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",
|
|
key: "v07s0e"
|
|
}
|
|
],
|
|
[
|
|
"line",
|
|
{
|
|
x1: "10",
|
|
x2: "10",
|
|
y1: "11",
|
|
y2: "17",
|
|
key: "1uufr5"
|
|
}
|
|
],
|
|
[
|
|
"line",
|
|
{
|
|
x1: "14",
|
|
x2: "14",
|
|
y1: "11",
|
|
y2: "17",
|
|
key: "xtxkd"
|
|
}
|
|
]
|
|
]);
|
|
;
|
|
//# sourceMappingURL=trash-2.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/trash-2.js [app-ssr] (ecmascript) <export default as Trash2>", ((__turbopack_context__) => {
|
|
"use strict";
|
|
|
|
__turbopack_context__.s([
|
|
"Trash2",
|
|
()=>__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$trash$2d$2$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$trash$2d$2$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/trash-2.js [app-ssr] (ecmascript)");
|
|
}),
|
|
"[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/@radix-ui+react-collection@1.1.1_@types+react-dom@19.2.3_@types+react@19.2.6__@types+re_1ad17166111274b6b451c5ad4817bfc8/node_modules/@radix-ui/react-collection/dist/index.mjs [app-ssr] (ecmascript)", ((__turbopack_context__) => {
|
|
"use strict";
|
|
|
|
__turbopack_context__.s([
|
|
"createCollection",
|
|
()=>createCollection
|
|
]);
|
|
// packages/react/collection/src/Collection.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$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$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)");
|
|
"use client";
|
|
;
|
|
;
|
|
;
|
|
;
|
|
;
|
|
function createCollection(name) {
|
|
const PROVIDER_NAME = name + "CollectionProvider";
|
|
const [createCollectionContext, createCollectionScope] = (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"])(PROVIDER_NAME);
|
|
const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(PROVIDER_NAME, {
|
|
collectionRef: {
|
|
current: null
|
|
},
|
|
itemMap: /* @__PURE__ */ new Map()
|
|
});
|
|
const CollectionProvider = (props)=>{
|
|
const { scope, children } = 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$__["default"].useRef(null);
|
|
const itemMap = __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$__["default"].useRef(/* @__PURE__ */ new Map()).current;
|
|
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"])(CollectionProviderImpl, {
|
|
scope,
|
|
itemMap,
|
|
collectionRef: ref,
|
|
children
|
|
});
|
|
};
|
|
CollectionProvider.displayName = PROVIDER_NAME;
|
|
const COLLECTION_SLOT_NAME = name + "CollectionSlot";
|
|
const CollectionSlot = __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$__["default"].forwardRef((props, forwardedRef)=>{
|
|
const { scope, children } = props;
|
|
const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
|
|
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, context.collectionRef);
|
|
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$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"], {
|
|
ref: composedRefs,
|
|
children
|
|
});
|
|
});
|
|
CollectionSlot.displayName = COLLECTION_SLOT_NAME;
|
|
const ITEM_SLOT_NAME = name + "CollectionItemSlot";
|
|
const ITEM_DATA_ATTR = "data-radix-collection-item";
|
|
const CollectionItemSlot = __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$__["default"].forwardRef((props, forwardedRef)=>{
|
|
const { scope, children, ...itemData } = 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$__["default"].useRef(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, ref);
|
|
const context = useCollectionContext(ITEM_SLOT_NAME, scope);
|
|
__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$__["default"].useEffect(()=>{
|
|
context.itemMap.set(ref, {
|
|
ref,
|
|
...itemData
|
|
});
|
|
return ()=>void context.itemMap.delete(ref);
|
|
});
|
|
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$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"], {
|
|
...{
|
|
[ITEM_DATA_ATTR]: ""
|
|
},
|
|
ref: composedRefs,
|
|
children
|
|
});
|
|
});
|
|
CollectionItemSlot.displayName = ITEM_SLOT_NAME;
|
|
function useCollection(scope) {
|
|
const context = useCollectionContext(name + "CollectionConsumer", scope);
|
|
const getItems = __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$__["default"].useCallback(()=>{
|
|
const collectionNode = context.collectionRef.current;
|
|
if (!collectionNode) return [];
|
|
const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));
|
|
const items = Array.from(context.itemMap.values());
|
|
const orderedItems = items.sort((a, b)=>orderedNodes.indexOf(a.ref.current) - orderedNodes.indexOf(b.ref.current));
|
|
return orderedItems;
|
|
}, [
|
|
context.collectionRef,
|
|
context.itemMap
|
|
]);
|
|
return getItems;
|
|
}
|
|
return [
|
|
{
|
|
Provider: CollectionProvider,
|
|
Slot: CollectionSlot,
|
|
ItemSlot: CollectionItemSlot
|
|
},
|
|
useCollection,
|
|
createCollectionScope
|
|
];
|
|
}
|
|
;
|
|
//# sourceMappingURL=index.mjs.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/@radix-ui+react-direction@1.1.0_@types+react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-direction/dist/index.mjs [app-ssr] (ecmascript)", ((__turbopack_context__) => {
|
|
"use strict";
|
|
|
|
// packages/react/direction/src/Direction.tsx
|
|
__turbopack_context__.s([
|
|
"DirectionProvider",
|
|
()=>DirectionProvider,
|
|
"Provider",
|
|
()=>Provider,
|
|
"useDirection",
|
|
()=>useDirection
|
|
]);
|
|
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)");
|
|
;
|
|
;
|
|
var DirectionContext = __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"](void 0);
|
|
var DirectionProvider = (props)=>{
|
|
const { dir, children } = props;
|
|
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"])(DirectionContext.Provider, {
|
|
value: dir,
|
|
children
|
|
});
|
|
};
|
|
function useDirection(localDir) {
|
|
const globalDir = __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"](DirectionContext);
|
|
return localDir || globalDir || "ltr";
|
|
}
|
|
var Provider = DirectionProvider;
|
|
;
|
|
//# sourceMappingURL=index.mjs.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/@floating-ui+utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs [app-ssr] (ecmascript)", ((__turbopack_context__) => {
|
|
"use strict";
|
|
|
|
/**
|
|
* Custom positioning reference element.
|
|
* @see https://floating-ui.com/docs/virtual-elements
|
|
*/ __turbopack_context__.s([
|
|
"alignments",
|
|
()=>alignments,
|
|
"clamp",
|
|
()=>clamp,
|
|
"createCoords",
|
|
()=>createCoords,
|
|
"evaluate",
|
|
()=>evaluate,
|
|
"expandPaddingObject",
|
|
()=>expandPaddingObject,
|
|
"floor",
|
|
()=>floor,
|
|
"getAlignment",
|
|
()=>getAlignment,
|
|
"getAlignmentAxis",
|
|
()=>getAlignmentAxis,
|
|
"getAlignmentSides",
|
|
()=>getAlignmentSides,
|
|
"getAxisLength",
|
|
()=>getAxisLength,
|
|
"getExpandedPlacements",
|
|
()=>getExpandedPlacements,
|
|
"getOppositeAlignmentPlacement",
|
|
()=>getOppositeAlignmentPlacement,
|
|
"getOppositeAxis",
|
|
()=>getOppositeAxis,
|
|
"getOppositeAxisPlacements",
|
|
()=>getOppositeAxisPlacements,
|
|
"getOppositePlacement",
|
|
()=>getOppositePlacement,
|
|
"getPaddingObject",
|
|
()=>getPaddingObject,
|
|
"getSide",
|
|
()=>getSide,
|
|
"getSideAxis",
|
|
()=>getSideAxis,
|
|
"max",
|
|
()=>max,
|
|
"min",
|
|
()=>min,
|
|
"placements",
|
|
()=>placements,
|
|
"rectToClientRect",
|
|
()=>rectToClientRect,
|
|
"round",
|
|
()=>round,
|
|
"sides",
|
|
()=>sides
|
|
]);
|
|
const sides = [
|
|
'top',
|
|
'right',
|
|
'bottom',
|
|
'left'
|
|
];
|
|
const alignments = [
|
|
'start',
|
|
'end'
|
|
];
|
|
const placements = /*#__PURE__*/ sides.reduce((acc, side)=>acc.concat(side, side + "-" + alignments[0], side + "-" + alignments[1]), []);
|
|
const min = Math.min;
|
|
const max = Math.max;
|
|
const round = Math.round;
|
|
const floor = Math.floor;
|
|
const createCoords = (v)=>({
|
|
x: v,
|
|
y: v
|
|
});
|
|
const oppositeSideMap = {
|
|
left: 'right',
|
|
right: 'left',
|
|
bottom: 'top',
|
|
top: 'bottom'
|
|
};
|
|
const oppositeAlignmentMap = {
|
|
start: 'end',
|
|
end: 'start'
|
|
};
|
|
function clamp(start, value, end) {
|
|
return max(start, min(value, end));
|
|
}
|
|
function evaluate(value, param) {
|
|
return typeof value === 'function' ? value(param) : value;
|
|
}
|
|
function getSide(placement) {
|
|
return placement.split('-')[0];
|
|
}
|
|
function getAlignment(placement) {
|
|
return placement.split('-')[1];
|
|
}
|
|
function getOppositeAxis(axis) {
|
|
return axis === 'x' ? 'y' : 'x';
|
|
}
|
|
function getAxisLength(axis) {
|
|
return axis === 'y' ? 'height' : 'width';
|
|
}
|
|
const yAxisSides = /*#__PURE__*/ new Set([
|
|
'top',
|
|
'bottom'
|
|
]);
|
|
function getSideAxis(placement) {
|
|
return yAxisSides.has(getSide(placement)) ? 'y' : 'x';
|
|
}
|
|
function getAlignmentAxis(placement) {
|
|
return getOppositeAxis(getSideAxis(placement));
|
|
}
|
|
function getAlignmentSides(placement, rects, rtl) {
|
|
if (rtl === void 0) {
|
|
rtl = false;
|
|
}
|
|
const alignment = getAlignment(placement);
|
|
const alignmentAxis = getAlignmentAxis(placement);
|
|
const length = getAxisLength(alignmentAxis);
|
|
let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';
|
|
if (rects.reference[length] > rects.floating[length]) {
|
|
mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
|
|
}
|
|
return [
|
|
mainAlignmentSide,
|
|
getOppositePlacement(mainAlignmentSide)
|
|
];
|
|
}
|
|
function getExpandedPlacements(placement) {
|
|
const oppositePlacement = getOppositePlacement(placement);
|
|
return [
|
|
getOppositeAlignmentPlacement(placement),
|
|
oppositePlacement,
|
|
getOppositeAlignmentPlacement(oppositePlacement)
|
|
];
|
|
}
|
|
function getOppositeAlignmentPlacement(placement) {
|
|
return placement.replace(/start|end/g, (alignment)=>oppositeAlignmentMap[alignment]);
|
|
}
|
|
const lrPlacement = [
|
|
'left',
|
|
'right'
|
|
];
|
|
const rlPlacement = [
|
|
'right',
|
|
'left'
|
|
];
|
|
const tbPlacement = [
|
|
'top',
|
|
'bottom'
|
|
];
|
|
const btPlacement = [
|
|
'bottom',
|
|
'top'
|
|
];
|
|
function getSideList(side, isStart, rtl) {
|
|
switch(side){
|
|
case 'top':
|
|
case 'bottom':
|
|
if (rtl) return isStart ? rlPlacement : lrPlacement;
|
|
return isStart ? lrPlacement : rlPlacement;
|
|
case 'left':
|
|
case 'right':
|
|
return isStart ? tbPlacement : btPlacement;
|
|
default:
|
|
return [];
|
|
}
|
|
}
|
|
function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
|
|
const alignment = getAlignment(placement);
|
|
let list = getSideList(getSide(placement), direction === 'start', rtl);
|
|
if (alignment) {
|
|
list = list.map((side)=>side + "-" + alignment);
|
|
if (flipAlignment) {
|
|
list = list.concat(list.map(getOppositeAlignmentPlacement));
|
|
}
|
|
}
|
|
return list;
|
|
}
|
|
function getOppositePlacement(placement) {
|
|
return placement.replace(/left|right|bottom|top/g, (side)=>oppositeSideMap[side]);
|
|
}
|
|
function expandPaddingObject(padding) {
|
|
return {
|
|
top: 0,
|
|
right: 0,
|
|
bottom: 0,
|
|
left: 0,
|
|
...padding
|
|
};
|
|
}
|
|
function getPaddingObject(padding) {
|
|
return typeof padding !== 'number' ? expandPaddingObject(padding) : {
|
|
top: padding,
|
|
right: padding,
|
|
bottom: padding,
|
|
left: padding
|
|
};
|
|
}
|
|
function rectToClientRect(rect) {
|
|
const { x, y, width, height } = rect;
|
|
return {
|
|
width,
|
|
height,
|
|
top: y,
|
|
left: x,
|
|
right: x + width,
|
|
bottom: y + height,
|
|
x,
|
|
y
|
|
};
|
|
}
|
|
;
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/@floating-ui+core@1.7.3/node_modules/@floating-ui/core/dist/floating-ui.core.mjs [app-ssr] (ecmascript) <locals>", ((__turbopack_context__) => {
|
|
"use strict";
|
|
|
|
__turbopack_context__.s([
|
|
"arrow",
|
|
()=>arrow,
|
|
"autoPlacement",
|
|
()=>autoPlacement,
|
|
"computePosition",
|
|
()=>computePosition,
|
|
"detectOverflow",
|
|
()=>detectOverflow,
|
|
"flip",
|
|
()=>flip,
|
|
"hide",
|
|
()=>hide,
|
|
"inline",
|
|
()=>inline,
|
|
"limitShift",
|
|
()=>limitShift,
|
|
"offset",
|
|
()=>offset,
|
|
"shift",
|
|
()=>shift,
|
|
"size",
|
|
()=>size
|
|
]);
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/@floating-ui+utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs [app-ssr] (ecmascript)");
|
|
;
|
|
;
|
|
function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
let { reference, floating } = _ref;
|
|
const sideAxis = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getSideAxis"])(placement);
|
|
const alignmentAxis = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getAlignmentAxis"])(placement);
|
|
const alignLength = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getAxisLength"])(alignmentAxis);
|
|
const side = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getSide"])(placement);
|
|
const isVertical = sideAxis === 'y';
|
|
const commonX = reference.x + reference.width / 2 - floating.width / 2;
|
|
const commonY = reference.y + reference.height / 2 - floating.height / 2;
|
|
const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;
|
|
let coords;
|
|
switch(side){
|
|
case 'top':
|
|
coords = {
|
|
x: commonX,
|
|
y: reference.y - floating.height
|
|
};
|
|
break;
|
|
case 'bottom':
|
|
coords = {
|
|
x: commonX,
|
|
y: reference.y + reference.height
|
|
};
|
|
break;
|
|
case 'right':
|
|
coords = {
|
|
x: reference.x + reference.width,
|
|
y: commonY
|
|
};
|
|
break;
|
|
case 'left':
|
|
coords = {
|
|
x: reference.x - floating.width,
|
|
y: commonY
|
|
};
|
|
break;
|
|
default:
|
|
coords = {
|
|
x: reference.x,
|
|
y: reference.y
|
|
};
|
|
}
|
|
switch((0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getAlignment"])(placement)){
|
|
case 'start':
|
|
coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
|
|
break;
|
|
case 'end':
|
|
coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
|
|
break;
|
|
}
|
|
return coords;
|
|
}
|
|
/**
|
|
* Computes the `x` and `y` coordinates that will place the floating element
|
|
* next to a given reference element.
|
|
*
|
|
* This export does not have any `platform` interface logic. You will need to
|
|
* write one for the platform you are using Floating UI with.
|
|
*/ const computePosition = async (reference, floating, config)=>{
|
|
const { placement = 'bottom', strategy = 'absolute', middleware = [], platform } = config;
|
|
const validMiddleware = middleware.filter(Boolean);
|
|
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));
|
|
let rects = await platform.getElementRects({
|
|
reference,
|
|
floating,
|
|
strategy
|
|
});
|
|
let { x, y } = computeCoordsFromPlacement(rects, placement, rtl);
|
|
let statefulPlacement = placement;
|
|
let middlewareData = {};
|
|
let resetCount = 0;
|
|
for(let i = 0; i < validMiddleware.length; i++){
|
|
const { name, fn } = validMiddleware[i];
|
|
const { x: nextX, y: nextY, data, reset } = await fn({
|
|
x,
|
|
y,
|
|
initialPlacement: placement,
|
|
placement: statefulPlacement,
|
|
strategy,
|
|
middlewareData,
|
|
rects,
|
|
platform,
|
|
elements: {
|
|
reference,
|
|
floating
|
|
}
|
|
});
|
|
x = nextX != null ? nextX : x;
|
|
y = nextY != null ? nextY : y;
|
|
middlewareData = {
|
|
...middlewareData,
|
|
[name]: {
|
|
...middlewareData[name],
|
|
...data
|
|
}
|
|
};
|
|
if (reset && resetCount <= 50) {
|
|
resetCount++;
|
|
if (typeof reset === 'object') {
|
|
if (reset.placement) {
|
|
statefulPlacement = reset.placement;
|
|
}
|
|
if (reset.rects) {
|
|
rects = reset.rects === true ? await platform.getElementRects({
|
|
reference,
|
|
floating,
|
|
strategy
|
|
}) : reset.rects;
|
|
}
|
|
({ x, y } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
|
|
}
|
|
i = -1;
|
|
}
|
|
}
|
|
return {
|
|
x,
|
|
y,
|
|
placement: statefulPlacement,
|
|
strategy,
|
|
middlewareData
|
|
};
|
|
};
|
|
/**
|
|
* Resolves with an object of overflow side offsets that determine how much the
|
|
* element is overflowing a given clipping boundary on each side.
|
|
* - positive = overflowing the boundary by that number of pixels
|
|
* - negative = how many pixels left before it will overflow
|
|
* - 0 = lies flush with the boundary
|
|
* @see https://floating-ui.com/docs/detectOverflow
|
|
*/ async function detectOverflow(state, options) {
|
|
var _await$platform$isEle;
|
|
if (options === void 0) {
|
|
options = {};
|
|
}
|
|
const { x, y, platform, rects, elements, strategy } = state;
|
|
const { boundary = 'clippingAncestors', rootBoundary = 'viewport', elementContext = 'floating', altBoundary = false, padding = 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$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["evaluate"])(options, state);
|
|
const paddingObject = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getPaddingObject"])(padding);
|
|
const altContext = elementContext === 'floating' ? 'reference' : 'floating';
|
|
const element = elements[altBoundary ? altContext : elementContext];
|
|
const clippingClientRect = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["rectToClientRect"])(await platform.getClippingRect({
|
|
element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating)),
|
|
boundary,
|
|
rootBoundary,
|
|
strategy
|
|
}));
|
|
const rect = elementContext === 'floating' ? {
|
|
x,
|
|
y,
|
|
width: rects.floating.width,
|
|
height: rects.floating.height
|
|
} : rects.reference;
|
|
const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
|
|
const offsetScale = await (platform.isElement == null ? void 0 : platform.isElement(offsetParent)) ? await (platform.getScale == null ? void 0 : platform.getScale(offsetParent)) || {
|
|
x: 1,
|
|
y: 1
|
|
} : {
|
|
x: 1,
|
|
y: 1
|
|
};
|
|
const elementClientRect = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["rectToClientRect"])(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
elements,
|
|
rect,
|
|
offsetParent,
|
|
strategy
|
|
}) : rect);
|
|
return {
|
|
top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
|
|
bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
|
|
left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
|
|
right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
|
|
};
|
|
}
|
|
/**
|
|
* Provides data to position an inner element of the floating element so that it
|
|
* appears centered to the reference element.
|
|
* @see https://floating-ui.com/docs/arrow
|
|
*/ const arrow = (options)=>({
|
|
name: 'arrow',
|
|
options,
|
|
async fn (state) {
|
|
const { x, y, placement, rects, platform, elements, middlewareData } = state;
|
|
// Since `element` is required, we don't Partial<> the type.
|
|
const { element, padding = 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$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["evaluate"])(options, state) || {};
|
|
if (element == null) {
|
|
return {};
|
|
}
|
|
const paddingObject = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getPaddingObject"])(padding);
|
|
const coords = {
|
|
x,
|
|
y
|
|
};
|
|
const axis = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getAlignmentAxis"])(placement);
|
|
const length = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getAxisLength"])(axis);
|
|
const arrowDimensions = await platform.getDimensions(element);
|
|
const isYAxis = axis === 'y';
|
|
const minProp = isYAxis ? 'top' : 'left';
|
|
const maxProp = isYAxis ? 'bottom' : 'right';
|
|
const clientProp = isYAxis ? 'clientHeight' : 'clientWidth';
|
|
const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
|
|
const startDiff = coords[axis] - rects.reference[axis];
|
|
const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));
|
|
let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;
|
|
// DOM platform can return `window` as the `offsetParent`.
|
|
if (!clientSize || !await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent))) {
|
|
clientSize = elements.floating[clientProp] || rects.floating[length];
|
|
}
|
|
const centerToReference = endDiff / 2 - startDiff / 2;
|
|
// If the padding is large enough that it causes the arrow to no longer be
|
|
// centered, modify the padding so that it is centered.
|
|
const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;
|
|
const minPadding = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["min"])(paddingObject[minProp], largestPossiblePadding);
|
|
const maxPadding = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["min"])(paddingObject[maxProp], largestPossiblePadding);
|
|
// Make sure the arrow doesn't overflow the floating element if the center
|
|
// point is outside the floating element's bounds.
|
|
const min$1 = minPadding;
|
|
const max = clientSize - arrowDimensions[length] - maxPadding;
|
|
const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
|
|
const offset = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["clamp"])(min$1, center, max);
|
|
// If the reference is small enough that the arrow's padding causes it to
|
|
// to point to nothing for an aligned placement, adjust the offset of the
|
|
// floating element itself. To ensure `shift()` continues to take action,
|
|
// a single reset is performed when this is true.
|
|
const shouldAddOffset = !middlewareData.arrow && (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getAlignment"])(placement) != null && center !== offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
|
|
const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max : 0;
|
|
return {
|
|
[axis]: coords[axis] + alignmentOffset,
|
|
data: {
|
|
[axis]: offset,
|
|
centerOffset: center - offset - alignmentOffset,
|
|
...shouldAddOffset && {
|
|
alignmentOffset
|
|
}
|
|
},
|
|
reset: shouldAddOffset
|
|
};
|
|
}
|
|
});
|
|
function getPlacementList(alignment, autoAlignment, allowedPlacements) {
|
|
const allowedPlacementsSortedByAlignment = alignment ? [
|
|
...allowedPlacements.filter((placement)=>(0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getAlignment"])(placement) === alignment),
|
|
...allowedPlacements.filter((placement)=>(0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getAlignment"])(placement) !== alignment)
|
|
] : allowedPlacements.filter((placement)=>(0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getSide"])(placement) === placement);
|
|
return allowedPlacementsSortedByAlignment.filter((placement)=>{
|
|
if (alignment) {
|
|
return (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getAlignment"])(placement) === alignment || (autoAlignment ? (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getOppositeAlignmentPlacement"])(placement) !== placement : false);
|
|
}
|
|
return true;
|
|
});
|
|
}
|
|
/**
|
|
* Optimizes the visibility of the floating element by choosing the placement
|
|
* that has the most space available automatically, without needing to specify a
|
|
* preferred placement. Alternative to `flip`.
|
|
* @see https://floating-ui.com/docs/autoPlacement
|
|
*/ const autoPlacement = function(options) {
|
|
if (options === void 0) {
|
|
options = {};
|
|
}
|
|
return {
|
|
name: 'autoPlacement',
|
|
options,
|
|
async fn (state) {
|
|
var _middlewareData$autoP, _middlewareData$autoP2, _placementsThatFitOnE;
|
|
const { rects, middlewareData, placement, platform, elements } = state;
|
|
const { crossAxis = false, alignment, allowedPlacements = __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["placements"], autoAlignment = true, ...detectOverflowOptions } = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["evaluate"])(options, state);
|
|
const placements$1 = alignment !== undefined || allowedPlacements === __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["placements"] ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements;
|
|
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0;
|
|
const currentPlacement = placements$1[currentIndex];
|
|
if (currentPlacement == null) {
|
|
return {};
|
|
}
|
|
const alignmentSides = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getAlignmentSides"])(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));
|
|
// Make `computeCoords` start from the right place.
|
|
if (placement !== currentPlacement) {
|
|
return {
|
|
reset: {
|
|
placement: placements$1[0]
|
|
}
|
|
};
|
|
}
|
|
const currentOverflows = [
|
|
overflow[(0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getSide"])(currentPlacement)],
|
|
overflow[alignmentSides[0]],
|
|
overflow[alignmentSides[1]]
|
|
];
|
|
const allOverflows = [
|
|
...((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || [],
|
|
{
|
|
placement: currentPlacement,
|
|
overflows: currentOverflows
|
|
}
|
|
];
|
|
const nextPlacement = placements$1[currentIndex + 1];
|
|
// There are more placements to check.
|
|
if (nextPlacement) {
|
|
return {
|
|
data: {
|
|
index: currentIndex + 1,
|
|
overflows: allOverflows
|
|
},
|
|
reset: {
|
|
placement: nextPlacement
|
|
}
|
|
};
|
|
}
|
|
const placementsSortedByMostSpace = allOverflows.map((d)=>{
|
|
const alignment = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getAlignment"])(d.placement);
|
|
return [
|
|
d.placement,
|
|
alignment && crossAxis ? // Check along the mainAxis and main crossAxis side.
|
|
d.overflows.slice(0, 2).reduce((acc, v)=>acc + v, 0) : // Check only the mainAxis.
|
|
d.overflows[0],
|
|
d.overflows
|
|
];
|
|
}).sort((a, b)=>a[1] - b[1]);
|
|
const placementsThatFitOnEachSide = placementsSortedByMostSpace.filter((d)=>d[2].slice(0, // Aligned placements should not check their opposite crossAxis
|
|
// side.
|
|
(0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getAlignment"])(d[0]) ? 2 : 3).every((v)=>v <= 0));
|
|
const resetPlacement = ((_placementsThatFitOnE = placementsThatFitOnEachSide[0]) == null ? void 0 : _placementsThatFitOnE[0]) || placementsSortedByMostSpace[0][0];
|
|
if (resetPlacement !== placement) {
|
|
return {
|
|
data: {
|
|
index: currentIndex + 1,
|
|
overflows: allOverflows
|
|
},
|
|
reset: {
|
|
placement: resetPlacement
|
|
}
|
|
};
|
|
}
|
|
return {};
|
|
}
|
|
};
|
|
};
|
|
/**
|
|
* Optimizes the visibility of the floating element by flipping the `placement`
|
|
* in order to keep it in view when the preferred placement(s) will overflow the
|
|
* clipping boundary. Alternative to `autoPlacement`.
|
|
* @see https://floating-ui.com/docs/flip
|
|
*/ const flip = function(options) {
|
|
if (options === void 0) {
|
|
options = {};
|
|
}
|
|
return {
|
|
name: 'flip',
|
|
options,
|
|
async fn (state) {
|
|
var _middlewareData$arrow, _middlewareData$flip;
|
|
const { placement, middlewareData, rects, initialPlacement, platform, elements } = state;
|
|
const { mainAxis: checkMainAxis = true, crossAxis: checkCrossAxis = true, fallbackPlacements: specifiedFallbackPlacements, fallbackStrategy = 'bestFit', fallbackAxisSideDirection = 'none', flipAlignment = true, ...detectOverflowOptions } = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["evaluate"])(options, state);
|
|
// If a reset by the arrow was caused due to an alignment offset being
|
|
// added, we should skip any logic now since `flip()` has already done its
|
|
// work.
|
|
// https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643
|
|
if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
|
|
return {};
|
|
}
|
|
const side = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getSide"])(placement);
|
|
const initialSideAxis = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getSideAxis"])(initialPlacement);
|
|
const isBasePlacement = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getSide"])(initialPlacement) === initialPlacement;
|
|
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
|
|
const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [
|
|
(0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getOppositePlacement"])(initialPlacement)
|
|
] : (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getExpandedPlacements"])(initialPlacement));
|
|
const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== 'none';
|
|
if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {
|
|
fallbackPlacements.push(...(0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getOppositeAxisPlacements"])(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
|
|
}
|
|
const placements = [
|
|
initialPlacement,
|
|
...fallbackPlacements
|
|
];
|
|
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
const overflows = [];
|
|
let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
|
|
if (checkMainAxis) {
|
|
overflows.push(overflow[side]);
|
|
}
|
|
if (checkCrossAxis) {
|
|
const sides = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getAlignmentSides"])(placement, rects, rtl);
|
|
overflows.push(overflow[sides[0]], overflow[sides[1]]);
|
|
}
|
|
overflowsData = [
|
|
...overflowsData,
|
|
{
|
|
placement,
|
|
overflows
|
|
}
|
|
];
|
|
// One or more sides is overflowing.
|
|
if (!overflows.every((side)=>side <= 0)) {
|
|
var _middlewareData$flip2, _overflowsData$filter;
|
|
const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
|
|
const nextPlacement = placements[nextIndex];
|
|
if (nextPlacement) {
|
|
const ignoreCrossAxisOverflow = checkCrossAxis === 'alignment' ? initialSideAxis !== (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getSideAxis"])(nextPlacement) : false;
|
|
if (!ignoreCrossAxisOverflow || // We leave the current main axis only if every placement on that axis
|
|
// overflows the main axis.
|
|
overflowsData.every((d)=>(0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getSideAxis"])(d.placement) === initialSideAxis ? d.overflows[0] > 0 : true)) {
|
|
// Try next placement and re-run the lifecycle.
|
|
return {
|
|
data: {
|
|
index: nextIndex,
|
|
overflows: overflowsData
|
|
},
|
|
reset: {
|
|
placement: nextPlacement
|
|
}
|
|
};
|
|
}
|
|
}
|
|
// First, find the candidates that fit on the mainAxis side of overflow,
|
|
// then find the placement that fits the best on the main crossAxis side.
|
|
let resetPlacement = (_overflowsData$filter = overflowsData.filter((d)=>d.overflows[0] <= 0).sort((a, b)=>a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;
|
|
// Otherwise fallback.
|
|
if (!resetPlacement) {
|
|
switch(fallbackStrategy){
|
|
case 'bestFit':
|
|
{
|
|
var _overflowsData$filter2;
|
|
const placement = (_overflowsData$filter2 = overflowsData.filter((d)=>{
|
|
if (hasFallbackAxisSideDirection) {
|
|
const currentSideAxis = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getSideAxis"])(d.placement);
|
|
return currentSideAxis === initialSideAxis || // Create a bias to the `y` side axis due to horizontal
|
|
// reading directions favoring greater width.
|
|
currentSideAxis === 'y';
|
|
}
|
|
return true;
|
|
}).map((d)=>[
|
|
d.placement,
|
|
d.overflows.filter((overflow)=>overflow > 0).reduce((acc, overflow)=>acc + overflow, 0)
|
|
]).sort((a, b)=>a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0];
|
|
if (placement) {
|
|
resetPlacement = placement;
|
|
}
|
|
break;
|
|
}
|
|
case 'initialPlacement':
|
|
resetPlacement = initialPlacement;
|
|
break;
|
|
}
|
|
}
|
|
if (placement !== resetPlacement) {
|
|
return {
|
|
reset: {
|
|
placement: resetPlacement
|
|
}
|
|
};
|
|
}
|
|
}
|
|
return {};
|
|
}
|
|
};
|
|
};
|
|
function getSideOffsets(overflow, rect) {
|
|
return {
|
|
top: overflow.top - rect.height,
|
|
right: overflow.right - rect.width,
|
|
bottom: overflow.bottom - rect.height,
|
|
left: overflow.left - rect.width
|
|
};
|
|
}
|
|
function isAnySideFullyClipped(overflow) {
|
|
return __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["sides"].some((side)=>overflow[side] >= 0);
|
|
}
|
|
/**
|
|
* Provides data to hide the floating element in applicable situations, such as
|
|
* when it is not in the same clipping context as the reference element.
|
|
* @see https://floating-ui.com/docs/hide
|
|
*/ const hide = function(options) {
|
|
if (options === void 0) {
|
|
options = {};
|
|
}
|
|
return {
|
|
name: 'hide',
|
|
options,
|
|
async fn (state) {
|
|
const { rects } = state;
|
|
const { strategy = 'referenceHidden', ...detectOverflowOptions } = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["evaluate"])(options, state);
|
|
switch(strategy){
|
|
case 'referenceHidden':
|
|
{
|
|
const overflow = await detectOverflow(state, {
|
|
...detectOverflowOptions,
|
|
elementContext: 'reference'
|
|
});
|
|
const offsets = getSideOffsets(overflow, rects.reference);
|
|
return {
|
|
data: {
|
|
referenceHiddenOffsets: offsets,
|
|
referenceHidden: isAnySideFullyClipped(offsets)
|
|
}
|
|
};
|
|
}
|
|
case 'escaped':
|
|
{
|
|
const overflow = await detectOverflow(state, {
|
|
...detectOverflowOptions,
|
|
altBoundary: true
|
|
});
|
|
const offsets = getSideOffsets(overflow, rects.floating);
|
|
return {
|
|
data: {
|
|
escapedOffsets: offsets,
|
|
escaped: isAnySideFullyClipped(offsets)
|
|
}
|
|
};
|
|
}
|
|
default:
|
|
{
|
|
return {};
|
|
}
|
|
}
|
|
}
|
|
};
|
|
};
|
|
function getBoundingRect(rects) {
|
|
const minX = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["min"])(...rects.map((rect)=>rect.left));
|
|
const minY = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["min"])(...rects.map((rect)=>rect.top));
|
|
const maxX = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["max"])(...rects.map((rect)=>rect.right));
|
|
const maxY = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["max"])(...rects.map((rect)=>rect.bottom));
|
|
return {
|
|
x: minX,
|
|
y: minY,
|
|
width: maxX - minX,
|
|
height: maxY - minY
|
|
};
|
|
}
|
|
function getRectsByLine(rects) {
|
|
const sortedRects = rects.slice().sort((a, b)=>a.y - b.y);
|
|
const groups = [];
|
|
let prevRect = null;
|
|
for(let i = 0; i < sortedRects.length; i++){
|
|
const rect = sortedRects[i];
|
|
if (!prevRect || rect.y - prevRect.y > prevRect.height / 2) {
|
|
groups.push([
|
|
rect
|
|
]);
|
|
} else {
|
|
groups[groups.length - 1].push(rect);
|
|
}
|
|
prevRect = rect;
|
|
}
|
|
return groups.map((rect)=>(0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["rectToClientRect"])(getBoundingRect(rect)));
|
|
}
|
|
/**
|
|
* Provides improved positioning for inline reference elements that can span
|
|
* over multiple lines, such as hyperlinks or range selections.
|
|
* @see https://floating-ui.com/docs/inline
|
|
*/ const inline = function(options) {
|
|
if (options === void 0) {
|
|
options = {};
|
|
}
|
|
return {
|
|
name: 'inline',
|
|
options,
|
|
async fn (state) {
|
|
const { placement, elements, rects, platform, strategy } = state;
|
|
// A MouseEvent's client{X,Y} coords can be up to 2 pixels off a
|
|
// ClientRect's bounds, despite the event listener being triggered. A
|
|
// padding of 2 seems to handle this issue.
|
|
const { padding = 2, x, y } = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["evaluate"])(options, state);
|
|
const nativeClientRects = Array.from(await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference)) || []);
|
|
const clientRects = getRectsByLine(nativeClientRects);
|
|
const fallback = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["rectToClientRect"])(getBoundingRect(nativeClientRects));
|
|
const paddingObject = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getPaddingObject"])(padding);
|
|
function getBoundingClientRect() {
|
|
// There are two rects and they are disjoined.
|
|
if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null && y != null) {
|
|
// Find the first rect in which the point is fully inside.
|
|
return clientRects.find((rect)=>x > rect.left - paddingObject.left && x < rect.right + paddingObject.right && y > rect.top - paddingObject.top && y < rect.bottom + paddingObject.bottom) || fallback;
|
|
}
|
|
// There are 2 or more connected rects.
|
|
if (clientRects.length >= 2) {
|
|
if ((0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getSideAxis"])(placement) === 'y') {
|
|
const firstRect = clientRects[0];
|
|
const lastRect = clientRects[clientRects.length - 1];
|
|
const isTop = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getSide"])(placement) === 'top';
|
|
const top = firstRect.top;
|
|
const bottom = lastRect.bottom;
|
|
const left = isTop ? firstRect.left : lastRect.left;
|
|
const right = isTop ? firstRect.right : lastRect.right;
|
|
const width = right - left;
|
|
const height = bottom - top;
|
|
return {
|
|
top,
|
|
bottom,
|
|
left,
|
|
right,
|
|
width,
|
|
height,
|
|
x: left,
|
|
y: top
|
|
};
|
|
}
|
|
const isLeftSide = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getSide"])(placement) === 'left';
|
|
const maxRight = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["max"])(...clientRects.map((rect)=>rect.right));
|
|
const minLeft = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["min"])(...clientRects.map((rect)=>rect.left));
|
|
const measureRects = clientRects.filter((rect)=>isLeftSide ? rect.left === minLeft : rect.right === maxRight);
|
|
const top = measureRects[0].top;
|
|
const bottom = measureRects[measureRects.length - 1].bottom;
|
|
const left = minLeft;
|
|
const right = maxRight;
|
|
const width = right - left;
|
|
const height = bottom - top;
|
|
return {
|
|
top,
|
|
bottom,
|
|
left,
|
|
right,
|
|
width,
|
|
height,
|
|
x: left,
|
|
y: top
|
|
};
|
|
}
|
|
return fallback;
|
|
}
|
|
const resetRects = await platform.getElementRects({
|
|
reference: {
|
|
getBoundingClientRect
|
|
},
|
|
floating: elements.floating,
|
|
strategy
|
|
});
|
|
if (rects.reference.x !== resetRects.reference.x || rects.reference.y !== resetRects.reference.y || rects.reference.width !== resetRects.reference.width || rects.reference.height !== resetRects.reference.height) {
|
|
return {
|
|
reset: {
|
|
rects: resetRects
|
|
}
|
|
};
|
|
}
|
|
return {};
|
|
}
|
|
};
|
|
};
|
|
const originSides = /*#__PURE__*/ new Set([
|
|
'left',
|
|
'top'
|
|
]);
|
|
// For type backwards-compatibility, the `OffsetOptions` type was also
|
|
// Derivable.
|
|
async function convertValueToCoords(state, options) {
|
|
const { placement, platform, elements } = state;
|
|
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
|
|
const side = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getSide"])(placement);
|
|
const alignment = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getAlignment"])(placement);
|
|
const isVertical = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getSideAxis"])(placement) === 'y';
|
|
const mainAxisMulti = originSides.has(side) ? -1 : 1;
|
|
const crossAxisMulti = rtl && isVertical ? -1 : 1;
|
|
const rawValue = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["evaluate"])(options, state);
|
|
// eslint-disable-next-line prefer-const
|
|
let { mainAxis, crossAxis, alignmentAxis } = typeof rawValue === 'number' ? {
|
|
mainAxis: rawValue,
|
|
crossAxis: 0,
|
|
alignmentAxis: null
|
|
} : {
|
|
mainAxis: rawValue.mainAxis || 0,
|
|
crossAxis: rawValue.crossAxis || 0,
|
|
alignmentAxis: rawValue.alignmentAxis
|
|
};
|
|
if (alignment && typeof alignmentAxis === 'number') {
|
|
crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;
|
|
}
|
|
return isVertical ? {
|
|
x: crossAxis * crossAxisMulti,
|
|
y: mainAxis * mainAxisMulti
|
|
} : {
|
|
x: mainAxis * mainAxisMulti,
|
|
y: crossAxis * crossAxisMulti
|
|
};
|
|
}
|
|
/**
|
|
* Modifies the placement by translating the floating element along the
|
|
* specified axes.
|
|
* A number (shorthand for `mainAxis` or distance), or an axes configuration
|
|
* object may be passed.
|
|
* @see https://floating-ui.com/docs/offset
|
|
*/ const offset = function(options) {
|
|
if (options === void 0) {
|
|
options = 0;
|
|
}
|
|
return {
|
|
name: 'offset',
|
|
options,
|
|
async fn (state) {
|
|
var _middlewareData$offse, _middlewareData$arrow;
|
|
const { x, y, placement, middlewareData } = state;
|
|
const diffCoords = await convertValueToCoords(state, options);
|
|
// If the placement is the same and the arrow caused an alignment offset
|
|
// then we don't need to change the positioning coordinates.
|
|
if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
|
|
return {};
|
|
}
|
|
return {
|
|
x: x + diffCoords.x,
|
|
y: y + diffCoords.y,
|
|
data: {
|
|
...diffCoords,
|
|
placement
|
|
}
|
|
};
|
|
}
|
|
};
|
|
};
|
|
/**
|
|
* Optimizes the visibility of the floating element by shifting it in order to
|
|
* keep it in view when it will overflow the clipping boundary.
|
|
* @see https://floating-ui.com/docs/shift
|
|
*/ const shift = function(options) {
|
|
if (options === void 0) {
|
|
options = {};
|
|
}
|
|
return {
|
|
name: 'shift',
|
|
options,
|
|
async fn (state) {
|
|
const { x, y, placement } = state;
|
|
const { mainAxis: checkMainAxis = true, crossAxis: checkCrossAxis = false, limiter = {
|
|
fn: (_ref)=>{
|
|
let { x, y } = _ref;
|
|
return {
|
|
x,
|
|
y
|
|
};
|
|
}
|
|
}, ...detectOverflowOptions } = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["evaluate"])(options, state);
|
|
const coords = {
|
|
x,
|
|
y
|
|
};
|
|
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
const crossAxis = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getSideAxis"])((0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getSide"])(placement));
|
|
const mainAxis = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getOppositeAxis"])(crossAxis);
|
|
let mainAxisCoord = coords[mainAxis];
|
|
let crossAxisCoord = coords[crossAxis];
|
|
if (checkMainAxis) {
|
|
const minSide = mainAxis === 'y' ? 'top' : 'left';
|
|
const maxSide = mainAxis === 'y' ? 'bottom' : 'right';
|
|
const min = mainAxisCoord + overflow[minSide];
|
|
const max = mainAxisCoord - overflow[maxSide];
|
|
mainAxisCoord = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["clamp"])(min, mainAxisCoord, max);
|
|
}
|
|
if (checkCrossAxis) {
|
|
const minSide = crossAxis === 'y' ? 'top' : 'left';
|
|
const maxSide = crossAxis === 'y' ? 'bottom' : 'right';
|
|
const min = crossAxisCoord + overflow[minSide];
|
|
const max = crossAxisCoord - overflow[maxSide];
|
|
crossAxisCoord = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["clamp"])(min, crossAxisCoord, max);
|
|
}
|
|
const limitedCoords = limiter.fn({
|
|
...state,
|
|
[mainAxis]: mainAxisCoord,
|
|
[crossAxis]: crossAxisCoord
|
|
});
|
|
return {
|
|
...limitedCoords,
|
|
data: {
|
|
x: limitedCoords.x - x,
|
|
y: limitedCoords.y - y,
|
|
enabled: {
|
|
[mainAxis]: checkMainAxis,
|
|
[crossAxis]: checkCrossAxis
|
|
}
|
|
}
|
|
};
|
|
}
|
|
};
|
|
};
|
|
/**
|
|
* Built-in `limiter` that will stop `shift()` at a certain point.
|
|
*/ const limitShift = function(options) {
|
|
if (options === void 0) {
|
|
options = {};
|
|
}
|
|
return {
|
|
options,
|
|
fn (state) {
|
|
const { x, y, placement, rects, middlewareData } = state;
|
|
const { offset = 0, mainAxis: checkMainAxis = true, crossAxis: checkCrossAxis = true } = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["evaluate"])(options, state);
|
|
const coords = {
|
|
x,
|
|
y
|
|
};
|
|
const crossAxis = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getSideAxis"])(placement);
|
|
const mainAxis = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getOppositeAxis"])(crossAxis);
|
|
let mainAxisCoord = coords[mainAxis];
|
|
let crossAxisCoord = coords[crossAxis];
|
|
const rawOffset = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["evaluate"])(offset, state);
|
|
const computedOffset = typeof rawOffset === 'number' ? {
|
|
mainAxis: rawOffset,
|
|
crossAxis: 0
|
|
} : {
|
|
mainAxis: 0,
|
|
crossAxis: 0,
|
|
...rawOffset
|
|
};
|
|
if (checkMainAxis) {
|
|
const len = mainAxis === 'y' ? 'height' : 'width';
|
|
const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis;
|
|
const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis;
|
|
if (mainAxisCoord < limitMin) {
|
|
mainAxisCoord = limitMin;
|
|
} else if (mainAxisCoord > limitMax) {
|
|
mainAxisCoord = limitMax;
|
|
}
|
|
}
|
|
if (checkCrossAxis) {
|
|
var _middlewareData$offse, _middlewareData$offse2;
|
|
const len = mainAxis === 'y' ? 'width' : 'height';
|
|
const isOriginSide = originSides.has((0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getSide"])(placement));
|
|
const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis);
|
|
const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0);
|
|
if (crossAxisCoord < limitMin) {
|
|
crossAxisCoord = limitMin;
|
|
} else if (crossAxisCoord > limitMax) {
|
|
crossAxisCoord = limitMax;
|
|
}
|
|
}
|
|
return {
|
|
[mainAxis]: mainAxisCoord,
|
|
[crossAxis]: crossAxisCoord
|
|
};
|
|
}
|
|
};
|
|
};
|
|
/**
|
|
* Provides data that allows you to change the size of the floating element —
|
|
* for instance, prevent it from overflowing the clipping boundary or match the
|
|
* width of the reference element.
|
|
* @see https://floating-ui.com/docs/size
|
|
*/ const size = function(options) {
|
|
if (options === void 0) {
|
|
options = {};
|
|
}
|
|
return {
|
|
name: 'size',
|
|
options,
|
|
async fn (state) {
|
|
var _state$middlewareData, _state$middlewareData2;
|
|
const { placement, rects, platform, elements } = state;
|
|
const { apply = ()=>{}, ...detectOverflowOptions } = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["evaluate"])(options, state);
|
|
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
const side = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getSide"])(placement);
|
|
const alignment = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getAlignment"])(placement);
|
|
const isYAxis = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getSideAxis"])(placement) === 'y';
|
|
const { width, height } = rects.floating;
|
|
let heightSide;
|
|
let widthSide;
|
|
if (side === 'top' || side === 'bottom') {
|
|
heightSide = side;
|
|
widthSide = alignment === (await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)) ? 'start' : 'end') ? 'left' : 'right';
|
|
} else {
|
|
widthSide = side;
|
|
heightSide = alignment === 'end' ? 'top' : 'bottom';
|
|
}
|
|
const maximumClippingHeight = height - overflow.top - overflow.bottom;
|
|
const maximumClippingWidth = width - overflow.left - overflow.right;
|
|
const overflowAvailableHeight = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["min"])(height - overflow[heightSide], maximumClippingHeight);
|
|
const overflowAvailableWidth = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["min"])(width - overflow[widthSide], maximumClippingWidth);
|
|
const noShift = !state.middlewareData.shift;
|
|
let availableHeight = overflowAvailableHeight;
|
|
let availableWidth = overflowAvailableWidth;
|
|
if ((_state$middlewareData = state.middlewareData.shift) != null && _state$middlewareData.enabled.x) {
|
|
availableWidth = maximumClippingWidth;
|
|
}
|
|
if ((_state$middlewareData2 = state.middlewareData.shift) != null && _state$middlewareData2.enabled.y) {
|
|
availableHeight = maximumClippingHeight;
|
|
}
|
|
if (noShift && !alignment) {
|
|
const xMin = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["max"])(overflow.left, 0);
|
|
const xMax = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["max"])(overflow.right, 0);
|
|
const yMin = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["max"])(overflow.top, 0);
|
|
const yMax = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["max"])(overflow.bottom, 0);
|
|
if (isYAxis) {
|
|
availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["max"])(overflow.left, overflow.right));
|
|
} else {
|
|
availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["max"])(overflow.top, overflow.bottom));
|
|
}
|
|
}
|
|
await apply({
|
|
...state,
|
|
availableWidth,
|
|
availableHeight
|
|
});
|
|
const nextDimensions = await platform.getDimensions(elements.floating);
|
|
if (width !== nextDimensions.width || height !== nextDimensions.height) {
|
|
return {
|
|
reset: {
|
|
rects: true
|
|
}
|
|
};
|
|
}
|
|
return {};
|
|
}
|
|
};
|
|
};
|
|
;
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/@floating-ui+utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs [app-ssr] (ecmascript)", ((__turbopack_context__) => {
|
|
"use strict";
|
|
|
|
__turbopack_context__.s([
|
|
"getComputedStyle",
|
|
()=>getComputedStyle,
|
|
"getContainingBlock",
|
|
()=>getContainingBlock,
|
|
"getDocumentElement",
|
|
()=>getDocumentElement,
|
|
"getFrameElement",
|
|
()=>getFrameElement,
|
|
"getNearestOverflowAncestor",
|
|
()=>getNearestOverflowAncestor,
|
|
"getNodeName",
|
|
()=>getNodeName,
|
|
"getNodeScroll",
|
|
()=>getNodeScroll,
|
|
"getOverflowAncestors",
|
|
()=>getOverflowAncestors,
|
|
"getParentNode",
|
|
()=>getParentNode,
|
|
"getWindow",
|
|
()=>getWindow,
|
|
"isContainingBlock",
|
|
()=>isContainingBlock,
|
|
"isElement",
|
|
()=>isElement,
|
|
"isHTMLElement",
|
|
()=>isHTMLElement,
|
|
"isLastTraversableNode",
|
|
()=>isLastTraversableNode,
|
|
"isNode",
|
|
()=>isNode,
|
|
"isOverflowElement",
|
|
()=>isOverflowElement,
|
|
"isShadowRoot",
|
|
()=>isShadowRoot,
|
|
"isTableElement",
|
|
()=>isTableElement,
|
|
"isTopLayer",
|
|
()=>isTopLayer,
|
|
"isWebKit",
|
|
()=>isWebKit
|
|
]);
|
|
function hasWindow() {
|
|
return ("TURBOPACK compile-time value", "undefined") !== 'undefined';
|
|
}
|
|
function getNodeName(node) {
|
|
if (isNode(node)) {
|
|
return (node.nodeName || '').toLowerCase();
|
|
}
|
|
// Mocked nodes in testing environments may not be instances of Node. By
|
|
// returning `#document` an infinite loop won't occur.
|
|
// https://github.com/floating-ui/floating-ui/issues/2317
|
|
return '#document';
|
|
}
|
|
function getWindow(node) {
|
|
var _node$ownerDocument;
|
|
return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
|
|
}
|
|
function getDocumentElement(node) {
|
|
var _ref;
|
|
return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
|
|
}
|
|
function isNode(value) {
|
|
if (!hasWindow()) {
|
|
return false;
|
|
}
|
|
//TURBOPACK unreachable
|
|
;
|
|
}
|
|
function isElement(value) {
|
|
if (!hasWindow()) {
|
|
return false;
|
|
}
|
|
//TURBOPACK unreachable
|
|
;
|
|
}
|
|
function isHTMLElement(value) {
|
|
if (!hasWindow()) {
|
|
return false;
|
|
}
|
|
//TURBOPACK unreachable
|
|
;
|
|
}
|
|
function isShadowRoot(value) {
|
|
if (!hasWindow() || typeof ShadowRoot === 'undefined') {
|
|
return false;
|
|
}
|
|
//TURBOPACK unreachable
|
|
;
|
|
}
|
|
const invalidOverflowDisplayValues = /*#__PURE__*/ new Set([
|
|
'inline',
|
|
'contents'
|
|
]);
|
|
function isOverflowElement(element) {
|
|
const { overflow, overflowX, overflowY, display } = getComputedStyle(element);
|
|
return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !invalidOverflowDisplayValues.has(display);
|
|
}
|
|
const tableElements = /*#__PURE__*/ new Set([
|
|
'table',
|
|
'td',
|
|
'th'
|
|
]);
|
|
function isTableElement(element) {
|
|
return tableElements.has(getNodeName(element));
|
|
}
|
|
const topLayerSelectors = [
|
|
':popover-open',
|
|
':modal'
|
|
];
|
|
function isTopLayer(element) {
|
|
return topLayerSelectors.some((selector)=>{
|
|
try {
|
|
return element.matches(selector);
|
|
} catch (_e) {
|
|
return false;
|
|
}
|
|
});
|
|
}
|
|
const transformProperties = [
|
|
'transform',
|
|
'translate',
|
|
'scale',
|
|
'rotate',
|
|
'perspective'
|
|
];
|
|
const willChangeValues = [
|
|
'transform',
|
|
'translate',
|
|
'scale',
|
|
'rotate',
|
|
'perspective',
|
|
'filter'
|
|
];
|
|
const containValues = [
|
|
'paint',
|
|
'layout',
|
|
'strict',
|
|
'content'
|
|
];
|
|
function isContainingBlock(elementOrCss) {
|
|
const webkit = isWebKit();
|
|
const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;
|
|
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
// https://drafts.csswg.org/css-transforms-2/#individual-transforms
|
|
return transformProperties.some((value)=>css[value] ? css[value] !== 'none' : false) || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || willChangeValues.some((value)=>(css.willChange || '').includes(value)) || containValues.some((value)=>(css.contain || '').includes(value));
|
|
}
|
|
function getContainingBlock(element) {
|
|
let currentNode = getParentNode(element);
|
|
while(isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)){
|
|
if (isContainingBlock(currentNode)) {
|
|
return currentNode;
|
|
} else if (isTopLayer(currentNode)) {
|
|
return null;
|
|
}
|
|
currentNode = getParentNode(currentNode);
|
|
}
|
|
return null;
|
|
}
|
|
function isWebKit() {
|
|
if (typeof CSS === 'undefined' || !CSS.supports) return false;
|
|
return CSS.supports('-webkit-backdrop-filter', 'none');
|
|
}
|
|
const lastTraversableNodeNames = /*#__PURE__*/ new Set([
|
|
'html',
|
|
'body',
|
|
'#document'
|
|
]);
|
|
function isLastTraversableNode(node) {
|
|
return lastTraversableNodeNames.has(getNodeName(node));
|
|
}
|
|
function getComputedStyle(element) {
|
|
return getWindow(element).getComputedStyle(element);
|
|
}
|
|
function getNodeScroll(element) {
|
|
if (isElement(element)) {
|
|
return {
|
|
scrollLeft: element.scrollLeft,
|
|
scrollTop: element.scrollTop
|
|
};
|
|
}
|
|
return {
|
|
scrollLeft: element.scrollX,
|
|
scrollTop: element.scrollY
|
|
};
|
|
}
|
|
function getParentNode(node) {
|
|
if (getNodeName(node) === 'html') {
|
|
return node;
|
|
}
|
|
const result = // Step into the shadow DOM of the parent of a slotted node.
|
|
node.assignedSlot || // DOM Element detected.
|
|
node.parentNode || // ShadowRoot detected.
|
|
isShadowRoot(node) && node.host || // Fallback.
|
|
getDocumentElement(node);
|
|
return isShadowRoot(result) ? result.host : result;
|
|
}
|
|
function getNearestOverflowAncestor(node) {
|
|
const parentNode = getParentNode(node);
|
|
if (isLastTraversableNode(parentNode)) {
|
|
return node.ownerDocument ? node.ownerDocument.body : node.body;
|
|
}
|
|
if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
|
|
return parentNode;
|
|
}
|
|
return getNearestOverflowAncestor(parentNode);
|
|
}
|
|
function getOverflowAncestors(node, list, traverseIframes) {
|
|
var _node$ownerDocument2;
|
|
if (list === void 0) {
|
|
list = [];
|
|
}
|
|
if (traverseIframes === void 0) {
|
|
traverseIframes = true;
|
|
}
|
|
const scrollableAncestor = getNearestOverflowAncestor(node);
|
|
const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
|
|
const win = getWindow(scrollableAncestor);
|
|
if (isBody) {
|
|
const frameElement = getFrameElement(win);
|
|
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
|
|
}
|
|
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
|
|
}
|
|
function getFrameElement(win) {
|
|
return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
|
|
}
|
|
;
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/@floating-ui+dom@1.7.4/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs [app-ssr] (ecmascript) <locals>", ((__turbopack_context__) => {
|
|
"use strict";
|
|
|
|
__turbopack_context__.s([
|
|
"arrow",
|
|
()=>arrow,
|
|
"autoPlacement",
|
|
()=>autoPlacement,
|
|
"autoUpdate",
|
|
()=>autoUpdate,
|
|
"computePosition",
|
|
()=>computePosition,
|
|
"detectOverflow",
|
|
()=>detectOverflow,
|
|
"flip",
|
|
()=>flip,
|
|
"hide",
|
|
()=>hide,
|
|
"inline",
|
|
()=>inline,
|
|
"limitShift",
|
|
()=>limitShift,
|
|
"offset",
|
|
()=>offset,
|
|
"platform",
|
|
()=>platform,
|
|
"shift",
|
|
()=>shift,
|
|
"size",
|
|
()=>size
|
|
]);
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/@floating-ui+utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.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$floating$2d$ui$2b$core$40$1$2e$7$2e$3$2f$node_modules$2f40$floating$2d$ui$2f$core$2f$dist$2f$floating$2d$ui$2e$core$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__$3c$locals$3e$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/@floating-ui+core@1.7.3/node_modules/@floating-ui/core/dist/floating-ui.core.mjs [app-ssr] (ecmascript) <locals>");
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/@floating-ui+utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs [app-ssr] (ecmascript)");
|
|
;
|
|
;
|
|
;
|
|
;
|
|
function getCssDimensions(element) {
|
|
const css = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getComputedStyle"])(element);
|
|
// In testing environments, the `width` and `height` properties are empty
|
|
// strings for SVG elements, returning NaN. Fallback to `0` in this case.
|
|
let width = parseFloat(css.width) || 0;
|
|
let height = parseFloat(css.height) || 0;
|
|
const hasOffset = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["isHTMLElement"])(element);
|
|
const offsetWidth = hasOffset ? element.offsetWidth : width;
|
|
const offsetHeight = hasOffset ? element.offsetHeight : height;
|
|
const shouldFallback = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["round"])(width) !== offsetWidth || (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["round"])(height) !== offsetHeight;
|
|
if (shouldFallback) {
|
|
width = offsetWidth;
|
|
height = offsetHeight;
|
|
}
|
|
return {
|
|
width,
|
|
height,
|
|
$: shouldFallback
|
|
};
|
|
}
|
|
function unwrapElement(element) {
|
|
return !(0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["isElement"])(element) ? element.contextElement : element;
|
|
}
|
|
function getScale(element) {
|
|
const domElement = unwrapElement(element);
|
|
if (!(0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["isHTMLElement"])(domElement)) {
|
|
return (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["createCoords"])(1);
|
|
}
|
|
const rect = domElement.getBoundingClientRect();
|
|
const { width, height, $ } = getCssDimensions(domElement);
|
|
let x = ($ ? (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["round"])(rect.width) : rect.width) / width;
|
|
let y = ($ ? (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["round"])(rect.height) : rect.height) / height;
|
|
// 0, NaN, or Infinity should always fallback to 1.
|
|
if (!x || !Number.isFinite(x)) {
|
|
x = 1;
|
|
}
|
|
if (!y || !Number.isFinite(y)) {
|
|
y = 1;
|
|
}
|
|
return {
|
|
x,
|
|
y
|
|
};
|
|
}
|
|
const noOffsets = /*#__PURE__*/ (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["createCoords"])(0);
|
|
function getVisualOffsets(element) {
|
|
const win = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getWindow"])(element);
|
|
if (!(0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["isWebKit"])() || !win.visualViewport) {
|
|
return noOffsets;
|
|
}
|
|
return {
|
|
x: win.visualViewport.offsetLeft,
|
|
y: win.visualViewport.offsetTop
|
|
};
|
|
}
|
|
function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
|
|
if (isFixed === void 0) {
|
|
isFixed = false;
|
|
}
|
|
if (!floatingOffsetParent || isFixed && floatingOffsetParent !== (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getWindow"])(element)) {
|
|
return false;
|
|
}
|
|
return isFixed;
|
|
}
|
|
function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
|
|
if (includeScale === void 0) {
|
|
includeScale = false;
|
|
}
|
|
if (isFixedStrategy === void 0) {
|
|
isFixedStrategy = false;
|
|
}
|
|
const clientRect = element.getBoundingClientRect();
|
|
const domElement = unwrapElement(element);
|
|
let scale = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["createCoords"])(1);
|
|
if (includeScale) {
|
|
if (offsetParent) {
|
|
if ((0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["isElement"])(offsetParent)) {
|
|
scale = getScale(offsetParent);
|
|
}
|
|
} else {
|
|
scale = getScale(element);
|
|
}
|
|
}
|
|
const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["createCoords"])(0);
|
|
let x = (clientRect.left + visualOffsets.x) / scale.x;
|
|
let y = (clientRect.top + visualOffsets.y) / scale.y;
|
|
let width = clientRect.width / scale.x;
|
|
let height = clientRect.height / scale.y;
|
|
if (domElement) {
|
|
const win = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getWindow"])(domElement);
|
|
const offsetWin = offsetParent && (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["isElement"])(offsetParent) ? (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getWindow"])(offsetParent) : offsetParent;
|
|
let currentWin = win;
|
|
let currentIFrame = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getFrameElement"])(currentWin);
|
|
while(currentIFrame && offsetParent && offsetWin !== currentWin){
|
|
const iframeScale = getScale(currentIFrame);
|
|
const iframeRect = currentIFrame.getBoundingClientRect();
|
|
const css = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getComputedStyle"])(currentIFrame);
|
|
const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
|
|
const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
|
|
x *= iframeScale.x;
|
|
y *= iframeScale.y;
|
|
width *= iframeScale.x;
|
|
height *= iframeScale.y;
|
|
x += left;
|
|
y += top;
|
|
currentWin = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getWindow"])(currentIFrame);
|
|
currentIFrame = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getFrameElement"])(currentWin);
|
|
}
|
|
}
|
|
return (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["rectToClientRect"])({
|
|
width,
|
|
height,
|
|
x,
|
|
y
|
|
});
|
|
}
|
|
// If <html> has a CSS width greater than the viewport, then this will be
|
|
// incorrect for RTL.
|
|
function getWindowScrollBarX(element, rect) {
|
|
const leftScroll = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getNodeScroll"])(element).scrollLeft;
|
|
if (!rect) {
|
|
return getBoundingClientRect((0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getDocumentElement"])(element)).left + leftScroll;
|
|
}
|
|
return rect.left + leftScroll;
|
|
}
|
|
function getHTMLOffset(documentElement, scroll) {
|
|
const htmlRect = documentElement.getBoundingClientRect();
|
|
const x = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect);
|
|
const y = htmlRect.top + scroll.scrollTop;
|
|
return {
|
|
x,
|
|
y
|
|
};
|
|
}
|
|
function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
let { elements, rect, offsetParent, strategy } = _ref;
|
|
const isFixed = strategy === 'fixed';
|
|
const documentElement = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getDocumentElement"])(offsetParent);
|
|
const topLayer = elements ? (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["isTopLayer"])(elements.floating) : false;
|
|
if (offsetParent === documentElement || topLayer && isFixed) {
|
|
return rect;
|
|
}
|
|
let scroll = {
|
|
scrollLeft: 0,
|
|
scrollTop: 0
|
|
};
|
|
let scale = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["createCoords"])(1);
|
|
const offsets = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["createCoords"])(0);
|
|
const isOffsetParentAnElement = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["isHTMLElement"])(offsetParent);
|
|
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
if ((0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getNodeName"])(offsetParent) !== 'body' || (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["isOverflowElement"])(documentElement)) {
|
|
scroll = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getNodeScroll"])(offsetParent);
|
|
}
|
|
if ((0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["isHTMLElement"])(offsetParent)) {
|
|
const offsetRect = getBoundingClientRect(offsetParent);
|
|
scale = getScale(offsetParent);
|
|
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
}
|
|
}
|
|
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["createCoords"])(0);
|
|
return {
|
|
width: rect.width * scale.x,
|
|
height: rect.height * scale.y,
|
|
x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,
|
|
y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y
|
|
};
|
|
}
|
|
function getClientRects(element) {
|
|
return Array.from(element.getClientRects());
|
|
}
|
|
// Gets the entire size of the scrollable document area, even extending outside
|
|
// of the `<html>` and `<body>` rect bounds if horizontally scrollable.
|
|
function getDocumentRect(element) {
|
|
const html = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getDocumentElement"])(element);
|
|
const scroll = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getNodeScroll"])(element);
|
|
const body = element.ownerDocument.body;
|
|
const width = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["max"])(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
|
|
const height = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["max"])(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
|
|
let x = -scroll.scrollLeft + getWindowScrollBarX(element);
|
|
const y = -scroll.scrollTop;
|
|
if ((0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getComputedStyle"])(body).direction === 'rtl') {
|
|
x += (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["max"])(html.clientWidth, body.clientWidth) - width;
|
|
}
|
|
return {
|
|
width,
|
|
height,
|
|
x,
|
|
y
|
|
};
|
|
}
|
|
// Safety check: ensure the scrollbar space is reasonable in case this
|
|
// calculation is affected by unusual styles.
|
|
// Most scrollbars leave 15-18px of space.
|
|
const SCROLLBAR_MAX = 25;
|
|
function getViewportRect(element, strategy) {
|
|
const win = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getWindow"])(element);
|
|
const html = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getDocumentElement"])(element);
|
|
const visualViewport = win.visualViewport;
|
|
let width = html.clientWidth;
|
|
let height = html.clientHeight;
|
|
let x = 0;
|
|
let y = 0;
|
|
if (visualViewport) {
|
|
width = visualViewport.width;
|
|
height = visualViewport.height;
|
|
const visualViewportBased = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["isWebKit"])();
|
|
if (!visualViewportBased || visualViewportBased && strategy === 'fixed') {
|
|
x = visualViewport.offsetLeft;
|
|
y = visualViewport.offsetTop;
|
|
}
|
|
}
|
|
const windowScrollbarX = getWindowScrollBarX(html);
|
|
// <html> `overflow: hidden` + `scrollbar-gutter: stable` reduces the
|
|
// visual width of the <html> but this is not considered in the size
|
|
// of `html.clientWidth`.
|
|
if (windowScrollbarX <= 0) {
|
|
const doc = html.ownerDocument;
|
|
const body = doc.body;
|
|
const bodyStyles = getComputedStyle(body);
|
|
const bodyMarginInline = doc.compatMode === 'CSS1Compat' ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0;
|
|
const clippingStableScrollbarWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline);
|
|
if (clippingStableScrollbarWidth <= SCROLLBAR_MAX) {
|
|
width -= clippingStableScrollbarWidth;
|
|
}
|
|
} else if (windowScrollbarX <= SCROLLBAR_MAX) {
|
|
// If the <body> scrollbar is on the left, the width needs to be extended
|
|
// by the scrollbar amount so there isn't extra space on the right.
|
|
width += windowScrollbarX;
|
|
}
|
|
return {
|
|
width,
|
|
height,
|
|
x,
|
|
y
|
|
};
|
|
}
|
|
const absoluteOrFixed = /*#__PURE__*/ new Set([
|
|
'absolute',
|
|
'fixed'
|
|
]);
|
|
// Returns the inner client rect, subtracting scrollbars if present.
|
|
function getInnerBoundingClientRect(element, strategy) {
|
|
const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');
|
|
const top = clientRect.top + element.clientTop;
|
|
const left = clientRect.left + element.clientLeft;
|
|
const scale = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["isHTMLElement"])(element) ? getScale(element) : (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["createCoords"])(1);
|
|
const width = element.clientWidth * scale.x;
|
|
const height = element.clientHeight * scale.y;
|
|
const x = left * scale.x;
|
|
const y = top * scale.y;
|
|
return {
|
|
width,
|
|
height,
|
|
x,
|
|
y
|
|
};
|
|
}
|
|
function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
|
|
let rect;
|
|
if (clippingAncestor === 'viewport') {
|
|
rect = getViewportRect(element, strategy);
|
|
} else if (clippingAncestor === 'document') {
|
|
rect = getDocumentRect((0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getDocumentElement"])(element));
|
|
} else if ((0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["isElement"])(clippingAncestor)) {
|
|
rect = getInnerBoundingClientRect(clippingAncestor, strategy);
|
|
} else {
|
|
const visualOffsets = getVisualOffsets(element);
|
|
rect = {
|
|
x: clippingAncestor.x - visualOffsets.x,
|
|
y: clippingAncestor.y - visualOffsets.y,
|
|
width: clippingAncestor.width,
|
|
height: clippingAncestor.height
|
|
};
|
|
}
|
|
return (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["rectToClientRect"])(rect);
|
|
}
|
|
function hasFixedPositionAncestor(element, stopNode) {
|
|
const parentNode = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getParentNode"])(element);
|
|
if (parentNode === stopNode || !(0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["isElement"])(parentNode) || (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["isLastTraversableNode"])(parentNode)) {
|
|
return false;
|
|
}
|
|
return (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getComputedStyle"])(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);
|
|
}
|
|
// A "clipping ancestor" is an `overflow` element with the characteristic of
|
|
// clipping (or hiding) child elements. This returns all clipping ancestors
|
|
// of the given element up the tree.
|
|
function getClippingElementAncestors(element, cache) {
|
|
const cachedResult = cache.get(element);
|
|
if (cachedResult) {
|
|
return cachedResult;
|
|
}
|
|
let result = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getOverflowAncestors"])(element, [], false).filter((el)=>(0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["isElement"])(el) && (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getNodeName"])(el) !== 'body');
|
|
let currentContainingBlockComputedStyle = null;
|
|
const elementIsFixed = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getComputedStyle"])(element).position === 'fixed';
|
|
let currentNode = elementIsFixed ? (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getParentNode"])(element) : element;
|
|
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
while((0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["isElement"])(currentNode) && !(0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["isLastTraversableNode"])(currentNode)){
|
|
const computedStyle = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getComputedStyle"])(currentNode);
|
|
const currentNodeIsContaining = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["isContainingBlock"])(currentNode);
|
|
if (!currentNodeIsContaining && computedStyle.position === 'fixed') {
|
|
currentContainingBlockComputedStyle = null;
|
|
}
|
|
const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && absoluteOrFixed.has(currentContainingBlockComputedStyle.position) || (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["isOverflowElement"])(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
|
|
if (shouldDropCurrentNode) {
|
|
// Drop non-containing blocks.
|
|
result = result.filter((ancestor)=>ancestor !== currentNode);
|
|
} else {
|
|
// Record last containing block for next iteration.
|
|
currentContainingBlockComputedStyle = computedStyle;
|
|
}
|
|
currentNode = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getParentNode"])(currentNode);
|
|
}
|
|
cache.set(element, result);
|
|
return result;
|
|
}
|
|
// Gets the maximum area that the element is visible in due to any number of
|
|
// clipping ancestors.
|
|
function getClippingRect(_ref) {
|
|
let { element, boundary, rootBoundary, strategy } = _ref;
|
|
const elementClippingAncestors = boundary === 'clippingAncestors' ? (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["isTopLayer"])(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);
|
|
const clippingAncestors = [
|
|
...elementClippingAncestors,
|
|
rootBoundary
|
|
];
|
|
const firstClippingAncestor = clippingAncestors[0];
|
|
const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor)=>{
|
|
const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
|
|
accRect.top = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["max"])(rect.top, accRect.top);
|
|
accRect.right = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["min"])(rect.right, accRect.right);
|
|
accRect.bottom = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["min"])(rect.bottom, accRect.bottom);
|
|
accRect.left = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["max"])(rect.left, accRect.left);
|
|
return accRect;
|
|
}, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
|
|
return {
|
|
width: clippingRect.right - clippingRect.left,
|
|
height: clippingRect.bottom - clippingRect.top,
|
|
x: clippingRect.left,
|
|
y: clippingRect.top
|
|
};
|
|
}
|
|
function getDimensions(element) {
|
|
const { width, height } = getCssDimensions(element);
|
|
return {
|
|
width,
|
|
height
|
|
};
|
|
}
|
|
function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
const isOffsetParentAnElement = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["isHTMLElement"])(offsetParent);
|
|
const documentElement = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getDocumentElement"])(offsetParent);
|
|
const isFixed = strategy === 'fixed';
|
|
const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
|
|
let scroll = {
|
|
scrollLeft: 0,
|
|
scrollTop: 0
|
|
};
|
|
const offsets = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["createCoords"])(0);
|
|
// If the <body> scrollbar appears on the left (e.g. RTL systems). Use
|
|
// Firefox with layout.scrollbar.side = 3 in about:config to test this.
|
|
function setLeftRTLScrollbarOffset() {
|
|
offsets.x = getWindowScrollBarX(documentElement);
|
|
}
|
|
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
if ((0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getNodeName"])(offsetParent) !== 'body' || (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["isOverflowElement"])(documentElement)) {
|
|
scroll = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getNodeScroll"])(offsetParent);
|
|
}
|
|
if (isOffsetParentAnElement) {
|
|
const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
|
|
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
} else if (documentElement) {
|
|
setLeftRTLScrollbarOffset();
|
|
}
|
|
}
|
|
if (isFixed && !isOffsetParentAnElement && documentElement) {
|
|
setLeftRTLScrollbarOffset();
|
|
}
|
|
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["createCoords"])(0);
|
|
const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;
|
|
const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;
|
|
return {
|
|
x,
|
|
y,
|
|
width: rect.width,
|
|
height: rect.height
|
|
};
|
|
}
|
|
function isStaticPositioned(element) {
|
|
return (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getComputedStyle"])(element).position === 'static';
|
|
}
|
|
function getTrueOffsetParent(element, polyfill) {
|
|
if (!(0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["isHTMLElement"])(element) || (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getComputedStyle"])(element).position === 'fixed') {
|
|
return null;
|
|
}
|
|
if (polyfill) {
|
|
return polyfill(element);
|
|
}
|
|
let rawOffsetParent = element.offsetParent;
|
|
// Firefox returns the <html> element as the offsetParent if it's non-static,
|
|
// while Chrome and Safari return the <body> element. The <body> element must
|
|
// be used to perform the correct calculations even if the <html> element is
|
|
// non-static.
|
|
if ((0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getDocumentElement"])(element) === rawOffsetParent) {
|
|
rawOffsetParent = rawOffsetParent.ownerDocument.body;
|
|
}
|
|
return rawOffsetParent;
|
|
}
|
|
// Gets the closest ancestor positioned element. Handles some edge cases,
|
|
// such as table ancestors and cross browser bugs.
|
|
function getOffsetParent(element, polyfill) {
|
|
const win = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getWindow"])(element);
|
|
if ((0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["isTopLayer"])(element)) {
|
|
return win;
|
|
}
|
|
if (!(0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["isHTMLElement"])(element)) {
|
|
let svgOffsetParent = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getParentNode"])(element);
|
|
while(svgOffsetParent && !(0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["isLastTraversableNode"])(svgOffsetParent)){
|
|
if ((0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["isElement"])(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {
|
|
return svgOffsetParent;
|
|
}
|
|
svgOffsetParent = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getParentNode"])(svgOffsetParent);
|
|
}
|
|
return win;
|
|
}
|
|
let offsetParent = getTrueOffsetParent(element, polyfill);
|
|
while(offsetParent && (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["isTableElement"])(offsetParent) && isStaticPositioned(offsetParent)){
|
|
offsetParent = getTrueOffsetParent(offsetParent, polyfill);
|
|
}
|
|
if (offsetParent && (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["isLastTraversableNode"])(offsetParent) && isStaticPositioned(offsetParent) && !(0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["isContainingBlock"])(offsetParent)) {
|
|
return win;
|
|
}
|
|
return offsetParent || (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getContainingBlock"])(element) || win;
|
|
}
|
|
const getElementRects = async function(data) {
|
|
const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
|
|
const getDimensionsFn = this.getDimensions;
|
|
const floatingDimensions = await getDimensionsFn(data.floating);
|
|
return {
|
|
reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),
|
|
floating: {
|
|
x: 0,
|
|
y: 0,
|
|
width: floatingDimensions.width,
|
|
height: floatingDimensions.height
|
|
}
|
|
};
|
|
};
|
|
function isRTL(element) {
|
|
return (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getComputedStyle"])(element).direction === 'rtl';
|
|
}
|
|
const platform = {
|
|
convertOffsetParentRelativeRectToViewportRelativeRect,
|
|
getDocumentElement: __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getDocumentElement"],
|
|
getClippingRect,
|
|
getOffsetParent,
|
|
getElementRects,
|
|
getClientRects,
|
|
getDimensions,
|
|
getScale,
|
|
isElement: __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["isElement"],
|
|
isRTL
|
|
};
|
|
function rectsAreEqual(a, b) {
|
|
return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;
|
|
}
|
|
// https://samthor.au/2021/observing-dom/
|
|
function observeMove(element, onMove) {
|
|
let io = null;
|
|
let timeoutId;
|
|
const root = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getDocumentElement"])(element);
|
|
function cleanup() {
|
|
var _io;
|
|
clearTimeout(timeoutId);
|
|
(_io = io) == null || _io.disconnect();
|
|
io = null;
|
|
}
|
|
function refresh(skip, threshold) {
|
|
if (skip === void 0) {
|
|
skip = false;
|
|
}
|
|
if (threshold === void 0) {
|
|
threshold = 1;
|
|
}
|
|
cleanup();
|
|
const elementRectForRootMargin = element.getBoundingClientRect();
|
|
const { left, top, width, height } = elementRectForRootMargin;
|
|
if (!skip) {
|
|
onMove();
|
|
}
|
|
if (!width || !height) {
|
|
return;
|
|
}
|
|
const insetTop = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["floor"])(top);
|
|
const insetRight = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["floor"])(root.clientWidth - (left + width));
|
|
const insetBottom = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["floor"])(root.clientHeight - (top + height));
|
|
const insetLeft = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["floor"])(left);
|
|
const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px";
|
|
const options = {
|
|
rootMargin,
|
|
threshold: (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["max"])(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$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["min"])(1, threshold)) || 1
|
|
};
|
|
let isFirstUpdate = true;
|
|
function handleObserve(entries) {
|
|
const ratio = entries[0].intersectionRatio;
|
|
if (ratio !== threshold) {
|
|
if (!isFirstUpdate) {
|
|
return refresh();
|
|
}
|
|
if (!ratio) {
|
|
// If the reference is clipped, the ratio is 0. Throttle the refresh
|
|
// to prevent an infinite loop of updates.
|
|
timeoutId = setTimeout(()=>{
|
|
refresh(false, 1e-7);
|
|
}, 1000);
|
|
} else {
|
|
refresh(false, ratio);
|
|
}
|
|
}
|
|
if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {
|
|
// It's possible that even though the ratio is reported as 1, the
|
|
// element is not actually fully within the IntersectionObserver's root
|
|
// area anymore. This can happen under performance constraints. This may
|
|
// be a bug in the browser's IntersectionObserver implementation. To
|
|
// work around this, we compare the element's bounding rect now with
|
|
// what it was at the time we created the IntersectionObserver. If they
|
|
// are not equal then the element moved, so we refresh.
|
|
refresh();
|
|
}
|
|
isFirstUpdate = false;
|
|
}
|
|
// Older browsers don't support a `document` as the root and will throw an
|
|
// error.
|
|
try {
|
|
io = new IntersectionObserver(handleObserve, {
|
|
...options,
|
|
// Handle <iframe>s
|
|
root: root.ownerDocument
|
|
});
|
|
} catch (_e) {
|
|
io = new IntersectionObserver(handleObserve, options);
|
|
}
|
|
io.observe(element);
|
|
}
|
|
refresh(true);
|
|
return cleanup;
|
|
}
|
|
/**
|
|
* Automatically updates the position of the floating element when necessary.
|
|
* Should only be called when the floating element is mounted on the DOM or
|
|
* visible on the screen.
|
|
* @returns cleanup function that should be invoked when the floating element is
|
|
* removed from the DOM or hidden from the screen.
|
|
* @see https://floating-ui.com/docs/autoUpdate
|
|
*/ function autoUpdate(reference, floating, update, options) {
|
|
if (options === void 0) {
|
|
options = {};
|
|
}
|
|
const { ancestorScroll = true, ancestorResize = true, elementResize = typeof ResizeObserver === 'function', layoutShift = typeof IntersectionObserver === 'function', animationFrame = false } = options;
|
|
const referenceEl = unwrapElement(reference);
|
|
const ancestors = ancestorScroll || ancestorResize ? [
|
|
...referenceEl ? (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getOverflowAncestors"])(referenceEl) : [],
|
|
...(0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$utils$40$0$2e$2$2e$10$2f$node_modules$2f40$floating$2d$ui$2f$utils$2f$dist$2f$floating$2d$ui$2e$utils$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["getOverflowAncestors"])(floating)
|
|
] : [];
|
|
ancestors.forEach((ancestor)=>{
|
|
ancestorScroll && ancestor.addEventListener('scroll', update, {
|
|
passive: true
|
|
});
|
|
ancestorResize && ancestor.addEventListener('resize', update);
|
|
});
|
|
const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;
|
|
let reobserveFrame = -1;
|
|
let resizeObserver = null;
|
|
if (elementResize) {
|
|
resizeObserver = new ResizeObserver((_ref)=>{
|
|
let [firstEntry] = _ref;
|
|
if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {
|
|
// Prevent update loops when using the `size` middleware.
|
|
// https://github.com/floating-ui/floating-ui/issues/1740
|
|
resizeObserver.unobserve(floating);
|
|
cancelAnimationFrame(reobserveFrame);
|
|
reobserveFrame = requestAnimationFrame(()=>{
|
|
var _resizeObserver;
|
|
(_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);
|
|
});
|
|
}
|
|
update();
|
|
});
|
|
if (referenceEl && !animationFrame) {
|
|
resizeObserver.observe(referenceEl);
|
|
}
|
|
resizeObserver.observe(floating);
|
|
}
|
|
let frameId;
|
|
let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
|
|
if (animationFrame) {
|
|
frameLoop();
|
|
}
|
|
function frameLoop() {
|
|
const nextRefRect = getBoundingClientRect(reference);
|
|
if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) {
|
|
update();
|
|
}
|
|
prevRefRect = nextRefRect;
|
|
frameId = requestAnimationFrame(frameLoop);
|
|
}
|
|
update();
|
|
return ()=>{
|
|
var _resizeObserver2;
|
|
ancestors.forEach((ancestor)=>{
|
|
ancestorScroll && ancestor.removeEventListener('scroll', update);
|
|
ancestorResize && ancestor.removeEventListener('resize', update);
|
|
});
|
|
cleanupIo == null || cleanupIo();
|
|
(_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();
|
|
resizeObserver = null;
|
|
if (animationFrame) {
|
|
cancelAnimationFrame(frameId);
|
|
}
|
|
};
|
|
}
|
|
/**
|
|
* Resolves with an object of overflow side offsets that determine how much the
|
|
* element is overflowing a given clipping boundary on each side.
|
|
* - positive = overflowing the boundary by that number of pixels
|
|
* - negative = how many pixels left before it will overflow
|
|
* - 0 = lies flush with the boundary
|
|
* @see https://floating-ui.com/docs/detectOverflow
|
|
*/ const detectOverflow = __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$core$40$1$2e$7$2e$3$2f$node_modules$2f40$floating$2d$ui$2f$core$2f$dist$2f$floating$2d$ui$2e$core$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__$3c$locals$3e$__["detectOverflow"];
|
|
/**
|
|
* Modifies the placement by translating the floating element along the
|
|
* specified axes.
|
|
* A number (shorthand for `mainAxis` or distance), or an axes configuration
|
|
* object may be passed.
|
|
* @see https://floating-ui.com/docs/offset
|
|
*/ const offset = __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$core$40$1$2e$7$2e$3$2f$node_modules$2f40$floating$2d$ui$2f$core$2f$dist$2f$floating$2d$ui$2e$core$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__$3c$locals$3e$__["offset"];
|
|
/**
|
|
* Optimizes the visibility of the floating element by choosing the placement
|
|
* that has the most space available automatically, without needing to specify a
|
|
* preferred placement. Alternative to `flip`.
|
|
* @see https://floating-ui.com/docs/autoPlacement
|
|
*/ const autoPlacement = __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$core$40$1$2e$7$2e$3$2f$node_modules$2f40$floating$2d$ui$2f$core$2f$dist$2f$floating$2d$ui$2e$core$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__$3c$locals$3e$__["autoPlacement"];
|
|
/**
|
|
* Optimizes the visibility of the floating element by shifting it in order to
|
|
* keep it in view when it will overflow the clipping boundary.
|
|
* @see https://floating-ui.com/docs/shift
|
|
*/ const shift = __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$core$40$1$2e$7$2e$3$2f$node_modules$2f40$floating$2d$ui$2f$core$2f$dist$2f$floating$2d$ui$2e$core$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__$3c$locals$3e$__["shift"];
|
|
/**
|
|
* Optimizes the visibility of the floating element by flipping the `placement`
|
|
* in order to keep it in view when the preferred placement(s) will overflow the
|
|
* clipping boundary. Alternative to `autoPlacement`.
|
|
* @see https://floating-ui.com/docs/flip
|
|
*/ const flip = __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$core$40$1$2e$7$2e$3$2f$node_modules$2f40$floating$2d$ui$2f$core$2f$dist$2f$floating$2d$ui$2e$core$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__$3c$locals$3e$__["flip"];
|
|
/**
|
|
* Provides data that allows you to change the size of the floating element —
|
|
* for instance, prevent it from overflowing the clipping boundary or match the
|
|
* width of the reference element.
|
|
* @see https://floating-ui.com/docs/size
|
|
*/ const size = __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$core$40$1$2e$7$2e$3$2f$node_modules$2f40$floating$2d$ui$2f$core$2f$dist$2f$floating$2d$ui$2e$core$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__$3c$locals$3e$__["size"];
|
|
/**
|
|
* Provides data to hide the floating element in applicable situations, such as
|
|
* when it is not in the same clipping context as the reference element.
|
|
* @see https://floating-ui.com/docs/hide
|
|
*/ const hide = __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$core$40$1$2e$7$2e$3$2f$node_modules$2f40$floating$2d$ui$2f$core$2f$dist$2f$floating$2d$ui$2e$core$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__$3c$locals$3e$__["hide"];
|
|
/**
|
|
* Provides data to position an inner element of the floating element so that it
|
|
* appears centered to the reference element.
|
|
* @see https://floating-ui.com/docs/arrow
|
|
*/ const arrow = __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$core$40$1$2e$7$2e$3$2f$node_modules$2f40$floating$2d$ui$2f$core$2f$dist$2f$floating$2d$ui$2e$core$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__$3c$locals$3e$__["arrow"];
|
|
/**
|
|
* Provides improved positioning for inline reference elements that can span
|
|
* over multiple lines, such as hyperlinks or range selections.
|
|
* @see https://floating-ui.com/docs/inline
|
|
*/ const inline = __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$core$40$1$2e$7$2e$3$2f$node_modules$2f40$floating$2d$ui$2f$core$2f$dist$2f$floating$2d$ui$2e$core$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__$3c$locals$3e$__["inline"];
|
|
/**
|
|
* Built-in `limiter` that will stop `shift()` at a certain point.
|
|
*/ const limitShift = __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$core$40$1$2e$7$2e$3$2f$node_modules$2f40$floating$2d$ui$2f$core$2f$dist$2f$floating$2d$ui$2e$core$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__$3c$locals$3e$__["limitShift"];
|
|
/**
|
|
* Computes the `x` and `y` coordinates that will place the floating element
|
|
* next to a given reference element.
|
|
*/ const computePosition = (reference, floating, options)=>{
|
|
// This caches the expensive `getClippingElementAncestors` function so that
|
|
// multiple lifecycle resets re-use the same result. It only lives for a
|
|
// single call. If other functions become expensive, we can add them as well.
|
|
const cache = new Map();
|
|
const mergedOptions = {
|
|
platform,
|
|
...options
|
|
};
|
|
const platformWithCache = {
|
|
...mergedOptions.platform,
|
|
_c: cache
|
|
};
|
|
return (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$core$40$1$2e$7$2e$3$2f$node_modules$2f40$floating$2d$ui$2f$core$2f$dist$2f$floating$2d$ui$2e$core$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__$3c$locals$3e$__["computePosition"])(reference, floating, {
|
|
...mergedOptions,
|
|
platform: platformWithCache
|
|
});
|
|
};
|
|
;
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/@floating-ui+react-dom@2.1.6_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs [app-ssr] (ecmascript) <locals>", ((__turbopack_context__) => {
|
|
"use strict";
|
|
|
|
__turbopack_context__.s([
|
|
"arrow",
|
|
()=>arrow,
|
|
"autoPlacement",
|
|
()=>autoPlacement,
|
|
"flip",
|
|
()=>flip,
|
|
"hide",
|
|
()=>hide,
|
|
"inline",
|
|
()=>inline,
|
|
"limitShift",
|
|
()=>limitShift,
|
|
"offset",
|
|
()=>offset,
|
|
"shift",
|
|
()=>shift,
|
|
"size",
|
|
()=>size,
|
|
"useFloating",
|
|
()=>useFloating
|
|
]);
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$dom$40$1$2e$7$2e$4$2f$node_modules$2f40$floating$2d$ui$2f$dom$2f$dist$2f$floating$2d$ui$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__$3c$locals$3e$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/@floating-ui+dom@1.7.4/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs [app-ssr] (ecmascript) <locals>");
|
|
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 isClient = typeof document !== 'undefined';
|
|
var noop = function noop() {};
|
|
var index = isClient ? __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"] : noop;
|
|
// Fork of `fast-deep-equal` that only does the comparisons we need and compares
|
|
// functions
|
|
function deepEqual(a, b) {
|
|
if (a === b) {
|
|
return true;
|
|
}
|
|
if (typeof a !== typeof b) {
|
|
return false;
|
|
}
|
|
if (typeof a === 'function' && a.toString() === b.toString()) {
|
|
return true;
|
|
}
|
|
let length;
|
|
let i;
|
|
let keys;
|
|
if (a && b && typeof a === 'object') {
|
|
if (Array.isArray(a)) {
|
|
length = a.length;
|
|
if (length !== b.length) return false;
|
|
for(i = length; i-- !== 0;){
|
|
if (!deepEqual(a[i], b[i])) {
|
|
return false;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
keys = Object.keys(a);
|
|
length = keys.length;
|
|
if (length !== Object.keys(b).length) {
|
|
return false;
|
|
}
|
|
for(i = length; i-- !== 0;){
|
|
if (!({}).hasOwnProperty.call(b, keys[i])) {
|
|
return false;
|
|
}
|
|
}
|
|
for(i = length; i-- !== 0;){
|
|
const key = keys[i];
|
|
if (key === '_owner' && a.$$typeof) {
|
|
continue;
|
|
}
|
|
if (!deepEqual(a[key], b[key])) {
|
|
return false;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
return a !== a && b !== b;
|
|
}
|
|
function getDPR(element) {
|
|
if ("TURBOPACK compile-time truthy", 1) {
|
|
return 1;
|
|
}
|
|
//TURBOPACK unreachable
|
|
;
|
|
const win = undefined;
|
|
}
|
|
function roundByDPR(element, value) {
|
|
const dpr = getDPR(element);
|
|
return Math.round(value * dpr) / dpr;
|
|
}
|
|
function useLatestRef(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);
|
|
index(()=>{
|
|
ref.current = value;
|
|
});
|
|
return ref;
|
|
}
|
|
/**
|
|
* Provides data to position a floating element.
|
|
* @see https://floating-ui.com/docs/useFloating
|
|
*/ function useFloating(options) {
|
|
if (options === void 0) {
|
|
options = {};
|
|
}
|
|
const { placement = 'bottom', strategy = 'absolute', middleware = [], platform, elements: { reference: externalReference, floating: externalFloating } = {}, transform = true, whileElementsMounted, open } = options;
|
|
const [data, setData] = __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"]({
|
|
x: 0,
|
|
y: 0,
|
|
strategy,
|
|
placement,
|
|
middlewareData: {},
|
|
isPositioned: false
|
|
});
|
|
const [latestMiddleware, setLatestMiddleware] = __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"](middleware);
|
|
if (!deepEqual(latestMiddleware, middleware)) {
|
|
setLatestMiddleware(middleware);
|
|
}
|
|
const [_reference, _setReference] = __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 [_floating, _setFloating] = __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 setReference = __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"]((node)=>{
|
|
if (node !== referenceRef.current) {
|
|
referenceRef.current = node;
|
|
_setReference(node);
|
|
}
|
|
}, []);
|
|
const setFloating = __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"]((node)=>{
|
|
if (node !== floatingRef.current) {
|
|
floatingRef.current = node;
|
|
_setFloating(node);
|
|
}
|
|
}, []);
|
|
const referenceEl = externalReference || _reference;
|
|
const floatingEl = externalFloating || _floating;
|
|
const referenceRef = __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 floatingRef = __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 dataRef = __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"](data);
|
|
const hasWhileElementsMounted = whileElementsMounted != null;
|
|
const whileElementsMountedRef = useLatestRef(whileElementsMounted);
|
|
const platformRef = useLatestRef(platform);
|
|
const openRef = useLatestRef(open);
|
|
const update = __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"](()=>{
|
|
if (!referenceRef.current || !floatingRef.current) {
|
|
return;
|
|
}
|
|
const config = {
|
|
placement,
|
|
strategy,
|
|
middleware: latestMiddleware
|
|
};
|
|
if (platformRef.current) {
|
|
config.platform = platformRef.current;
|
|
}
|
|
(0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$dom$40$1$2e$7$2e$4$2f$node_modules$2f40$floating$2d$ui$2f$dom$2f$dist$2f$floating$2d$ui$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__$3c$locals$3e$__["computePosition"])(referenceRef.current, floatingRef.current, config).then((data)=>{
|
|
const fullData = {
|
|
...data,
|
|
// The floating element's position may be recomputed while it's closed
|
|
// but still mounted (such as when transitioning out). To ensure
|
|
// `isPositioned` will be `false` initially on the next open, avoid
|
|
// setting it to `true` when `open === false` (must be specified).
|
|
isPositioned: openRef.current !== false
|
|
};
|
|
if (isMountedRef.current && !deepEqual(dataRef.current, fullData)) {
|
|
dataRef.current = fullData;
|
|
__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"](()=>{
|
|
setData(fullData);
|
|
});
|
|
}
|
|
});
|
|
}, [
|
|
latestMiddleware,
|
|
placement,
|
|
strategy,
|
|
platformRef,
|
|
openRef
|
|
]);
|
|
index(()=>{
|
|
if (open === false && dataRef.current.isPositioned) {
|
|
dataRef.current.isPositioned = false;
|
|
setData((data)=>({
|
|
...data,
|
|
isPositioned: false
|
|
}));
|
|
}
|
|
}, [
|
|
open
|
|
]);
|
|
const isMountedRef = __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);
|
|
index(()=>{
|
|
isMountedRef.current = true;
|
|
return ()=>{
|
|
isMountedRef.current = false;
|
|
};
|
|
}, []);
|
|
index(()=>{
|
|
if (referenceEl) referenceRef.current = referenceEl;
|
|
if (floatingEl) floatingRef.current = floatingEl;
|
|
if (referenceEl && floatingEl) {
|
|
if (whileElementsMountedRef.current) {
|
|
return whileElementsMountedRef.current(referenceEl, floatingEl, update);
|
|
}
|
|
update();
|
|
}
|
|
}, [
|
|
referenceEl,
|
|
floatingEl,
|
|
update,
|
|
whileElementsMountedRef,
|
|
hasWhileElementsMounted
|
|
]);
|
|
const refs = __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"](()=>({
|
|
reference: referenceRef,
|
|
floating: floatingRef,
|
|
setReference,
|
|
setFloating
|
|
}), [
|
|
setReference,
|
|
setFloating
|
|
]);
|
|
const elements = __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"](()=>({
|
|
reference: referenceEl,
|
|
floating: floatingEl
|
|
}), [
|
|
referenceEl,
|
|
floatingEl
|
|
]);
|
|
const floatingStyles = __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"](()=>{
|
|
const initialStyles = {
|
|
position: strategy,
|
|
left: 0,
|
|
top: 0
|
|
};
|
|
if (!elements.floating) {
|
|
return initialStyles;
|
|
}
|
|
const x = roundByDPR(elements.floating, data.x);
|
|
const y = roundByDPR(elements.floating, data.y);
|
|
if (transform) {
|
|
return {
|
|
...initialStyles,
|
|
transform: "translate(" + x + "px, " + y + "px)",
|
|
...getDPR(elements.floating) >= 1.5 && {
|
|
willChange: 'transform'
|
|
}
|
|
};
|
|
}
|
|
return {
|
|
position: strategy,
|
|
left: x,
|
|
top: y
|
|
};
|
|
}, [
|
|
strategy,
|
|
transform,
|
|
elements.floating,
|
|
data.x,
|
|
data.y
|
|
]);
|
|
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"](()=>({
|
|
...data,
|
|
update,
|
|
refs,
|
|
elements,
|
|
floatingStyles
|
|
}), [
|
|
data,
|
|
update,
|
|
refs,
|
|
elements,
|
|
floatingStyles
|
|
]);
|
|
}
|
|
/**
|
|
* Provides data to position an inner element of the floating element so that it
|
|
* appears centered to the reference element.
|
|
* This wraps the core `arrow` middleware to allow React refs as the element.
|
|
* @see https://floating-ui.com/docs/arrow
|
|
*/ const arrow$1 = (options)=>{
|
|
function isRef(value) {
|
|
return ({}).hasOwnProperty.call(value, 'current');
|
|
}
|
|
return {
|
|
name: 'arrow',
|
|
options,
|
|
fn (state) {
|
|
const { element, padding } = typeof options === 'function' ? options(state) : options;
|
|
if (element && isRef(element)) {
|
|
if (element.current != null) {
|
|
return (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$dom$40$1$2e$7$2e$4$2f$node_modules$2f40$floating$2d$ui$2f$dom$2f$dist$2f$floating$2d$ui$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__$3c$locals$3e$__["arrow"])({
|
|
element: element.current,
|
|
padding
|
|
}).fn(state);
|
|
}
|
|
return {};
|
|
}
|
|
if (element) {
|
|
return (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$dom$40$1$2e$7$2e$4$2f$node_modules$2f40$floating$2d$ui$2f$dom$2f$dist$2f$floating$2d$ui$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__$3c$locals$3e$__["arrow"])({
|
|
element,
|
|
padding
|
|
}).fn(state);
|
|
}
|
|
return {};
|
|
}
|
|
};
|
|
};
|
|
/**
|
|
* Modifies the placement by translating the floating element along the
|
|
* specified axes.
|
|
* A number (shorthand for `mainAxis` or distance), or an axes configuration
|
|
* object may be passed.
|
|
* @see https://floating-ui.com/docs/offset
|
|
*/ const offset = (options, deps)=>({
|
|
...(0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$dom$40$1$2e$7$2e$4$2f$node_modules$2f40$floating$2d$ui$2f$dom$2f$dist$2f$floating$2d$ui$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__$3c$locals$3e$__["offset"])(options),
|
|
options: [
|
|
options,
|
|
deps
|
|
]
|
|
});
|
|
/**
|
|
* Optimizes the visibility of the floating element by shifting it in order to
|
|
* keep it in view when it will overflow the clipping boundary.
|
|
* @see https://floating-ui.com/docs/shift
|
|
*/ const shift = (options, deps)=>({
|
|
...(0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$dom$40$1$2e$7$2e$4$2f$node_modules$2f40$floating$2d$ui$2f$dom$2f$dist$2f$floating$2d$ui$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__$3c$locals$3e$__["shift"])(options),
|
|
options: [
|
|
options,
|
|
deps
|
|
]
|
|
});
|
|
/**
|
|
* Built-in `limiter` that will stop `shift()` at a certain point.
|
|
*/ const limitShift = (options, deps)=>({
|
|
...(0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$dom$40$1$2e$7$2e$4$2f$node_modules$2f40$floating$2d$ui$2f$dom$2f$dist$2f$floating$2d$ui$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__$3c$locals$3e$__["limitShift"])(options),
|
|
options: [
|
|
options,
|
|
deps
|
|
]
|
|
});
|
|
/**
|
|
* Optimizes the visibility of the floating element by flipping the `placement`
|
|
* in order to keep it in view when the preferred placement(s) will overflow the
|
|
* clipping boundary. Alternative to `autoPlacement`.
|
|
* @see https://floating-ui.com/docs/flip
|
|
*/ const flip = (options, deps)=>({
|
|
...(0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$dom$40$1$2e$7$2e$4$2f$node_modules$2f40$floating$2d$ui$2f$dom$2f$dist$2f$floating$2d$ui$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__$3c$locals$3e$__["flip"])(options),
|
|
options: [
|
|
options,
|
|
deps
|
|
]
|
|
});
|
|
/**
|
|
* Provides data that allows you to change the size of the floating element —
|
|
* for instance, prevent it from overflowing the clipping boundary or match the
|
|
* width of the reference element.
|
|
* @see https://floating-ui.com/docs/size
|
|
*/ const size = (options, deps)=>({
|
|
...(0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$dom$40$1$2e$7$2e$4$2f$node_modules$2f40$floating$2d$ui$2f$dom$2f$dist$2f$floating$2d$ui$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__$3c$locals$3e$__["size"])(options),
|
|
options: [
|
|
options,
|
|
deps
|
|
]
|
|
});
|
|
/**
|
|
* Optimizes the visibility of the floating element by choosing the placement
|
|
* that has the most space available automatically, without needing to specify a
|
|
* preferred placement. Alternative to `flip`.
|
|
* @see https://floating-ui.com/docs/autoPlacement
|
|
*/ const autoPlacement = (options, deps)=>({
|
|
...(0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$dom$40$1$2e$7$2e$4$2f$node_modules$2f40$floating$2d$ui$2f$dom$2f$dist$2f$floating$2d$ui$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__$3c$locals$3e$__["autoPlacement"])(options),
|
|
options: [
|
|
options,
|
|
deps
|
|
]
|
|
});
|
|
/**
|
|
* Provides data to hide the floating element in applicable situations, such as
|
|
* when it is not in the same clipping context as the reference element.
|
|
* @see https://floating-ui.com/docs/hide
|
|
*/ const hide = (options, deps)=>({
|
|
...(0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$dom$40$1$2e$7$2e$4$2f$node_modules$2f40$floating$2d$ui$2f$dom$2f$dist$2f$floating$2d$ui$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__$3c$locals$3e$__["hide"])(options),
|
|
options: [
|
|
options,
|
|
deps
|
|
]
|
|
});
|
|
/**
|
|
* Provides improved positioning for inline reference elements that can span
|
|
* over multiple lines, such as hyperlinks or range selections.
|
|
* @see https://floating-ui.com/docs/inline
|
|
*/ const inline = (options, deps)=>({
|
|
...(0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$dom$40$1$2e$7$2e$4$2f$node_modules$2f40$floating$2d$ui$2f$dom$2f$dist$2f$floating$2d$ui$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__$3c$locals$3e$__["inline"])(options),
|
|
options: [
|
|
options,
|
|
deps
|
|
]
|
|
});
|
|
/**
|
|
* Provides data to position an inner element of the floating element so that it
|
|
* appears centered to the reference element.
|
|
* This wraps the core `arrow` middleware to allow React refs as the element.
|
|
* @see https://floating-ui.com/docs/arrow
|
|
*/ const arrow = (options, deps)=>({
|
|
...arrow$1(options),
|
|
options: [
|
|
options,
|
|
deps
|
|
]
|
|
});
|
|
;
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/@radix-ui+react-arrow@1.1.1_@types+react-dom@19.2.3_@types+react@19.2.6__@types+react@1_39cf57811aaff0943ff6c638b98c5bc2/node_modules/@radix-ui/react-arrow/dist/index.mjs [app-ssr] (ecmascript)", ((__turbopack_context__) => {
|
|
"use strict";
|
|
|
|
// packages/react/arrow/src/Arrow.tsx
|
|
__turbopack_context__.s([
|
|
"Arrow",
|
|
()=>Arrow,
|
|
"Root",
|
|
()=>Root
|
|
]);
|
|
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)");
|
|
;
|
|
;
|
|
;
|
|
var NAME = "Arrow";
|
|
var Arrow = __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 { children, width = 10, height = 5, ...arrowProps } = props;
|
|
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"].svg, {
|
|
...arrowProps,
|
|
ref: forwardedRef,
|
|
width,
|
|
height,
|
|
viewBox: "0 0 30 10",
|
|
preserveAspectRatio: "none",
|
|
children: props.asChild ? 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"])("polygon", {
|
|
points: "0,0 30,0 15,10"
|
|
})
|
|
});
|
|
});
|
|
Arrow.displayName = NAME;
|
|
var Root = Arrow;
|
|
;
|
|
//# 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-popper@1.2.1_@types+react-dom@19.2.3_@types+react@19.2.6__@types+react@_f51937a6043c1687ec731d0ff356eddd/node_modules/@radix-ui/react-popper/dist/index.mjs [app-ssr] (ecmascript)", ((__turbopack_context__) => {
|
|
"use strict";
|
|
|
|
__turbopack_context__.s([
|
|
"ALIGN_OPTIONS",
|
|
()=>ALIGN_OPTIONS,
|
|
"Anchor",
|
|
()=>Anchor,
|
|
"Arrow",
|
|
()=>Arrow,
|
|
"Content",
|
|
()=>Content,
|
|
"Popper",
|
|
()=>Popper,
|
|
"PopperAnchor",
|
|
()=>PopperAnchor,
|
|
"PopperArrow",
|
|
()=>PopperArrow,
|
|
"PopperContent",
|
|
()=>PopperContent,
|
|
"Root",
|
|
()=>Root2,
|
|
"SIDE_OPTIONS",
|
|
()=>SIDE_OPTIONS,
|
|
"createPopperScope",
|
|
()=>createPopperScope
|
|
]);
|
|
// packages/react/popper/src/Popper.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$floating$2d$ui$2b$react$2d$dom$40$2$2e$1$2e$6_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$2f40$floating$2d$ui$2f$react$2d$dom$2f$dist$2f$floating$2d$ui$2e$react$2d$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__$3c$locals$3e$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/@floating-ui+react-dom@2.1.6_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs [app-ssr] (ecmascript) <locals>");
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$dom$40$1$2e$7$2e$4$2f$node_modules$2f40$floating$2d$ui$2f$dom$2f$dist$2f$floating$2d$ui$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__$3c$locals$3e$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/@floating-ui+dom@1.7.4/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs [app-ssr] (ecmascript) <locals>");
|
|
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$arrow$40$1$2e$1$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$react$40$1_39cf57811aaff0943ff6c638b98c5bc2$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$arrow$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-arrow@1.1.1_@types+react-dom@19.2.3_@types+react@19.2.6__@types+react@1_39cf57811aaff0943ff6c638b98c5bc2/node_modules/@radix-ui/react-arrow/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$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$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$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$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 SIDE_OPTIONS = [
|
|
"top",
|
|
"right",
|
|
"bottom",
|
|
"left"
|
|
];
|
|
var ALIGN_OPTIONS = [
|
|
"start",
|
|
"center",
|
|
"end"
|
|
];
|
|
var POPPER_NAME = "Popper";
|
|
var [createPopperContext, createPopperScope] = (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"])(POPPER_NAME);
|
|
var [PopperProvider, usePopperContext] = createPopperContext(POPPER_NAME);
|
|
var Popper = (props)=>{
|
|
const { __scopePopper, children } = props;
|
|
const [anchor, setAnchor] = __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);
|
|
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"])(PopperProvider, {
|
|
scope: __scopePopper,
|
|
anchor,
|
|
onAnchorChange: setAnchor,
|
|
children
|
|
});
|
|
};
|
|
Popper.displayName = POPPER_NAME;
|
|
var ANCHOR_NAME = "PopperAnchor";
|
|
var PopperAnchor = __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 { __scopePopper, virtualRef, ...anchorProps } = props;
|
|
const context = usePopperContext(ANCHOR_NAME, __scopePopper);
|
|
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 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, 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$__["useEffect"](()=>{
|
|
context.onAnchorChange(virtualRef?.current || ref.current);
|
|
});
|
|
return virtualRef ? null : /* @__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"].div, {
|
|
...anchorProps,
|
|
ref: composedRefs
|
|
});
|
|
});
|
|
PopperAnchor.displayName = ANCHOR_NAME;
|
|
var CONTENT_NAME = "PopperContent";
|
|
var [PopperContentProvider, useContentContext] = createPopperContext(CONTENT_NAME);
|
|
var PopperContent = __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 { __scopePopper, side = "bottom", sideOffset = 0, align = "center", alignOffset = 0, arrowPadding = 0, avoidCollisions = true, collisionBoundary = [], collisionPadding: collisionPaddingProp = 0, sticky = "partial", hideWhenDetached = false, updatePositionStrategy = "optimized", onPlaced, ...contentProps } = props;
|
|
const context = usePopperContext(CONTENT_NAME, __scopePopper);
|
|
const [content, setContent] = __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)=>setContent(node));
|
|
const [arrow, setArrow] = __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 arrowSize = (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"])(arrow);
|
|
const arrowWidth = arrowSize?.width ?? 0;
|
|
const arrowHeight = arrowSize?.height ?? 0;
|
|
const desiredPlacement = side + (align !== "center" ? "-" + align : "");
|
|
const collisionPadding = typeof collisionPaddingProp === "number" ? collisionPaddingProp : {
|
|
top: 0,
|
|
right: 0,
|
|
bottom: 0,
|
|
left: 0,
|
|
...collisionPaddingProp
|
|
};
|
|
const boundary = Array.isArray(collisionBoundary) ? collisionBoundary : [
|
|
collisionBoundary
|
|
];
|
|
const hasExplicitBoundaries = boundary.length > 0;
|
|
const detectOverflowOptions = {
|
|
padding: collisionPadding,
|
|
boundary: boundary.filter(isNotNull),
|
|
// with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
|
|
altBoundary: hasExplicitBoundaries
|
|
};
|
|
const { refs, floatingStyles, placement, isPositioned, middlewareData } = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$react$2d$dom$40$2$2e$1$2e$6_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$2f40$floating$2d$ui$2f$react$2d$dom$2f$dist$2f$floating$2d$ui$2e$react$2d$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__$3c$locals$3e$__["useFloating"])({
|
|
// default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
|
|
strategy: "fixed",
|
|
placement: desiredPlacement,
|
|
whileElementsMounted: (...args)=>{
|
|
const cleanup = (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$dom$40$1$2e$7$2e$4$2f$node_modules$2f40$floating$2d$ui$2f$dom$2f$dist$2f$floating$2d$ui$2e$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__$3c$locals$3e$__["autoUpdate"])(...args, {
|
|
animationFrame: updatePositionStrategy === "always"
|
|
});
|
|
return cleanup;
|
|
},
|
|
elements: {
|
|
reference: context.anchor
|
|
},
|
|
middleware: [
|
|
(0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$react$2d$dom$40$2$2e$1$2e$6_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$2f40$floating$2d$ui$2f$react$2d$dom$2f$dist$2f$floating$2d$ui$2e$react$2d$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__$3c$locals$3e$__["offset"])({
|
|
mainAxis: sideOffset + arrowHeight,
|
|
alignmentAxis: alignOffset
|
|
}),
|
|
avoidCollisions && (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$react$2d$dom$40$2$2e$1$2e$6_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$2f40$floating$2d$ui$2f$react$2d$dom$2f$dist$2f$floating$2d$ui$2e$react$2d$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__$3c$locals$3e$__["shift"])({
|
|
mainAxis: true,
|
|
crossAxis: false,
|
|
limiter: sticky === "partial" ? (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$react$2d$dom$40$2$2e$1$2e$6_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$2f40$floating$2d$ui$2f$react$2d$dom$2f$dist$2f$floating$2d$ui$2e$react$2d$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__$3c$locals$3e$__["limitShift"])() : void 0,
|
|
...detectOverflowOptions
|
|
}),
|
|
avoidCollisions && (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$react$2d$dom$40$2$2e$1$2e$6_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$2f40$floating$2d$ui$2f$react$2d$dom$2f$dist$2f$floating$2d$ui$2e$react$2d$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__$3c$locals$3e$__["flip"])({
|
|
...detectOverflowOptions
|
|
}),
|
|
(0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$react$2d$dom$40$2$2e$1$2e$6_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$2f40$floating$2d$ui$2f$react$2d$dom$2f$dist$2f$floating$2d$ui$2e$react$2d$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__$3c$locals$3e$__["size"])({
|
|
...detectOverflowOptions,
|
|
apply: ({ elements, rects, availableWidth, availableHeight })=>{
|
|
const { width: anchorWidth, height: anchorHeight } = rects.reference;
|
|
const contentStyle = elements.floating.style;
|
|
contentStyle.setProperty("--radix-popper-available-width", `${availableWidth}px`);
|
|
contentStyle.setProperty("--radix-popper-available-height", `${availableHeight}px`);
|
|
contentStyle.setProperty("--radix-popper-anchor-width", `${anchorWidth}px`);
|
|
contentStyle.setProperty("--radix-popper-anchor-height", `${anchorHeight}px`);
|
|
}
|
|
}),
|
|
arrow && (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$react$2d$dom$40$2$2e$1$2e$6_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$2f40$floating$2d$ui$2f$react$2d$dom$2f$dist$2f$floating$2d$ui$2e$react$2d$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__$3c$locals$3e$__["arrow"])({
|
|
element: arrow,
|
|
padding: arrowPadding
|
|
}),
|
|
transformOrigin({
|
|
arrowWidth,
|
|
arrowHeight
|
|
}),
|
|
hideWhenDetached && (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f40$floating$2d$ui$2b$react$2d$dom$40$2$2e$1$2e$6_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$2f40$floating$2d$ui$2f$react$2d$dom$2f$dist$2f$floating$2d$ui$2e$react$2d$dom$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__$3c$locals$3e$__["hide"])({
|
|
strategy: "referenceHidden",
|
|
...detectOverflowOptions
|
|
})
|
|
]
|
|
});
|
|
const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);
|
|
const handlePlaced = (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"])(onPlaced);
|
|
(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 (isPositioned) {
|
|
handlePlaced?.();
|
|
}
|
|
}, [
|
|
isPositioned,
|
|
handlePlaced
|
|
]);
|
|
const arrowX = middlewareData.arrow?.x;
|
|
const arrowY = middlewareData.arrow?.y;
|
|
const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;
|
|
const [contentZIndex, setContentZIndex] = __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"]();
|
|
(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 (content) setContentZIndex(window.getComputedStyle(content).zIndex);
|
|
}, [
|
|
content
|
|
]);
|
|
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"])("div", {
|
|
ref: refs.setFloating,
|
|
"data-radix-popper-content-wrapper": "",
|
|
style: {
|
|
...floatingStyles,
|
|
transform: isPositioned ? floatingStyles.transform : "translate(0, -200%)",
|
|
// keep off the page when measuring
|
|
minWidth: "max-content",
|
|
zIndex: contentZIndex,
|
|
["--radix-popper-transform-origin"]: [
|
|
middlewareData.transformOrigin?.x,
|
|
middlewareData.transformOrigin?.y
|
|
].join(" "),
|
|
// hide the content if using the hide middleware and should be hidden
|
|
// set visibility to hidden and disable pointer events so the UI behaves
|
|
// as if the PopperContent isn't there at all
|
|
...middlewareData.hide?.referenceHidden && {
|
|
visibility: "hidden",
|
|
pointerEvents: "none"
|
|
}
|
|
},
|
|
dir: props.dir,
|
|
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"])(PopperContentProvider, {
|
|
scope: __scopePopper,
|
|
placedSide,
|
|
onArrowChange: setArrow,
|
|
arrowX,
|
|
arrowY,
|
|
shouldHideArrow: cannotCenterArrow,
|
|
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"].div, {
|
|
"data-side": placedSide,
|
|
"data-align": placedAlign,
|
|
...contentProps,
|
|
ref: composedRefs,
|
|
style: {
|
|
...contentProps.style,
|
|
// if the PopperContent hasn't been placed yet (not all measurements done)
|
|
// we prevent animations so that users's animation don't kick in too early referring wrong sides
|
|
animation: !isPositioned ? "none" : void 0
|
|
}
|
|
})
|
|
})
|
|
});
|
|
});
|
|
PopperContent.displayName = CONTENT_NAME;
|
|
var ARROW_NAME = "PopperArrow";
|
|
var OPPOSITE_SIDE = {
|
|
top: "bottom",
|
|
right: "left",
|
|
bottom: "top",
|
|
left: "right"
|
|
};
|
|
var PopperArrow = __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"](function PopperArrow2(props, forwardedRef) {
|
|
const { __scopePopper, ...arrowProps } = props;
|
|
const contentContext = useContentContext(ARROW_NAME, __scopePopper);
|
|
const baseSide = OPPOSITE_SIDE[contentContext.placedSide];
|
|
return(// we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
|
|
// doesn't report size as we'd expect on SVG elements.
|
|
// it reports their bounding box which is effectively the largest path inside the SVG.
|
|
/* @__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"])("span", {
|
|
ref: contentContext.onArrowChange,
|
|
style: {
|
|
position: "absolute",
|
|
left: contentContext.arrowX,
|
|
top: contentContext.arrowY,
|
|
[baseSide]: 0,
|
|
transformOrigin: {
|
|
top: "",
|
|
right: "0 0",
|
|
bottom: "center 0",
|
|
left: "100% 0"
|
|
}[contentContext.placedSide],
|
|
transform: {
|
|
top: "translateY(100%)",
|
|
right: "translateY(50%) rotate(90deg) translateX(-50%)",
|
|
bottom: `rotate(180deg)`,
|
|
left: "translateY(50%) rotate(-90deg) translateX(50%)"
|
|
}[contentContext.placedSide],
|
|
visibility: contentContext.shouldHideArrow ? "hidden" : void 0
|
|
},
|
|
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$arrow$40$1$2e$1$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$react$40$1_39cf57811aaff0943ff6c638b98c5bc2$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$arrow$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["Root"], {
|
|
...arrowProps,
|
|
ref: forwardedRef,
|
|
style: {
|
|
...arrowProps.style,
|
|
// ensures the element can be measured correctly (mostly for if SVG)
|
|
display: "block"
|
|
}
|
|
})
|
|
}));
|
|
});
|
|
PopperArrow.displayName = ARROW_NAME;
|
|
function isNotNull(value) {
|
|
return value !== null;
|
|
}
|
|
var transformOrigin = (options)=>({
|
|
name: "transformOrigin",
|
|
options,
|
|
fn (data) {
|
|
const { placement, rects, middlewareData } = data;
|
|
const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;
|
|
const isArrowHidden = cannotCenterArrow;
|
|
const arrowWidth = isArrowHidden ? 0 : options.arrowWidth;
|
|
const arrowHeight = isArrowHidden ? 0 : options.arrowHeight;
|
|
const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);
|
|
const noArrowAlign = {
|
|
start: "0%",
|
|
center: "50%",
|
|
end: "100%"
|
|
}[placedAlign];
|
|
const arrowXCenter = (middlewareData.arrow?.x ?? 0) + arrowWidth / 2;
|
|
const arrowYCenter = (middlewareData.arrow?.y ?? 0) + arrowHeight / 2;
|
|
let x = "";
|
|
let y = "";
|
|
if (placedSide === "bottom") {
|
|
x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;
|
|
y = `${-arrowHeight}px`;
|
|
} else if (placedSide === "top") {
|
|
x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;
|
|
y = `${rects.floating.height + arrowHeight}px`;
|
|
} else if (placedSide === "right") {
|
|
x = `${-arrowHeight}px`;
|
|
y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;
|
|
} else if (placedSide === "left") {
|
|
x = `${rects.floating.width + arrowHeight}px`;
|
|
y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;
|
|
}
|
|
return {
|
|
data: {
|
|
x,
|
|
y
|
|
}
|
|
};
|
|
}
|
|
});
|
|
function getSideAndAlignFromPlacement(placement) {
|
|
const [side, align = "center"] = placement.split("-");
|
|
return [
|
|
side,
|
|
align
|
|
];
|
|
}
|
|
var Root2 = Popper;
|
|
var Anchor = PopperAnchor;
|
|
var Content = PopperContent;
|
|
var Arrow = PopperArrow;
|
|
;
|
|
//# sourceMappingURL=index.mjs.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/@radix-ui+react-roving-focus@1.1.1_@types+react-dom@19.2.3_@types+react@19.2.6__@types+_a18e46462387af707d972c0ffe7a229b/node_modules/@radix-ui/react-roving-focus/dist/index.mjs [app-ssr] (ecmascript)", ((__turbopack_context__) => {
|
|
"use strict";
|
|
|
|
__turbopack_context__.s([
|
|
"Item",
|
|
()=>Item,
|
|
"Root",
|
|
()=>Root,
|
|
"RovingFocusGroup",
|
|
()=>RovingFocusGroup,
|
|
"RovingFocusGroupItem",
|
|
()=>RovingFocusGroupItem,
|
|
"createRovingFocusGroupScope",
|
|
()=>createRovingFocusGroupScope
|
|
]);
|
|
// packages/react/roving-focus/src/RovingFocusGroup.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$collection$40$1$2e$1$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$re_1ad17166111274b6b451c5ad4817bfc8$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$collection$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-collection@1.1.1_@types+react-dom@19.2.3_@types+react@19.2.6__@types+re_1ad17166111274b6b451c5ad4817bfc8/node_modules/@radix-ui/react-collection/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$id$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$id$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-id@1.1.0_@types+react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-id/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$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$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$direction$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$direction$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-direction@1.1.0_@types+react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-direction/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 ENTRY_FOCUS = "rovingFocusGroup.onEntryFocus";
|
|
var EVENT_OPTIONS = {
|
|
bubbles: false,
|
|
cancelable: true
|
|
};
|
|
var GROUP_NAME = "RovingFocusGroup";
|
|
var [Collection, useCollection, createCollectionScope] = (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$collection$40$1$2e$1$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$re_1ad17166111274b6b451c5ad4817bfc8$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$collection$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["createCollection"])(GROUP_NAME);
|
|
var [createRovingFocusGroupContext, createRovingFocusGroupScope] = (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"])(GROUP_NAME, [
|
|
createCollectionScope
|
|
]);
|
|
var [RovingFocusProvider, useRovingFocusContext] = createRovingFocusGroupContext(GROUP_NAME);
|
|
var RovingFocusGroup = __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"])(Collection.Provider, {
|
|
scope: props.__scopeRovingFocusGroup,
|
|
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"])(Collection.Slot, {
|
|
scope: props.__scopeRovingFocusGroup,
|
|
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"])(RovingFocusGroupImpl, {
|
|
...props,
|
|
ref: forwardedRef
|
|
})
|
|
})
|
|
});
|
|
});
|
|
RovingFocusGroup.displayName = GROUP_NAME;
|
|
var RovingFocusGroupImpl = __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 { __scopeRovingFocusGroup, orientation, loop = false, dir, currentTabStopId: currentTabStopIdProp, defaultCurrentTabStopId, onCurrentTabStopIdChange, onEntryFocus, preventScrollOnEntryFocus = false, ...groupProps } = 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 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, ref);
|
|
const direction = (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$direction$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$direction$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["useDirection"])(dir);
|
|
const [currentTabStopId = null, setCurrentTabStopId] = (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: currentTabStopIdProp,
|
|
defaultProp: defaultCurrentTabStopId,
|
|
onChange: onCurrentTabStopIdChange
|
|
});
|
|
const [isTabbingBackOut, setIsTabbingBackOut] = __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"](false);
|
|
const handleEntryFocus = (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"])(onEntryFocus);
|
|
const getItems = useCollection(__scopeRovingFocusGroup);
|
|
const isClickFocusRef = __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 [focusableItemsCount, setFocusableItemsCount] = __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"](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"](()=>{
|
|
const node = ref.current;
|
|
if (node) {
|
|
node.addEventListener(ENTRY_FOCUS, handleEntryFocus);
|
|
return ()=>node.removeEventListener(ENTRY_FOCUS, handleEntryFocus);
|
|
}
|
|
}, [
|
|
handleEntryFocus
|
|
]);
|
|
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"])(RovingFocusProvider, {
|
|
scope: __scopeRovingFocusGroup,
|
|
orientation,
|
|
dir: direction,
|
|
loop,
|
|
currentTabStopId,
|
|
onItemFocus: __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"]((tabStopId)=>setCurrentTabStopId(tabStopId), [
|
|
setCurrentTabStopId
|
|
]),
|
|
onItemShiftTab: __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"](()=>setIsTabbingBackOut(true), []),
|
|
onFocusableItemAdd: __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"](()=>setFocusableItemsCount((prevCount)=>prevCount + 1), []),
|
|
onFocusableItemRemove: __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"](()=>setFocusableItemsCount((prevCount)=>prevCount - 1), []),
|
|
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"].div, {
|
|
tabIndex: isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0,
|
|
"data-orientation": orientation,
|
|
...groupProps,
|
|
ref: composedRefs,
|
|
style: {
|
|
outline: "none",
|
|
...props.style
|
|
},
|
|
onMouseDown: (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.onMouseDown, ()=>{
|
|
isClickFocusRef.current = true;
|
|
}),
|
|
onFocus: (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.onFocus, (event)=>{
|
|
const isKeyboardFocus = !isClickFocusRef.current;
|
|
if (event.target === event.currentTarget && isKeyboardFocus && !isTabbingBackOut) {
|
|
const entryFocusEvent = new CustomEvent(ENTRY_FOCUS, EVENT_OPTIONS);
|
|
event.currentTarget.dispatchEvent(entryFocusEvent);
|
|
if (!entryFocusEvent.defaultPrevented) {
|
|
const items = getItems().filter((item)=>item.focusable);
|
|
const activeItem = items.find((item)=>item.active);
|
|
const currentItem = items.find((item)=>item.id === currentTabStopId);
|
|
const candidateItems = [
|
|
activeItem,
|
|
currentItem,
|
|
...items
|
|
].filter(Boolean);
|
|
const candidateNodes = candidateItems.map((item)=>item.ref.current);
|
|
focusFirst(candidateNodes, preventScrollOnEntryFocus);
|
|
}
|
|
}
|
|
isClickFocusRef.current = false;
|
|
}),
|
|
onBlur: (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.onBlur, ()=>setIsTabbingBackOut(false))
|
|
})
|
|
});
|
|
});
|
|
var ITEM_NAME = "RovingFocusGroupItem";
|
|
var RovingFocusGroupItem = __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 { __scopeRovingFocusGroup, focusable = true, active = false, tabStopId, ...itemProps } = props;
|
|
const autoId = (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$id$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$id$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["useId"])();
|
|
const id = tabStopId || autoId;
|
|
const context = useRovingFocusContext(ITEM_NAME, __scopeRovingFocusGroup);
|
|
const isCurrentTabStop = context.currentTabStopId === id;
|
|
const getItems = useCollection(__scopeRovingFocusGroup);
|
|
const { onFocusableItemAdd, onFocusableItemRemove } = 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$__["useEffect"](()=>{
|
|
if (focusable) {
|
|
onFocusableItemAdd();
|
|
return ()=>onFocusableItemRemove();
|
|
}
|
|
}, [
|
|
focusable,
|
|
onFocusableItemAdd,
|
|
onFocusableItemRemove
|
|
]);
|
|
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"])(Collection.ItemSlot, {
|
|
scope: __scopeRovingFocusGroup,
|
|
id,
|
|
focusable,
|
|
active,
|
|
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, {
|
|
tabIndex: isCurrentTabStop ? 0 : -1,
|
|
"data-orientation": context.orientation,
|
|
...itemProps,
|
|
ref: forwardedRef,
|
|
onMouseDown: (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.onMouseDown, (event)=>{
|
|
if (!focusable) event.preventDefault();
|
|
else context.onItemFocus(id);
|
|
}),
|
|
onFocus: (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.onFocus, ()=>context.onItemFocus(id)),
|
|
onKeyDown: (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.onKeyDown, (event)=>{
|
|
if (event.key === "Tab" && event.shiftKey) {
|
|
context.onItemShiftTab();
|
|
return;
|
|
}
|
|
if (event.target !== event.currentTarget) return;
|
|
const focusIntent = getFocusIntent(event, context.orientation, context.dir);
|
|
if (focusIntent !== void 0) {
|
|
if (event.metaKey || event.ctrlKey || event.altKey || event.shiftKey) return;
|
|
event.preventDefault();
|
|
const items = getItems().filter((item)=>item.focusable);
|
|
let candidateNodes = items.map((item)=>item.ref.current);
|
|
if (focusIntent === "last") candidateNodes.reverse();
|
|
else if (focusIntent === "prev" || focusIntent === "next") {
|
|
if (focusIntent === "prev") candidateNodes.reverse();
|
|
const currentIndex = candidateNodes.indexOf(event.currentTarget);
|
|
candidateNodes = context.loop ? wrapArray(candidateNodes, currentIndex + 1) : candidateNodes.slice(currentIndex + 1);
|
|
}
|
|
setTimeout(()=>focusFirst(candidateNodes));
|
|
}
|
|
})
|
|
})
|
|
});
|
|
});
|
|
RovingFocusGroupItem.displayName = ITEM_NAME;
|
|
var MAP_KEY_TO_FOCUS_INTENT = {
|
|
ArrowLeft: "prev",
|
|
ArrowUp: "prev",
|
|
ArrowRight: "next",
|
|
ArrowDown: "next",
|
|
PageUp: "first",
|
|
Home: "first",
|
|
PageDown: "last",
|
|
End: "last"
|
|
};
|
|
function getDirectionAwareKey(key, dir) {
|
|
if (dir !== "rtl") return key;
|
|
return key === "ArrowLeft" ? "ArrowRight" : key === "ArrowRight" ? "ArrowLeft" : key;
|
|
}
|
|
function getFocusIntent(event, orientation, dir) {
|
|
const key = getDirectionAwareKey(event.key, dir);
|
|
if (orientation === "vertical" && [
|
|
"ArrowLeft",
|
|
"ArrowRight"
|
|
].includes(key)) return void 0;
|
|
if (orientation === "horizontal" && [
|
|
"ArrowUp",
|
|
"ArrowDown"
|
|
].includes(key)) return void 0;
|
|
return MAP_KEY_TO_FOCUS_INTENT[key];
|
|
}
|
|
function focusFirst(candidates, preventScroll = false) {
|
|
const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;
|
|
for (const candidate of candidates){
|
|
if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;
|
|
candidate.focus({
|
|
preventScroll
|
|
});
|
|
if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;
|
|
}
|
|
}
|
|
function wrapArray(array, startIndex) {
|
|
return array.map((_, index)=>array[(startIndex + index) % array.length]);
|
|
}
|
|
var Root = RovingFocusGroup;
|
|
var Item = RovingFocusGroupItem;
|
|
;
|
|
//# sourceMappingURL=index.mjs.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/@radix-ui+react-menu@2.1.4_@types+react-dom@19.2.3_@types+react@19.2.6__@types+react@19_0d4b96092e17d5c8c1f962859072e800/node_modules/@radix-ui/react-menu/dist/index.mjs [app-ssr] (ecmascript)", ((__turbopack_context__) => {
|
|
"use strict";
|
|
|
|
__turbopack_context__.s([
|
|
"Anchor",
|
|
()=>Anchor2,
|
|
"Arrow",
|
|
()=>Arrow2,
|
|
"CheckboxItem",
|
|
()=>CheckboxItem,
|
|
"Content",
|
|
()=>Content2,
|
|
"Group",
|
|
()=>Group,
|
|
"Item",
|
|
()=>Item2,
|
|
"ItemIndicator",
|
|
()=>ItemIndicator,
|
|
"Label",
|
|
()=>Label,
|
|
"Menu",
|
|
()=>Menu,
|
|
"MenuAnchor",
|
|
()=>MenuAnchor,
|
|
"MenuArrow",
|
|
()=>MenuArrow,
|
|
"MenuCheckboxItem",
|
|
()=>MenuCheckboxItem,
|
|
"MenuContent",
|
|
()=>MenuContent,
|
|
"MenuGroup",
|
|
()=>MenuGroup,
|
|
"MenuItem",
|
|
()=>MenuItem,
|
|
"MenuItemIndicator",
|
|
()=>MenuItemIndicator,
|
|
"MenuLabel",
|
|
()=>MenuLabel,
|
|
"MenuPortal",
|
|
()=>MenuPortal,
|
|
"MenuRadioGroup",
|
|
()=>MenuRadioGroup,
|
|
"MenuRadioItem",
|
|
()=>MenuRadioItem,
|
|
"MenuSeparator",
|
|
()=>MenuSeparator,
|
|
"MenuSub",
|
|
()=>MenuSub,
|
|
"MenuSubContent",
|
|
()=>MenuSubContent,
|
|
"MenuSubTrigger",
|
|
()=>MenuSubTrigger,
|
|
"Portal",
|
|
()=>Portal,
|
|
"RadioGroup",
|
|
()=>RadioGroup,
|
|
"RadioItem",
|
|
()=>RadioItem,
|
|
"Root",
|
|
()=>Root3,
|
|
"Separator",
|
|
()=>Separator,
|
|
"Sub",
|
|
()=>Sub,
|
|
"SubContent",
|
|
()=>SubContent,
|
|
"SubTrigger",
|
|
()=>SubTrigger,
|
|
"createMenuScope",
|
|
()=>createMenuScope
|
|
]);
|
|
// packages/react/menu/src/Menu.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$collection$40$1$2e$1$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$re_1ad17166111274b6b451c5ad4817bfc8$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$collection$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-collection@1.1.1_@types+react-dom@19.2.3_@types+react@19.2.6__@types+re_1ad17166111274b6b451c5ad4817bfc8/node_modules/@radix-ui/react-collection/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$direction$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$direction$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-direction@1.1.0_@types+react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-direction/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$dismissable$2d$layer$40$1$2e$1$2e$3_$40$types$2b$react$2d$dom$40$19$2e$2$2e$3_$40$types$2b$react$40$19$2e$2$2e$6_$5f40$t_93e149627c30a83695c926d31c853576$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$dismissable$2d$layer$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-dismissable-layer@1.1.3_@types+react-dom@19.2.3_@types+react@19.2.6__@t_93e149627c30a83695c926d31c853576/node_modules/@radix-ui/react-dismissable-layer/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$focus$2d$guards$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$focus$2d$guards$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-focus-guards@1.1.1_@types+react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-focus-guards/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$focus$2d$scope$40$1$2e$1$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$r_d785daf6985fc8350fb3781de275c6b6$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$focus$2d$scope$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-focus-scope@1.1.1_@types+react-dom@19.2.3_@types+react@19.2.6__@types+r_d785daf6985fc8350fb3781de275c6b6/node_modules/@radix-ui/react-focus-scope/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$id$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$id$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-id@1.1.0_@types+react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-id/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$popper$40$1$2e$2$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$react$40$_f51937a6043c1687ec731d0ff356eddd$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$popper$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-popper@1.2.1_@types+react-dom@19.2.3_@types+react@19.2.6__@types+react@_f51937a6043c1687ec731d0ff356eddd/node_modules/@radix-ui/react-popper/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$portal$40$1$2e$1$2e$3_$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$react$40$_046b67df02e5a46cef606421f30d033b$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$portal$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-portal@1.1.3_@types+react-dom@19.2.3_@types+react@19.2.6__@types+react@_046b67df02e5a46cef606421f30d033b/node_modules/@radix-ui/react-portal/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$presence$40$1$2e$1$2e$2_$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$reac_4990595ea432be9a74aea0197efb306c$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$presence$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-presence@1.1.2_@types+react-dom@19.2.3_@types+react@19.2.6__@types+reac_4990595ea432be9a74aea0197efb306c/node_modules/@radix-ui/react-presence/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$2f40$radix$2d$ui$2b$react$2d$roving$2d$focus$40$1$2e$1$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$_a18e46462387af707d972c0ffe7a229b$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$roving$2d$focus$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-roving-focus@1.1.1_@types+react-dom@19.2.3_@types+react@19.2.6__@types+_a18e46462387af707d972c0ffe7a229b/node_modules/@radix-ui/react-roving-focus/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$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$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$2f$aria$2d$hidden$40$1$2e$2$2e$6$2f$node_modules$2f$aria$2d$hidden$2f$dist$2f$es2015$2f$index$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/aria-hidden@1.2.6/node_modules/aria-hidden/dist/es2015/index.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$react$2d$remove$2d$scroll$40$2$2e$7$2e$1_$40$types$2b$react$40$19$2e$2$2e$6_react$40$19$2e$2$2e$0$2f$node_modules$2f$react$2d$remove$2d$scroll$2f$dist$2f$es2015$2f$Combination$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__$3c$export__default__as__RemoveScroll$3e$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.2.6_react@19.2.0/node_modules/react-remove-scroll/dist/es2015/Combination.js [app-ssr] (ecmascript) <export default as RemoveScroll>");
|
|
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 SELECTION_KEYS = [
|
|
"Enter",
|
|
" "
|
|
];
|
|
var FIRST_KEYS = [
|
|
"ArrowDown",
|
|
"PageUp",
|
|
"Home"
|
|
];
|
|
var LAST_KEYS = [
|
|
"ArrowUp",
|
|
"PageDown",
|
|
"End"
|
|
];
|
|
var FIRST_LAST_KEYS = [
|
|
...FIRST_KEYS,
|
|
...LAST_KEYS
|
|
];
|
|
var SUB_OPEN_KEYS = {
|
|
ltr: [
|
|
...SELECTION_KEYS,
|
|
"ArrowRight"
|
|
],
|
|
rtl: [
|
|
...SELECTION_KEYS,
|
|
"ArrowLeft"
|
|
]
|
|
};
|
|
var SUB_CLOSE_KEYS = {
|
|
ltr: [
|
|
"ArrowLeft"
|
|
],
|
|
rtl: [
|
|
"ArrowRight"
|
|
]
|
|
};
|
|
var MENU_NAME = "Menu";
|
|
var [Collection, useCollection, createCollectionScope] = (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$collection$40$1$2e$1$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$re_1ad17166111274b6b451c5ad4817bfc8$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$collection$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["createCollection"])(MENU_NAME);
|
|
var [createMenuContext, createMenuScope] = (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"])(MENU_NAME, [
|
|
createCollectionScope,
|
|
__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$popper$40$1$2e$2$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$react$40$_f51937a6043c1687ec731d0ff356eddd$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$popper$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["createPopperScope"],
|
|
__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$roving$2d$focus$40$1$2e$1$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$_a18e46462387af707d972c0ffe7a229b$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$roving$2d$focus$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["createRovingFocusGroupScope"]
|
|
]);
|
|
var usePopperScope = (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$popper$40$1$2e$2$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$react$40$_f51937a6043c1687ec731d0ff356eddd$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$popper$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["createPopperScope"])();
|
|
var useRovingFocusGroupScope = (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$roving$2d$focus$40$1$2e$1$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$_a18e46462387af707d972c0ffe7a229b$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$roving$2d$focus$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["createRovingFocusGroupScope"])();
|
|
var [MenuProvider, useMenuContext] = createMenuContext(MENU_NAME);
|
|
var [MenuRootProvider, useMenuRootContext] = createMenuContext(MENU_NAME);
|
|
var Menu = (props)=>{
|
|
const { __scopeMenu, open = false, children, dir, onOpenChange, modal = true } = props;
|
|
const popperScope = usePopperScope(__scopeMenu);
|
|
const [content, setContent] = __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 isUsingKeyboardRef = __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 handleOpenChange = (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"])(onOpenChange);
|
|
const direction = (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$direction$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$direction$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["useDirection"])(dir);
|
|
__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 handleKeyDown = ()=>{
|
|
isUsingKeyboardRef.current = true;
|
|
document.addEventListener("pointerdown", handlePointer, {
|
|
capture: true,
|
|
once: true
|
|
});
|
|
document.addEventListener("pointermove", handlePointer, {
|
|
capture: true,
|
|
once: true
|
|
});
|
|
};
|
|
const handlePointer = ()=>isUsingKeyboardRef.current = false;
|
|
document.addEventListener("keydown", handleKeyDown, {
|
|
capture: true
|
|
});
|
|
return ()=>{
|
|
document.removeEventListener("keydown", handleKeyDown, {
|
|
capture: true
|
|
});
|
|
document.removeEventListener("pointerdown", handlePointer, {
|
|
capture: true
|
|
});
|
|
document.removeEventListener("pointermove", handlePointer, {
|
|
capture: true
|
|
});
|
|
};
|
|
}, []);
|
|
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$popper$40$1$2e$2$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$react$40$_f51937a6043c1687ec731d0ff356eddd$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$popper$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["Root"], {
|
|
...popperScope,
|
|
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"])(MenuProvider, {
|
|
scope: __scopeMenu,
|
|
open,
|
|
onOpenChange: handleOpenChange,
|
|
content,
|
|
onContentChange: setContent,
|
|
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"])(MenuRootProvider, {
|
|
scope: __scopeMenu,
|
|
onClose: __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"](()=>handleOpenChange(false), [
|
|
handleOpenChange
|
|
]),
|
|
isUsingKeyboardRef,
|
|
dir: direction,
|
|
modal,
|
|
children
|
|
})
|
|
})
|
|
});
|
|
};
|
|
Menu.displayName = MENU_NAME;
|
|
var ANCHOR_NAME = "MenuAnchor";
|
|
var MenuAnchor = __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 { __scopeMenu, ...anchorProps } = props;
|
|
const popperScope = usePopperScope(__scopeMenu);
|
|
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$popper$40$1$2e$2$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$react$40$_f51937a6043c1687ec731d0ff356eddd$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$popper$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["Anchor"], {
|
|
...popperScope,
|
|
...anchorProps,
|
|
ref: forwardedRef
|
|
});
|
|
});
|
|
MenuAnchor.displayName = ANCHOR_NAME;
|
|
var PORTAL_NAME = "MenuPortal";
|
|
var [PortalProvider, usePortalContext] = createMenuContext(PORTAL_NAME, {
|
|
forceMount: void 0
|
|
});
|
|
var MenuPortal = (props)=>{
|
|
const { __scopeMenu, forceMount, children, container } = props;
|
|
const context = useMenuContext(PORTAL_NAME, __scopeMenu);
|
|
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"])(PortalProvider, {
|
|
scope: __scopeMenu,
|
|
forceMount,
|
|
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$presence$40$1$2e$1$2e$2_$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$reac_4990595ea432be9a74aea0197efb306c$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$presence$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["Presence"], {
|
|
present: forceMount || context.open,
|
|
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$portal$40$1$2e$1$2e$3_$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$react$40$_046b67df02e5a46cef606421f30d033b$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$portal$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["Portal"], {
|
|
asChild: true,
|
|
container,
|
|
children
|
|
})
|
|
})
|
|
});
|
|
};
|
|
MenuPortal.displayName = PORTAL_NAME;
|
|
var CONTENT_NAME = "MenuContent";
|
|
var [MenuContentProvider, useMenuContentContext] = createMenuContext(CONTENT_NAME);
|
|
var MenuContent = __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 portalContext = usePortalContext(CONTENT_NAME, props.__scopeMenu);
|
|
const { forceMount = portalContext.forceMount, ...contentProps } = props;
|
|
const context = useMenuContext(CONTENT_NAME, props.__scopeMenu);
|
|
const rootContext = useMenuRootContext(CONTENT_NAME, props.__scopeMenu);
|
|
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"])(Collection.Provider, {
|
|
scope: props.__scopeMenu,
|
|
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$presence$40$1$2e$1$2e$2_$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$reac_4990595ea432be9a74aea0197efb306c$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$presence$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["Presence"], {
|
|
present: forceMount || context.open,
|
|
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"])(Collection.Slot, {
|
|
scope: props.__scopeMenu,
|
|
children: rootContext.modal ? /* @__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"])(MenuRootContentModal, {
|
|
...contentProps,
|
|
ref: forwardedRef
|
|
}) : /* @__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"])(MenuRootContentNonModal, {
|
|
...contentProps,
|
|
ref: forwardedRef
|
|
})
|
|
})
|
|
})
|
|
});
|
|
});
|
|
var MenuRootContentModal = __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 context = useMenuContext(CONTENT_NAME, props.__scopeMenu);
|
|
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 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, 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$__["useEffect"](()=>{
|
|
const content = ref.current;
|
|
if (content) return (0, __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$aria$2d$hidden$40$1$2e$2$2e$6$2f$node_modules$2f$aria$2d$hidden$2f$dist$2f$es2015$2f$index$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["hideOthers"])(content);
|
|
}, []);
|
|
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"])(MenuContentImpl, {
|
|
...props,
|
|
ref: composedRefs,
|
|
trapFocus: context.open,
|
|
disableOutsidePointerEvents: context.open,
|
|
disableOutsideScroll: true,
|
|
onFocusOutside: (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.onFocusOutside, (event)=>event.preventDefault(), {
|
|
checkForDefaultPrevented: false
|
|
}),
|
|
onDismiss: ()=>context.onOpenChange(false)
|
|
});
|
|
});
|
|
var MenuRootContentNonModal = __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 context = useMenuContext(CONTENT_NAME, props.__scopeMenu);
|
|
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"])(MenuContentImpl, {
|
|
...props,
|
|
ref: forwardedRef,
|
|
trapFocus: false,
|
|
disableOutsidePointerEvents: false,
|
|
disableOutsideScroll: false,
|
|
onDismiss: ()=>context.onOpenChange(false)
|
|
});
|
|
});
|
|
var MenuContentImpl = __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 { __scopeMenu, loop = false, trapFocus, onOpenAutoFocus, onCloseAutoFocus, disableOutsidePointerEvents, onEntryFocus, onEscapeKeyDown, onPointerDownOutside, onFocusOutside, onInteractOutside, onDismiss, disableOutsideScroll, ...contentProps } = props;
|
|
const context = useMenuContext(CONTENT_NAME, __scopeMenu);
|
|
const rootContext = useMenuRootContext(CONTENT_NAME, __scopeMenu);
|
|
const popperScope = usePopperScope(__scopeMenu);
|
|
const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeMenu);
|
|
const getItems = useCollection(__scopeMenu);
|
|
const [currentItemId, setCurrentItemId] = __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 contentRef = __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 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, contentRef, context.onContentChange);
|
|
const timerRef = __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"](0);
|
|
const searchRef = __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"]("");
|
|
const pointerGraceTimerRef = __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"](0);
|
|
const pointerGraceIntentRef = __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 pointerDirRef = __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"]("right");
|
|
const lastPointerXRef = __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"](0);
|
|
const ScrollLockWrapper = disableOutsideScroll ? __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$react$2d$remove$2d$scroll$40$2$2e$7$2e$1_$40$types$2b$react$40$19$2e$2$2e$6_react$40$19$2e$2$2e$0$2f$node_modules$2f$react$2d$remove$2d$scroll$2f$dist$2f$es2015$2f$Combination$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__$3c$export__default__as__RemoveScroll$3e$__["RemoveScroll"] : __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$__["Fragment"];
|
|
const scrollLockWrapperProps = disableOutsideScroll ? {
|
|
as: __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"],
|
|
allowPinchZoom: true
|
|
} : void 0;
|
|
const handleTypeaheadSearch = (key)=>{
|
|
const search = searchRef.current + key;
|
|
const items = getItems().filter((item)=>!item.disabled);
|
|
const currentItem = document.activeElement;
|
|
const currentMatch = items.find((item)=>item.ref.current === currentItem)?.textValue;
|
|
const values = items.map((item)=>item.textValue);
|
|
const nextMatch = getNextMatch(values, search, currentMatch);
|
|
const newItem = items.find((item)=>item.textValue === nextMatch)?.ref.current;
|
|
(function updateSearch(value) {
|
|
searchRef.current = value;
|
|
window.clearTimeout(timerRef.current);
|
|
if (value !== "") timerRef.current = window.setTimeout(()=>updateSearch(""), 1e3);
|
|
})(search);
|
|
if (newItem) {
|
|
setTimeout(()=>newItem.focus());
|
|
}
|
|
};
|
|
__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"](()=>{
|
|
return ()=>window.clearTimeout(timerRef.current);
|
|
}, []);
|
|
(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$focus$2d$guards$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$focus$2d$guards$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["useFocusGuards"])();
|
|
const isPointerMovingToSubmenu = __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"]((event)=>{
|
|
const isMovingTowards = pointerDirRef.current === pointerGraceIntentRef.current?.side;
|
|
return isMovingTowards && isPointerInGraceArea(event, pointerGraceIntentRef.current?.area);
|
|
}, []);
|
|
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"])(MenuContentProvider, {
|
|
scope: __scopeMenu,
|
|
searchRef,
|
|
onItemEnter: __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"]((event)=>{
|
|
if (isPointerMovingToSubmenu(event)) event.preventDefault();
|
|
}, [
|
|
isPointerMovingToSubmenu
|
|
]),
|
|
onItemLeave: __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"]((event)=>{
|
|
if (isPointerMovingToSubmenu(event)) return;
|
|
contentRef.current?.focus();
|
|
setCurrentItemId(null);
|
|
}, [
|
|
isPointerMovingToSubmenu
|
|
]),
|
|
onTriggerLeave: __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"]((event)=>{
|
|
if (isPointerMovingToSubmenu(event)) event.preventDefault();
|
|
}, [
|
|
isPointerMovingToSubmenu
|
|
]),
|
|
pointerGraceTimerRef,
|
|
onPointerGraceIntentChange: __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"]((intent)=>{
|
|
pointerGraceIntentRef.current = intent;
|
|
}, []),
|
|
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"])(ScrollLockWrapper, {
|
|
...scrollLockWrapperProps,
|
|
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$focus$2d$scope$40$1$2e$1$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$r_d785daf6985fc8350fb3781de275c6b6$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$focus$2d$scope$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["FocusScope"], {
|
|
asChild: true,
|
|
trapped: trapFocus,
|
|
onMountAutoFocus: (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"])(onOpenAutoFocus, (event)=>{
|
|
event.preventDefault();
|
|
contentRef.current?.focus({
|
|
preventScroll: true
|
|
});
|
|
}),
|
|
onUnmountAutoFocus: onCloseAutoFocus,
|
|
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$dismissable$2d$layer$40$1$2e$1$2e$3_$40$types$2b$react$2d$dom$40$19$2e$2$2e$3_$40$types$2b$react$40$19$2e$2$2e$6_$5f40$t_93e149627c30a83695c926d31c853576$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$dismissable$2d$layer$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["DismissableLayer"], {
|
|
asChild: true,
|
|
disableOutsidePointerEvents,
|
|
onEscapeKeyDown,
|
|
onPointerDownOutside,
|
|
onFocusOutside,
|
|
onInteractOutside,
|
|
onDismiss,
|
|
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$roving$2d$focus$40$1$2e$1$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$_a18e46462387af707d972c0ffe7a229b$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$roving$2d$focus$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["Root"], {
|
|
asChild: true,
|
|
...rovingFocusGroupScope,
|
|
dir: rootContext.dir,
|
|
orientation: "vertical",
|
|
loop,
|
|
currentTabStopId: currentItemId,
|
|
onCurrentTabStopIdChange: setCurrentItemId,
|
|
onEntryFocus: (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"])(onEntryFocus, (event)=>{
|
|
if (!rootContext.isUsingKeyboardRef.current) event.preventDefault();
|
|
}),
|
|
preventScrollOnEntryFocus: true,
|
|
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$popper$40$1$2e$2$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$react$40$_f51937a6043c1687ec731d0ff356eddd$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$popper$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["Content"], {
|
|
role: "menu",
|
|
"aria-orientation": "vertical",
|
|
"data-state": getOpenState(context.open),
|
|
"data-radix-menu-content": "",
|
|
dir: rootContext.dir,
|
|
...popperScope,
|
|
...contentProps,
|
|
ref: composedRefs,
|
|
style: {
|
|
outline: "none",
|
|
...contentProps.style
|
|
},
|
|
onKeyDown: (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"])(contentProps.onKeyDown, (event)=>{
|
|
const target = event.target;
|
|
const isKeyDownInside = target.closest("[data-radix-menu-content]") === event.currentTarget;
|
|
const isModifierKey = event.ctrlKey || event.altKey || event.metaKey;
|
|
const isCharacterKey = event.key.length === 1;
|
|
if (isKeyDownInside) {
|
|
if (event.key === "Tab") event.preventDefault();
|
|
if (!isModifierKey && isCharacterKey) handleTypeaheadSearch(event.key);
|
|
}
|
|
const content = contentRef.current;
|
|
if (event.target !== content) return;
|
|
if (!FIRST_LAST_KEYS.includes(event.key)) return;
|
|
event.preventDefault();
|
|
const items = getItems().filter((item)=>!item.disabled);
|
|
const candidateNodes = items.map((item)=>item.ref.current);
|
|
if (LAST_KEYS.includes(event.key)) candidateNodes.reverse();
|
|
focusFirst(candidateNodes);
|
|
}),
|
|
onBlur: (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.onBlur, (event)=>{
|
|
if (!event.currentTarget.contains(event.target)) {
|
|
window.clearTimeout(timerRef.current);
|
|
searchRef.current = "";
|
|
}
|
|
}),
|
|
onPointerMove: (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.onPointerMove, whenMouse((event)=>{
|
|
const target = event.target;
|
|
const pointerXHasChanged = lastPointerXRef.current !== event.clientX;
|
|
if (event.currentTarget.contains(target) && pointerXHasChanged) {
|
|
const newDir = event.clientX > lastPointerXRef.current ? "right" : "left";
|
|
pointerDirRef.current = newDir;
|
|
lastPointerXRef.current = event.clientX;
|
|
}
|
|
}))
|
|
})
|
|
})
|
|
})
|
|
})
|
|
})
|
|
});
|
|
});
|
|
MenuContent.displayName = CONTENT_NAME;
|
|
var GROUP_NAME = "MenuGroup";
|
|
var MenuGroup = __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 { __scopeMenu, ...groupProps } = props;
|
|
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"].div, {
|
|
role: "group",
|
|
...groupProps,
|
|
ref: forwardedRef
|
|
});
|
|
});
|
|
MenuGroup.displayName = GROUP_NAME;
|
|
var LABEL_NAME = "MenuLabel";
|
|
var MenuLabel = __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 { __scopeMenu, ...labelProps } = props;
|
|
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"].div, {
|
|
...labelProps,
|
|
ref: forwardedRef
|
|
});
|
|
});
|
|
MenuLabel.displayName = LABEL_NAME;
|
|
var ITEM_NAME = "MenuItem";
|
|
var ITEM_SELECT = "menu.itemSelect";
|
|
var MenuItem = __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 { disabled = false, onSelect, ...itemProps } = 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 rootContext = useMenuRootContext(ITEM_NAME, props.__scopeMenu);
|
|
const contentContext = useMenuContentContext(ITEM_NAME, props.__scopeMenu);
|
|
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, ref);
|
|
const isPointerDownRef = __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 handleSelect = ()=>{
|
|
const menuItem = ref.current;
|
|
if (!disabled && menuItem) {
|
|
const itemSelectEvent = new CustomEvent(ITEM_SELECT, {
|
|
bubbles: true,
|
|
cancelable: true
|
|
});
|
|
menuItem.addEventListener(ITEM_SELECT, (event)=>onSelect?.(event), {
|
|
once: true
|
|
});
|
|
(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$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$__["dispatchDiscreteCustomEvent"])(menuItem, itemSelectEvent);
|
|
if (itemSelectEvent.defaultPrevented) {
|
|
isPointerDownRef.current = false;
|
|
} else {
|
|
rootContext.onClose();
|
|
}
|
|
}
|
|
};
|
|
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"])(MenuItemImpl, {
|
|
...itemProps,
|
|
ref: composedRefs,
|
|
disabled,
|
|
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, handleSelect),
|
|
onPointerDown: (event)=>{
|
|
props.onPointerDown?.(event);
|
|
isPointerDownRef.current = true;
|
|
},
|
|
onPointerUp: (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.onPointerUp, (event)=>{
|
|
if (!isPointerDownRef.current) event.currentTarget?.click();
|
|
}),
|
|
onKeyDown: (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.onKeyDown, (event)=>{
|
|
const isTypingAhead = contentContext.searchRef.current !== "";
|
|
if (disabled || isTypingAhead && event.key === " ") return;
|
|
if (SELECTION_KEYS.includes(event.key)) {
|
|
event.currentTarget.click();
|
|
event.preventDefault();
|
|
}
|
|
})
|
|
});
|
|
});
|
|
MenuItem.displayName = ITEM_NAME;
|
|
var MenuItemImpl = __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 { __scopeMenu, disabled = false, textValue, ...itemProps } = props;
|
|
const contentContext = useMenuContentContext(ITEM_NAME, __scopeMenu);
|
|
const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeMenu);
|
|
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 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, ref);
|
|
const [isFocused, setIsFocused] = __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"](false);
|
|
const [textContent, setTextContent] = __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"]("");
|
|
__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 menuItem = ref.current;
|
|
if (menuItem) {
|
|
setTextContent((menuItem.textContent ?? "").trim());
|
|
}
|
|
}, [
|
|
itemProps.children
|
|
]);
|
|
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"])(Collection.ItemSlot, {
|
|
scope: __scopeMenu,
|
|
disabled,
|
|
textValue: textValue ?? textContent,
|
|
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$roving$2d$focus$40$1$2e$1$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$_a18e46462387af707d972c0ffe7a229b$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$roving$2d$focus$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["Item"], {
|
|
asChild: true,
|
|
...rovingFocusGroupScope,
|
|
focusable: !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"].div, {
|
|
role: "menuitem",
|
|
"data-highlighted": isFocused ? "" : void 0,
|
|
"aria-disabled": disabled || void 0,
|
|
"data-disabled": disabled ? "" : void 0,
|
|
...itemProps,
|
|
ref: composedRefs,
|
|
onPointerMove: (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.onPointerMove, whenMouse((event)=>{
|
|
if (disabled) {
|
|
contentContext.onItemLeave(event);
|
|
} else {
|
|
contentContext.onItemEnter(event);
|
|
if (!event.defaultPrevented) {
|
|
const item = event.currentTarget;
|
|
item.focus({
|
|
preventScroll: true
|
|
});
|
|
}
|
|
}
|
|
})),
|
|
onPointerLeave: (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.onPointerLeave, whenMouse((event)=>contentContext.onItemLeave(event))),
|
|
onFocus: (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.onFocus, ()=>setIsFocused(true)),
|
|
onBlur: (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.onBlur, ()=>setIsFocused(false))
|
|
})
|
|
})
|
|
});
|
|
});
|
|
var CHECKBOX_ITEM_NAME = "MenuCheckboxItem";
|
|
var MenuCheckboxItem = __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 { checked = false, onCheckedChange, ...checkboxItemProps } = props;
|
|
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"])(ItemIndicatorProvider, {
|
|
scope: props.__scopeMenu,
|
|
checked,
|
|
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"])(MenuItem, {
|
|
role: "menuitemcheckbox",
|
|
"aria-checked": isIndeterminate(checked) ? "mixed" : checked,
|
|
...checkboxItemProps,
|
|
ref: forwardedRef,
|
|
"data-state": getCheckedState(checked),
|
|
onSelect: (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"])(checkboxItemProps.onSelect, ()=>onCheckedChange?.(isIndeterminate(checked) ? true : !checked), {
|
|
checkForDefaultPrevented: false
|
|
})
|
|
})
|
|
});
|
|
});
|
|
MenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME;
|
|
var RADIO_GROUP_NAME = "MenuRadioGroup";
|
|
var [RadioGroupProvider, useRadioGroupContext] = createMenuContext(RADIO_GROUP_NAME, {
|
|
value: void 0,
|
|
onValueChange: ()=>{}
|
|
});
|
|
var MenuRadioGroup = __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 { value, onValueChange, ...groupProps } = props;
|
|
const handleValueChange = (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"])(onValueChange);
|
|
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"])(RadioGroupProvider, {
|
|
scope: props.__scopeMenu,
|
|
value,
|
|
onValueChange: handleValueChange,
|
|
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"])(MenuGroup, {
|
|
...groupProps,
|
|
ref: forwardedRef
|
|
})
|
|
});
|
|
});
|
|
MenuRadioGroup.displayName = RADIO_GROUP_NAME;
|
|
var RADIO_ITEM_NAME = "MenuRadioItem";
|
|
var MenuRadioItem = __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 { value, ...radioItemProps } = props;
|
|
const context = useRadioGroupContext(RADIO_ITEM_NAME, props.__scopeMenu);
|
|
const checked = value === context.value;
|
|
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"])(ItemIndicatorProvider, {
|
|
scope: props.__scopeMenu,
|
|
checked,
|
|
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"])(MenuItem, {
|
|
role: "menuitemradio",
|
|
"aria-checked": checked,
|
|
...radioItemProps,
|
|
ref: forwardedRef,
|
|
"data-state": getCheckedState(checked),
|
|
onSelect: (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"])(radioItemProps.onSelect, ()=>context.onValueChange?.(value), {
|
|
checkForDefaultPrevented: false
|
|
})
|
|
})
|
|
});
|
|
});
|
|
MenuRadioItem.displayName = RADIO_ITEM_NAME;
|
|
var ITEM_INDICATOR_NAME = "MenuItemIndicator";
|
|
var [ItemIndicatorProvider, useItemIndicatorContext] = createMenuContext(ITEM_INDICATOR_NAME, {
|
|
checked: false
|
|
});
|
|
var MenuItemIndicator = __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 { __scopeMenu, forceMount, ...itemIndicatorProps } = props;
|
|
const indicatorContext = useItemIndicatorContext(ITEM_INDICATOR_NAME, __scopeMenu);
|
|
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$presence$40$1$2e$1$2e$2_$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$reac_4990595ea432be9a74aea0197efb306c$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$presence$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["Presence"], {
|
|
present: forceMount || isIndeterminate(indicatorContext.checked) || indicatorContext.checked === true,
|
|
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, {
|
|
...itemIndicatorProps,
|
|
ref: forwardedRef,
|
|
"data-state": getCheckedState(indicatorContext.checked)
|
|
})
|
|
});
|
|
});
|
|
MenuItemIndicator.displayName = ITEM_INDICATOR_NAME;
|
|
var SEPARATOR_NAME = "MenuSeparator";
|
|
var MenuSeparator = __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 { __scopeMenu, ...separatorProps } = props;
|
|
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"].div, {
|
|
role: "separator",
|
|
"aria-orientation": "horizontal",
|
|
...separatorProps,
|
|
ref: forwardedRef
|
|
});
|
|
});
|
|
MenuSeparator.displayName = SEPARATOR_NAME;
|
|
var ARROW_NAME = "MenuArrow";
|
|
var MenuArrow = __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 { __scopeMenu, ...arrowProps } = props;
|
|
const popperScope = usePopperScope(__scopeMenu);
|
|
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$popper$40$1$2e$2$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$react$40$_f51937a6043c1687ec731d0ff356eddd$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$popper$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["Arrow"], {
|
|
...popperScope,
|
|
...arrowProps,
|
|
ref: forwardedRef
|
|
});
|
|
});
|
|
MenuArrow.displayName = ARROW_NAME;
|
|
var SUB_NAME = "MenuSub";
|
|
var [MenuSubProvider, useMenuSubContext] = createMenuContext(SUB_NAME);
|
|
var MenuSub = (props)=>{
|
|
const { __scopeMenu, children, open = false, onOpenChange } = props;
|
|
const parentMenuContext = useMenuContext(SUB_NAME, __scopeMenu);
|
|
const popperScope = usePopperScope(__scopeMenu);
|
|
const [trigger, setTrigger] = __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 [content, setContent] = __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 handleOpenChange = (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"])(onOpenChange);
|
|
__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 (parentMenuContext.open === false) handleOpenChange(false);
|
|
return ()=>handleOpenChange(false);
|
|
}, [
|
|
parentMenuContext.open,
|
|
handleOpenChange
|
|
]);
|
|
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$popper$40$1$2e$2$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$react$40$_f51937a6043c1687ec731d0ff356eddd$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$popper$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["Root"], {
|
|
...popperScope,
|
|
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"])(MenuProvider, {
|
|
scope: __scopeMenu,
|
|
open,
|
|
onOpenChange: handleOpenChange,
|
|
content,
|
|
onContentChange: setContent,
|
|
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"])(MenuSubProvider, {
|
|
scope: __scopeMenu,
|
|
contentId: (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$id$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$id$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["useId"])(),
|
|
triggerId: (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$id$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$id$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["useId"])(),
|
|
trigger,
|
|
onTriggerChange: setTrigger,
|
|
children
|
|
})
|
|
})
|
|
});
|
|
};
|
|
MenuSub.displayName = SUB_NAME;
|
|
var SUB_TRIGGER_NAME = "MenuSubTrigger";
|
|
var MenuSubTrigger = __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 context = useMenuContext(SUB_TRIGGER_NAME, props.__scopeMenu);
|
|
const rootContext = useMenuRootContext(SUB_TRIGGER_NAME, props.__scopeMenu);
|
|
const subContext = useMenuSubContext(SUB_TRIGGER_NAME, props.__scopeMenu);
|
|
const contentContext = useMenuContentContext(SUB_TRIGGER_NAME, props.__scopeMenu);
|
|
const openTimerRef = __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 { pointerGraceTimerRef, onPointerGraceIntentChange } = contentContext;
|
|
const scope = {
|
|
__scopeMenu: props.__scopeMenu
|
|
};
|
|
const clearOpenTimer = __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"](()=>{
|
|
if (openTimerRef.current) window.clearTimeout(openTimerRef.current);
|
|
openTimerRef.current = null;
|
|
}, []);
|
|
__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"](()=>clearOpenTimer, [
|
|
clearOpenTimer
|
|
]);
|
|
__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 pointerGraceTimer = pointerGraceTimerRef.current;
|
|
return ()=>{
|
|
window.clearTimeout(pointerGraceTimer);
|
|
onPointerGraceIntentChange(null);
|
|
};
|
|
}, [
|
|
pointerGraceTimerRef,
|
|
onPointerGraceIntentChange
|
|
]);
|
|
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"])(MenuAnchor, {
|
|
asChild: true,
|
|
...scope,
|
|
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"])(MenuItemImpl, {
|
|
id: subContext.triggerId,
|
|
"aria-haspopup": "menu",
|
|
"aria-expanded": context.open,
|
|
"aria-controls": subContext.contentId,
|
|
"data-state": getOpenState(context.open),
|
|
...props,
|
|
ref: (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$__["composeRefs"])(forwardedRef, subContext.onTriggerChange),
|
|
onClick: (event)=>{
|
|
props.onClick?.(event);
|
|
if (props.disabled || event.defaultPrevented) return;
|
|
event.currentTarget.focus();
|
|
if (!context.open) context.onOpenChange(true);
|
|
},
|
|
onPointerMove: (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.onPointerMove, whenMouse((event)=>{
|
|
contentContext.onItemEnter(event);
|
|
if (event.defaultPrevented) return;
|
|
if (!props.disabled && !context.open && !openTimerRef.current) {
|
|
contentContext.onPointerGraceIntentChange(null);
|
|
openTimerRef.current = window.setTimeout(()=>{
|
|
context.onOpenChange(true);
|
|
clearOpenTimer();
|
|
}, 100);
|
|
}
|
|
})),
|
|
onPointerLeave: (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.onPointerLeave, whenMouse((event)=>{
|
|
clearOpenTimer();
|
|
const contentRect = context.content?.getBoundingClientRect();
|
|
if (contentRect) {
|
|
const side = context.content?.dataset.side;
|
|
const rightSide = side === "right";
|
|
const bleed = rightSide ? -5 : 5;
|
|
const contentNearEdge = contentRect[rightSide ? "left" : "right"];
|
|
const contentFarEdge = contentRect[rightSide ? "right" : "left"];
|
|
contentContext.onPointerGraceIntentChange({
|
|
area: [
|
|
// Apply a bleed on clientX to ensure that our exit point is
|
|
// consistently within polygon bounds
|
|
{
|
|
x: event.clientX + bleed,
|
|
y: event.clientY
|
|
},
|
|
{
|
|
x: contentNearEdge,
|
|
y: contentRect.top
|
|
},
|
|
{
|
|
x: contentFarEdge,
|
|
y: contentRect.top
|
|
},
|
|
{
|
|
x: contentFarEdge,
|
|
y: contentRect.bottom
|
|
},
|
|
{
|
|
x: contentNearEdge,
|
|
y: contentRect.bottom
|
|
}
|
|
],
|
|
side
|
|
});
|
|
window.clearTimeout(pointerGraceTimerRef.current);
|
|
pointerGraceTimerRef.current = window.setTimeout(()=>contentContext.onPointerGraceIntentChange(null), 300);
|
|
} else {
|
|
contentContext.onTriggerLeave(event);
|
|
if (event.defaultPrevented) return;
|
|
contentContext.onPointerGraceIntentChange(null);
|
|
}
|
|
})),
|
|
onKeyDown: (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.onKeyDown, (event)=>{
|
|
const isTypingAhead = contentContext.searchRef.current !== "";
|
|
if (props.disabled || isTypingAhead && event.key === " ") return;
|
|
if (SUB_OPEN_KEYS[rootContext.dir].includes(event.key)) {
|
|
context.onOpenChange(true);
|
|
context.content?.focus();
|
|
event.preventDefault();
|
|
}
|
|
})
|
|
})
|
|
});
|
|
});
|
|
MenuSubTrigger.displayName = SUB_TRIGGER_NAME;
|
|
var SUB_CONTENT_NAME = "MenuSubContent";
|
|
var MenuSubContent = __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 portalContext = usePortalContext(CONTENT_NAME, props.__scopeMenu);
|
|
const { forceMount = portalContext.forceMount, ...subContentProps } = props;
|
|
const context = useMenuContext(CONTENT_NAME, props.__scopeMenu);
|
|
const rootContext = useMenuRootContext(CONTENT_NAME, props.__scopeMenu);
|
|
const subContext = useMenuSubContext(SUB_CONTENT_NAME, props.__scopeMenu);
|
|
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 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, ref);
|
|
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"])(Collection.Provider, {
|
|
scope: props.__scopeMenu,
|
|
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$presence$40$1$2e$1$2e$2_$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$reac_4990595ea432be9a74aea0197efb306c$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$presence$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["Presence"], {
|
|
present: forceMount || context.open,
|
|
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"])(Collection.Slot, {
|
|
scope: props.__scopeMenu,
|
|
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"])(MenuContentImpl, {
|
|
id: subContext.contentId,
|
|
"aria-labelledby": subContext.triggerId,
|
|
...subContentProps,
|
|
ref: composedRefs,
|
|
align: "start",
|
|
side: rootContext.dir === "rtl" ? "left" : "right",
|
|
disableOutsidePointerEvents: false,
|
|
disableOutsideScroll: false,
|
|
trapFocus: false,
|
|
onOpenAutoFocus: (event)=>{
|
|
if (rootContext.isUsingKeyboardRef.current) ref.current?.focus();
|
|
event.preventDefault();
|
|
},
|
|
onCloseAutoFocus: (event)=>event.preventDefault(),
|
|
onFocusOutside: (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.onFocusOutside, (event)=>{
|
|
if (event.target !== subContext.trigger) context.onOpenChange(false);
|
|
}),
|
|
onEscapeKeyDown: (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.onEscapeKeyDown, (event)=>{
|
|
rootContext.onClose();
|
|
event.preventDefault();
|
|
}),
|
|
onKeyDown: (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.onKeyDown, (event)=>{
|
|
const isKeyDownInside = event.currentTarget.contains(event.target);
|
|
const isCloseKey = SUB_CLOSE_KEYS[rootContext.dir].includes(event.key);
|
|
if (isKeyDownInside && isCloseKey) {
|
|
context.onOpenChange(false);
|
|
subContext.trigger?.focus();
|
|
event.preventDefault();
|
|
}
|
|
})
|
|
})
|
|
})
|
|
})
|
|
});
|
|
});
|
|
MenuSubContent.displayName = SUB_CONTENT_NAME;
|
|
function getOpenState(open) {
|
|
return open ? "open" : "closed";
|
|
}
|
|
function isIndeterminate(checked) {
|
|
return checked === "indeterminate";
|
|
}
|
|
function getCheckedState(checked) {
|
|
return isIndeterminate(checked) ? "indeterminate" : checked ? "checked" : "unchecked";
|
|
}
|
|
function focusFirst(candidates) {
|
|
const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;
|
|
for (const candidate of candidates){
|
|
if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;
|
|
candidate.focus();
|
|
if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;
|
|
}
|
|
}
|
|
function wrapArray(array, startIndex) {
|
|
return array.map((_, index)=>array[(startIndex + index) % array.length]);
|
|
}
|
|
function getNextMatch(values, search, currentMatch) {
|
|
const isRepeated = search.length > 1 && Array.from(search).every((char)=>char === search[0]);
|
|
const normalizedSearch = isRepeated ? search[0] : search;
|
|
const currentMatchIndex = currentMatch ? values.indexOf(currentMatch) : -1;
|
|
let wrappedValues = wrapArray(values, Math.max(currentMatchIndex, 0));
|
|
const excludeCurrentMatch = normalizedSearch.length === 1;
|
|
if (excludeCurrentMatch) wrappedValues = wrappedValues.filter((v)=>v !== currentMatch);
|
|
const nextMatch = wrappedValues.find((value)=>value.toLowerCase().startsWith(normalizedSearch.toLowerCase()));
|
|
return nextMatch !== currentMatch ? nextMatch : void 0;
|
|
}
|
|
function isPointInPolygon(point, polygon) {
|
|
const { x, y } = point;
|
|
let inside = false;
|
|
for(let i = 0, j = polygon.length - 1; i < polygon.length; j = i++){
|
|
const xi = polygon[i].x;
|
|
const yi = polygon[i].y;
|
|
const xj = polygon[j].x;
|
|
const yj = polygon[j].y;
|
|
const intersect = yi > y !== yj > y && x < (xj - xi) * (y - yi) / (yj - yi) + xi;
|
|
if (intersect) inside = !inside;
|
|
}
|
|
return inside;
|
|
}
|
|
function isPointerInGraceArea(event, area) {
|
|
if (!area) return false;
|
|
const cursorPos = {
|
|
x: event.clientX,
|
|
y: event.clientY
|
|
};
|
|
return isPointInPolygon(cursorPos, area);
|
|
}
|
|
function whenMouse(handler) {
|
|
return (event)=>event.pointerType === "mouse" ? handler(event) : void 0;
|
|
}
|
|
var Root3 = Menu;
|
|
var Anchor2 = MenuAnchor;
|
|
var Portal = MenuPortal;
|
|
var Content2 = MenuContent;
|
|
var Group = MenuGroup;
|
|
var Label = MenuLabel;
|
|
var Item2 = MenuItem;
|
|
var CheckboxItem = MenuCheckboxItem;
|
|
var RadioGroup = MenuRadioGroup;
|
|
var RadioItem = MenuRadioItem;
|
|
var ItemIndicator = MenuItemIndicator;
|
|
var Separator = MenuSeparator;
|
|
var Arrow2 = MenuArrow;
|
|
var Sub = MenuSub;
|
|
var SubTrigger = MenuSubTrigger;
|
|
var SubContent = MenuSubContent;
|
|
;
|
|
//# sourceMappingURL=index.mjs.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/@radix-ui+react-dropdown-menu@2.1.4_@types+react-dom@19.2.3_@types+react@19.2.6__@types_aefad4ac5851d46557f75f368796c888/node_modules/@radix-ui/react-dropdown-menu/dist/index.mjs [app-ssr] (ecmascript)", ((__turbopack_context__) => {
|
|
"use strict";
|
|
|
|
__turbopack_context__.s([
|
|
"Arrow",
|
|
()=>Arrow2,
|
|
"CheckboxItem",
|
|
()=>CheckboxItem2,
|
|
"Content",
|
|
()=>Content2,
|
|
"DropdownMenu",
|
|
()=>DropdownMenu,
|
|
"DropdownMenuArrow",
|
|
()=>DropdownMenuArrow,
|
|
"DropdownMenuCheckboxItem",
|
|
()=>DropdownMenuCheckboxItem,
|
|
"DropdownMenuContent",
|
|
()=>DropdownMenuContent,
|
|
"DropdownMenuGroup",
|
|
()=>DropdownMenuGroup,
|
|
"DropdownMenuItem",
|
|
()=>DropdownMenuItem,
|
|
"DropdownMenuItemIndicator",
|
|
()=>DropdownMenuItemIndicator,
|
|
"DropdownMenuLabel",
|
|
()=>DropdownMenuLabel,
|
|
"DropdownMenuPortal",
|
|
()=>DropdownMenuPortal,
|
|
"DropdownMenuRadioGroup",
|
|
()=>DropdownMenuRadioGroup,
|
|
"DropdownMenuRadioItem",
|
|
()=>DropdownMenuRadioItem,
|
|
"DropdownMenuSeparator",
|
|
()=>DropdownMenuSeparator,
|
|
"DropdownMenuSub",
|
|
()=>DropdownMenuSub,
|
|
"DropdownMenuSubContent",
|
|
()=>DropdownMenuSubContent,
|
|
"DropdownMenuSubTrigger",
|
|
()=>DropdownMenuSubTrigger,
|
|
"DropdownMenuTrigger",
|
|
()=>DropdownMenuTrigger,
|
|
"Group",
|
|
()=>Group2,
|
|
"Item",
|
|
()=>Item2,
|
|
"ItemIndicator",
|
|
()=>ItemIndicator2,
|
|
"Label",
|
|
()=>Label2,
|
|
"Portal",
|
|
()=>Portal2,
|
|
"RadioGroup",
|
|
()=>RadioGroup2,
|
|
"RadioItem",
|
|
()=>RadioItem2,
|
|
"Root",
|
|
()=>Root2,
|
|
"Separator",
|
|
()=>Separator2,
|
|
"Sub",
|
|
()=>Sub2,
|
|
"SubContent",
|
|
()=>SubContent2,
|
|
"SubTrigger",
|
|
()=>SubTrigger2,
|
|
"Trigger",
|
|
()=>Trigger,
|
|
"createDropdownMenuScope",
|
|
()=>createDropdownMenuScope
|
|
]);
|
|
// packages/react/dropdown-menu/src/DropdownMenu.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$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$2f40$radix$2d$ui$2b$react$2d$menu$40$2$2e$1$2e$4_$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$react$40$19_0d4b96092e17d5c8c1f962859072e800$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$menu$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-menu@2.1.4_@types+react-dom@19.2.3_@types+react@19.2.6__@types+react@19_0d4b96092e17d5c8c1f962859072e800/node_modules/@radix-ui/react-menu/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$id$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$id$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-id@1.1.0_@types+react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-id/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 DROPDOWN_MENU_NAME = "DropdownMenu";
|
|
var [createDropdownMenuContext, createDropdownMenuScope] = (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"])(DROPDOWN_MENU_NAME, [
|
|
__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$menu$40$2$2e$1$2e$4_$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$react$40$19_0d4b96092e17d5c8c1f962859072e800$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$menu$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["createMenuScope"]
|
|
]);
|
|
var useMenuScope = (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$menu$40$2$2e$1$2e$4_$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$react$40$19_0d4b96092e17d5c8c1f962859072e800$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$menu$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["createMenuScope"])();
|
|
var [DropdownMenuProvider, useDropdownMenuContext] = createDropdownMenuContext(DROPDOWN_MENU_NAME);
|
|
var DropdownMenu = (props)=>{
|
|
const { __scopeDropdownMenu, children, dir, open: openProp, defaultOpen, onOpenChange, modal = true } = props;
|
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
const triggerRef = __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 [open = false, setOpen] = (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: openProp,
|
|
defaultProp: defaultOpen,
|
|
onChange: onOpenChange
|
|
});
|
|
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"])(DropdownMenuProvider, {
|
|
scope: __scopeDropdownMenu,
|
|
triggerId: (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$id$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$id$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["useId"])(),
|
|
triggerRef,
|
|
contentId: (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$id$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$id$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["useId"])(),
|
|
open,
|
|
onOpenChange: setOpen,
|
|
onOpenToggle: __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"](()=>setOpen((prevOpen)=>!prevOpen), [
|
|
setOpen
|
|
]),
|
|
modal,
|
|
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$menu$40$2$2e$1$2e$4_$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$react$40$19_0d4b96092e17d5c8c1f962859072e800$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$menu$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["Root"], {
|
|
...menuScope,
|
|
open,
|
|
onOpenChange: setOpen,
|
|
dir,
|
|
modal,
|
|
children
|
|
})
|
|
});
|
|
};
|
|
DropdownMenu.displayName = DROPDOWN_MENU_NAME;
|
|
var TRIGGER_NAME = "DropdownMenuTrigger";
|
|
var DropdownMenuTrigger = __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 { __scopeDropdownMenu, disabled = false, ...triggerProps } = props;
|
|
const context = useDropdownMenuContext(TRIGGER_NAME, __scopeDropdownMenu);
|
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
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$menu$40$2$2e$1$2e$4_$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$react$40$19_0d4b96092e17d5c8c1f962859072e800$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$menu$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["Anchor"], {
|
|
asChild: true,
|
|
...menuScope,
|
|
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",
|
|
id: context.triggerId,
|
|
"aria-haspopup": "menu",
|
|
"aria-expanded": context.open,
|
|
"aria-controls": context.open ? context.contentId : void 0,
|
|
"data-state": context.open ? "open" : "closed",
|
|
"data-disabled": disabled ? "" : void 0,
|
|
disabled,
|
|
...triggerProps,
|
|
ref: (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$__["composeRefs"])(forwardedRef, context.triggerRef),
|
|
onPointerDown: (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.onPointerDown, (event)=>{
|
|
if (!disabled && event.button === 0 && event.ctrlKey === false) {
|
|
context.onOpenToggle();
|
|
if (!context.open) event.preventDefault();
|
|
}
|
|
}),
|
|
onKeyDown: (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.onKeyDown, (event)=>{
|
|
if (disabled) return;
|
|
if ([
|
|
"Enter",
|
|
" "
|
|
].includes(event.key)) context.onOpenToggle();
|
|
if (event.key === "ArrowDown") context.onOpenChange(true);
|
|
if ([
|
|
"Enter",
|
|
" ",
|
|
"ArrowDown"
|
|
].includes(event.key)) event.preventDefault();
|
|
})
|
|
})
|
|
});
|
|
});
|
|
DropdownMenuTrigger.displayName = TRIGGER_NAME;
|
|
var PORTAL_NAME = "DropdownMenuPortal";
|
|
var DropdownMenuPortal = (props)=>{
|
|
const { __scopeDropdownMenu, ...portalProps } = props;
|
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
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$menu$40$2$2e$1$2e$4_$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$react$40$19_0d4b96092e17d5c8c1f962859072e800$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$menu$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["Portal"], {
|
|
...menuScope,
|
|
...portalProps
|
|
});
|
|
};
|
|
DropdownMenuPortal.displayName = PORTAL_NAME;
|
|
var CONTENT_NAME = "DropdownMenuContent";
|
|
var DropdownMenuContent = __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 { __scopeDropdownMenu, ...contentProps } = props;
|
|
const context = useDropdownMenuContext(CONTENT_NAME, __scopeDropdownMenu);
|
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
const hasInteractedOutsideRef = __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);
|
|
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$menu$40$2$2e$1$2e$4_$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$react$40$19_0d4b96092e17d5c8c1f962859072e800$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$menu$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["Content"], {
|
|
id: context.contentId,
|
|
"aria-labelledby": context.triggerId,
|
|
...menuScope,
|
|
...contentProps,
|
|
ref: forwardedRef,
|
|
onCloseAutoFocus: (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.onCloseAutoFocus, (event)=>{
|
|
if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();
|
|
hasInteractedOutsideRef.current = false;
|
|
event.preventDefault();
|
|
}),
|
|
onInteractOutside: (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.onInteractOutside, (event)=>{
|
|
const originalEvent = event.detail.originalEvent;
|
|
const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
|
|
const isRightClick = originalEvent.button === 2 || ctrlLeftClick;
|
|
if (!context.modal || isRightClick) hasInteractedOutsideRef.current = true;
|
|
}),
|
|
style: {
|
|
...props.style,
|
|
// re-namespace exposed content custom properties
|
|
...{
|
|
"--radix-dropdown-menu-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
"--radix-dropdown-menu-content-available-width": "var(--radix-popper-available-width)",
|
|
"--radix-dropdown-menu-content-available-height": "var(--radix-popper-available-height)",
|
|
"--radix-dropdown-menu-trigger-width": "var(--radix-popper-anchor-width)",
|
|
"--radix-dropdown-menu-trigger-height": "var(--radix-popper-anchor-height)"
|
|
}
|
|
}
|
|
});
|
|
});
|
|
DropdownMenuContent.displayName = CONTENT_NAME;
|
|
var GROUP_NAME = "DropdownMenuGroup";
|
|
var DropdownMenuGroup = __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 { __scopeDropdownMenu, ...groupProps } = props;
|
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
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$menu$40$2$2e$1$2e$4_$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$react$40$19_0d4b96092e17d5c8c1f962859072e800$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$menu$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["Group"], {
|
|
...menuScope,
|
|
...groupProps,
|
|
ref: forwardedRef
|
|
});
|
|
});
|
|
DropdownMenuGroup.displayName = GROUP_NAME;
|
|
var LABEL_NAME = "DropdownMenuLabel";
|
|
var DropdownMenuLabel = __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 { __scopeDropdownMenu, ...labelProps } = props;
|
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
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$menu$40$2$2e$1$2e$4_$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$react$40$19_0d4b96092e17d5c8c1f962859072e800$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$menu$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["Label"], {
|
|
...menuScope,
|
|
...labelProps,
|
|
ref: forwardedRef
|
|
});
|
|
});
|
|
DropdownMenuLabel.displayName = LABEL_NAME;
|
|
var ITEM_NAME = "DropdownMenuItem";
|
|
var DropdownMenuItem = __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 { __scopeDropdownMenu, ...itemProps } = props;
|
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
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$menu$40$2$2e$1$2e$4_$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$react$40$19_0d4b96092e17d5c8c1f962859072e800$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$menu$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["Item"], {
|
|
...menuScope,
|
|
...itemProps,
|
|
ref: forwardedRef
|
|
});
|
|
});
|
|
DropdownMenuItem.displayName = ITEM_NAME;
|
|
var CHECKBOX_ITEM_NAME = "DropdownMenuCheckboxItem";
|
|
var DropdownMenuCheckboxItem = __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 { __scopeDropdownMenu, ...checkboxItemProps } = props;
|
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
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$menu$40$2$2e$1$2e$4_$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$react$40$19_0d4b96092e17d5c8c1f962859072e800$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$menu$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["CheckboxItem"], {
|
|
...menuScope,
|
|
...checkboxItemProps,
|
|
ref: forwardedRef
|
|
});
|
|
});
|
|
DropdownMenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME;
|
|
var RADIO_GROUP_NAME = "DropdownMenuRadioGroup";
|
|
var DropdownMenuRadioGroup = __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 { __scopeDropdownMenu, ...radioGroupProps } = props;
|
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
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$menu$40$2$2e$1$2e$4_$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$react$40$19_0d4b96092e17d5c8c1f962859072e800$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$menu$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["RadioGroup"], {
|
|
...menuScope,
|
|
...radioGroupProps,
|
|
ref: forwardedRef
|
|
});
|
|
});
|
|
DropdownMenuRadioGroup.displayName = RADIO_GROUP_NAME;
|
|
var RADIO_ITEM_NAME = "DropdownMenuRadioItem";
|
|
var DropdownMenuRadioItem = __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 { __scopeDropdownMenu, ...radioItemProps } = props;
|
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
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$menu$40$2$2e$1$2e$4_$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$react$40$19_0d4b96092e17d5c8c1f962859072e800$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$menu$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["RadioItem"], {
|
|
...menuScope,
|
|
...radioItemProps,
|
|
ref: forwardedRef
|
|
});
|
|
});
|
|
DropdownMenuRadioItem.displayName = RADIO_ITEM_NAME;
|
|
var INDICATOR_NAME = "DropdownMenuItemIndicator";
|
|
var DropdownMenuItemIndicator = __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 { __scopeDropdownMenu, ...itemIndicatorProps } = props;
|
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
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$menu$40$2$2e$1$2e$4_$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$react$40$19_0d4b96092e17d5c8c1f962859072e800$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$menu$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["ItemIndicator"], {
|
|
...menuScope,
|
|
...itemIndicatorProps,
|
|
ref: forwardedRef
|
|
});
|
|
});
|
|
DropdownMenuItemIndicator.displayName = INDICATOR_NAME;
|
|
var SEPARATOR_NAME = "DropdownMenuSeparator";
|
|
var DropdownMenuSeparator = __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 { __scopeDropdownMenu, ...separatorProps } = props;
|
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
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$menu$40$2$2e$1$2e$4_$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$react$40$19_0d4b96092e17d5c8c1f962859072e800$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$menu$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["Separator"], {
|
|
...menuScope,
|
|
...separatorProps,
|
|
ref: forwardedRef
|
|
});
|
|
});
|
|
DropdownMenuSeparator.displayName = SEPARATOR_NAME;
|
|
var ARROW_NAME = "DropdownMenuArrow";
|
|
var DropdownMenuArrow = __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 { __scopeDropdownMenu, ...arrowProps } = props;
|
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
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$menu$40$2$2e$1$2e$4_$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$react$40$19_0d4b96092e17d5c8c1f962859072e800$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$menu$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["Arrow"], {
|
|
...menuScope,
|
|
...arrowProps,
|
|
ref: forwardedRef
|
|
});
|
|
});
|
|
DropdownMenuArrow.displayName = ARROW_NAME;
|
|
var DropdownMenuSub = (props)=>{
|
|
const { __scopeDropdownMenu, children, open: openProp, onOpenChange, defaultOpen } = props;
|
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
const [open = false, setOpen] = (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: openProp,
|
|
defaultProp: defaultOpen,
|
|
onChange: onOpenChange
|
|
});
|
|
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$menu$40$2$2e$1$2e$4_$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$react$40$19_0d4b96092e17d5c8c1f962859072e800$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$menu$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["Sub"], {
|
|
...menuScope,
|
|
open,
|
|
onOpenChange: setOpen,
|
|
children
|
|
});
|
|
};
|
|
var SUB_TRIGGER_NAME = "DropdownMenuSubTrigger";
|
|
var DropdownMenuSubTrigger = __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 { __scopeDropdownMenu, ...subTriggerProps } = props;
|
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
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$menu$40$2$2e$1$2e$4_$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$react$40$19_0d4b96092e17d5c8c1f962859072e800$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$menu$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["SubTrigger"], {
|
|
...menuScope,
|
|
...subTriggerProps,
|
|
ref: forwardedRef
|
|
});
|
|
});
|
|
DropdownMenuSubTrigger.displayName = SUB_TRIGGER_NAME;
|
|
var SUB_CONTENT_NAME = "DropdownMenuSubContent";
|
|
var DropdownMenuSubContent = __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 { __scopeDropdownMenu, ...subContentProps } = props;
|
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
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$menu$40$2$2e$1$2e$4_$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$react$40$19_0d4b96092e17d5c8c1f962859072e800$2f$node_modules$2f40$radix$2d$ui$2f$react$2d$menu$2f$dist$2f$index$2e$mjs__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["SubContent"], {
|
|
...menuScope,
|
|
...subContentProps,
|
|
ref: forwardedRef,
|
|
style: {
|
|
...props.style,
|
|
// re-namespace exposed content custom properties
|
|
...{
|
|
"--radix-dropdown-menu-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
"--radix-dropdown-menu-content-available-width": "var(--radix-popper-available-width)",
|
|
"--radix-dropdown-menu-content-available-height": "var(--radix-popper-available-height)",
|
|
"--radix-dropdown-menu-trigger-width": "var(--radix-popper-anchor-width)",
|
|
"--radix-dropdown-menu-trigger-height": "var(--radix-popper-anchor-height)"
|
|
}
|
|
}
|
|
});
|
|
});
|
|
DropdownMenuSubContent.displayName = SUB_CONTENT_NAME;
|
|
var Root2 = DropdownMenu;
|
|
var Trigger = DropdownMenuTrigger;
|
|
var Portal2 = DropdownMenuPortal;
|
|
var Content2 = DropdownMenuContent;
|
|
var Group2 = DropdownMenuGroup;
|
|
var Label2 = DropdownMenuLabel;
|
|
var Item2 = DropdownMenuItem;
|
|
var CheckboxItem2 = DropdownMenuCheckboxItem;
|
|
var RadioGroup2 = DropdownMenuRadioGroup;
|
|
var RadioItem2 = DropdownMenuRadioItem;
|
|
var ItemIndicator2 = DropdownMenuItemIndicator;
|
|
var Separator2 = DropdownMenuSeparator;
|
|
var Arrow2 = DropdownMenuArrow;
|
|
var Sub2 = DropdownMenuSub;
|
|
var SubTrigger2 = DropdownMenuSubTrigger;
|
|
var SubContent2 = DropdownMenuSubContent;
|
|
;
|
|
//# 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/check.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",
|
|
()=>Check
|
|
]);
|
|
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 Check = (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"])("Check", [
|
|
[
|
|
"path",
|
|
{
|
|
d: "M20 6 9 17l-5-5",
|
|
key: "1gmf2c"
|
|
}
|
|
]
|
|
]);
|
|
;
|
|
//# sourceMappingURL=check.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/check.js [app-ssr] (ecmascript) <export default as CheckIcon>", ((__turbopack_context__) => {
|
|
"use strict";
|
|
|
|
__turbopack_context__.s([
|
|
"CheckIcon",
|
|
()=>__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$check$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$check$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/check.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/chevron-right.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",
|
|
()=>ChevronRight
|
|
]);
|
|
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 ChevronRight = (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"])("ChevronRight", [
|
|
[
|
|
"path",
|
|
{
|
|
d: "m9 18 6-6-6-6",
|
|
key: "mthhwq"
|
|
}
|
|
]
|
|
]);
|
|
;
|
|
//# sourceMappingURL=chevron-right.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/chevron-right.js [app-ssr] (ecmascript) <export default as ChevronRightIcon>", ((__turbopack_context__) => {
|
|
"use strict";
|
|
|
|
__turbopack_context__.s([
|
|
"ChevronRightIcon",
|
|
()=>__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$chevron$2d$right$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$chevron$2d$right$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/chevron-right.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/circle.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",
|
|
()=>Circle
|
|
]);
|
|
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 Circle = (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"])("Circle", [
|
|
[
|
|
"circle",
|
|
{
|
|
cx: "12",
|
|
cy: "12",
|
|
r: "10",
|
|
key: "1mglay"
|
|
}
|
|
]
|
|
]);
|
|
;
|
|
//# sourceMappingURL=circle.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/circle.js [app-ssr] (ecmascript) <export default as CircleIcon>", ((__turbopack_context__) => {
|
|
"use strict";
|
|
|
|
__turbopack_context__.s([
|
|
"CircleIcon",
|
|
()=>__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$circle$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$circle$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/circle.js [app-ssr] (ecmascript)");
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/dexie@4.2.1/node_modules/dexie/dist/dexie.js [app-ssr] (ecmascript)", ((__turbopack_context__, module, exports) => {
|
|
|
|
/*
|
|
* Dexie.js - a minimalistic wrapper for IndexedDB
|
|
* ===============================================
|
|
*
|
|
* By David Fahlander, david.fahlander@gmail.com
|
|
*
|
|
* Version 4.2.1, Sat Oct 04 2025
|
|
*
|
|
* https://dexie.org
|
|
*
|
|
* Apache License Version 2.0, January 2004, http://www.apache.org/licenses/
|
|
*/ (function(global, factory) {
|
|
("TURBOPACK compile-time truthy", 1) ? module.exports = factory() : "TURBOPACK unreachable";
|
|
})(/*TURBOPACK member replacement*/ __turbopack_context__.e, function() {
|
|
'use strict';
|
|
/*! *****************************************************************************
|
|
Copyright (c) Microsoft Corporation.
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
purpose with or without fee is hereby granted.
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
***************************************************************************** */ var extendStatics = function(d, b) {
|
|
extendStatics = Object.setPrototypeOf || ({
|
|
__proto__: []
|
|
}) instanceof Array && function(d, b) {
|
|
d.__proto__ = b;
|
|
} || function(d, b) {
|
|
for(var p in b)if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
|
};
|
|
return extendStatics(d, b);
|
|
};
|
|
function __extends(d, b) {
|
|
if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
extendStatics(d, b);
|
|
function __() {
|
|
this.constructor = d;
|
|
}
|
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
}
|
|
var __assign = function() {
|
|
__assign = Object.assign || function __assign(t) {
|
|
for(var s, i = 1, n = arguments.length; i < n; i++){
|
|
s = arguments[i];
|
|
for(var p in s)if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
}
|
|
return t;
|
|
};
|
|
return __assign.apply(this, arguments);
|
|
};
|
|
function __spreadArray(to, from, pack) {
|
|
if (pack || arguments.length === 2) for(var i = 0, l = from.length, ar; i < l; i++){
|
|
if (ar || !(i in from)) {
|
|
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
ar[i] = from[i];
|
|
}
|
|
}
|
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
}
|
|
var _global = typeof globalThis !== 'undefined' ? globalThis : typeof self !== 'undefined' ? self : ("TURBOPACK compile-time falsy", 0) ? "TURBOPACK unreachable" : /*TURBOPACK member replacement*/ __turbopack_context__.g;
|
|
var keys = Object.keys;
|
|
var isArray = Array.isArray;
|
|
if (typeof Promise !== 'undefined' && !_global.Promise) {
|
|
_global.Promise = Promise;
|
|
}
|
|
function extend(obj, extension) {
|
|
if (typeof extension !== 'object') return obj;
|
|
keys(extension).forEach(function(key) {
|
|
obj[key] = extension[key];
|
|
});
|
|
return obj;
|
|
}
|
|
var getProto = Object.getPrototypeOf;
|
|
var _hasOwn = {}.hasOwnProperty;
|
|
function hasOwn(obj, prop) {
|
|
return _hasOwn.call(obj, prop);
|
|
}
|
|
function props(proto, extension) {
|
|
if (typeof extension === 'function') extension = extension(getProto(proto));
|
|
(typeof Reflect === "undefined" ? keys : Reflect.ownKeys)(extension).forEach(function(key) {
|
|
setProp(proto, key, extension[key]);
|
|
});
|
|
}
|
|
var defineProperty = Object.defineProperty;
|
|
function setProp(obj, prop, functionOrGetSet, options) {
|
|
defineProperty(obj, prop, extend(functionOrGetSet && hasOwn(functionOrGetSet, "get") && typeof functionOrGetSet.get === 'function' ? {
|
|
get: functionOrGetSet.get,
|
|
set: functionOrGetSet.set,
|
|
configurable: true
|
|
} : {
|
|
value: functionOrGetSet,
|
|
configurable: true,
|
|
writable: true
|
|
}, options));
|
|
}
|
|
function derive(Child) {
|
|
return {
|
|
from: function(Parent) {
|
|
Child.prototype = Object.create(Parent.prototype);
|
|
setProp(Child.prototype, "constructor", Child);
|
|
return {
|
|
extend: props.bind(null, Child.prototype)
|
|
};
|
|
}
|
|
};
|
|
}
|
|
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
function getPropertyDescriptor(obj, prop) {
|
|
var pd = getOwnPropertyDescriptor(obj, prop);
|
|
var proto;
|
|
return pd || (proto = getProto(obj)) && getPropertyDescriptor(proto, prop);
|
|
}
|
|
var _slice = [].slice;
|
|
function slice(args, start, end) {
|
|
return _slice.call(args, start, end);
|
|
}
|
|
function override(origFunc, overridedFactory) {
|
|
return overridedFactory(origFunc);
|
|
}
|
|
function assert(b) {
|
|
if (!b) throw new Error("Assertion Failed");
|
|
}
|
|
function asap$1(fn) {
|
|
if (_global.setImmediate) setImmediate(fn);
|
|
else setTimeout(fn, 0);
|
|
}
|
|
function arrayToObject(array, extractor) {
|
|
return array.reduce(function(result, item, i) {
|
|
var nameAndValue = extractor(item, i);
|
|
if (nameAndValue) result[nameAndValue[0]] = nameAndValue[1];
|
|
return result;
|
|
}, {});
|
|
}
|
|
function getByKeyPath(obj, keyPath) {
|
|
if (typeof keyPath === 'string' && hasOwn(obj, keyPath)) return obj[keyPath];
|
|
if (!keyPath) return obj;
|
|
if (typeof keyPath !== 'string') {
|
|
var rv = [];
|
|
for(var i = 0, l = keyPath.length; i < l; ++i){
|
|
var val = getByKeyPath(obj, keyPath[i]);
|
|
rv.push(val);
|
|
}
|
|
return rv;
|
|
}
|
|
var period = keyPath.indexOf('.');
|
|
if (period !== -1) {
|
|
var innerObj = obj[keyPath.substr(0, period)];
|
|
return innerObj == null ? undefined : getByKeyPath(innerObj, keyPath.substr(period + 1));
|
|
}
|
|
return undefined;
|
|
}
|
|
function setByKeyPath(obj, keyPath, value) {
|
|
if (!obj || keyPath === undefined) return;
|
|
if ('isFrozen' in Object && Object.isFrozen(obj)) return;
|
|
if (typeof keyPath !== 'string' && 'length' in keyPath) {
|
|
assert(typeof value !== 'string' && 'length' in value);
|
|
for(var i = 0, l = keyPath.length; i < l; ++i){
|
|
setByKeyPath(obj, keyPath[i], value[i]);
|
|
}
|
|
} else {
|
|
var period = keyPath.indexOf('.');
|
|
if (period !== -1) {
|
|
var currentKeyPath = keyPath.substr(0, period);
|
|
var remainingKeyPath = keyPath.substr(period + 1);
|
|
if (remainingKeyPath === "") if (value === undefined) {
|
|
if (isArray(obj) && !isNaN(parseInt(currentKeyPath))) obj.splice(currentKeyPath, 1);
|
|
else delete obj[currentKeyPath];
|
|
} else obj[currentKeyPath] = value;
|
|
else {
|
|
var innerObj = obj[currentKeyPath];
|
|
if (!innerObj || !hasOwn(obj, currentKeyPath)) innerObj = obj[currentKeyPath] = {};
|
|
setByKeyPath(innerObj, remainingKeyPath, value);
|
|
}
|
|
} else {
|
|
if (value === undefined) {
|
|
if (isArray(obj) && !isNaN(parseInt(keyPath))) obj.splice(keyPath, 1);
|
|
else delete obj[keyPath];
|
|
} else obj[keyPath] = value;
|
|
}
|
|
}
|
|
}
|
|
function delByKeyPath(obj, keyPath) {
|
|
if (typeof keyPath === 'string') setByKeyPath(obj, keyPath, undefined);
|
|
else if ('length' in keyPath) [].map.call(keyPath, function(kp) {
|
|
setByKeyPath(obj, kp, undefined);
|
|
});
|
|
}
|
|
function shallowClone(obj) {
|
|
var rv = {};
|
|
for(var m in obj){
|
|
if (hasOwn(obj, m)) rv[m] = obj[m];
|
|
}
|
|
return rv;
|
|
}
|
|
var concat = [].concat;
|
|
function flatten(a) {
|
|
return concat.apply([], a);
|
|
}
|
|
var intrinsicTypeNames = "BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(',').concat(flatten([
|
|
8,
|
|
16,
|
|
32,
|
|
64
|
|
].map(function(num) {
|
|
return [
|
|
"Int",
|
|
"Uint",
|
|
"Float"
|
|
].map(function(t) {
|
|
return t + num + "Array";
|
|
});
|
|
}))).filter(function(t) {
|
|
return _global[t];
|
|
});
|
|
var intrinsicTypes = new Set(intrinsicTypeNames.map(function(t) {
|
|
return _global[t];
|
|
}));
|
|
function cloneSimpleObjectTree(o) {
|
|
var rv = {};
|
|
for(var k in o)if (hasOwn(o, k)) {
|
|
var v = o[k];
|
|
rv[k] = !v || typeof v !== 'object' || intrinsicTypes.has(v.constructor) ? v : cloneSimpleObjectTree(v);
|
|
}
|
|
return rv;
|
|
}
|
|
function objectIsEmpty(o) {
|
|
for(var k in o)if (hasOwn(o, k)) return false;
|
|
return true;
|
|
}
|
|
var circularRefs = null;
|
|
function deepClone(any) {
|
|
circularRefs = new WeakMap();
|
|
var rv = innerDeepClone(any);
|
|
circularRefs = null;
|
|
return rv;
|
|
}
|
|
function innerDeepClone(x) {
|
|
if (!x || typeof x !== 'object') return x;
|
|
var rv = circularRefs.get(x);
|
|
if (rv) return rv;
|
|
if (isArray(x)) {
|
|
rv = [];
|
|
circularRefs.set(x, rv);
|
|
for(var i = 0, l = x.length; i < l; ++i){
|
|
rv.push(innerDeepClone(x[i]));
|
|
}
|
|
} else if (intrinsicTypes.has(x.constructor)) {
|
|
rv = x;
|
|
} else {
|
|
var proto = getProto(x);
|
|
rv = proto === Object.prototype ? {} : Object.create(proto);
|
|
circularRefs.set(x, rv);
|
|
for(var prop in x){
|
|
if (hasOwn(x, prop)) {
|
|
rv[prop] = innerDeepClone(x[prop]);
|
|
}
|
|
}
|
|
}
|
|
return rv;
|
|
}
|
|
var toString = {}.toString;
|
|
function toStringTag(o) {
|
|
return toString.call(o).slice(8, -1);
|
|
}
|
|
var iteratorSymbol = typeof Symbol !== 'undefined' ? Symbol.iterator : '@@iterator';
|
|
var getIteratorOf = typeof iteratorSymbol === "symbol" ? function(x) {
|
|
var i;
|
|
return x != null && (i = x[iteratorSymbol]) && i.apply(x);
|
|
} : function() {
|
|
return null;
|
|
};
|
|
function delArrayItem(a, x) {
|
|
var i = a.indexOf(x);
|
|
if (i >= 0) a.splice(i, 1);
|
|
return i >= 0;
|
|
}
|
|
var NO_CHAR_ARRAY = {};
|
|
function getArrayOf(arrayLike) {
|
|
var i, a, x, it;
|
|
if (arguments.length === 1) {
|
|
if (isArray(arrayLike)) return arrayLike.slice();
|
|
if (this === NO_CHAR_ARRAY && typeof arrayLike === 'string') return [
|
|
arrayLike
|
|
];
|
|
if (it = getIteratorOf(arrayLike)) {
|
|
a = [];
|
|
while(x = it.next(), !x.done)a.push(x.value);
|
|
return a;
|
|
}
|
|
if (arrayLike == null) return [
|
|
arrayLike
|
|
];
|
|
i = arrayLike.length;
|
|
if (typeof i === 'number') {
|
|
a = new Array(i);
|
|
while(i--)a[i] = arrayLike[i];
|
|
return a;
|
|
}
|
|
return [
|
|
arrayLike
|
|
];
|
|
}
|
|
i = arguments.length;
|
|
a = new Array(i);
|
|
while(i--)a[i] = arguments[i];
|
|
return a;
|
|
}
|
|
var isAsyncFunction = typeof Symbol !== 'undefined' ? function(fn) {
|
|
return fn[Symbol.toStringTag] === 'AsyncFunction';
|
|
} : function() {
|
|
return false;
|
|
};
|
|
var dexieErrorNames = [
|
|
'Modify',
|
|
'Bulk',
|
|
'OpenFailed',
|
|
'VersionChange',
|
|
'Schema',
|
|
'Upgrade',
|
|
'InvalidTable',
|
|
'MissingAPI',
|
|
'NoSuchDatabase',
|
|
'InvalidArgument',
|
|
'SubTransaction',
|
|
'Unsupported',
|
|
'Internal',
|
|
'DatabaseClosed',
|
|
'PrematureCommit',
|
|
'ForeignAwait'
|
|
];
|
|
var idbDomErrorNames = [
|
|
'Unknown',
|
|
'Constraint',
|
|
'Data',
|
|
'TransactionInactive',
|
|
'ReadOnly',
|
|
'Version',
|
|
'NotFound',
|
|
'InvalidState',
|
|
'InvalidAccess',
|
|
'Abort',
|
|
'Timeout',
|
|
'QuotaExceeded',
|
|
'Syntax',
|
|
'DataClone'
|
|
];
|
|
var errorList = dexieErrorNames.concat(idbDomErrorNames);
|
|
var defaultTexts = {
|
|
VersionChanged: "Database version changed by other database connection",
|
|
DatabaseClosed: "Database has been closed",
|
|
Abort: "Transaction aborted",
|
|
TransactionInactive: "Transaction has already completed or failed",
|
|
MissingAPI: "IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"
|
|
};
|
|
function DexieError(name, msg) {
|
|
this.name = name;
|
|
this.message = msg;
|
|
}
|
|
derive(DexieError).from(Error).extend({
|
|
toString: function() {
|
|
return this.name + ": " + this.message;
|
|
}
|
|
});
|
|
function getMultiErrorMessage(msg, failures) {
|
|
return msg + ". Errors: " + Object.keys(failures).map(function(key) {
|
|
return failures[key].toString();
|
|
}).filter(function(v, i, s) {
|
|
return s.indexOf(v) === i;
|
|
}).join('\n');
|
|
}
|
|
function ModifyError(msg, failures, successCount, failedKeys) {
|
|
this.failures = failures;
|
|
this.failedKeys = failedKeys;
|
|
this.successCount = successCount;
|
|
this.message = getMultiErrorMessage(msg, failures);
|
|
}
|
|
derive(ModifyError).from(DexieError);
|
|
function BulkError(msg, failures) {
|
|
this.name = "BulkError";
|
|
this.failures = Object.keys(failures).map(function(pos) {
|
|
return failures[pos];
|
|
});
|
|
this.failuresByPos = failures;
|
|
this.message = getMultiErrorMessage(msg, this.failures);
|
|
}
|
|
derive(BulkError).from(DexieError);
|
|
var errnames = errorList.reduce(function(obj, name) {
|
|
return obj[name] = name + "Error", obj;
|
|
}, {});
|
|
var BaseException = DexieError;
|
|
var exceptions = errorList.reduce(function(obj, name) {
|
|
var fullName = name + "Error";
|
|
function DexieError(msgOrInner, inner) {
|
|
this.name = fullName;
|
|
if (!msgOrInner) {
|
|
this.message = defaultTexts[name] || fullName;
|
|
this.inner = null;
|
|
} else if (typeof msgOrInner === 'string') {
|
|
this.message = "".concat(msgOrInner).concat(!inner ? '' : '\n ' + inner);
|
|
this.inner = inner || null;
|
|
} else if (typeof msgOrInner === 'object') {
|
|
this.message = "".concat(msgOrInner.name, " ").concat(msgOrInner.message);
|
|
this.inner = msgOrInner;
|
|
}
|
|
}
|
|
derive(DexieError).from(BaseException);
|
|
obj[name] = DexieError;
|
|
return obj;
|
|
}, {});
|
|
exceptions.Syntax = SyntaxError;
|
|
exceptions.Type = TypeError;
|
|
exceptions.Range = RangeError;
|
|
var exceptionMap = idbDomErrorNames.reduce(function(obj, name) {
|
|
obj[name + "Error"] = exceptions[name];
|
|
return obj;
|
|
}, {});
|
|
function mapError(domError, message) {
|
|
if (!domError || domError instanceof DexieError || domError instanceof TypeError || domError instanceof SyntaxError || !domError.name || !exceptionMap[domError.name]) return domError;
|
|
var rv = new exceptionMap[domError.name](message || domError.message, domError);
|
|
if ("stack" in domError) {
|
|
setProp(rv, "stack", {
|
|
get: function() {
|
|
return this.inner.stack;
|
|
}
|
|
});
|
|
}
|
|
return rv;
|
|
}
|
|
var fullNameExceptions = errorList.reduce(function(obj, name) {
|
|
if ([
|
|
"Syntax",
|
|
"Type",
|
|
"Range"
|
|
].indexOf(name) === -1) obj[name + "Error"] = exceptions[name];
|
|
return obj;
|
|
}, {});
|
|
fullNameExceptions.ModifyError = ModifyError;
|
|
fullNameExceptions.DexieError = DexieError;
|
|
fullNameExceptions.BulkError = BulkError;
|
|
function nop() {}
|
|
function mirror(val) {
|
|
return val;
|
|
}
|
|
function pureFunctionChain(f1, f2) {
|
|
if (f1 == null || f1 === mirror) return f2;
|
|
return function(val) {
|
|
return f2(f1(val));
|
|
};
|
|
}
|
|
function callBoth(on1, on2) {
|
|
return function() {
|
|
on1.apply(this, arguments);
|
|
on2.apply(this, arguments);
|
|
};
|
|
}
|
|
function hookCreatingChain(f1, f2) {
|
|
if (f1 === nop) return f2;
|
|
return function() {
|
|
var res = f1.apply(this, arguments);
|
|
if (res !== undefined) arguments[0] = res;
|
|
var onsuccess = this.onsuccess, onerror = this.onerror;
|
|
this.onsuccess = null;
|
|
this.onerror = null;
|
|
var res2 = f2.apply(this, arguments);
|
|
if (onsuccess) this.onsuccess = this.onsuccess ? callBoth(onsuccess, this.onsuccess) : onsuccess;
|
|
if (onerror) this.onerror = this.onerror ? callBoth(onerror, this.onerror) : onerror;
|
|
return res2 !== undefined ? res2 : res;
|
|
};
|
|
}
|
|
function hookDeletingChain(f1, f2) {
|
|
if (f1 === nop) return f2;
|
|
return function() {
|
|
f1.apply(this, arguments);
|
|
var onsuccess = this.onsuccess, onerror = this.onerror;
|
|
this.onsuccess = this.onerror = null;
|
|
f2.apply(this, arguments);
|
|
if (onsuccess) this.onsuccess = this.onsuccess ? callBoth(onsuccess, this.onsuccess) : onsuccess;
|
|
if (onerror) this.onerror = this.onerror ? callBoth(onerror, this.onerror) : onerror;
|
|
};
|
|
}
|
|
function hookUpdatingChain(f1, f2) {
|
|
if (f1 === nop) return f2;
|
|
return function(modifications) {
|
|
var res = f1.apply(this, arguments);
|
|
extend(modifications, res);
|
|
var onsuccess = this.onsuccess, onerror = this.onerror;
|
|
this.onsuccess = null;
|
|
this.onerror = null;
|
|
var res2 = f2.apply(this, arguments);
|
|
if (onsuccess) this.onsuccess = this.onsuccess ? callBoth(onsuccess, this.onsuccess) : onsuccess;
|
|
if (onerror) this.onerror = this.onerror ? callBoth(onerror, this.onerror) : onerror;
|
|
return res === undefined ? res2 === undefined ? undefined : res2 : extend(res, res2);
|
|
};
|
|
}
|
|
function reverseStoppableEventChain(f1, f2) {
|
|
if (f1 === nop) return f2;
|
|
return function() {
|
|
if (f2.apply(this, arguments) === false) return false;
|
|
return f1.apply(this, arguments);
|
|
};
|
|
}
|
|
function promisableChain(f1, f2) {
|
|
if (f1 === nop) return f2;
|
|
return function() {
|
|
var res = f1.apply(this, arguments);
|
|
if (res && typeof res.then === 'function') {
|
|
var thiz = this, i = arguments.length, args = new Array(i);
|
|
while(i--)args[i] = arguments[i];
|
|
return res.then(function() {
|
|
return f2.apply(thiz, args);
|
|
});
|
|
}
|
|
return f2.apply(this, arguments);
|
|
};
|
|
}
|
|
var debug = typeof location !== 'undefined' && /^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);
|
|
function setDebug(value, filter) {
|
|
debug = value;
|
|
}
|
|
var INTERNAL = {};
|
|
var ZONE_ECHO_LIMIT = 100, _a$1 = typeof Promise === 'undefined' ? [] : function() {
|
|
var globalP = Promise.resolve();
|
|
if (typeof crypto === 'undefined' || !crypto.subtle) return [
|
|
globalP,
|
|
getProto(globalP),
|
|
globalP
|
|
];
|
|
var nativeP = crypto.subtle.digest("SHA-512", new Uint8Array([
|
|
0
|
|
]));
|
|
return [
|
|
nativeP,
|
|
getProto(nativeP),
|
|
globalP
|
|
];
|
|
}(), resolvedNativePromise = _a$1[0], nativePromiseProto = _a$1[1], resolvedGlobalPromise = _a$1[2], nativePromiseThen = nativePromiseProto && nativePromiseProto.then;
|
|
var NativePromise = resolvedNativePromise && resolvedNativePromise.constructor;
|
|
var patchGlobalPromise = !!resolvedGlobalPromise;
|
|
function schedulePhysicalTick() {
|
|
queueMicrotask(physicalTick);
|
|
}
|
|
var asap = function(callback, args) {
|
|
microtickQueue.push([
|
|
callback,
|
|
args
|
|
]);
|
|
if (needsNewPhysicalTick) {
|
|
schedulePhysicalTick();
|
|
needsNewPhysicalTick = false;
|
|
}
|
|
};
|
|
var isOutsideMicroTick = true, needsNewPhysicalTick = true, unhandledErrors = [], rejectingErrors = [], rejectionMapper = mirror;
|
|
var globalPSD = {
|
|
id: 'global',
|
|
global: true,
|
|
ref: 0,
|
|
unhandleds: [],
|
|
onunhandled: nop,
|
|
pgp: false,
|
|
env: {},
|
|
finalize: nop
|
|
};
|
|
var PSD = globalPSD;
|
|
var microtickQueue = [];
|
|
var numScheduledCalls = 0;
|
|
var tickFinalizers = [];
|
|
function DexiePromise(fn) {
|
|
if (typeof this !== 'object') throw new TypeError('Promises must be constructed via new');
|
|
this._listeners = [];
|
|
this._lib = false;
|
|
var psd = this._PSD = PSD;
|
|
if (typeof fn !== 'function') {
|
|
if (fn !== INTERNAL) throw new TypeError('Not a function');
|
|
this._state = arguments[1];
|
|
this._value = arguments[2];
|
|
if (this._state === false) handleRejection(this, this._value);
|
|
return;
|
|
}
|
|
this._state = null;
|
|
this._value = null;
|
|
++psd.ref;
|
|
executePromiseTask(this, fn);
|
|
}
|
|
var thenProp = {
|
|
get: function() {
|
|
var psd = PSD, microTaskId = totalEchoes;
|
|
function then(onFulfilled, onRejected) {
|
|
var _this = this;
|
|
var possibleAwait = !psd.global && (psd !== PSD || microTaskId !== totalEchoes);
|
|
var cleanup = possibleAwait && !decrementExpectedAwaits();
|
|
var rv = new DexiePromise(function(resolve, reject) {
|
|
propagateToListener(_this, new Listener(nativeAwaitCompatibleWrap(onFulfilled, psd, possibleAwait, cleanup), nativeAwaitCompatibleWrap(onRejected, psd, possibleAwait, cleanup), resolve, reject, psd));
|
|
});
|
|
if (this._consoleTask) rv._consoleTask = this._consoleTask;
|
|
return rv;
|
|
}
|
|
then.prototype = INTERNAL;
|
|
return then;
|
|
},
|
|
set: function(value) {
|
|
setProp(this, 'then', value && value.prototype === INTERNAL ? thenProp : {
|
|
get: function() {
|
|
return value;
|
|
},
|
|
set: thenProp.set
|
|
});
|
|
}
|
|
};
|
|
props(DexiePromise.prototype, {
|
|
then: thenProp,
|
|
_then: function(onFulfilled, onRejected) {
|
|
propagateToListener(this, new Listener(null, null, onFulfilled, onRejected, PSD));
|
|
},
|
|
catch: function(onRejected) {
|
|
if (arguments.length === 1) return this.then(null, onRejected);
|
|
var type = arguments[0], handler = arguments[1];
|
|
return typeof type === 'function' ? this.then(null, function(err) {
|
|
return err instanceof type ? handler(err) : PromiseReject(err);
|
|
}) : this.then(null, function(err) {
|
|
return err && err.name === type ? handler(err) : PromiseReject(err);
|
|
});
|
|
},
|
|
finally: function(onFinally) {
|
|
return this.then(function(value) {
|
|
return DexiePromise.resolve(onFinally()).then(function() {
|
|
return value;
|
|
});
|
|
}, function(err) {
|
|
return DexiePromise.resolve(onFinally()).then(function() {
|
|
return PromiseReject(err);
|
|
});
|
|
});
|
|
},
|
|
timeout: function(ms, msg) {
|
|
var _this = this;
|
|
return ms < Infinity ? new DexiePromise(function(resolve, reject) {
|
|
var handle = setTimeout(function() {
|
|
return reject(new exceptions.Timeout(msg));
|
|
}, ms);
|
|
_this.then(resolve, reject).finally(clearTimeout.bind(null, handle));
|
|
}) : this;
|
|
}
|
|
});
|
|
if (typeof Symbol !== 'undefined' && Symbol.toStringTag) setProp(DexiePromise.prototype, Symbol.toStringTag, 'Dexie.Promise');
|
|
globalPSD.env = snapShot();
|
|
function Listener(onFulfilled, onRejected, resolve, reject, zone) {
|
|
this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;
|
|
this.onRejected = typeof onRejected === 'function' ? onRejected : null;
|
|
this.resolve = resolve;
|
|
this.reject = reject;
|
|
this.psd = zone;
|
|
}
|
|
props(DexiePromise, {
|
|
all: function() {
|
|
var values = getArrayOf.apply(null, arguments).map(onPossibleParallellAsync);
|
|
return new DexiePromise(function(resolve, reject) {
|
|
if (values.length === 0) resolve([]);
|
|
var remaining = values.length;
|
|
values.forEach(function(a, i) {
|
|
return DexiePromise.resolve(a).then(function(x) {
|
|
values[i] = x;
|
|
if (!--remaining) resolve(values);
|
|
}, reject);
|
|
});
|
|
});
|
|
},
|
|
resolve: function(value) {
|
|
if (value instanceof DexiePromise) return value;
|
|
if (value && typeof value.then === 'function') return new DexiePromise(function(resolve, reject) {
|
|
value.then(resolve, reject);
|
|
});
|
|
var rv = new DexiePromise(INTERNAL, true, value);
|
|
return rv;
|
|
},
|
|
reject: PromiseReject,
|
|
race: function() {
|
|
var values = getArrayOf.apply(null, arguments).map(onPossibleParallellAsync);
|
|
return new DexiePromise(function(resolve, reject) {
|
|
values.map(function(value) {
|
|
return DexiePromise.resolve(value).then(resolve, reject);
|
|
});
|
|
});
|
|
},
|
|
PSD: {
|
|
get: function() {
|
|
return PSD;
|
|
},
|
|
set: function(value) {
|
|
return PSD = value;
|
|
}
|
|
},
|
|
totalEchoes: {
|
|
get: function() {
|
|
return totalEchoes;
|
|
}
|
|
},
|
|
newPSD: newScope,
|
|
usePSD: usePSD,
|
|
scheduler: {
|
|
get: function() {
|
|
return asap;
|
|
},
|
|
set: function(value) {
|
|
asap = value;
|
|
}
|
|
},
|
|
rejectionMapper: {
|
|
get: function() {
|
|
return rejectionMapper;
|
|
},
|
|
set: function(value) {
|
|
rejectionMapper = value;
|
|
}
|
|
},
|
|
follow: function(fn, zoneProps) {
|
|
return new DexiePromise(function(resolve, reject) {
|
|
return newScope(function(resolve, reject) {
|
|
var psd = PSD;
|
|
psd.unhandleds = [];
|
|
psd.onunhandled = reject;
|
|
psd.finalize = callBoth(function() {
|
|
var _this = this;
|
|
run_at_end_of_this_or_next_physical_tick(function() {
|
|
_this.unhandleds.length === 0 ? resolve() : reject(_this.unhandleds[0]);
|
|
});
|
|
}, psd.finalize);
|
|
fn();
|
|
}, zoneProps, resolve, reject);
|
|
});
|
|
}
|
|
});
|
|
if (NativePromise) {
|
|
if (NativePromise.allSettled) setProp(DexiePromise, "allSettled", function() {
|
|
var possiblePromises = getArrayOf.apply(null, arguments).map(onPossibleParallellAsync);
|
|
return new DexiePromise(function(resolve) {
|
|
if (possiblePromises.length === 0) resolve([]);
|
|
var remaining = possiblePromises.length;
|
|
var results = new Array(remaining);
|
|
possiblePromises.forEach(function(p, i) {
|
|
return DexiePromise.resolve(p).then(function(value) {
|
|
return results[i] = {
|
|
status: "fulfilled",
|
|
value: value
|
|
};
|
|
}, function(reason) {
|
|
return results[i] = {
|
|
status: "rejected",
|
|
reason: reason
|
|
};
|
|
}).then(function() {
|
|
return --remaining || resolve(results);
|
|
});
|
|
});
|
|
});
|
|
});
|
|
if (NativePromise.any && typeof AggregateError !== 'undefined') setProp(DexiePromise, "any", function() {
|
|
var possiblePromises = getArrayOf.apply(null, arguments).map(onPossibleParallellAsync);
|
|
return new DexiePromise(function(resolve, reject) {
|
|
if (possiblePromises.length === 0) reject(new AggregateError([]));
|
|
var remaining = possiblePromises.length;
|
|
var failures = new Array(remaining);
|
|
possiblePromises.forEach(function(p, i) {
|
|
return DexiePromise.resolve(p).then(function(value) {
|
|
return resolve(value);
|
|
}, function(failure) {
|
|
failures[i] = failure;
|
|
if (!--remaining) reject(new AggregateError(failures));
|
|
});
|
|
});
|
|
});
|
|
});
|
|
if (NativePromise.withResolvers) DexiePromise.withResolvers = NativePromise.withResolvers;
|
|
}
|
|
function executePromiseTask(promise, fn) {
|
|
try {
|
|
fn(function(value) {
|
|
if (promise._state !== null) return;
|
|
if (value === promise) throw new TypeError('A promise cannot be resolved with itself.');
|
|
var shouldExecuteTick = promise._lib && beginMicroTickScope();
|
|
if (value && typeof value.then === 'function') {
|
|
executePromiseTask(promise, function(resolve, reject) {
|
|
value instanceof DexiePromise ? value._then(resolve, reject) : value.then(resolve, reject);
|
|
});
|
|
} else {
|
|
promise._state = true;
|
|
promise._value = value;
|
|
propagateAllListeners(promise);
|
|
}
|
|
if (shouldExecuteTick) endMicroTickScope();
|
|
}, handleRejection.bind(null, promise));
|
|
} catch (ex) {
|
|
handleRejection(promise, ex);
|
|
}
|
|
}
|
|
function handleRejection(promise, reason) {
|
|
rejectingErrors.push(reason);
|
|
if (promise._state !== null) return;
|
|
var shouldExecuteTick = promise._lib && beginMicroTickScope();
|
|
reason = rejectionMapper(reason);
|
|
promise._state = false;
|
|
promise._value = reason;
|
|
addPossiblyUnhandledError(promise);
|
|
propagateAllListeners(promise);
|
|
if (shouldExecuteTick) endMicroTickScope();
|
|
}
|
|
function propagateAllListeners(promise) {
|
|
var listeners = promise._listeners;
|
|
promise._listeners = [];
|
|
for(var i = 0, len = listeners.length; i < len; ++i){
|
|
propagateToListener(promise, listeners[i]);
|
|
}
|
|
var psd = promise._PSD;
|
|
--psd.ref || psd.finalize();
|
|
if (numScheduledCalls === 0) {
|
|
++numScheduledCalls;
|
|
asap(function() {
|
|
if (--numScheduledCalls === 0) finalizePhysicalTick();
|
|
}, []);
|
|
}
|
|
}
|
|
function propagateToListener(promise, listener) {
|
|
if (promise._state === null) {
|
|
promise._listeners.push(listener);
|
|
return;
|
|
}
|
|
var cb = promise._state ? listener.onFulfilled : listener.onRejected;
|
|
if (cb === null) {
|
|
return (promise._state ? listener.resolve : listener.reject)(promise._value);
|
|
}
|
|
++listener.psd.ref;
|
|
++numScheduledCalls;
|
|
asap(callListener, [
|
|
cb,
|
|
promise,
|
|
listener
|
|
]);
|
|
}
|
|
function callListener(cb, promise, listener) {
|
|
try {
|
|
var ret, value = promise._value;
|
|
if (!promise._state && rejectingErrors.length) rejectingErrors = [];
|
|
ret = debug && promise._consoleTask ? promise._consoleTask.run(function() {
|
|
return cb(value);
|
|
}) : cb(value);
|
|
if (!promise._state && rejectingErrors.indexOf(value) === -1) {
|
|
markErrorAsHandled(promise);
|
|
}
|
|
listener.resolve(ret);
|
|
} catch (e) {
|
|
listener.reject(e);
|
|
} finally{
|
|
if (--numScheduledCalls === 0) finalizePhysicalTick();
|
|
--listener.psd.ref || listener.psd.finalize();
|
|
}
|
|
}
|
|
function physicalTick() {
|
|
usePSD(globalPSD, function() {
|
|
beginMicroTickScope() && endMicroTickScope();
|
|
});
|
|
}
|
|
function beginMicroTickScope() {
|
|
var wasRootExec = isOutsideMicroTick;
|
|
isOutsideMicroTick = false;
|
|
needsNewPhysicalTick = false;
|
|
return wasRootExec;
|
|
}
|
|
function endMicroTickScope() {
|
|
var callbacks, i, l;
|
|
do {
|
|
while(microtickQueue.length > 0){
|
|
callbacks = microtickQueue;
|
|
microtickQueue = [];
|
|
l = callbacks.length;
|
|
for(i = 0; i < l; ++i){
|
|
var item = callbacks[i];
|
|
item[0].apply(null, item[1]);
|
|
}
|
|
}
|
|
}while (microtickQueue.length > 0)
|
|
isOutsideMicroTick = true;
|
|
needsNewPhysicalTick = true;
|
|
}
|
|
function finalizePhysicalTick() {
|
|
var unhandledErrs = unhandledErrors;
|
|
unhandledErrors = [];
|
|
unhandledErrs.forEach(function(p) {
|
|
p._PSD.onunhandled.call(null, p._value, p);
|
|
});
|
|
var finalizers = tickFinalizers.slice(0);
|
|
var i = finalizers.length;
|
|
while(i)finalizers[--i]();
|
|
}
|
|
function run_at_end_of_this_or_next_physical_tick(fn) {
|
|
function finalizer() {
|
|
fn();
|
|
tickFinalizers.splice(tickFinalizers.indexOf(finalizer), 1);
|
|
}
|
|
tickFinalizers.push(finalizer);
|
|
++numScheduledCalls;
|
|
asap(function() {
|
|
if (--numScheduledCalls === 0) finalizePhysicalTick();
|
|
}, []);
|
|
}
|
|
function addPossiblyUnhandledError(promise) {
|
|
if (!unhandledErrors.some(function(p) {
|
|
return p._value === promise._value;
|
|
})) unhandledErrors.push(promise);
|
|
}
|
|
function markErrorAsHandled(promise) {
|
|
var i = unhandledErrors.length;
|
|
while(i)if (unhandledErrors[--i]._value === promise._value) {
|
|
unhandledErrors.splice(i, 1);
|
|
return;
|
|
}
|
|
}
|
|
function PromiseReject(reason) {
|
|
return new DexiePromise(INTERNAL, false, reason);
|
|
}
|
|
function wrap(fn, errorCatcher) {
|
|
var psd = PSD;
|
|
return function() {
|
|
var wasRootExec = beginMicroTickScope(), outerScope = PSD;
|
|
try {
|
|
switchToZone(psd, true);
|
|
return fn.apply(this, arguments);
|
|
} catch (e) {
|
|
errorCatcher && errorCatcher(e);
|
|
} finally{
|
|
switchToZone(outerScope, false);
|
|
if (wasRootExec) endMicroTickScope();
|
|
}
|
|
};
|
|
}
|
|
var task = {
|
|
awaits: 0,
|
|
echoes: 0,
|
|
id: 0
|
|
};
|
|
var taskCounter = 0;
|
|
var zoneStack = [];
|
|
var zoneEchoes = 0;
|
|
var totalEchoes = 0;
|
|
var zone_id_counter = 0;
|
|
function newScope(fn, props, a1, a2) {
|
|
var parent = PSD, psd = Object.create(parent);
|
|
psd.parent = parent;
|
|
psd.ref = 0;
|
|
psd.global = false;
|
|
psd.id = ++zone_id_counter;
|
|
globalPSD.env;
|
|
psd.env = patchGlobalPromise ? {
|
|
Promise: DexiePromise,
|
|
PromiseProp: {
|
|
value: DexiePromise,
|
|
configurable: true,
|
|
writable: true
|
|
},
|
|
all: DexiePromise.all,
|
|
race: DexiePromise.race,
|
|
allSettled: DexiePromise.allSettled,
|
|
any: DexiePromise.any,
|
|
resolve: DexiePromise.resolve,
|
|
reject: DexiePromise.reject
|
|
} : {};
|
|
if (props) extend(psd, props);
|
|
++parent.ref;
|
|
psd.finalize = function() {
|
|
--this.parent.ref || this.parent.finalize();
|
|
};
|
|
var rv = usePSD(psd, fn, a1, a2);
|
|
if (psd.ref === 0) psd.finalize();
|
|
return rv;
|
|
}
|
|
function incrementExpectedAwaits() {
|
|
if (!task.id) task.id = ++taskCounter;
|
|
++task.awaits;
|
|
task.echoes += ZONE_ECHO_LIMIT;
|
|
return task.id;
|
|
}
|
|
function decrementExpectedAwaits() {
|
|
if (!task.awaits) return false;
|
|
if (--task.awaits === 0) task.id = 0;
|
|
task.echoes = task.awaits * ZONE_ECHO_LIMIT;
|
|
return true;
|
|
}
|
|
if (('' + nativePromiseThen).indexOf('[native code]') === -1) {
|
|
incrementExpectedAwaits = decrementExpectedAwaits = nop;
|
|
}
|
|
function onPossibleParallellAsync(possiblePromise) {
|
|
if (task.echoes && possiblePromise && possiblePromise.constructor === NativePromise) {
|
|
incrementExpectedAwaits();
|
|
return possiblePromise.then(function(x) {
|
|
decrementExpectedAwaits();
|
|
return x;
|
|
}, function(e) {
|
|
decrementExpectedAwaits();
|
|
return rejection(e);
|
|
});
|
|
}
|
|
return possiblePromise;
|
|
}
|
|
function zoneEnterEcho(targetZone) {
|
|
++totalEchoes;
|
|
if (!task.echoes || --task.echoes === 0) {
|
|
task.echoes = task.awaits = task.id = 0;
|
|
}
|
|
zoneStack.push(PSD);
|
|
switchToZone(targetZone, true);
|
|
}
|
|
function zoneLeaveEcho() {
|
|
var zone = zoneStack[zoneStack.length - 1];
|
|
zoneStack.pop();
|
|
switchToZone(zone, false);
|
|
}
|
|
function switchToZone(targetZone, bEnteringZone) {
|
|
var currentZone = PSD;
|
|
if (bEnteringZone ? task.echoes && (!zoneEchoes++ || targetZone !== PSD) : zoneEchoes && (!--zoneEchoes || targetZone !== PSD)) {
|
|
queueMicrotask(bEnteringZone ? zoneEnterEcho.bind(null, targetZone) : zoneLeaveEcho);
|
|
}
|
|
if (targetZone === PSD) return;
|
|
PSD = targetZone;
|
|
if (currentZone === globalPSD) globalPSD.env = snapShot();
|
|
if (patchGlobalPromise) {
|
|
var GlobalPromise = globalPSD.env.Promise;
|
|
var targetEnv = targetZone.env;
|
|
if (currentZone.global || targetZone.global) {
|
|
Object.defineProperty(_global, 'Promise', targetEnv.PromiseProp);
|
|
GlobalPromise.all = targetEnv.all;
|
|
GlobalPromise.race = targetEnv.race;
|
|
GlobalPromise.resolve = targetEnv.resolve;
|
|
GlobalPromise.reject = targetEnv.reject;
|
|
if (targetEnv.allSettled) GlobalPromise.allSettled = targetEnv.allSettled;
|
|
if (targetEnv.any) GlobalPromise.any = targetEnv.any;
|
|
}
|
|
}
|
|
}
|
|
function snapShot() {
|
|
var GlobalPromise = _global.Promise;
|
|
return patchGlobalPromise ? {
|
|
Promise: GlobalPromise,
|
|
PromiseProp: Object.getOwnPropertyDescriptor(_global, "Promise"),
|
|
all: GlobalPromise.all,
|
|
race: GlobalPromise.race,
|
|
allSettled: GlobalPromise.allSettled,
|
|
any: GlobalPromise.any,
|
|
resolve: GlobalPromise.resolve,
|
|
reject: GlobalPromise.reject
|
|
} : {};
|
|
}
|
|
function usePSD(psd, fn, a1, a2, a3) {
|
|
var outerScope = PSD;
|
|
try {
|
|
switchToZone(psd, true);
|
|
return fn(a1, a2, a3);
|
|
} finally{
|
|
switchToZone(outerScope, false);
|
|
}
|
|
}
|
|
function nativeAwaitCompatibleWrap(fn, zone, possibleAwait, cleanup) {
|
|
return typeof fn !== 'function' ? fn : function() {
|
|
var outerZone = PSD;
|
|
if (possibleAwait) incrementExpectedAwaits();
|
|
switchToZone(zone, true);
|
|
try {
|
|
return fn.apply(this, arguments);
|
|
} finally{
|
|
switchToZone(outerZone, false);
|
|
if (cleanup) queueMicrotask(decrementExpectedAwaits);
|
|
}
|
|
};
|
|
}
|
|
function execInGlobalContext(cb) {
|
|
if (Promise === NativePromise && task.echoes === 0) {
|
|
if (zoneEchoes === 0) {
|
|
cb();
|
|
} else {
|
|
enqueueNativeMicroTask(cb);
|
|
}
|
|
} else {
|
|
setTimeout(cb, 0);
|
|
}
|
|
}
|
|
var rejection = DexiePromise.reject;
|
|
function tempTransaction(db, mode, storeNames, fn) {
|
|
if (!db.idbdb || !db._state.openComplete && !PSD.letThrough && !db._vip) {
|
|
if (db._state.openComplete) {
|
|
return rejection(new exceptions.DatabaseClosed(db._state.dbOpenError));
|
|
}
|
|
if (!db._state.isBeingOpened) {
|
|
if (!db._state.autoOpen) return rejection(new exceptions.DatabaseClosed());
|
|
db.open().catch(nop);
|
|
}
|
|
return db._state.dbReadyPromise.then(function() {
|
|
return tempTransaction(db, mode, storeNames, fn);
|
|
});
|
|
} else {
|
|
var trans = db._createTransaction(mode, storeNames, db._dbSchema);
|
|
try {
|
|
trans.create();
|
|
db._state.PR1398_maxLoop = 3;
|
|
} catch (ex) {
|
|
if (ex.name === errnames.InvalidState && db.isOpen() && --db._state.PR1398_maxLoop > 0) {
|
|
console.warn('Dexie: Need to reopen db');
|
|
db.close({
|
|
disableAutoOpen: false
|
|
});
|
|
return db.open().then(function() {
|
|
return tempTransaction(db, mode, storeNames, fn);
|
|
});
|
|
}
|
|
return rejection(ex);
|
|
}
|
|
return trans._promise(mode, function(resolve, reject) {
|
|
return newScope(function() {
|
|
PSD.trans = trans;
|
|
return fn(resolve, reject, trans);
|
|
});
|
|
}).then(function(result) {
|
|
if (mode === 'readwrite') try {
|
|
trans.idbtrans.commit();
|
|
} catch (_a) {}
|
|
return mode === 'readonly' ? result : trans._completion.then(function() {
|
|
return result;
|
|
});
|
|
});
|
|
}
|
|
}
|
|
var DEXIE_VERSION = '4.2.1';
|
|
var maxString = String.fromCharCode(65535);
|
|
var minKey = -Infinity;
|
|
var INVALID_KEY_ARGUMENT = "Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.";
|
|
var STRING_EXPECTED = "String expected.";
|
|
var connections = [];
|
|
var DBNAMES_DB = '__dbnames';
|
|
var READONLY = 'readonly';
|
|
var READWRITE = 'readwrite';
|
|
function combine(filter1, filter2) {
|
|
return filter1 ? filter2 ? function() {
|
|
return filter1.apply(this, arguments) && filter2.apply(this, arguments);
|
|
} : filter1 : filter2;
|
|
}
|
|
var AnyRange = {
|
|
type: 3,
|
|
lower: -Infinity,
|
|
lowerOpen: false,
|
|
upper: [
|
|
[]
|
|
],
|
|
upperOpen: false
|
|
};
|
|
function workaroundForUndefinedPrimKey(keyPath) {
|
|
return typeof keyPath === "string" && !/\./.test(keyPath) ? function(obj) {
|
|
if (obj[keyPath] === undefined && keyPath in obj) {
|
|
obj = deepClone(obj);
|
|
delete obj[keyPath];
|
|
}
|
|
return obj;
|
|
} : function(obj) {
|
|
return obj;
|
|
};
|
|
}
|
|
function Entity() {
|
|
throw exceptions.Type("Entity instances must never be new:ed. Instances are generated by the framework bypassing the constructor.");
|
|
}
|
|
function cmp(a, b) {
|
|
try {
|
|
var ta = type(a);
|
|
var tb = type(b);
|
|
if (ta !== tb) {
|
|
if (ta === 'Array') return 1;
|
|
if (tb === 'Array') return -1;
|
|
if (ta === 'binary') return 1;
|
|
if (tb === 'binary') return -1;
|
|
if (ta === 'string') return 1;
|
|
if (tb === 'string') return -1;
|
|
if (ta === 'Date') return 1;
|
|
if (tb !== 'Date') return NaN;
|
|
return -1;
|
|
}
|
|
switch(ta){
|
|
case 'number':
|
|
case 'Date':
|
|
case 'string':
|
|
return a > b ? 1 : a < b ? -1 : 0;
|
|
case 'binary':
|
|
{
|
|
return compareUint8Arrays(getUint8Array(a), getUint8Array(b));
|
|
}
|
|
case 'Array':
|
|
return compareArrays(a, b);
|
|
}
|
|
} catch (_a) {}
|
|
return NaN;
|
|
}
|
|
function compareArrays(a, b) {
|
|
var al = a.length;
|
|
var bl = b.length;
|
|
var l = al < bl ? al : bl;
|
|
for(var i = 0; i < l; ++i){
|
|
var res = cmp(a[i], b[i]);
|
|
if (res !== 0) return res;
|
|
}
|
|
return al === bl ? 0 : al < bl ? -1 : 1;
|
|
}
|
|
function compareUint8Arrays(a, b) {
|
|
var al = a.length;
|
|
var bl = b.length;
|
|
var l = al < bl ? al : bl;
|
|
for(var i = 0; i < l; ++i){
|
|
if (a[i] !== b[i]) return a[i] < b[i] ? -1 : 1;
|
|
}
|
|
return al === bl ? 0 : al < bl ? -1 : 1;
|
|
}
|
|
function type(x) {
|
|
var t = typeof x;
|
|
if (t !== 'object') return t;
|
|
if (ArrayBuffer.isView(x)) return 'binary';
|
|
var tsTag = toStringTag(x);
|
|
return tsTag === 'ArrayBuffer' ? 'binary' : tsTag;
|
|
}
|
|
function getUint8Array(a) {
|
|
if (a instanceof Uint8Array) return a;
|
|
if (ArrayBuffer.isView(a)) return new Uint8Array(a.buffer, a.byteOffset, a.byteLength);
|
|
return new Uint8Array(a);
|
|
}
|
|
function builtInDeletionTrigger(table, keys, res) {
|
|
var yProps = table.schema.yProps;
|
|
if (!yProps) return res;
|
|
if (keys && res.numFailures > 0) keys = keys.filter(function(_, i) {
|
|
return !res.failures[i];
|
|
});
|
|
return Promise.all(yProps.map(function(_a) {
|
|
var updatesTable = _a.updatesTable;
|
|
return keys ? table.db.table(updatesTable).where('k').anyOf(keys).delete() : table.db.table(updatesTable).clear();
|
|
})).then(function() {
|
|
return res;
|
|
});
|
|
}
|
|
var PropModification = function() {
|
|
function PropModification(spec) {
|
|
this["@@propmod"] = spec;
|
|
}
|
|
PropModification.prototype.execute = function(value) {
|
|
var _a;
|
|
var spec = this["@@propmod"];
|
|
if (spec.add !== undefined) {
|
|
var term = spec.add;
|
|
if (isArray(term)) {
|
|
return __spreadArray(__spreadArray([], isArray(value) ? value : [], true), term, true).sort();
|
|
}
|
|
if (typeof term === 'number') return (Number(value) || 0) + term;
|
|
if (typeof term === 'bigint') {
|
|
try {
|
|
return BigInt(value) + term;
|
|
} catch (_b) {
|
|
return BigInt(0) + term;
|
|
}
|
|
}
|
|
throw new TypeError("Invalid term ".concat(term));
|
|
}
|
|
if (spec.remove !== undefined) {
|
|
var subtrahend_1 = spec.remove;
|
|
if (isArray(subtrahend_1)) {
|
|
return isArray(value) ? value.filter(function(item) {
|
|
return !subtrahend_1.includes(item);
|
|
}).sort() : [];
|
|
}
|
|
if (typeof subtrahend_1 === 'number') return Number(value) - subtrahend_1;
|
|
if (typeof subtrahend_1 === 'bigint') {
|
|
try {
|
|
return BigInt(value) - subtrahend_1;
|
|
} catch (_c) {
|
|
return BigInt(0) - subtrahend_1;
|
|
}
|
|
}
|
|
throw new TypeError("Invalid subtrahend ".concat(subtrahend_1));
|
|
}
|
|
var prefixToReplace = (_a = spec.replacePrefix) === null || _a === void 0 ? void 0 : _a[0];
|
|
if (prefixToReplace && typeof value === 'string' && value.startsWith(prefixToReplace)) {
|
|
return spec.replacePrefix[1] + value.substring(prefixToReplace.length);
|
|
}
|
|
return value;
|
|
};
|
|
return PropModification;
|
|
}();
|
|
function applyUpdateSpec(obj, changes) {
|
|
var keyPaths = keys(changes);
|
|
var numKeys = keyPaths.length;
|
|
var anythingModified = false;
|
|
for(var i = 0; i < numKeys; ++i){
|
|
var keyPath = keyPaths[i];
|
|
var value = changes[keyPath];
|
|
var origValue = getByKeyPath(obj, keyPath);
|
|
if (value instanceof PropModification) {
|
|
setByKeyPath(obj, keyPath, value.execute(origValue));
|
|
anythingModified = true;
|
|
} else if (origValue !== value) {
|
|
setByKeyPath(obj, keyPath, value);
|
|
anythingModified = true;
|
|
}
|
|
}
|
|
return anythingModified;
|
|
}
|
|
var Table = function() {
|
|
function Table() {}
|
|
Table.prototype._trans = function(mode, fn, writeLocked) {
|
|
var trans = this._tx || PSD.trans;
|
|
var tableName = this.name;
|
|
var task = debug && typeof console !== 'undefined' && console.createTask && console.createTask("Dexie: ".concat(mode === 'readonly' ? 'read' : 'write', " ").concat(this.name));
|
|
function checkTableInTransaction(resolve, reject, trans) {
|
|
if (!trans.schema[tableName]) throw new exceptions.NotFound("Table " + tableName + " not part of transaction");
|
|
return fn(trans.idbtrans, trans);
|
|
}
|
|
var wasRootExec = beginMicroTickScope();
|
|
try {
|
|
var p = trans && trans.db._novip === this.db._novip ? trans === PSD.trans ? trans._promise(mode, checkTableInTransaction, writeLocked) : newScope(function() {
|
|
return trans._promise(mode, checkTableInTransaction, writeLocked);
|
|
}, {
|
|
trans: trans,
|
|
transless: PSD.transless || PSD
|
|
}) : tempTransaction(this.db, mode, [
|
|
this.name
|
|
], checkTableInTransaction);
|
|
if (task) {
|
|
p._consoleTask = task;
|
|
p = p.catch(function(err) {
|
|
console.trace(err);
|
|
return rejection(err);
|
|
});
|
|
}
|
|
return p;
|
|
} finally{
|
|
if (wasRootExec) endMicroTickScope();
|
|
}
|
|
};
|
|
Table.prototype.get = function(keyOrCrit, cb) {
|
|
var _this = this;
|
|
if (keyOrCrit && keyOrCrit.constructor === Object) return this.where(keyOrCrit).first(cb);
|
|
if (keyOrCrit == null) return rejection(new exceptions.Type("Invalid argument to Table.get()"));
|
|
return this._trans('readonly', function(trans) {
|
|
return _this.core.get({
|
|
trans: trans,
|
|
key: keyOrCrit
|
|
}).then(function(res) {
|
|
return _this.hook.reading.fire(res);
|
|
});
|
|
}).then(cb);
|
|
};
|
|
Table.prototype.where = function(indexOrCrit) {
|
|
if (typeof indexOrCrit === 'string') return new this.db.WhereClause(this, indexOrCrit);
|
|
if (isArray(indexOrCrit)) return new this.db.WhereClause(this, "[".concat(indexOrCrit.join('+'), "]"));
|
|
var keyPaths = keys(indexOrCrit);
|
|
if (keyPaths.length === 1) return this.where(keyPaths[0]).equals(indexOrCrit[keyPaths[0]]);
|
|
var compoundIndex = this.schema.indexes.concat(this.schema.primKey).filter(function(ix) {
|
|
if (ix.compound && keyPaths.every(function(keyPath) {
|
|
return ix.keyPath.indexOf(keyPath) >= 0;
|
|
})) {
|
|
for(var i = 0; i < keyPaths.length; ++i){
|
|
if (keyPaths.indexOf(ix.keyPath[i]) === -1) return false;
|
|
}
|
|
return true;
|
|
}
|
|
return false;
|
|
}).sort(function(a, b) {
|
|
return a.keyPath.length - b.keyPath.length;
|
|
})[0];
|
|
if (compoundIndex && this.db._maxKey !== maxString) {
|
|
var keyPathsInValidOrder = compoundIndex.keyPath.slice(0, keyPaths.length);
|
|
return this.where(keyPathsInValidOrder).equals(keyPathsInValidOrder.map(function(kp) {
|
|
return indexOrCrit[kp];
|
|
}));
|
|
}
|
|
if (!compoundIndex && debug) console.warn("The query ".concat(JSON.stringify(indexOrCrit), " on ").concat(this.name, " would benefit from a ") + "compound index [".concat(keyPaths.join('+'), "]"));
|
|
var idxByName = this.schema.idxByName;
|
|
function equals(a, b) {
|
|
return cmp(a, b) === 0;
|
|
}
|
|
var _a = keyPaths.reduce(function(_a, keyPath) {
|
|
var prevIndex = _a[0], prevFilterFn = _a[1];
|
|
var index = idxByName[keyPath];
|
|
var value = indexOrCrit[keyPath];
|
|
return [
|
|
prevIndex || index,
|
|
prevIndex || !index ? combine(prevFilterFn, index && index.multi ? function(x) {
|
|
var prop = getByKeyPath(x, keyPath);
|
|
return isArray(prop) && prop.some(function(item) {
|
|
return equals(value, item);
|
|
});
|
|
} : function(x) {
|
|
return equals(value, getByKeyPath(x, keyPath));
|
|
}) : prevFilterFn
|
|
];
|
|
}, [
|
|
null,
|
|
null
|
|
]), idx = _a[0], filterFunction = _a[1];
|
|
return idx ? this.where(idx.name).equals(indexOrCrit[idx.keyPath]).filter(filterFunction) : compoundIndex ? this.filter(filterFunction) : this.where(keyPaths).equals('');
|
|
};
|
|
Table.prototype.filter = function(filterFunction) {
|
|
return this.toCollection().and(filterFunction);
|
|
};
|
|
Table.prototype.count = function(thenShortcut) {
|
|
return this.toCollection().count(thenShortcut);
|
|
};
|
|
Table.prototype.offset = function(offset) {
|
|
return this.toCollection().offset(offset);
|
|
};
|
|
Table.prototype.limit = function(numRows) {
|
|
return this.toCollection().limit(numRows);
|
|
};
|
|
Table.prototype.each = function(callback) {
|
|
return this.toCollection().each(callback);
|
|
};
|
|
Table.prototype.toArray = function(thenShortcut) {
|
|
return this.toCollection().toArray(thenShortcut);
|
|
};
|
|
Table.prototype.toCollection = function() {
|
|
return new this.db.Collection(new this.db.WhereClause(this));
|
|
};
|
|
Table.prototype.orderBy = function(index) {
|
|
return new this.db.Collection(new this.db.WhereClause(this, isArray(index) ? "[".concat(index.join('+'), "]") : index));
|
|
};
|
|
Table.prototype.reverse = function() {
|
|
return this.toCollection().reverse();
|
|
};
|
|
Table.prototype.mapToClass = function(constructor) {
|
|
var _a = this, db = _a.db, tableName = _a.name;
|
|
this.schema.mappedClass = constructor;
|
|
if (constructor.prototype instanceof Entity) {
|
|
constructor = function(_super) {
|
|
__extends(class_1, _super);
|
|
function class_1() {
|
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
}
|
|
Object.defineProperty(class_1.prototype, "db", {
|
|
get: function() {
|
|
return db;
|
|
},
|
|
enumerable: false,
|
|
configurable: true
|
|
});
|
|
class_1.prototype.table = function() {
|
|
return tableName;
|
|
};
|
|
return class_1;
|
|
}(constructor);
|
|
}
|
|
var inheritedProps = new Set();
|
|
for(var proto = constructor.prototype; proto; proto = getProto(proto)){
|
|
Object.getOwnPropertyNames(proto).forEach(function(propName) {
|
|
return inheritedProps.add(propName);
|
|
});
|
|
}
|
|
var readHook = function(obj) {
|
|
if (!obj) return obj;
|
|
var res = Object.create(constructor.prototype);
|
|
for(var m in obj)if (!inheritedProps.has(m)) try {
|
|
res[m] = obj[m];
|
|
} catch (_) {}
|
|
return res;
|
|
};
|
|
if (this.schema.readHook) {
|
|
this.hook.reading.unsubscribe(this.schema.readHook);
|
|
}
|
|
this.schema.readHook = readHook;
|
|
this.hook("reading", readHook);
|
|
return constructor;
|
|
};
|
|
Table.prototype.defineClass = function() {
|
|
function Class(content) {
|
|
extend(this, content);
|
|
}
|
|
return this.mapToClass(Class);
|
|
};
|
|
Table.prototype.add = function(obj, key) {
|
|
var _this = this;
|
|
var _a = this.schema.primKey, auto = _a.auto, keyPath = _a.keyPath;
|
|
var objToAdd = obj;
|
|
if (keyPath && auto) {
|
|
objToAdd = workaroundForUndefinedPrimKey(keyPath)(obj);
|
|
}
|
|
return this._trans('readwrite', function(trans) {
|
|
return _this.core.mutate({
|
|
trans: trans,
|
|
type: 'add',
|
|
keys: key != null ? [
|
|
key
|
|
] : null,
|
|
values: [
|
|
objToAdd
|
|
]
|
|
});
|
|
}).then(function(res) {
|
|
return res.numFailures ? DexiePromise.reject(res.failures[0]) : res.lastResult;
|
|
}).then(function(lastResult) {
|
|
if (keyPath) {
|
|
try {
|
|
setByKeyPath(obj, keyPath, lastResult);
|
|
} catch (_) {}
|
|
}
|
|
return lastResult;
|
|
});
|
|
};
|
|
Table.prototype.upsert = function(key, modifications) {
|
|
var _this = this;
|
|
var keyPath = this.schema.primKey.keyPath;
|
|
return this._trans('readwrite', function(trans) {
|
|
return _this.core.get({
|
|
trans: trans,
|
|
key: key
|
|
}).then(function(existing) {
|
|
var obj = existing !== null && existing !== void 0 ? existing : {};
|
|
applyUpdateSpec(obj, modifications);
|
|
if (keyPath) setByKeyPath(obj, keyPath, key);
|
|
return _this.core.mutate({
|
|
trans: trans,
|
|
type: 'put',
|
|
values: [
|
|
obj
|
|
],
|
|
keys: [
|
|
key
|
|
],
|
|
upsert: true,
|
|
updates: {
|
|
keys: [
|
|
key
|
|
],
|
|
changeSpecs: [
|
|
modifications
|
|
]
|
|
}
|
|
}).then(function(res) {
|
|
return res.numFailures ? DexiePromise.reject(res.failures[0]) : !!existing;
|
|
});
|
|
});
|
|
});
|
|
};
|
|
Table.prototype.update = function(keyOrObject, modifications) {
|
|
if (typeof keyOrObject === 'object' && !isArray(keyOrObject)) {
|
|
var key = getByKeyPath(keyOrObject, this.schema.primKey.keyPath);
|
|
if (key === undefined) return rejection(new exceptions.InvalidArgument("Given object does not contain its primary key"));
|
|
return this.where(":id").equals(key).modify(modifications);
|
|
} else {
|
|
return this.where(":id").equals(keyOrObject).modify(modifications);
|
|
}
|
|
};
|
|
Table.prototype.put = function(obj, key) {
|
|
var _this = this;
|
|
var _a = this.schema.primKey, auto = _a.auto, keyPath = _a.keyPath;
|
|
var objToAdd = obj;
|
|
if (keyPath && auto) {
|
|
objToAdd = workaroundForUndefinedPrimKey(keyPath)(obj);
|
|
}
|
|
return this._trans('readwrite', function(trans) {
|
|
return _this.core.mutate({
|
|
trans: trans,
|
|
type: 'put',
|
|
values: [
|
|
objToAdd
|
|
],
|
|
keys: key != null ? [
|
|
key
|
|
] : null
|
|
});
|
|
}).then(function(res) {
|
|
return res.numFailures ? DexiePromise.reject(res.failures[0]) : res.lastResult;
|
|
}).then(function(lastResult) {
|
|
if (keyPath) {
|
|
try {
|
|
setByKeyPath(obj, keyPath, lastResult);
|
|
} catch (_) {}
|
|
}
|
|
return lastResult;
|
|
});
|
|
};
|
|
Table.prototype.delete = function(key) {
|
|
var _this = this;
|
|
return this._trans('readwrite', function(trans) {
|
|
return _this.core.mutate({
|
|
trans: trans,
|
|
type: 'delete',
|
|
keys: [
|
|
key
|
|
]
|
|
}).then(function(res) {
|
|
return builtInDeletionTrigger(_this, [
|
|
key
|
|
], res);
|
|
}).then(function(res) {
|
|
return res.numFailures ? DexiePromise.reject(res.failures[0]) : undefined;
|
|
});
|
|
});
|
|
};
|
|
Table.prototype.clear = function() {
|
|
var _this = this;
|
|
return this._trans('readwrite', function(trans) {
|
|
return _this.core.mutate({
|
|
trans: trans,
|
|
type: 'deleteRange',
|
|
range: AnyRange
|
|
}).then(function(res) {
|
|
return builtInDeletionTrigger(_this, null, res);
|
|
});
|
|
}).then(function(res) {
|
|
return res.numFailures ? DexiePromise.reject(res.failures[0]) : undefined;
|
|
});
|
|
};
|
|
Table.prototype.bulkGet = function(keys) {
|
|
var _this = this;
|
|
return this._trans('readonly', function(trans) {
|
|
return _this.core.getMany({
|
|
keys: keys,
|
|
trans: trans
|
|
}).then(function(result) {
|
|
return result.map(function(res) {
|
|
return _this.hook.reading.fire(res);
|
|
});
|
|
});
|
|
});
|
|
};
|
|
Table.prototype.bulkAdd = function(objects, keysOrOptions, options) {
|
|
var _this = this;
|
|
var keys = Array.isArray(keysOrOptions) ? keysOrOptions : undefined;
|
|
options = options || (keys ? undefined : keysOrOptions);
|
|
var wantResults = options ? options.allKeys : undefined;
|
|
return this._trans('readwrite', function(trans) {
|
|
var _a = _this.schema.primKey, auto = _a.auto, keyPath = _a.keyPath;
|
|
if (keyPath && keys) throw new exceptions.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");
|
|
if (keys && keys.length !== objects.length) throw new exceptions.InvalidArgument("Arguments objects and keys must have the same length");
|
|
var numObjects = objects.length;
|
|
var objectsToAdd = keyPath && auto ? objects.map(workaroundForUndefinedPrimKey(keyPath)) : objects;
|
|
return _this.core.mutate({
|
|
trans: trans,
|
|
type: 'add',
|
|
keys: keys,
|
|
values: objectsToAdd,
|
|
wantResults: wantResults
|
|
}).then(function(_a) {
|
|
var numFailures = _a.numFailures, results = _a.results, lastResult = _a.lastResult, failures = _a.failures;
|
|
var result = wantResults ? results : lastResult;
|
|
if (numFailures === 0) return result;
|
|
throw new BulkError("".concat(_this.name, ".bulkAdd(): ").concat(numFailures, " of ").concat(numObjects, " operations failed"), failures);
|
|
});
|
|
});
|
|
};
|
|
Table.prototype.bulkPut = function(objects, keysOrOptions, options) {
|
|
var _this = this;
|
|
var keys = Array.isArray(keysOrOptions) ? keysOrOptions : undefined;
|
|
options = options || (keys ? undefined : keysOrOptions);
|
|
var wantResults = options ? options.allKeys : undefined;
|
|
return this._trans('readwrite', function(trans) {
|
|
var _a = _this.schema.primKey, auto = _a.auto, keyPath = _a.keyPath;
|
|
if (keyPath && keys) throw new exceptions.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");
|
|
if (keys && keys.length !== objects.length) throw new exceptions.InvalidArgument("Arguments objects and keys must have the same length");
|
|
var numObjects = objects.length;
|
|
var objectsToPut = keyPath && auto ? objects.map(workaroundForUndefinedPrimKey(keyPath)) : objects;
|
|
return _this.core.mutate({
|
|
trans: trans,
|
|
type: 'put',
|
|
keys: keys,
|
|
values: objectsToPut,
|
|
wantResults: wantResults
|
|
}).then(function(_a) {
|
|
var numFailures = _a.numFailures, results = _a.results, lastResult = _a.lastResult, failures = _a.failures;
|
|
var result = wantResults ? results : lastResult;
|
|
if (numFailures === 0) return result;
|
|
throw new BulkError("".concat(_this.name, ".bulkPut(): ").concat(numFailures, " of ").concat(numObjects, " operations failed"), failures);
|
|
});
|
|
});
|
|
};
|
|
Table.prototype.bulkUpdate = function(keysAndChanges) {
|
|
var _this = this;
|
|
var coreTable = this.core;
|
|
var keys = keysAndChanges.map(function(entry) {
|
|
return entry.key;
|
|
});
|
|
var changeSpecs = keysAndChanges.map(function(entry) {
|
|
return entry.changes;
|
|
});
|
|
var offsetMap = [];
|
|
return this._trans('readwrite', function(trans) {
|
|
return coreTable.getMany({
|
|
trans: trans,
|
|
keys: keys,
|
|
cache: 'clone'
|
|
}).then(function(objs) {
|
|
var resultKeys = [];
|
|
var resultObjs = [];
|
|
keysAndChanges.forEach(function(_a, idx) {
|
|
var key = _a.key, changes = _a.changes;
|
|
var obj = objs[idx];
|
|
if (obj) {
|
|
for(var _i = 0, _b = Object.keys(changes); _i < _b.length; _i++){
|
|
var keyPath = _b[_i];
|
|
var value = changes[keyPath];
|
|
if (keyPath === _this.schema.primKey.keyPath) {
|
|
if (cmp(value, key) !== 0) {
|
|
throw new exceptions.Constraint("Cannot update primary key in bulkUpdate()");
|
|
}
|
|
} else {
|
|
setByKeyPath(obj, keyPath, value);
|
|
}
|
|
}
|
|
offsetMap.push(idx);
|
|
resultKeys.push(key);
|
|
resultObjs.push(obj);
|
|
}
|
|
});
|
|
var numEntries = resultKeys.length;
|
|
return coreTable.mutate({
|
|
trans: trans,
|
|
type: 'put',
|
|
keys: resultKeys,
|
|
values: resultObjs,
|
|
updates: {
|
|
keys: keys,
|
|
changeSpecs: changeSpecs
|
|
}
|
|
}).then(function(_a) {
|
|
var numFailures = _a.numFailures, failures = _a.failures;
|
|
if (numFailures === 0) return numEntries;
|
|
for(var _i = 0, _b = Object.keys(failures); _i < _b.length; _i++){
|
|
var offset = _b[_i];
|
|
var mappedOffset = offsetMap[Number(offset)];
|
|
if (mappedOffset != null) {
|
|
var failure = failures[offset];
|
|
delete failures[offset];
|
|
failures[mappedOffset] = failure;
|
|
}
|
|
}
|
|
throw new BulkError("".concat(_this.name, ".bulkUpdate(): ").concat(numFailures, " of ").concat(numEntries, " operations failed"), failures);
|
|
});
|
|
});
|
|
});
|
|
};
|
|
Table.prototype.bulkDelete = function(keys) {
|
|
var _this = this;
|
|
var numKeys = keys.length;
|
|
return this._trans('readwrite', function(trans) {
|
|
return _this.core.mutate({
|
|
trans: trans,
|
|
type: 'delete',
|
|
keys: keys
|
|
}).then(function(res) {
|
|
return builtInDeletionTrigger(_this, keys, res);
|
|
});
|
|
}).then(function(_a) {
|
|
var numFailures = _a.numFailures, lastResult = _a.lastResult, failures = _a.failures;
|
|
if (numFailures === 0) return lastResult;
|
|
throw new BulkError("".concat(_this.name, ".bulkDelete(): ").concat(numFailures, " of ").concat(numKeys, " operations failed"), failures);
|
|
});
|
|
};
|
|
return Table;
|
|
}();
|
|
function Events(ctx) {
|
|
var evs = {};
|
|
var rv = function(eventName, subscriber) {
|
|
if (subscriber) {
|
|
var i = arguments.length, args = new Array(i - 1);
|
|
while(--i)args[i - 1] = arguments[i];
|
|
evs[eventName].subscribe.apply(null, args);
|
|
return ctx;
|
|
} else if (typeof eventName === 'string') {
|
|
return evs[eventName];
|
|
}
|
|
};
|
|
rv.addEventType = add;
|
|
for(var i = 1, l = arguments.length; i < l; ++i){
|
|
add(arguments[i]);
|
|
}
|
|
return rv;
|
|
//TURBOPACK unreachable
|
|
;
|
|
function add(eventName, chainFunction, defaultFunction) {
|
|
if (typeof eventName === 'object') return addConfiguredEvents(eventName);
|
|
if (!chainFunction) chainFunction = reverseStoppableEventChain;
|
|
if (!defaultFunction) defaultFunction = nop;
|
|
var context = {
|
|
subscribers: [],
|
|
fire: defaultFunction,
|
|
subscribe: function(cb) {
|
|
if (context.subscribers.indexOf(cb) === -1) {
|
|
context.subscribers.push(cb);
|
|
context.fire = chainFunction(context.fire, cb);
|
|
}
|
|
},
|
|
unsubscribe: function(cb) {
|
|
context.subscribers = context.subscribers.filter(function(fn) {
|
|
return fn !== cb;
|
|
});
|
|
context.fire = context.subscribers.reduce(chainFunction, defaultFunction);
|
|
}
|
|
};
|
|
evs[eventName] = rv[eventName] = context;
|
|
return context;
|
|
}
|
|
function addConfiguredEvents(cfg) {
|
|
keys(cfg).forEach(function(eventName) {
|
|
var args = cfg[eventName];
|
|
if (isArray(args)) {
|
|
add(eventName, cfg[eventName][0], cfg[eventName][1]);
|
|
} else if (args === 'asap') {
|
|
var context = add(eventName, mirror, function fire() {
|
|
var i = arguments.length, args = new Array(i);
|
|
while(i--)args[i] = arguments[i];
|
|
context.subscribers.forEach(function(fn) {
|
|
asap$1(function fireEvent() {
|
|
fn.apply(null, args);
|
|
});
|
|
});
|
|
});
|
|
} else throw new exceptions.InvalidArgument("Invalid event config");
|
|
});
|
|
}
|
|
}
|
|
function makeClassConstructor(prototype, constructor) {
|
|
derive(constructor).from({
|
|
prototype: prototype
|
|
});
|
|
return constructor;
|
|
}
|
|
function createTableConstructor(db) {
|
|
return makeClassConstructor(Table.prototype, function Table(name, tableSchema, trans) {
|
|
this.db = db;
|
|
this._tx = trans;
|
|
this.name = name;
|
|
this.schema = tableSchema;
|
|
this.hook = db._allTables[name] ? db._allTables[name].hook : Events(null, {
|
|
"creating": [
|
|
hookCreatingChain,
|
|
nop
|
|
],
|
|
"reading": [
|
|
pureFunctionChain,
|
|
mirror
|
|
],
|
|
"updating": [
|
|
hookUpdatingChain,
|
|
nop
|
|
],
|
|
"deleting": [
|
|
hookDeletingChain,
|
|
nop
|
|
]
|
|
});
|
|
});
|
|
}
|
|
function isPlainKeyRange(ctx, ignoreLimitFilter) {
|
|
return !(ctx.filter || ctx.algorithm || ctx.or) && (ignoreLimitFilter ? ctx.justLimit : !ctx.replayFilter);
|
|
}
|
|
function addFilter(ctx, fn) {
|
|
ctx.filter = combine(ctx.filter, fn);
|
|
}
|
|
function addReplayFilter(ctx, factory, isLimitFilter) {
|
|
var curr = ctx.replayFilter;
|
|
ctx.replayFilter = curr ? function() {
|
|
return combine(curr(), factory());
|
|
} : factory;
|
|
ctx.justLimit = isLimitFilter && !curr;
|
|
}
|
|
function addMatchFilter(ctx, fn) {
|
|
ctx.isMatch = combine(ctx.isMatch, fn);
|
|
}
|
|
function getIndexOrStore(ctx, coreSchema) {
|
|
if (ctx.isPrimKey) return coreSchema.primaryKey;
|
|
var index = coreSchema.getIndexByKeyPath(ctx.index);
|
|
if (!index) throw new exceptions.Schema("KeyPath " + ctx.index + " on object store " + coreSchema.name + " is not indexed");
|
|
return index;
|
|
}
|
|
function openCursor(ctx, coreTable, trans) {
|
|
var index = getIndexOrStore(ctx, coreTable.schema);
|
|
return coreTable.openCursor({
|
|
trans: trans,
|
|
values: !ctx.keysOnly,
|
|
reverse: ctx.dir === 'prev',
|
|
unique: !!ctx.unique,
|
|
query: {
|
|
index: index,
|
|
range: ctx.range
|
|
}
|
|
});
|
|
}
|
|
function iter(ctx, fn, coreTrans, coreTable) {
|
|
var filter = ctx.replayFilter ? combine(ctx.filter, ctx.replayFilter()) : ctx.filter;
|
|
if (!ctx.or) {
|
|
return iterate(openCursor(ctx, coreTable, coreTrans), combine(ctx.algorithm, filter), fn, !ctx.keysOnly && ctx.valueMapper);
|
|
} else {
|
|
var set_1 = {};
|
|
var union = function(item, cursor, advance) {
|
|
if (!filter || filter(cursor, advance, function(result) {
|
|
return cursor.stop(result);
|
|
}, function(err) {
|
|
return cursor.fail(err);
|
|
})) {
|
|
var primaryKey = cursor.primaryKey;
|
|
var key = '' + primaryKey;
|
|
if (key === '[object ArrayBuffer]') key = '' + new Uint8Array(primaryKey);
|
|
if (!hasOwn(set_1, key)) {
|
|
set_1[key] = true;
|
|
fn(item, cursor, advance);
|
|
}
|
|
}
|
|
};
|
|
return Promise.all([
|
|
ctx.or._iterate(union, coreTrans),
|
|
iterate(openCursor(ctx, coreTable, coreTrans), ctx.algorithm, union, !ctx.keysOnly && ctx.valueMapper)
|
|
]);
|
|
}
|
|
}
|
|
function iterate(cursorPromise, filter, fn, valueMapper) {
|
|
var mappedFn = valueMapper ? function(x, c, a) {
|
|
return fn(valueMapper(x), c, a);
|
|
} : fn;
|
|
var wrappedFn = wrap(mappedFn);
|
|
return cursorPromise.then(function(cursor) {
|
|
if (cursor) {
|
|
return cursor.start(function() {
|
|
var c = function() {
|
|
return cursor.continue();
|
|
};
|
|
if (!filter || filter(cursor, function(advancer) {
|
|
return c = advancer;
|
|
}, function(val) {
|
|
cursor.stop(val);
|
|
c = nop;
|
|
}, function(e) {
|
|
cursor.fail(e);
|
|
c = nop;
|
|
})) wrappedFn(cursor.value, cursor, function(advancer) {
|
|
return c = advancer;
|
|
});
|
|
c();
|
|
});
|
|
}
|
|
});
|
|
}
|
|
var Collection = function() {
|
|
function Collection() {}
|
|
Collection.prototype._read = function(fn, cb) {
|
|
var ctx = this._ctx;
|
|
return ctx.error ? ctx.table._trans(null, rejection.bind(null, ctx.error)) : ctx.table._trans('readonly', fn).then(cb);
|
|
};
|
|
Collection.prototype._write = function(fn) {
|
|
var ctx = this._ctx;
|
|
return ctx.error ? ctx.table._trans(null, rejection.bind(null, ctx.error)) : ctx.table._trans('readwrite', fn, "locked");
|
|
};
|
|
Collection.prototype._addAlgorithm = function(fn) {
|
|
var ctx = this._ctx;
|
|
ctx.algorithm = combine(ctx.algorithm, fn);
|
|
};
|
|
Collection.prototype._iterate = function(fn, coreTrans) {
|
|
return iter(this._ctx, fn, coreTrans, this._ctx.table.core);
|
|
};
|
|
Collection.prototype.clone = function(props) {
|
|
var rv = Object.create(this.constructor.prototype), ctx = Object.create(this._ctx);
|
|
if (props) extend(ctx, props);
|
|
rv._ctx = ctx;
|
|
return rv;
|
|
};
|
|
Collection.prototype.raw = function() {
|
|
this._ctx.valueMapper = null;
|
|
return this;
|
|
};
|
|
Collection.prototype.each = function(fn) {
|
|
var ctx = this._ctx;
|
|
return this._read(function(trans) {
|
|
return iter(ctx, fn, trans, ctx.table.core);
|
|
});
|
|
};
|
|
Collection.prototype.count = function(cb) {
|
|
var _this = this;
|
|
return this._read(function(trans) {
|
|
var ctx = _this._ctx;
|
|
var coreTable = ctx.table.core;
|
|
if (isPlainKeyRange(ctx, true)) {
|
|
return coreTable.count({
|
|
trans: trans,
|
|
query: {
|
|
index: getIndexOrStore(ctx, coreTable.schema),
|
|
range: ctx.range
|
|
}
|
|
}).then(function(count) {
|
|
return Math.min(count, ctx.limit);
|
|
});
|
|
} else {
|
|
var count = 0;
|
|
return iter(ctx, function() {
|
|
++count;
|
|
return false;
|
|
}, trans, coreTable).then(function() {
|
|
return count;
|
|
});
|
|
}
|
|
}).then(cb);
|
|
};
|
|
Collection.prototype.sortBy = function(keyPath, cb) {
|
|
var parts = keyPath.split('.').reverse(), lastPart = parts[0], lastIndex = parts.length - 1;
|
|
function getval(obj, i) {
|
|
if (i) return getval(obj[parts[i]], i - 1);
|
|
return obj[lastPart];
|
|
}
|
|
var order = this._ctx.dir === "next" ? 1 : -1;
|
|
function sorter(a, b) {
|
|
var aVal = getval(a, lastIndex), bVal = getval(b, lastIndex);
|
|
return cmp(aVal, bVal) * order;
|
|
}
|
|
return this.toArray(function(a) {
|
|
return a.sort(sorter);
|
|
}).then(cb);
|
|
};
|
|
Collection.prototype.toArray = function(cb) {
|
|
var _this = this;
|
|
return this._read(function(trans) {
|
|
var ctx = _this._ctx;
|
|
if (ctx.dir === 'next' && isPlainKeyRange(ctx, true) && ctx.limit > 0) {
|
|
var valueMapper_1 = ctx.valueMapper;
|
|
var index = getIndexOrStore(ctx, ctx.table.core.schema);
|
|
return ctx.table.core.query({
|
|
trans: trans,
|
|
limit: ctx.limit,
|
|
values: true,
|
|
query: {
|
|
index: index,
|
|
range: ctx.range
|
|
}
|
|
}).then(function(_a) {
|
|
var result = _a.result;
|
|
return valueMapper_1 ? result.map(valueMapper_1) : result;
|
|
});
|
|
} else {
|
|
var a_1 = [];
|
|
return iter(ctx, function(item) {
|
|
return a_1.push(item);
|
|
}, trans, ctx.table.core).then(function() {
|
|
return a_1;
|
|
});
|
|
}
|
|
}, cb);
|
|
};
|
|
Collection.prototype.offset = function(offset) {
|
|
var ctx = this._ctx;
|
|
if (offset <= 0) return this;
|
|
ctx.offset += offset;
|
|
if (isPlainKeyRange(ctx)) {
|
|
addReplayFilter(ctx, function() {
|
|
var offsetLeft = offset;
|
|
return function(cursor, advance) {
|
|
if (offsetLeft === 0) return true;
|
|
if (offsetLeft === 1) {
|
|
--offsetLeft;
|
|
return false;
|
|
}
|
|
advance(function() {
|
|
cursor.advance(offsetLeft);
|
|
offsetLeft = 0;
|
|
});
|
|
return false;
|
|
};
|
|
});
|
|
} else {
|
|
addReplayFilter(ctx, function() {
|
|
var offsetLeft = offset;
|
|
return function() {
|
|
return --offsetLeft < 0;
|
|
};
|
|
});
|
|
}
|
|
return this;
|
|
};
|
|
Collection.prototype.limit = function(numRows) {
|
|
this._ctx.limit = Math.min(this._ctx.limit, numRows);
|
|
addReplayFilter(this._ctx, function() {
|
|
var rowsLeft = numRows;
|
|
return function(cursor, advance, resolve) {
|
|
if (--rowsLeft <= 0) advance(resolve);
|
|
return rowsLeft >= 0;
|
|
};
|
|
}, true);
|
|
return this;
|
|
};
|
|
Collection.prototype.until = function(filterFunction, bIncludeStopEntry) {
|
|
addFilter(this._ctx, function(cursor, advance, resolve) {
|
|
if (filterFunction(cursor.value)) {
|
|
advance(resolve);
|
|
return bIncludeStopEntry;
|
|
} else {
|
|
return true;
|
|
}
|
|
});
|
|
return this;
|
|
};
|
|
Collection.prototype.first = function(cb) {
|
|
return this.limit(1).toArray(function(a) {
|
|
return a[0];
|
|
}).then(cb);
|
|
};
|
|
Collection.prototype.last = function(cb) {
|
|
return this.reverse().first(cb);
|
|
};
|
|
Collection.prototype.filter = function(filterFunction) {
|
|
addFilter(this._ctx, function(cursor) {
|
|
return filterFunction(cursor.value);
|
|
});
|
|
addMatchFilter(this._ctx, filterFunction);
|
|
return this;
|
|
};
|
|
Collection.prototype.and = function(filter) {
|
|
return this.filter(filter);
|
|
};
|
|
Collection.prototype.or = function(indexName) {
|
|
return new this.db.WhereClause(this._ctx.table, indexName, this);
|
|
};
|
|
Collection.prototype.reverse = function() {
|
|
this._ctx.dir = this._ctx.dir === "prev" ? "next" : "prev";
|
|
if (this._ondirectionchange) this._ondirectionchange(this._ctx.dir);
|
|
return this;
|
|
};
|
|
Collection.prototype.desc = function() {
|
|
return this.reverse();
|
|
};
|
|
Collection.prototype.eachKey = function(cb) {
|
|
var ctx = this._ctx;
|
|
ctx.keysOnly = !ctx.isMatch;
|
|
return this.each(function(val, cursor) {
|
|
cb(cursor.key, cursor);
|
|
});
|
|
};
|
|
Collection.prototype.eachUniqueKey = function(cb) {
|
|
this._ctx.unique = "unique";
|
|
return this.eachKey(cb);
|
|
};
|
|
Collection.prototype.eachPrimaryKey = function(cb) {
|
|
var ctx = this._ctx;
|
|
ctx.keysOnly = !ctx.isMatch;
|
|
return this.each(function(val, cursor) {
|
|
cb(cursor.primaryKey, cursor);
|
|
});
|
|
};
|
|
Collection.prototype.keys = function(cb) {
|
|
var ctx = this._ctx;
|
|
ctx.keysOnly = !ctx.isMatch;
|
|
var a = [];
|
|
return this.each(function(item, cursor) {
|
|
a.push(cursor.key);
|
|
}).then(function() {
|
|
return a;
|
|
}).then(cb);
|
|
};
|
|
Collection.prototype.primaryKeys = function(cb) {
|
|
var ctx = this._ctx;
|
|
if (ctx.dir === 'next' && isPlainKeyRange(ctx, true) && ctx.limit > 0) {
|
|
return this._read(function(trans) {
|
|
var index = getIndexOrStore(ctx, ctx.table.core.schema);
|
|
return ctx.table.core.query({
|
|
trans: trans,
|
|
values: false,
|
|
limit: ctx.limit,
|
|
query: {
|
|
index: index,
|
|
range: ctx.range
|
|
}
|
|
});
|
|
}).then(function(_a) {
|
|
var result = _a.result;
|
|
return result;
|
|
}).then(cb);
|
|
}
|
|
ctx.keysOnly = !ctx.isMatch;
|
|
var a = [];
|
|
return this.each(function(item, cursor) {
|
|
a.push(cursor.primaryKey);
|
|
}).then(function() {
|
|
return a;
|
|
}).then(cb);
|
|
};
|
|
Collection.prototype.uniqueKeys = function(cb) {
|
|
this._ctx.unique = "unique";
|
|
return this.keys(cb);
|
|
};
|
|
Collection.prototype.firstKey = function(cb) {
|
|
return this.limit(1).keys(function(a) {
|
|
return a[0];
|
|
}).then(cb);
|
|
};
|
|
Collection.prototype.lastKey = function(cb) {
|
|
return this.reverse().firstKey(cb);
|
|
};
|
|
Collection.prototype.distinct = function() {
|
|
var ctx = this._ctx, idx = ctx.index && ctx.table.schema.idxByName[ctx.index];
|
|
if (!idx || !idx.multi) return this;
|
|
var set = {};
|
|
addFilter(this._ctx, function(cursor) {
|
|
var strKey = cursor.primaryKey.toString();
|
|
var found = hasOwn(set, strKey);
|
|
set[strKey] = true;
|
|
return !found;
|
|
});
|
|
return this;
|
|
};
|
|
Collection.prototype.modify = function(changes) {
|
|
var _this = this;
|
|
var ctx = this._ctx;
|
|
return this._write(function(trans) {
|
|
var modifyer;
|
|
if (typeof changes === 'function') {
|
|
modifyer = changes;
|
|
} else {
|
|
modifyer = function(item) {
|
|
return applyUpdateSpec(item, changes);
|
|
};
|
|
}
|
|
var coreTable = ctx.table.core;
|
|
var _a = coreTable.schema.primaryKey, outbound = _a.outbound, extractKey = _a.extractKey;
|
|
var limit = 200;
|
|
var modifyChunkSize = _this.db._options.modifyChunkSize;
|
|
if (modifyChunkSize) {
|
|
if (typeof modifyChunkSize == 'object') {
|
|
limit = modifyChunkSize[coreTable.name] || modifyChunkSize['*'] || 200;
|
|
} else {
|
|
limit = modifyChunkSize;
|
|
}
|
|
}
|
|
var totalFailures = [];
|
|
var successCount = 0;
|
|
var failedKeys = [];
|
|
var applyMutateResult = function(expectedCount, res) {
|
|
var failures = res.failures, numFailures = res.numFailures;
|
|
successCount += expectedCount - numFailures;
|
|
for(var _i = 0, _a = keys(failures); _i < _a.length; _i++){
|
|
var pos = _a[_i];
|
|
totalFailures.push(failures[pos]);
|
|
}
|
|
};
|
|
var isUnconditionalDelete = changes === deleteCallback;
|
|
return _this.clone().primaryKeys().then(function(keys) {
|
|
var criteria = isPlainKeyRange(ctx) && ctx.limit === Infinity && (typeof changes !== 'function' || isUnconditionalDelete) && {
|
|
index: ctx.index,
|
|
range: ctx.range
|
|
};
|
|
var nextChunk = function(offset) {
|
|
var count = Math.min(limit, keys.length - offset);
|
|
var keysInChunk = keys.slice(offset, offset + count);
|
|
return (isUnconditionalDelete ? Promise.resolve([]) : coreTable.getMany({
|
|
trans: trans,
|
|
keys: keysInChunk,
|
|
cache: "immutable"
|
|
})).then(function(values) {
|
|
var addValues = [];
|
|
var putValues = [];
|
|
var putKeys = outbound ? [] : null;
|
|
var deleteKeys = isUnconditionalDelete ? keysInChunk : [];
|
|
if (!isUnconditionalDelete) for(var i = 0; i < count; ++i){
|
|
var origValue = values[i];
|
|
var ctx_1 = {
|
|
value: deepClone(origValue),
|
|
primKey: keys[offset + i]
|
|
};
|
|
if (modifyer.call(ctx_1, ctx_1.value, ctx_1) !== false) {
|
|
if (ctx_1.value == null) {
|
|
deleteKeys.push(keys[offset + i]);
|
|
} else if (!outbound && cmp(extractKey(origValue), extractKey(ctx_1.value)) !== 0) {
|
|
deleteKeys.push(keys[offset + i]);
|
|
addValues.push(ctx_1.value);
|
|
} else {
|
|
putValues.push(ctx_1.value);
|
|
if (outbound) putKeys.push(keys[offset + i]);
|
|
}
|
|
}
|
|
}
|
|
return Promise.resolve(addValues.length > 0 && coreTable.mutate({
|
|
trans: trans,
|
|
type: 'add',
|
|
values: addValues
|
|
}).then(function(res) {
|
|
for(var pos in res.failures){
|
|
deleteKeys.splice(parseInt(pos), 1);
|
|
}
|
|
applyMutateResult(addValues.length, res);
|
|
})).then(function() {
|
|
return (putValues.length > 0 || criteria && typeof changes === 'object') && coreTable.mutate({
|
|
trans: trans,
|
|
type: 'put',
|
|
keys: putKeys,
|
|
values: putValues,
|
|
criteria: criteria,
|
|
changeSpec: typeof changes !== 'function' && changes,
|
|
isAdditionalChunk: offset > 0
|
|
}).then(function(res) {
|
|
return applyMutateResult(putValues.length, res);
|
|
});
|
|
}).then(function() {
|
|
return (deleteKeys.length > 0 || criteria && isUnconditionalDelete) && coreTable.mutate({
|
|
trans: trans,
|
|
type: 'delete',
|
|
keys: deleteKeys,
|
|
criteria: criteria,
|
|
isAdditionalChunk: offset > 0
|
|
}).then(function(res) {
|
|
return builtInDeletionTrigger(ctx.table, deleteKeys, res);
|
|
}).then(function(res) {
|
|
return applyMutateResult(deleteKeys.length, res);
|
|
});
|
|
}).then(function() {
|
|
return keys.length > offset + count && nextChunk(offset + limit);
|
|
});
|
|
});
|
|
};
|
|
return nextChunk(0).then(function() {
|
|
if (totalFailures.length > 0) throw new ModifyError("Error modifying one or more objects", totalFailures, successCount, failedKeys);
|
|
return keys.length;
|
|
});
|
|
});
|
|
});
|
|
};
|
|
Collection.prototype.delete = function() {
|
|
var ctx = this._ctx, range = ctx.range;
|
|
if (isPlainKeyRange(ctx) && !ctx.table.schema.yProps && (ctx.isPrimKey || range.type === 3)) {
|
|
return this._write(function(trans) {
|
|
var primaryKey = ctx.table.core.schema.primaryKey;
|
|
var coreRange = range;
|
|
return ctx.table.core.count({
|
|
trans: trans,
|
|
query: {
|
|
index: primaryKey,
|
|
range: coreRange
|
|
}
|
|
}).then(function(count) {
|
|
return ctx.table.core.mutate({
|
|
trans: trans,
|
|
type: 'deleteRange',
|
|
range: coreRange
|
|
}).then(function(_a) {
|
|
var failures = _a.failures, numFailures = _a.numFailures;
|
|
if (numFailures) throw new ModifyError("Could not delete some values", Object.keys(failures).map(function(pos) {
|
|
return failures[pos];
|
|
}), count - numFailures);
|
|
return count - numFailures;
|
|
});
|
|
});
|
|
});
|
|
}
|
|
return this.modify(deleteCallback);
|
|
};
|
|
return Collection;
|
|
}();
|
|
var deleteCallback = function(value, ctx) {
|
|
return ctx.value = null;
|
|
};
|
|
function createCollectionConstructor(db) {
|
|
return makeClassConstructor(Collection.prototype, function Collection(whereClause, keyRangeGenerator) {
|
|
this.db = db;
|
|
var keyRange = AnyRange, error = null;
|
|
if (keyRangeGenerator) try {
|
|
keyRange = keyRangeGenerator();
|
|
} catch (ex) {
|
|
error = ex;
|
|
}
|
|
var whereCtx = whereClause._ctx;
|
|
var table = whereCtx.table;
|
|
var readingHook = table.hook.reading.fire;
|
|
this._ctx = {
|
|
table: table,
|
|
index: whereCtx.index,
|
|
isPrimKey: !whereCtx.index || table.schema.primKey.keyPath && whereCtx.index === table.schema.primKey.name,
|
|
range: keyRange,
|
|
keysOnly: false,
|
|
dir: "next",
|
|
unique: "",
|
|
algorithm: null,
|
|
filter: null,
|
|
replayFilter: null,
|
|
justLimit: true,
|
|
isMatch: null,
|
|
offset: 0,
|
|
limit: Infinity,
|
|
error: error,
|
|
or: whereCtx.or,
|
|
valueMapper: readingHook !== mirror ? readingHook : null
|
|
};
|
|
});
|
|
}
|
|
function simpleCompare(a, b) {
|
|
return a < b ? -1 : a === b ? 0 : 1;
|
|
}
|
|
function simpleCompareReverse(a, b) {
|
|
return a > b ? -1 : a === b ? 0 : 1;
|
|
}
|
|
function fail(collectionOrWhereClause, err, T) {
|
|
var collection = collectionOrWhereClause instanceof WhereClause ? new collectionOrWhereClause.Collection(collectionOrWhereClause) : collectionOrWhereClause;
|
|
collection._ctx.error = T ? new T(err) : new TypeError(err);
|
|
return collection;
|
|
}
|
|
function emptyCollection(whereClause) {
|
|
return new whereClause.Collection(whereClause, function() {
|
|
return rangeEqual("");
|
|
}).limit(0);
|
|
}
|
|
function upperFactory(dir) {
|
|
return dir === "next" ? function(s) {
|
|
return s.toUpperCase();
|
|
} : function(s) {
|
|
return s.toLowerCase();
|
|
};
|
|
}
|
|
function lowerFactory(dir) {
|
|
return dir === "next" ? function(s) {
|
|
return s.toLowerCase();
|
|
} : function(s) {
|
|
return s.toUpperCase();
|
|
};
|
|
}
|
|
function nextCasing(key, lowerKey, upperNeedle, lowerNeedle, cmp, dir) {
|
|
var length = Math.min(key.length, lowerNeedle.length);
|
|
var llp = -1;
|
|
for(var i = 0; i < length; ++i){
|
|
var lwrKeyChar = lowerKey[i];
|
|
if (lwrKeyChar !== lowerNeedle[i]) {
|
|
if (cmp(key[i], upperNeedle[i]) < 0) return key.substr(0, i) + upperNeedle[i] + upperNeedle.substr(i + 1);
|
|
if (cmp(key[i], lowerNeedle[i]) < 0) return key.substr(0, i) + lowerNeedle[i] + upperNeedle.substr(i + 1);
|
|
if (llp >= 0) return key.substr(0, llp) + lowerKey[llp] + upperNeedle.substr(llp + 1);
|
|
return null;
|
|
}
|
|
if (cmp(key[i], lwrKeyChar) < 0) llp = i;
|
|
}
|
|
if (length < lowerNeedle.length && dir === "next") return key + upperNeedle.substr(key.length);
|
|
if (length < key.length && dir === "prev") return key.substr(0, upperNeedle.length);
|
|
return llp < 0 ? null : key.substr(0, llp) + lowerNeedle[llp] + upperNeedle.substr(llp + 1);
|
|
}
|
|
function addIgnoreCaseAlgorithm(whereClause, match, needles, suffix) {
|
|
var upper, lower, compare, upperNeedles, lowerNeedles, direction, nextKeySuffix, needlesLen = needles.length;
|
|
if (!needles.every(function(s) {
|
|
return typeof s === 'string';
|
|
})) {
|
|
return fail(whereClause, STRING_EXPECTED);
|
|
}
|
|
function initDirection(dir) {
|
|
upper = upperFactory(dir);
|
|
lower = lowerFactory(dir);
|
|
compare = dir === "next" ? simpleCompare : simpleCompareReverse;
|
|
var needleBounds = needles.map(function(needle) {
|
|
return {
|
|
lower: lower(needle),
|
|
upper: upper(needle)
|
|
};
|
|
}).sort(function(a, b) {
|
|
return compare(a.lower, b.lower);
|
|
});
|
|
upperNeedles = needleBounds.map(function(nb) {
|
|
return nb.upper;
|
|
});
|
|
lowerNeedles = needleBounds.map(function(nb) {
|
|
return nb.lower;
|
|
});
|
|
direction = dir;
|
|
nextKeySuffix = dir === "next" ? "" : suffix;
|
|
}
|
|
initDirection("next");
|
|
var c = new whereClause.Collection(whereClause, function() {
|
|
return createRange(upperNeedles[0], lowerNeedles[needlesLen - 1] + suffix);
|
|
});
|
|
c._ondirectionchange = function(direction) {
|
|
initDirection(direction);
|
|
};
|
|
var firstPossibleNeedle = 0;
|
|
c._addAlgorithm(function(cursor, advance, resolve) {
|
|
var key = cursor.key;
|
|
if (typeof key !== 'string') return false;
|
|
var lowerKey = lower(key);
|
|
if (match(lowerKey, lowerNeedles, firstPossibleNeedle)) {
|
|
return true;
|
|
} else {
|
|
var lowestPossibleCasing = null;
|
|
for(var i = firstPossibleNeedle; i < needlesLen; ++i){
|
|
var casing = nextCasing(key, lowerKey, upperNeedles[i], lowerNeedles[i], compare, direction);
|
|
if (casing === null && lowestPossibleCasing === null) firstPossibleNeedle = i + 1;
|
|
else if (lowestPossibleCasing === null || compare(lowestPossibleCasing, casing) > 0) {
|
|
lowestPossibleCasing = casing;
|
|
}
|
|
}
|
|
if (lowestPossibleCasing !== null) {
|
|
advance(function() {
|
|
cursor.continue(lowestPossibleCasing + nextKeySuffix);
|
|
});
|
|
} else {
|
|
advance(resolve);
|
|
}
|
|
return false;
|
|
}
|
|
});
|
|
return c;
|
|
}
|
|
function createRange(lower, upper, lowerOpen, upperOpen) {
|
|
return {
|
|
type: 2,
|
|
lower: lower,
|
|
upper: upper,
|
|
lowerOpen: lowerOpen,
|
|
upperOpen: upperOpen
|
|
};
|
|
}
|
|
function rangeEqual(value) {
|
|
return {
|
|
type: 1,
|
|
lower: value,
|
|
upper: value
|
|
};
|
|
}
|
|
var WhereClause = function() {
|
|
function WhereClause() {}
|
|
Object.defineProperty(WhereClause.prototype, "Collection", {
|
|
get: function() {
|
|
return this._ctx.table.db.Collection;
|
|
},
|
|
enumerable: false,
|
|
configurable: true
|
|
});
|
|
WhereClause.prototype.between = function(lower, upper, includeLower, includeUpper) {
|
|
includeLower = includeLower !== false;
|
|
includeUpper = includeUpper === true;
|
|
try {
|
|
if (this._cmp(lower, upper) > 0 || this._cmp(lower, upper) === 0 && (includeLower || includeUpper) && !(includeLower && includeUpper)) return emptyCollection(this);
|
|
return new this.Collection(this, function() {
|
|
return createRange(lower, upper, !includeLower, !includeUpper);
|
|
});
|
|
} catch (e) {
|
|
return fail(this, INVALID_KEY_ARGUMENT);
|
|
}
|
|
};
|
|
WhereClause.prototype.equals = function(value) {
|
|
if (value == null) return fail(this, INVALID_KEY_ARGUMENT);
|
|
return new this.Collection(this, function() {
|
|
return rangeEqual(value);
|
|
});
|
|
};
|
|
WhereClause.prototype.above = function(value) {
|
|
if (value == null) return fail(this, INVALID_KEY_ARGUMENT);
|
|
return new this.Collection(this, function() {
|
|
return createRange(value, undefined, true);
|
|
});
|
|
};
|
|
WhereClause.prototype.aboveOrEqual = function(value) {
|
|
if (value == null) return fail(this, INVALID_KEY_ARGUMENT);
|
|
return new this.Collection(this, function() {
|
|
return createRange(value, undefined, false);
|
|
});
|
|
};
|
|
WhereClause.prototype.below = function(value) {
|
|
if (value == null) return fail(this, INVALID_KEY_ARGUMENT);
|
|
return new this.Collection(this, function() {
|
|
return createRange(undefined, value, false, true);
|
|
});
|
|
};
|
|
WhereClause.prototype.belowOrEqual = function(value) {
|
|
if (value == null) return fail(this, INVALID_KEY_ARGUMENT);
|
|
return new this.Collection(this, function() {
|
|
return createRange(undefined, value);
|
|
});
|
|
};
|
|
WhereClause.prototype.startsWith = function(str) {
|
|
if (typeof str !== 'string') return fail(this, STRING_EXPECTED);
|
|
return this.between(str, str + maxString, true, true);
|
|
};
|
|
WhereClause.prototype.startsWithIgnoreCase = function(str) {
|
|
if (str === "") return this.startsWith(str);
|
|
return addIgnoreCaseAlgorithm(this, function(x, a) {
|
|
return x.indexOf(a[0]) === 0;
|
|
}, [
|
|
str
|
|
], maxString);
|
|
};
|
|
WhereClause.prototype.equalsIgnoreCase = function(str) {
|
|
return addIgnoreCaseAlgorithm(this, function(x, a) {
|
|
return x === a[0];
|
|
}, [
|
|
str
|
|
], "");
|
|
};
|
|
WhereClause.prototype.anyOfIgnoreCase = function() {
|
|
var set = getArrayOf.apply(NO_CHAR_ARRAY, arguments);
|
|
if (set.length === 0) return emptyCollection(this);
|
|
return addIgnoreCaseAlgorithm(this, function(x, a) {
|
|
return a.indexOf(x) !== -1;
|
|
}, set, "");
|
|
};
|
|
WhereClause.prototype.startsWithAnyOfIgnoreCase = function() {
|
|
var set = getArrayOf.apply(NO_CHAR_ARRAY, arguments);
|
|
if (set.length === 0) return emptyCollection(this);
|
|
return addIgnoreCaseAlgorithm(this, function(x, a) {
|
|
return a.some(function(n) {
|
|
return x.indexOf(n) === 0;
|
|
});
|
|
}, set, maxString);
|
|
};
|
|
WhereClause.prototype.anyOf = function() {
|
|
var _this = this;
|
|
var set = getArrayOf.apply(NO_CHAR_ARRAY, arguments);
|
|
var compare = this._cmp;
|
|
try {
|
|
set.sort(compare);
|
|
} catch (e) {
|
|
return fail(this, INVALID_KEY_ARGUMENT);
|
|
}
|
|
if (set.length === 0) return emptyCollection(this);
|
|
var c = new this.Collection(this, function() {
|
|
return createRange(set[0], set[set.length - 1]);
|
|
});
|
|
c._ondirectionchange = function(direction) {
|
|
compare = direction === "next" ? _this._ascending : _this._descending;
|
|
set.sort(compare);
|
|
};
|
|
var i = 0;
|
|
c._addAlgorithm(function(cursor, advance, resolve) {
|
|
var key = cursor.key;
|
|
while(compare(key, set[i]) > 0){
|
|
++i;
|
|
if (i === set.length) {
|
|
advance(resolve);
|
|
return false;
|
|
}
|
|
}
|
|
if (compare(key, set[i]) === 0) {
|
|
return true;
|
|
} else {
|
|
advance(function() {
|
|
cursor.continue(set[i]);
|
|
});
|
|
return false;
|
|
}
|
|
});
|
|
return c;
|
|
};
|
|
WhereClause.prototype.notEqual = function(value) {
|
|
return this.inAnyRange([
|
|
[
|
|
minKey,
|
|
value
|
|
],
|
|
[
|
|
value,
|
|
this.db._maxKey
|
|
]
|
|
], {
|
|
includeLowers: false,
|
|
includeUppers: false
|
|
});
|
|
};
|
|
WhereClause.prototype.noneOf = function() {
|
|
var set = getArrayOf.apply(NO_CHAR_ARRAY, arguments);
|
|
if (set.length === 0) return new this.Collection(this);
|
|
try {
|
|
set.sort(this._ascending);
|
|
} catch (e) {
|
|
return fail(this, INVALID_KEY_ARGUMENT);
|
|
}
|
|
var ranges = set.reduce(function(res, val) {
|
|
return res ? res.concat([
|
|
[
|
|
res[res.length - 1][1],
|
|
val
|
|
]
|
|
]) : [
|
|
[
|
|
minKey,
|
|
val
|
|
]
|
|
];
|
|
}, null);
|
|
ranges.push([
|
|
set[set.length - 1],
|
|
this.db._maxKey
|
|
]);
|
|
return this.inAnyRange(ranges, {
|
|
includeLowers: false,
|
|
includeUppers: false
|
|
});
|
|
};
|
|
WhereClause.prototype.inAnyRange = function(ranges, options) {
|
|
var _this = this;
|
|
var cmp = this._cmp, ascending = this._ascending, descending = this._descending, min = this._min, max = this._max;
|
|
if (ranges.length === 0) return emptyCollection(this);
|
|
if (!ranges.every(function(range) {
|
|
return range[0] !== undefined && range[1] !== undefined && ascending(range[0], range[1]) <= 0;
|
|
})) {
|
|
return fail(this, "First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower", exceptions.InvalidArgument);
|
|
}
|
|
var includeLowers = !options || options.includeLowers !== false;
|
|
var includeUppers = options && options.includeUppers === true;
|
|
function addRange(ranges, newRange) {
|
|
var i = 0, l = ranges.length;
|
|
for(; i < l; ++i){
|
|
var range = ranges[i];
|
|
if (cmp(newRange[0], range[1]) < 0 && cmp(newRange[1], range[0]) > 0) {
|
|
range[0] = min(range[0], newRange[0]);
|
|
range[1] = max(range[1], newRange[1]);
|
|
break;
|
|
}
|
|
}
|
|
if (i === l) ranges.push(newRange);
|
|
return ranges;
|
|
}
|
|
var sortDirection = ascending;
|
|
function rangeSorter(a, b) {
|
|
return sortDirection(a[0], b[0]);
|
|
}
|
|
var set;
|
|
try {
|
|
set = ranges.reduce(addRange, []);
|
|
set.sort(rangeSorter);
|
|
} catch (ex) {
|
|
return fail(this, INVALID_KEY_ARGUMENT);
|
|
}
|
|
var rangePos = 0;
|
|
var keyIsBeyondCurrentEntry = includeUppers ? function(key) {
|
|
return ascending(key, set[rangePos][1]) > 0;
|
|
} : function(key) {
|
|
return ascending(key, set[rangePos][1]) >= 0;
|
|
};
|
|
var keyIsBeforeCurrentEntry = includeLowers ? function(key) {
|
|
return descending(key, set[rangePos][0]) > 0;
|
|
} : function(key) {
|
|
return descending(key, set[rangePos][0]) >= 0;
|
|
};
|
|
function keyWithinCurrentRange(key) {
|
|
return !keyIsBeyondCurrentEntry(key) && !keyIsBeforeCurrentEntry(key);
|
|
}
|
|
var checkKey = keyIsBeyondCurrentEntry;
|
|
var c = new this.Collection(this, function() {
|
|
return createRange(set[0][0], set[set.length - 1][1], !includeLowers, !includeUppers);
|
|
});
|
|
c._ondirectionchange = function(direction) {
|
|
if (direction === "next") {
|
|
checkKey = keyIsBeyondCurrentEntry;
|
|
sortDirection = ascending;
|
|
} else {
|
|
checkKey = keyIsBeforeCurrentEntry;
|
|
sortDirection = descending;
|
|
}
|
|
set.sort(rangeSorter);
|
|
};
|
|
c._addAlgorithm(function(cursor, advance, resolve) {
|
|
var key = cursor.key;
|
|
while(checkKey(key)){
|
|
++rangePos;
|
|
if (rangePos === set.length) {
|
|
advance(resolve);
|
|
return false;
|
|
}
|
|
}
|
|
if (keyWithinCurrentRange(key)) {
|
|
return true;
|
|
} else if (_this._cmp(key, set[rangePos][1]) === 0 || _this._cmp(key, set[rangePos][0]) === 0) {
|
|
return false;
|
|
} else {
|
|
advance(function() {
|
|
if (sortDirection === ascending) cursor.continue(set[rangePos][0]);
|
|
else cursor.continue(set[rangePos][1]);
|
|
});
|
|
return false;
|
|
}
|
|
});
|
|
return c;
|
|
};
|
|
WhereClause.prototype.startsWithAnyOf = function() {
|
|
var set = getArrayOf.apply(NO_CHAR_ARRAY, arguments);
|
|
if (!set.every(function(s) {
|
|
return typeof s === 'string';
|
|
})) {
|
|
return fail(this, "startsWithAnyOf() only works with strings");
|
|
}
|
|
if (set.length === 0) return emptyCollection(this);
|
|
return this.inAnyRange(set.map(function(str) {
|
|
return [
|
|
str,
|
|
str + maxString
|
|
];
|
|
}));
|
|
};
|
|
return WhereClause;
|
|
}();
|
|
function createWhereClauseConstructor(db) {
|
|
return makeClassConstructor(WhereClause.prototype, function WhereClause(table, index, orCollection) {
|
|
this.db = db;
|
|
this._ctx = {
|
|
table: table,
|
|
index: index === ":id" ? null : index,
|
|
or: orCollection
|
|
};
|
|
this._cmp = this._ascending = cmp;
|
|
this._descending = function(a, b) {
|
|
return cmp(b, a);
|
|
};
|
|
this._max = function(a, b) {
|
|
return cmp(a, b) > 0 ? a : b;
|
|
};
|
|
this._min = function(a, b) {
|
|
return cmp(a, b) < 0 ? a : b;
|
|
};
|
|
this._IDBKeyRange = db._deps.IDBKeyRange;
|
|
if (!this._IDBKeyRange) throw new exceptions.MissingAPI();
|
|
});
|
|
}
|
|
function eventRejectHandler(reject) {
|
|
return wrap(function(event) {
|
|
preventDefault(event);
|
|
reject(event.target.error);
|
|
return false;
|
|
});
|
|
}
|
|
function preventDefault(event) {
|
|
if (event.stopPropagation) event.stopPropagation();
|
|
if (event.preventDefault) event.preventDefault();
|
|
}
|
|
var DEXIE_STORAGE_MUTATED_EVENT_NAME = 'storagemutated';
|
|
var STORAGE_MUTATED_DOM_EVENT_NAME = 'x-storagemutated-1';
|
|
var globalEvents = Events(null, DEXIE_STORAGE_MUTATED_EVENT_NAME);
|
|
var Transaction = function() {
|
|
function Transaction() {}
|
|
Transaction.prototype._lock = function() {
|
|
assert(!PSD.global);
|
|
++this._reculock;
|
|
if (this._reculock === 1 && !PSD.global) PSD.lockOwnerFor = this;
|
|
return this;
|
|
};
|
|
Transaction.prototype._unlock = function() {
|
|
assert(!PSD.global);
|
|
if (--this._reculock === 0) {
|
|
if (!PSD.global) PSD.lockOwnerFor = null;
|
|
while(this._blockedFuncs.length > 0 && !this._locked()){
|
|
var fnAndPSD = this._blockedFuncs.shift();
|
|
try {
|
|
usePSD(fnAndPSD[1], fnAndPSD[0]);
|
|
} catch (e) {}
|
|
}
|
|
}
|
|
return this;
|
|
};
|
|
Transaction.prototype._locked = function() {
|
|
return this._reculock && PSD.lockOwnerFor !== this;
|
|
};
|
|
Transaction.prototype.create = function(idbtrans) {
|
|
var _this = this;
|
|
if (!this.mode) return this;
|
|
var idbdb = this.db.idbdb;
|
|
var dbOpenError = this.db._state.dbOpenError;
|
|
assert(!this.idbtrans);
|
|
if (!idbtrans && !idbdb) {
|
|
switch(dbOpenError && dbOpenError.name){
|
|
case "DatabaseClosedError":
|
|
throw new exceptions.DatabaseClosed(dbOpenError);
|
|
case "MissingAPIError":
|
|
throw new exceptions.MissingAPI(dbOpenError.message, dbOpenError);
|
|
default:
|
|
throw new exceptions.OpenFailed(dbOpenError);
|
|
}
|
|
}
|
|
if (!this.active) throw new exceptions.TransactionInactive();
|
|
assert(this._completion._state === null);
|
|
idbtrans = this.idbtrans = idbtrans || (this.db.core ? this.db.core.transaction(this.storeNames, this.mode, {
|
|
durability: this.chromeTransactionDurability
|
|
}) : idbdb.transaction(this.storeNames, this.mode, {
|
|
durability: this.chromeTransactionDurability
|
|
}));
|
|
idbtrans.onerror = wrap(function(ev) {
|
|
preventDefault(ev);
|
|
_this._reject(idbtrans.error);
|
|
});
|
|
idbtrans.onabort = wrap(function(ev) {
|
|
preventDefault(ev);
|
|
_this.active && _this._reject(new exceptions.Abort(idbtrans.error));
|
|
_this.active = false;
|
|
_this.on("abort").fire(ev);
|
|
});
|
|
idbtrans.oncomplete = wrap(function() {
|
|
_this.active = false;
|
|
_this._resolve();
|
|
if ('mutatedParts' in idbtrans) {
|
|
globalEvents.storagemutated.fire(idbtrans["mutatedParts"]);
|
|
}
|
|
});
|
|
return this;
|
|
};
|
|
Transaction.prototype._promise = function(mode, fn, bWriteLock) {
|
|
var _this = this;
|
|
if (mode === 'readwrite' && this.mode !== 'readwrite') return rejection(new exceptions.ReadOnly("Transaction is readonly"));
|
|
if (!this.active) return rejection(new exceptions.TransactionInactive());
|
|
if (this._locked()) {
|
|
return new DexiePromise(function(resolve, reject) {
|
|
_this._blockedFuncs.push([
|
|
function() {
|
|
_this._promise(mode, fn, bWriteLock).then(resolve, reject);
|
|
},
|
|
PSD
|
|
]);
|
|
});
|
|
} else if (bWriteLock) {
|
|
return newScope(function() {
|
|
var p = new DexiePromise(function(resolve, reject) {
|
|
_this._lock();
|
|
var rv = fn(resolve, reject, _this);
|
|
if (rv && rv.then) rv.then(resolve, reject);
|
|
});
|
|
p.finally(function() {
|
|
return _this._unlock();
|
|
});
|
|
p._lib = true;
|
|
return p;
|
|
});
|
|
} else {
|
|
var p = new DexiePromise(function(resolve, reject) {
|
|
var rv = fn(resolve, reject, _this);
|
|
if (rv && rv.then) rv.then(resolve, reject);
|
|
});
|
|
p._lib = true;
|
|
return p;
|
|
}
|
|
};
|
|
Transaction.prototype._root = function() {
|
|
return this.parent ? this.parent._root() : this;
|
|
};
|
|
Transaction.prototype.waitFor = function(promiseLike) {
|
|
var root = this._root();
|
|
var promise = DexiePromise.resolve(promiseLike);
|
|
if (root._waitingFor) {
|
|
root._waitingFor = root._waitingFor.then(function() {
|
|
return promise;
|
|
});
|
|
} else {
|
|
root._waitingFor = promise;
|
|
root._waitingQueue = [];
|
|
var store = root.idbtrans.objectStore(root.storeNames[0]);
|
|
(function spin() {
|
|
++root._spinCount;
|
|
while(root._waitingQueue.length)root._waitingQueue.shift()();
|
|
if (root._waitingFor) store.get(-Infinity).onsuccess = spin;
|
|
})();
|
|
}
|
|
var currentWaitPromise = root._waitingFor;
|
|
return new DexiePromise(function(resolve, reject) {
|
|
promise.then(function(res) {
|
|
return root._waitingQueue.push(wrap(resolve.bind(null, res)));
|
|
}, function(err) {
|
|
return root._waitingQueue.push(wrap(reject.bind(null, err)));
|
|
}).finally(function() {
|
|
if (root._waitingFor === currentWaitPromise) {
|
|
root._waitingFor = null;
|
|
}
|
|
});
|
|
});
|
|
};
|
|
Transaction.prototype.abort = function() {
|
|
if (this.active) {
|
|
this.active = false;
|
|
if (this.idbtrans) this.idbtrans.abort();
|
|
this._reject(new exceptions.Abort());
|
|
}
|
|
};
|
|
Transaction.prototype.table = function(tableName) {
|
|
var memoizedTables = this._memoizedTables || (this._memoizedTables = {});
|
|
if (hasOwn(memoizedTables, tableName)) return memoizedTables[tableName];
|
|
var tableSchema = this.schema[tableName];
|
|
if (!tableSchema) {
|
|
throw new exceptions.NotFound("Table " + tableName + " not part of transaction");
|
|
}
|
|
var transactionBoundTable = new this.db.Table(tableName, tableSchema, this);
|
|
transactionBoundTable.core = this.db.core.table(tableName);
|
|
memoizedTables[tableName] = transactionBoundTable;
|
|
return transactionBoundTable;
|
|
};
|
|
return Transaction;
|
|
}();
|
|
function createTransactionConstructor(db) {
|
|
return makeClassConstructor(Transaction.prototype, function Transaction(mode, storeNames, dbschema, chromeTransactionDurability, parent) {
|
|
var _this = this;
|
|
if (mode !== 'readonly') storeNames.forEach(function(storeName) {
|
|
var _a;
|
|
var yProps = (_a = dbschema[storeName]) === null || _a === void 0 ? void 0 : _a.yProps;
|
|
if (yProps) storeNames = storeNames.concat(yProps.map(function(p) {
|
|
return p.updatesTable;
|
|
}));
|
|
});
|
|
this.db = db;
|
|
this.mode = mode;
|
|
this.storeNames = storeNames;
|
|
this.schema = dbschema;
|
|
this.chromeTransactionDurability = chromeTransactionDurability;
|
|
this.idbtrans = null;
|
|
this.on = Events(this, "complete", "error", "abort");
|
|
this.parent = parent || null;
|
|
this.active = true;
|
|
this._reculock = 0;
|
|
this._blockedFuncs = [];
|
|
this._resolve = null;
|
|
this._reject = null;
|
|
this._waitingFor = null;
|
|
this._waitingQueue = null;
|
|
this._spinCount = 0;
|
|
this._completion = new DexiePromise(function(resolve, reject) {
|
|
_this._resolve = resolve;
|
|
_this._reject = reject;
|
|
});
|
|
this._completion.then(function() {
|
|
_this.active = false;
|
|
_this.on.complete.fire();
|
|
}, function(e) {
|
|
var wasActive = _this.active;
|
|
_this.active = false;
|
|
_this.on.error.fire(e);
|
|
_this.parent ? _this.parent._reject(e) : wasActive && _this.idbtrans && _this.idbtrans.abort();
|
|
return rejection(e);
|
|
});
|
|
});
|
|
}
|
|
function createIndexSpec(name, keyPath, unique, multi, auto, compound, isPrimKey, type) {
|
|
return {
|
|
name: name,
|
|
keyPath: keyPath,
|
|
unique: unique,
|
|
multi: multi,
|
|
auto: auto,
|
|
compound: compound,
|
|
src: (unique && !isPrimKey ? '&' : '') + (multi ? '*' : '') + (auto ? "++" : "") + nameFromKeyPath(keyPath),
|
|
type: type
|
|
};
|
|
}
|
|
function nameFromKeyPath(keyPath) {
|
|
return typeof keyPath === 'string' ? keyPath : keyPath ? '[' + [].join.call(keyPath, '+') + ']' : "";
|
|
}
|
|
function createTableSchema(name, primKey, indexes) {
|
|
return {
|
|
name: name,
|
|
primKey: primKey,
|
|
indexes: indexes,
|
|
mappedClass: null,
|
|
idxByName: arrayToObject(indexes, function(index) {
|
|
return [
|
|
index.name,
|
|
index
|
|
];
|
|
})
|
|
};
|
|
}
|
|
function safariMultiStoreFix(storeNames) {
|
|
return storeNames.length === 1 ? storeNames[0] : storeNames;
|
|
}
|
|
var getMaxKey = function(IdbKeyRange) {
|
|
try {
|
|
IdbKeyRange.only([
|
|
[]
|
|
]);
|
|
getMaxKey = function() {
|
|
return [
|
|
[]
|
|
];
|
|
};
|
|
return [
|
|
[]
|
|
];
|
|
} catch (e) {
|
|
getMaxKey = function() {
|
|
return maxString;
|
|
};
|
|
return maxString;
|
|
}
|
|
};
|
|
function getKeyExtractor(keyPath) {
|
|
if (keyPath == null) {
|
|
return function() {
|
|
return undefined;
|
|
};
|
|
} else if (typeof keyPath === 'string') {
|
|
return getSinglePathKeyExtractor(keyPath);
|
|
} else {
|
|
return function(obj) {
|
|
return getByKeyPath(obj, keyPath);
|
|
};
|
|
}
|
|
}
|
|
function getSinglePathKeyExtractor(keyPath) {
|
|
var split = keyPath.split('.');
|
|
if (split.length === 1) {
|
|
return function(obj) {
|
|
return obj[keyPath];
|
|
};
|
|
} else {
|
|
return function(obj) {
|
|
return getByKeyPath(obj, keyPath);
|
|
};
|
|
}
|
|
}
|
|
function arrayify(arrayLike) {
|
|
return [].slice.call(arrayLike);
|
|
}
|
|
var _id_counter = 0;
|
|
function getKeyPathAlias(keyPath) {
|
|
return keyPath == null ? ":id" : typeof keyPath === 'string' ? keyPath : "[".concat(keyPath.join('+'), "]");
|
|
}
|
|
function createDBCore(db, IdbKeyRange, tmpTrans) {
|
|
function extractSchema(db, trans) {
|
|
var tables = arrayify(db.objectStoreNames);
|
|
return {
|
|
schema: {
|
|
name: db.name,
|
|
tables: tables.map(function(table) {
|
|
return trans.objectStore(table);
|
|
}).map(function(store) {
|
|
var keyPath = store.keyPath, autoIncrement = store.autoIncrement;
|
|
var compound = isArray(keyPath);
|
|
var outbound = keyPath == null;
|
|
var indexByKeyPath = {};
|
|
var result = {
|
|
name: store.name,
|
|
primaryKey: {
|
|
name: null,
|
|
isPrimaryKey: true,
|
|
outbound: outbound,
|
|
compound: compound,
|
|
keyPath: keyPath,
|
|
autoIncrement: autoIncrement,
|
|
unique: true,
|
|
extractKey: getKeyExtractor(keyPath)
|
|
},
|
|
indexes: arrayify(store.indexNames).map(function(indexName) {
|
|
return store.index(indexName);
|
|
}).map(function(index) {
|
|
var name = index.name, unique = index.unique, multiEntry = index.multiEntry, keyPath = index.keyPath;
|
|
var compound = isArray(keyPath);
|
|
var result = {
|
|
name: name,
|
|
compound: compound,
|
|
keyPath: keyPath,
|
|
unique: unique,
|
|
multiEntry: multiEntry,
|
|
extractKey: getKeyExtractor(keyPath)
|
|
};
|
|
indexByKeyPath[getKeyPathAlias(keyPath)] = result;
|
|
return result;
|
|
}),
|
|
getIndexByKeyPath: function(keyPath) {
|
|
return indexByKeyPath[getKeyPathAlias(keyPath)];
|
|
}
|
|
};
|
|
indexByKeyPath[":id"] = result.primaryKey;
|
|
if (keyPath != null) {
|
|
indexByKeyPath[getKeyPathAlias(keyPath)] = result.primaryKey;
|
|
}
|
|
return result;
|
|
})
|
|
},
|
|
hasGetAll: tables.length > 0 && 'getAll' in trans.objectStore(tables[0]) && !(typeof navigator !== 'undefined' && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604)
|
|
};
|
|
}
|
|
function makeIDBKeyRange(range) {
|
|
if (range.type === 3) return null;
|
|
if (range.type === 4) throw new Error("Cannot convert never type to IDBKeyRange");
|
|
var lower = range.lower, upper = range.upper, lowerOpen = range.lowerOpen, upperOpen = range.upperOpen;
|
|
var idbRange = lower === undefined ? upper === undefined ? null : IdbKeyRange.upperBound(upper, !!upperOpen) : upper === undefined ? IdbKeyRange.lowerBound(lower, !!lowerOpen) : IdbKeyRange.bound(lower, upper, !!lowerOpen, !!upperOpen);
|
|
return idbRange;
|
|
}
|
|
function createDbCoreTable(tableSchema) {
|
|
var tableName = tableSchema.name;
|
|
function mutate(_a) {
|
|
var trans = _a.trans, type = _a.type, keys = _a.keys, values = _a.values, range = _a.range;
|
|
return new Promise(function(resolve, reject) {
|
|
resolve = wrap(resolve);
|
|
var store = trans.objectStore(tableName);
|
|
var outbound = store.keyPath == null;
|
|
var isAddOrPut = type === "put" || type === "add";
|
|
if (!isAddOrPut && type !== 'delete' && type !== 'deleteRange') throw new Error("Invalid operation type: " + type);
|
|
var length = (keys || values || {
|
|
length: 1
|
|
}).length;
|
|
if (keys && values && keys.length !== values.length) {
|
|
throw new Error("Given keys array must have same length as given values array.");
|
|
}
|
|
if (length === 0) return resolve({
|
|
numFailures: 0,
|
|
failures: {},
|
|
results: [],
|
|
lastResult: undefined
|
|
});
|
|
var req;
|
|
var reqs = [];
|
|
var failures = [];
|
|
var numFailures = 0;
|
|
var errorHandler = function(event) {
|
|
++numFailures;
|
|
preventDefault(event);
|
|
};
|
|
if (type === 'deleteRange') {
|
|
if (range.type === 4) return resolve({
|
|
numFailures: numFailures,
|
|
failures: failures,
|
|
results: [],
|
|
lastResult: undefined
|
|
});
|
|
if (range.type === 3) reqs.push(req = store.clear());
|
|
else reqs.push(req = store.delete(makeIDBKeyRange(range)));
|
|
} else {
|
|
var _a = isAddOrPut ? outbound ? [
|
|
values,
|
|
keys
|
|
] : [
|
|
values,
|
|
null
|
|
] : [
|
|
keys,
|
|
null
|
|
], args1 = _a[0], args2 = _a[1];
|
|
if (isAddOrPut) {
|
|
for(var i = 0; i < length; ++i){
|
|
reqs.push(req = args2 && args2[i] !== undefined ? store[type](args1[i], args2[i]) : store[type](args1[i]));
|
|
req.onerror = errorHandler;
|
|
}
|
|
} else {
|
|
for(var i = 0; i < length; ++i){
|
|
reqs.push(req = store[type](args1[i]));
|
|
req.onerror = errorHandler;
|
|
}
|
|
}
|
|
}
|
|
var done = function(event) {
|
|
var lastResult = event.target.result;
|
|
reqs.forEach(function(req, i) {
|
|
return req.error != null && (failures[i] = req.error);
|
|
});
|
|
resolve({
|
|
numFailures: numFailures,
|
|
failures: failures,
|
|
results: type === "delete" ? keys : reqs.map(function(req) {
|
|
return req.result;
|
|
}),
|
|
lastResult: lastResult
|
|
});
|
|
};
|
|
req.onerror = function(event) {
|
|
errorHandler(event);
|
|
done(event);
|
|
};
|
|
req.onsuccess = done;
|
|
});
|
|
}
|
|
function openCursor(_a) {
|
|
var trans = _a.trans, values = _a.values, query = _a.query, reverse = _a.reverse, unique = _a.unique;
|
|
return new Promise(function(resolve, reject) {
|
|
resolve = wrap(resolve);
|
|
var index = query.index, range = query.range;
|
|
var store = trans.objectStore(tableName);
|
|
var source = index.isPrimaryKey ? store : store.index(index.name);
|
|
var direction = reverse ? unique ? "prevunique" : "prev" : unique ? "nextunique" : "next";
|
|
var req = values || !('openKeyCursor' in source) ? source.openCursor(makeIDBKeyRange(range), direction) : source.openKeyCursor(makeIDBKeyRange(range), direction);
|
|
req.onerror = eventRejectHandler(reject);
|
|
req.onsuccess = wrap(function(ev) {
|
|
var cursor = req.result;
|
|
if (!cursor) {
|
|
resolve(null);
|
|
return;
|
|
}
|
|
cursor.___id = ++_id_counter;
|
|
cursor.done = false;
|
|
var _cursorContinue = cursor.continue.bind(cursor);
|
|
var _cursorContinuePrimaryKey = cursor.continuePrimaryKey;
|
|
if (_cursorContinuePrimaryKey) _cursorContinuePrimaryKey = _cursorContinuePrimaryKey.bind(cursor);
|
|
var _cursorAdvance = cursor.advance.bind(cursor);
|
|
var doThrowCursorIsNotStarted = function() {
|
|
throw new Error("Cursor not started");
|
|
};
|
|
var doThrowCursorIsStopped = function() {
|
|
throw new Error("Cursor not stopped");
|
|
};
|
|
cursor.trans = trans;
|
|
cursor.stop = cursor.continue = cursor.continuePrimaryKey = cursor.advance = doThrowCursorIsNotStarted;
|
|
cursor.fail = wrap(reject);
|
|
cursor.next = function() {
|
|
var _this = this;
|
|
var gotOne = 1;
|
|
return this.start(function() {
|
|
return gotOne-- ? _this.continue() : _this.stop();
|
|
}).then(function() {
|
|
return _this;
|
|
});
|
|
};
|
|
cursor.start = function(callback) {
|
|
var iterationPromise = new Promise(function(resolveIteration, rejectIteration) {
|
|
resolveIteration = wrap(resolveIteration);
|
|
req.onerror = eventRejectHandler(rejectIteration);
|
|
cursor.fail = rejectIteration;
|
|
cursor.stop = function(value) {
|
|
cursor.stop = cursor.continue = cursor.continuePrimaryKey = cursor.advance = doThrowCursorIsStopped;
|
|
resolveIteration(value);
|
|
};
|
|
});
|
|
var guardedCallback = function() {
|
|
if (req.result) {
|
|
try {
|
|
callback();
|
|
} catch (err) {
|
|
cursor.fail(err);
|
|
}
|
|
} else {
|
|
cursor.done = true;
|
|
cursor.start = function() {
|
|
throw new Error("Cursor behind last entry");
|
|
};
|
|
cursor.stop();
|
|
}
|
|
};
|
|
req.onsuccess = wrap(function(ev) {
|
|
req.onsuccess = guardedCallback;
|
|
guardedCallback();
|
|
});
|
|
cursor.continue = _cursorContinue;
|
|
cursor.continuePrimaryKey = _cursorContinuePrimaryKey;
|
|
cursor.advance = _cursorAdvance;
|
|
guardedCallback();
|
|
return iterationPromise;
|
|
};
|
|
resolve(cursor);
|
|
}, reject);
|
|
});
|
|
}
|
|
function query(hasGetAll) {
|
|
return function(request) {
|
|
return new Promise(function(resolve, reject) {
|
|
resolve = wrap(resolve);
|
|
var trans = request.trans, values = request.values, limit = request.limit, query = request.query;
|
|
var nonInfinitLimit = limit === Infinity ? undefined : limit;
|
|
var index = query.index, range = query.range;
|
|
var store = trans.objectStore(tableName);
|
|
var source = index.isPrimaryKey ? store : store.index(index.name);
|
|
var idbKeyRange = makeIDBKeyRange(range);
|
|
if (limit === 0) return resolve({
|
|
result: []
|
|
});
|
|
if (hasGetAll) {
|
|
var req = values ? source.getAll(idbKeyRange, nonInfinitLimit) : source.getAllKeys(idbKeyRange, nonInfinitLimit);
|
|
req.onsuccess = function(event) {
|
|
return resolve({
|
|
result: event.target.result
|
|
});
|
|
};
|
|
req.onerror = eventRejectHandler(reject);
|
|
} else {
|
|
var count_1 = 0;
|
|
var req_1 = values || !('openKeyCursor' in source) ? source.openCursor(idbKeyRange) : source.openKeyCursor(idbKeyRange);
|
|
var result_1 = [];
|
|
req_1.onsuccess = function(event) {
|
|
var cursor = req_1.result;
|
|
if (!cursor) return resolve({
|
|
result: result_1
|
|
});
|
|
result_1.push(values ? cursor.value : cursor.primaryKey);
|
|
if (++count_1 === limit) return resolve({
|
|
result: result_1
|
|
});
|
|
cursor.continue();
|
|
};
|
|
req_1.onerror = eventRejectHandler(reject);
|
|
}
|
|
});
|
|
};
|
|
}
|
|
return {
|
|
name: tableName,
|
|
schema: tableSchema,
|
|
mutate: mutate,
|
|
getMany: function(_a) {
|
|
var trans = _a.trans, keys = _a.keys;
|
|
return new Promise(function(resolve, reject) {
|
|
resolve = wrap(resolve);
|
|
var store = trans.objectStore(tableName);
|
|
var length = keys.length;
|
|
var result = new Array(length);
|
|
var keyCount = 0;
|
|
var callbackCount = 0;
|
|
var req;
|
|
var successHandler = function(event) {
|
|
var req = event.target;
|
|
if ((result[req._pos] = req.result) != null) ;
|
|
if (++callbackCount === keyCount) resolve(result);
|
|
};
|
|
var errorHandler = eventRejectHandler(reject);
|
|
for(var i = 0; i < length; ++i){
|
|
var key = keys[i];
|
|
if (key != null) {
|
|
req = store.get(keys[i]);
|
|
req._pos = i;
|
|
req.onsuccess = successHandler;
|
|
req.onerror = errorHandler;
|
|
++keyCount;
|
|
}
|
|
}
|
|
if (keyCount === 0) resolve(result);
|
|
});
|
|
},
|
|
get: function(_a) {
|
|
var trans = _a.trans, key = _a.key;
|
|
return new Promise(function(resolve, reject) {
|
|
resolve = wrap(resolve);
|
|
var store = trans.objectStore(tableName);
|
|
var req = store.get(key);
|
|
req.onsuccess = function(event) {
|
|
return resolve(event.target.result);
|
|
};
|
|
req.onerror = eventRejectHandler(reject);
|
|
});
|
|
},
|
|
query: query(hasGetAll),
|
|
openCursor: openCursor,
|
|
count: function(_a) {
|
|
var query = _a.query, trans = _a.trans;
|
|
var index = query.index, range = query.range;
|
|
return new Promise(function(resolve, reject) {
|
|
var store = trans.objectStore(tableName);
|
|
var source = index.isPrimaryKey ? store : store.index(index.name);
|
|
var idbKeyRange = makeIDBKeyRange(range);
|
|
var req = idbKeyRange ? source.count(idbKeyRange) : source.count();
|
|
req.onsuccess = wrap(function(ev) {
|
|
return resolve(ev.target.result);
|
|
});
|
|
req.onerror = eventRejectHandler(reject);
|
|
});
|
|
}
|
|
};
|
|
}
|
|
var _a = extractSchema(db, tmpTrans), schema = _a.schema, hasGetAll = _a.hasGetAll;
|
|
var tables = schema.tables.map(function(tableSchema) {
|
|
return createDbCoreTable(tableSchema);
|
|
});
|
|
var tableMap = {};
|
|
tables.forEach(function(table) {
|
|
return tableMap[table.name] = table;
|
|
});
|
|
return {
|
|
stack: "dbcore",
|
|
transaction: db.transaction.bind(db),
|
|
table: function(name) {
|
|
var result = tableMap[name];
|
|
if (!result) throw new Error("Table '".concat(name, "' not found"));
|
|
return tableMap[name];
|
|
},
|
|
MIN_KEY: -Infinity,
|
|
MAX_KEY: getMaxKey(IdbKeyRange),
|
|
schema: schema
|
|
};
|
|
}
|
|
function createMiddlewareStack(stackImpl, middlewares) {
|
|
return middlewares.reduce(function(down, _a) {
|
|
var create = _a.create;
|
|
return __assign(__assign({}, down), create(down));
|
|
}, stackImpl);
|
|
}
|
|
function createMiddlewareStacks(middlewares, idbdb, _a, tmpTrans) {
|
|
var IDBKeyRange = _a.IDBKeyRange;
|
|
_a.indexedDB;
|
|
var dbcore = createMiddlewareStack(createDBCore(idbdb, IDBKeyRange, tmpTrans), middlewares.dbcore);
|
|
return {
|
|
dbcore: dbcore
|
|
};
|
|
}
|
|
function generateMiddlewareStacks(db, tmpTrans) {
|
|
var idbdb = tmpTrans.db;
|
|
var stacks = createMiddlewareStacks(db._middlewares, idbdb, db._deps, tmpTrans);
|
|
db.core = stacks.dbcore;
|
|
db.tables.forEach(function(table) {
|
|
var tableName = table.name;
|
|
if (db.core.schema.tables.some(function(tbl) {
|
|
return tbl.name === tableName;
|
|
})) {
|
|
table.core = db.core.table(tableName);
|
|
if (db[tableName] instanceof db.Table) {
|
|
db[tableName].core = table.core;
|
|
}
|
|
}
|
|
});
|
|
}
|
|
function setApiOnPlace(db, objs, tableNames, dbschema) {
|
|
tableNames.forEach(function(tableName) {
|
|
var schema = dbschema[tableName];
|
|
objs.forEach(function(obj) {
|
|
var propDesc = getPropertyDescriptor(obj, tableName);
|
|
if (!propDesc || "value" in propDesc && propDesc.value === undefined) {
|
|
if (obj === db.Transaction.prototype || obj instanceof db.Transaction) {
|
|
setProp(obj, tableName, {
|
|
get: function() {
|
|
return this.table(tableName);
|
|
},
|
|
set: function(value) {
|
|
defineProperty(this, tableName, {
|
|
value: value,
|
|
writable: true,
|
|
configurable: true,
|
|
enumerable: true
|
|
});
|
|
}
|
|
});
|
|
} else {
|
|
obj[tableName] = new db.Table(tableName, schema);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
function removeTablesApi(db, objs) {
|
|
objs.forEach(function(obj) {
|
|
for(var key in obj){
|
|
if (obj[key] instanceof db.Table) delete obj[key];
|
|
}
|
|
});
|
|
}
|
|
function lowerVersionFirst(a, b) {
|
|
return a._cfg.version - b._cfg.version;
|
|
}
|
|
function runUpgraders(db, oldVersion, idbUpgradeTrans, reject) {
|
|
var globalSchema = db._dbSchema;
|
|
if (idbUpgradeTrans.objectStoreNames.contains('$meta') && !globalSchema.$meta) {
|
|
globalSchema.$meta = createTableSchema("$meta", parseIndexSyntax("")[0], []);
|
|
db._storeNames.push('$meta');
|
|
}
|
|
var trans = db._createTransaction('readwrite', db._storeNames, globalSchema);
|
|
trans.create(idbUpgradeTrans);
|
|
trans._completion.catch(reject);
|
|
var rejectTransaction = trans._reject.bind(trans);
|
|
var transless = PSD.transless || PSD;
|
|
newScope(function() {
|
|
PSD.trans = trans;
|
|
PSD.transless = transless;
|
|
if (oldVersion === 0) {
|
|
keys(globalSchema).forEach(function(tableName) {
|
|
createTable(idbUpgradeTrans, tableName, globalSchema[tableName].primKey, globalSchema[tableName].indexes);
|
|
});
|
|
generateMiddlewareStacks(db, idbUpgradeTrans);
|
|
DexiePromise.follow(function() {
|
|
return db.on.populate.fire(trans);
|
|
}).catch(rejectTransaction);
|
|
} else {
|
|
generateMiddlewareStacks(db, idbUpgradeTrans);
|
|
return getExistingVersion(db, trans, oldVersion).then(function(oldVersion) {
|
|
return updateTablesAndIndexes(db, oldVersion, trans, idbUpgradeTrans);
|
|
}).catch(rejectTransaction);
|
|
}
|
|
});
|
|
}
|
|
function patchCurrentVersion(db, idbUpgradeTrans) {
|
|
createMissingTables(db._dbSchema, idbUpgradeTrans);
|
|
if (idbUpgradeTrans.db.version % 10 === 0 && !idbUpgradeTrans.objectStoreNames.contains('$meta')) {
|
|
idbUpgradeTrans.db.createObjectStore('$meta').add(Math.ceil(idbUpgradeTrans.db.version / 10 - 1), 'version');
|
|
}
|
|
var globalSchema = buildGlobalSchema(db, db.idbdb, idbUpgradeTrans);
|
|
adjustToExistingIndexNames(db, db._dbSchema, idbUpgradeTrans);
|
|
var diff = getSchemaDiff(globalSchema, db._dbSchema);
|
|
var _loop_1 = function(tableChange) {
|
|
if (tableChange.change.length || tableChange.recreate) {
|
|
console.warn("Unable to patch indexes of table ".concat(tableChange.name, " because it has changes on the type of index or primary key."));
|
|
return {
|
|
value: void 0
|
|
};
|
|
}
|
|
var store = idbUpgradeTrans.objectStore(tableChange.name);
|
|
tableChange.add.forEach(function(idx) {
|
|
if (debug) console.debug("Dexie upgrade patch: Creating missing index ".concat(tableChange.name, ".").concat(idx.src));
|
|
addIndex(store, idx);
|
|
});
|
|
};
|
|
for(var _i = 0, _a = diff.change; _i < _a.length; _i++){
|
|
var tableChange = _a[_i];
|
|
var state_1 = _loop_1(tableChange);
|
|
if (typeof state_1 === "object") return state_1.value;
|
|
}
|
|
}
|
|
function getExistingVersion(db, trans, oldVersion) {
|
|
if (trans.storeNames.includes('$meta')) {
|
|
return trans.table('$meta').get('version').then(function(metaVersion) {
|
|
return metaVersion != null ? metaVersion : oldVersion;
|
|
});
|
|
} else {
|
|
return DexiePromise.resolve(oldVersion);
|
|
}
|
|
}
|
|
function updateTablesAndIndexes(db, oldVersion, trans, idbUpgradeTrans) {
|
|
var queue = [];
|
|
var versions = db._versions;
|
|
var globalSchema = db._dbSchema = buildGlobalSchema(db, db.idbdb, idbUpgradeTrans);
|
|
var versToRun = versions.filter(function(v) {
|
|
return v._cfg.version >= oldVersion;
|
|
});
|
|
if (versToRun.length === 0) {
|
|
return DexiePromise.resolve();
|
|
}
|
|
versToRun.forEach(function(version) {
|
|
queue.push(function() {
|
|
var oldSchema = globalSchema;
|
|
var newSchema = version._cfg.dbschema;
|
|
adjustToExistingIndexNames(db, oldSchema, idbUpgradeTrans);
|
|
adjustToExistingIndexNames(db, newSchema, idbUpgradeTrans);
|
|
globalSchema = db._dbSchema = newSchema;
|
|
var diff = getSchemaDiff(oldSchema, newSchema);
|
|
diff.add.forEach(function(tuple) {
|
|
createTable(idbUpgradeTrans, tuple[0], tuple[1].primKey, tuple[1].indexes);
|
|
});
|
|
diff.change.forEach(function(change) {
|
|
if (change.recreate) {
|
|
throw new exceptions.Upgrade("Not yet support for changing primary key");
|
|
} else {
|
|
var store_1 = idbUpgradeTrans.objectStore(change.name);
|
|
change.add.forEach(function(idx) {
|
|
return addIndex(store_1, idx);
|
|
});
|
|
change.change.forEach(function(idx) {
|
|
store_1.deleteIndex(idx.name);
|
|
addIndex(store_1, idx);
|
|
});
|
|
change.del.forEach(function(idxName) {
|
|
return store_1.deleteIndex(idxName);
|
|
});
|
|
}
|
|
});
|
|
var contentUpgrade = version._cfg.contentUpgrade;
|
|
if (contentUpgrade && version._cfg.version > oldVersion) {
|
|
generateMiddlewareStacks(db, idbUpgradeTrans);
|
|
trans._memoizedTables = {};
|
|
var upgradeSchema_1 = shallowClone(newSchema);
|
|
diff.del.forEach(function(table) {
|
|
upgradeSchema_1[table] = oldSchema[table];
|
|
});
|
|
removeTablesApi(db, [
|
|
db.Transaction.prototype
|
|
]);
|
|
setApiOnPlace(db, [
|
|
db.Transaction.prototype
|
|
], keys(upgradeSchema_1), upgradeSchema_1);
|
|
trans.schema = upgradeSchema_1;
|
|
var contentUpgradeIsAsync_1 = isAsyncFunction(contentUpgrade);
|
|
if (contentUpgradeIsAsync_1) {
|
|
incrementExpectedAwaits();
|
|
}
|
|
var returnValue_1;
|
|
var promiseFollowed = DexiePromise.follow(function() {
|
|
returnValue_1 = contentUpgrade(trans);
|
|
if (returnValue_1) {
|
|
if (contentUpgradeIsAsync_1) {
|
|
var decrementor = decrementExpectedAwaits.bind(null, null);
|
|
returnValue_1.then(decrementor, decrementor);
|
|
}
|
|
}
|
|
});
|
|
return returnValue_1 && typeof returnValue_1.then === 'function' ? DexiePromise.resolve(returnValue_1) : promiseFollowed.then(function() {
|
|
return returnValue_1;
|
|
});
|
|
}
|
|
});
|
|
queue.push(function(idbtrans) {
|
|
var newSchema = version._cfg.dbschema;
|
|
deleteRemovedTables(newSchema, idbtrans);
|
|
removeTablesApi(db, [
|
|
db.Transaction.prototype
|
|
]);
|
|
setApiOnPlace(db, [
|
|
db.Transaction.prototype
|
|
], db._storeNames, db._dbSchema);
|
|
trans.schema = db._dbSchema;
|
|
});
|
|
queue.push(function(idbtrans) {
|
|
if (db.idbdb.objectStoreNames.contains('$meta')) {
|
|
if (Math.ceil(db.idbdb.version / 10) === version._cfg.version) {
|
|
db.idbdb.deleteObjectStore('$meta');
|
|
delete db._dbSchema.$meta;
|
|
db._storeNames = db._storeNames.filter(function(name) {
|
|
return name !== '$meta';
|
|
});
|
|
} else {
|
|
idbtrans.objectStore('$meta').put(version._cfg.version, 'version');
|
|
}
|
|
}
|
|
});
|
|
});
|
|
function runQueue() {
|
|
return queue.length ? DexiePromise.resolve(queue.shift()(trans.idbtrans)).then(runQueue) : DexiePromise.resolve();
|
|
}
|
|
return runQueue().then(function() {
|
|
createMissingTables(globalSchema, idbUpgradeTrans);
|
|
});
|
|
}
|
|
function getSchemaDiff(oldSchema, newSchema) {
|
|
var diff = {
|
|
del: [],
|
|
add: [],
|
|
change: []
|
|
};
|
|
var table;
|
|
for(table in oldSchema){
|
|
if (!newSchema[table]) diff.del.push(table);
|
|
}
|
|
for(table in newSchema){
|
|
var oldDef = oldSchema[table], newDef = newSchema[table];
|
|
if (!oldDef) {
|
|
diff.add.push([
|
|
table,
|
|
newDef
|
|
]);
|
|
} else {
|
|
var change = {
|
|
name: table,
|
|
def: newDef,
|
|
recreate: false,
|
|
del: [],
|
|
add: [],
|
|
change: []
|
|
};
|
|
if ('' + (oldDef.primKey.keyPath || '') !== '' + (newDef.primKey.keyPath || '') || oldDef.primKey.auto !== newDef.primKey.auto) {
|
|
change.recreate = true;
|
|
diff.change.push(change);
|
|
} else {
|
|
var oldIndexes = oldDef.idxByName;
|
|
var newIndexes = newDef.idxByName;
|
|
var idxName = void 0;
|
|
for(idxName in oldIndexes){
|
|
if (!newIndexes[idxName]) change.del.push(idxName);
|
|
}
|
|
for(idxName in newIndexes){
|
|
var oldIdx = oldIndexes[idxName], newIdx = newIndexes[idxName];
|
|
if (!oldIdx) change.add.push(newIdx);
|
|
else if (oldIdx.src !== newIdx.src) change.change.push(newIdx);
|
|
}
|
|
if (change.del.length > 0 || change.add.length > 0 || change.change.length > 0) {
|
|
diff.change.push(change);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return diff;
|
|
}
|
|
function createTable(idbtrans, tableName, primKey, indexes) {
|
|
var store = idbtrans.db.createObjectStore(tableName, primKey.keyPath ? {
|
|
keyPath: primKey.keyPath,
|
|
autoIncrement: primKey.auto
|
|
} : {
|
|
autoIncrement: primKey.auto
|
|
});
|
|
indexes.forEach(function(idx) {
|
|
return addIndex(store, idx);
|
|
});
|
|
return store;
|
|
}
|
|
function createMissingTables(newSchema, idbtrans) {
|
|
keys(newSchema).forEach(function(tableName) {
|
|
if (!idbtrans.db.objectStoreNames.contains(tableName)) {
|
|
if (debug) console.debug('Dexie: Creating missing table', tableName);
|
|
createTable(idbtrans, tableName, newSchema[tableName].primKey, newSchema[tableName].indexes);
|
|
}
|
|
});
|
|
}
|
|
function deleteRemovedTables(newSchema, idbtrans) {
|
|
[].slice.call(idbtrans.db.objectStoreNames).forEach(function(storeName) {
|
|
return newSchema[storeName] == null && idbtrans.db.deleteObjectStore(storeName);
|
|
});
|
|
}
|
|
function addIndex(store, idx) {
|
|
store.createIndex(idx.name, idx.keyPath, {
|
|
unique: idx.unique,
|
|
multiEntry: idx.multi
|
|
});
|
|
}
|
|
function buildGlobalSchema(db, idbdb, tmpTrans) {
|
|
var globalSchema = {};
|
|
var dbStoreNames = slice(idbdb.objectStoreNames, 0);
|
|
dbStoreNames.forEach(function(storeName) {
|
|
var store = tmpTrans.objectStore(storeName);
|
|
var keyPath = store.keyPath;
|
|
var primKey = createIndexSpec(nameFromKeyPath(keyPath), keyPath || "", true, false, !!store.autoIncrement, keyPath && typeof keyPath !== "string", true);
|
|
var indexes = [];
|
|
for(var j = 0; j < store.indexNames.length; ++j){
|
|
var idbindex = store.index(store.indexNames[j]);
|
|
keyPath = idbindex.keyPath;
|
|
var index = createIndexSpec(idbindex.name, keyPath, !!idbindex.unique, !!idbindex.multiEntry, false, keyPath && typeof keyPath !== "string", false);
|
|
indexes.push(index);
|
|
}
|
|
globalSchema[storeName] = createTableSchema(storeName, primKey, indexes);
|
|
});
|
|
return globalSchema;
|
|
}
|
|
function readGlobalSchema(db, idbdb, tmpTrans) {
|
|
db.verno = idbdb.version / 10;
|
|
var globalSchema = db._dbSchema = buildGlobalSchema(db, idbdb, tmpTrans);
|
|
db._storeNames = slice(idbdb.objectStoreNames, 0);
|
|
setApiOnPlace(db, [
|
|
db._allTables
|
|
], keys(globalSchema), globalSchema);
|
|
}
|
|
function verifyInstalledSchema(db, tmpTrans) {
|
|
var installedSchema = buildGlobalSchema(db, db.idbdb, tmpTrans);
|
|
var diff = getSchemaDiff(installedSchema, db._dbSchema);
|
|
return !(diff.add.length || diff.change.some(function(ch) {
|
|
return ch.add.length || ch.change.length;
|
|
}));
|
|
}
|
|
function adjustToExistingIndexNames(db, schema, idbtrans) {
|
|
var storeNames = idbtrans.db.objectStoreNames;
|
|
for(var i = 0; i < storeNames.length; ++i){
|
|
var storeName = storeNames[i];
|
|
var store = idbtrans.objectStore(storeName);
|
|
db._hasGetAll = 'getAll' in store;
|
|
for(var j = 0; j < store.indexNames.length; ++j){
|
|
var indexName = store.indexNames[j];
|
|
var keyPath = store.index(indexName).keyPath;
|
|
var dexieName = typeof keyPath === 'string' ? keyPath : "[" + slice(keyPath).join('+') + "]";
|
|
if (schema[storeName]) {
|
|
var indexSpec = schema[storeName].idxByName[dexieName];
|
|
if (indexSpec) {
|
|
indexSpec.name = indexName;
|
|
delete schema[storeName].idxByName[dexieName];
|
|
schema[storeName].idxByName[indexName] = indexSpec;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (typeof navigator !== 'undefined' && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && _global.WorkerGlobalScope && _global instanceof _global.WorkerGlobalScope && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604) {
|
|
db._hasGetAll = false;
|
|
}
|
|
}
|
|
function parseIndexSyntax(primKeyAndIndexes) {
|
|
return primKeyAndIndexes.split(',').map(function(index, indexNum) {
|
|
var _a;
|
|
var typeSplit = index.split(':');
|
|
var type = (_a = typeSplit[1]) === null || _a === void 0 ? void 0 : _a.trim();
|
|
index = typeSplit[0].trim();
|
|
var name = index.replace(/([&*]|\+\+)/g, "");
|
|
var keyPath = /^\[/.test(name) ? name.match(/^\[(.*)\]$/)[1].split('+') : name;
|
|
return createIndexSpec(name, keyPath || null, /\&/.test(index), /\*/.test(index), /\+\+/.test(index), isArray(keyPath), indexNum === 0, type);
|
|
});
|
|
}
|
|
var Version = function() {
|
|
function Version() {}
|
|
Version.prototype._createTableSchema = function(name, primKey, indexes) {
|
|
return createTableSchema(name, primKey, indexes);
|
|
};
|
|
Version.prototype._parseIndexSyntax = function(primKeyAndIndexes) {
|
|
return parseIndexSyntax(primKeyAndIndexes);
|
|
};
|
|
Version.prototype._parseStoresSpec = function(stores, outSchema) {
|
|
var _this = this;
|
|
keys(stores).forEach(function(tableName) {
|
|
if (stores[tableName] !== null) {
|
|
var indexes = _this._parseIndexSyntax(stores[tableName]);
|
|
var primKey = indexes.shift();
|
|
if (!primKey) {
|
|
throw new exceptions.Schema('Invalid schema for table ' + tableName + ': ' + stores[tableName]);
|
|
}
|
|
primKey.unique = true;
|
|
if (primKey.multi) throw new exceptions.Schema('Primary key cannot be multiEntry*');
|
|
indexes.forEach(function(idx) {
|
|
if (idx.auto) throw new exceptions.Schema('Only primary key can be marked as autoIncrement (++)');
|
|
if (!idx.keyPath) throw new exceptions.Schema('Index must have a name and cannot be an empty string');
|
|
});
|
|
var tblSchema = _this._createTableSchema(tableName, primKey, indexes);
|
|
outSchema[tableName] = tblSchema;
|
|
}
|
|
});
|
|
};
|
|
Version.prototype.stores = function(stores) {
|
|
var db = this.db;
|
|
this._cfg.storesSource = this._cfg.storesSource ? extend(this._cfg.storesSource, stores) : stores;
|
|
var versions = db._versions;
|
|
var storesSpec = {};
|
|
var dbschema = {};
|
|
versions.forEach(function(version) {
|
|
extend(storesSpec, version._cfg.storesSource);
|
|
dbschema = version._cfg.dbschema = {};
|
|
version._parseStoresSpec(storesSpec, dbschema);
|
|
});
|
|
db._dbSchema = dbschema;
|
|
removeTablesApi(db, [
|
|
db._allTables,
|
|
db,
|
|
db.Transaction.prototype
|
|
]);
|
|
setApiOnPlace(db, [
|
|
db._allTables,
|
|
db,
|
|
db.Transaction.prototype,
|
|
this._cfg.tables
|
|
], keys(dbschema), dbschema);
|
|
db._storeNames = keys(dbschema);
|
|
return this;
|
|
};
|
|
Version.prototype.upgrade = function(upgradeFunction) {
|
|
this._cfg.contentUpgrade = promisableChain(this._cfg.contentUpgrade || nop, upgradeFunction);
|
|
return this;
|
|
};
|
|
return Version;
|
|
}();
|
|
function createVersionConstructor(db) {
|
|
return makeClassConstructor(Version.prototype, function Version(versionNumber) {
|
|
this.db = db;
|
|
this._cfg = {
|
|
version: versionNumber,
|
|
storesSource: null,
|
|
dbschema: {},
|
|
tables: {},
|
|
contentUpgrade: null
|
|
};
|
|
});
|
|
}
|
|
function getDbNamesTable(indexedDB1, IDBKeyRange) {
|
|
var dbNamesDB = indexedDB1["_dbNamesDB"];
|
|
if (!dbNamesDB) {
|
|
dbNamesDB = indexedDB1["_dbNamesDB"] = new Dexie$1(DBNAMES_DB, {
|
|
addons: [],
|
|
indexedDB: indexedDB1,
|
|
IDBKeyRange: IDBKeyRange
|
|
});
|
|
dbNamesDB.version(1).stores({
|
|
dbnames: "name"
|
|
});
|
|
}
|
|
return dbNamesDB.table("dbnames");
|
|
}
|
|
function hasDatabasesNative(indexedDB1) {
|
|
return indexedDB1 && typeof indexedDB1.databases === "function";
|
|
}
|
|
function getDatabaseNames(_a) {
|
|
var indexedDB1 = _a.indexedDB, IDBKeyRange = _a.IDBKeyRange;
|
|
return hasDatabasesNative(indexedDB1) ? Promise.resolve(indexedDB1.databases()).then(function(infos) {
|
|
return infos.map(function(info) {
|
|
return info.name;
|
|
}).filter(function(name) {
|
|
return name !== DBNAMES_DB;
|
|
});
|
|
}) : getDbNamesTable(indexedDB1, IDBKeyRange).toCollection().primaryKeys();
|
|
}
|
|
function _onDatabaseCreated(_a, name) {
|
|
var indexedDB1 = _a.indexedDB, IDBKeyRange = _a.IDBKeyRange;
|
|
!hasDatabasesNative(indexedDB1) && name !== DBNAMES_DB && getDbNamesTable(indexedDB1, IDBKeyRange).put({
|
|
name: name
|
|
}).catch(nop);
|
|
}
|
|
function _onDatabaseDeleted(_a, name) {
|
|
var indexedDB1 = _a.indexedDB, IDBKeyRange = _a.IDBKeyRange;
|
|
!hasDatabasesNative(indexedDB1) && name !== DBNAMES_DB && getDbNamesTable(indexedDB1, IDBKeyRange).delete(name).catch(nop);
|
|
}
|
|
function vip(fn) {
|
|
return newScope(function() {
|
|
PSD.letThrough = true;
|
|
return fn();
|
|
});
|
|
}
|
|
function idbReady() {
|
|
var isSafari = !navigator.userAgentData && /Safari\//.test(navigator.userAgent) && !/Chrom(e|ium)\//.test(navigator.userAgent);
|
|
if (!isSafari || !indexedDB.databases) return Promise.resolve();
|
|
var intervalId;
|
|
return new Promise(function(resolve) {
|
|
var tryIdb = function() {
|
|
return indexedDB.databases().finally(resolve);
|
|
};
|
|
intervalId = setInterval(tryIdb, 100);
|
|
tryIdb();
|
|
}).finally(function() {
|
|
return clearInterval(intervalId);
|
|
});
|
|
}
|
|
var _a;
|
|
function isEmptyRange(node) {
|
|
return !("from" in node);
|
|
}
|
|
var RangeSet = function(fromOrTree, to) {
|
|
if (this) {
|
|
extend(this, arguments.length ? {
|
|
d: 1,
|
|
from: fromOrTree,
|
|
to: arguments.length > 1 ? to : fromOrTree
|
|
} : {
|
|
d: 0
|
|
});
|
|
} else {
|
|
var rv = new RangeSet();
|
|
if (fromOrTree && "d" in fromOrTree) {
|
|
extend(rv, fromOrTree);
|
|
}
|
|
return rv;
|
|
}
|
|
};
|
|
props(RangeSet.prototype, (_a = {
|
|
add: function(rangeSet) {
|
|
mergeRanges(this, rangeSet);
|
|
return this;
|
|
},
|
|
addKey: function(key) {
|
|
addRange(this, key, key);
|
|
return this;
|
|
},
|
|
addKeys: function(keys) {
|
|
var _this = this;
|
|
keys.forEach(function(key) {
|
|
return addRange(_this, key, key);
|
|
});
|
|
return this;
|
|
},
|
|
hasKey: function(key) {
|
|
var node = getRangeSetIterator(this).next(key).value;
|
|
return node && cmp(node.from, key) <= 0 && cmp(node.to, key) >= 0;
|
|
}
|
|
}, _a[iteratorSymbol] = function() {
|
|
return getRangeSetIterator(this);
|
|
}, _a));
|
|
function addRange(target, from, to) {
|
|
var diff = cmp(from, to);
|
|
if (isNaN(diff)) return;
|
|
if (diff > 0) throw RangeError();
|
|
if (isEmptyRange(target)) return extend(target, {
|
|
from: from,
|
|
to: to,
|
|
d: 1
|
|
});
|
|
var left = target.l;
|
|
var right = target.r;
|
|
if (cmp(to, target.from) < 0) {
|
|
left ? addRange(left, from, to) : target.l = {
|
|
from: from,
|
|
to: to,
|
|
d: 1,
|
|
l: null,
|
|
r: null
|
|
};
|
|
return rebalance(target);
|
|
}
|
|
if (cmp(from, target.to) > 0) {
|
|
right ? addRange(right, from, to) : target.r = {
|
|
from: from,
|
|
to: to,
|
|
d: 1,
|
|
l: null,
|
|
r: null
|
|
};
|
|
return rebalance(target);
|
|
}
|
|
if (cmp(from, target.from) < 0) {
|
|
target.from = from;
|
|
target.l = null;
|
|
target.d = right ? right.d + 1 : 1;
|
|
}
|
|
if (cmp(to, target.to) > 0) {
|
|
target.to = to;
|
|
target.r = null;
|
|
target.d = target.l ? target.l.d + 1 : 1;
|
|
}
|
|
var rightWasCutOff = !target.r;
|
|
if (left && !target.l) {
|
|
mergeRanges(target, left);
|
|
}
|
|
if (right && rightWasCutOff) {
|
|
mergeRanges(target, right);
|
|
}
|
|
}
|
|
function mergeRanges(target, newSet) {
|
|
function _addRangeSet(target, _a) {
|
|
var from = _a.from, to = _a.to, l = _a.l, r = _a.r;
|
|
addRange(target, from, to);
|
|
if (l) _addRangeSet(target, l);
|
|
if (r) _addRangeSet(target, r);
|
|
}
|
|
if (!isEmptyRange(newSet)) _addRangeSet(target, newSet);
|
|
}
|
|
function rangesOverlap(rangeSet1, rangeSet2) {
|
|
var i1 = getRangeSetIterator(rangeSet2);
|
|
var nextResult1 = i1.next();
|
|
if (nextResult1.done) return false;
|
|
var a = nextResult1.value;
|
|
var i2 = getRangeSetIterator(rangeSet1);
|
|
var nextResult2 = i2.next(a.from);
|
|
var b = nextResult2.value;
|
|
while(!nextResult1.done && !nextResult2.done){
|
|
if (cmp(b.from, a.to) <= 0 && cmp(b.to, a.from) >= 0) return true;
|
|
cmp(a.from, b.from) < 0 ? a = (nextResult1 = i1.next(b.from)).value : b = (nextResult2 = i2.next(a.from)).value;
|
|
}
|
|
return false;
|
|
}
|
|
function getRangeSetIterator(node) {
|
|
var state = isEmptyRange(node) ? null : {
|
|
s: 0,
|
|
n: node
|
|
};
|
|
return {
|
|
next: function(key) {
|
|
var keyProvided = arguments.length > 0;
|
|
while(state){
|
|
switch(state.s){
|
|
case 0:
|
|
state.s = 1;
|
|
if (keyProvided) {
|
|
while(state.n.l && cmp(key, state.n.from) < 0)state = {
|
|
up: state,
|
|
n: state.n.l,
|
|
s: 1
|
|
};
|
|
} else {
|
|
while(state.n.l)state = {
|
|
up: state,
|
|
n: state.n.l,
|
|
s: 1
|
|
};
|
|
}
|
|
case 1:
|
|
state.s = 2;
|
|
if (!keyProvided || cmp(key, state.n.to) <= 0) return {
|
|
value: state.n,
|
|
done: false
|
|
};
|
|
case 2:
|
|
if (state.n.r) {
|
|
state.s = 3;
|
|
state = {
|
|
up: state,
|
|
n: state.n.r,
|
|
s: 0
|
|
};
|
|
continue;
|
|
}
|
|
case 3:
|
|
state = state.up;
|
|
}
|
|
}
|
|
return {
|
|
done: true
|
|
};
|
|
}
|
|
};
|
|
}
|
|
function rebalance(target) {
|
|
var _a, _b;
|
|
var diff = (((_a = target.r) === null || _a === void 0 ? void 0 : _a.d) || 0) - (((_b = target.l) === null || _b === void 0 ? void 0 : _b.d) || 0);
|
|
var r = diff > 1 ? "r" : diff < -1 ? "l" : "";
|
|
if (r) {
|
|
var l = r === "r" ? "l" : "r";
|
|
var rootClone = __assign({}, target);
|
|
var oldRootRight = target[r];
|
|
target.from = oldRootRight.from;
|
|
target.to = oldRootRight.to;
|
|
target[r] = oldRootRight[r];
|
|
rootClone[r] = oldRootRight[l];
|
|
target[l] = rootClone;
|
|
rootClone.d = computeDepth(rootClone);
|
|
}
|
|
target.d = computeDepth(target);
|
|
}
|
|
function computeDepth(_a) {
|
|
var r = _a.r, l = _a.l;
|
|
return (r ? l ? Math.max(r.d, l.d) : r.d : l ? l.d : 0) + 1;
|
|
}
|
|
function extendObservabilitySet(target, newSet) {
|
|
keys(newSet).forEach(function(part) {
|
|
if (target[part]) mergeRanges(target[part], newSet[part]);
|
|
else target[part] = cloneSimpleObjectTree(newSet[part]);
|
|
});
|
|
return target;
|
|
}
|
|
function obsSetsOverlap(os1, os2) {
|
|
return os1.all || os2.all || Object.keys(os1).some(function(key) {
|
|
return os2[key] && rangesOverlap(os2[key], os1[key]);
|
|
});
|
|
}
|
|
var cache = {};
|
|
var unsignaledParts = {};
|
|
var isTaskEnqueued = false;
|
|
function signalSubscribersLazily(part, optimistic) {
|
|
extendObservabilitySet(unsignaledParts, part);
|
|
if (!isTaskEnqueued) {
|
|
isTaskEnqueued = true;
|
|
setTimeout(function() {
|
|
isTaskEnqueued = false;
|
|
var parts = unsignaledParts;
|
|
unsignaledParts = {};
|
|
signalSubscribersNow(parts, false);
|
|
}, 0);
|
|
}
|
|
}
|
|
function signalSubscribersNow(updatedParts, deleteAffectedCacheEntries) {
|
|
if (deleteAffectedCacheEntries === void 0) {
|
|
deleteAffectedCacheEntries = false;
|
|
}
|
|
var queriesToSignal = new Set();
|
|
if (updatedParts.all) {
|
|
for(var _i = 0, _a = Object.values(cache); _i < _a.length; _i++){
|
|
var tblCache = _a[_i];
|
|
collectTableSubscribers(tblCache, updatedParts, queriesToSignal, deleteAffectedCacheEntries);
|
|
}
|
|
} else {
|
|
for(var key in updatedParts){
|
|
var parts = /^idb\:\/\/(.*)\/(.*)\//.exec(key);
|
|
if (parts) {
|
|
var dbName = parts[1], tableName = parts[2];
|
|
var tblCache = cache["idb://".concat(dbName, "/").concat(tableName)];
|
|
if (tblCache) collectTableSubscribers(tblCache, updatedParts, queriesToSignal, deleteAffectedCacheEntries);
|
|
}
|
|
}
|
|
}
|
|
queriesToSignal.forEach(function(requery) {
|
|
return requery();
|
|
});
|
|
}
|
|
function collectTableSubscribers(tblCache, updatedParts, outQueriesToSignal, deleteAffectedCacheEntries) {
|
|
var updatedEntryLists = [];
|
|
for(var _i = 0, _a = Object.entries(tblCache.queries.query); _i < _a.length; _i++){
|
|
var _b = _a[_i], indexName = _b[0], entries = _b[1];
|
|
var filteredEntries = [];
|
|
for(var _c = 0, entries_1 = entries; _c < entries_1.length; _c++){
|
|
var entry = entries_1[_c];
|
|
if (obsSetsOverlap(updatedParts, entry.obsSet)) {
|
|
entry.subscribers.forEach(function(requery) {
|
|
return outQueriesToSignal.add(requery);
|
|
});
|
|
} else if (deleteAffectedCacheEntries) {
|
|
filteredEntries.push(entry);
|
|
}
|
|
}
|
|
if (deleteAffectedCacheEntries) updatedEntryLists.push([
|
|
indexName,
|
|
filteredEntries
|
|
]);
|
|
}
|
|
if (deleteAffectedCacheEntries) {
|
|
for(var _d = 0, updatedEntryLists_1 = updatedEntryLists; _d < updatedEntryLists_1.length; _d++){
|
|
var _e = updatedEntryLists_1[_d], indexName = _e[0], filteredEntries = _e[1];
|
|
tblCache.queries.query[indexName] = filteredEntries;
|
|
}
|
|
}
|
|
}
|
|
function dexieOpen(db) {
|
|
var state = db._state;
|
|
var indexedDB1 = db._deps.indexedDB;
|
|
if (state.isBeingOpened || db.idbdb) return state.dbReadyPromise.then(function() {
|
|
return state.dbOpenError ? rejection(state.dbOpenError) : db;
|
|
});
|
|
state.isBeingOpened = true;
|
|
state.dbOpenError = null;
|
|
state.openComplete = false;
|
|
var openCanceller = state.openCanceller;
|
|
var nativeVerToOpen = Math.round(db.verno * 10);
|
|
var schemaPatchMode = false;
|
|
function throwIfCancelled() {
|
|
if (state.openCanceller !== openCanceller) throw new exceptions.DatabaseClosed('db.open() was cancelled');
|
|
}
|
|
var resolveDbReady = state.dbReadyResolve, upgradeTransaction = null, wasCreated = false;
|
|
var tryOpenDB = function() {
|
|
return new DexiePromise(function(resolve, reject) {
|
|
throwIfCancelled();
|
|
if (!indexedDB1) throw new exceptions.MissingAPI();
|
|
var dbName = db.name;
|
|
var req = state.autoSchema || !nativeVerToOpen ? indexedDB1.open(dbName) : indexedDB1.open(dbName, nativeVerToOpen);
|
|
if (!req) throw new exceptions.MissingAPI();
|
|
req.onerror = eventRejectHandler(reject);
|
|
req.onblocked = wrap(db._fireOnBlocked);
|
|
req.onupgradeneeded = wrap(function(e) {
|
|
upgradeTransaction = req.transaction;
|
|
if (state.autoSchema && !db._options.allowEmptyDB) {
|
|
req.onerror = preventDefault;
|
|
upgradeTransaction.abort();
|
|
req.result.close();
|
|
var delreq = indexedDB1.deleteDatabase(dbName);
|
|
delreq.onsuccess = delreq.onerror = wrap(function() {
|
|
reject(new exceptions.NoSuchDatabase("Database ".concat(dbName, " doesnt exist")));
|
|
});
|
|
} else {
|
|
upgradeTransaction.onerror = eventRejectHandler(reject);
|
|
var oldVer = e.oldVersion > Math.pow(2, 62) ? 0 : e.oldVersion;
|
|
wasCreated = oldVer < 1;
|
|
db.idbdb = req.result;
|
|
if (schemaPatchMode) {
|
|
patchCurrentVersion(db, upgradeTransaction);
|
|
}
|
|
runUpgraders(db, oldVer / 10, upgradeTransaction, reject);
|
|
}
|
|
}, reject);
|
|
req.onsuccess = wrap(function() {
|
|
upgradeTransaction = null;
|
|
var idbdb = db.idbdb = req.result;
|
|
var objectStoreNames = slice(idbdb.objectStoreNames);
|
|
if (objectStoreNames.length > 0) try {
|
|
var tmpTrans = idbdb.transaction(safariMultiStoreFix(objectStoreNames), 'readonly');
|
|
if (state.autoSchema) readGlobalSchema(db, idbdb, tmpTrans);
|
|
else {
|
|
adjustToExistingIndexNames(db, db._dbSchema, tmpTrans);
|
|
if (!verifyInstalledSchema(db, tmpTrans) && !schemaPatchMode) {
|
|
console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this.");
|
|
idbdb.close();
|
|
nativeVerToOpen = idbdb.version + 1;
|
|
schemaPatchMode = true;
|
|
return resolve(tryOpenDB());
|
|
}
|
|
}
|
|
generateMiddlewareStacks(db, tmpTrans);
|
|
} catch (e) {}
|
|
connections.push(db);
|
|
idbdb.onversionchange = wrap(function(ev) {
|
|
state.vcFired = true;
|
|
db.on("versionchange").fire(ev);
|
|
});
|
|
idbdb.onclose = wrap(function() {
|
|
db.close({
|
|
disableAutoOpen: false
|
|
});
|
|
});
|
|
if (wasCreated) _onDatabaseCreated(db._deps, dbName);
|
|
resolve();
|
|
}, reject);
|
|
}).catch(function(err) {
|
|
switch(err === null || err === void 0 ? void 0 : err.name){
|
|
case "UnknownError":
|
|
if (state.PR1398_maxLoop > 0) {
|
|
state.PR1398_maxLoop--;
|
|
console.warn('Dexie: Workaround for Chrome UnknownError on open()');
|
|
return tryOpenDB();
|
|
}
|
|
break;
|
|
case "VersionError":
|
|
if (nativeVerToOpen > 0) {
|
|
nativeVerToOpen = 0;
|
|
return tryOpenDB();
|
|
}
|
|
break;
|
|
}
|
|
return DexiePromise.reject(err);
|
|
});
|
|
};
|
|
return DexiePromise.race([
|
|
openCanceller,
|
|
(typeof navigator === 'undefined' ? DexiePromise.resolve() : idbReady()).then(tryOpenDB)
|
|
]).then(function() {
|
|
throwIfCancelled();
|
|
state.onReadyBeingFired = [];
|
|
return DexiePromise.resolve(vip(function() {
|
|
return db.on.ready.fire(db.vip);
|
|
})).then(function fireRemainders() {
|
|
if (state.onReadyBeingFired.length > 0) {
|
|
var remainders_1 = state.onReadyBeingFired.reduce(promisableChain, nop);
|
|
state.onReadyBeingFired = [];
|
|
return DexiePromise.resolve(vip(function() {
|
|
return remainders_1(db.vip);
|
|
})).then(fireRemainders);
|
|
}
|
|
});
|
|
}).finally(function() {
|
|
if (state.openCanceller === openCanceller) {
|
|
state.onReadyBeingFired = null;
|
|
state.isBeingOpened = false;
|
|
}
|
|
}).catch(function(err) {
|
|
state.dbOpenError = err;
|
|
try {
|
|
upgradeTransaction && upgradeTransaction.abort();
|
|
} catch (_a) {}
|
|
if (openCanceller === state.openCanceller) {
|
|
db._close();
|
|
}
|
|
return rejection(err);
|
|
}).finally(function() {
|
|
state.openComplete = true;
|
|
resolveDbReady();
|
|
}).then(function() {
|
|
if (wasCreated) {
|
|
var everything_1 = {};
|
|
db.tables.forEach(function(table) {
|
|
table.schema.indexes.forEach(function(idx) {
|
|
if (idx.name) everything_1["idb://".concat(db.name, "/").concat(table.name, "/").concat(idx.name)] = new RangeSet(-Infinity, [
|
|
[
|
|
[]
|
|
]
|
|
]);
|
|
});
|
|
everything_1["idb://".concat(db.name, "/").concat(table.name, "/")] = everything_1["idb://".concat(db.name, "/").concat(table.name, "/:dels")] = new RangeSet(-Infinity, [
|
|
[
|
|
[]
|
|
]
|
|
]);
|
|
});
|
|
globalEvents(DEXIE_STORAGE_MUTATED_EVENT_NAME).fire(everything_1);
|
|
signalSubscribersNow(everything_1, true);
|
|
}
|
|
return db;
|
|
});
|
|
}
|
|
function awaitIterator(iterator) {
|
|
var callNext = function(result) {
|
|
return iterator.next(result);
|
|
}, doThrow = function(error) {
|
|
return iterator.throw(error);
|
|
}, onSuccess = step(callNext), onError = step(doThrow);
|
|
function step(getNext) {
|
|
return function(val) {
|
|
var next = getNext(val), value = next.value;
|
|
return next.done ? value : !value || typeof value.then !== 'function' ? isArray(value) ? Promise.all(value).then(onSuccess, onError) : onSuccess(value) : value.then(onSuccess, onError);
|
|
};
|
|
}
|
|
return step(callNext)();
|
|
}
|
|
function extractTransactionArgs(mode, _tableArgs_, scopeFunc) {
|
|
var i = arguments.length;
|
|
if (i < 2) throw new exceptions.InvalidArgument("Too few arguments");
|
|
var args = new Array(i - 1);
|
|
while(--i)args[i - 1] = arguments[i];
|
|
scopeFunc = args.pop();
|
|
var tables = flatten(args);
|
|
return [
|
|
mode,
|
|
tables,
|
|
scopeFunc
|
|
];
|
|
}
|
|
function enterTransactionScope(db, mode, storeNames, parentTransaction, scopeFunc) {
|
|
return DexiePromise.resolve().then(function() {
|
|
var transless = PSD.transless || PSD;
|
|
var trans = db._createTransaction(mode, storeNames, db._dbSchema, parentTransaction);
|
|
trans.explicit = true;
|
|
var zoneProps = {
|
|
trans: trans,
|
|
transless: transless
|
|
};
|
|
if (parentTransaction) {
|
|
trans.idbtrans = parentTransaction.idbtrans;
|
|
} else {
|
|
try {
|
|
trans.create();
|
|
trans.idbtrans._explicit = true;
|
|
db._state.PR1398_maxLoop = 3;
|
|
} catch (ex) {
|
|
if (ex.name === errnames.InvalidState && db.isOpen() && --db._state.PR1398_maxLoop > 0) {
|
|
console.warn('Dexie: Need to reopen db');
|
|
db.close({
|
|
disableAutoOpen: false
|
|
});
|
|
return db.open().then(function() {
|
|
return enterTransactionScope(db, mode, storeNames, null, scopeFunc);
|
|
});
|
|
}
|
|
return rejection(ex);
|
|
}
|
|
}
|
|
var scopeFuncIsAsync = isAsyncFunction(scopeFunc);
|
|
if (scopeFuncIsAsync) {
|
|
incrementExpectedAwaits();
|
|
}
|
|
var returnValue;
|
|
var promiseFollowed = DexiePromise.follow(function() {
|
|
returnValue = scopeFunc.call(trans, trans);
|
|
if (returnValue) {
|
|
if (scopeFuncIsAsync) {
|
|
var decrementor = decrementExpectedAwaits.bind(null, null);
|
|
returnValue.then(decrementor, decrementor);
|
|
} else if (typeof returnValue.next === 'function' && typeof returnValue.throw === 'function') {
|
|
returnValue = awaitIterator(returnValue);
|
|
}
|
|
}
|
|
}, zoneProps);
|
|
return (returnValue && typeof returnValue.then === 'function' ? DexiePromise.resolve(returnValue).then(function(x) {
|
|
return trans.active ? x : rejection(new exceptions.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"));
|
|
}) : promiseFollowed.then(function() {
|
|
return returnValue;
|
|
})).then(function(x) {
|
|
if (parentTransaction) trans._resolve();
|
|
return trans._completion.then(function() {
|
|
return x;
|
|
});
|
|
}).catch(function(e) {
|
|
trans._reject(e);
|
|
return rejection(e);
|
|
});
|
|
});
|
|
}
|
|
function pad(a, value, count) {
|
|
var result = isArray(a) ? a.slice() : [
|
|
a
|
|
];
|
|
for(var i = 0; i < count; ++i)result.push(value);
|
|
return result;
|
|
}
|
|
function createVirtualIndexMiddleware(down) {
|
|
return __assign(__assign({}, down), {
|
|
table: function(tableName) {
|
|
var table = down.table(tableName);
|
|
var schema = table.schema;
|
|
var indexLookup = {};
|
|
var allVirtualIndexes = [];
|
|
function addVirtualIndexes(keyPath, keyTail, lowLevelIndex) {
|
|
var keyPathAlias = getKeyPathAlias(keyPath);
|
|
var indexList = indexLookup[keyPathAlias] = indexLookup[keyPathAlias] || [];
|
|
var keyLength = keyPath == null ? 0 : typeof keyPath === 'string' ? 1 : keyPath.length;
|
|
var isVirtual = keyTail > 0;
|
|
var virtualIndex = __assign(__assign({}, lowLevelIndex), {
|
|
name: isVirtual ? "".concat(keyPathAlias, "(virtual-from:").concat(lowLevelIndex.name, ")") : lowLevelIndex.name,
|
|
lowLevelIndex: lowLevelIndex,
|
|
isVirtual: isVirtual,
|
|
keyTail: keyTail,
|
|
keyLength: keyLength,
|
|
extractKey: getKeyExtractor(keyPath),
|
|
unique: !isVirtual && lowLevelIndex.unique
|
|
});
|
|
indexList.push(virtualIndex);
|
|
if (!virtualIndex.isPrimaryKey) {
|
|
allVirtualIndexes.push(virtualIndex);
|
|
}
|
|
if (keyLength > 1) {
|
|
var virtualKeyPath = keyLength === 2 ? keyPath[0] : keyPath.slice(0, keyLength - 1);
|
|
addVirtualIndexes(virtualKeyPath, keyTail + 1, lowLevelIndex);
|
|
}
|
|
indexList.sort(function(a, b) {
|
|
return a.keyTail - b.keyTail;
|
|
});
|
|
return virtualIndex;
|
|
}
|
|
var primaryKey = addVirtualIndexes(schema.primaryKey.keyPath, 0, schema.primaryKey);
|
|
indexLookup[":id"] = [
|
|
primaryKey
|
|
];
|
|
for(var _i = 0, _a = schema.indexes; _i < _a.length; _i++){
|
|
var index = _a[_i];
|
|
addVirtualIndexes(index.keyPath, 0, index);
|
|
}
|
|
function findBestIndex(keyPath) {
|
|
var result = indexLookup[getKeyPathAlias(keyPath)];
|
|
return result && result[0];
|
|
}
|
|
function translateRange(range, keyTail) {
|
|
return {
|
|
type: range.type === 1 ? 2 : range.type,
|
|
lower: pad(range.lower, range.lowerOpen ? down.MAX_KEY : down.MIN_KEY, keyTail),
|
|
lowerOpen: true,
|
|
upper: pad(range.upper, range.upperOpen ? down.MIN_KEY : down.MAX_KEY, keyTail),
|
|
upperOpen: true
|
|
};
|
|
}
|
|
function translateRequest(req) {
|
|
var index = req.query.index;
|
|
return index.isVirtual ? __assign(__assign({}, req), {
|
|
query: {
|
|
index: index.lowLevelIndex,
|
|
range: translateRange(req.query.range, index.keyTail)
|
|
}
|
|
}) : req;
|
|
}
|
|
var result = __assign(__assign({}, table), {
|
|
schema: __assign(__assign({}, schema), {
|
|
primaryKey: primaryKey,
|
|
indexes: allVirtualIndexes,
|
|
getIndexByKeyPath: findBestIndex
|
|
}),
|
|
count: function(req) {
|
|
return table.count(translateRequest(req));
|
|
},
|
|
query: function(req) {
|
|
return table.query(translateRequest(req));
|
|
},
|
|
openCursor: function(req) {
|
|
var _a = req.query.index, keyTail = _a.keyTail, isVirtual = _a.isVirtual, keyLength = _a.keyLength;
|
|
if (!isVirtual) return table.openCursor(req);
|
|
function createVirtualCursor(cursor) {
|
|
function _continue(key) {
|
|
key != null ? cursor.continue(pad(key, req.reverse ? down.MAX_KEY : down.MIN_KEY, keyTail)) : req.unique ? cursor.continue(cursor.key.slice(0, keyLength).concat(req.reverse ? down.MIN_KEY : down.MAX_KEY, keyTail)) : cursor.continue();
|
|
}
|
|
var virtualCursor = Object.create(cursor, {
|
|
continue: {
|
|
value: _continue
|
|
},
|
|
continuePrimaryKey: {
|
|
value: function(key, primaryKey) {
|
|
cursor.continuePrimaryKey(pad(key, down.MAX_KEY, keyTail), primaryKey);
|
|
}
|
|
},
|
|
primaryKey: {
|
|
get: function() {
|
|
return cursor.primaryKey;
|
|
}
|
|
},
|
|
key: {
|
|
get: function() {
|
|
var key = cursor.key;
|
|
return keyLength === 1 ? key[0] : key.slice(0, keyLength);
|
|
}
|
|
},
|
|
value: {
|
|
get: function() {
|
|
return cursor.value;
|
|
}
|
|
}
|
|
});
|
|
return virtualCursor;
|
|
}
|
|
return table.openCursor(translateRequest(req)).then(function(cursor) {
|
|
return cursor && createVirtualCursor(cursor);
|
|
});
|
|
}
|
|
});
|
|
return result;
|
|
}
|
|
});
|
|
}
|
|
var virtualIndexMiddleware = {
|
|
stack: "dbcore",
|
|
name: "VirtualIndexMiddleware",
|
|
level: 1,
|
|
create: createVirtualIndexMiddleware
|
|
};
|
|
function getObjectDiff(a, b, rv, prfx) {
|
|
rv = rv || {};
|
|
prfx = prfx || '';
|
|
keys(a).forEach(function(prop) {
|
|
if (!hasOwn(b, prop)) {
|
|
rv[prfx + prop] = undefined;
|
|
} else {
|
|
var ap = a[prop], bp = b[prop];
|
|
if (typeof ap === 'object' && typeof bp === 'object' && ap && bp) {
|
|
var apTypeName = toStringTag(ap);
|
|
var bpTypeName = toStringTag(bp);
|
|
if (apTypeName !== bpTypeName) {
|
|
rv[prfx + prop] = b[prop];
|
|
} else if (apTypeName === 'Object') {
|
|
getObjectDiff(ap, bp, rv, prfx + prop + '.');
|
|
} else if (ap !== bp) {
|
|
rv[prfx + prop] = b[prop];
|
|
}
|
|
} else if (ap !== bp) rv[prfx + prop] = b[prop];
|
|
}
|
|
});
|
|
keys(b).forEach(function(prop) {
|
|
if (!hasOwn(a, prop)) {
|
|
rv[prfx + prop] = b[prop];
|
|
}
|
|
});
|
|
return rv;
|
|
}
|
|
function getEffectiveKeys(primaryKey, req) {
|
|
if (req.type === 'delete') return req.keys;
|
|
return req.keys || req.values.map(primaryKey.extractKey);
|
|
}
|
|
var hooksMiddleware = {
|
|
stack: "dbcore",
|
|
name: "HooksMiddleware",
|
|
level: 2,
|
|
create: function(downCore) {
|
|
return __assign(__assign({}, downCore), {
|
|
table: function(tableName) {
|
|
var downTable = downCore.table(tableName);
|
|
var primaryKey = downTable.schema.primaryKey;
|
|
var tableMiddleware = __assign(__assign({}, downTable), {
|
|
mutate: function(req) {
|
|
var dxTrans = PSD.trans;
|
|
var _a = dxTrans.table(tableName).hook, deleting = _a.deleting, creating = _a.creating, updating = _a.updating;
|
|
switch(req.type){
|
|
case 'add':
|
|
if (creating.fire === nop) break;
|
|
return dxTrans._promise('readwrite', function() {
|
|
return addPutOrDelete(req);
|
|
}, true);
|
|
case 'put':
|
|
if (creating.fire === nop && updating.fire === nop) break;
|
|
return dxTrans._promise('readwrite', function() {
|
|
return addPutOrDelete(req);
|
|
}, true);
|
|
case 'delete':
|
|
if (deleting.fire === nop) break;
|
|
return dxTrans._promise('readwrite', function() {
|
|
return addPutOrDelete(req);
|
|
}, true);
|
|
case 'deleteRange':
|
|
if (deleting.fire === nop) break;
|
|
return dxTrans._promise('readwrite', function() {
|
|
return deleteRange(req);
|
|
}, true);
|
|
}
|
|
return downTable.mutate(req);
|
|
//TURBOPACK unreachable
|
|
;
|
|
function addPutOrDelete(req) {
|
|
var dxTrans = PSD.trans;
|
|
var keys = req.keys || getEffectiveKeys(primaryKey, req);
|
|
if (!keys) throw new Error("Keys missing");
|
|
req = req.type === 'add' || req.type === 'put' ? __assign(__assign({}, req), {
|
|
keys: keys
|
|
}) : __assign({}, req);
|
|
if (req.type !== 'delete') req.values = __spreadArray([], req.values, true);
|
|
if (req.keys) req.keys = __spreadArray([], req.keys, true);
|
|
return getExistingValues(downTable, req, keys).then(function(existingValues) {
|
|
var contexts = keys.map(function(key, i) {
|
|
var existingValue = existingValues[i];
|
|
var ctx = {
|
|
onerror: null,
|
|
onsuccess: null
|
|
};
|
|
if (req.type === 'delete') {
|
|
deleting.fire.call(ctx, key, existingValue, dxTrans);
|
|
} else if (req.type === 'add' || existingValue === undefined) {
|
|
var generatedPrimaryKey = creating.fire.call(ctx, key, req.values[i], dxTrans);
|
|
if (key == null && generatedPrimaryKey != null) {
|
|
key = generatedPrimaryKey;
|
|
req.keys[i] = key;
|
|
if (!primaryKey.outbound) {
|
|
setByKeyPath(req.values[i], primaryKey.keyPath, key);
|
|
}
|
|
}
|
|
} else {
|
|
var objectDiff = getObjectDiff(existingValue, req.values[i]);
|
|
var additionalChanges_1 = updating.fire.call(ctx, objectDiff, key, existingValue, dxTrans);
|
|
if (additionalChanges_1) {
|
|
var requestedValue_1 = req.values[i];
|
|
Object.keys(additionalChanges_1).forEach(function(keyPath) {
|
|
if (hasOwn(requestedValue_1, keyPath)) {
|
|
requestedValue_1[keyPath] = additionalChanges_1[keyPath];
|
|
} else {
|
|
setByKeyPath(requestedValue_1, keyPath, additionalChanges_1[keyPath]);
|
|
}
|
|
});
|
|
}
|
|
}
|
|
return ctx;
|
|
});
|
|
return downTable.mutate(req).then(function(_a) {
|
|
var failures = _a.failures, results = _a.results, numFailures = _a.numFailures, lastResult = _a.lastResult;
|
|
for(var i = 0; i < keys.length; ++i){
|
|
var primKey = results ? results[i] : keys[i];
|
|
var ctx = contexts[i];
|
|
if (primKey == null) {
|
|
ctx.onerror && ctx.onerror(failures[i]);
|
|
} else {
|
|
ctx.onsuccess && ctx.onsuccess(req.type === 'put' && existingValues[i] ? req.values[i] : primKey);
|
|
}
|
|
}
|
|
return {
|
|
failures: failures,
|
|
results: results,
|
|
numFailures: numFailures,
|
|
lastResult: lastResult
|
|
};
|
|
}).catch(function(error) {
|
|
contexts.forEach(function(ctx) {
|
|
return ctx.onerror && ctx.onerror(error);
|
|
});
|
|
return Promise.reject(error);
|
|
});
|
|
});
|
|
}
|
|
function deleteRange(req) {
|
|
return deleteNextChunk(req.trans, req.range, 10000);
|
|
}
|
|
function deleteNextChunk(trans, range, limit) {
|
|
return downTable.query({
|
|
trans: trans,
|
|
values: false,
|
|
query: {
|
|
index: primaryKey,
|
|
range: range
|
|
},
|
|
limit: limit
|
|
}).then(function(_a) {
|
|
var result = _a.result;
|
|
return addPutOrDelete({
|
|
type: 'delete',
|
|
keys: result,
|
|
trans: trans
|
|
}).then(function(res) {
|
|
if (res.numFailures > 0) return Promise.reject(res.failures[0]);
|
|
if (result.length < limit) {
|
|
return {
|
|
failures: [],
|
|
numFailures: 0,
|
|
lastResult: undefined
|
|
};
|
|
} else {
|
|
return deleteNextChunk(trans, __assign(__assign({}, range), {
|
|
lower: result[result.length - 1],
|
|
lowerOpen: true
|
|
}), limit);
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|
|
});
|
|
return tableMiddleware;
|
|
}
|
|
});
|
|
}
|
|
};
|
|
function getExistingValues(table, req, effectiveKeys) {
|
|
return req.type === "add" ? Promise.resolve([]) : table.getMany({
|
|
trans: req.trans,
|
|
keys: effectiveKeys,
|
|
cache: "immutable"
|
|
});
|
|
}
|
|
function getFromTransactionCache(keys, cache, clone) {
|
|
try {
|
|
if (!cache) return null;
|
|
if (cache.keys.length < keys.length) return null;
|
|
var result = [];
|
|
for(var i = 0, j = 0; i < cache.keys.length && j < keys.length; ++i){
|
|
if (cmp(cache.keys[i], keys[j]) !== 0) continue;
|
|
result.push(clone ? deepClone(cache.values[i]) : cache.values[i]);
|
|
++j;
|
|
}
|
|
return result.length === keys.length ? result : null;
|
|
} catch (_a) {
|
|
return null;
|
|
}
|
|
}
|
|
var cacheExistingValuesMiddleware = {
|
|
stack: "dbcore",
|
|
level: -1,
|
|
create: function(core) {
|
|
return {
|
|
table: function(tableName) {
|
|
var table = core.table(tableName);
|
|
return __assign(__assign({}, table), {
|
|
getMany: function(req) {
|
|
if (!req.cache) {
|
|
return table.getMany(req);
|
|
}
|
|
var cachedResult = getFromTransactionCache(req.keys, req.trans["_cache"], req.cache === "clone");
|
|
if (cachedResult) {
|
|
return DexiePromise.resolve(cachedResult);
|
|
}
|
|
return table.getMany(req).then(function(res) {
|
|
req.trans["_cache"] = {
|
|
keys: req.keys,
|
|
values: req.cache === "clone" ? deepClone(res) : res
|
|
};
|
|
return res;
|
|
});
|
|
},
|
|
mutate: function(req) {
|
|
if (req.type !== "add") req.trans["_cache"] = null;
|
|
return table.mutate(req);
|
|
}
|
|
});
|
|
}
|
|
};
|
|
}
|
|
};
|
|
function isCachableContext(ctx, table) {
|
|
return ctx.trans.mode === 'readonly' && !!ctx.subscr && !ctx.trans.explicit && ctx.trans.db._options.cache !== 'disabled' && !table.schema.primaryKey.outbound;
|
|
}
|
|
function isCachableRequest(type, req) {
|
|
switch(type){
|
|
case 'query':
|
|
return req.values && !req.unique;
|
|
case 'get':
|
|
return false;
|
|
case 'getMany':
|
|
return false;
|
|
case 'count':
|
|
return false;
|
|
case 'openCursor':
|
|
return false;
|
|
}
|
|
}
|
|
var observabilityMiddleware = {
|
|
stack: "dbcore",
|
|
level: 0,
|
|
name: "Observability",
|
|
create: function(core) {
|
|
var dbName = core.schema.name;
|
|
var FULL_RANGE = new RangeSet(core.MIN_KEY, core.MAX_KEY);
|
|
return __assign(__assign({}, core), {
|
|
transaction: function(stores, mode, options) {
|
|
if (PSD.subscr && mode !== 'readonly') {
|
|
throw new exceptions.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(PSD.querier));
|
|
}
|
|
return core.transaction(stores, mode, options);
|
|
},
|
|
table: function(tableName) {
|
|
var table = core.table(tableName);
|
|
var schema = table.schema;
|
|
var primaryKey = schema.primaryKey, indexes = schema.indexes;
|
|
var extractKey = primaryKey.extractKey, outbound = primaryKey.outbound;
|
|
var indexesWithAutoIncPK = primaryKey.autoIncrement && indexes.filter(function(index) {
|
|
return index.compound && index.keyPath.includes(primaryKey.keyPath);
|
|
});
|
|
var tableClone = __assign(__assign({}, table), {
|
|
mutate: function(req) {
|
|
var _a, _b;
|
|
var trans = req.trans;
|
|
var mutatedParts = req.mutatedParts || (req.mutatedParts = {});
|
|
var getRangeSet = function(indexName) {
|
|
var part = "idb://".concat(dbName, "/").concat(tableName, "/").concat(indexName);
|
|
return mutatedParts[part] || (mutatedParts[part] = new RangeSet());
|
|
};
|
|
var pkRangeSet = getRangeSet("");
|
|
var delsRangeSet = getRangeSet(":dels");
|
|
var type = req.type;
|
|
var _c = req.type === "deleteRange" ? [
|
|
req.range
|
|
] : req.type === "delete" ? [
|
|
req.keys
|
|
] : req.values.length < 50 ? [
|
|
getEffectiveKeys(primaryKey, req).filter(function(id) {
|
|
return id;
|
|
}),
|
|
req.values
|
|
] : [], keys = _c[0], newObjs = _c[1];
|
|
var oldCache = req.trans["_cache"];
|
|
if (isArray(keys)) {
|
|
pkRangeSet.addKeys(keys);
|
|
var oldObjs = type === 'delete' || keys.length === newObjs.length ? getFromTransactionCache(keys, oldCache) : null;
|
|
if (!oldObjs) {
|
|
delsRangeSet.addKeys(keys);
|
|
}
|
|
if (oldObjs || newObjs) {
|
|
trackAffectedIndexes(getRangeSet, schema, oldObjs, newObjs);
|
|
}
|
|
} else if (keys) {
|
|
var range = {
|
|
from: (_a = keys.lower) !== null && _a !== void 0 ? _a : core.MIN_KEY,
|
|
to: (_b = keys.upper) !== null && _b !== void 0 ? _b : core.MAX_KEY
|
|
};
|
|
delsRangeSet.add(range);
|
|
pkRangeSet.add(range);
|
|
} else {
|
|
pkRangeSet.add(FULL_RANGE);
|
|
delsRangeSet.add(FULL_RANGE);
|
|
schema.indexes.forEach(function(idx) {
|
|
return getRangeSet(idx.name).add(FULL_RANGE);
|
|
});
|
|
}
|
|
return table.mutate(req).then(function(res) {
|
|
if (keys && (req.type === 'add' || req.type === 'put')) {
|
|
pkRangeSet.addKeys(res.results);
|
|
if (indexesWithAutoIncPK) {
|
|
indexesWithAutoIncPK.forEach(function(idx) {
|
|
var idxVals = req.values.map(function(v) {
|
|
return idx.extractKey(v);
|
|
});
|
|
var pkPos = idx.keyPath.findIndex(function(prop) {
|
|
return prop === primaryKey.keyPath;
|
|
});
|
|
for(var i = 0, len = res.results.length; i < len; ++i){
|
|
idxVals[i][pkPos] = res.results[i];
|
|
}
|
|
getRangeSet(idx.name).addKeys(idxVals);
|
|
});
|
|
}
|
|
}
|
|
trans.mutatedParts = extendObservabilitySet(trans.mutatedParts || {}, mutatedParts);
|
|
return res;
|
|
});
|
|
}
|
|
});
|
|
var getRange = function(_a) {
|
|
var _b, _c;
|
|
var _d = _a.query, index = _d.index, range = _d.range;
|
|
return [
|
|
index,
|
|
new RangeSet((_b = range.lower) !== null && _b !== void 0 ? _b : core.MIN_KEY, (_c = range.upper) !== null && _c !== void 0 ? _c : core.MAX_KEY)
|
|
];
|
|
};
|
|
var readSubscribers = {
|
|
get: function(req) {
|
|
return [
|
|
primaryKey,
|
|
new RangeSet(req.key)
|
|
];
|
|
},
|
|
getMany: function(req) {
|
|
return [
|
|
primaryKey,
|
|
new RangeSet().addKeys(req.keys)
|
|
];
|
|
},
|
|
count: getRange,
|
|
query: getRange,
|
|
openCursor: getRange
|
|
};
|
|
keys(readSubscribers).forEach(function(method) {
|
|
tableClone[method] = function(req) {
|
|
var subscr = PSD.subscr;
|
|
var isLiveQuery = !!subscr;
|
|
var cachable = isCachableContext(PSD, table) && isCachableRequest(method, req);
|
|
var obsSet = cachable ? req.obsSet = {} : subscr;
|
|
if (isLiveQuery) {
|
|
var getRangeSet = function(indexName) {
|
|
var part = "idb://".concat(dbName, "/").concat(tableName, "/").concat(indexName);
|
|
return obsSet[part] || (obsSet[part] = new RangeSet());
|
|
};
|
|
var pkRangeSet_1 = getRangeSet("");
|
|
var delsRangeSet_1 = getRangeSet(":dels");
|
|
var _a = readSubscribers[method](req), queriedIndex = _a[0], queriedRanges = _a[1];
|
|
if (method === 'query' && queriedIndex.isPrimaryKey && !req.values) {
|
|
delsRangeSet_1.add(queriedRanges);
|
|
} else {
|
|
getRangeSet(queriedIndex.name || "").add(queriedRanges);
|
|
}
|
|
if (!queriedIndex.isPrimaryKey) {
|
|
if (method === "count") {
|
|
delsRangeSet_1.add(FULL_RANGE);
|
|
} else {
|
|
var keysPromise_1 = method === "query" && outbound && req.values && table.query(__assign(__assign({}, req), {
|
|
values: false
|
|
}));
|
|
return table[method].apply(this, arguments).then(function(res) {
|
|
if (method === "query") {
|
|
if (outbound && req.values) {
|
|
return keysPromise_1.then(function(_a) {
|
|
var resultingKeys = _a.result;
|
|
pkRangeSet_1.addKeys(resultingKeys);
|
|
return res;
|
|
});
|
|
}
|
|
var pKeys = req.values ? res.result.map(extractKey) : res.result;
|
|
if (req.values) {
|
|
pkRangeSet_1.addKeys(pKeys);
|
|
} else {
|
|
delsRangeSet_1.addKeys(pKeys);
|
|
}
|
|
} else if (method === "openCursor") {
|
|
var cursor_1 = res;
|
|
var wantValues_1 = req.values;
|
|
return cursor_1 && Object.create(cursor_1, {
|
|
key: {
|
|
get: function() {
|
|
delsRangeSet_1.addKey(cursor_1.primaryKey);
|
|
return cursor_1.key;
|
|
}
|
|
},
|
|
primaryKey: {
|
|
get: function() {
|
|
var pkey = cursor_1.primaryKey;
|
|
delsRangeSet_1.addKey(pkey);
|
|
return pkey;
|
|
}
|
|
},
|
|
value: {
|
|
get: function() {
|
|
wantValues_1 && pkRangeSet_1.addKey(cursor_1.primaryKey);
|
|
return cursor_1.value;
|
|
}
|
|
}
|
|
});
|
|
}
|
|
return res;
|
|
});
|
|
}
|
|
}
|
|
}
|
|
return table[method].apply(this, arguments);
|
|
};
|
|
});
|
|
return tableClone;
|
|
}
|
|
});
|
|
}
|
|
};
|
|
function trackAffectedIndexes(getRangeSet, schema, oldObjs, newObjs) {
|
|
function addAffectedIndex(ix) {
|
|
var rangeSet = getRangeSet(ix.name || "");
|
|
function extractKey(obj) {
|
|
return obj != null ? ix.extractKey(obj) : null;
|
|
}
|
|
var addKeyOrKeys = function(key) {
|
|
return ix.multiEntry && isArray(key) ? key.forEach(function(key) {
|
|
return rangeSet.addKey(key);
|
|
}) : rangeSet.addKey(key);
|
|
};
|
|
(oldObjs || newObjs).forEach(function(_, i) {
|
|
var oldKey = oldObjs && extractKey(oldObjs[i]);
|
|
var newKey = newObjs && extractKey(newObjs[i]);
|
|
if (cmp(oldKey, newKey) !== 0) {
|
|
if (oldKey != null) addKeyOrKeys(oldKey);
|
|
if (newKey != null) addKeyOrKeys(newKey);
|
|
}
|
|
});
|
|
}
|
|
schema.indexes.forEach(addAffectedIndex);
|
|
}
|
|
function adjustOptimisticFromFailures(tblCache, req, res) {
|
|
if (res.numFailures === 0) return req;
|
|
if (req.type === 'deleteRange') {
|
|
return null;
|
|
}
|
|
var numBulkOps = req.keys ? req.keys.length : 'values' in req && req.values ? req.values.length : 1;
|
|
if (res.numFailures === numBulkOps) {
|
|
return null;
|
|
}
|
|
var clone = __assign({}, req);
|
|
if (isArray(clone.keys)) {
|
|
clone.keys = clone.keys.filter(function(_, i) {
|
|
return !(i in res.failures);
|
|
});
|
|
}
|
|
if ('values' in clone && isArray(clone.values)) {
|
|
clone.values = clone.values.filter(function(_, i) {
|
|
return !(i in res.failures);
|
|
});
|
|
}
|
|
return clone;
|
|
}
|
|
function isAboveLower(key, range) {
|
|
return range.lower === undefined ? true : range.lowerOpen ? cmp(key, range.lower) > 0 : cmp(key, range.lower) >= 0;
|
|
}
|
|
function isBelowUpper(key, range) {
|
|
return range.upper === undefined ? true : range.upperOpen ? cmp(key, range.upper) < 0 : cmp(key, range.upper) <= 0;
|
|
}
|
|
function isWithinRange(key, range) {
|
|
return isAboveLower(key, range) && isBelowUpper(key, range);
|
|
}
|
|
function applyOptimisticOps(result, req, ops, table, cacheEntry, immutable) {
|
|
if (!ops || ops.length === 0) return result;
|
|
var index = req.query.index;
|
|
var multiEntry = index.multiEntry;
|
|
var queryRange = req.query.range;
|
|
var primaryKey = table.schema.primaryKey;
|
|
var extractPrimKey = primaryKey.extractKey;
|
|
var extractIndex = index.extractKey;
|
|
var extractLowLevelIndex = (index.lowLevelIndex || index).extractKey;
|
|
var finalResult = ops.reduce(function(result, op) {
|
|
var modifedResult = result;
|
|
var includedValues = [];
|
|
if (op.type === 'add' || op.type === 'put') {
|
|
var includedPKs = new RangeSet();
|
|
for(var i = op.values.length - 1; i >= 0; --i){
|
|
var value = op.values[i];
|
|
var pk = extractPrimKey(value);
|
|
if (includedPKs.hasKey(pk)) continue;
|
|
var key = extractIndex(value);
|
|
if (multiEntry && isArray(key) ? key.some(function(k) {
|
|
return isWithinRange(k, queryRange);
|
|
}) : isWithinRange(key, queryRange)) {
|
|
includedPKs.addKey(pk);
|
|
includedValues.push(value);
|
|
}
|
|
}
|
|
}
|
|
switch(op.type){
|
|
case 'add':
|
|
{
|
|
var existingKeys_1 = new RangeSet().addKeys(req.values ? result.map(function(v) {
|
|
return extractPrimKey(v);
|
|
}) : result);
|
|
modifedResult = result.concat(req.values ? includedValues.filter(function(v) {
|
|
var key = extractPrimKey(v);
|
|
if (existingKeys_1.hasKey(key)) return false;
|
|
existingKeys_1.addKey(key);
|
|
return true;
|
|
}) : includedValues.map(function(v) {
|
|
return extractPrimKey(v);
|
|
}).filter(function(k) {
|
|
if (existingKeys_1.hasKey(k)) return false;
|
|
existingKeys_1.addKey(k);
|
|
return true;
|
|
}));
|
|
break;
|
|
}
|
|
case 'put':
|
|
{
|
|
var keySet_1 = new RangeSet().addKeys(op.values.map(function(v) {
|
|
return extractPrimKey(v);
|
|
}));
|
|
modifedResult = result.filter(function(item) {
|
|
return !keySet_1.hasKey(req.values ? extractPrimKey(item) : item);
|
|
}).concat(req.values ? includedValues : includedValues.map(function(v) {
|
|
return extractPrimKey(v);
|
|
}));
|
|
break;
|
|
}
|
|
case 'delete':
|
|
var keysToDelete_1 = new RangeSet().addKeys(op.keys);
|
|
modifedResult = result.filter(function(item) {
|
|
return !keysToDelete_1.hasKey(req.values ? extractPrimKey(item) : item);
|
|
});
|
|
break;
|
|
case 'deleteRange':
|
|
var range_1 = op.range;
|
|
modifedResult = result.filter(function(item) {
|
|
return !isWithinRange(extractPrimKey(item), range_1);
|
|
});
|
|
break;
|
|
}
|
|
return modifedResult;
|
|
}, result);
|
|
if (finalResult === result) return result;
|
|
finalResult.sort(function(a, b) {
|
|
return cmp(extractLowLevelIndex(a), extractLowLevelIndex(b)) || cmp(extractPrimKey(a), extractPrimKey(b));
|
|
});
|
|
if (req.limit && req.limit < Infinity) {
|
|
if (finalResult.length > req.limit) {
|
|
finalResult.length = req.limit;
|
|
} else if (result.length === req.limit && finalResult.length < req.limit) {
|
|
cacheEntry.dirty = true;
|
|
}
|
|
}
|
|
return immutable ? Object.freeze(finalResult) : finalResult;
|
|
}
|
|
function areRangesEqual(r1, r2) {
|
|
return cmp(r1.lower, r2.lower) === 0 && cmp(r1.upper, r2.upper) === 0 && !!r1.lowerOpen === !!r2.lowerOpen && !!r1.upperOpen === !!r2.upperOpen;
|
|
}
|
|
function compareLowers(lower1, lower2, lowerOpen1, lowerOpen2) {
|
|
if (lower1 === undefined) return lower2 !== undefined ? -1 : 0;
|
|
if (lower2 === undefined) return 1;
|
|
var c = cmp(lower1, lower2);
|
|
if (c === 0) {
|
|
if (lowerOpen1 && lowerOpen2) return 0;
|
|
if (lowerOpen1) return 1;
|
|
if (lowerOpen2) return -1;
|
|
}
|
|
return c;
|
|
}
|
|
function compareUppers(upper1, upper2, upperOpen1, upperOpen2) {
|
|
if (upper1 === undefined) return upper2 !== undefined ? 1 : 0;
|
|
if (upper2 === undefined) return -1;
|
|
var c = cmp(upper1, upper2);
|
|
if (c === 0) {
|
|
if (upperOpen1 && upperOpen2) return 0;
|
|
if (upperOpen1) return -1;
|
|
if (upperOpen2) return 1;
|
|
}
|
|
return c;
|
|
}
|
|
function isSuperRange(r1, r2) {
|
|
return compareLowers(r1.lower, r2.lower, r1.lowerOpen, r2.lowerOpen) <= 0 && compareUppers(r1.upper, r2.upper, r1.upperOpen, r2.upperOpen) >= 0;
|
|
}
|
|
function findCompatibleQuery(dbName, tableName, type, req) {
|
|
var tblCache = cache["idb://".concat(dbName, "/").concat(tableName)];
|
|
if (!tblCache) return [];
|
|
var queries = tblCache.queries[type];
|
|
if (!queries) return [
|
|
null,
|
|
false,
|
|
tblCache,
|
|
null
|
|
];
|
|
var indexName = req.query ? req.query.index.name : null;
|
|
var entries = queries[indexName || ''];
|
|
if (!entries) return [
|
|
null,
|
|
false,
|
|
tblCache,
|
|
null
|
|
];
|
|
switch(type){
|
|
case 'query':
|
|
var equalEntry = entries.find(function(entry) {
|
|
return entry.req.limit === req.limit && entry.req.values === req.values && areRangesEqual(entry.req.query.range, req.query.range);
|
|
});
|
|
if (equalEntry) return [
|
|
equalEntry,
|
|
true,
|
|
tblCache,
|
|
entries
|
|
];
|
|
var superEntry = entries.find(function(entry) {
|
|
var limit = 'limit' in entry.req ? entry.req.limit : Infinity;
|
|
return limit >= req.limit && (req.values ? entry.req.values : true) && isSuperRange(entry.req.query.range, req.query.range);
|
|
});
|
|
return [
|
|
superEntry,
|
|
false,
|
|
tblCache,
|
|
entries
|
|
];
|
|
case 'count':
|
|
var countQuery = entries.find(function(entry) {
|
|
return areRangesEqual(entry.req.query.range, req.query.range);
|
|
});
|
|
return [
|
|
countQuery,
|
|
!!countQuery,
|
|
tblCache,
|
|
entries
|
|
];
|
|
}
|
|
}
|
|
function subscribeToCacheEntry(cacheEntry, container, requery, signal) {
|
|
cacheEntry.subscribers.add(requery);
|
|
signal.addEventListener("abort", function() {
|
|
cacheEntry.subscribers.delete(requery);
|
|
if (cacheEntry.subscribers.size === 0) {
|
|
enqueForDeletion(cacheEntry, container);
|
|
}
|
|
});
|
|
}
|
|
function enqueForDeletion(cacheEntry, container) {
|
|
setTimeout(function() {
|
|
if (cacheEntry.subscribers.size === 0) {
|
|
delArrayItem(container, cacheEntry);
|
|
}
|
|
}, 3000);
|
|
}
|
|
var cacheMiddleware = {
|
|
stack: 'dbcore',
|
|
level: 0,
|
|
name: 'Cache',
|
|
create: function(core) {
|
|
var dbName = core.schema.name;
|
|
var coreMW = __assign(__assign({}, core), {
|
|
transaction: function(stores, mode, options) {
|
|
var idbtrans = core.transaction(stores, mode, options);
|
|
if (mode === 'readwrite') {
|
|
var ac_1 = new AbortController();
|
|
var signal = ac_1.signal;
|
|
var endTransaction = function(wasCommitted) {
|
|
return function() {
|
|
ac_1.abort();
|
|
if (mode === 'readwrite') {
|
|
var affectedSubscribers_1 = new Set();
|
|
for(var _i = 0, stores_1 = stores; _i < stores_1.length; _i++){
|
|
var storeName = stores_1[_i];
|
|
var tblCache = cache["idb://".concat(dbName, "/").concat(storeName)];
|
|
if (tblCache) {
|
|
var table = core.table(storeName);
|
|
var ops = tblCache.optimisticOps.filter(function(op) {
|
|
return op.trans === idbtrans;
|
|
});
|
|
if (idbtrans._explicit && wasCommitted && idbtrans.mutatedParts) {
|
|
for(var _a = 0, _b = Object.values(tblCache.queries.query); _a < _b.length; _a++){
|
|
var entries = _b[_a];
|
|
for(var _c = 0, _d = entries.slice(); _c < _d.length; _c++){
|
|
var entry = _d[_c];
|
|
if (obsSetsOverlap(entry.obsSet, idbtrans.mutatedParts)) {
|
|
delArrayItem(entries, entry);
|
|
entry.subscribers.forEach(function(requery) {
|
|
return affectedSubscribers_1.add(requery);
|
|
});
|
|
}
|
|
}
|
|
}
|
|
} else if (ops.length > 0) {
|
|
tblCache.optimisticOps = tblCache.optimisticOps.filter(function(op) {
|
|
return op.trans !== idbtrans;
|
|
});
|
|
for(var _e = 0, _f = Object.values(tblCache.queries.query); _e < _f.length; _e++){
|
|
var entries = _f[_e];
|
|
for(var _g = 0, _h = entries.slice(); _g < _h.length; _g++){
|
|
var entry = _h[_g];
|
|
if (entry.res != null && idbtrans.mutatedParts) {
|
|
if (wasCommitted && !entry.dirty) {
|
|
var freezeResults = Object.isFrozen(entry.res);
|
|
var modRes = applyOptimisticOps(entry.res, entry.req, ops, table, entry, freezeResults);
|
|
if (entry.dirty) {
|
|
delArrayItem(entries, entry);
|
|
entry.subscribers.forEach(function(requery) {
|
|
return affectedSubscribers_1.add(requery);
|
|
});
|
|
} else if (modRes !== entry.res) {
|
|
entry.res = modRes;
|
|
entry.promise = DexiePromise.resolve({
|
|
result: modRes
|
|
});
|
|
}
|
|
} else {
|
|
if (entry.dirty) {
|
|
delArrayItem(entries, entry);
|
|
}
|
|
entry.subscribers.forEach(function(requery) {
|
|
return affectedSubscribers_1.add(requery);
|
|
});
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
affectedSubscribers_1.forEach(function(requery) {
|
|
return requery();
|
|
});
|
|
}
|
|
};
|
|
};
|
|
idbtrans.addEventListener('abort', endTransaction(false), {
|
|
signal: signal
|
|
});
|
|
idbtrans.addEventListener('error', endTransaction(false), {
|
|
signal: signal
|
|
});
|
|
idbtrans.addEventListener('complete', endTransaction(true), {
|
|
signal: signal
|
|
});
|
|
}
|
|
return idbtrans;
|
|
},
|
|
table: function(tableName) {
|
|
var downTable = core.table(tableName);
|
|
var primKey = downTable.schema.primaryKey;
|
|
var tableMW = __assign(__assign({}, downTable), {
|
|
mutate: function(req) {
|
|
var trans = PSD.trans;
|
|
if (primKey.outbound || trans.db._options.cache === 'disabled' || trans.explicit || trans.idbtrans.mode !== 'readwrite') {
|
|
return downTable.mutate(req);
|
|
}
|
|
var tblCache = cache["idb://".concat(dbName, "/").concat(tableName)];
|
|
if (!tblCache) return downTable.mutate(req);
|
|
var promise = downTable.mutate(req);
|
|
if ((req.type === 'add' || req.type === 'put') && (req.values.length >= 50 || getEffectiveKeys(primKey, req).some(function(key) {
|
|
return key == null;
|
|
}))) {
|
|
promise.then(function(res) {
|
|
var reqWithResolvedKeys = __assign(__assign({}, req), {
|
|
values: req.values.map(function(value, i) {
|
|
var _a;
|
|
if (res.failures[i]) return value;
|
|
var valueWithKey = ((_a = primKey.keyPath) === null || _a === void 0 ? void 0 : _a.includes('.')) ? deepClone(value) : __assign({}, value);
|
|
setByKeyPath(valueWithKey, primKey.keyPath, res.results[i]);
|
|
return valueWithKey;
|
|
})
|
|
});
|
|
var adjustedReq = adjustOptimisticFromFailures(tblCache, reqWithResolvedKeys, res);
|
|
tblCache.optimisticOps.push(adjustedReq);
|
|
queueMicrotask(function() {
|
|
return req.mutatedParts && signalSubscribersLazily(req.mutatedParts);
|
|
});
|
|
});
|
|
} else {
|
|
tblCache.optimisticOps.push(req);
|
|
req.mutatedParts && signalSubscribersLazily(req.mutatedParts);
|
|
promise.then(function(res) {
|
|
if (res.numFailures > 0) {
|
|
delArrayItem(tblCache.optimisticOps, req);
|
|
var adjustedReq = adjustOptimisticFromFailures(tblCache, req, res);
|
|
if (adjustedReq) {
|
|
tblCache.optimisticOps.push(adjustedReq);
|
|
}
|
|
req.mutatedParts && signalSubscribersLazily(req.mutatedParts);
|
|
}
|
|
});
|
|
promise.catch(function() {
|
|
delArrayItem(tblCache.optimisticOps, req);
|
|
req.mutatedParts && signalSubscribersLazily(req.mutatedParts);
|
|
});
|
|
}
|
|
return promise;
|
|
},
|
|
query: function(req) {
|
|
var _a;
|
|
if (!isCachableContext(PSD, downTable) || !isCachableRequest("query", req)) return downTable.query(req);
|
|
var freezeResults = ((_a = PSD.trans) === null || _a === void 0 ? void 0 : _a.db._options.cache) === 'immutable';
|
|
var _b = PSD, requery = _b.requery, signal = _b.signal;
|
|
var _c = findCompatibleQuery(dbName, tableName, 'query', req), cacheEntry = _c[0], exactMatch = _c[1], tblCache = _c[2], container = _c[3];
|
|
if (cacheEntry && exactMatch) {
|
|
cacheEntry.obsSet = req.obsSet;
|
|
} else {
|
|
var promise = downTable.query(req).then(function(res) {
|
|
var result = res.result;
|
|
if (cacheEntry) cacheEntry.res = result;
|
|
if (freezeResults) {
|
|
for(var i = 0, l = result.length; i < l; ++i){
|
|
Object.freeze(result[i]);
|
|
}
|
|
Object.freeze(result);
|
|
} else {
|
|
res.result = deepClone(result);
|
|
}
|
|
return res;
|
|
}).catch(function(error) {
|
|
if (container && cacheEntry) delArrayItem(container, cacheEntry);
|
|
return Promise.reject(error);
|
|
});
|
|
cacheEntry = {
|
|
obsSet: req.obsSet,
|
|
promise: promise,
|
|
subscribers: new Set(),
|
|
type: 'query',
|
|
req: req,
|
|
dirty: false
|
|
};
|
|
if (container) {
|
|
container.push(cacheEntry);
|
|
} else {
|
|
container = [
|
|
cacheEntry
|
|
];
|
|
if (!tblCache) {
|
|
tblCache = cache["idb://".concat(dbName, "/").concat(tableName)] = {
|
|
queries: {
|
|
query: {},
|
|
count: {}
|
|
},
|
|
objs: new Map(),
|
|
optimisticOps: [],
|
|
unsignaledParts: {}
|
|
};
|
|
}
|
|
tblCache.queries.query[req.query.index.name || ''] = container;
|
|
}
|
|
}
|
|
subscribeToCacheEntry(cacheEntry, container, requery, signal);
|
|
return cacheEntry.promise.then(function(res) {
|
|
return {
|
|
result: applyOptimisticOps(res.result, req, tblCache === null || tblCache === void 0 ? void 0 : tblCache.optimisticOps, downTable, cacheEntry, freezeResults)
|
|
};
|
|
});
|
|
}
|
|
});
|
|
return tableMW;
|
|
}
|
|
});
|
|
return coreMW;
|
|
}
|
|
};
|
|
function vipify(target, vipDb) {
|
|
return new Proxy(target, {
|
|
get: function(target, prop, receiver) {
|
|
if (prop === 'db') return vipDb;
|
|
return Reflect.get(target, prop, receiver);
|
|
}
|
|
});
|
|
}
|
|
var Dexie$1 = function() {
|
|
function Dexie(name, options) {
|
|
var _this = this;
|
|
this._middlewares = {};
|
|
this.verno = 0;
|
|
var deps = Dexie.dependencies;
|
|
this._options = options = __assign({
|
|
addons: Dexie.addons,
|
|
autoOpen: true,
|
|
indexedDB: deps.indexedDB,
|
|
IDBKeyRange: deps.IDBKeyRange,
|
|
cache: 'cloned'
|
|
}, options);
|
|
this._deps = {
|
|
indexedDB: options.indexedDB,
|
|
IDBKeyRange: options.IDBKeyRange
|
|
};
|
|
var addons = options.addons;
|
|
this._dbSchema = {};
|
|
this._versions = [];
|
|
this._storeNames = [];
|
|
this._allTables = {};
|
|
this.idbdb = null;
|
|
this._novip = this;
|
|
var state = {
|
|
dbOpenError: null,
|
|
isBeingOpened: false,
|
|
onReadyBeingFired: null,
|
|
openComplete: false,
|
|
dbReadyResolve: nop,
|
|
dbReadyPromise: null,
|
|
cancelOpen: nop,
|
|
openCanceller: null,
|
|
autoSchema: true,
|
|
PR1398_maxLoop: 3,
|
|
autoOpen: options.autoOpen
|
|
};
|
|
state.dbReadyPromise = new DexiePromise(function(resolve) {
|
|
state.dbReadyResolve = resolve;
|
|
});
|
|
state.openCanceller = new DexiePromise(function(_, reject) {
|
|
state.cancelOpen = reject;
|
|
});
|
|
this._state = state;
|
|
this.name = name;
|
|
this.on = Events(this, "populate", "blocked", "versionchange", "close", {
|
|
ready: [
|
|
promisableChain,
|
|
nop
|
|
]
|
|
});
|
|
this.once = function(event, callback) {
|
|
var fn = function() {
|
|
var args = [];
|
|
for(var _i = 0; _i < arguments.length; _i++){
|
|
args[_i] = arguments[_i];
|
|
}
|
|
_this.on(event).unsubscribe(fn);
|
|
callback.apply(_this, args);
|
|
};
|
|
return _this.on(event, fn);
|
|
};
|
|
this.on.ready.subscribe = override(this.on.ready.subscribe, function(subscribe) {
|
|
return function(subscriber, bSticky) {
|
|
Dexie.vip(function() {
|
|
var state = _this._state;
|
|
if (state.openComplete) {
|
|
if (!state.dbOpenError) DexiePromise.resolve().then(subscriber);
|
|
if (bSticky) subscribe(subscriber);
|
|
} else if (state.onReadyBeingFired) {
|
|
state.onReadyBeingFired.push(subscriber);
|
|
if (bSticky) subscribe(subscriber);
|
|
} else {
|
|
subscribe(subscriber);
|
|
var db_1 = _this;
|
|
if (!bSticky) subscribe(function unsubscribe() {
|
|
db_1.on.ready.unsubscribe(subscriber);
|
|
db_1.on.ready.unsubscribe(unsubscribe);
|
|
});
|
|
}
|
|
});
|
|
};
|
|
});
|
|
this.Collection = createCollectionConstructor(this);
|
|
this.Table = createTableConstructor(this);
|
|
this.Transaction = createTransactionConstructor(this);
|
|
this.Version = createVersionConstructor(this);
|
|
this.WhereClause = createWhereClauseConstructor(this);
|
|
this.on("versionchange", function(ev) {
|
|
if (ev.newVersion > 0) console.warn("Another connection wants to upgrade database '".concat(_this.name, "'. Closing db now to resume the upgrade."));
|
|
else console.warn("Another connection wants to delete database '".concat(_this.name, "'. Closing db now to resume the delete request."));
|
|
_this.close({
|
|
disableAutoOpen: false
|
|
});
|
|
});
|
|
this.on("blocked", function(ev) {
|
|
if (!ev.newVersion || ev.newVersion < ev.oldVersion) console.warn("Dexie.delete('".concat(_this.name, "') was blocked"));
|
|
else console.warn("Upgrade '".concat(_this.name, "' blocked by other connection holding version ").concat(ev.oldVersion / 10));
|
|
});
|
|
this._maxKey = getMaxKey(options.IDBKeyRange);
|
|
this._createTransaction = function(mode, storeNames, dbschema, parentTransaction) {
|
|
return new _this.Transaction(mode, storeNames, dbschema, _this._options.chromeTransactionDurability, parentTransaction);
|
|
};
|
|
this._fireOnBlocked = function(ev) {
|
|
_this.on("blocked").fire(ev);
|
|
connections.filter(function(c) {
|
|
return c.name === _this.name && c !== _this && !c._state.vcFired;
|
|
}).map(function(c) {
|
|
return c.on("versionchange").fire(ev);
|
|
});
|
|
};
|
|
this.use(cacheExistingValuesMiddleware);
|
|
this.use(cacheMiddleware);
|
|
this.use(observabilityMiddleware);
|
|
this.use(virtualIndexMiddleware);
|
|
this.use(hooksMiddleware);
|
|
var vipDB = new Proxy(this, {
|
|
get: function(_, prop, receiver) {
|
|
if (prop === '_vip') return true;
|
|
if (prop === 'table') return function(tableName) {
|
|
return vipify(_this.table(tableName), vipDB);
|
|
};
|
|
var rv = Reflect.get(_, prop, receiver);
|
|
if (rv instanceof Table) return vipify(rv, vipDB);
|
|
if (prop === 'tables') return rv.map(function(t) {
|
|
return vipify(t, vipDB);
|
|
});
|
|
if (prop === '_createTransaction') return function() {
|
|
var tx = rv.apply(this, arguments);
|
|
return vipify(tx, vipDB);
|
|
};
|
|
return rv;
|
|
}
|
|
});
|
|
this.vip = vipDB;
|
|
addons.forEach(function(addon) {
|
|
return addon(_this);
|
|
});
|
|
}
|
|
Dexie.prototype.version = function(versionNumber) {
|
|
if (isNaN(versionNumber) || versionNumber < 0.1) throw new exceptions.Type("Given version is not a positive number");
|
|
versionNumber = Math.round(versionNumber * 10) / 10;
|
|
if (this.idbdb || this._state.isBeingOpened) throw new exceptions.Schema("Cannot add version when database is open");
|
|
this.verno = Math.max(this.verno, versionNumber);
|
|
var versions = this._versions;
|
|
var versionInstance = versions.filter(function(v) {
|
|
return v._cfg.version === versionNumber;
|
|
})[0];
|
|
if (versionInstance) return versionInstance;
|
|
versionInstance = new this.Version(versionNumber);
|
|
versions.push(versionInstance);
|
|
versions.sort(lowerVersionFirst);
|
|
versionInstance.stores({});
|
|
this._state.autoSchema = false;
|
|
return versionInstance;
|
|
};
|
|
Dexie.prototype._whenReady = function(fn) {
|
|
var _this = this;
|
|
return this.idbdb && (this._state.openComplete || PSD.letThrough || this._vip) ? fn() : new DexiePromise(function(resolve, reject) {
|
|
if (_this._state.openComplete) {
|
|
return reject(new exceptions.DatabaseClosed(_this._state.dbOpenError));
|
|
}
|
|
if (!_this._state.isBeingOpened) {
|
|
if (!_this._state.autoOpen) {
|
|
reject(new exceptions.DatabaseClosed());
|
|
return;
|
|
}
|
|
_this.open().catch(nop);
|
|
}
|
|
_this._state.dbReadyPromise.then(resolve, reject);
|
|
}).then(fn);
|
|
};
|
|
Dexie.prototype.use = function(_a) {
|
|
var stack = _a.stack, create = _a.create, level = _a.level, name = _a.name;
|
|
if (name) this.unuse({
|
|
stack: stack,
|
|
name: name
|
|
});
|
|
var middlewares = this._middlewares[stack] || (this._middlewares[stack] = []);
|
|
middlewares.push({
|
|
stack: stack,
|
|
create: create,
|
|
level: level == null ? 10 : level,
|
|
name: name
|
|
});
|
|
middlewares.sort(function(a, b) {
|
|
return a.level - b.level;
|
|
});
|
|
return this;
|
|
};
|
|
Dexie.prototype.unuse = function(_a) {
|
|
var stack = _a.stack, name = _a.name, create = _a.create;
|
|
if (stack && this._middlewares[stack]) {
|
|
this._middlewares[stack] = this._middlewares[stack].filter(function(mw) {
|
|
return create ? mw.create !== create : name ? mw.name !== name : false;
|
|
});
|
|
}
|
|
return this;
|
|
};
|
|
Dexie.prototype.open = function() {
|
|
var _this = this;
|
|
return usePSD(globalPSD, function() {
|
|
return dexieOpen(_this);
|
|
});
|
|
};
|
|
Dexie.prototype._close = function() {
|
|
this.on.close.fire(new CustomEvent('close'));
|
|
var state = this._state;
|
|
var idx = connections.indexOf(this);
|
|
if (idx >= 0) connections.splice(idx, 1);
|
|
if (this.idbdb) {
|
|
try {
|
|
this.idbdb.close();
|
|
} catch (e) {}
|
|
this.idbdb = null;
|
|
}
|
|
if (!state.isBeingOpened) {
|
|
state.dbReadyPromise = new DexiePromise(function(resolve) {
|
|
state.dbReadyResolve = resolve;
|
|
});
|
|
state.openCanceller = new DexiePromise(function(_, reject) {
|
|
state.cancelOpen = reject;
|
|
});
|
|
}
|
|
};
|
|
Dexie.prototype.close = function(_a) {
|
|
var _b = _a === void 0 ? {
|
|
disableAutoOpen: true
|
|
} : _a, disableAutoOpen = _b.disableAutoOpen;
|
|
var state = this._state;
|
|
if (disableAutoOpen) {
|
|
if (state.isBeingOpened) {
|
|
state.cancelOpen(new exceptions.DatabaseClosed());
|
|
}
|
|
this._close();
|
|
state.autoOpen = false;
|
|
state.dbOpenError = new exceptions.DatabaseClosed();
|
|
} else {
|
|
this._close();
|
|
state.autoOpen = this._options.autoOpen || state.isBeingOpened;
|
|
state.openComplete = false;
|
|
state.dbOpenError = null;
|
|
}
|
|
};
|
|
Dexie.prototype.delete = function(closeOptions) {
|
|
var _this = this;
|
|
if (closeOptions === void 0) {
|
|
closeOptions = {
|
|
disableAutoOpen: true
|
|
};
|
|
}
|
|
var hasInvalidArguments = arguments.length > 0 && typeof arguments[0] !== 'object';
|
|
var state = this._state;
|
|
return new DexiePromise(function(resolve, reject) {
|
|
var doDelete = function() {
|
|
_this.close(closeOptions);
|
|
var req = _this._deps.indexedDB.deleteDatabase(_this.name);
|
|
req.onsuccess = wrap(function() {
|
|
_onDatabaseDeleted(_this._deps, _this.name);
|
|
resolve();
|
|
});
|
|
req.onerror = eventRejectHandler(reject);
|
|
req.onblocked = _this._fireOnBlocked;
|
|
};
|
|
if (hasInvalidArguments) throw new exceptions.InvalidArgument("Invalid closeOptions argument to db.delete()");
|
|
if (state.isBeingOpened) {
|
|
state.dbReadyPromise.then(doDelete);
|
|
} else {
|
|
doDelete();
|
|
}
|
|
});
|
|
};
|
|
Dexie.prototype.backendDB = function() {
|
|
return this.idbdb;
|
|
};
|
|
Dexie.prototype.isOpen = function() {
|
|
return this.idbdb !== null;
|
|
};
|
|
Dexie.prototype.hasBeenClosed = function() {
|
|
var dbOpenError = this._state.dbOpenError;
|
|
return dbOpenError && dbOpenError.name === 'DatabaseClosed';
|
|
};
|
|
Dexie.prototype.hasFailed = function() {
|
|
return this._state.dbOpenError !== null;
|
|
};
|
|
Dexie.prototype.dynamicallyOpened = function() {
|
|
return this._state.autoSchema;
|
|
};
|
|
Object.defineProperty(Dexie.prototype, "tables", {
|
|
get: function() {
|
|
var _this = this;
|
|
return keys(this._allTables).map(function(name) {
|
|
return _this._allTables[name];
|
|
});
|
|
},
|
|
enumerable: false,
|
|
configurable: true
|
|
});
|
|
Dexie.prototype.transaction = function() {
|
|
var args = extractTransactionArgs.apply(this, arguments);
|
|
return this._transaction.apply(this, args);
|
|
};
|
|
Dexie.prototype._transaction = function(mode, tables, scopeFunc) {
|
|
var _this = this;
|
|
var parentTransaction = PSD.trans;
|
|
if (!parentTransaction || parentTransaction.db !== this || mode.indexOf('!') !== -1) parentTransaction = null;
|
|
var onlyIfCompatible = mode.indexOf('?') !== -1;
|
|
mode = mode.replace('!', '').replace('?', '');
|
|
var idbMode, storeNames;
|
|
try {
|
|
storeNames = tables.map(function(table) {
|
|
var storeName = table instanceof _this.Table ? table.name : table;
|
|
if (typeof storeName !== 'string') throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");
|
|
return storeName;
|
|
});
|
|
if (mode == "r" || mode === READONLY) idbMode = READONLY;
|
|
else if (mode == "rw" || mode == READWRITE) idbMode = READWRITE;
|
|
else throw new exceptions.InvalidArgument("Invalid transaction mode: " + mode);
|
|
if (parentTransaction) {
|
|
if (parentTransaction.mode === READONLY && idbMode === READWRITE) {
|
|
if (onlyIfCompatible) {
|
|
parentTransaction = null;
|
|
} else throw new exceptions.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");
|
|
}
|
|
if (parentTransaction) {
|
|
storeNames.forEach(function(storeName) {
|
|
if (parentTransaction && parentTransaction.storeNames.indexOf(storeName) === -1) {
|
|
if (onlyIfCompatible) {
|
|
parentTransaction = null;
|
|
} else throw new exceptions.SubTransaction("Table " + storeName + " not included in parent transaction.");
|
|
}
|
|
});
|
|
}
|
|
if (onlyIfCompatible && parentTransaction && !parentTransaction.active) {
|
|
parentTransaction = null;
|
|
}
|
|
}
|
|
} catch (e) {
|
|
return parentTransaction ? parentTransaction._promise(null, function(_, reject) {
|
|
reject(e);
|
|
}) : rejection(e);
|
|
}
|
|
var enterTransaction = enterTransactionScope.bind(null, this, idbMode, storeNames, parentTransaction, scopeFunc);
|
|
return parentTransaction ? parentTransaction._promise(idbMode, enterTransaction, "lock") : PSD.trans ? usePSD(PSD.transless, function() {
|
|
return _this._whenReady(enterTransaction);
|
|
}) : this._whenReady(enterTransaction);
|
|
};
|
|
Dexie.prototype.table = function(tableName) {
|
|
if (!hasOwn(this._allTables, tableName)) {
|
|
throw new exceptions.InvalidTable("Table ".concat(tableName, " does not exist"));
|
|
}
|
|
return this._allTables[tableName];
|
|
};
|
|
return Dexie;
|
|
}();
|
|
var symbolObservable = typeof Symbol !== "undefined" && "observable" in Symbol ? Symbol.observable : "@@observable";
|
|
var Observable = function() {
|
|
function Observable(subscribe) {
|
|
this._subscribe = subscribe;
|
|
}
|
|
Observable.prototype.subscribe = function(x, error, complete) {
|
|
return this._subscribe(!x || typeof x === "function" ? {
|
|
next: x,
|
|
error: error,
|
|
complete: complete
|
|
} : x);
|
|
};
|
|
Observable.prototype[symbolObservable] = function() {
|
|
return this;
|
|
};
|
|
return Observable;
|
|
}();
|
|
var domDeps;
|
|
try {
|
|
domDeps = {
|
|
indexedDB: _global.indexedDB || _global.mozIndexedDB || _global.webkitIndexedDB || _global.msIndexedDB,
|
|
IDBKeyRange: _global.IDBKeyRange || _global.webkitIDBKeyRange
|
|
};
|
|
} catch (e) {
|
|
domDeps = {
|
|
indexedDB: null,
|
|
IDBKeyRange: null
|
|
};
|
|
}
|
|
function liveQuery(querier) {
|
|
var hasValue = false;
|
|
var currentValue;
|
|
var observable = new Observable(function(observer) {
|
|
var scopeFuncIsAsync = isAsyncFunction(querier);
|
|
function execute(ctx) {
|
|
var wasRootExec = beginMicroTickScope();
|
|
try {
|
|
if (scopeFuncIsAsync) {
|
|
incrementExpectedAwaits();
|
|
}
|
|
var rv = newScope(querier, ctx);
|
|
if (scopeFuncIsAsync) {
|
|
rv = rv.finally(decrementExpectedAwaits);
|
|
}
|
|
return rv;
|
|
} finally{
|
|
wasRootExec && endMicroTickScope();
|
|
}
|
|
}
|
|
var closed = false;
|
|
var abortController;
|
|
var accumMuts = {};
|
|
var currentObs = {};
|
|
var subscription = {
|
|
get closed () {
|
|
return closed;
|
|
},
|
|
unsubscribe: function() {
|
|
if (closed) return;
|
|
closed = true;
|
|
if (abortController) abortController.abort();
|
|
if (startedListening) globalEvents.storagemutated.unsubscribe(mutationListener);
|
|
}
|
|
};
|
|
observer.start && observer.start(subscription);
|
|
var startedListening = false;
|
|
var doQuery = function() {
|
|
return execInGlobalContext(_doQuery);
|
|
};
|
|
function shouldNotify() {
|
|
return obsSetsOverlap(currentObs, accumMuts);
|
|
}
|
|
var mutationListener = function(parts) {
|
|
extendObservabilitySet(accumMuts, parts);
|
|
if (shouldNotify()) {
|
|
doQuery();
|
|
}
|
|
};
|
|
var _doQuery = function() {
|
|
if (closed || !domDeps.indexedDB) {
|
|
return;
|
|
}
|
|
accumMuts = {};
|
|
var subscr = {};
|
|
if (abortController) abortController.abort();
|
|
abortController = new AbortController();
|
|
var ctx = {
|
|
subscr: subscr,
|
|
signal: abortController.signal,
|
|
requery: doQuery,
|
|
querier: querier,
|
|
trans: null
|
|
};
|
|
var ret = execute(ctx);
|
|
Promise.resolve(ret).then(function(result) {
|
|
hasValue = true;
|
|
currentValue = result;
|
|
if (closed || ctx.signal.aborted) {
|
|
return;
|
|
}
|
|
accumMuts = {};
|
|
currentObs = subscr;
|
|
if (!objectIsEmpty(currentObs) && !startedListening) {
|
|
globalEvents(DEXIE_STORAGE_MUTATED_EVENT_NAME, mutationListener);
|
|
startedListening = true;
|
|
}
|
|
execInGlobalContext(function() {
|
|
return !closed && observer.next && observer.next(result);
|
|
});
|
|
}, function(err) {
|
|
hasValue = false;
|
|
if (![
|
|
'DatabaseClosedError',
|
|
'AbortError'
|
|
].includes(err === null || err === void 0 ? void 0 : err.name)) {
|
|
if (!closed) execInGlobalContext(function() {
|
|
if (closed) return;
|
|
observer.error && observer.error(err);
|
|
});
|
|
}
|
|
});
|
|
};
|
|
setTimeout(doQuery, 0);
|
|
return subscription;
|
|
});
|
|
observable.hasValue = function() {
|
|
return hasValue;
|
|
};
|
|
observable.getValue = function() {
|
|
return currentValue;
|
|
};
|
|
return observable;
|
|
}
|
|
var Dexie = Dexie$1;
|
|
props(Dexie, __assign(__assign({}, fullNameExceptions), {
|
|
delete: function(databaseName) {
|
|
var db = new Dexie(databaseName, {
|
|
addons: []
|
|
});
|
|
return db.delete();
|
|
},
|
|
exists: function(name) {
|
|
return new Dexie(name, {
|
|
addons: []
|
|
}).open().then(function(db) {
|
|
db.close();
|
|
return true;
|
|
}).catch('NoSuchDatabaseError', function() {
|
|
return false;
|
|
});
|
|
},
|
|
getDatabaseNames: function(cb) {
|
|
try {
|
|
return getDatabaseNames(Dexie.dependencies).then(cb);
|
|
} catch (_a) {
|
|
return rejection(new exceptions.MissingAPI());
|
|
}
|
|
},
|
|
defineClass: function() {
|
|
function Class(content) {
|
|
extend(this, content);
|
|
}
|
|
return Class;
|
|
},
|
|
ignoreTransaction: function(scopeFunc) {
|
|
return PSD.trans ? usePSD(PSD.transless, scopeFunc) : scopeFunc();
|
|
},
|
|
vip: vip,
|
|
async: function(generatorFn) {
|
|
return function() {
|
|
try {
|
|
var rv = awaitIterator(generatorFn.apply(this, arguments));
|
|
if (!rv || typeof rv.then !== 'function') return DexiePromise.resolve(rv);
|
|
return rv;
|
|
} catch (e) {
|
|
return rejection(e);
|
|
}
|
|
};
|
|
},
|
|
spawn: function(generatorFn, args, thiz) {
|
|
try {
|
|
var rv = awaitIterator(generatorFn.apply(thiz, args || []));
|
|
if (!rv || typeof rv.then !== 'function') return DexiePromise.resolve(rv);
|
|
return rv;
|
|
} catch (e) {
|
|
return rejection(e);
|
|
}
|
|
},
|
|
currentTransaction: {
|
|
get: function() {
|
|
return PSD.trans || null;
|
|
}
|
|
},
|
|
waitFor: function(promiseOrFunction, optionalTimeout) {
|
|
var promise = DexiePromise.resolve(typeof promiseOrFunction === 'function' ? Dexie.ignoreTransaction(promiseOrFunction) : promiseOrFunction).timeout(optionalTimeout || 60000);
|
|
return PSD.trans ? PSD.trans.waitFor(promise) : promise;
|
|
},
|
|
Promise: DexiePromise,
|
|
debug: {
|
|
get: function() {
|
|
return debug;
|
|
},
|
|
set: function(value) {
|
|
setDebug(value);
|
|
}
|
|
},
|
|
derive: derive,
|
|
extend: extend,
|
|
props: props,
|
|
override: override,
|
|
Events: Events,
|
|
on: globalEvents,
|
|
liveQuery: liveQuery,
|
|
extendObservabilitySet: extendObservabilitySet,
|
|
getByKeyPath: getByKeyPath,
|
|
setByKeyPath: setByKeyPath,
|
|
delByKeyPath: delByKeyPath,
|
|
shallowClone: shallowClone,
|
|
deepClone: deepClone,
|
|
getObjectDiff: getObjectDiff,
|
|
cmp: cmp,
|
|
asap: asap$1,
|
|
minKey: minKey,
|
|
addons: [],
|
|
connections: connections,
|
|
errnames: errnames,
|
|
dependencies: domDeps,
|
|
cache: cache,
|
|
semVer: DEXIE_VERSION,
|
|
version: DEXIE_VERSION.split('.').map(function(n) {
|
|
return parseInt(n);
|
|
}).reduce(function(p, c, i) {
|
|
return p + c / Math.pow(10, i * 2);
|
|
})
|
|
}));
|
|
Dexie.maxKey = getMaxKey(Dexie.dependencies.IDBKeyRange);
|
|
if (typeof dispatchEvent !== 'undefined' && typeof addEventListener !== 'undefined') {
|
|
globalEvents(DEXIE_STORAGE_MUTATED_EVENT_NAME, function(updatedParts) {
|
|
if (!propagatingLocally) {
|
|
var event_1;
|
|
event_1 = new CustomEvent(STORAGE_MUTATED_DOM_EVENT_NAME, {
|
|
detail: updatedParts
|
|
});
|
|
propagatingLocally = true;
|
|
dispatchEvent(event_1);
|
|
propagatingLocally = false;
|
|
}
|
|
});
|
|
addEventListener(STORAGE_MUTATED_DOM_EVENT_NAME, function(_a) {
|
|
var detail = _a.detail;
|
|
if (!propagatingLocally) {
|
|
propagateLocally(detail);
|
|
}
|
|
});
|
|
}
|
|
function propagateLocally(updateParts) {
|
|
var wasMe = propagatingLocally;
|
|
try {
|
|
propagatingLocally = true;
|
|
globalEvents.storagemutated.fire(updateParts);
|
|
signalSubscribersNow(updateParts, true);
|
|
} finally{
|
|
propagatingLocally = wasMe;
|
|
}
|
|
}
|
|
var propagatingLocally = false;
|
|
var bc;
|
|
var createBC = function() {};
|
|
if (typeof BroadcastChannel !== 'undefined') {
|
|
createBC = function() {
|
|
bc = new BroadcastChannel(STORAGE_MUTATED_DOM_EVENT_NAME);
|
|
bc.onmessage = function(ev) {
|
|
return ev.data && propagateLocally(ev.data);
|
|
};
|
|
};
|
|
createBC();
|
|
if (typeof bc.unref === 'function') {
|
|
bc.unref();
|
|
}
|
|
globalEvents(DEXIE_STORAGE_MUTATED_EVENT_NAME, function(changedParts) {
|
|
if (!propagatingLocally) {
|
|
bc.postMessage(changedParts);
|
|
}
|
|
});
|
|
}
|
|
if (typeof addEventListener !== 'undefined') {
|
|
addEventListener('pagehide', function(event) {
|
|
if (!Dexie$1.disableBfCache && event.persisted) {
|
|
if (debug) console.debug('Dexie: handling persisted pagehide');
|
|
bc === null || bc === void 0 ? void 0 : bc.close();
|
|
for(var _i = 0, connections_1 = connections; _i < connections_1.length; _i++){
|
|
var db = connections_1[_i];
|
|
db.close({
|
|
disableAutoOpen: false
|
|
});
|
|
}
|
|
}
|
|
});
|
|
addEventListener('pageshow', function(event) {
|
|
if (!Dexie$1.disableBfCache && event.persisted) {
|
|
if (debug) console.debug('Dexie: handling persisted pageshow');
|
|
createBC();
|
|
propagateLocally({
|
|
all: new RangeSet(-Infinity, [
|
|
[]
|
|
])
|
|
});
|
|
}
|
|
});
|
|
}
|
|
function add(value) {
|
|
return new PropModification({
|
|
add: value
|
|
});
|
|
}
|
|
function remove(value) {
|
|
return new PropModification({
|
|
remove: value
|
|
});
|
|
}
|
|
function replacePrefix(a, b) {
|
|
return new PropModification({
|
|
replacePrefix: [
|
|
a,
|
|
b
|
|
]
|
|
});
|
|
}
|
|
DexiePromise.rejectionMapper = mapError;
|
|
setDebug(debug);
|
|
var namedExports = /*#__PURE__*/ Object.freeze({
|
|
__proto__: null,
|
|
Dexie: Dexie$1,
|
|
liveQuery: liveQuery,
|
|
Entity: Entity,
|
|
cmp: cmp,
|
|
PropModification: PropModification,
|
|
replacePrefix: replacePrefix,
|
|
add: add,
|
|
remove: remove,
|
|
'default': Dexie$1,
|
|
RangeSet: RangeSet,
|
|
mergeRanges: mergeRanges,
|
|
rangesOverlap: rangesOverlap
|
|
});
|
|
__assign(Dexie$1, namedExports, {
|
|
default: Dexie$1
|
|
});
|
|
return Dexie$1;
|
|
}); //# sourceMappingURL=dexie.js.map
|
|
}),
|
|
"[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/dexie@4.2.1/node_modules/dexie/import-wrapper.mjs [app-ssr] (ecmascript)", ((__turbopack_context__) => {
|
|
"use strict";
|
|
|
|
// Making the module version consumable via require - to prohibit
|
|
// multiple occurrancies of the same module in the same app
|
|
// (dual package hazard, https://nodejs.org/api/packages.html#dual-package-hazard)
|
|
__turbopack_context__.s([
|
|
"Dexie",
|
|
()=>Dexie,
|
|
"DexieYProvider",
|
|
()=>DexieYProvider,
|
|
"Entity",
|
|
()=>Entity,
|
|
"PropModification",
|
|
()=>PropModification,
|
|
"RangeSet",
|
|
()=>RangeSet,
|
|
"add",
|
|
()=>add,
|
|
"cmp",
|
|
()=>cmp,
|
|
"default",
|
|
()=>__TURBOPACK__default__export__,
|
|
"liveQuery",
|
|
()=>liveQuery,
|
|
"mergeRanges",
|
|
()=>mergeRanges,
|
|
"rangesOverlap",
|
|
()=>rangesOverlap,
|
|
"remove",
|
|
()=>remove,
|
|
"replacePrefix",
|
|
()=>replacePrefix
|
|
]);
|
|
var __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$dexie$40$4$2e$2$2e$1$2f$node_modules$2f$dexie$2f$dist$2f$dexie$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/Documents/go-new/chinese-family-tree/node_modules/.pnpm/dexie@4.2.1/node_modules/dexie/dist/dexie.js [app-ssr] (ecmascript)");
|
|
;
|
|
const DexieSymbol = Symbol.for("Dexie");
|
|
const Dexie = globalThis[DexieSymbol] || (globalThis[DexieSymbol] = __TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$dexie$40$4$2e$2$2e$1$2f$node_modules$2f$dexie$2f$dist$2f$dexie$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["default"]);
|
|
if (__TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$dexie$40$4$2e$2$2e$1$2f$node_modules$2f$dexie$2f$dist$2f$dexie$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["default"].semVer !== Dexie.semVer) {
|
|
throw new Error(`Two different versions of Dexie loaded in the same app: ${__TURBOPACK__imported__module__$5b$project$5d2f$Documents$2f$go$2d$new$2f$chinese$2d$family$2d$tree$2f$node_modules$2f2e$pnpm$2f$dexie$40$4$2e$2$2e$1$2f$node_modules$2f$dexie$2f$dist$2f$dexie$2e$js__$5b$app$2d$ssr$5d$__$28$ecmascript$29$__["default"].semVer} and ${Dexie.semVer}`);
|
|
}
|
|
const { liveQuery, mergeRanges, rangesOverlap, RangeSet, cmp, Entity, PropModification, replacePrefix, add, remove, DexieYProvider } = Dexie;
|
|
;
|
|
const __TURBOPACK__default__export__ = Dexie;
|
|
}),
|
|
"[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/circle-user.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",
|
|
()=>CircleUser
|
|
]);
|
|
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 CircleUser = (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"])("CircleUser", [
|
|
[
|
|
"circle",
|
|
{
|
|
cx: "12",
|
|
cy: "12",
|
|
r: "10",
|
|
key: "1mglay"
|
|
}
|
|
],
|
|
[
|
|
"circle",
|
|
{
|
|
cx: "12",
|
|
cy: "10",
|
|
r: "3",
|
|
key: "ilqhr7"
|
|
}
|
|
],
|
|
[
|
|
"path",
|
|
{
|
|
d: "M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",
|
|
key: "154egf"
|
|
}
|
|
]
|
|
]);
|
|
;
|
|
//# sourceMappingURL=circle-user.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/circle-user.js [app-ssr] (ecmascript) <export default as CircleUser>", ((__turbopack_context__) => {
|
|
"use strict";
|
|
|
|
__turbopack_context__.s([
|
|
"CircleUser",
|
|
()=>__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$circle$2d$user$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$circle$2d$user$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/circle-user.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/circle-user-round.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",
|
|
()=>CircleUserRound
|
|
]);
|
|
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 CircleUserRound = (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"])("CircleUserRound", [
|
|
[
|
|
"path",
|
|
{
|
|
d: "M18 20a6 6 0 0 0-12 0",
|
|
key: "1qehca"
|
|
}
|
|
],
|
|
[
|
|
"circle",
|
|
{
|
|
cx: "12",
|
|
cy: "10",
|
|
r: "4",
|
|
key: "1h16sb"
|
|
}
|
|
],
|
|
[
|
|
"circle",
|
|
{
|
|
cx: "12",
|
|
cy: "12",
|
|
r: "10",
|
|
key: "1mglay"
|
|
}
|
|
]
|
|
]);
|
|
;
|
|
//# sourceMappingURL=circle-user-round.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/circle-user-round.js [app-ssr] (ecmascript) <export default as CircleUserRound>", ((__turbopack_context__) => {
|
|
"use strict";
|
|
|
|
__turbopack_context__.s([
|
|
"CircleUserRound",
|
|
()=>__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$circle$2d$user$2d$round$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$circle$2d$user$2d$round$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/circle-user-round.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/heart.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",
|
|
()=>Heart
|
|
]);
|
|
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 Heart = (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"])("Heart", [
|
|
[
|
|
"path",
|
|
{
|
|
d: "M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",
|
|
key: "c3ymky"
|
|
}
|
|
]
|
|
]);
|
|
;
|
|
//# sourceMappingURL=heart.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/heart.js [app-ssr] (ecmascript) <export default as Heart>", ((__turbopack_context__) => {
|
|
"use strict";
|
|
|
|
__turbopack_context__.s([
|
|
"Heart",
|
|
()=>__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$heart$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$heart$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/heart.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/zoom-in.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",
|
|
()=>ZoomIn
|
|
]);
|
|
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 ZoomIn = (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"])("ZoomIn", [
|
|
[
|
|
"circle",
|
|
{
|
|
cx: "11",
|
|
cy: "11",
|
|
r: "8",
|
|
key: "4ej97u"
|
|
}
|
|
],
|
|
[
|
|
"line",
|
|
{
|
|
x1: "21",
|
|
x2: "16.65",
|
|
y1: "21",
|
|
y2: "16.65",
|
|
key: "13gj7c"
|
|
}
|
|
],
|
|
[
|
|
"line",
|
|
{
|
|
x1: "11",
|
|
x2: "11",
|
|
y1: "8",
|
|
y2: "14",
|
|
key: "1vmskp"
|
|
}
|
|
],
|
|
[
|
|
"line",
|
|
{
|
|
x1: "8",
|
|
x2: "14",
|
|
y1: "11",
|
|
y2: "11",
|
|
key: "durymu"
|
|
}
|
|
]
|
|
]);
|
|
;
|
|
//# sourceMappingURL=zoom-in.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/zoom-in.js [app-ssr] (ecmascript) <export default as ZoomIn>", ((__turbopack_context__) => {
|
|
"use strict";
|
|
|
|
__turbopack_context__.s([
|
|
"ZoomIn",
|
|
()=>__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$zoom$2d$in$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$zoom$2d$in$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/zoom-in.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/zoom-out.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",
|
|
()=>ZoomOut
|
|
]);
|
|
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 ZoomOut = (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"])("ZoomOut", [
|
|
[
|
|
"circle",
|
|
{
|
|
cx: "11",
|
|
cy: "11",
|
|
r: "8",
|
|
key: "4ej97u"
|
|
}
|
|
],
|
|
[
|
|
"line",
|
|
{
|
|
x1: "21",
|
|
x2: "16.65",
|
|
y1: "21",
|
|
y2: "16.65",
|
|
key: "13gj7c"
|
|
}
|
|
],
|
|
[
|
|
"line",
|
|
{
|
|
x1: "8",
|
|
x2: "14",
|
|
y1: "11",
|
|
y2: "11",
|
|
key: "durymu"
|
|
}
|
|
]
|
|
]);
|
|
;
|
|
//# sourceMappingURL=zoom-out.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/zoom-out.js [app-ssr] (ecmascript) <export default as ZoomOut>", ((__turbopack_context__) => {
|
|
"use strict";
|
|
|
|
__turbopack_context__.s([
|
|
"ZoomOut",
|
|
()=>__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$zoom$2d$out$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$zoom$2d$out$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/zoom-out.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/move.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",
|
|
()=>Move
|
|
]);
|
|
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 Move = (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"])("Move", [
|
|
[
|
|
"path",
|
|
{
|
|
d: "M12 2v20",
|
|
key: "t6zp3m"
|
|
}
|
|
],
|
|
[
|
|
"path",
|
|
{
|
|
d: "m15 19-3 3-3-3",
|
|
key: "11eu04"
|
|
}
|
|
],
|
|
[
|
|
"path",
|
|
{
|
|
d: "m19 9 3 3-3 3",
|
|
key: "1mg7y2"
|
|
}
|
|
],
|
|
[
|
|
"path",
|
|
{
|
|
d: "M2 12h20",
|
|
key: "9i4pu4"
|
|
}
|
|
],
|
|
[
|
|
"path",
|
|
{
|
|
d: "m5 9-3 3 3 3",
|
|
key: "j64kie"
|
|
}
|
|
],
|
|
[
|
|
"path",
|
|
{
|
|
d: "m9 5 3-3 3 3",
|
|
key: "l8vdw6"
|
|
}
|
|
]
|
|
]);
|
|
;
|
|
//# sourceMappingURL=move.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/move.js [app-ssr] (ecmascript) <export default as Move>", ((__turbopack_context__) => {
|
|
"use strict";
|
|
|
|
__turbopack_context__.s([
|
|
"Move",
|
|
()=>__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$move$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$move$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/move.js [app-ssr] (ecmascript)");
|
|
}),
|
|
];
|
|
|
|
//# sourceMappingURL=a0629__pnpm_3439a82d._.js.map |