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

412 lines
13 KiB
JavaScript

/*
* Extracted from browser-delivered Turbopack chunk: 1da3af88666fe4c8.e799ee1631.js
* Module id: 997657
* For reading/searching only; this factory depends on the original Turbopack runtime.
*/
const moduleFactory = (e) => {
"use strict";
var t = e.i(462214),
r = e.i(358379),
o = e.i(646283),
n = e.i(403557),
i = e.i(192830),
a = e.i(600354),
l = e.i(855698),
s = e.i(938202);
e.i(7284);
var c = e.i(620428),
u = e.i(507263),
d = e.i(830744),
m = e.i(479324),
f = e.i(450943),
p = e.i(124859),
g = e.i(593307),
_ = { root: "m_96b553a6" },
h = e.i(186563),
v = e.i(290297),
y = e.i(211859);
let b = (0, s.createVarsResolver)((e, { transitionDuration: t }) => ({
root: { "--transition-duration": "number" == typeof t ? `${t}ms` : t },
})),
T = (0, g.factory)((e, o) => {
let n = (0, m.useProps)("FloatingIndicator", null, e),
{
classNames: i,
className: l,
style: s,
styles: c,
unstyled: u,
vars: d,
target: g,
parent: T,
transitionDuration: S,
mod: x,
displayAfterTransitionEnd: E,
attributes: A,
...w
} = n,
N = (0, f.useStyles)({
name: "FloatingIndicator",
classes: _,
props: n,
className: l,
style: s,
classNames: i,
styles: c,
unstyled: u,
attributes: A,
vars: d,
varsResolver: b,
}),
C = (0, r.useRef)(null),
{ initialized: k, hidden: D } = (function ({
target: e,
parent: t,
ref: o,
displayAfterTransitionEnd: n,
}) {
let i = (0, r.useRef)(-1),
[a, l] = (0, r.useState)(!1),
[s, c] = (0, r.useState)("boolean" == typeof n && n),
u = () => {
if (!e || !t || !o.current) return;
let r = e.getBoundingClientRect(),
n = t.getBoundingClientRect(),
i = window.getComputedStyle(e),
a = window.getComputedStyle(t),
l =
(0, y.toInt)(i.borderTopWidth) +
(0, y.toInt)(a.borderTopWidth),
s =
(0, y.toInt)(i.borderLeftWidth) +
(0, y.toInt)(a.borderLeftWidth),
c = {
top: r.top - n.top - l,
left: r.left - n.left - s,
width: r.width,
height: r.height,
};
(o.current.style.transform = `translateY(${c.top}px) translateX(${c.left}px)`),
(o.current.style.width = `${c.width}px`),
(o.current.style.height = `${c.height}px`);
},
d = () => {
window.clearTimeout(i.current),
o.current && (o.current.style.transitionDuration = "0ms"),
u(),
(i.current = window.setTimeout(() => {
o.current && (o.current.style.transitionDuration = "");
}, 30));
},
m = (0, r.useRef)(null),
f = (0, r.useRef)(null);
return (
(0, r.useEffect)(() => {
if ((u(), e))
return (
(m.current = new ResizeObserver(d)),
m.current.observe(e),
t &&
((f.current = new ResizeObserver(d)),
f.current.observe(t)),
() => {
m.current?.disconnect(), f.current?.disconnect();
}
);
}, [t, e]),
(0, r.useEffect)(() => {
if (t) {
let e = (e) => {
(function (e, t) {
if (!t || !e) return !1;
let r = t.parentNode;
for (; null != r; ) {
if (r === e) return !0;
r = r.parentNode;
}
return !1;
})(e.target, t) && (d(), c(!1));
};
return (
t.addEventListener("transitionend", e),
() => {
t.removeEventListener("transitionend", e);
}
);
}
}, [t]),
!(function (e, t, o = { autoInvoke: !1 }) {
let n = (0, r.useRef)(null),
i = (0, r.useCallback)(
(...t) => {
n.current ||
(n.current = window.setTimeout(() => {
e(t), (n.current = null);
}, 20));
},
[20],
),
a = (0, r.useCallback)(() => {
n.current &&
(window.clearTimeout(n.current), (n.current = null));
}, []);
(0, r.useEffect)(() => (o.autoInvoke && i(), a), [a, i]);
})(
() => {
"test" !== (0, v.getEnv)() && l(!0);
},
0,
{ autoInvoke: !0 },
),
(0, h.useMutationObserver)(
(e) => {
e.forEach((e) => {
"attributes" === e.type && "dir" === e.attributeName && d();
});
},
{ attributes: !0, attributeFilter: ["dir"] },
() => document.documentElement,
),
{ initialized: a, hidden: s }
);
})({ target: g, parent: T, ref: C, displayAfterTransitionEnd: E }),
O = (0, a.useMergedRef)(o, C);
return g && T
? (0, t.jsx)(p.Box, {
ref: O,
mod: [{ initialized: k, hidden: D }, x],
...N("root"),
...w,
})
: null;
});
(T.displayName = "@mantine/core/FloatingIndicator"), (T.classes = _);
var S = {
root: "m_cf365364",
indicator: "m_9e182ccd",
label: "m_1738fcb2",
input: "m_1714d588",
control: "m_69686b9b",
innerLabel: "m_78882f40",
};
let x = { withItemsBorders: !0 },
E = (0, s.createVarsResolver)(
(
e,
{
radius: t,
color: r,
transitionDuration: o,
size: n,
transitionTimingFunction: i,
},
) => ({
root: {
"--sc-radius": void 0 === t ? void 0 : (0, l.getRadius)(t),
"--sc-color": r ? (0, c.getThemeColor)(r, e) : void 0,
"--sc-shadow": r ? void 0 : "var(--mantine-shadow-xs)",
"--sc-transition-duration": void 0 === o ? void 0 : `${o}ms`,
"--sc-transition-timing-function": i,
"--sc-padding": (0, l.getSize)(n, "sc-padding"),
"--sc-font-size": (0, l.getFontSize)(n),
},
}),
),
A = (0, g.factory)((e, l) => {
var s, c;
let g,
_,
h = (0, m.useProps)("SegmentedControl", x, e),
{
classNames: v,
className: y,
style: b,
styles: A,
unstyled: w,
vars: N,
data: C,
value: k,
defaultValue: D,
onChange: O,
size: R,
name: I,
disabled: L,
readOnly: M,
fullWidth: P,
orientation: U,
radius: j,
color: z,
transitionDuration: F,
transitionTimingFunction: B,
variant: H,
autoContrast: W,
withItemsBorders: G,
mod: $,
attributes: Y,
...q
} = h,
V = (0, f.useStyles)({
name: "SegmentedControl",
props: h,
classes: S,
className: y,
style: b,
classNames: v,
styles: A,
unstyled: w,
attributes: Y,
vars: N,
varsResolver: E,
}),
X = (0, d.useMantineTheme)(),
Z = C.map((e) => ("string" == typeof e ? { label: e, value: e } : e)),
K = (function () {
let [e, t] = (0, r.useState)(!1);
return (0, r.useEffect)(() => t(!0), []), e;
})(),
[Q, J] = (0, r.useState)((0, o.randomId)()),
[ee, et] = (0, r.useState)(null),
[er, eo] = (0, r.useState)({}),
[en, ei] = (0, n.useUncontrolled)({
value: k,
defaultValue: D,
finalValue: Array.isArray(C)
? (Z.find((e) => !e.disabled)?.value ?? C[0]?.value ?? null)
: null,
onChange: O,
}),
ea = (0, i.useId)(I),
el = Z.map((e) =>
(0, r.createElement)(
p.Box,
{
...V("control"),
mod: { active: en === e.value, orientation: U },
key: e.value,
},
(0, r.createElement)("input", {
...V("input"),
disabled: L || e.disabled,
type: "radio",
name: ea,
value: e.value,
id: `${ea}-${e.value}`,
checked: en === e.value,
onChange: () => !M && ei(e.value),
"data-focus-ring": X.focusRing,
key: `${e.value}-input`,
}),
(0, r.createElement)(
p.Box,
{
component: "label",
...V("label"),
mod: {
active: en === e.value && !(L || e.disabled),
disabled: L || e.disabled,
"read-only": M,
},
htmlFor: `${ea}-${e.value}`,
ref: (t) => {
(er[e.value] = t), eo(er);
},
__vars: {
"--sc-label-color":
void 0 !== z
? (0, u.getContrastColor)({
color: z,
theme: X,
autoContrast: W,
})
: void 0,
},
key: `${e.value}-label`,
},
(0, t.jsx)("span", { ...V("innerLabel"), children: e.label }),
),
),
),
es = (0, a.useMergedRef)(l, (e) => et(e));
return ((s = () => {
J((0, o.randomId)());
}),
(c = [C.length]),
(0, r.useEffect)(
s,
((g = (0, r.useRef)([])),
(_ = (0, r.useRef)(0)),
!(function (e, t) {
if (!e || !t) return !1;
if (e === t) return !0;
if (e.length !== t.length) return !1;
for (let r = 0; r < e.length; r += 1)
if (
!(function (e, t) {
if (e === t || (Number.isNaN(e) && Number.isNaN(t)))
return !0;
if (!(e instanceof Object) || !(t instanceof Object))
return !1;
let r = Object.keys(e),
{ length: o } = r;
if (o !== Object.keys(t).length) return !1;
for (let n = 0; n < o; n += 1) {
let o = r[n];
if (
!(o in t) ||
(e[o] !== t[o] &&
!(Number.isNaN(e[o]) && Number.isNaN(t[o])))
)
return !1;
}
return !0;
})(e[r], t[r])
)
return !1;
return !0;
})(g.current, c) && ((g.current = c), (_.current += 1)),
[_.current]),
),
0 === C.length)
? null
: (0, t.jsxs)(p.Box, {
...V("root"),
variant: H,
size: R,
ref: es,
mod: [
{
"full-width": P,
orientation: U,
initialized: K,
"with-items-borders": G,
},
$,
],
...q,
role: "radiogroup",
"data-disabled": L,
children: [
"string" == typeof en &&
(0, t.jsx)(
T,
{
target: er[en],
parent: ee,
component: "span",
transitionDuration: "var(--sc-transition-duration)",
...V("indicator"),
},
Q,
),
el,
],
});
});
(A.classes = S),
(A.displayName = "@mantine/core/SegmentedControl"),
e.s(["SegmentedControl", () => A], 997657);
};
export default moduleFactory;