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

524 lines
17 KiB
JavaScript

/*
* Extracted from browser-delivered Turbopack chunk: 5abe5d57a9f648de.55a495b94b.js
* Module id: 313500
* For reading/searching only; this factory depends on the original Turbopack runtime.
*/
const moduleFactory = (e) => {
"use strict";
var t,
a,
l,
s,
r = e.i(462214),
n = e.i(358379),
i = e.i(734911),
o = e.i(41671),
c = e.i(777784),
d = e.i(637591),
u = e.i(373518),
x = e.i(133085);
function m(e) {
let t = new Date(e);
if (isNaN(t.getTime())) return e;
let a = t.getFullYear(),
l = String(t.getMonth() + 1).padStart(2, "0"),
s = String(t.getDate()).padStart(2, "0"),
r = String(t.getHours()).padStart(2, "0"),
n = String(t.getMinutes()).padStart(2, "0"),
i = String(t.getSeconds()).padStart(2, "0");
return `${a}/${l}/${s} ${r}:${n}:${i}`;
}
function h(e) {
try {
return JSON.parse(e).skuName ?? "";
} catch {
return "";
}
}
function p({ item: e, onCopyInviteCode: t }) {
let a =
(0, n.useMemo)(
() =>
(function (e) {
try {
return JSON.parse(e);
} catch {
return {};
}
})(e.ext),
[e.ext],
).teamName || e.inviterNickname,
l = e.rewards?.[0]?.createTime;
return (0, r.jsxs)("div", {
className: x.default.teamSection,
children: [
(0, r.jsxs)("div", {
className: x.default.teamHeaderContent,
children: [
(0, r.jsxs)("div", {
className: x.default.teamTitleRow,
children: [
(0, r.jsx)("span", {
className: x.default.teamName,
children: a,
}),
l &&
(0, r.jsx)("span", {
className: x.default.teamDate,
children: new Date(l)
.toLocaleDateString("zh-CN", {
year: "numeric",
month: "2-digit",
day: "2-digit",
})
.replace(/\//g, "."),
}),
(0, r.jsxs)("button", {
className: x.default.inviteBtn,
type: "button",
onClick: () => t(e),
children: [
(0, r.jsx)(o.Icons.Copy, { width: 14, height: 14 }),
"去邀请",
],
}),
],
}),
(0, r.jsxs)("div", {
className: x.default.tableHeader,
children: [
(0, r.jsx)("span", {
className: x.default.colUser,
children: "被邀请用户",
}),
(0, r.jsx)("span", {
className: x.default.colType,
children: "购买类型",
}),
(0, r.jsx)("span", {
className: x.default.colTime,
children: "购买时间",
}),
(0, r.jsx)("span", {
className: x.default.colReward,
children: "获得次数",
}),
],
}),
],
}),
e.rewards?.map((e) => {
let t = h(e.bizData);
return (0, r.jsxs)(
"div",
{
className: x.default.memberRow,
children: [
(0, r.jsxs)("div", {
className: x.default.userCell,
children: [
(0, r.jsx)("img", {
alt: e.inviteeNickname || "",
className: x.default.avatar,
src: e.inviteeAvatar || "",
}),
(0, r.jsx)("span", {
className: x.default.nickname,
children: e.inviteeNickname || "用户",
}),
],
}),
(0, r.jsx)("span", {
className: x.default.typeCell,
children: t,
}),
(0, r.jsx)("span", {
className: x.default.timeCell,
children: e.createTime ? m(e.createTime) : "",
}),
(0, r.jsxs)("span", {
className: x.default.rewardCell,
children: ["+", e.rewardAmount],
}),
],
},
e.id,
);
}),
(0, r.jsxs)("div", {
className: x.default.memberRow,
children: [
(0, r.jsxs)("div", {
className: x.default.userCell,
children: [
(0, r.jsx)("img", {
alt: e.inviterNickname || "",
className: x.default.avatar,
src: e.inviterAvatar || "",
}),
(0, r.jsx)("span", {
className: x.default.nickname,
children: e.inviterNickname || "用户",
}),
(0, r.jsx)("span", {
className: x.default.leaderTag,
children: "管理员",
}),
],
}),
(0, r.jsx)("span", {
className: x.default.typeCell,
children: e.rewards?.[0] ? h(e.rewards[0].bizData) : "",
}),
(0, r.jsx)("span", {
className: x.default.timeCell,
children: e.rewards?.[0]?.createTime
? m(e.rewards[0].createTime)
: "",
}),
(0, r.jsxs)("span", {
className: x.default.rewardCell,
children: ["+", e.inviterRewardAmountTotal],
}),
],
}),
],
});
}
function f({ opened: e, onClose: t }) {
let [a, l] = (0, n.useState)(null),
[s, m] = (0, n.useState)(!1),
h = (0, n.useRef)(!1);
(0, n.useEffect)(() => {
if (!e) {
h.current = !1;
return;
}
if (h.current) return;
h.current = !0;
let t = !1;
return (
m(!0),
(0, d.getInviteCodeDetails)(u.TEAM_FISSION_BATCH_NO)
.then((e) => {
t || l(e?.data ?? null);
})
.catch(() => {})
.finally(() => {
t || m(!1);
}),
() => {
t = !0;
}
);
}, [e]);
let f = (0, n.useCallback)((e) => {
let t = e.inviteCode || e.rewards?.[0]?.inviteCode;
if (!t) return void c.Notify.warn("暂无邀请码");
let a = window.location.origin,
l = `${a}?invite=${t}`;
navigator.clipboard.writeText(l).then(
() => c.Notify.success("邀请链接已复制"),
() => c.Notify.error("复制失败,请手动复制"),
);
}, []),
g = a?.inviteCount ?? 0,
b = a?.rewardAmount ?? 0;
return (0, r.jsx)(i.Modal, {
centered: !0,
opened: e,
onClose: t,
withCloseButton: !1,
padding: 0,
radius: 16,
size: 720,
zIndex: "var(--z-modal)",
styles: {
content: {
background: "var(--bg-surface)",
border: "0.5px solid var(--border-default)",
overflow: "hidden",
},
body: { padding: 0 },
overlay: { backgroundColor: "rgba(0, 0, 0, 0.6)" },
},
children: (0, r.jsxs)("div", {
className: x.default.panel,
children: [
(0, r.jsxs)("div", {
className: x.default.header,
children: [
(0, r.jsx)("span", {
className: x.default.title,
children: "邀请明细",
}),
(0, r.jsx)("button", {
className: x.default.closeBtn,
type: "button",
onClick: t,
children: (0, r.jsx)(o.Icons.Close, {
width: 14,
height: 14,
}),
}),
],
}),
(0, r.jsxs)("div", {
className: x.default.banner,
children: [
(0, r.jsx)("span", {
className: x.default.bannerText,
children: "邀请同事加入团队,最高获得 1100 条 免费生成",
}),
(0, r.jsx)(v, {}),
],
}),
(0, r.jsxs)("div", {
className: x.default.statsRow,
children: [
(0, r.jsxs)("div", {
className: x.default.statCard,
children: [
(0, r.jsxs)("span", {
className: x.default.statValue,
children: [g, "人"],
}),
(0, r.jsx)("span", {
className: x.default.statLabel,
children: "累计邀请",
}),
],
}),
(0, r.jsxs)("div", {
className: x.default.statCard,
children: [
(0, r.jsxs)("span", {
className: x.default.statValue,
children: [b, "条"],
}),
(0, r.jsx)("span", {
className: x.default.statLabel,
children: "累计获得 Seedance 2.0 生成条数",
}),
],
}),
],
}),
(0, r.jsxs)("div", {
className: `${x.default.scrollArea} tiny-scrollbar`,
children: [
s &&
!a &&
(0, r.jsx)("div", {
style: {
padding: 24,
textAlign: "center",
color: "var(--fg-muted)",
},
children: "加载中...",
}),
a?.list?.map((e) =>
(0, r.jsx)(
p,
{ item: e, onCopyInviteCode: f },
e.inviterUserId,
),
),
a &&
a.list?.length === 0 &&
(0, r.jsx)("div", {
style: {
padding: 24,
textAlign: "center",
color: "var(--fg-muted)",
},
children: "暂无邀请记录",
}),
],
}),
],
}),
});
}
function v() {
let [e, t] = (0, n.useState)({ d: 0, h: 0, m: 0, s: 0 });
(0, n.useEffect)(() => {
function e() {
let e = new Date(),
t = Math.floor(
Math.max(
0,
new Date(
e.getFullYear(),
e.getMonth() + 1,
0,
23,
59,
59,
999,
).getTime() - e.getTime(),
) / 1e3,
);
return {
d: Math.floor(t / 86400),
h: Math.floor((t % 86400) / 3600),
m: Math.floor((t % 3600) / 60),
s: t % 60,
};
}
t(e());
let a = setInterval(() => t(e()), 1e3);
return () => clearInterval(a);
}, []);
let a = (e) => String(e).padStart(2, "0");
return (0, r.jsxs)("div", {
className: x.default.countdown,
children: [
(0, r.jsx)("span", {
className: x.default.countdownUnit,
children: a(e.d),
}),
(0, r.jsx)("span", {
className: x.default.countdownLabel,
children: "天",
}),
(0, r.jsx)("span", {
className: x.default.countdownUnit,
children: a(e.h),
}),
(0, r.jsx)("span", {
className: x.default.countdownLabel,
children: "时",
}),
(0, r.jsx)("span", {
className: x.default.countdownUnit,
children: a(e.m),
}),
(0, r.jsx)("span", {
className: x.default.countdownLabel,
children: "分",
}),
(0, r.jsx)("span", {
className: x.default.countdownUnit,
children: a(e.s),
}),
(0, r.jsx)("span", {
className: x.default.countdownLabel,
children: "秒",
}),
],
});
}
function g() {
return (g = Object.assign.bind()).apply(null, arguments);
}
function b() {
return (b = Object.assign.bind()).apply(null, arguments);
}
function w() {
return (w = Object.assign.bind()).apply(null, arguments);
}
e.s(["default", () => f], 646554),
e.s(
[
"default",
0,
function (e) {
return n.createElement(
"svg",
g(
{
xmlns: "http://www.w3.org/2000/svg",
width: 14,
height: 14,
fill: "none",
viewBox: "0 0 14 14",
},
e,
),
t ||
(t = n.createElement("path", {
fill: "currentColor",
d: "M4.829 11.082a.526.526 0 0 1 .695-.114l.043.031.125.092c.302.2.684.323 1.104.323.48 0 .909-.16 1.227-.415a.526.526 0 0 1 .655.82l-.096.075a3.03 3.03 0 0 1-1.786.57c-.716 0-1.377-.24-1.884-.645a.525.525 0 0 1-.083-.737M6.796.914c2.526 0 4.494 2.23 4.495 4.877v.007l-.015 1.212a3.33 3.33 0 0 0 .565 1.821c.19.284.17.62.079.857-.09.228-.33.55-.754.55H2.424c-.43 0-.669-.33-.755-.56-.09-.238-.108-.58.09-.866a3.2 3.2 0 0 0 .584-1.81v-.005l.014-1.274C2.36 3.113 4.302.914 6.796.914m0 1.05c-1.827 0-3.388 1.64-3.388 3.765v.004L3.393 7.01a4.2 4.2 0 0 1-.627 2.178h8.06a4.35 4.35 0 0 1-.6-2.184v-.006l.015-1.206-.006-.201c-.095-2.061-1.64-3.625-3.44-3.625",
})),
);
},
],
477714,
),
e.s(
[
"default",
0,
function (e) {
return n.createElement(
"svg",
b(
{
xmlns: "http://www.w3.org/2000/svg",
width: 14,
height: 14,
fill: "none",
viewBox: "0 0 14 14",
},
e,
),
a ||
(a = n.createElement("path", {
fill: "currentColor",
d: "M7 1.227a.525.525 0 0 1 .371.896 3.188 3.188 0 0 0 4.508 4.508.525.525 0 0 1 .896.37A5.776 5.776 0 1 1 7 1.228M5.87 2.415a4.73 4.73 0 0 0-3.235 2.78 4.725 4.725 0 1 0 8.951 2.937A4.236 4.236 0 0 1 5.87 2.415",
})),
);
},
],
650348,
),
e.s(
[
"default",
0,
function (e) {
return n.createElement(
"svg",
w(
{
xmlns: "http://www.w3.org/2000/svg",
width: 14,
height: 14,
fill: "none",
viewBox: "0 0 14 14",
},
e,
),
l ||
(l = n.createElement(
"g",
{ clipPath: "url(#sun-dim_svg__a)" },
n.createElement("path", {
fill: "#F7F7F7",
d: "M7.005 12.727a.637.637 0 0 1 0 1.272h-.009a.636.636 0 0 1 0-1.272zm-4.497-1.864a.636.636 0 0 1 0 1.273H2.5a.64.64 0 0 1-.638-.637c0-.351.287-.636.638-.636zm8.993 0c.351 0 .637.285.638.636a.64.64 0 0 1-.638.637h-.008a.637.637 0 0 1 0-1.273zM6.996 3.181a3.819 3.819 0 0 1 0 7.638 3.818 3.818 0 0 1 0-7.638m0 1.273a2.545 2.545 0 0 0 0 5.09 2.545 2.545 0 0 0 0-5.09M.645 6.364a.637.637 0 1 1 0 1.272H.637a.637.637 0 0 1 0-1.273zm12.72 0a.636.636 0 0 1 0 1.272h-.009a.637.637 0 0 1 0-1.273zm-10.857-4.5a.637.637 0 0 1 0 1.272H2.5a.64.64 0 0 1-.638-.636c0-.351.287-.637.638-.637zm8.993 0c.351 0 .638.285.638.636a.64.64 0 0 1-.638.636h-.008a.636.636 0 0 1 0-1.273zM7.005-.002a.637.637 0 0 1 0 1.273h-.009a.637.637 0 0 1 0-1.273z",
}),
)),
s ||
(s = n.createElement(
"defs",
null,
n.createElement(
"clipPath",
{ id: "sun-dim_svg__a" },
n.createElement("path", {
fill: "#fff",
d: "M0 0h14v14H0z",
}),
),
)),
);
},
],
313500,
);
};
export default moduleFactory;