@arcblock/ux 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.
Files changed (66) hide show
  1. package/lib/Address/did-address.js +47 -49
  2. package/lib/Address/responsive-did-address.js +53 -57
  3. package/lib/Avatar/index.js +16 -16
  4. package/lib/BlockletV2/blocklet.js +64 -64
  5. package/lib/BlockletV2/components/tooltip-icon.js +26 -27
  6. package/lib/CardSelector/index.js +1 -2
  7. package/lib/ClickToCopy/hook.js +10 -11
  8. package/lib/ClickToCopy/index.js +16 -16
  9. package/lib/Config/theme-mode-toggle.js +7 -8
  10. package/lib/DID/index.js +131 -133
  11. package/lib/DIDConnect/app-info-item.js +18 -18
  12. package/lib/DIDConnect/auth-apps/index.js +83 -84
  13. package/lib/DIDConnect/did-connect-container.js +89 -90
  14. package/lib/DIDConnect/did-connect-footer.js +25 -25
  15. package/lib/DIDConnect/landing-page.js +17 -17
  16. package/lib/DIDConnect/powered-by.js +11 -11
  17. package/lib/DIDConnect/request-storage-access-api-dialog.js +36 -37
  18. package/lib/DIDConnect/with-container.js +66 -68
  19. package/lib/Dialog/use-confirm.js +40 -43
  20. package/lib/Earth/index.js +21 -22
  21. package/lib/Footer/index.js +15 -16
  22. package/lib/Header/responsive-header.js +23 -24
  23. package/lib/Layout/dashboard/index.js +63 -72
  24. package/lib/Layout/dashboard/sidebar.js +20 -21
  25. package/lib/Layout/dashboard-legacy/index.js +52 -52
  26. package/lib/Locale/context.js +36 -37
  27. package/lib/Locale/selector.js +40 -42
  28. package/lib/NFTDisplay/index.js +114 -118
  29. package/lib/NFTDisplay/render-svg.js +12 -12
  30. package/lib/NavMenu/nav-menu.js +159 -161
  31. package/lib/NavMenu/sub-container.js +25 -26
  32. package/lib/PageScroller/index.js +28 -32
  33. package/lib/Passport/passport.js +11 -11
  34. package/lib/PhoneInput/country-select.js +38 -38
  35. package/lib/PhoneInput/index.js +65 -66
  36. package/lib/Screenshot/index.js +26 -27
  37. package/lib/SessionBlocklet/index.js +87 -93
  38. package/lib/SessionPermission/index.js +5 -9
  39. package/lib/SessionUser/components/did-space.js +24 -25
  40. package/lib/SessionUser/components/logged-in.js +122 -127
  41. package/lib/SessionUser/components/quick-login-item.js +41 -42
  42. package/lib/SessionUser/components/session-user-item.js +35 -36
  43. package/lib/SessionUser/components/session-user-switch.js +81 -85
  44. package/lib/SessionUser/components/un-login.js +41 -41
  45. package/lib/SessionUser/components/user-info.js +43 -47
  46. package/lib/SessionUser/index.js +1 -1
  47. package/lib/SessionUser/libs/utils.js +24 -30
  48. package/lib/SharedBridge/index.js +35 -35
  49. package/lib/Theme/index.js +16 -16
  50. package/lib/Theme/theme.js +42 -43
  51. package/lib/Toast/index.js +24 -25
  52. package/lib/Typography/index.js +42 -42
  53. package/lib/UserCard/Content/basic.js +91 -93
  54. package/lib/UserCard/Content/shorten-label.js +9 -9
  55. package/lib/UserCard/components.js +15 -15
  56. package/lib/Util/deprecate.js +1 -1
  57. package/lib/Util/federated.js +28 -32
  58. package/lib/Util/iframe.js +9 -10
  59. package/lib/Util/index.js +134 -135
  60. package/lib/Util/security.js +9 -10
  61. package/lib/Util/wallet.js +6 -9
  62. package/lib/VerificationCode/index.js +26 -28
  63. package/lib/hooks/use-blocklet-logo.js +11 -14
  64. package/lib/ux.css +1 -1
  65. package/lib/withTracker/index.js +13 -14
  66. package/package.json +9 -10
