@24city/web-console 0.3.6 → 0.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +65 -0
- package/GUIDELINES.md +29 -2
- package/README.md +3 -3
- package/dist/account/account-api.d.ts +7 -0
- package/dist/account/index.d.ts +1 -0
- package/dist/account/index.js +60 -59
- package/dist/account/use-show-once.d.ts +26 -0
- package/dist/chunks/{auth-provider-CqiyTeOt.js → auth-provider-7FOj7Y84.js} +1 -1
- package/dist/chunks/{console-layout-Os4sQzMP.js → console-layout-B4OlW1IZ.js} +1 -1
- package/dist/chunks/logout-signal-CLdquzzn.js +378 -0
- package/dist/chunks/{stale-build-DG-Tb2RA.js → stale-build-DwUlkKYm.js} +2 -2
- package/dist/chunks/text-link-WWzQqJ14.js +196 -0
- package/dist/chunks/use-show-once-Bz1ojVqb.js +768 -0
- package/dist/chunks/{wallet-badge-Dt8fv-Du.js → wallet-badge-COpdEDYI.js} +1 -1
- package/dist/chunks/waterfall-DOeGU8Zs.js +752 -0
- package/dist/index.js +197 -192
- package/dist/layout/index.js +1 -1
- package/dist/list/content-square.d.ts +36 -7
- package/dist/list/cover-tabs.d.ts +36 -0
- package/dist/list/filter-panel.d.ts +8 -5
- package/dist/list/index.d.ts +1 -0
- package/dist/list/index.js +26 -23
- package/dist/page/guide-modal.d.ts +37 -0
- package/dist/page/index.d.ts +1 -0
- package/dist/page/index.js +22 -21
- package/dist/runtime/index.js +2 -2
- package/dist/styles.css +820 -157
- package/dist/testing/fixtures.js +33 -27
- package/package.json +1 -1
- package/dist/chunks/logout-signal-CiD_zY5M.js +0 -365
- package/dist/chunks/text-link-Bb5f1eLW.js +0 -106
- package/dist/chunks/upgrade-modal-DyPkV9OB.js +0 -713
- package/dist/chunks/waterfall-ZMzEjGwK.js +0 -614
|
@@ -0,0 +1,768 @@
|
|
|
1
|
+
import { jsxs as o, jsx as e, Fragment as T } from "react/jsx-runtime";
|
|
2
|
+
import { Card as z, Button as v, Typography as ee, Tag as we, Skeleton as q, Banner as Re, RadioGroup as Oe, Avatar as De, Progress as Be, Space as ue, Modal as Ve } from "@douyinfe/semi-ui";
|
|
3
|
+
import { IconExternalOpen as Se, IconGift as je, IconRefresh as Pe, IconLock as qe, IconDesktop as He, IconUserGroup as Ce, IconShield as Ge, IconTick as se, IconMinus as Ye, IconCrown as Ke, IconUser as _e, IconChevronRight as Qe, IconExit as Je, IconClose as We } from "@douyinfe/semi-icons";
|
|
4
|
+
import { useParams as Xe, useNavigate as ie, useLocation as re, Navigate as oe } from "react-router";
|
|
5
|
+
import { S as Ze, F as te, e as j, c as et } from "./page-YBG0dEN1.js";
|
|
6
|
+
import { u as Y, a as D, b as R } from "./context-CaVim6ZO.js";
|
|
7
|
+
import { q as A, m as tt, u as ce, C as $e, i as nt, d as pe, r as ge } from "./logout-signal-CLdquzzn.js";
|
|
8
|
+
import { H as K, I as ke, q as Q, l as at, J as Le, m as ne, O as Ie, i as xe, r as le, g as H, n as Te, z as Ee, y as st, k as it, B as rt, w as ot, L as ct, M as lt, p as dt, h as ht, F as mt, s as ze, D as ut, G as _t, N as pt, x as gt } from "./wallet-badge-COpdEDYI.js";
|
|
9
|
+
import { L as de } from "./link-button-PqZcqU6s.js";
|
|
10
|
+
import { useState as ft, useRef as fe, useEffect as he, useSyncExternalStore as Nt, useCallback as Ne } from "react";
|
|
11
|
+
const bt = {
|
|
12
|
+
/** 统一资料(显示名称)、修改登录密码、登录设备与导出个人数据 */
|
|
13
|
+
settings: "/app/settings",
|
|
14
|
+
/** 当前空间在 24.city 各产品里的积分消耗 */
|
|
15
|
+
points: "/app/points",
|
|
16
|
+
/** 套餐和商品订单 */
|
|
17
|
+
orders: "/app/orders",
|
|
18
|
+
/** 加入的空间、团队成员与邀请 */
|
|
19
|
+
spaces: "/app/spaces"
|
|
20
|
+
}, Ae = (t) => {
|
|
21
|
+
const n = (t == null ? void 0 : t.trim()) ?? "";
|
|
22
|
+
if (!n) return null;
|
|
23
|
+
try {
|
|
24
|
+
const a = new URL(n);
|
|
25
|
+
return a.protocol !== "https:" && a.protocol !== "http:" ? null : `${a.origin}${a.pathname.replace(/\/+$/, "")}`;
|
|
26
|
+
} catch {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
}, G = (t, n) => {
|
|
30
|
+
const a = Ae(t);
|
|
31
|
+
return a ? `${a}${bt[n]}` : null;
|
|
32
|
+
}, ae = (t, n) => {
|
|
33
|
+
const a = Ae(t);
|
|
34
|
+
if (!a) return null;
|
|
35
|
+
const i = new URLSearchParams();
|
|
36
|
+
return n.productCode && i.set("product_code", n.productCode), i.set("return_url", n.returnUrl), n.spaceId && i.set("space_id", n.spaceId), n.spaceType && i.set("space_type", n.spaceType), n.priceCode && i.set("price_code", n.priceCode), `${a}/plans?${i.toString()}`;
|
|
37
|
+
}, yt = "_center_14d6l_7", vt = "_aside_14d6l_21", wt = "_identityCard_14d6l_27", St = "_identity_14d6l_27", Pt = "_identityAvatar_14d6l_42", Ct = "_identityText_14d6l_55", $t = "_identityName_14d6l_64", kt = "_identitySpace_14d6l_76", Lt = "_identitySpaceName_14d6l_91", It = "_identityRole_14d6l_98", xt = "_identityStats_14d6l_108", Tt = "_identityStat_14d6l_108", Et = "_identityStatLabel_14d6l_129", zt = "_identityStatValue_14d6l_135", At = "_nav_14d6l_147", Mt = "_navItem_14d6l_156", Ft = "_navIcon_14d6l_191", Ut = "_navLabel_14d6l_202", Rt = "_navArrow_14d6l_207", Ot = "_asideFoot_14d6l_223", Dt = "_logout_14d6l_228", Bt = "_main_14d6l_249", Vt = "_head_14d6l_262", jt = "_title_14d6l_268", qt = "_description_14d6l_277", Ht = "_card_14d6l_286", Gt = "_usage_14d6l_285", Yt = "_fields_14d6l_318", Kt = "_field_14d6l_318", Qt = "_fieldLabel_14d6l_331", Jt = "_fieldValue_14d6l_337", Wt = "_fieldText_14d6l_345", Xt = "_fieldMuted_14d6l_358", Zt = "_fieldHint_14d6l_364", en = "_mono_14d6l_370", tn = "_inlineTag_14d6l_379", nn = "_settingList_14d6l_384", an = "_settingRow_14d6l_389", sn = "_settingIcon_14d6l_405", rn = "_settingText_14d6l_418", on = "_settingTitle_14d6l_426", cn = "_settingDescription_14d6l_433", ln = "_settingAction_14d6l_439", dn = "_note_14d6l_443", hn = "_centerLink_14d6l_463", mn = "_centerLinkIcon_14d6l_469", un = "_heroCard_14d6l_477", _n = "_hero_14d6l_477", pn = "_heroMain_14d6l_501", gn = "_heroEyebrow_14d6l_510", fn = "_heroEyebrowText_14d6l_525", Nn = "_heroValue_14d6l_536", bn = "_heroMeta_14d6l_546", yn = "_heroActions_14d6l_560", vn = "_heroFoot_14d6l_569", wn = "_ownerOnly_14d6l_587", Sn = "_heroSkeleton_14d6l_709", s = {
|
|
38
|
+
center: yt,
|
|
39
|
+
aside: vt,
|
|
40
|
+
identityCard: wt,
|
|
41
|
+
identity: St,
|
|
42
|
+
identityAvatar: Pt,
|
|
43
|
+
identityText: Ct,
|
|
44
|
+
identityName: $t,
|
|
45
|
+
identitySpace: kt,
|
|
46
|
+
identitySpaceName: Lt,
|
|
47
|
+
identityRole: It,
|
|
48
|
+
identityStats: xt,
|
|
49
|
+
identityStat: Tt,
|
|
50
|
+
identityStatLabel: Et,
|
|
51
|
+
identityStatValue: zt,
|
|
52
|
+
nav: At,
|
|
53
|
+
navItem: Mt,
|
|
54
|
+
navIcon: Ft,
|
|
55
|
+
navLabel: Ut,
|
|
56
|
+
navArrow: Rt,
|
|
57
|
+
asideFoot: Ot,
|
|
58
|
+
logout: Dt,
|
|
59
|
+
main: Bt,
|
|
60
|
+
head: Vt,
|
|
61
|
+
title: jt,
|
|
62
|
+
description: qt,
|
|
63
|
+
card: Ht,
|
|
64
|
+
usage: Gt,
|
|
65
|
+
fields: Yt,
|
|
66
|
+
field: Kt,
|
|
67
|
+
fieldLabel: Qt,
|
|
68
|
+
fieldValue: Jt,
|
|
69
|
+
fieldText: Wt,
|
|
70
|
+
fieldMuted: Xt,
|
|
71
|
+
fieldHint: Zt,
|
|
72
|
+
mono: en,
|
|
73
|
+
inlineTag: tn,
|
|
74
|
+
settingList: nn,
|
|
75
|
+
settingRow: an,
|
|
76
|
+
settingIcon: sn,
|
|
77
|
+
settingText: rn,
|
|
78
|
+
settingTitle: on,
|
|
79
|
+
settingDescription: cn,
|
|
80
|
+
settingAction: ln,
|
|
81
|
+
note: dn,
|
|
82
|
+
centerLink: hn,
|
|
83
|
+
centerLinkIcon: mn,
|
|
84
|
+
heroCard: un,
|
|
85
|
+
hero: _n,
|
|
86
|
+
heroMain: pn,
|
|
87
|
+
heroEyebrow: gn,
|
|
88
|
+
heroEyebrowText: fn,
|
|
89
|
+
heroValue: Nn,
|
|
90
|
+
heroMeta: bn,
|
|
91
|
+
heroActions: yn,
|
|
92
|
+
heroFoot: vn,
|
|
93
|
+
ownerOnly: wn,
|
|
94
|
+
heroSkeleton: Sn
|
|
95
|
+
}, M = ({
|
|
96
|
+
href: t,
|
|
97
|
+
children: n,
|
|
98
|
+
type: a = "secondary",
|
|
99
|
+
size: i = "default",
|
|
100
|
+
label: r
|
|
101
|
+
}) => t ? /* @__PURE__ */ o(
|
|
102
|
+
de,
|
|
103
|
+
{
|
|
104
|
+
theme: a === "primary" ? "solid" : a === "text" ? "borderless" : "light",
|
|
105
|
+
type: a === "primary" ? "primary" : "tertiary",
|
|
106
|
+
size: i,
|
|
107
|
+
href: t,
|
|
108
|
+
target: "_blank",
|
|
109
|
+
"aria-label": r,
|
|
110
|
+
className: s.centerLink,
|
|
111
|
+
children: [
|
|
112
|
+
n,
|
|
113
|
+
/* @__PURE__ */ e(Se, { className: s.centerLinkIcon, "aria-hidden": "true" })
|
|
114
|
+
]
|
|
115
|
+
}
|
|
116
|
+
) : null, W = ({
|
|
117
|
+
icon: t,
|
|
118
|
+
title: n,
|
|
119
|
+
description: a,
|
|
120
|
+
action: i
|
|
121
|
+
}) => /* @__PURE__ */ o("div", { className: s.settingRow, children: [
|
|
122
|
+
/* @__PURE__ */ e("span", { className: s.settingIcon, "aria-hidden": "true", children: t }),
|
|
123
|
+
/* @__PURE__ */ o("div", { className: s.settingText, children: [
|
|
124
|
+
/* @__PURE__ */ e("span", { className: s.settingTitle, children: n }),
|
|
125
|
+
/* @__PURE__ */ e("span", { className: s.settingDescription, children: a })
|
|
126
|
+
] }),
|
|
127
|
+
i ? /* @__PURE__ */ e("div", { className: s.settingAction, children: i }) : null
|
|
128
|
+
] }), Pn = ({ data: t }) => {
|
|
129
|
+
var g;
|
|
130
|
+
const n = Y(), { PointsDetail: a } = D(), { session: i, activeSpace: r, activeSpaceId: c, globalUserId: l, wallet: d } = t, p = G(i == null ? void 0 : i.accountCenterUrl, "points"), _ = r ? K(r) : "当前空间", m = (g = d.data) == null ? void 0 : g.availablePoints;
|
|
131
|
+
return /* @__PURE__ */ o(T, { children: [
|
|
132
|
+
/* @__PURE__ */ o(z, { className: s.heroCard, bordered: !1, bodyStyle: { padding: 0 }, children: [
|
|
133
|
+
/* @__PURE__ */ o("div", { className: s.hero, "data-tone": "primary", children: [
|
|
134
|
+
/* @__PURE__ */ o("div", { className: s.heroMain, children: [
|
|
135
|
+
/* @__PURE__ */ o("span", { className: s.heroEyebrow, title: _, children: [
|
|
136
|
+
/* @__PURE__ */ e(je, { "aria-hidden": "true" }),
|
|
137
|
+
/* @__PURE__ */ o("span", { className: s.heroEyebrowText, children: [
|
|
138
|
+
"可用积分 · ",
|
|
139
|
+
_
|
|
140
|
+
] })
|
|
141
|
+
] }),
|
|
142
|
+
/* @__PURE__ */ e("span", { className: s.heroValue, "aria-live": "polite", children: d.isPending ? "读取中" : d.isError || m === void 0 ? "暂不可用" : A(m) }),
|
|
143
|
+
/* @__PURE__ */ e("span", { className: s.heroMeta, children: "积分属于当前空间,24.city 各产品共用。" })
|
|
144
|
+
] }),
|
|
145
|
+
/* @__PURE__ */ o("div", { className: s.heroActions, children: [
|
|
146
|
+
/* @__PURE__ */ e(v, { theme: "light", type: "tertiary", icon: /* @__PURE__ */ e(Pe, { "aria-hidden": "true" }), disabled: d.isFetching, onClick: () => void d.refetch(), children: "刷新" }),
|
|
147
|
+
/* @__PURE__ */ e(M, { type: "primary", href: p, label: "全部积分消耗(在统一账号中心打开)", children: "全部积分消耗" })
|
|
148
|
+
] })
|
|
149
|
+
] }),
|
|
150
|
+
/* @__PURE__ */ e("div", { className: s.heroFoot, children: /* @__PURE__ */ e("span", { children: a ? `下面是你本人在 ${n.shortName} 里的扣费明细;当前空间在 24.city 各产品里的全部积分消耗,请到统一账号中心查看。` : "当前空间在 24.city 各产品里的全部积分消耗,请到统一账号中心查看。" }) })
|
|
151
|
+
] }),
|
|
152
|
+
a ? /* @__PURE__ */ e("div", { className: s.usage, children: /* @__PURE__ */ e(a, { activeSpaceId: c, globalUserId: l }) }) : null
|
|
153
|
+
] });
|
|
154
|
+
}, V = ({ label: t, children: n, hint: a }) => /* @__PURE__ */ o("div", { className: s.field, children: [
|
|
155
|
+
/* @__PURE__ */ e("span", { className: s.fieldLabel, children: t }),
|
|
156
|
+
/* @__PURE__ */ o("div", { className: s.fieldValue, children: [
|
|
157
|
+
n,
|
|
158
|
+
a ? /* @__PURE__ */ e("span", { className: s.fieldHint, children: a }) : null
|
|
159
|
+
] })
|
|
160
|
+
] }), Cn = ({ data: t }) => {
|
|
161
|
+
var g;
|
|
162
|
+
const n = Y(), { session: a, activeSpace: i, profile: r, globalUserId: c } = t, l = a == null ? void 0 : a.accountCenterUrl, d = ((g = r.data) == null ? void 0 : g.nickName) ?? "", p = ke(i == null ? void 0 : i.role), _ = G(l, "settings"), m = G(l, "spaces");
|
|
163
|
+
return /* @__PURE__ */ o(T, { children: [
|
|
164
|
+
/* @__PURE__ */ e(z, { title: "账号信息", className: s.card, bordered: !1, headerLine: !1, children: /* @__PURE__ */ o("div", { className: s.fields, children: [
|
|
165
|
+
/* @__PURE__ */ e(V, { label: "昵称", hint: `首次登录 ${n.shortName} 时从统一账号带来`, children: /* @__PURE__ */ e("span", { className: s.fieldText, children: d || (r.isPending ? "读取中" : "未设置") }) }),
|
|
166
|
+
/* @__PURE__ */ e(V, { label: "统一账号 ID", hint: "联系客服时可以提供", children: /* @__PURE__ */ e(ee.Text, { copyable: { copyTip: "复制", successTip: "已复制" }, className: s.mono, children: c }) }),
|
|
167
|
+
/* @__PURE__ */ e(V, { label: "当前空间", children: /* @__PURE__ */ o("span", { className: s.fieldText, children: [
|
|
168
|
+
i ? K(i) : "暂不可用",
|
|
169
|
+
i && Q(i) ? /* @__PURE__ */ e(we, { size: "small", color: "blue", className: s.inlineTag, children: "团队" }) : null,
|
|
170
|
+
p ? /* @__PURE__ */ o("span", { className: s.fieldMuted, children: [
|
|
171
|
+
"· 我是",
|
|
172
|
+
p
|
|
173
|
+
] }) : null
|
|
174
|
+
] }) }),
|
|
175
|
+
/* @__PURE__ */ e(V, { label: "本次登录有效至", hint: "到期后重新登录即可", children: /* @__PURE__ */ e("span", { className: s.fieldText, children: a ? tt(a.absoluteExpiresAt) : "暂无" }) })
|
|
176
|
+
] }) }),
|
|
177
|
+
/* @__PURE__ */ o(z, { title: "登录与安全", className: s.card, bordered: !1, headerLine: !1, children: [
|
|
178
|
+
/* @__PURE__ */ o("div", { className: s.settingList, children: [
|
|
179
|
+
/* @__PURE__ */ e(
|
|
180
|
+
W,
|
|
181
|
+
{
|
|
182
|
+
icon: /* @__PURE__ */ e(qe, {}),
|
|
183
|
+
title: "登录密码",
|
|
184
|
+
description: "验证已绑定的手机号后修改。改完后,24.city 所有产品都用新密码登录。",
|
|
185
|
+
action: /* @__PURE__ */ e(M, { href: _, label: "修改密码(在统一账号中心打开)", children: "修改密码" })
|
|
186
|
+
}
|
|
187
|
+
),
|
|
188
|
+
/* @__PURE__ */ e(
|
|
189
|
+
W,
|
|
190
|
+
{
|
|
191
|
+
icon: /* @__PURE__ */ e(He, {}),
|
|
192
|
+
title: "登录设备与个人数据",
|
|
193
|
+
description: "查看登录过的设备,导出你的个人数据。",
|
|
194
|
+
action: /* @__PURE__ */ e(M, { href: _, label: "查看登录设备(在统一账号中心打开)", children: "前往查看" })
|
|
195
|
+
}
|
|
196
|
+
),
|
|
197
|
+
/* @__PURE__ */ e(
|
|
198
|
+
W,
|
|
199
|
+
{
|
|
200
|
+
icon: /* @__PURE__ */ e(Ce, {}),
|
|
201
|
+
title: "空间与成员",
|
|
202
|
+
description: "查看你加入的空间;团队所有者和管理员在这里邀请、管理成员。",
|
|
203
|
+
action: /* @__PURE__ */ e(M, { href: m, label: "管理空间与成员(在统一账号中心打开)", children: "前往管理" })
|
|
204
|
+
}
|
|
205
|
+
)
|
|
206
|
+
] }),
|
|
207
|
+
/* @__PURE__ */ o("div", { className: s.note, children: [
|
|
208
|
+
/* @__PURE__ */ e(Ge, { "aria-hidden": "true" }),
|
|
209
|
+
/* @__PURE__ */ e("span", { children: _ ? `${n.shortName} 使用 24.city 统一账号登录,不保存你的密码和验证码。以上设置在统一账号中心修改,所有产品同步生效。` : "统一账号中心的地址暂时不可用,请稍后刷新页面再试。" })
|
|
210
|
+
] })
|
|
211
|
+
] })
|
|
212
|
+
] });
|
|
213
|
+
}, X = {
|
|
214
|
+
free: { tone: "basic", tagline: "先免费体验", benefits: [] },
|
|
215
|
+
standard: { tone: "standard", badge: "推荐", tagline: "个人用户的常用之选", benefits: ["按积分扣费,用多少扣多少"] },
|
|
216
|
+
pro: { tone: "pro", tagline: "高频使用,积分更充足", benefits: ["每月积分更多,适合批量使用"] }
|
|
217
|
+
}, $n = {
|
|
218
|
+
tone: "team",
|
|
219
|
+
tagline: "团队一起用,套餐和积分共用",
|
|
220
|
+
benefits: ["成员共用套餐和积分"]
|
|
221
|
+
}, kn = (t, n) => t.spaceType === "team" ? n.teamPlanCopy ?? $n : t.isDefault || t.tier <= 0 ? X.free : t.tier === 1 ? X.standard : X.pro, Me = (t, n = {}) => {
|
|
222
|
+
var a;
|
|
223
|
+
return ((a = n.planCopy) == null ? void 0 : a[t.code]) ?? kn(t, n);
|
|
224
|
+
}, Fe = (t, n = [], a = {}) => {
|
|
225
|
+
const i = [], r = (c, l = !0) => {
|
|
226
|
+
i.some((d) => d.text === c) || i.push({ text: c, included: l });
|
|
227
|
+
};
|
|
228
|
+
t.monthlyPoints > 0 && r(t.isDefault ? `每月赠送 ${A(t.monthlyPoints)} 积分` : `每月 ${A(t.monthlyPoints)} 积分`), t.spaceType === "team" && t.includedSeats > 0 && r(`含 ${A(t.includedSeats)} 个成员席位`);
|
|
229
|
+
for (const c of at(t, n, a)) r(c.text, c.included);
|
|
230
|
+
for (const c of Me(t, a).benefits) r(c);
|
|
231
|
+
return i;
|
|
232
|
+
}, Ln = (t, n) => t.prices.filter((r) => r.billingPeriod === n && r.amountCents > 0).reduce((r, c) => !r || c.amountCents < r.amountCents ? c : r, null) ?? Le(t), In = (t, n) => {
|
|
233
|
+
if (n.billingPeriod !== "year") return "";
|
|
234
|
+
const a = ne({ amountCents: Math.round(n.amountCents / 12), currency: n.currency }), i = t.prices.find((c) => c.billingPeriod === "month" && c.currency === n.currency && c.amountCents > 0), r = i ? i.amountCents * 12 - n.amountCents : 0;
|
|
235
|
+
return r > 0 ? `约 ${a}/月 · 比月付省 ${ne({ amountCents: r, currency: n.currency })}` : `约 ${a}/月`;
|
|
236
|
+
}, xn = "_subtitle_m4zgm_7", Tn = "_grid_m4zgm_16", En = "_skeleton_m4zgm_22", zn = "_card_m4zgm_30", An = "_section_m4zgm_62", Mn = "_badge_m4zgm_90", Fn = "_top_m4zgm_109", Un = "_art_m4zgm_139", Rn = "_name_m4zgm_160", On = "_tagline_m4zgm_178", Dn = "_price_m4zgm_195", Bn = "_amount_m4zgm_202", Vn = "_period_m4zgm_218", jn = "_priceNote_m4zgm_227", qn = "_body_m4zgm_244", Hn = "_benefits_m4zgm_252", Gn = "_benefit_m4zgm_252", Yn = "_check_m4zgm_268", Kn = "_action_m4zgm_304", Qn = "_cta_m4zgm_304", Jn = "_ctaCurrent_m4zgm_345", Wn = "_ctaNote_m4zgm_354", u = {
|
|
237
|
+
subtitle: xn,
|
|
238
|
+
grid: Tn,
|
|
239
|
+
skeleton: En,
|
|
240
|
+
card: zn,
|
|
241
|
+
section: An,
|
|
242
|
+
badge: Mn,
|
|
243
|
+
top: Fn,
|
|
244
|
+
art: Un,
|
|
245
|
+
name: Rn,
|
|
246
|
+
tagline: On,
|
|
247
|
+
price: Dn,
|
|
248
|
+
amount: Bn,
|
|
249
|
+
period: Vn,
|
|
250
|
+
priceNote: jn,
|
|
251
|
+
body: qn,
|
|
252
|
+
benefits: Hn,
|
|
253
|
+
benefit: Gn,
|
|
254
|
+
check: Yn,
|
|
255
|
+
action: Kn,
|
|
256
|
+
cta: Qn,
|
|
257
|
+
ctaCurrent: Jn,
|
|
258
|
+
ctaNote: Wn
|
|
259
|
+
}, Xn = { month: "/月", year: "/年", one_time: "" }, Zn = [
|
|
260
|
+
{ label: "按月付", value: "month" },
|
|
261
|
+
{ label: "按年付", value: "year" }
|
|
262
|
+
], be = (t, n) => t.some((a) => a.prices.some((i) => i.billingPeriod === n && i.amountCents > 0)), ea = ({
|
|
263
|
+
plan: t,
|
|
264
|
+
price: n,
|
|
265
|
+
catalog: a,
|
|
266
|
+
current: i,
|
|
267
|
+
focus: r,
|
|
268
|
+
action: c,
|
|
269
|
+
custom: l
|
|
270
|
+
}) => {
|
|
271
|
+
const d = Me(t, l), p = n ? In(t, n) : "长期有效", _ = d.badge ?? (r ? "推荐升级" : void 0);
|
|
272
|
+
return /* @__PURE__ */ o(
|
|
273
|
+
"div",
|
|
274
|
+
{
|
|
275
|
+
className: u.card,
|
|
276
|
+
"data-tone": d.tone,
|
|
277
|
+
"data-current": i ? "true" : "false",
|
|
278
|
+
"data-focus": r && !i ? "true" : "false",
|
|
279
|
+
role: "group",
|
|
280
|
+
"aria-label": t.name,
|
|
281
|
+
children: [
|
|
282
|
+
i ? /* @__PURE__ */ e("span", { className: u.badge, "data-kind": "current", children: "当前套餐" }) : _ ? /* @__PURE__ */ e("span", { className: u.badge, children: _ }) : null,
|
|
283
|
+
/* @__PURE__ */ o("div", { className: d.tone === "pro" ? `${u.top} semi-always-light` : u.top, children: [
|
|
284
|
+
/* @__PURE__ */ e("span", { className: u.art, "aria-hidden": "true" }),
|
|
285
|
+
/* @__PURE__ */ e("span", { className: u.name, children: t.name }),
|
|
286
|
+
/* @__PURE__ */ e("span", { className: u.tagline, children: d.tagline }),
|
|
287
|
+
/* @__PURE__ */ e("span", { className: u.price, children: n ? /* @__PURE__ */ o(T, { children: [
|
|
288
|
+
/* @__PURE__ */ e("span", { className: u.amount, children: ne(n) }),
|
|
289
|
+
/* @__PURE__ */ e("span", { className: u.period, children: Xn[n.billingPeriod] })
|
|
290
|
+
] }) : /* @__PURE__ */ e("span", { className: u.amount, children: "免费" }) }),
|
|
291
|
+
/* @__PURE__ */ e("span", { className: u.priceNote, children: p || " " })
|
|
292
|
+
] }),
|
|
293
|
+
/* @__PURE__ */ o("div", { className: u.body, children: [
|
|
294
|
+
/* @__PURE__ */ e("div", { className: u.benefits, role: "list", "aria-label": `${t.name}权益`, children: Fe(t, a, l).map((m) => /* @__PURE__ */ o("div", { className: u.benefit, "data-included": m.included ? "true" : "false", role: "listitem", children: [
|
|
295
|
+
/* @__PURE__ */ e("span", { className: u.check, "aria-hidden": "true", children: m.included ? /* @__PURE__ */ e(se, {}) : /* @__PURE__ */ e(Ye, {}) }),
|
|
296
|
+
/* @__PURE__ */ e("span", { children: m.text })
|
|
297
|
+
] }, m.text)) }),
|
|
298
|
+
/* @__PURE__ */ e("div", { className: u.action, children: c })
|
|
299
|
+
] })
|
|
300
|
+
]
|
|
301
|
+
}
|
|
302
|
+
);
|
|
303
|
+
}, ta = ({ data: t, focusPlan: n }) => {
|
|
304
|
+
const { config: a } = R(), i = D(), { session: r, activeSpace: c, activeSpaceId: l, subscription: d, wallet: p, allowed: _ } = t, m = Ie(_), [g, f] = ft("month"), C = c ? Q(c) : !1, I = xe(c), $ = d.isError && le(d.error), P = d.data ?? null, y = (m.data ?? []).filter((h) => h.spaceType === (C ? "team" : "personal")), F = `${window.location.origin}${H(a.routes.app, "subscription")}`, k = (h) => {
|
|
305
|
+
var L;
|
|
306
|
+
return ae(r == null ? void 0 : r.accountCenterUrl, { productCode: (L = p.data) == null ? void 0 : L.productCode, returnUrl: F, spaceId: C ? l : void 0, priceCode: h });
|
|
307
|
+
}, w = be(y, "month") && be(y, "year"), x = fe(null), E = fe(!1), b = !!(n && y.some((h) => h.code === n));
|
|
308
|
+
he(() => {
|
|
309
|
+
var h, L;
|
|
310
|
+
!b || E.current || (E.current = !0, (L = (h = x.current) == null ? void 0 : h.scrollIntoView) == null || L.call(h, { behavior: "smooth", block: "start" }));
|
|
311
|
+
}, [b]);
|
|
312
|
+
const J = (h, L, O) => {
|
|
313
|
+
if (h.isDefault || !L)
|
|
314
|
+
return O ? /* @__PURE__ */ e(v, { theme: "light", type: "tertiary", block: !0, disabled: !0, className: u.ctaCurrent, children: "正在使用" }) : /* @__PURE__ */ e("span", { className: u.ctaNote, children: "会员到期后回到免费版" });
|
|
315
|
+
if (!I) return /* @__PURE__ */ e("span", { className: u.ctaNote, children: $ ? "请团队所有者续费" : "请团队所有者购买" });
|
|
316
|
+
const B = O ? "续费" : $ ? `续费${h.name}` : !P || P.isDefault ? "立即开通" : h.tier > P.tier ? `升级到${h.name}` : `选择${h.name}`, me = k(L.code);
|
|
317
|
+
if (!me) return null;
|
|
318
|
+
const Ue = B.includes(h.name) ? B : `${B}${h.name}`;
|
|
319
|
+
return /* @__PURE__ */ e(de, { block: !0, className: u.cta, href: me, target: "_blank", "aria-label": `${Ue}(在统一账号中心打开)`, children: B });
|
|
320
|
+
};
|
|
321
|
+
return m.isPending ? /* @__PURE__ */ e(z, { title: "会员套餐", className: s.card, bordered: !1, headerLine: !1, children: /* @__PURE__ */ e("div", { className: u.grid, children: [0, 1, 2].map((h) => /* @__PURE__ */ e("div", { className: u.skeleton, children: /* @__PURE__ */ e(q, { loading: !0, active: !0, placeholder: /* @__PURE__ */ e(q.Paragraph, { rows: 4 }) }) }, h)) }) }) : m.isError ? /* @__PURE__ */ e(z, { title: "会员套餐", className: s.card, bordered: !1, headerLine: !1, children: /* @__PURE__ */ e(Re, { type: "info", fullMode: !1, closeIcon: null, description: "暂时读不到套餐价格,可以在统一账号中心查看全部套餐。", children: /* @__PURE__ */ e(M, { size: "small", href: k(), label: "查看全部套餐(在统一账号中心打开)", children: "查看全部套餐" }) }) }) : y.length ? /* @__PURE__ */ e("div", { ref: x, children: /* @__PURE__ */ o(
|
|
322
|
+
z,
|
|
323
|
+
{
|
|
324
|
+
title: "会员套餐",
|
|
325
|
+
className: `${s.card} ${u.section}`,
|
|
326
|
+
bordered: !1,
|
|
327
|
+
headerLine: !1,
|
|
328
|
+
headerExtraContent: w ? /* @__PURE__ */ e(
|
|
329
|
+
Oe,
|
|
330
|
+
{
|
|
331
|
+
type: "button",
|
|
332
|
+
buttonSize: "small",
|
|
333
|
+
options: Zn,
|
|
334
|
+
value: g,
|
|
335
|
+
onChange: (h) => f(h.target.value),
|
|
336
|
+
"aria-label": "付费周期"
|
|
337
|
+
}
|
|
338
|
+
) : null,
|
|
339
|
+
children: [
|
|
340
|
+
/* @__PURE__ */ e("span", { className: u.subtitle, children: "价格取自 24.city 统一账号中心,点按钮去统一账号中心付款,付款后回到这里。" }),
|
|
341
|
+
/* @__PURE__ */ e("div", { className: u.grid, children: y.map((h) => {
|
|
342
|
+
const L = Ln(h, g), O = !!(P && P.planCode === h.code);
|
|
343
|
+
return /* @__PURE__ */ e(
|
|
344
|
+
ea,
|
|
345
|
+
{
|
|
346
|
+
plan: h,
|
|
347
|
+
price: L,
|
|
348
|
+
catalog: m.data ?? [],
|
|
349
|
+
current: O,
|
|
350
|
+
focus: h.code === n,
|
|
351
|
+
action: J(h, L, O),
|
|
352
|
+
custom: i
|
|
353
|
+
},
|
|
354
|
+
h.code
|
|
355
|
+
);
|
|
356
|
+
}) })
|
|
357
|
+
]
|
|
358
|
+
}
|
|
359
|
+
) }) : null;
|
|
360
|
+
}, na = "_team_13j8p_7", aa = "_art_13j8p_22", sa = "_text_13j8p_30", ia = "_eyebrow_13j8p_39", ra = "_title_13j8p_49", oa = "_description_13j8p_57", ca = "_highlights_13j8p_63", la = "_highlight_13j8p_63", da = "_highlightIcon_13j8p_83", ha = "_action_13j8p_88", ma = "_cta_13j8p_96", ua = "_ctaIcon_13j8p_116", _a = "_price_13j8p_121", S = {
|
|
361
|
+
team: na,
|
|
362
|
+
art: aa,
|
|
363
|
+
text: sa,
|
|
364
|
+
eyebrow: ia,
|
|
365
|
+
title: ra,
|
|
366
|
+
description: oa,
|
|
367
|
+
highlights: ca,
|
|
368
|
+
highlight: la,
|
|
369
|
+
highlightIcon: da,
|
|
370
|
+
action: ha,
|
|
371
|
+
cta: ma,
|
|
372
|
+
ctaIcon: ua,
|
|
373
|
+
price: _a
|
|
374
|
+
}, pa = ({ href: t, plan: n }) => {
|
|
375
|
+
const a = Y(), { teamPromoHighlights: i = [] } = D(), r = n ? Le(n) : null, c = [
|
|
376
|
+
n && n.includedSeats > 0 ? `含 ${A(n.includedSeats)} 个成员席位` : "",
|
|
377
|
+
n && n.monthlyPoints > 0 ? `每月 ${A(n.monthlyPoints)} 积分` : "",
|
|
378
|
+
"套餐和积分团队共用",
|
|
379
|
+
...i
|
|
380
|
+
].filter(Boolean);
|
|
381
|
+
return /* @__PURE__ */ o("section", { className: S.team, "aria-label": "开通团队版", children: [
|
|
382
|
+
/* @__PURE__ */ e("span", { className: S.art, "aria-hidden": "true" }),
|
|
383
|
+
/* @__PURE__ */ o("div", { className: S.text, children: [
|
|
384
|
+
/* @__PURE__ */ e("span", { className: S.eyebrow, children: "团队版" }),
|
|
385
|
+
/* @__PURE__ */ o("span", { className: S.title, children: [
|
|
386
|
+
"和同事一起用 ",
|
|
387
|
+
a.shortName
|
|
388
|
+
] }),
|
|
389
|
+
/* @__PURE__ */ e("span", { className: S.description, children: "开通团队版会创建一个团队空间,你是所有者;套餐、席位和积分归团队共用。" }),
|
|
390
|
+
/* @__PURE__ */ e("div", { className: S.highlights, role: "list", "aria-label": "团队版要点", children: c.map((l) => /* @__PURE__ */ o("span", { className: S.highlight, role: "listitem", children: [
|
|
391
|
+
/* @__PURE__ */ e(se, { className: S.highlightIcon, "aria-hidden": "true" }),
|
|
392
|
+
l
|
|
393
|
+
] }, l)) })
|
|
394
|
+
] }),
|
|
395
|
+
t ? /* @__PURE__ */ o("div", { className: S.action, children: [
|
|
396
|
+
/* @__PURE__ */ o(de, { className: S.cta, href: t, target: "_blank", "aria-label": "开通团队版(在统一账号中心打开)", children: [
|
|
397
|
+
"开通团队版",
|
|
398
|
+
/* @__PURE__ */ e(Se, { className: S.ctaIcon, "aria-hidden": "true" })
|
|
399
|
+
] }),
|
|
400
|
+
r ? /* @__PURE__ */ o("span", { className: S.price, children: [
|
|
401
|
+
Te(r),
|
|
402
|
+
"起"
|
|
403
|
+
] }) : null
|
|
404
|
+
] }) : null
|
|
405
|
+
] });
|
|
406
|
+
}, ga = ({ data: t, focusPlan: n }) => {
|
|
407
|
+
var E;
|
|
408
|
+
const { config: a } = R(), { session: i, activeSpace: r, activeSpaceId: c, wallet: l, subscription: d, allowed: p } = t, _ = Ie(p), m = i == null ? void 0 : i.accountCenterUrl, g = r ? Q(r) : !1, f = xe(r), C = r ? K(r) : "当前空间", I = `${window.location.origin}${H(a.routes.app, "subscription")}`, $ = (E = l.data) == null ? void 0 : E.productCode, P = ae(m, { productCode: $, returnUrl: I, spaceId: g ? c : void 0 }), y = ae(m, { productCode: $, returnUrl: I, spaceType: "team" }), F = G(m, "orders"), k = d.isError && le(d.error), w = d.data, x = (b) => f ? /* @__PURE__ */ e(M, { type: "primary", href: P, label: `${b}(在统一账号中心打开)`, children: b }) : /* @__PURE__ */ e("span", { className: s.ownerOnly, children: k ? "请团队所有者续费" : "请团队所有者购买" });
|
|
409
|
+
return /* @__PURE__ */ o(T, { children: [
|
|
410
|
+
/* @__PURE__ */ o(z, { className: s.heroCard, bordered: !1, bodyStyle: { padding: 0 }, children: [
|
|
411
|
+
/* @__PURE__ */ o("div", { className: s.hero, "data-tone": k ? "warning" : "primary", children: [
|
|
412
|
+
/* @__PURE__ */ o("div", { className: s.heroMain, children: [
|
|
413
|
+
/* @__PURE__ */ o("span", { className: s.heroEyebrow, title: C, children: [
|
|
414
|
+
/* @__PURE__ */ e(Ke, { "aria-hidden": "true" }),
|
|
415
|
+
/* @__PURE__ */ o("span", { className: s.heroEyebrowText, children: [
|
|
416
|
+
"当前套餐 · ",
|
|
417
|
+
C
|
|
418
|
+
] })
|
|
419
|
+
] }),
|
|
420
|
+
d.isPending ? /* @__PURE__ */ e(q, { loading: !0, active: !0, placeholder: /* @__PURE__ */ e(q.Paragraph, { rows: 2, className: s.heroSkeleton }) }) : k ? /* @__PURE__ */ o(T, { children: [
|
|
421
|
+
/* @__PURE__ */ e("span", { className: s.heroValue, children: "团队版已到期" }),
|
|
422
|
+
/* @__PURE__ */ e("span", { className: s.heroMeta, children: "该团队的团队版已到期,请在统一账号中心续费后再使用,续费后成员继续共用套餐和积分。" })
|
|
423
|
+
] }) : d.isError ? /* @__PURE__ */ o(T, { children: [
|
|
424
|
+
/* @__PURE__ */ e("span", { className: s.heroValue, children: "暂不可用" }),
|
|
425
|
+
/* @__PURE__ */ e("span", { className: s.heroMeta, children: "暂时读不到当前套餐,请稍后重试。" })
|
|
426
|
+
] }) : w ? /* @__PURE__ */ o(T, { children: [
|
|
427
|
+
/* @__PURE__ */ e("span", { className: s.heroValue, children: Ee(w) }),
|
|
428
|
+
/* @__PURE__ */ o("span", { className: s.heroMeta, children: [
|
|
429
|
+
/* @__PURE__ */ e(we, { size: "small", color: "green", children: "生效中" }),
|
|
430
|
+
st(w)
|
|
431
|
+
] })
|
|
432
|
+
] }) : /* @__PURE__ */ o(T, { children: [
|
|
433
|
+
/* @__PURE__ */ e("span", { className: s.heroValue, children: "未开通" }),
|
|
434
|
+
/* @__PURE__ */ e("span", { className: s.heroMeta, children: "当前空间还没有生效的套餐。" })
|
|
435
|
+
] })
|
|
436
|
+
] }),
|
|
437
|
+
/* @__PURE__ */ o("div", { className: s.heroActions, children: [
|
|
438
|
+
d.isError && !k ? /* @__PURE__ */ e(v, { theme: "light", type: "tertiary", icon: /* @__PURE__ */ e(Pe, { "aria-hidden": "true" }), onClick: () => void d.refetch(), children: "重试" }) : null,
|
|
439
|
+
d.isPending ? null : k ? x("续费团队版") : w && !w.isDefault ? x("续费或升级") : x(w ? "升级套餐" : "选择套餐")
|
|
440
|
+
] })
|
|
441
|
+
] }),
|
|
442
|
+
/* @__PURE__ */ o("div", { className: s.heroFoot, children: [
|
|
443
|
+
/* @__PURE__ */ e("span", { children: "套餐属于当前空间,对 24.city 所有产品同时生效;购买、续费和发票在统一账号中心办理。" }),
|
|
444
|
+
/* @__PURE__ */ e(M, { type: "text", size: "small", href: F, label: "订单记录(在统一账号中心打开)", children: "订单记录" })
|
|
445
|
+
] })
|
|
446
|
+
] }),
|
|
447
|
+
/* @__PURE__ */ e(ta, { data: t, focusPlan: n }),
|
|
448
|
+
r && !g ? /* @__PURE__ */ e(pa, { href: y, plan: it(_.data) }) : null
|
|
449
|
+
] });
|
|
450
|
+
}, fa = ({ subscription: t }) => t.isPending ? "读取中" : t.isError ? le(t.error) ? "团队版已到期" : "暂不可用" : t.data ? Ee(t.data) : "未开通", Na = ({ wallet: t }) => t.isPending ? "读取中" : t.data ? A(t.data.availablePoints) : "暂不可用", is = () => {
|
|
451
|
+
var E;
|
|
452
|
+
const { section: t = "" } = Xe(), { config: n } = R(), a = Y(), i = D(), { PointsDetail: r } = i, c = rt(i), l = c.find((b) => b.key === t), d = ie(), p = ot(re().state), _ = ct(), { confirmLogout: m, pending: g } = lt(), f = n.routes.app;
|
|
453
|
+
if (!dt(t) && !l) return /* @__PURE__ */ e(oe, { replace: !0, to: H(f, "profile") });
|
|
454
|
+
const C = {
|
|
455
|
+
profile: "你的统一账号与当前空间。密码、登录设备和团队成员在 24.city 统一账号中心管理,所有产品同步生效。",
|
|
456
|
+
subscription: "当前空间的套餐与权益,以统一账号中心为准;购买、续费和升级都在统一账号中心完成。",
|
|
457
|
+
points: r ? `当前空间的可用积分,以及你在 ${a.shortName} 里的扣费明细。` : "当前空间的可用积分,由统一账号中心记账。"
|
|
458
|
+
}, I = l ? l.description : C[t], $ = ht(f, c).items, P = $.find((b) => b.to === H(f, t)), { activeSpace: y, profile: F, allowed: k } = _, w = ((E = F.data) == null ? void 0 : E.nickName) ?? "", x = ke(y == null ? void 0 : y.role);
|
|
459
|
+
return /* @__PURE__ */ o("div", { className: s.center, children: [
|
|
460
|
+
/* @__PURE__ */ e("aside", { className: s.aside, "aria-label": "个人中心", children: /* @__PURE__ */ o(z, { className: s.identityCard, bordered: !1, bodyStyle: { padding: 0 }, children: [
|
|
461
|
+
/* @__PURE__ */ o("div", { className: s.identity, children: [
|
|
462
|
+
/* @__PURE__ */ e(De, { size: "medium", shape: "circle", className: s.identityAvatar, children: w ? Array.from(w)[0] : /* @__PURE__ */ e(_e, { "aria-hidden": "true" }) }),
|
|
463
|
+
/* @__PURE__ */ o("div", { className: s.identityText, children: [
|
|
464
|
+
/* @__PURE__ */ e("span", { className: s.identityName, title: w || void 0, children: w || (F.isPending ? "" : mt) }),
|
|
465
|
+
y ? /* @__PURE__ */ o("span", { className: s.identitySpace, children: [
|
|
466
|
+
Q(y) ? /* @__PURE__ */ e(Ce, { "aria-hidden": "true" }) : /* @__PURE__ */ e(_e, { "aria-hidden": "true" }),
|
|
467
|
+
/* @__PURE__ */ e("span", { className: s.identitySpaceName, children: K(y) }),
|
|
468
|
+
x ? /* @__PURE__ */ e("span", { className: s.identityRole, children: x }) : null
|
|
469
|
+
] }) : null
|
|
470
|
+
] })
|
|
471
|
+
] }),
|
|
472
|
+
k ? /* @__PURE__ */ o("div", { className: s.identityStats, children: [
|
|
473
|
+
/* @__PURE__ */ o("div", { className: s.identityStat, children: [
|
|
474
|
+
/* @__PURE__ */ e("span", { className: s.identityStatLabel, children: "当前套餐" }),
|
|
475
|
+
/* @__PURE__ */ e("span", { className: s.identityStatValue, children: fa(_) })
|
|
476
|
+
] }),
|
|
477
|
+
/* @__PURE__ */ o("div", { className: s.identityStat, children: [
|
|
478
|
+
/* @__PURE__ */ e("span", { className: s.identityStatLabel, children: "可用积分" }),
|
|
479
|
+
/* @__PURE__ */ e("span", { className: s.identityStatValue, children: Na(_) })
|
|
480
|
+
] })
|
|
481
|
+
] }) : null,
|
|
482
|
+
/* @__PURE__ */ e("nav", { className: s.nav, "aria-label": "个人中心分区", children: $.map((b) => {
|
|
483
|
+
const J = b === P;
|
|
484
|
+
return /* @__PURE__ */ o(
|
|
485
|
+
v,
|
|
486
|
+
{
|
|
487
|
+
theme: "borderless",
|
|
488
|
+
type: "tertiary",
|
|
489
|
+
className: s.navItem,
|
|
490
|
+
"aria-current": J ? "page" : void 0,
|
|
491
|
+
onClick: () => d(b.to),
|
|
492
|
+
children: [
|
|
493
|
+
b.icon ? /* @__PURE__ */ e("span", { className: s.navIcon, "aria-hidden": "true", children: /* @__PURE__ */ e(b.icon, {}) }) : null,
|
|
494
|
+
/* @__PURE__ */ e("span", { className: s.navLabel, children: b.label }),
|
|
495
|
+
/* @__PURE__ */ e(Qe, { className: s.navArrow, "aria-hidden": "true" })
|
|
496
|
+
]
|
|
497
|
+
},
|
|
498
|
+
b.key
|
|
499
|
+
);
|
|
500
|
+
}) }),
|
|
501
|
+
/* @__PURE__ */ e("div", { className: s.asideFoot, children: /* @__PURE__ */ e(v, { theme: "borderless", type: "tertiary", className: s.logout, icon: /* @__PURE__ */ e(Je, { "aria-hidden": "true" }), disabled: g, onClick: m, children: "退出登录" }) })
|
|
502
|
+
] }) }),
|
|
503
|
+
/* @__PURE__ */ o("div", { className: s.main, children: [
|
|
504
|
+
/* @__PURE__ */ o("header", { className: s.head, children: [
|
|
505
|
+
/* @__PURE__ */ e(ee.Title, { heading: 1, className: s.title, children: P == null ? void 0 : P.label }),
|
|
506
|
+
/* @__PURE__ */ e(ee.Paragraph, { className: s.description, children: I })
|
|
507
|
+
] }),
|
|
508
|
+
k ? l ? /* @__PURE__ */ e(l.Component, { data: _ }) : t === "profile" ? /* @__PURE__ */ e(Cn, { data: _ }) : t === "subscription" ? /* @__PURE__ */ e(ga, { data: _, focusPlan: p }) : /* @__PURE__ */ e(Pn, { data: _ }) : /* @__PURE__ */ e(Ze, {})
|
|
509
|
+
] })
|
|
510
|
+
] });
|
|
511
|
+
}, ba = "_meter_o7x3q_7", ya = "_head_o7x3q_16", va = "_label_o7x3q_24", wa = "_value_o7x3q_33", Sa = "_bar_o7x3q_53", Pa = "_note_o7x3q_57", U = {
|
|
512
|
+
meter: ba,
|
|
513
|
+
head: ya,
|
|
514
|
+
label: va,
|
|
515
|
+
value: wa,
|
|
516
|
+
bar: Sa,
|
|
517
|
+
note: Pa
|
|
518
|
+
}, Z = (t) => t.toLocaleString("zh-CN", { maximumFractionDigits: 0 }), Ca = ({ unit: t, used: n, total: a, status: i }) => i === "loading" ? "…" : i === "error" || n === void 0 || a === void 0 ? "暂不可用" : ze(a) ? `已用 ${Z(n)} ${t} · 不限` : `已用 ${Z(n)}/${Z(a)} ${t}`, $a = ({ used: t, total: n, status: a }) => a !== void 0 || t === void 0 || n === void 0 || n <= 0 || ze(n) ? null : Math.min(1, Math.max(0, t / n)), rs = (t) => {
|
|
519
|
+
const { label: n, note: a, exhausted: i, status: r } = t, c = Ca(t), l = $a(t), d = r === void 0 && (i ?? (l !== null && l >= 1)), p = d ? "warning" : c === "暂不可用" ? "muted" : void 0;
|
|
520
|
+
return /* @__PURE__ */ o("div", { className: U.meter, role: "group", "aria-label": n, children: [
|
|
521
|
+
/* @__PURE__ */ o("div", { className: U.head, children: [
|
|
522
|
+
/* @__PURE__ */ e("span", { className: U.label, children: n }),
|
|
523
|
+
/* @__PURE__ */ e("span", { className: U.value, "data-tone": p, children: c })
|
|
524
|
+
] }),
|
|
525
|
+
l !== null ? /* @__PURE__ */ e(
|
|
526
|
+
Be,
|
|
527
|
+
{
|
|
528
|
+
className: U.bar,
|
|
529
|
+
size: "large",
|
|
530
|
+
percent: Math.round(l * 100),
|
|
531
|
+
stroke: d ? "var(--semi-color-warning)" : "var(--app-strong-bg)",
|
|
532
|
+
orbitStroke: "var(--semi-color-fill-1)",
|
|
533
|
+
"aria-label": n,
|
|
534
|
+
"aria-valuetext": c
|
|
535
|
+
}
|
|
536
|
+
) : null,
|
|
537
|
+
a ? /* @__PURE__ */ e("span", { className: U.note, children: a }) : null
|
|
538
|
+
] });
|
|
539
|
+
}, os = () => {
|
|
540
|
+
const t = re(), n = ie(), { accountApi: a, config: i } = R(), { bootstrapped: r, serviceUnavailable: c, session: l } = ce(), d = $e(new URLSearchParams(t.search).get("returnPath"), i.routes.app), p = a.startLogin(d, i.routes.app);
|
|
541
|
+
return he(() => {
|
|
542
|
+
r && !l && !c && !nt() && !pe() && window.location.replace(p);
|
|
543
|
+
}, [r, p, c, l]), r && l ? /* @__PURE__ */ e(oe, { to: d, replace: !0 }) : r && !l && pe() ? /* @__PURE__ */ e(te, { children: /* @__PURE__ */ e(
|
|
544
|
+
j,
|
|
545
|
+
{
|
|
546
|
+
status: "info",
|
|
547
|
+
title: "已退出登录",
|
|
548
|
+
description: "您已在其他窗口退出 24.city 统一账号。需要继续使用时请重新登录。",
|
|
549
|
+
extra: /* @__PURE__ */ o(ue, { spacing: 12, children: [
|
|
550
|
+
/* @__PURE__ */ e(
|
|
551
|
+
v,
|
|
552
|
+
{
|
|
553
|
+
theme: "solid",
|
|
554
|
+
type: "primary",
|
|
555
|
+
onClick: () => {
|
|
556
|
+
ge(), window.location.replace(p);
|
|
557
|
+
},
|
|
558
|
+
children: "重新登录"
|
|
559
|
+
}
|
|
560
|
+
),
|
|
561
|
+
/* @__PURE__ */ e(
|
|
562
|
+
v,
|
|
563
|
+
{
|
|
564
|
+
theme: "light",
|
|
565
|
+
type: "tertiary",
|
|
566
|
+
onClick: () => {
|
|
567
|
+
ge(), n(i.routes.publicHome);
|
|
568
|
+
},
|
|
569
|
+
children: "返回首页"
|
|
570
|
+
}
|
|
571
|
+
)
|
|
572
|
+
] })
|
|
573
|
+
}
|
|
574
|
+
) }) : /* @__PURE__ */ e(te, { children: c ? /* @__PURE__ */ e("div", { role: "alert", children: /* @__PURE__ */ e(
|
|
575
|
+
j,
|
|
576
|
+
{
|
|
577
|
+
status: "error",
|
|
578
|
+
title: "统一账号服务暂不可用",
|
|
579
|
+
description: "请稍后重试。",
|
|
580
|
+
extra: /* @__PURE__ */ o(ue, { spacing: 12, children: [
|
|
581
|
+
/* @__PURE__ */ e(v, { theme: "solid", type: "primary", onClick: () => window.location.replace(p), children: "重试" }),
|
|
582
|
+
/* @__PURE__ */ e(v, { theme: "light", type: "tertiary", onClick: () => n(i.routes.publicHome), children: "返回首页" })
|
|
583
|
+
] })
|
|
584
|
+
}
|
|
585
|
+
) }) : /* @__PURE__ */ e(j, { status: "loading", title: "正在前往统一登录…" }) });
|
|
586
|
+
}, ka = "_pill_1hckq_2", La = "_upgrade_1hckq_24", ye = {
|
|
587
|
+
pill: ka,
|
|
588
|
+
upgrade: La
|
|
589
|
+
}, cs = ({ quota: t, unit: n, onUpgrade: a }) => {
|
|
590
|
+
if (!t) return null;
|
|
591
|
+
const i = ut(t);
|
|
592
|
+
return /* @__PURE__ */ o("span", { className: ye.pill, "data-full": i ? "true" : "false", role: "status", children: [
|
|
593
|
+
/* @__PURE__ */ e("span", { children: _t(t, n) }),
|
|
594
|
+
i ? /* @__PURE__ */ e(v, { theme: "borderless", type: "tertiary", size: "small", className: ye.upgrade, onClick: a, children: "升级" }) : null
|
|
595
|
+
] });
|
|
596
|
+
}, ls = ({ children: t }) => {
|
|
597
|
+
const n = re(), { config: a } = R(), { bootstrapped: i, serviceUnavailable: r, session: c } = ce();
|
|
598
|
+
if (!i) return /* @__PURE__ */ e(et, {});
|
|
599
|
+
if (r)
|
|
600
|
+
return /* @__PURE__ */ e(te, { children: /* @__PURE__ */ e("div", { role: "alert", children: /* @__PURE__ */ e(
|
|
601
|
+
j,
|
|
602
|
+
{
|
|
603
|
+
status: "error",
|
|
604
|
+
title: "账号服务暂不可用",
|
|
605
|
+
description: "无法确认当前会话与空间,应用已停止加载受保护数据。",
|
|
606
|
+
extra: /* @__PURE__ */ e(v, { theme: "solid", type: "primary", onClick: () => window.location.reload(), children: "重新加载" })
|
|
607
|
+
}
|
|
608
|
+
) }) });
|
|
609
|
+
if (!c || c.purpose !== "user") {
|
|
610
|
+
const l = $e(n.pathname + n.search, a.routes.app);
|
|
611
|
+
return /* @__PURE__ */ e(oe, { to: `${a.routes.login}?returnPath=${encodeURIComponent(l)}`, replace: !0 });
|
|
612
|
+
}
|
|
613
|
+
return /* @__PURE__ */ e(T, { children: t });
|
|
614
|
+
}, Ia = "_modal_6pw0p_6", xa = "_hero_6pw0p_15", Ta = "_close_6pw0p_15", Ea = "_badge_6pw0p_35", za = "_art_6pw0p_48", Aa = "_title_6pw0p_61", Ma = "_description_6pw0p_69", Fa = "_body_6pw0p_76", Ua = "_offer_6pw0p_83", Ra = "_offerName_6pw0p_89", Oa = "_lines_6pw0p_95", Da = "_line_6pw0p_95", Ba = "_check_6pw0p_110", Va = "_cta_6pw0p_123", ja = "_ctaPrice_6pw0p_140", qa = "_ownerOnly_6pw0p_150", Ha = "_later_6pw0p_158", N = {
|
|
615
|
+
modal: Ia,
|
|
616
|
+
hero: xa,
|
|
617
|
+
close: Ta,
|
|
618
|
+
badge: Ea,
|
|
619
|
+
art: za,
|
|
620
|
+
title: Aa,
|
|
621
|
+
description: Ma,
|
|
622
|
+
body: Fa,
|
|
623
|
+
offer: Ua,
|
|
624
|
+
offerName: Ra,
|
|
625
|
+
lines: Oa,
|
|
626
|
+
line: Da,
|
|
627
|
+
check: Ba,
|
|
628
|
+
cta: Va,
|
|
629
|
+
ctaPrice: ja,
|
|
630
|
+
ownerOnly: qa,
|
|
631
|
+
later: Ha
|
|
632
|
+
}, ds = ({
|
|
633
|
+
title: t,
|
|
634
|
+
description: n,
|
|
635
|
+
art: a = "engine",
|
|
636
|
+
onClose: i
|
|
637
|
+
}) => {
|
|
638
|
+
const r = ie(), c = D(), { offer: l, plans: d, canBuy: p, subscriptionPath: _ } = pt(), m = l ? Fe(l.plan, d.data ?? [], c).filter((f) => f.included).slice(0, 5).map((f) => f.text) : [], g = l != null && l.price ? `${Te(l.price)}起` : "";
|
|
639
|
+
return (
|
|
640
|
+
// Semi 把 className 挂在最外层包装上(遮罩和弹窗的共同父元素),不在 .semi-modal 上:宽度用 width 属性给。
|
|
641
|
+
// header={null} 时 Semi 连关闭按钮也不渲染,右上角的关闭按钮自己画在插画区里。
|
|
642
|
+
/* @__PURE__ */ o(Ve, { visible: !0, header: null, footer: null, onCancel: i, className: N.modal, width: 400, centered: !0, children: [
|
|
643
|
+
/* @__PURE__ */ o("div", { className: N.hero, "data-art": a, children: [
|
|
644
|
+
/* @__PURE__ */ e(
|
|
645
|
+
v,
|
|
646
|
+
{
|
|
647
|
+
theme: "borderless",
|
|
648
|
+
type: "tertiary",
|
|
649
|
+
size: "small",
|
|
650
|
+
icon: /* @__PURE__ */ e(We, { "aria-hidden": "true" }),
|
|
651
|
+
"aria-label": "关闭",
|
|
652
|
+
className: N.close,
|
|
653
|
+
onClick: i
|
|
654
|
+
}
|
|
655
|
+
),
|
|
656
|
+
/* @__PURE__ */ e("span", { className: N.badge, children: "会员专享" }),
|
|
657
|
+
/* @__PURE__ */ e("span", { className: N.art, "aria-hidden": "true" }),
|
|
658
|
+
/* @__PURE__ */ e("span", { className: N.title, children: t }),
|
|
659
|
+
/* @__PURE__ */ e("span", { className: N.description, children: n })
|
|
660
|
+
] }),
|
|
661
|
+
/* @__PURE__ */ o("div", { className: N.body, children: [
|
|
662
|
+
l ? /* @__PURE__ */ o("span", { className: N.offer, children: [
|
|
663
|
+
"升级到",
|
|
664
|
+
/* @__PURE__ */ e("span", { className: N.offerName, children: l.plan.name }),
|
|
665
|
+
"即可使用,同时获得:"
|
|
666
|
+
] }) : /* @__PURE__ */ e("span", { className: N.offer, children: "升级套餐即可使用。" }),
|
|
667
|
+
m.length ? /* @__PURE__ */ e("div", { className: N.lines, role: "list", "aria-label": "升级后的权益", children: m.map((f) => /* @__PURE__ */ o("div", { className: N.line, role: "listitem", children: [
|
|
668
|
+
/* @__PURE__ */ e("span", { className: N.check, "aria-hidden": "true", children: /* @__PURE__ */ e(se, {}) }),
|
|
669
|
+
f
|
|
670
|
+
] }, f)) }) : null,
|
|
671
|
+
p ? /* @__PURE__ */ o(
|
|
672
|
+
v,
|
|
673
|
+
{
|
|
674
|
+
theme: "light",
|
|
675
|
+
type: "tertiary",
|
|
676
|
+
block: !0,
|
|
677
|
+
className: N.cta,
|
|
678
|
+
"aria-label": `立即升级${g ? `,${g}` : ""}(打开订阅与套餐)`,
|
|
679
|
+
onClick: () => {
|
|
680
|
+
i(), r(_, { state: gt(l == null ? void 0 : l.plan.code) });
|
|
681
|
+
},
|
|
682
|
+
children: [
|
|
683
|
+
"立即升级",
|
|
684
|
+
g ? /* @__PURE__ */ e("span", { className: N.ctaPrice, children: g }) : null
|
|
685
|
+
]
|
|
686
|
+
}
|
|
687
|
+
) : /* @__PURE__ */ e("span", { className: N.ownerOnly, children: "团队套餐由所有者在统一账号中心升级,请联系团队所有者。" }),
|
|
688
|
+
/* @__PURE__ */ e(v, { theme: "borderless", type: "tertiary", block: !0, className: N.later, onClick: i, children: "暂不升级" })
|
|
689
|
+
] })
|
|
690
|
+
] })
|
|
691
|
+
);
|
|
692
|
+
}, Ga = /^[a-z0-9][a-z0-9._:-]{0,99}$/, Ya = () => {
|
|
693
|
+
const t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Set();
|
|
694
|
+
return {
|
|
695
|
+
get: (a) => t.get(a),
|
|
696
|
+
set(a, i) {
|
|
697
|
+
t.set(a, i), n.forEach((r) => r());
|
|
698
|
+
},
|
|
699
|
+
subscribe(a) {
|
|
700
|
+
return n.add(a), () => {
|
|
701
|
+
n.delete(a);
|
|
702
|
+
};
|
|
703
|
+
}
|
|
704
|
+
};
|
|
705
|
+
}, ve = /* @__PURE__ */ new WeakMap(), Ka = (t) => {
|
|
706
|
+
let n = ve.get(t);
|
|
707
|
+
return n || (n = Ya(), ve.set(t, n)), n;
|
|
708
|
+
}, hs = (t, { enabled: n = !0 } = {}) => {
|
|
709
|
+
var _;
|
|
710
|
+
if (!Ga.test(t))
|
|
711
|
+
throw new Error(`useShowOnce 的标识无效:${t}(小写字母、数字和 . _ : -,最长 100 个字符)`);
|
|
712
|
+
const { accountApi: a } = R(), i = ((_ = ce().session) == null ? void 0 : _.globalUserId) ?? null, r = Ka(a), c = i ? `${i}
|
|
713
|
+
${t}` : null, l = Nt(
|
|
714
|
+
r.subscribe,
|
|
715
|
+
() => c ? r.get(c) : void 0,
|
|
716
|
+
() => {
|
|
717
|
+
}
|
|
718
|
+
);
|
|
719
|
+
he(() => {
|
|
720
|
+
if (!n || !c || r.get(c)) return;
|
|
721
|
+
if (!a.getShownPrompts || !a.claimShownPrompts) {
|
|
722
|
+
r.set(c, "done");
|
|
723
|
+
return;
|
|
724
|
+
}
|
|
725
|
+
r.set(c, "asking");
|
|
726
|
+
const m = (f) => {
|
|
727
|
+
r.get(c) === "asking" && r.set(c, f);
|
|
728
|
+
};
|
|
729
|
+
(async () => {
|
|
730
|
+
var I, $;
|
|
731
|
+
const f = await ((I = a.getShownPrompts) == null ? void 0 : I.call(a, [t]));
|
|
732
|
+
if (!f || f.includes(t)) {
|
|
733
|
+
m("done");
|
|
734
|
+
return;
|
|
735
|
+
}
|
|
736
|
+
const C = await (($ = a.claimShownPrompts) == null ? void 0 : $.call(a, [t]));
|
|
737
|
+
m(C != null && C.includes(t) ? "open" : "done");
|
|
738
|
+
})().catch(() => m("done"));
|
|
739
|
+
}, [a, n, c, t, r]);
|
|
740
|
+
const d = Ne(() => {
|
|
741
|
+
c && r.set(c, "done");
|
|
742
|
+
}, [c, r]), p = Ne(() => {
|
|
743
|
+
c && r.set(c, "open");
|
|
744
|
+
}, [c, r]);
|
|
745
|
+
return { visible: l === "open", close: d, open: p };
|
|
746
|
+
};
|
|
747
|
+
export {
|
|
748
|
+
is as A,
|
|
749
|
+
M as C,
|
|
750
|
+
os as L,
|
|
751
|
+
ta as P,
|
|
752
|
+
cs as Q,
|
|
753
|
+
ls as R,
|
|
754
|
+
W as S,
|
|
755
|
+
pa as T,
|
|
756
|
+
ds as U,
|
|
757
|
+
rs as a,
|
|
758
|
+
Pn as b,
|
|
759
|
+
Cn as c,
|
|
760
|
+
ga as d,
|
|
761
|
+
G as e,
|
|
762
|
+
Me as f,
|
|
763
|
+
ae as g,
|
|
764
|
+
Ln as h,
|
|
765
|
+
Fe as p,
|
|
766
|
+
hs as u,
|
|
767
|
+
In as y
|
|
768
|
+
};
|