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

719 lines
23 KiB
JavaScript

/*
* Extracted from browser-delivered Turbopack chunk: 20293dbce215808d.10cf9e27a9.js
* Module id: 641712
* For reading/searching only; this factory depends on the original Turbopack runtime.
*/
const moduleFactory = (e) => {
"use strict";
var t = e.i(425017),
n = e.i(585831),
r = e.i(888659);
function o(e) {
let n = (0, r.getComputedStyle)(e),
o = parseFloat(n.width) || 0,
i = parseFloat(n.height) || 0,
l = (0, r.isHTMLElement)(e),
a = l ? e.offsetWidth : o,
u = l ? e.offsetHeight : i,
s = (0, t.round)(o) !== a || (0, t.round)(i) !== u;
return s && ((o = a), (i = u)), { width: o, height: i, $: s };
}
function i(e) {
return (0, r.isElement)(e) ? e : e.contextElement;
}
function l(e) {
let n = i(e);
if (!(0, r.isHTMLElement)(n)) return (0, t.createCoords)(1);
let l = n.getBoundingClientRect(),
{ width: a, height: u, $: s } = o(n),
c = (s ? (0, t.round)(l.width) : l.width) / a,
d = (s ? (0, t.round)(l.height) : l.height) / u;
return (
(c && Number.isFinite(c)) || (c = 1),
(d && Number.isFinite(d)) || (d = 1),
{ x: c, y: d }
);
}
let a = (0, t.createCoords)(0);
function u(e) {
let t = (0, r.getWindow)(e);
return (0, r.isWebKit)() && t.visualViewport
? { x: t.visualViewport.offsetLeft, y: t.visualViewport.offsetTop }
: a;
}
function s(e, n, o, a) {
var s;
void 0 === n && (n = !1), void 0 === o && (o = !1);
let c = e.getBoundingClientRect(),
d = i(e),
f = (0, t.createCoords)(1);
n && (a ? (0, r.isElement)(a) && (f = l(a)) : (f = l(e)));
let m = (void 0 === (s = o) && (s = !1),
a && (!s || a === (0, r.getWindow)(d)) && s)
? u(d)
: (0, t.createCoords)(0),
p = (c.left + m.x) / f.x,
v = (c.top + m.y) / f.y,
g = c.width / f.x,
h = c.height / f.y;
if (d) {
let e = (0, r.getWindow)(d),
t = a && (0, r.isElement)(a) ? (0, r.getWindow)(a) : a,
n = e,
o = (0, r.getFrameElement)(n);
for (; o && a && t !== n; ) {
let e = l(o),
t = o.getBoundingClientRect(),
i = (0, r.getComputedStyle)(o),
a = t.left + (o.clientLeft + parseFloat(i.paddingLeft)) * e.x,
u = t.top + (o.clientTop + parseFloat(i.paddingTop)) * e.y;
(p *= e.x),
(v *= e.y),
(g *= e.x),
(h *= e.y),
(p += a),
(v += u),
(n = (0, r.getWindow)(o)),
(o = (0, r.getFrameElement)(n));
}
}
return (0, t.rectToClientRect)({ width: g, height: h, x: p, y: v });
}
function c(e, t) {
let n = (0, r.getNodeScroll)(e).scrollLeft;
return t ? t.left + n : s((0, r.getDocumentElement)(e)).left + n;
}
function d(e, t) {
let n = e.getBoundingClientRect();
return { x: n.left + t.scrollLeft - c(e, n), y: n.top + t.scrollTop };
}
let f = new Set(["absolute", "fixed"]);
function m(e, n, o) {
var i;
let a;
if ("viewport" === n)
a = (function (e, t) {
let n = (0, r.getWindow)(e),
o = (0, r.getDocumentElement)(e),
i = n.visualViewport,
l = o.clientWidth,
a = o.clientHeight,
u = 0,
s = 0;
if (i) {
(l = i.width), (a = i.height);
let e = (0, r.isWebKit)();
(!e || (e && "fixed" === t)) &&
((u = i.offsetLeft), (s = i.offsetTop));
}
let d = c(o);
if (d <= 0) {
let e = o.ownerDocument,
t = e.body,
n = getComputedStyle(t),
r =
("CSS1Compat" === e.compatMode &&
parseFloat(n.marginLeft) + parseFloat(n.marginRight)) ||
0,
i = Math.abs(o.clientWidth - t.clientWidth - r);
i <= 25 && (l -= i);
} else d <= 25 && (l += d);
return { width: l, height: a, x: u, y: s };
})(e, o);
else if ("document" === n) {
let n, o, l, u, s, d, f;
(i = (0, r.getDocumentElement)(e)),
(n = (0, r.getDocumentElement)(i)),
(o = (0, r.getNodeScroll)(i)),
(l = i.ownerDocument.body),
(u = (0, t.max)(
n.scrollWidth,
n.clientWidth,
l.scrollWidth,
l.clientWidth,
)),
(s = (0, t.max)(
n.scrollHeight,
n.clientHeight,
l.scrollHeight,
l.clientHeight,
)),
(d = -o.scrollLeft + c(i)),
(f = -o.scrollTop),
"rtl" === (0, r.getComputedStyle)(l).direction &&
(d += (0, t.max)(n.clientWidth, l.clientWidth) - u),
(a = { width: u, height: s, x: d, y: f });
} else if ((0, r.isElement)(n)) {
let e, i, u, c, d, f;
(i = (e = s(n, !0, "fixed" === o)).top + n.clientTop),
(u = e.left + n.clientLeft),
(c = (0, r.isHTMLElement)(n) ? l(n) : (0, t.createCoords)(1)),
(d = n.clientWidth * c.x),
(f = n.clientHeight * c.y),
(a = { width: d, height: f, x: u * c.x, y: i * c.y });
} else {
let t = u(e);
a = { x: n.x - t.x, y: n.y - t.y, width: n.width, height: n.height };
}
return (0, t.rectToClientRect)(a);
}
function p(e) {
return "static" === (0, r.getComputedStyle)(e).position;
}
function v(e, t) {
if (
!(0, r.isHTMLElement)(e) ||
"fixed" === (0, r.getComputedStyle)(e).position
)
return null;
if (t) return t(e);
let n = e.offsetParent;
return (
(0, r.getDocumentElement)(e) === n && (n = n.ownerDocument.body), n
);
}
function g(e, t) {
let n = (0, r.getWindow)(e);
if ((0, r.isTopLayer)(e)) return n;
if (!(0, r.isHTMLElement)(e)) {
let t = (0, r.getParentNode)(e);
for (; t && !(0, r.isLastTraversableNode)(t); ) {
if ((0, r.isElement)(t) && !p(t)) return t;
t = (0, r.getParentNode)(t);
}
return n;
}
let o = v(e, t);
for (; o && (0, r.isTableElement)(o) && p(o); ) o = v(o, t);
return o &&
(0, r.isLastTraversableNode)(o) &&
p(o) &&
!(0, r.isContainingBlock)(o)
? n
: o || (0, r.getContainingBlock)(e) || n;
}
let h = async function (e) {
let n = this.getOffsetParent || g,
o = this.getDimensions,
i = await o(e.floating);
return {
reference: (function (e, n, o) {
let i = (0, r.isHTMLElement)(n),
l = (0, r.getDocumentElement)(n),
a = "fixed" === o,
u = s(e, !0, a, n),
f = { scrollLeft: 0, scrollTop: 0 },
m = (0, t.createCoords)(0);
if (i || (!i && !a))
if (
(("body" !== (0, r.getNodeName)(n) ||
(0, r.isOverflowElement)(l)) &&
(f = (0, r.getNodeScroll)(n)),
i)
) {
let e = s(n, !0, a, n);
(m.x = e.x + n.clientLeft), (m.y = e.y + n.clientTop);
} else l && (m.x = c(l));
a && !i && l && (m.x = c(l));
let p = !l || i || a ? (0, t.createCoords)(0) : d(l, f);
return {
x: u.left + f.scrollLeft - m.x - p.x,
y: u.top + f.scrollTop - m.y - p.y,
width: u.width,
height: u.height,
};
})(e.reference, await n(e.floating), e.strategy),
floating: { x: 0, y: 0, width: i.width, height: i.height },
};
},
y = {
convertOffsetParentRelativeRectToViewportRelativeRect: function (e) {
let { elements: n, rect: o, offsetParent: i, strategy: a } = e,
u = "fixed" === a,
c = (0, r.getDocumentElement)(i),
f = !!n && (0, r.isTopLayer)(n.floating);
if (i === c || (f && u)) return o;
let m = { scrollLeft: 0, scrollTop: 0 },
p = (0, t.createCoords)(1),
v = (0, t.createCoords)(0),
g = (0, r.isHTMLElement)(i);
if (
(g || (!g && !u)) &&
(("body" !== (0, r.getNodeName)(i) ||
(0, r.isOverflowElement)(c)) &&
(m = (0, r.getNodeScroll)(i)),
(0, r.isHTMLElement)(i))
) {
let e = s(i);
(p = l(i)), (v.x = e.x + i.clientLeft), (v.y = e.y + i.clientTop);
}
let h = !c || g || u ? (0, t.createCoords)(0) : d(c, m);
return {
width: o.width * p.x,
height: o.height * p.y,
x: o.x * p.x - m.scrollLeft * p.x + v.x + h.x,
y: o.y * p.y - m.scrollTop * p.y + v.y + h.y,
};
},
getDocumentElement: r.getDocumentElement,
getClippingRect: function (e) {
let { element: n, boundary: o, rootBoundary: i, strategy: l } = e,
a = [
...("clippingAncestors" === o
? (0, r.isTopLayer)(n)
? []
: (function (e, t) {
let n = t.get(e);
if (n) return n;
let o = (0, r.getOverflowAncestors)(e, [], !1).filter(
(e) =>
(0, r.isElement)(e) &&
"body" !== (0, r.getNodeName)(e),
),
i = null,
l = "fixed" === (0, r.getComputedStyle)(e).position,
a = l ? (0, r.getParentNode)(e) : e;
for (
;
(0, r.isElement)(a) && !(0, r.isLastTraversableNode)(a);
) {
let t = (0, r.getComputedStyle)(a),
n = (0, r.isContainingBlock)(a);
n || "fixed" !== t.position || (i = null),
(
l
? !n && !i
: (!n &&
"static" === t.position &&
!!i &&
f.has(i.position)) ||
((0, r.isOverflowElement)(a) &&
!n &&
(function e(t, n) {
let o = (0, r.getParentNode)(t);
return (
!(
o === n ||
!(0, r.isElement)(o) ||
(0, r.isLastTraversableNode)(o)
) &&
("fixed" ===
(0, r.getComputedStyle)(o).position ||
e(o, n))
);
})(e, a))
)
? (o = o.filter((e) => e !== a))
: (i = t),
(a = (0, r.getParentNode)(a));
}
return t.set(e, o), o;
})(n, this._c)
: [].concat(o)),
i,
],
u = a[0],
s = a.reduce(
(e, r) => {
let o = m(n, r, l);
return (
(e.top = (0, t.max)(o.top, e.top)),
(e.right = (0, t.min)(o.right, e.right)),
(e.bottom = (0, t.min)(o.bottom, e.bottom)),
(e.left = (0, t.max)(o.left, e.left)),
e
);
},
m(n, u, l),
);
return {
width: s.right - s.left,
height: s.bottom - s.top,
x: s.left,
y: s.top,
};
},
getOffsetParent: g,
getElementRects: h,
getClientRects: function (e) {
return Array.from(e.getClientRects());
},
getDimensions: function (e) {
let { width: t, height: n } = o(e);
return { width: t, height: n };
},
getScale: l,
isElement: r.isElement,
isRTL: function (e) {
return "rtl" === (0, r.getComputedStyle)(e).direction;
},
};
function w(e, t) {
return (
e.x === t.x &&
e.y === t.y &&
e.width === t.width &&
e.height === t.height
);
}
function b(e, n, o, l) {
let a;
void 0 === l && (l = {});
let {
ancestorScroll: u = !0,
ancestorResize: c = !0,
elementResize: d = "function" == typeof ResizeObserver,
layoutShift: f = "function" == typeof IntersectionObserver,
animationFrame: m = !1,
} = l,
p = i(e),
v =
u || c
? [
...(p ? (0, r.getOverflowAncestors)(p) : []),
...(0, r.getOverflowAncestors)(n),
]
: [];
v.forEach((e) => {
u && e.addEventListener("scroll", o, { passive: !0 }),
c && e.addEventListener("resize", o);
});
let g =
p && f
? (function (e, n) {
let o,
i = null,
l = (0, r.getDocumentElement)(e);
function a() {
var e;
clearTimeout(o),
null == (e = i) || e.disconnect(),
(i = null);
}
return (
!(function r(u, s) {
void 0 === u && (u = !1), void 0 === s && (s = 1), a();
let c = e.getBoundingClientRect(),
{ left: d, top: f, width: m, height: p } = c;
if ((u || n(), !m || !p)) return;
let v = {
rootMargin:
-(0, t.floor)(f) +
"px " +
-(0, t.floor)(l.clientWidth - (d + m)) +
"px " +
-(0, t.floor)(l.clientHeight - (f + p)) +
"px " +
-(0, t.floor)(d) +
"px",
threshold: (0, t.max)(0, (0, t.min)(1, s)) || 1,
},
g = !0;
function h(t) {
let n = t[0].intersectionRatio;
if (n !== s) {
if (!g) return r();
n
? r(!1, n)
: (o = setTimeout(() => {
r(!1, 1e-7);
}, 1e3));
}
1 !== n || w(c, e.getBoundingClientRect()) || r(),
(g = !1);
}
try {
i = new IntersectionObserver(h, {
...v,
root: l.ownerDocument,
});
} catch (e) {
i = new IntersectionObserver(h, v);
}
i.observe(e);
})(!0),
a
);
})(p, o)
: null,
h = -1,
y = null;
d &&
((y = new ResizeObserver((e) => {
let [t] = e;
t &&
t.target === p &&
y &&
(y.unobserve(n),
cancelAnimationFrame(h),
(h = requestAnimationFrame(() => {
var e;
null == (e = y) || e.observe(n);
}))),
o();
})),
p && !m && y.observe(p),
y.observe(n));
let b = m ? s(e) : null;
return (
m &&
(function t() {
let n = s(e);
b && !w(b, n) && o(), (b = n), (a = requestAnimationFrame(t));
})(),
o(),
() => {
var e;
v.forEach((e) => {
u && e.removeEventListener("scroll", o),
c && e.removeEventListener("resize", o);
}),
null == g || g(),
null == (e = y) || e.disconnect(),
(y = null),
m && cancelAnimationFrame(a);
}
);
}
let x = n.detectOverflow,
E = n.offset,
S = n.autoPlacement,
C = n.shift,
R = n.flip,
T = n.size,
M = n.hide,
A = n.arrow,
L = n.inline,
P = n.limitShift,
N = (e, t, r) => {
let o = new Map(),
i = { platform: y, ...r },
l = { ...i.platform, _c: o };
return (0, n.computePosition)(e, t, { ...i, platform: l });
};
e.s(
[
"arrow",
() => A,
"autoPlacement",
() => S,
"autoUpdate",
() => b,
"computePosition",
() => N,
"detectOverflow",
() => x,
"flip",
() => R,
"hide",
() => M,
"inline",
() => L,
"limitShift",
() => P,
"offset",
() => E,
"shift",
() => C,
"size",
() => T,
],
641712,
);
var k = e.i(358379),
O = e.i(111558),
D = "u" > typeof document ? k.useLayoutEffect : function () {};
function I(e, t) {
let n, r, o;
if (e === t) return !0;
if (typeof e != typeof t) return !1;
if ("function" == typeof e && e.toString() === t.toString()) return !0;
if (e && t && "object" == typeof e) {
if (Array.isArray(e)) {
if ((n = e.length) !== t.length) return !1;
for (r = n; 0 != r--; ) if (!I(e[r], t[r])) return !1;
return !0;
}
if ((n = (o = Object.keys(e)).length) !== Object.keys(t).length)
return !1;
for (r = n; 0 != r--; ) if (!{}.hasOwnProperty.call(t, o[r])) return !1;
for (r = n; 0 != r--; ) {
let n = o[r];
if (("_owner" !== n || !e.$$typeof) && !I(e[n], t[n])) return !1;
}
return !0;
}
return e != e && t != t;
}
function B(e) {
return "u" < typeof window
? 1
: (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
}
function j(e, t) {
let n = B(e);
return Math.round(t * n) / n;
}
function _(e) {
let t = k.useRef(e);
return (
D(() => {
t.current = e;
}),
t
);
}
function F(e) {
void 0 === e && (e = {});
let {
placement: t = "bottom",
strategy: n = "absolute",
middleware: r = [],
platform: o,
elements: { reference: i, floating: l } = {},
transform: a = !0,
whileElementsMounted: u,
open: s,
} = e,
[c, d] = k.useState({
x: 0,
y: 0,
strategy: n,
placement: t,
middlewareData: {},
isPositioned: !1,
}),
[f, m] = k.useState(r);
I(f, r) || m(r);
let [p, v] = k.useState(null),
[g, h] = k.useState(null),
y = k.useCallback((e) => {
e !== E.current && ((E.current = e), v(e));
}, []),
w = k.useCallback((e) => {
e !== S.current && ((S.current = e), h(e));
}, []),
b = i || p,
x = l || g,
E = k.useRef(null),
S = k.useRef(null),
C = k.useRef(c),
R = null != u,
T = _(u),
M = _(o),
A = _(s),
L = k.useCallback(() => {
if (!E.current || !S.current) return;
let e = { placement: t, strategy: n, middleware: f };
M.current && (e.platform = M.current),
N(E.current, S.current, e).then((e) => {
let t = { ...e, isPositioned: !1 !== A.current };
P.current &&
!I(C.current, t) &&
((C.current = t),
O.flushSync(() => {
d(t);
}));
});
}, [f, t, n, M, A]);
D(() => {
!1 === s &&
C.current.isPositioned &&
((C.current.isPositioned = !1),
d((e) => ({ ...e, isPositioned: !1 })));
}, [s]);
let P = k.useRef(!1);
D(
() => (
(P.current = !0),
() => {
P.current = !1;
}
),
[],
),
D(() => {
if ((b && (E.current = b), x && (S.current = x), b && x)) {
if (T.current) return T.current(b, x, L);
L();
}
}, [b, x, L, T, R]);
let F = k.useMemo(
() => ({
reference: E,
floating: S,
setReference: y,
setFloating: w,
}),
[y, w],
),
H = k.useMemo(() => ({ reference: b, floating: x }), [b, x]),
W = k.useMemo(() => {
let e = { position: n, left: 0, top: 0 };
if (!H.floating) return e;
let t = j(H.floating, c.x),
r = j(H.floating, c.y);
return a
? {
...e,
transform: "translate(" + t + "px, " + r + "px)",
...(B(H.floating) >= 1.5 && { willChange: "transform" }),
}
: { position: n, left: t, top: r };
}, [n, a, H.floating, c.x, c.y]);
return k.useMemo(
() => ({ ...c, update: L, refs: F, elements: H, floatingStyles: W }),
[c, L, F, H, W],
);
}
let H = (e, t) => ({ ...E(e), options: [e, t] }),
W = (e, t) => ({ ...C(e), options: [e, t] }),
z = (e, t) => ({ ...P(e), options: [e, t] }),
V = (e, t) => ({ ...R(e), options: [e, t] }),
X = (e, t) => ({ ...T(e), options: [e, t] }),
U = (e, t) => ({ ...M(e), options: [e, t] }),
Y = (e, t) => ({ ...L(e), options: [e, t] }),
$ = (e, t) => ({
name: "arrow",
options: e,
fn(t) {
let { element: n, padding: r } = "function" == typeof e ? e(t) : e;
return n && {}.hasOwnProperty.call(n, "current")
? null != n.current
? A({ element: n.current, padding: r }).fn(t)
: {}
: n
? A({ element: n, padding: r }).fn(t)
: {};
},
options: [e, t],
});
e.s(
[
"arrow",
() => $,
"flip",
() => V,
"hide",
() => U,
"inline",
() => Y,
"limitShift",
() => z,
"offset",
() => H,
"shift",
() => W,
"size",
() => X,
"useFloating",
() => F,
],
520466,
);
};
export default moduleFactory;