Your Name 1912bcd25b
Some checks failed
Lint / build (20) (push) Has been cancelled
Playwright Tests / test (push) Has been cancelled
chore: sync all remaining local workspace changes
2026-05-08 11:26:57 +08:00

668 lines
24 KiB
JavaScript

/*
* Extracted from browser-delivered Turbopack chunk: ffa5de913d3f001d.98ff1c0dc5.js
* Module id: 116713
* For reading/searching only; this factory depends on the original Turbopack runtime.
*/
const moduleFactory = (e, t, r) => {
"use strict";
Object.defineProperty(r, "__esModule", { value: !0 });
var n = {
cancelPrefetchTask: function () {
return m;
},
isPrefetchTaskDirty: function () {
return E;
},
pingPrefetchTask: function () {
return M;
},
reschedulePrefetchTask: function () {
return P;
},
schedulePrefetchTask: function () {
return R;
},
startRevalidationCooldown: function () {
return b;
},
};
for (var a in n) Object.defineProperty(r, a, { enumerable: !0, get: n[a] });
let l = e.r(369209),
u = e.r(414531),
o = e.r(567281),
i = e.r(409369),
s = e.r(133087),
c = e.r(393354),
f = e.r(745347),
d =
"function" == typeof queueMicrotask
? queueMicrotask
: (e) =>
Promise.resolve()
.then(e)
.catch((e) =>
setTimeout(() => {
throw e;
}),
),
h = [],
p = 0,
y = 0,
g = !1,
v = null,
_ = null;
function b() {
null !== _ && clearTimeout(_),
(_ = setTimeout(() => {
(_ = null), O();
}, 300));
}
function R(e, t, r, n, a) {
let l = {
key: e,
treeAtTimeOfPrefetch: t,
cacheVersion: (0, o.getCurrentCacheVersion)(),
priority: n,
phase: 1,
hasBackgroundWork: !1,
spawnedRuntimePrefetches: null,
fetchStrategy: r,
sortId: y++,
isCanceled: !1,
onInvalidate: a,
_heapIndex: -1,
};
return S(l), B(h, l), O(), l;
}
function m(e) {
(e.isCanceled = !0),
(function (e, t) {
let r = t._heapIndex;
if (-1 !== r && ((t._heapIndex = -1), 0 !== e.length)) {
let n = e.pop();
n !== t && ((e[r] = n), (n._heapIndex = r), G(e, n, r));
}
})(h, e);
}
function P(e, t, r, n) {
(e.isCanceled = !1),
(e.phase = 1),
(e.sortId = y++),
(e.priority = e === v ? c.PrefetchPriority.Intent : n),
(e.treeAtTimeOfPrefetch = t),
(e.fetchStrategy = r),
S(e),
-1 !== e._heapIndex ? V(h, e) : B(h, e),
O();
}
function E(e, t, r) {
let n = (0, o.getCurrentCacheVersion)();
return (
e.cacheVersion !== n ||
e.treeAtTimeOfPrefetch !== r ||
e.key.nextUrl !== t
);
}
function S(e) {
e.priority === c.PrefetchPriority.Intent &&
e !== v &&
(null !== v &&
v.priority !== c.PrefetchPriority.Background &&
((v.priority = c.PrefetchPriority.Default), V(h, v)),
(v = e));
}
function O() {
g || ((g = !0), d(A));
}
function T(e) {
return (
null === _ &&
(e.priority === c.PrefetchPriority.Intent ? p < 12 : p < 4)
);
}
function w(e) {
return (
p++,
e.then((e) => (null === e ? (j(), null) : (e.closed.then(j), e.value)))
);
}
function j() {
p--, O();
}
function M(e) {
e.isCanceled || -1 !== e._heapIndex || (B(h, e), O());
}
function A() {
g = !1;
let e = Date.now(),
t = $(h);
for (; null !== t && T(t); ) {
t.cacheVersion = (0, o.getCurrentCacheVersion)();
let r = (function (e, t) {
let r = t.key,
n = (0, o.readOrCreateRouteCacheEntry)(e, t, r),
a = (function (e, t, r) {
switch (r.status) {
case o.EntryStatus.Empty:
w((0, o.fetchRouteOnCacheMiss)(r, t, t.key)),
(r.staleAt = e + 6e4),
(r.status = o.EntryStatus.Pending);
case o.EntryStatus.Pending: {
let e = r.blockedTasks;
return (
null === e ? (r.blockedTasks = new Set([t])) : e.add(t), 1
);
}
case o.EntryStatus.Rejected:
break;
case o.EntryStatus.Fulfilled: {
if (0 !== t.phase) return 2;
if (!T(t)) return 0;
let i = r.tree,
s =
t.fetchStrategy === c.FetchStrategy.PPR
? r.isPPREnabled
? c.FetchStrategy.PPR
: c.FetchStrategy.LoadingBoundary
: t.fetchStrategy;
switch (s) {
case c.FetchStrategy.PPR: {
var n, a, u;
if (
(U(
(n = e),
(a = t),
(u = r),
(0, o.readOrCreateSegmentCacheEntry)(
n,
c.FetchStrategy.PPR,
u,
u.metadata,
),
a.key,
u.metadata,
),
0 ===
(function e(t, r, n, a, l) {
let u = (0, o.readOrCreateSegmentCacheEntry)(
t,
r.fetchStrategy,
n,
l,
);
U(t, r, n, u, r.key, l);
let i = a[1],
s = l.slots;
if (null !== s)
for (let a in s) {
if (!T(r)) return 0;
let l = s[a],
u = l.segment,
c = i[a],
f = c?.[0];
if (
0 ===
(void 0 !== f && x(n, u, f)
? e(t, r, n, c, l)
: (function e(t, r, n, a) {
if (a.hasRuntimePrefetch)
return (
null ===
r.spawnedRuntimePrefetches
? (r.spawnedRuntimePrefetches =
new Set([a.requestKey]))
: r.spawnedRuntimePrefetches.add(
a.requestKey,
),
2
);
let l = (0,
o.readOrCreateSegmentCacheEntry)(
t,
r.fetchStrategy,
n,
a,
);
if (
(U(t, r, n, l, r.key, a),
null !== a.slots)
) {
if (!T(r)) return 0;
for (let l in a.slots)
if (0 === e(t, r, n, a.slots[l]))
return 0;
}
return 2;
})(t, r, n, l))
)
return 0;
}
return 2;
})(e, t, r, t.treeAtTimeOfPrefetch, i))
)
return 0;
let l = t.spawnedRuntimePrefetches;
if (null !== l) {
let n = new Map();
N(e, t, r, n, c.FetchStrategy.PPRRuntime);
let a = (function e(t, r, n, a, l, u) {
if (l.has(a.requestKey))
return F(
t,
r,
n,
a,
!1,
u,
c.FetchStrategy.PPRRuntime,
);
let o = {},
i = a.slots;
if (null !== i)
for (let a in i) {
let s = i[a];
o[a] = e(t, r, n, s, l, u);
}
return [a.segment, o, null, null];
})(e, t, r, i, l, n);
n.size > 0 &&
w(
(0, o.fetchSegmentPrefetchesUsingDynamicRequest)(
t,
r,
c.FetchStrategy.PPRRuntime,
a,
n,
),
);
}
return 2;
}
case c.FetchStrategy.Full:
case c.FetchStrategy.PPRRuntime:
case c.FetchStrategy.LoadingBoundary: {
let n = new Map();
N(e, t, r, n, s);
let a = (function e(t, r, n, a, u, i, s) {
let f = a[1],
d = u.slots,
h = {};
if (null !== d)
for (let a in d) {
let u = d[a],
p = u.segment,
y = f[a],
g = y?.[0];
if (void 0 !== g && x(n, p, g)) {
let l = e(t, r, n, y, u, i, s);
h[a] = l;
} else
switch (s) {
case c.FetchStrategy.LoadingBoundary: {
let e =
u.hasLoadingBoundary !==
l.HasLoadingBoundary
.SubtreeHasNoLoadingBoundary
? (function e(t, r, n, a, u, i) {
let s =
null === u
? "inside-shared-layout"
: null,
f = (0,
o.readOrCreateSegmentCacheEntry)(
t,
r.fetchStrategy,
n,
a,
);
switch (f.status) {
case o.EntryStatus.Empty:
i.set(
a.requestKey,
(0,
o.upgradeToPendingSegment)(
f,
c.FetchStrategy
.LoadingBoundary,
),
),
"refetch" !== u &&
(s = u = "refetch");
break;
case o.EntryStatus.Fulfilled:
if (
a.hasLoadingBoundary ===
l.HasLoadingBoundary
.SegmentHasLoadingBoundary
)
return (0,
o.convertRouteTreeToFlightRouterState)(
a,
);
case o.EntryStatus.Pending:
case o.EntryStatus.Rejected:
}
let d = {};
if (null !== a.slots)
for (let l in a.slots) {
let o = a.slots[l];
d[l] = e(t, r, n, o, u, i);
}
return [
a.segment,
d,
null,
s,
a.isRootLayout,
];
})(t, r, n, u, null, i)
: (0,
o.convertRouteTreeToFlightRouterState)(
u,
);
h[a] = e;
break;
}
case c.FetchStrategy.PPRRuntime: {
let e = F(t, r, n, u, !1, i, s);
h[a] = e;
break;
}
case c.FetchStrategy.Full: {
let e = F(t, r, n, u, !1, i, s);
h[a] = e;
}
}
}
return [u.segment, h, null, null, u.isRootLayout];
})(e, t, r, t.treeAtTimeOfPrefetch, i, n, s);
return (
n.size > 0 &&
w(
(0, o.fetchSegmentPrefetchesUsingDynamicRequest)(
t,
r,
s,
a,
n,
),
),
2
);
}
}
}
}
return 2;
})(e, t, n);
if (0 !== a && "" !== r.search) {
let n = new URL(r.pathname, location.origin),
a = (0, s.createCacheKey)(n.href, r.nextUrl),
l = (0, o.readOrCreateRouteCacheEntry)(e, t, a);
switch (l.status) {
case o.EntryStatus.Empty:
C(t) &&
((l.status = o.EntryStatus.Pending),
w((0, o.fetchRouteOnCacheMiss)(l, t, a)));
case o.EntryStatus.Pending:
case o.EntryStatus.Fulfilled:
case o.EntryStatus.Rejected:
}
}
return a;
})(e, t),
n = t.hasBackgroundWork;
switch (
((t.hasBackgroundWork = !1), (t.spawnedRuntimePrefetches = null), r)
) {
case 0:
return;
case 1:
K(h), (t = $(h));
continue;
case 2:
1 === t.phase
? ((t.phase = 0), V(h, t))
: n
? ((t.priority = c.PrefetchPriority.Background), V(h, t))
: K(h),
(t = $(h));
continue;
}
}
}
function C(e) {
return (
e.priority === c.PrefetchPriority.Background ||
((e.hasBackgroundWork = !0), !1)
);
}
function N(e, t, r, n, a) {
F(
e,
t,
r,
r.metadata,
!1,
n,
a === c.FetchStrategy.LoadingBoundary ? c.FetchStrategy.Full : a,
);
}
function F(e, t, r, n, a, l, u) {
let i = (0, o.readOrCreateSegmentCacheEntry)(e, u, r, n),
s = null;
switch (i.status) {
case o.EntryStatus.Empty:
s = (0, o.upgradeToPendingSegment)(i, u);
break;
case o.EntryStatus.Fulfilled:
i.isPartial &&
(0, o.canNewFetchStrategyProvideMoreContent)(i.fetchStrategy, u) &&
(s = I(e, r, n, u));
break;
case o.EntryStatus.Pending:
case o.EntryStatus.Rejected:
(0, o.canNewFetchStrategyProvideMoreContent)(i.fetchStrategy, u) &&
(s = I(e, r, n, u));
}
let c = {};
if (null !== n.slots)
for (let o in n.slots) {
let i = n.slots[o];
c[o] = F(e, t, r, i, a || null !== s, l, u);
}
null !== s && l.set(n.requestKey, s);
let f = a || null === s ? null : "refetch";
return [n.segment, c, null, f, n.isRootLayout];
}
function U(e, t, r, n, a, l) {
switch (n.status) {
case o.EntryStatus.Empty:
w(
(0, o.fetchSegmentOnCacheMiss)(
r,
(0, o.upgradeToPendingSegment)(n, c.FetchStrategy.PPR),
a,
l,
),
);
break;
case o.EntryStatus.Pending:
switch (n.fetchStrategy) {
case c.FetchStrategy.PPR:
case c.FetchStrategy.PPRRuntime:
case c.FetchStrategy.Full:
break;
case c.FetchStrategy.LoadingBoundary:
C(t) && k(e, r, a, l);
break;
default:
n.fetchStrategy;
}
break;
case o.EntryStatus.Rejected:
switch (n.fetchStrategy) {
case c.FetchStrategy.PPR:
case c.FetchStrategy.PPRRuntime:
case c.FetchStrategy.Full:
break;
case c.FetchStrategy.LoadingBoundary:
k(e, r, a, l);
break;
default:
n.fetchStrategy;
}
case o.EntryStatus.Fulfilled:
}
}
function k(e, t, r, n) {
let a = (0, o.readOrCreateRevalidatingSegmentEntry)(
e,
c.FetchStrategy.PPR,
t,
n,
);
switch (a.status) {
case o.EntryStatus.Empty:
D(
w(
(0, o.fetchSegmentOnCacheMiss)(
t,
(0, o.upgradeToPendingSegment)(a, c.FetchStrategy.PPR),
r,
n,
),
),
(0, i.getSegmentVaryPathForRequest)(c.FetchStrategy.PPR, n),
);
case o.EntryStatus.Pending:
case o.EntryStatus.Fulfilled:
case o.EntryStatus.Rejected:
}
}
function I(e, t, r, n) {
let a = (0, o.readOrCreateRevalidatingSegmentEntry)(e, n, t, r);
if (a.status === o.EntryStatus.Empty) {
let e = (0, o.upgradeToPendingSegment)(a, n);
return (
D(
(0, o.waitForSegmentCacheEntry)(e),
(0, i.getSegmentVaryPathForRequest)(n, r),
),
e
);
}
if ((0, o.canNewFetchStrategyProvideMoreContent)(a.fetchStrategy, n)) {
let e = (0, o.overwriteRevalidatingSegmentCacheEntry)(n, t, r),
a = (0, o.upgradeToPendingSegment)(e, n);
return (
D(
(0, o.waitForSegmentCacheEntry)(a),
(0, i.getSegmentVaryPathForRequest)(n, r),
),
a
);
}
switch (a.status) {
case o.EntryStatus.Pending:
case o.EntryStatus.Fulfilled:
case o.EntryStatus.Rejected:
default:
return null;
}
}
let L = () => {};
function D(e, t) {
e.then((e) => {
null !== e && (0, o.upsertSegmentEntry)(Date.now(), t, e);
}, L);
}
function x(e, t, r) {
return r === f.PAGE_SEGMENT_KEY
? t ===
(0, f.addSearchParamsIfPageSegment)(
f.PAGE_SEGMENT_KEY,
Object.fromEntries(new URLSearchParams(e.renderedSearch)),
)
: (0, u.matchSegment)(r, t);
}
function H(e, t) {
let r = t.priority - e.priority;
if (0 !== r) return r;
let n = t.phase - e.phase;
return 0 !== n ? n : t.sortId - e.sortId;
}
function B(e, t) {
let r = e.length;
e.push(t), (t._heapIndex = r), q(e, t, r);
}
function $(e) {
return 0 === e.length ? null : e[0];
}
function K(e) {
if (0 === e.length) return null;
let t = e[0];
t._heapIndex = -1;
let r = e.pop();
return r !== t && ((e[0] = r), (r._heapIndex = 0), G(e, r, 0)), t;
}
function V(e, t) {
let r = t._heapIndex;
-1 !== r &&
(0 === r
? G(e, t, 0)
: H(e[(r - 1) >>> 1], t) > 0
? q(e, t, r)
: G(e, t, r));
}
function q(e, t, r) {
let n = r;
for (; n > 0; ) {
let r = (n - 1) >>> 1,
a = e[r];
if (!(H(a, t) > 0)) return;
(e[r] = t), (t._heapIndex = r), (e[n] = a), (a._heapIndex = n), (n = r);
}
}
function G(e, t, r) {
let n = r,
a = e.length,
l = a >>> 1;
for (; n < l; ) {
let r = (n + 1) * 2 - 1,
l = e[r],
u = r + 1,
o = e[u];
if (0 > H(l, t))
u < a && 0 > H(o, l)
? ((e[n] = o),
(o._heapIndex = n),
(e[u] = t),
(t._heapIndex = u),
(n = u))
: ((e[n] = l),
(l._heapIndex = n),
(e[r] = t),
(t._heapIndex = r),
(n = r));
else {
if (!(u < a && 0 > H(o, t))) return;
(e[n] = o),
(o._heapIndex = n),
(e[u] = t),
(t._heapIndex = u),
(n = u);
}
}
}
("function" == typeof r.default ||
("object" == typeof r.default && null !== r.default)) &&
void 0 === r.default.__esModule &&
(Object.defineProperty(r.default, "__esModule", { value: !0 }),
Object.assign(r.default, r),
(t.exports = r.default));
};
export default moduleFactory;