@@ -1,127 +1,122 @@
1
- import { jsxs as m, jsx as t, Fragment as j } from "react/jsx-runtime";
2
- import { useRef as T, useEffect as _ } from "react";
3
- import { useMemoizedFn as n, useCreation as H, useReactive as N } from "ahooks";
4
- import g from "@arcblock/bridge";
5
- import { Box as y, IconButton as Q, Popper as V, ClickAwayListener as q, Fade as G, Paper as J, Divider as I, MenuList as K, MenuItem as X } from "@mui/material";
6
- import { Icon as Y } from "@iconify/react";
7
- import Z from "@iconify-icons/material-symbols/person-outline-rounded";
8
- import $ from "@iconify-icons/material-symbols/filter-vintage-outline-rounded";
9
- import ee from "@iconify-icons/material-symbols/account-circle-off-outline-rounded";
10
- import re from "@iconify-icons/material-symbols/featured-seasonal-and-gifts-rounded";
11
- import te from "copy-to-clipboard";
12
- import P from "lodash/noop";
13
- import oe from "../../Toast/index.js";
14
- import ie from "../../Avatar/index.js";
15
- import { getUserAvatar as ne } from "../../Util/index.js";
16
- import ce from "./user-info.js";
17
- import { DASHBOARD_URL as ae, PROFILE_URL as le } from "../../Util/constant.js";
18
- import pe from "../../SessionPermission/index.js";
19
- import { translations as ue } from "../libs/translation.js";
20
- import { translate as de } from "../../Locale/util.js";
21
- import me from "./did-space.js";
22
- import { mergeSx as se } from "../../Util/style.js";
23
- import { createDebug as fe } from "../../Util/logger.js";
24
- const he = (e) => {
25
- const l = new URL(window.location.href);
26
- return l.searchParams.set("inviter", e), l.toString();
27
- }, v = fe("did-connect");
28
- function je({
1
+ import { jsxs as s, jsx as r, Fragment as W } from "react/jsx-runtime";
2
+ import { useRef as z, useEffect as j } from "react";
3
+ import { useMemoizedFn as n, useCreation as T, useReactive as _ } from "ahooks";
4
+ import f from "@arcblock/bridge";
5
+ import { Box as S, IconButton as H, Popper as N, ClickAwayListener as Q, Fade as V, Paper as q, Divider as k, MenuList as G, MenuItem as J } from "@mui/material";
6
+ import { Icon as K } from "@iconify/react";
7
+ import X from "@iconify-icons/material-symbols/person-outline-rounded";
8
+ import Y from "@iconify-icons/material-symbols/filter-vintage-outline-rounded";
9
+ import Z from "@iconify-icons/material-symbols/account-circle-off-outline-rounded";
10
+ import $ from "@iconify-icons/material-symbols/featured-seasonal-and-gifts-rounded";
11
+ import ee from "copy-to-clipboard";
12
+ import h from "lodash/noop";
13
+ import re from "../../Toast/index.js";
14
+ import te from "../../Avatar/index.js";
15
+ import { getUserAvatar as oe } from "../../Util/index.js";
16
+ import ie from "./user-info.js";
17
+ import { DASHBOARD_URL as ne, PROFILE_URL as ce } from "../../Util/constant.js";
18
+ import ae from "../../SessionPermission/index.js";
19
+ import { translations as le } from "../libs/translation.js";
20
+ import { translate as se } from "../../Locale/util.js";
21
+ import pe from "./did-space.js";
22
+ import { mergeSx as ue } from "../../Util/style.js";
23
+ import { createDebug as de } from "../../Util/logger.js";
24
+ const me = (e) => {
25
+ const c = new URL(window.location.href);
26
+ return c.searchParams.set("inviter", e), c.toString();
27
+ }, g = de("did-connect");
28
+ function We({
29
29
  session: e,
30
- onBindWallet: l = P,
31
- isBlocklet: c = !0,
32
- locale: f = "en",
33
- size: R = 24,
34
- popperType: C = "click",
35
- sx: B,
36
- ...D
30
+ onBindWallet: c = h,
31
+ isBlocklet: a = !0,
32
+ locale: u = "en",
33
+ size: b = 24,
34
+ popperType: I = "click",
35
+ sx: y,
36
+ ...R
37
37
  }) {
38
- var S, b;
39
- const u = n((r, o = {}) => de(ue, r, f, "en", o)), L = H(() => {
40
- var r, o, a;
41
- return !!((a = (o = (r = globalThis == null ? void 0 : globalThis.blocklet) == null ? void 0 : r.settings) == null ? void 0 : o.invite) != null && a.enabled);
42
- }, []), x = T(null), h = N({
38
+ const l = n((t, o = {}) => se(le, t, u, "en", o)), C = T(() => !!globalThis?.blocklet?.settings?.invite?.enabled, []), P = z(null), d = _({
43
39
  open: !1
44
- }), i = n((r = !h.open) => {
45
- h.open = r;
46
- }), O = C === "hover" ? { onMouseEnter: () => i(!0), onMouseLeave: () => i(!1) } : { onClick: () => i() }, M = ne((b = (S = e.user) == null ? void 0 : S.avatar) == null ? void 0 : b.replace(/\s/g, encodeURIComponent(" "))), E = e.useOAuth(), U = typeof e.usePasskey == "function" ? e.usePasskey() : null, w = n(({ inArcSphere: r = !1 } = {}) => {
47
- var a, d, p;
40
+ }), i = n((t = !d.open) => {
41
+ d.open = t;
42
+ }), B = I === "hover" ? { onMouseEnter: () => i(!0), onMouseLeave: () => i(!1) } : { onClick: () => i() }, D = oe(e.user?.avatar?.replace(/\s/g, encodeURIComponent(" "))), L = e.useOAuth(), O = typeof e.usePasskey == "function" ? e.usePasskey() : null, v = n(({ inArcSphere: t = !1 } = {}) => {
48
43
  const o = {};
49
- r && (a = e == null ? void 0 : e.user) != null && a.sourceAppPid && (o.sourceAppPid = e.user.sourceAppPid), i(!1), ((d = e == null ? void 0 : e.user) == null ? void 0 : d.sourceProvider) === "passkey" ? U.switchPassport(e.user) : ["google", "apple", "email", "github"].includes((p = e == null ? void 0 : e.user) == null ? void 0 : p.sourceProvider) ? E.switchOAuthPassport(e.user) : e.switchPassport(P, o);
50
- }), A = n(({ userSession: r, inArcSphere: o = !1 } = {}) => new Promise((a) => {
51
- const d = {};
52
- o && e.user.sourceAppPid && (d.sourceAppPid = e.user.sourceAppPid);
53
- const p = {};
54
- r ? p.userSession = r : (i(!1), p.showQuickConnect = !1), e.switchDid(
44
+ t && e?.user?.sourceAppPid && (o.sourceAppPid = e.user.sourceAppPid), i(!1), e?.user?.sourceProvider === "passkey" ? O.switchPassport(e.user) : ["google", "apple", "email", "github"].includes(e?.user?.sourceProvider) ? L.switchOAuthPassport(e.user) : e.switchPassport(h, o);
45
+ }), x = n(({ userSession: t, inArcSphere: o = !1 } = {}) => new Promise((F) => {
46
+ const A = {};
47
+ o && e.user.sourceAppPid && (A.sourceAppPid = e.user.sourceAppPid);
48
+ const m = {};
49
+ t ? m.userSession = t : (i(!1), m.showQuickConnect = !1), e.switchDid(
55
50
  () => {
56
- i(!1), a();
51
+ i(!1), F();
57
52
  },
58
- d,
59
- p
53
+ A,
54
+ m
60
55
  );
61
- })), k = n(({ inArcSphere: r = !1 } = {}) => {
56
+ })), w = n(({ inArcSphere: t = !1 } = {}) => {
62
57
  const o = {};
63
- r && e.user.sourceAppPid && (o.sourceAppPid = e.user.sourceAppPid), i(!1), e.switchProfile(P, o);
64
- }), F = n(() => {
58
+ t && e.user.sourceAppPid && (o.sourceAppPid = e.user.sourceAppPid), i(!1), e.switchProfile(h, o);
59
+ }), M = n(() => {
65
60
  i(!1), e.logout();
66
- }), W = n(() => {
67
- i(!1), e.bindWallet(l);
68
- }), z = n(() => {
61
+ }), E = n(() => {
62
+ i(!1), e.bindWallet(c);
63
+ }), U = n(() => {
69
64
  i(!1);
70
- const r = he(e.user.did);
71
- te(r), oe.success(u("inviteCopied"));
65
+ const t = me(e.user.did);
66
+ ee(t), re.success(l("inviteCopied"));
72
67
  });
73
- return _(() => {
74
- g.registerBlocklet("callSwitchPassport", () => {
75
- v("bridge registerBlocklet: callSwitchPassport"), w({ inArcSphere: !0 });
76
- }), g.registerBlocklet("callSwitchDid", () => {
77
- v("bridge registerBlocklet: callSwitchDid"), A({ inArcSphere: !0 });
78
- }), g.registerBlocklet("callSwitchProfile", () => {
79
- v("bridge registerBlocklet: callSwitchProfile"), k({ inArcSphere: !0 });
68
+ return j(() => {
69
+ f.registerBlocklet("callSwitchPassport", () => {
70
+ g("bridge registerBlocklet: callSwitchPassport"), v({ inArcSphere: !0 });
71
+ }), f.registerBlocklet("callSwitchDid", () => {
72
+ g("bridge registerBlocklet: callSwitchDid"), x({ inArcSphere: !0 });
73
+ }), f.registerBlocklet("callSwitchProfile", () => {
74
+ g("bridge registerBlocklet: callSwitchProfile"), w({ inArcSphere: !0 });
80
75
  });
81
- }, []), /* @__PURE__ */ m(
82
- y,
76
+ }, []), /* @__PURE__ */ s(
77
+ S,
83
78
  {
84
- sx: se(
79
+ sx: ue(
85
80
  {
86
81
  display: "inline-flex",
87
82
  alignItems: "center",
88
83
  justifyContent: "center"
89
84
  },
90
85
  // @ts-ignore
91
- B
86
+ y
92
87
  ),
93
- ...D,
88
+ ...R,
94
89
  children: [
95
- /* @__PURE__ */ t(
96
- Q,
90
+ /* @__PURE__ */ r(
91
+ H,
97
92
  {
98
- ref: x,
93
+ ref: P,
99
94
  size: "medium",
100
95
  "data-cy": "sessionManager-logout-popup",
101
96
  className: "arc-session-user-logged-in",
102
97
  "aria-label": "User info button",
103
- ...O,
104
- children: /* @__PURE__ */ t(ie, { variant: "circle", did: e.user.did, src: M, size: R, shape: "circle" })
98
+ ...B,
99
+ children: /* @__PURE__ */ r(te, { variant: "circle", did: e.user.did, src: D, size: b, shape: "circle" })
105
100
  }
106
101
  ),
107
- /* @__PURE__ */ t(
108
- V,
102
+ /* @__PURE__ */ r(
103
+ N,
109
104
  {
110
- open: h.open,
111
- anchorEl: x.current,
105
+ open: d.open,
106
+ anchorEl: P.current,
112
107
  transition: !0,
113
108
  placement: "bottom-end",
114
109
  sx: {
115
110
  zIndex: 1600
116
111
  },
117
- children: ({ TransitionProps: r }) => /* @__PURE__ */ t(
118
- q,
112
+ children: ({ TransitionProps: t }) => /* @__PURE__ */ r(
113
+ Q,
119
114
  {
120
115
  onClickAway: (o) => {
121
116
  o.preventDefault(), o.stopPropagation(), i(!1);
122
117
  },
123
- children: /* @__PURE__ */ t(G, { ...r, timeout: 350, children: /* @__PURE__ */ m(
124
- J,
118
+ children: /* @__PURE__ */ r(V, { ...t, timeout: 350, children: /* @__PURE__ */ s(
119
+ q,
125
120
  {
126
121
  variant: "outlined",
127
122
  sx: {
@@ -130,62 +125,62 @@ function je({
130
125
  maxWidth: "90vw"
131
126
  },
132
127
  children: [
133
- /* @__PURE__ */ t(
134
- ce,
128
+ /* @__PURE__ */ r(
129
+ ie,
135
130
  {
136
- locale: f,
137
- isBlocklet: c,
131
+ locale: u,
132
+ isBlocklet: a,
138
133
  session: e,
139
- onSwitchPassport: w,
140
- onSwitchAccount: A,
141
- onSwitchProfile: k,
142
- onBindWallet: W
134
+ onSwitchPassport: v,
135
+ onSwitchAccount: x,
136
+ onSwitchProfile: w,
137
+ onBindWallet: E
143
138
  }
144
139
  ),
145
- /* @__PURE__ */ t(I, { sx: { m: "0 !important" } }),
146
- /* @__PURE__ */ m(K, { sx: { p: 0 }, children: [
147
- c ? /* @__PURE__ */ m(j, { children: [
148
- /* @__PURE__ */ t(pe, { session: e, children: /* @__PURE__ */ t(
149
- s,
140
+ /* @__PURE__ */ r(k, { sx: { m: "0 !important" } }),
141
+ /* @__PURE__ */ s(G, { sx: { p: 0 }, children: [
142
+ a ? /* @__PURE__ */ s(W, { children: [
143
+ /* @__PURE__ */ r(ae, { session: e, children: /* @__PURE__ */ r(
144
+ p,
150
145
  {
151
- icon: $,
152
- title: u("dashboard"),
146
+ icon: Y,
147
+ title: l("dashboard"),
153
148
  component: "a",
154
- href: ae,
149
+ href: ne,
155
150
  sx: { display: "block", textDecoration: "none", color: "inherit" }
156
151
  }
157
152
  ) }),
158
- /* @__PURE__ */ t(
159
- s,
153
+ /* @__PURE__ */ r(
154
+ p,
160
155
  {
161
- icon: Z,
162
- title: u("profile"),
156
+ icon: X,
157
+ title: l("profile"),
163
158
  component: "a",
164
- href: le,
159
+ href: ce,
165
160
  sx: { display: "block", textDecoration: "none", color: "inherit" }
166
161
  }
167
162
  ),
168
- L && /* @__PURE__ */ t(
169
- s,
163
+ C && /* @__PURE__ */ r(
164
+ p,
170
165
  {
171
- icon: re,
172
- title: u("invite"),
166
+ icon: $,
167
+ title: l("invite"),
173
168
  component: "div",
174
- onClick: z,
169
+ onClick: U,
175
170
  sx: { display: "block", color: "inherit" }
176
171
  }
177
172
  ),
178
- /* @__PURE__ */ t(I, { sx: { m: "0 !important" } }),
179
- /* @__PURE__ */ t(me, { session: e, locale: f })
173
+ /* @__PURE__ */ r(k, { sx: { m: "0 !important" } }),
174
+ /* @__PURE__ */ r(pe, { session: e, locale: u })
180
175
  ] }) : null,
181
- /* @__PURE__ */ t(
182
- s,
176
+ /* @__PURE__ */ r(
177
+ p,
183
178
  {
184
- icon: ee,
185
- title: u("logout"),
179
+ icon: Z,
180
+ title: l("logout"),
186
181
  component: "div",
187
182
  sx: { color: "error.main" },
188
- onClick: F,
183
+ onClick: M,
189
184
  "data-cy": "sessionManager-logout-trigger"
190
185
  }
191
186
  )
@@ -201,13 +196,13 @@ function je({
201
196
  }
202
197
  );
203
198
  }
204
- function s({
199
+ function p({
205
200
  icon: e,
206
- title: l,
207
- ...c
201
+ title: c,
202
+ ...a
208
203
  }) {
209
- return /* @__PURE__ */ t(y, { ...c, sx: { p: 0.5, ...c == null ? void 0 : c.sx }, children: /* @__PURE__ */ m(
210
- X,
204
+ return /* @__PURE__ */ r(S, { ...a, sx: { p: 0.5, ...a?.sx }, children: /* @__PURE__ */ s(
205
+ J,
211
206
  {
212
207
  sx: {
213
208
  display: "flex",
@@ -220,12 +215,12 @@ function s({
220
215
  py: 1
221
216
  },
222
217
  children: [
223
- /* @__PURE__ */ t(Y, { icon: e, fontSize: 24 }),
224
- l
218
+ /* @__PURE__ */ r(K, { icon: e, fontSize: 24 }),
219
+ c
225
220
  ]
226
221
  }
227
222
  ) });
228
223
  }
229
224
  export {
230
- je as default
225
+ We as default
231
226
  };
@@ -1,20 +1,19 @@
1
- import { jsxs as e, jsx as r } from "react/jsx-runtime";
2
- import { useTheme as g, useMediaQuery as v, Box as o, Typography as n, Chip as y } from "@mui/material";
3
- import b from "lodash/noop";
4
- import w from "../../RelativeTime/index.js";
5
- import u from "../../WalletOSIcon/index.js";
6
- import { DID as z } from "../../DID/index.js";
7
- import k from "../../Avatar/index.js";
8
- import { getSourceProvider as I } from "../libs/utils.js";
9
- function M({
10
- userSession: t,
11
- locale: a = "en",
12
- onClick: p = b
1
+ import { jsxs as o, jsx as t } from "react/jsx-runtime";
2
+ import { useTheme as m, useMediaQuery as x, Box as r, Typography as a, Chip as f } from "@mui/material";
3
+ import h from "lodash/noop";
4
+ import s from "../../RelativeTime/index.js";
5
+ import g from "../../WalletOSIcon/index.js";
6
+ import { DID as u } from "../../DID/index.js";
7
+ import v from "../../Avatar/index.js";
8
+ import { getSourceProvider as y } from "../libs/utils.js";
9
+ function T({
10
+ userSession: e,
11
+ locale: i = "en",
12
+ onClick: l = h
13
13
  }) {
14
- var l, i, d, c;
15
- const { palette: m } = g(), x = v((h) => h.breakpoints.down("md")), f = I(t == null ? void 0 : t.user) === "wallet";
16
- return /* @__PURE__ */ e(
17
- o,
14
+ const { palette: n } = m(), d = x((p) => p.breakpoints.down("md")), c = y(e?.user) === "wallet";
15
+ return /* @__PURE__ */ o(
16
+ r,
18
17
  {
19
18
  sx: {
20
19
  p: 2,
@@ -32,10 +31,10 @@ function M({
32
31
  },
33
32
  width: "100%"
34
33
  },
35
- onClick: p,
34
+ onClick: l,
36
35
  children: [
37
- /* @__PURE__ */ e(
38
- o,
36
+ /* @__PURE__ */ o(
37
+ r,
39
38
  {
40
39
  sx: {
41
40
  display: "flex",
@@ -45,12 +44,12 @@ function M({
45
44
  overflow: "hidden"
46
45
  },
47
46
  children: [
48
- /* @__PURE__ */ r(k, { src: t.user.avatar, did: t.user.did, size: 44, variant: "circle", shape: "circle" }),
49
- /* @__PURE__ */ e(o, { sx: { flex: 1, overflow: "hidden" }, children: [
50
- /* @__PURE__ */ e(
51
- n,
47
+ /* @__PURE__ */ t(v, { src: e.user.avatar, did: e.user.did, size: 44, variant: "circle", shape: "circle" }),
48
+ /* @__PURE__ */ o(r, { sx: { flex: 1, overflow: "hidden" }, children: [
49
+ /* @__PURE__ */ o(
50
+ a,
52
51
  {
53
- component: o,
52
+ component: r,
54
53
  sx: {
55
54
  fontSize: "16px",
56
55
  fontWeight: 500,
@@ -60,11 +59,11 @@ function M({
60
59
  color: "text.primary"
61
60
  },
62
61
  children: [
63
- t.user.fullName,
64
- /* @__PURE__ */ r(
65
- y,
62
+ e.user.fullName,
63
+ /* @__PURE__ */ t(
64
+ f,
66
65
  {
67
- label: ((l = t.user) == null ? void 0 : l.roleTitle) || ((i = t.user) == null ? void 0 : i.role),
66
+ label: e.user?.roleTitle || e.user?.role,
68
67
  size: "small",
69
68
  variant: "outlined",
70
69
  sx: () => ({
@@ -79,8 +78,8 @@ function M({
79
78
  ]
80
79
  }
81
80
  ),
82
- f ? /* @__PURE__ */ e(
83
- o,
81
+ c ? /* @__PURE__ */ o(
82
+ r,
84
83
  {
85
84
  sx: {
86
85
  display: "flex",
@@ -88,19 +87,19 @@ function M({
88
87
  gap: 0.5
89
88
  },
90
89
  children: [
91
- /* @__PURE__ */ r(
92
- u,
90
+ /* @__PURE__ */ t(
91
+ g,
93
92
  {
94
- provider: (d = t == null ? void 0 : t.extra) == null ? void 0 : d.provider,
95
- walletOS: (c = t == null ? void 0 : t.extra) == null ? void 0 : c.walletOS,
96
- color: m.text.secondary
93
+ provider: e?.extra?.provider,
94
+ walletOS: e?.extra?.walletOS,
95
+ color: n.text.secondary
97
96
  }
98
97
  ),
99
- /* @__PURE__ */ r(
100
- z,
98
+ /* @__PURE__ */ t(
99
+ u,
101
100
  {
102
- locale: a,
103
- did: t.user.did,
101
+ locale: i,
102
+ did: e.user.did,
104
103
  size: 12,
105
104
  sx: {
106
105
  lineHeight: 1,
@@ -115,16 +114,16 @@ function M({
115
114
  )
116
115
  ]
117
116
  }
118
- ) : /* @__PURE__ */ r(n, { sx: { fontSize: "12px", color: "text.secondary" }, children: t.user.email })
117
+ ) : /* @__PURE__ */ t(a, { sx: { fontSize: "12px", color: "text.secondary" }, children: e.user.email })
119
118
  ] })
120
119
  ]
121
120
  }
122
121
  ),
123
- t.updatedAt && !x && /* @__PURE__ */ r(o, { component: "span", sx: { color: "text.hint", fontSize: "12px", flexShrink: 0 }, children: /* @__PURE__ */ r(w, { value: t.updatedAt, locale: a }) })
122
+ e.updatedAt && !d && /* @__PURE__ */ t(r, { component: "span", sx: { color: "text.hint", fontSize: "12px", flexShrink: 0 }, children: /* @__PURE__ */ t(s, { value: e.updatedAt, locale: i }) })
124
123
  ]
125
124
  }
126
125
  );
127
126
  }
128
127
  export {
129
- M as default
128
+ T as default
130
129
  };
@@ -1,25 +1,24 @@
1
- import { jsxs as t, jsx as l } from "react/jsx-runtime";
2
- import { useTheme as u, Box as e, Tooltip as x, Typography as h, IconButton as v } from "@mui/material";
3
- import { Icon as y } from "@iconify/react";
4
- import m from "@iconify-icons/material-symbols/lens";
5
- import w from "../../WalletOSIcon/index.js";
6
- import S from "../../Avatar/index.js";
7
- import { DID as g } from "../../DID/index.js";
8
- import { getSourceProvider as z } from "../libs/utils.js";
9
- function R({
10
- ref: p = void 0,
11
- sessionItem: r,
12
- statusContent: c = null,
13
- active: n = !1,
14
- ...a
1
+ import { jsxs as t, jsx as r } from "react/jsx-runtime";
2
+ import { useTheme as c, Box as o, Tooltip as s, Typography as f, IconButton as m } from "@mui/material";
3
+ import { Icon as u } from "@iconify/react";
4
+ import x from "@iconify-icons/material-symbols/lens";
5
+ import h from "../../WalletOSIcon/index.js";
6
+ import v from "../../Avatar/index.js";
7
+ import { DID as y } from "../../DID/index.js";
8
+ import { getSourceProvider as w } from "../libs/utils.js";
9
+ function T({
10
+ ref: a = void 0,
11
+ sessionItem: e,
12
+ statusContent: n = null,
13
+ active: d = !1,
14
+ ...i
15
15
  }) {
16
- var i, d;
17
- const { palette: o } = u(), f = z(r == null ? void 0 : r.user) === "wallet";
16
+ const { palette: l } = c(), p = w(e?.user) === "wallet";
18
17
  return /* @__PURE__ */ t(
19
- e,
18
+ o,
20
19
  {
21
- ...a,
22
- ref: p,
20
+ ...i,
21
+ ref: a,
23
22
  sx: {
24
23
  display: "flex",
25
24
  alignItems: "center",
@@ -27,11 +26,11 @@ function R({
27
26
  py: 0.75,
28
27
  px: 1,
29
28
  width: "100%",
30
- ...a == null ? void 0 : a.sx
29
+ ...i?.sx
31
30
  },
32
31
  children: [
33
32
  /* @__PURE__ */ t(
34
- e,
33
+ o,
35
34
  {
36
35
  sx: {
37
36
  display: "flex",
@@ -43,33 +42,33 @@ function R({
43
42
  }
44
43
  },
45
44
  children: [
46
- /* @__PURE__ */ l(e, { sx: { mr: 0.5, fontSize: 0 }, children: /* @__PURE__ */ l(S, { did: r.userDid, size: 36 }) }),
47
- /* @__PURE__ */ l(
48
- w,
45
+ /* @__PURE__ */ r(o, { sx: { mr: 0.5, fontSize: 0 }, children: /* @__PURE__ */ r(v, { did: e.userDid, size: 36 }) }),
46
+ /* @__PURE__ */ r(
47
+ h,
49
48
  {
50
- color: o.text.secondary,
51
- loading: r.__isDefault,
52
- provider: (i = r == null ? void 0 : r.extra) == null ? void 0 : i.provider,
53
- walletOS: (d = r == null ? void 0 : r.extra) == null ? void 0 : d.walletOS
49
+ color: l.text.secondary,
50
+ loading: e.__isDefault,
51
+ provider: e?.extra?.provider,
52
+ walletOS: e?.extra?.walletOS
54
53
  }
55
54
  ),
56
- f ? /* @__PURE__ */ l(g, { did: r.userDid, copyable: !1, size: 14, responsive: !1, compact: !0, sx: { lineHeight: 1 } }) : r.user.email && /* @__PURE__ */ l(
57
- x,
55
+ p ? /* @__PURE__ */ r(y, { did: e.userDid, copyable: !1, size: 14, responsive: !1, compact: !0, sx: { lineHeight: 1 } }) : e.user.email && /* @__PURE__ */ r(
56
+ s,
58
57
  {
59
- title: r.user.email,
58
+ title: e.user.email,
60
59
  sx: {
61
60
  zIndex: 1600
62
61
  },
63
62
  placement: "top",
64
- children: /* @__PURE__ */ l(
65
- h,
63
+ children: /* @__PURE__ */ r(
64
+ f,
66
65
  {
67
66
  sx: {
68
67
  fontSize: 14,
69
68
  overflow: "hidden",
70
69
  textOverflow: "ellipsis"
71
70
  },
72
- children: r.user.email
71
+ children: e.user.email
73
72
  }
74
73
  )
75
74
  }
@@ -77,11 +76,11 @@ function R({
77
76
  ]
78
77
  }
79
78
  ),
80
- c || n && /* @__PURE__ */ l(v, { size: "small", disableRipple: !0, children: /* @__PURE__ */ l(y, { icon: m, fontSize: 6, color: o.success.main }) })
79
+ n || d && /* @__PURE__ */ r(m, { size: "small", disableRipple: !0, children: /* @__PURE__ */ r(u, { icon: x, fontSize: 6, color: l.success.main }) })
81
80
  ]
82
81
  }
83
82
  );
84
83
  }
85
84
  export {
86
- R as default
85
+ T as default
87
86
  };