@blocklet/ui-react 3.0.9 → 3.0.10
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/lib/BlockletStudio/index.js +70 -71
- package/lib/ComponentInstaller/index.js +85 -88
- package/lib/ComponentInstaller/installer-item.js +47 -53
- package/lib/ComponentInstaller/use-component-installed.js +32 -38
- package/lib/ComponentManager/components/add-component.js +47 -50
- package/lib/ComponentManager/components/publish-component.js +30 -31
- package/lib/ComponentManager/components/resource-dialog.js +28 -30
- package/lib/Dashboard/index.d.ts +1 -1
- package/lib/Dashboard/index.js +59 -61
- package/lib/Footer/index.js +51 -52
- package/lib/Footer/internal-footer.js +43 -47
- package/lib/Footer/layout/standard.js +11 -12
- package/lib/Footer/links.js +25 -28
- package/lib/Footer/social-media.js +17 -17
- package/lib/Header/index.js +81 -83
- package/lib/Notifications/Snackbar.js +76 -77
- package/lib/Notifications/hooks/use-title.js +34 -34
- package/lib/Notifications/utils.js +56 -60
- package/lib/UserCenter/components/config-inviter.js +17 -18
- package/lib/UserCenter/components/danger-zone.js +49 -52
- package/lib/UserCenter/components/nft.js +44 -45
- package/lib/UserCenter/components/notification.js +92 -99
- package/lib/UserCenter/components/passport.js +22 -22
- package/lib/UserCenter/components/privacy.js +6 -6
- package/lib/UserCenter/components/settings.js +40 -43
- package/lib/UserCenter/components/status-dialog/date-picker.js +7 -8
- package/lib/UserCenter/components/status-dialog/index.js +112 -114
- package/lib/UserCenter/components/status-selector/duration-menu.js +35 -36
- package/lib/UserCenter/components/status-selector/index.js +13 -13
- package/lib/UserCenter/components/storage/action.js +21 -22
- package/lib/UserCenter/components/storage/delete.js +24 -24
- package/lib/UserCenter/components/third-party-login/index.js +53 -53
- package/lib/UserCenter/components/third-party-login/third-party-item.js +87 -89
- package/lib/UserCenter/components/user-center.js +198 -207
- package/lib/UserCenter/components/user-info/metadata.js +343 -353
- package/lib/UserCenter/components/user-info/switch-role.js +17 -20
- package/lib/UserCenter/components/user-info/user-basic-info.js +79 -82
- package/lib/UserCenter/components/user-info/user-info.js +40 -40
- package/lib/UserCenter/components/user-info/user-status.js +97 -99
- package/lib/UserCenter/components/user-info/utils.js +34 -35
- package/lib/UserSessions/components/user-session-info.js +25 -28
- package/lib/UserSessions/components/user-sessions.js +169 -181
- package/lib/blocklets.js +62 -72
- package/lib/common/domain-warning.js +31 -31
- package/lib/common/header-addons.d.ts +1 -1
- package/lib/common/header-addons.js +49 -53
- package/lib/common/notification-addon.js +29 -32
- package/lib/common/ws.js +17 -18
- package/lib/contexts/config-user-space.js +16 -19
- package/lib/utils.js +44 -48
- package/package.json +6 -6
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { use as
|
|
3
|
-
import { Box as
|
|
4
|
-
import { useMemoizedFn as
|
|
5
|
-
import
|
|
6
|
-
import { SessionContext as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import { useConfirm as
|
|
12
|
-
import { translate as
|
|
13
|
-
import { useLocaleContext as
|
|
14
|
-
import { ErrorFallback as
|
|
15
|
-
import { styled as
|
|
16
|
-
import
|
|
17
|
-
import { joinURL as
|
|
18
|
-
import { PROFILE_URL as
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import { translations as
|
|
22
|
-
import
|
|
1
|
+
import { jsx as e, jsxs as f, Fragment as D } from "react/jsx-runtime";
|
|
2
|
+
import { use as fe } from "react";
|
|
3
|
+
import { Box as a, Typography as pe, CircularProgress as me, Divider as he } from "@mui/material";
|
|
4
|
+
import { useMemoizedFn as y, useCreation as d, useRequest as Y } from "ahooks";
|
|
5
|
+
import xe from "p-wait-for";
|
|
6
|
+
import { SessionContext as ge } from "@arcblock/did-connect/lib/Session";
|
|
7
|
+
import ve from "@arcblock/ux/lib/Tabs";
|
|
8
|
+
import M from "@arcblock/ux/lib/Empty";
|
|
9
|
+
import be from "@arcblock/ux/lib/Button";
|
|
10
|
+
import we from "@arcblock/ux/lib/Result";
|
|
11
|
+
import { useConfirm as ye } from "@arcblock/ux/lib/Dialog";
|
|
12
|
+
import { translate as Ce } from "@arcblock/ux/lib/Locale/util";
|
|
13
|
+
import { useLocaleContext as ke } from "@arcblock/ux/lib/Locale/context";
|
|
14
|
+
import { ErrorFallback as Pe } from "@arcblock/ux/lib/ErrorBoundary";
|
|
15
|
+
import { styled as oe } from "@arcblock/ux/lib/Theme";
|
|
16
|
+
import Se from "lodash/cloneDeep";
|
|
17
|
+
import { joinURL as C, getQuery as De, withoutTrailingSlash as Z, withQuery as $ } from "ufo";
|
|
18
|
+
import { PROFILE_URL as k } from "@arcblock/ux/lib/Util/constant";
|
|
19
|
+
import Me from "../../Footer/index.js";
|
|
20
|
+
import ee from "../../Header/index.js";
|
|
21
|
+
import { translations as Te } from "../libs/locales.js";
|
|
22
|
+
import re from "./user-info/user-basic-info.js";
|
|
23
23
|
import "@mui/icons-material";
|
|
24
24
|
import "@iconify/react";
|
|
25
25
|
import "@arcblock/ux/lib/DID";
|
|
@@ -30,15 +30,15 @@ import "@iconify-icons/material-symbols/settings-input-antenna-rounded";
|
|
|
30
30
|
import "@arcblock/ux/lib/RelativeTime";
|
|
31
31
|
import "@arcblock/ux/lib/UserCard/Content/shorten-label";
|
|
32
32
|
import "./user-info/switch-role.js";
|
|
33
|
-
import { formatBlockletInfo as
|
|
34
|
-
import
|
|
35
|
-
import
|
|
36
|
-
import { client as
|
|
37
|
-
import
|
|
38
|
-
import { ConfigUserSpaceProvider as
|
|
39
|
-
import
|
|
40
|
-
import
|
|
41
|
-
const
|
|
33
|
+
import { formatBlockletInfo as We, getLink as T, getLocalizedNavigation as ze } from "../../blocklets.js";
|
|
34
|
+
import Ae from "./passport.js";
|
|
35
|
+
import Ue from "./settings.js";
|
|
36
|
+
import { client as te } from "../../libs/client.js";
|
|
37
|
+
import Le from "../../hooks/use-mobile.js";
|
|
38
|
+
import { ConfigUserSpaceProvider as Be } from "../../contexts/config-user-space.js";
|
|
39
|
+
import Fe from "./storage/index.js";
|
|
40
|
+
import Re from "./nft.js";
|
|
41
|
+
const W = C(k, "/nfts"), z = C(k, "/settings"), A = C(k, "/did-spaces"), ie = oe(a)(({ theme: v }) => ({
|
|
42
42
|
flex: 1,
|
|
43
43
|
boxSizing: "border-box",
|
|
44
44
|
padding: "0 16px",
|
|
@@ -52,7 +52,7 @@ const B = D(M, "/nfts"), I = D(M, "/settings"), j = D(M, "/did-spaces"), ur = fr
|
|
|
52
52
|
[v.breakpoints.up("md")]: {
|
|
53
53
|
flexDirection: "row"
|
|
54
54
|
}
|
|
55
|
-
})),
|
|
55
|
+
})), U = oe(a)(({ theme: v }) => ({
|
|
56
56
|
overflow: "hidden",
|
|
57
57
|
flex: "revert",
|
|
58
58
|
[v.breakpoints.up("md")]: {
|
|
@@ -64,50 +64,45 @@ const B = D(M, "/nfts"), I = D(M, "/settings"), j = D(M, "/did-spaces"), ur = fr
|
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
}));
|
|
67
|
-
function
|
|
67
|
+
function Sr({
|
|
68
68
|
children: v,
|
|
69
|
-
notLoginContent:
|
|
70
|
-
currentTab:
|
|
71
|
-
contentProps:
|
|
72
|
-
disableAutoRedirect:
|
|
73
|
-
hideFooter:
|
|
74
|
-
headerProps:
|
|
75
|
-
footerProps:
|
|
76
|
-
userDid:
|
|
77
|
-
stickySidebar:
|
|
78
|
-
embed:
|
|
79
|
-
onlyProfile:
|
|
69
|
+
notLoginContent: L = null,
|
|
70
|
+
currentTab: h,
|
|
71
|
+
contentProps: B = {},
|
|
72
|
+
disableAutoRedirect: F = !1,
|
|
73
|
+
hideFooter: ne = !1,
|
|
74
|
+
headerProps: se = {},
|
|
75
|
+
footerProps: ae = {},
|
|
76
|
+
userDid: P = void 0,
|
|
77
|
+
stickySidebar: R = !1,
|
|
78
|
+
embed: I = !1,
|
|
79
|
+
onlyProfile: w = !1
|
|
80
80
|
// 只显示 profile 页面,用于 ArcSphere 只需要显示 Profile 的内容
|
|
81
81
|
}) {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
return o != null && o.did ? Array.isArray(o.did) ? o.did[0] : o.did : (p = r == null ? void 0 : r.user) == null ? void 0 : p.did;
|
|
89
|
-
}, [(rr = r == null ? void 0 : r.user) == null ? void 0 : rr.did, S]), n = f(() => {
|
|
90
|
-
var e;
|
|
91
|
-
return r != null && r.user ? h === ((e = r == null ? void 0 : r.user) == null ? void 0 : e.did) : !1;
|
|
92
|
-
}, [h, (er = r == null ? void 0 : r.user) == null ? void 0 : er.did]), l = or(
|
|
82
|
+
const { locale: x } = ke(), l = Le({ key: "md" }), g = y((r, o = {}) => Ce(Te, r, x, "en", o)), t = fe(ge)?.session, p = d(() => {
|
|
83
|
+
if (P)
|
|
84
|
+
return P;
|
|
85
|
+
const r = window.location.href, o = De(r);
|
|
86
|
+
return o?.did ? Array.isArray(o.did) ? o.did[0] : o.did : t?.user?.did;
|
|
87
|
+
}, [t?.user?.did, P]), i = d(() => t?.user ? p === t?.user?.did : !1, [p, t?.user?.did]), n = Y(
|
|
93
88
|
// eslint-disable-next-line consistent-return
|
|
94
89
|
async () => {
|
|
95
|
-
if (await
|
|
96
|
-
return
|
|
97
|
-
if (
|
|
98
|
-
return
|
|
90
|
+
if (await xe(() => t?.initialized), i)
|
|
91
|
+
return t.user;
|
|
92
|
+
if (p)
|
|
93
|
+
return te.user.getUserPublicInfo({ did: p });
|
|
99
94
|
},
|
|
100
95
|
{
|
|
101
|
-
refreshDeps: [
|
|
96
|
+
refreshDeps: [p, i, t?.initialized, t?.user]
|
|
102
97
|
}
|
|
103
|
-
),
|
|
104
|
-
async () =>
|
|
98
|
+
), j = y(() => i ? t.refresh() : n.refresh()), m = Y(
|
|
99
|
+
async () => n.data && h ? await te.user.getUserPrivacyConfig({ did: p }) : null,
|
|
105
100
|
{
|
|
106
|
-
refreshDeps: [
|
|
101
|
+
refreshDeps: [p, n.data, h],
|
|
107
102
|
loadingDelay: 300
|
|
108
103
|
}
|
|
109
|
-
), { confirmHolder:
|
|
110
|
-
fullScreen:
|
|
104
|
+
), { confirmHolder: H } = ye({
|
|
105
|
+
fullScreen: l,
|
|
111
106
|
sx: {
|
|
112
107
|
".MuiDialog-paper": {
|
|
113
108
|
borderRadius: 1,
|
|
@@ -126,74 +121,71 @@ function Le({
|
|
|
126
121
|
}
|
|
127
122
|
}
|
|
128
123
|
}
|
|
129
|
-
}),
|
|
130
|
-
const
|
|
124
|
+
}), N = d(() => {
|
|
125
|
+
const r = Se(window.blocklet);
|
|
131
126
|
try {
|
|
132
|
-
return
|
|
127
|
+
return We(r);
|
|
133
128
|
} catch (o) {
|
|
134
|
-
return console.error("Failed to format blocklet info", o,
|
|
129
|
+
return console.error("Failed to format blocklet info", o, r), r;
|
|
135
130
|
}
|
|
136
|
-
}, []),
|
|
137
|
-
const
|
|
138
|
-
label:
|
|
131
|
+
}, []), _ = d(() => {
|
|
132
|
+
const r = {
|
|
133
|
+
label: g("common.nft"),
|
|
139
134
|
protected: !1,
|
|
140
135
|
isPrivate: !1,
|
|
141
136
|
// true: 隐私数据,仅自己可见
|
|
142
|
-
value:
|
|
143
|
-
url:
|
|
137
|
+
value: W,
|
|
138
|
+
url: T(W, x)
|
|
144
139
|
};
|
|
145
|
-
let o = [
|
|
146
|
-
return
|
|
147
|
-
|
|
140
|
+
let o = [r];
|
|
141
|
+
return i && (o = [
|
|
142
|
+
r,
|
|
148
143
|
{
|
|
149
|
-
label:
|
|
144
|
+
label: g("common.setting"),
|
|
150
145
|
protected: !0,
|
|
151
146
|
isPrivate: !0,
|
|
152
|
-
value:
|
|
153
|
-
url:
|
|
147
|
+
value: z,
|
|
148
|
+
url: T(z, x)
|
|
154
149
|
},
|
|
155
150
|
{
|
|
156
|
-
label:
|
|
151
|
+
label: g("storageManagement"),
|
|
157
152
|
protected: !0,
|
|
158
153
|
isPrivate: !0,
|
|
159
|
-
value:
|
|
160
|
-
url:
|
|
154
|
+
value: A,
|
|
155
|
+
url: T(A, x)
|
|
161
156
|
}
|
|
162
157
|
]), o;
|
|
163
|
-
}, [
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
var k, ir;
|
|
168
|
-
const U = u.value ?? u._rawLink ?? u.link ?? u.url;
|
|
158
|
+
}, [i, x]), c = d(() => {
|
|
159
|
+
const r = N?.navigation?.userCenter || [];
|
|
160
|
+
return (ze(r, x) || []).concat(_).map((u) => {
|
|
161
|
+
const X = u.value ?? u._rawLink ?? u.link ?? u.url;
|
|
169
162
|
return {
|
|
170
|
-
value:
|
|
163
|
+
value: X,
|
|
171
164
|
label: u.title || u.label,
|
|
172
165
|
url: u.link || u.url,
|
|
173
|
-
protected:
|
|
174
|
-
isPrivate: u.isPrivate || u.private || (
|
|
166
|
+
protected: m?.data?.[X] ?? !1,
|
|
167
|
+
isPrivate: u.isPrivate || u.private || (u?._rawLink?.includes("/customer") ?? !1)
|
|
175
168
|
// FIXME: HACK: 隐藏 /customer 菜单, 需要一个通用的解决方案,在嵌入的时候就决定是否是私有的
|
|
176
169
|
// icon: x.icon,
|
|
177
170
|
};
|
|
178
|
-
}).filter((u) =>
|
|
179
|
-
}, [
|
|
180
|
-
const o =
|
|
181
|
-
o && (window.location.href =
|
|
182
|
-
did:
|
|
171
|
+
}).filter((u) => i || !u.isPrivate);
|
|
172
|
+
}, [N, n.data, m?.data, x, _, i]), s = d(() => c.find((r) => Z(r.value) === Z(h)), [c]), le = y((r) => {
|
|
173
|
+
const o = c.find((b) => b.value === r);
|
|
174
|
+
o && (window.location.href = $(o.url, {
|
|
175
|
+
did: i ? void 0 : p
|
|
183
176
|
}));
|
|
184
|
-
}),
|
|
185
|
-
|
|
177
|
+
}), E = d(() => /* @__PURE__ */ e(
|
|
178
|
+
Ue,
|
|
186
179
|
{
|
|
187
|
-
user:
|
|
188
|
-
settings: { userCenterTabs:
|
|
189
|
-
onSave: async (
|
|
190
|
-
isMobile:
|
|
180
|
+
user: n.data,
|
|
181
|
+
settings: { userCenterTabs: c },
|
|
182
|
+
onSave: async (r) => r === "privacy" ? (await m.runAsync(), m.data) : (r === "profile" && await t.refresh(), null),
|
|
183
|
+
isMobile: l
|
|
191
184
|
}
|
|
192
|
-
), [
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
s,
|
|
185
|
+
), [n.data, c, m.data, m.runAsync]), O = d(() => s && s?.value === z, [s]), q = d(() => s && s?.value === C(k, "/profile") || s?.value === W, [s]), de = d(() => s && s?.value === A, [s]), ce = t.useOAuth(), ue = t.usePasskey(), Q = y(() => {
|
|
186
|
+
t?.user?.sourceProvider === "passkey" ? ue.switchPassport(t.user) : ["google", "apple", "email", "github"].includes(t?.user?.sourceProvider ?? "") ? ce.switchOAuthPassport(t.user) : t && t.switchPassport();
|
|
187
|
+
}), S = d(() => q ? /* @__PURE__ */ f(
|
|
188
|
+
a,
|
|
197
189
|
{
|
|
198
190
|
sx: {
|
|
199
191
|
display: "flex",
|
|
@@ -201,37 +193,37 @@ function Le({
|
|
|
201
193
|
gap: 2.5
|
|
202
194
|
},
|
|
203
195
|
children: [
|
|
204
|
-
|
|
205
|
-
/* @__PURE__ */
|
|
206
|
-
|
|
196
|
+
i ? /* @__PURE__ */ f(a, { sx: { border: "1px solid", borderColor: "divider", borderRadius: 1.5, p: 2 }, children: [
|
|
197
|
+
/* @__PURE__ */ e(
|
|
198
|
+
pe,
|
|
207
199
|
{
|
|
208
200
|
sx: {
|
|
209
201
|
color: "text.primary",
|
|
210
202
|
fontWeight: 600,
|
|
211
203
|
mb: 2.5
|
|
212
204
|
},
|
|
213
|
-
children:
|
|
205
|
+
children: g("passport")
|
|
214
206
|
}
|
|
215
207
|
),
|
|
216
|
-
/* @__PURE__ */
|
|
208
|
+
/* @__PURE__ */ e(Ae, { user: n.data })
|
|
217
209
|
] }) : null,
|
|
218
|
-
/* @__PURE__ */
|
|
210
|
+
/* @__PURE__ */ e(Re, { user: n.data })
|
|
219
211
|
]
|
|
220
212
|
}
|
|
221
|
-
) :
|
|
222
|
-
|
|
213
|
+
) : O && i ? E : de && i ? /* @__PURE__ */ e(Be, { children: /* @__PURE__ */ e(Fe, {}) }) : null, [O, q, n, i, R, E]), G = d(() => /* @__PURE__ */ e(
|
|
214
|
+
a,
|
|
223
215
|
{
|
|
224
216
|
sx: {
|
|
225
217
|
display: {
|
|
226
|
-
xs:
|
|
218
|
+
xs: i ? "none" : "block",
|
|
227
219
|
md: "block"
|
|
228
220
|
},
|
|
229
221
|
py: 3
|
|
230
222
|
},
|
|
231
|
-
children: /* @__PURE__ */
|
|
223
|
+
children: /* @__PURE__ */ e(M, { children: g("emptyContent") })
|
|
232
224
|
}
|
|
233
|
-
), [
|
|
234
|
-
|
|
225
|
+
), [i, x]), J = d(() => !m.data || m.loading ? /* @__PURE__ */ e(
|
|
226
|
+
a,
|
|
235
227
|
{
|
|
236
228
|
sx: {
|
|
237
229
|
height: "100%",
|
|
@@ -242,28 +234,27 @@ function Le({
|
|
|
242
234
|
alignItems: "center",
|
|
243
235
|
flex: 1
|
|
244
236
|
},
|
|
245
|
-
children: /* @__PURE__ */
|
|
237
|
+
children: /* @__PURE__ */ e(me, {})
|
|
246
238
|
}
|
|
247
239
|
) : (
|
|
248
240
|
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
249
|
-
/* @__PURE__ */
|
|
241
|
+
/* @__PURE__ */ e(a, { sx: { flex: 1 }, children: s?.protected && !i ? /* @__PURE__ */ e(a, { children: /* @__PURE__ */ e(M, { children: g("underProtected") }) }) : (
|
|
250
242
|
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
251
|
-
/* @__PURE__ */
|
|
243
|
+
/* @__PURE__ */ e(D, { children: v ? /* @__PURE__ */ e(a, { ...B, children: v }) : /* @__PURE__ */ e(D, { children: S }) })
|
|
252
244
|
) })
|
|
253
|
-
), [
|
|
254
|
-
|
|
255
|
-
if (l.loading || r.loading)
|
|
245
|
+
), [m, s, i, v, B, S, x]), K = d(() => {
|
|
246
|
+
if (n.loading || t.loading)
|
|
256
247
|
return null;
|
|
257
|
-
if (
|
|
258
|
-
if (
|
|
259
|
-
return /* @__PURE__ */
|
|
260
|
-
const
|
|
261
|
-
message:
|
|
248
|
+
if (n.error) {
|
|
249
|
+
if (n.error?.response?.status === 404)
|
|
250
|
+
return /* @__PURE__ */ e(a, { sx: { width: "100%" }, children: /* @__PURE__ */ e(we, { status: 404, description: g("noUserFound") }) });
|
|
251
|
+
const b = {
|
|
252
|
+
message: n.error.response?.data?.error || n.error.message || "error occurred"
|
|
262
253
|
};
|
|
263
|
-
return /* @__PURE__ */
|
|
254
|
+
return /* @__PURE__ */ e(a, { sx: { width: "100%" }, children: /* @__PURE__ */ e(Pe, { error: b }) });
|
|
264
255
|
}
|
|
265
|
-
return !
|
|
266
|
-
|
|
256
|
+
return !p && !n.data ? L || /* @__PURE__ */ e(a, { sx: { width: "100%" }, children: /* @__PURE__ */ f(
|
|
257
|
+
a,
|
|
267
258
|
{
|
|
268
259
|
sx: {
|
|
269
260
|
display: "flex",
|
|
@@ -273,54 +264,54 @@ function Le({
|
|
|
273
264
|
gap: 1
|
|
274
265
|
},
|
|
275
266
|
children: [
|
|
276
|
-
/* @__PURE__ */
|
|
277
|
-
/* @__PURE__ */
|
|
267
|
+
/* @__PURE__ */ e(M, { children: g("viewAfterLogin") }),
|
|
268
|
+
/* @__PURE__ */ e(be, { size: "small", variant: "contained", onClick: () => t.login(), children: g("loginNow") })
|
|
278
269
|
]
|
|
279
270
|
}
|
|
280
|
-
) }) :
|
|
281
|
-
|
|
282
|
-
|
|
271
|
+
) }) : I ? /* @__PURE__ */ f(U, { children: [
|
|
272
|
+
c.length > 0 && h ? /* @__PURE__ */ e(
|
|
273
|
+
a,
|
|
283
274
|
{
|
|
284
275
|
sx: {
|
|
285
|
-
display:
|
|
276
|
+
display: l ? "block" : "flex",
|
|
286
277
|
height: "100%",
|
|
287
278
|
overflow: "auto",
|
|
288
279
|
padding: "1px"
|
|
289
280
|
},
|
|
290
|
-
children:
|
|
281
|
+
children: J
|
|
291
282
|
}
|
|
292
283
|
) : null,
|
|
293
|
-
|
|
294
|
-
] }) :
|
|
295
|
-
|
|
284
|
+
c.length === 0 && G
|
|
285
|
+
] }) : w ? /* @__PURE__ */ e(U, { display: "flex", flexDirection: l ? "column" : "row", children: /* @__PURE__ */ e(
|
|
286
|
+
re,
|
|
296
287
|
{
|
|
297
|
-
isMobile:
|
|
298
|
-
order:
|
|
299
|
-
isMyself:
|
|
300
|
-
switchPassport:
|
|
301
|
-
switchProfile:
|
|
302
|
-
user:
|
|
288
|
+
isMobile: l,
|
|
289
|
+
order: l ? 1 : "unset",
|
|
290
|
+
isMyself: i,
|
|
291
|
+
switchPassport: Q,
|
|
292
|
+
switchProfile: t.switchProfile,
|
|
293
|
+
user: n.data,
|
|
303
294
|
showFullDid: !1,
|
|
304
|
-
onlyProfile:
|
|
305
|
-
refreshProfile:
|
|
295
|
+
onlyProfile: w,
|
|
296
|
+
refreshProfile: j,
|
|
306
297
|
sx: {
|
|
307
|
-
padding:
|
|
308
|
-
...
|
|
298
|
+
padding: l ? "16px 0 0 0" : "40px 24px 24px 40px",
|
|
299
|
+
...l ? {} : { width: 320, maxWidth: 320, flexShrink: 0 },
|
|
309
300
|
boxSizing: "content-box"
|
|
310
301
|
}
|
|
311
302
|
}
|
|
312
|
-
) }) : /* @__PURE__ */
|
|
313
|
-
/* @__PURE__ */
|
|
314
|
-
|
|
303
|
+
) }) : /* @__PURE__ */ f(U, { display: "flex", flexDirection: l ? "column" : "row", children: [
|
|
304
|
+
/* @__PURE__ */ f(
|
|
305
|
+
a,
|
|
315
306
|
{
|
|
316
307
|
className: "user-center-tabs",
|
|
317
308
|
sx: {
|
|
318
309
|
flex: "1",
|
|
319
|
-
order:
|
|
310
|
+
order: l ? 2 : "unset"
|
|
320
311
|
},
|
|
321
312
|
children: [
|
|
322
|
-
|
|
323
|
-
|
|
313
|
+
c.length > 0 && h ? /* @__PURE__ */ f(
|
|
314
|
+
a,
|
|
324
315
|
{
|
|
325
316
|
sx: {
|
|
326
317
|
display: "flex",
|
|
@@ -330,20 +321,20 @@ function Le({
|
|
|
330
321
|
padding: "1px"
|
|
331
322
|
},
|
|
332
323
|
children: [
|
|
333
|
-
/* @__PURE__ */
|
|
334
|
-
|
|
324
|
+
/* @__PURE__ */ e(
|
|
325
|
+
ve,
|
|
335
326
|
{
|
|
336
327
|
orientation: "horizontal",
|
|
337
328
|
variant: "line",
|
|
338
|
-
tabs:
|
|
339
|
-
current:
|
|
340
|
-
onChange:
|
|
329
|
+
tabs: c,
|
|
330
|
+
current: s?.value ?? h,
|
|
331
|
+
onChange: le,
|
|
341
332
|
sx: {
|
|
342
333
|
mb: 2,
|
|
343
334
|
".MuiTabs-flexContainer": {
|
|
344
335
|
gap: 3,
|
|
345
336
|
".MuiButtonBase-root": {
|
|
346
|
-
padding:
|
|
337
|
+
padding: l ? "16px 4px" : "40px 4px 32px 4px",
|
|
347
338
|
fontSize: 16
|
|
348
339
|
},
|
|
349
340
|
".MuiTab-root": {
|
|
@@ -366,60 +357,60 @@ function Le({
|
|
|
366
357
|
}
|
|
367
358
|
}
|
|
368
359
|
),
|
|
369
|
-
|
|
360
|
+
J
|
|
370
361
|
]
|
|
371
362
|
}
|
|
372
363
|
) : null,
|
|
373
|
-
|
|
364
|
+
c.length === 0 && G
|
|
374
365
|
]
|
|
375
366
|
}
|
|
376
367
|
),
|
|
377
|
-
!
|
|
378
|
-
/* @__PURE__ */
|
|
379
|
-
|
|
368
|
+
!l && /* @__PURE__ */ e(he, { orientation: "vertical", sx: { ml: 5 } }),
|
|
369
|
+
/* @__PURE__ */ e(
|
|
370
|
+
re,
|
|
380
371
|
{
|
|
381
|
-
isMobile:
|
|
382
|
-
order:
|
|
383
|
-
isMyself:
|
|
384
|
-
switchPassport:
|
|
385
|
-
switchProfile:
|
|
386
|
-
user:
|
|
387
|
-
refreshProfile:
|
|
372
|
+
isMobile: l,
|
|
373
|
+
order: l ? 1 : "unset",
|
|
374
|
+
isMyself: i,
|
|
375
|
+
switchPassport: Q,
|
|
376
|
+
switchProfile: t.switchProfile,
|
|
377
|
+
user: n.data,
|
|
378
|
+
refreshProfile: j,
|
|
388
379
|
showFullDid: !1,
|
|
389
380
|
sx: {
|
|
390
|
-
padding:
|
|
391
|
-
...
|
|
381
|
+
padding: l ? "16px 0 0 0" : "40px 24px 24px 40px",
|
|
382
|
+
...l ? {} : { width: 320, maxWidth: 320, flexShrink: 0 },
|
|
392
383
|
boxSizing: "content-box"
|
|
393
384
|
}
|
|
394
385
|
}
|
|
395
386
|
)
|
|
396
387
|
] });
|
|
397
388
|
}, [
|
|
398
|
-
l,
|
|
399
|
-
a,
|
|
400
389
|
n,
|
|
401
|
-
t,
|
|
402
390
|
c,
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
391
|
+
i,
|
|
392
|
+
s,
|
|
393
|
+
m,
|
|
394
|
+
h,
|
|
395
|
+
R,
|
|
396
|
+
S
|
|
397
|
+
]), V = d(() => i ? !1 : s?.isPrivate, [i, s]);
|
|
398
|
+
if (d(() => w ? !1 : !F && !h && c?.length > 0 || !s || V, [F, h, c, s, V, w])) {
|
|
399
|
+
const r = c[0]?.url, o = c.find((b) => b.value === r);
|
|
400
|
+
return r && !o?.isPrivate && window.location.replace(
|
|
401
|
+
$(r, {
|
|
402
|
+
did: i ? void 0 : p
|
|
412
403
|
})
|
|
413
404
|
), null;
|
|
414
405
|
}
|
|
415
|
-
return
|
|
416
|
-
/* @__PURE__ */
|
|
417
|
-
/* @__PURE__ */
|
|
418
|
-
|
|
419
|
-
|
|
406
|
+
return I || w ? /* @__PURE__ */ f(D, { children: [
|
|
407
|
+
/* @__PURE__ */ e(ee, { style: { display: "none" } }),
|
|
408
|
+
/* @__PURE__ */ f(ie, { children: [
|
|
409
|
+
K,
|
|
410
|
+
H
|
|
420
411
|
] })
|
|
421
|
-
] }) : /* @__PURE__ */
|
|
422
|
-
|
|
412
|
+
] }) : /* @__PURE__ */ f(
|
|
413
|
+
a,
|
|
423
414
|
{
|
|
424
415
|
sx: {
|
|
425
416
|
minHeight: "100vh",
|
|
@@ -427,16 +418,16 @@ function Le({
|
|
|
427
418
|
flexDirection: "column"
|
|
428
419
|
},
|
|
429
420
|
children: [
|
|
430
|
-
/* @__PURE__ */
|
|
431
|
-
/* @__PURE__ */
|
|
432
|
-
|
|
433
|
-
|
|
421
|
+
/* @__PURE__ */ e(ee, { bordered: !0, ...se, maxWidth: "100%" }),
|
|
422
|
+
/* @__PURE__ */ f(ie, { children: [
|
|
423
|
+
K,
|
|
424
|
+
H
|
|
434
425
|
] }),
|
|
435
|
-
|
|
436
|
-
|
|
426
|
+
ne ? null : /* @__PURE__ */ e(
|
|
427
|
+
Me,
|
|
437
428
|
{
|
|
438
429
|
bordered: !0,
|
|
439
|
-
...
|
|
430
|
+
...ae,
|
|
440
431
|
sx: {
|
|
441
432
|
".MuiContainer-root": {
|
|
442
433
|
maxWidth: 1600
|
|
@@ -449,5 +440,5 @@ function Le({
|
|
|
449
440
|
);
|
|
450
441
|
}
|
|
451
442
|
export {
|
|
452
|
-
|
|
443
|
+
Sr as default
|
|
453
444
|
};
|