@blocklet/ui-react 3.1.28 → 3.1.30

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