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

589 lines
18 KiB
JavaScript

/*
* Extracted from browser-delivered Turbopack chunk: d797a0c3f1e529b7.bdfb00cb92.js
* Module id: 819151
* For reading/searching only; this factory depends on the original Turbopack runtime.
*/
const moduleFactory = (e) => {
"use strict";
var t = e.i(462214),
o = e.i(358379),
r = e.i(7284),
i = e.i(600354),
n = e.i(909243),
s = e.i(855698),
a = e.i(141460),
l = e.i(142385),
d = e.i(938202),
p = e.i(479324),
u = e.i(450943),
c = e.i(124859),
f = e.i(593307),
g = e.i(46978),
m = e.i(487101),
h = e.i(981933),
v = e.i(754654),
w = e.i(764218);
let x = { duration: 100, transition: "fade" };
function b(e, t) {
return { ...x, ...t, ...e };
}
var y = { tooltip: "m_1b3c8819", arrow: "m_f898399f" },
P = e.i(620428),
R = e.i(830744);
function C(e, t) {
return Array.isArray(e)
? [...e].reduce((e, o) => ({ ...e, ...C(o, t) }), {})
: "function" == typeof e
? e(t)
: null == e
? {}
: e;
}
e.s(["getStyleObject", () => C], 819151);
var E = e.i(800109),
S = e.i(520466),
T = e.i(888659);
let F = {
refProp: "ref",
withinPortal: !0,
offset: 10,
position: "right",
zIndex: (0, n.getDefaultZIndex)("popover"),
},
D = (0, d.createVarsResolver)((e, { radius: t, color: o }) => ({
tooltip: {
"--tooltip-radius": void 0 === t ? void 0 : (0, s.getRadius)(t),
"--tooltip-bg": o ? (0, P.getThemeColor)(o, e) : void 0,
"--tooltip-color": o ? "var(--mantine-color-white)" : void 0,
},
})),
I = (0, f.factory)((e, r) => {
let n = (0, p.useProps)("TooltipFloating", F, e),
{
children: s,
refProp: d,
withinPortal: f,
style: g,
className: m,
classNames: h,
styles: w,
unstyled: x,
radius: b,
color: P,
label: I,
offset: O,
position: M,
multiline: $,
zIndex: _,
disabled: j,
defaultOpened: z,
variant: N,
vars: k,
portalProps: W,
attributes: A,
...L
} = n,
B = (0, R.useMantineTheme)(),
U = (0, u.useStyles)({
name: "TooltipFloating",
props: n,
classes: y,
className: m,
style: g,
classNames: h,
styles: w,
unstyled: x,
attributes: A,
rootSelector: "tooltip",
vars: k,
varsResolver: D,
}),
{
handleMouseMove: V,
x: H,
y: X,
opened: G,
boundaryRef: Y,
floating: K,
setOpened: Z,
} = (function ({ offset: e, position: t, defaultOpened: r }) {
let [i, n] = (0, o.useState)(r),
s = (0, o.useRef)(null),
{
x: a,
y: l,
elements: d,
refs: p,
update: u,
placement: c,
} = (0, E.useFloating)({
placement: t,
middleware: [
(0, S.shift)({
crossAxis: !0,
padding: 5,
rootBoundary: "document",
}),
],
}),
f = c.includes("right") ? e : t.includes("left") ? -1 * e : 0,
g = c.includes("bottom") ? e : t.includes("top") ? -1 * e : 0,
m = (0, o.useCallback)(
({ clientX: e, clientY: t }) => {
p.setPositionReference({
getBoundingClientRect: () => ({
width: 0,
height: 0,
x: e,
y: t,
left: e + f,
top: t + g,
right: e,
bottom: t,
}),
});
},
[d.reference],
);
return (
(0, o.useEffect)(() => {
if (p.floating.current) {
let e = s.current;
e.addEventListener("mousemove", m);
let t = (0, T.getOverflowAncestors)(p.floating.current);
return (
t.forEach((e) => {
e.addEventListener("scroll", u);
}),
() => {
e.removeEventListener("mousemove", m),
t.forEach((e) => {
e.removeEventListener("scroll", u);
});
}
);
}
}, [d.reference, p.floating.current, u, m, i]),
{
handleMouseMove: m,
x: a,
y: l,
opened: i,
setOpened: n,
boundaryRef: s,
floating: p.setFloating,
}
);
})({ offset: O, position: M, defaultOpened: z }),
q = (0, l.getSingleElementChild)(s);
if (!q)
throw Error(
"[@mantine/core] Tooltip.Floating component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported",
);
let Q = (0, i.useMergedRef)(Y, (0, a.getRefProp)(q), r),
J = q.props;
return (0, t.jsxs)(t.Fragment, {
children: [
(0, t.jsx)(v.OptionalPortal, {
...W,
withinPortal: f,
children: (0, t.jsx)(c.Box, {
...L,
...U("tooltip", {
style: {
...C(g, B),
zIndex: _,
display: !j && G ? "block" : "none",
top: (X && Math.round(X)) ?? "",
left: (H && Math.round(H)) ?? "",
},
}),
variant: N,
ref: K,
mod: { multiline: $ },
children: I,
}),
}),
(0, o.cloneElement)(q, {
...J,
[d]: Q,
onMouseEnter: (e) => {
J.onMouseEnter?.(e), V(e), Z(!0);
},
onMouseLeave: (e) => {
J.onMouseLeave?.(e), Z(!1);
},
}),
],
});
});
(I.classes = y), (I.displayName = "@mantine/core/TooltipFloating");
let O = (0, o.createContext)(!1),
M = O.Provider,
$ = { openDelay: 0, closeDelay: 0 };
function _(e) {
let {
openDelay: o,
closeDelay: r,
children: i,
} = (0, p.useProps)("TooltipGroup", $, e);
return (0, t.jsx)(M, {
value: !0,
children: (0, t.jsx)(E.FloatingDelayGroup, {
delay: { open: o, close: r },
children: i,
}),
});
}
(_.displayName = "@mantine/core/TooltipGroup"), (_.extend = (e) => e);
var j = e.i(641712),
z = e.i(192830),
N = e.i(361752);
let k = {
position: "top",
refProp: "ref",
withinPortal: !0,
arrowSize: 4,
arrowOffset: 5,
arrowRadius: 0,
arrowPosition: "side",
offset: 5,
transitionProps: { duration: 100, transition: "fade" },
events: { hover: !0, focus: !1, touch: !1 },
zIndex: (0, n.getDefaultZIndex)("popover"),
positionDependencies: [],
middlewares: { flip: !0, shift: !0, inline: !1 },
},
W = (0, d.createVarsResolver)(
(e, { radius: t, color: o, variant: r, autoContrast: i }) => {
let n = e.variantColorResolver({
theme: e,
color: o || e.primaryColor,
autoContrast: i,
variant: r || "filled",
});
return {
tooltip: {
"--tooltip-radius": void 0 === t ? void 0 : (0, s.getRadius)(t),
"--tooltip-bg": o ? n.background : void 0,
"--tooltip-color": o ? n.color : void 0,
},
};
},
),
A = (0, f.factory)((e, n) => {
let s = (0, p.useProps)("Tooltip", k, e),
{
children: d,
position: f,
refProp: x,
label: P,
openDelay: R,
closeDelay: C,
onPositionChange: T,
opened: F,
defaultOpened: D,
withinPortal: I,
radius: M,
color: $,
classNames: _,
styles: A,
unstyled: L,
style: B,
className: U,
withArrow: V,
arrowSize: H,
arrowOffset: X,
arrowRadius: G,
arrowPosition: Y,
offset: K,
transitionProps: Z,
multiline: q,
events: Q,
zIndex: J,
disabled: ee,
positionDependencies: et,
onClick: eo,
onMouseEnter: er,
onMouseLeave: ei,
inline: en,
variant: es,
keepMounted: ea,
vars: el,
portalProps: ed,
mod: ep,
floatingStrategy: eu,
middlewares: ec,
autoContrast: ef,
attributes: eg,
target: em,
...eh
} = (0, p.useProps)("Tooltip", k, s),
{ dir: ev } = (0, g.useDirection)(),
ew = (0, o.useRef)(null),
ex = (function (e) {
let t,
r,
[i, n] = (0, o.useState)(e.defaultOpened),
s = "boolean" == typeof e.opened ? e.opened : i,
a = (0, o.useContext)(O),
l = (0, z.useId)(),
d = (0, o.useCallback)(
(e) => {
n(e), e && x(l);
},
[l],
),
{
x: p,
y: u,
context: c,
refs: f,
placement: g,
middlewareData: { arrow: { x: m, y: h } = {} },
} = (0, E.useFloating)({
strategy: e.strategy,
placement: e.position,
open: s,
onOpenChange: d,
middleware:
((t = (function (e) {
if (void 0 === e) return { shift: !0, flip: !0 };
let t = { ...e };
return (
void 0 === e.shift && (t.shift = !0),
void 0 === e.flip && (t.flip = !0),
t
);
})(e.middlewares)),
(r = [(0, S.offset)(e.offset)]),
t.shift &&
r.push(
(0, S.shift)(
"boolean" == typeof t.shift
? { padding: 8 }
: { padding: 8, ...t.shift },
),
),
t.flip &&
r.push(
"boolean" == typeof t.flip
? (0, S.flip)()
: (0, S.flip)(t.flip),
),
r.push(
(0, S.arrow)({
element: e.arrowRef,
padding: e.arrowOffset,
}),
),
t.inline
? r.push(
"boolean" == typeof t.inline
? (0, S.inline)()
: (0, S.inline)(t.inline),
)
: e.inline && r.push((0, S.inline)()),
r),
whileElementsMounted: j.autoUpdate,
}),
{
delay: v,
currentId: w,
setCurrentId: x,
} = (0, E.useDelayGroup)(c, { id: l }),
{ getReferenceProps: b, getFloatingProps: y } = (0,
E.useInteractions)([
(0, E.useHover)(c, {
enabled: e.events?.hover,
delay: a ? v : { open: e.openDelay, close: e.closeDelay },
mouseOnly: !e.events?.touch,
}),
(0, E.useFocus)(c, {
enabled: e.events?.focus,
visibleOnly: !0,
}),
(0, E.useRole)(c, { role: "tooltip" }),
(0, E.useDismiss)(c, { enabled: void 0 === e.opened }),
]);
(0, N.useDidUpdate)(() => {
e.onPositionChange?.(g);
}, [g]);
let P = s && w && w !== l;
return {
x: p,
y: u,
arrowX: m,
arrowY: h,
reference: f.setReference,
floating: f.setFloating,
getFloatingProps: y,
getReferenceProps: b,
isGroupPhase: P,
opened: s,
placement: g,
};
})({
position: (0, h.getFloatingPosition)(ev, f),
closeDelay: C,
openDelay: R,
onPositionChange: T,
opened: F,
defaultOpened: D,
events: Q,
arrowRef: ew,
arrowOffset: X,
offset: "number" == typeof K ? K + (V ? H / 2 : 0) : K,
positionDependencies: [...et, em ?? d],
inline: en,
strategy: eu,
middlewares: ec,
});
(0, o.useEffect)(() => {
let e =
em instanceof HTMLElement
? em
: "string" == typeof em
? document.querySelector(em)
: em?.current || null;
e && ex.reference(e);
}, [em, ex]);
let eb = (0, u.useStyles)({
name: "Tooltip",
props: s,
classes: y,
className: U,
style: B,
classNames: _,
styles: A,
unstyled: L,
attributes: eg,
rootSelector: "tooltip",
vars: el,
varsResolver: W,
}),
ey = (0, l.getSingleElementChild)(d);
if (!em && !ey) return null;
if (em) {
let e = b(Z, { duration: 100, transition: "fade" });
return (0, t.jsx)(t.Fragment, {
children: (0, t.jsx)(v.OptionalPortal, {
...ed,
withinPortal: I,
children: (0, t.jsx)(w.Transition, {
...e,
keepMounted: ea,
mounted: !ee && !!ex.opened,
duration: ex.isGroupPhase ? 10 : e.duration,
children: (e) =>
(0, t.jsxs)(c.Box, {
...eh,
"data-fixed": "fixed" === eu || void 0,
variant: es,
mod: [{ multiline: q }, ep],
...ex.getFloatingProps({
ref: ex.floating,
className: eb("tooltip").className,
style: {
...eb("tooltip").style,
...e,
zIndex: J,
top: ex.y ?? 0,
left: ex.x ?? 0,
},
}),
children: [
P,
(0, t.jsx)(m.FloatingArrow, {
ref: ew,
arrowX: ex.arrowX,
arrowY: ex.arrowY,
visible: V,
position: ex.placement,
arrowSize: H,
arrowOffset: X,
arrowRadius: G,
arrowPosition: Y,
...eb("arrow"),
}),
],
}),
}),
}),
});
}
let eP = ey.props,
eR = (0, i.useMergedRef)(ex.reference, (0, a.getRefProp)(ey), n),
eC = b(Z, { duration: 100, transition: "fade" });
return (0, t.jsxs)(t.Fragment, {
children: [
(0, t.jsx)(v.OptionalPortal, {
...ed,
withinPortal: I,
children: (0, t.jsx)(w.Transition, {
...eC,
keepMounted: ea,
mounted: !ee && !!ex.opened,
duration: ex.isGroupPhase ? 10 : eC.duration,
children: (e) =>
(0, t.jsxs)(c.Box, {
...eh,
"data-fixed": "fixed" === eu || void 0,
variant: es,
mod: [{ multiline: q }, ep],
...ex.getFloatingProps({
ref: ex.floating,
className: eb("tooltip").className,
style: {
...eb("tooltip").style,
...e,
zIndex: J,
top: ex.y ?? 0,
left: ex.x ?? 0,
},
}),
children: [
P,
(0, t.jsx)(m.FloatingArrow, {
ref: ew,
arrowX: ex.arrowX,
arrowY: ex.arrowY,
visible: V,
position: ex.placement,
arrowSize: H,
arrowOffset: X,
arrowRadius: G,
arrowPosition: Y,
...eb("arrow"),
}),
],
}),
}),
}),
(0, o.cloneElement)(
ey,
ex.getReferenceProps({
onClick: eo,
onMouseEnter: er,
onMouseLeave: ei,
onMouseMove: s.onMouseMove,
onPointerDown: s.onPointerDown,
onPointerEnter: s.onPointerEnter,
...eP,
className: (0, r.default)(U, eP.className),
[x]: eR,
}),
),
],
});
});
(A.classes = y),
(A.displayName = "@mantine/core/Tooltip"),
(A.Floating = I),
(A.Group = _),
e.s(["Tooltip", () => A], 510161);
};
export default moduleFactory;