@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,61 +1,60 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { lazy as
|
|
3
|
-
import { Icon as
|
|
4
|
-
import { Backdrop as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { mergeSx as
|
|
11
|
-
import { LOGIN_PROVIDER as
|
|
12
|
-
import { useReactive as
|
|
13
|
-
import { translate as
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import { useLocaleContext as
|
|
17
|
-
import { useBrowser as
|
|
18
|
-
import
|
|
19
|
-
import { translations as
|
|
20
|
-
import g, { inputFieldStyle as
|
|
21
|
-
import { LinkPreviewInput as
|
|
22
|
-
import { defaultButtonStyle as
|
|
23
|
-
import { TimezoneSelect as
|
|
24
|
-
import
|
|
25
|
-
const
|
|
1
|
+
import { jsxs as y, Fragment as L, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { lazy as I, memo as ie, createElement as ae, useState as T, useRef as le, useEffect as de, useMemo as F } from "react";
|
|
3
|
+
import { Icon as ce } from "@iconify/react";
|
|
4
|
+
import { Backdrop as se, Box as m, useMediaQuery as pe, SwipeableDrawer as me, Typography as N, Tooltip as ue } from "@mui/material";
|
|
5
|
+
import he from "@emotion/styled";
|
|
6
|
+
import j from "@arcblock/ux/lib/Button";
|
|
7
|
+
import M, { detectCountryFromPhone as $, getCountryNameByCountry as fe, validatePhoneNumber as ye, getDialCodeByCountry as xe } from "@arcblock/ux/lib/PhoneInput";
|
|
8
|
+
import v from "lodash/cloneDeep";
|
|
9
|
+
import be from "lodash/omit";
|
|
10
|
+
import { mergeSx as ge } from "@arcblock/ux/lib/Util/style";
|
|
11
|
+
import { LOGIN_PROVIDER as G } from "@arcblock/ux/lib/Util/constant";
|
|
12
|
+
import { useReactive as w, useCreation as k, useMemoizedFn as Ce } from "ahooks";
|
|
13
|
+
import { translate as ve } from "@arcblock/ux/lib/Locale/util";
|
|
14
|
+
import we from "validator/lib/isEmail";
|
|
15
|
+
import H from "validator/lib/isPostalCode";
|
|
16
|
+
import { useLocaleContext as ke } from "@arcblock/ux/lib/Locale/context";
|
|
17
|
+
import { useBrowser as Ee } from "@arcblock/react-hooks";
|
|
18
|
+
import Ie from "@arcblock/ux/lib/UserCard/Content/clock";
|
|
19
|
+
import { translations as ze } from "../../libs/locales.js";
|
|
20
|
+
import g, { inputFieldStyle as Pe, commonInputStyle as Ve } from "../editable-field.js";
|
|
21
|
+
import { LinkPreviewInput as Be } from "./link-preview-input.js";
|
|
22
|
+
import { defaultButtonStyle as Q, currentTimezone as A, primaryButtonStyle as Le } from "./utils.js";
|
|
23
|
+
import { TimezoneSelect as Ne } from "./timezone-select.js";
|
|
24
|
+
import je from "./address.js";
|
|
25
|
+
const Ae = I(() => import("@arcblock/icons/lib/Location")), Se = I(() => import("@arcblock/icons/lib/Timezone")), Oe = I(() => import("@arcblock/icons/lib/Email")), We = I(() => import("@arcblock/icons/lib/Phone")), E = {
|
|
26
26
|
width: 20,
|
|
27
27
|
height: 20
|
|
28
|
-
},
|
|
29
|
-
ref:
|
|
30
|
-
...
|
|
28
|
+
}, U = 200, Y = ie(function({
|
|
29
|
+
ref: r,
|
|
30
|
+
...z
|
|
31
31
|
}) {
|
|
32
|
-
return /* @__PURE__ */
|
|
33
|
-
|
|
32
|
+
return /* @__PURE__ */ ae(
|
|
33
|
+
se,
|
|
34
34
|
{
|
|
35
|
-
ref:
|
|
35
|
+
ref: r,
|
|
36
36
|
component: "div",
|
|
37
37
|
style: {
|
|
38
38
|
backgroundColor: "rgba(0, 0, 0, 0.6)",
|
|
39
39
|
backdropFilter: "blur(3px)",
|
|
40
40
|
touchAction: "none"
|
|
41
41
|
},
|
|
42
|
-
...
|
|
42
|
+
...z,
|
|
43
43
|
key: "background"
|
|
44
44
|
}
|
|
45
45
|
);
|
|
46
46
|
});
|
|
47
|
-
|
|
48
|
-
function
|
|
49
|
-
isMyself:
|
|
50
|
-
user:
|
|
51
|
-
onSave:
|
|
52
|
-
isMobile:
|
|
47
|
+
Y.displayName = "BackdropWrap";
|
|
48
|
+
function so({
|
|
49
|
+
isMyself: s,
|
|
50
|
+
user: r,
|
|
51
|
+
onSave: z,
|
|
52
|
+
isMobile: x
|
|
53
53
|
}) {
|
|
54
|
-
|
|
55
|
-
const [Z, B] = H(!1), [oo, C] = H(!1), eo = fo(null), no = Lo(), u = bo("(max-width:640px)") || no.mobile.any, p = E({
|
|
54
|
+
const [_, P] = T(!1), [q, C] = T(!1), J = le(null), K = Ee(), b = pe("(max-width:640px)") || K.mobile.any, c = w({
|
|
56
55
|
email: "",
|
|
57
56
|
phone: ""
|
|
58
|
-
}),
|
|
57
|
+
}), u = w({
|
|
59
58
|
country: "",
|
|
60
59
|
province: "",
|
|
61
60
|
city: "",
|
|
@@ -63,20 +62,20 @@ function se({
|
|
|
63
62
|
line2: "",
|
|
64
63
|
postalCode: ""
|
|
65
64
|
});
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}, [
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
joinedAt:
|
|
72
|
-
email:
|
|
65
|
+
de(() => {
|
|
66
|
+
b || C(!1);
|
|
67
|
+
}, [b]);
|
|
68
|
+
const S = k(() => r?.phoneVerified ?? !1, [r?.phoneVerified]), O = k(() => r?.emailVerified ?? !1, [r?.emailVerified]), { locale: V } = ke(), d = Ce((o, n = {}) => ve(ze, o, V, "en", n)), a = w(
|
|
69
|
+
r?.metadata ? v(r.metadata) : {
|
|
70
|
+
joinedAt: r?.createdAt,
|
|
71
|
+
email: r?.email,
|
|
73
72
|
phone: {
|
|
74
73
|
country: "cn",
|
|
75
|
-
phoneNumber:
|
|
74
|
+
phoneNumber: r?.phone ?? ""
|
|
76
75
|
}
|
|
77
76
|
}
|
|
78
|
-
),
|
|
79
|
-
|
|
77
|
+
), l = w(
|
|
78
|
+
r?.address ? v(r.address) : {
|
|
80
79
|
country: "",
|
|
81
80
|
province: "",
|
|
82
81
|
city: "",
|
|
@@ -84,337 +83,328 @@ function se({
|
|
|
84
83
|
line2: "",
|
|
85
84
|
postalCode: ""
|
|
86
85
|
}
|
|
87
|
-
),
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}, [(G = o == null ? void 0 : o.address) == null ? void 0 : G.country, L]), N = I(() => {
|
|
91
|
-
const n = l.phone ?? (o == null ? void 0 : o.phone) ?? {
|
|
92
|
-
country: y,
|
|
86
|
+
), X = k(() => !!r?.address, [r?.address?.country]), h = F(() => r?.address?.country ? r.address.country : V === "zh" ? "cn" : "us", [r?.address?.country, V]), B = k(() => {
|
|
87
|
+
const o = a.phone ?? r?.phone ?? {
|
|
88
|
+
country: h,
|
|
93
89
|
phone: ""
|
|
94
90
|
};
|
|
95
|
-
if (
|
|
91
|
+
if (o && typeof o == "string")
|
|
96
92
|
return {
|
|
97
|
-
country:
|
|
98
|
-
phone:
|
|
93
|
+
country: $(o) || h,
|
|
94
|
+
phone: o
|
|
99
95
|
};
|
|
100
|
-
if (
|
|
101
|
-
const { country:
|
|
96
|
+
if (o && typeof o == "object") {
|
|
97
|
+
const { country: n = "", phoneNumber: e = "" } = o;
|
|
102
98
|
return {
|
|
103
|
-
country:
|
|
104
|
-
phone:
|
|
99
|
+
country: n || $(e) || "",
|
|
100
|
+
phone: e || ""
|
|
105
101
|
};
|
|
106
102
|
}
|
|
107
103
|
return {
|
|
108
|
-
country:
|
|
104
|
+
country: h,
|
|
109
105
|
phone: ""
|
|
110
106
|
};
|
|
111
|
-
}, [
|
|
112
|
-
|
|
113
|
-
},
|
|
114
|
-
|
|
115
|
-
},
|
|
116
|
-
|
|
117
|
-
},
|
|
118
|
-
const
|
|
119
|
-
|
|
120
|
-
const
|
|
121
|
-
|
|
107
|
+
}, [a.phone, r?.phone, h]), p = (o, n) => {
|
|
108
|
+
a[n] = o;
|
|
109
|
+
}, Z = (o, n) => {
|
|
110
|
+
l[o] = n, o === "city" && p(n, "location"), o === "postalCode" ? u.postalCode = n && !H(n, "any") ? d("profile.address.invalidPostalCode") : "" : u[o] = "";
|
|
111
|
+
}, W = () => {
|
|
112
|
+
b ? C(!0) : P(!0);
|
|
113
|
+
}, R = () => {
|
|
114
|
+
const o = v(r?.metadata) ?? {};
|
|
115
|
+
o && Object.keys(a).forEach((e) => {
|
|
116
|
+
const i = e;
|
|
117
|
+
a[i] = o[i];
|
|
122
118
|
});
|
|
123
|
-
const
|
|
124
|
-
|
|
125
|
-
const
|
|
126
|
-
|
|
127
|
-
}), [
|
|
128
|
-
Object.keys(
|
|
129
|
-
|
|
119
|
+
const n = v(r?.address) ?? {};
|
|
120
|
+
n && Object.keys(l).forEach((e) => {
|
|
121
|
+
const i = e;
|
|
122
|
+
l[i] = n[i];
|
|
123
|
+
}), [c, u].forEach((e) => {
|
|
124
|
+
Object.keys(e).forEach((i) => {
|
|
125
|
+
e[i] = "";
|
|
130
126
|
});
|
|
131
|
-
}),
|
|
132
|
-
},
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
var d;
|
|
139
|
-
if (!t)
|
|
127
|
+
}), b ? C(!1) : P(!1);
|
|
128
|
+
}, ee = F(() => {
|
|
129
|
+
const o = a?.links?.map((n) => n.url) || [""];
|
|
130
|
+
return o.length > 0 ? o : [""];
|
|
131
|
+
}, [a.links]), oe = (o) => {
|
|
132
|
+
const n = o.map((e) => {
|
|
133
|
+
if (!e)
|
|
140
134
|
return {
|
|
141
|
-
url:
|
|
135
|
+
url: e
|
|
142
136
|
};
|
|
143
|
-
const
|
|
144
|
-
return
|
|
145
|
-
...
|
|
146
|
-
url:
|
|
137
|
+
const i = a.links?.find((f) => f.url === e);
|
|
138
|
+
return i ? {
|
|
139
|
+
...i,
|
|
140
|
+
url: e
|
|
147
141
|
} : {
|
|
148
|
-
url:
|
|
149
|
-
favicon:
|
|
142
|
+
url: e,
|
|
143
|
+
favicon: e
|
|
150
144
|
};
|
|
151
145
|
});
|
|
152
|
-
|
|
153
|
-
},
|
|
154
|
-
if (Object.keys(
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
...po ? { phoneNumber: w.phoneNumber } : {}
|
|
146
|
+
p(n, "links");
|
|
147
|
+
}, ne = () => {
|
|
148
|
+
if (Object.keys(a).forEach((n) => {
|
|
149
|
+
const e = n, i = a[e];
|
|
150
|
+
if (i && typeof i == "string" && (a[e] = i.trim()), e === "bio" && (a[e] = a[e]?.slice(0, U)), e === "timezone" && (a[e] = i || A), e === "phone" && i && typeof i == "object") {
|
|
151
|
+
const f = i, te = xe(f.country), re = (f.phoneNumber?.replace(new RegExp(`^\\+${te}`), "") || "")?.trim().length > 0;
|
|
152
|
+
a[e] = {
|
|
153
|
+
country: f.country,
|
|
154
|
+
...re ? { phoneNumber: f.phoneNumber } : {}
|
|
162
155
|
};
|
|
163
156
|
}
|
|
164
|
-
}),
|
|
157
|
+
}), l.postalCode && !H(l.postalCode, "any") && (u.postalCode = d("profile.address.invalidPostalCode")), [c, u].some((n) => Object.values(n).some((e) => e)))
|
|
165
158
|
return;
|
|
166
|
-
const
|
|
167
|
-
|
|
168
|
-
},
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
style: {
|
|
193
|
-
...n ? { marginBottom: 8 } : {}
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
),
|
|
197
|
-
!n && m ? /* @__PURE__ */ a(
|
|
198
|
-
O,
|
|
199
|
-
{
|
|
200
|
-
size: b ? "small" : "large",
|
|
201
|
-
variant: "outlined",
|
|
202
|
-
sx: {
|
|
203
|
-
...J,
|
|
204
|
-
mb: b ? "4px" : 2,
|
|
205
|
-
mt: b ? "4px" : 2,
|
|
206
|
-
height: b ? "32px" : "40px"
|
|
207
|
-
},
|
|
208
|
-
onClick: T,
|
|
209
|
-
fullWidth: !0,
|
|
210
|
-
children: c("profile.editProfile")
|
|
211
|
-
}
|
|
212
|
-
) : null,
|
|
213
|
-
n && m && to ? /* @__PURE__ */ a(
|
|
214
|
-
Wo,
|
|
215
|
-
{
|
|
216
|
-
address: r,
|
|
217
|
-
errors: s,
|
|
218
|
-
handleChange: io,
|
|
219
|
-
defaultCountry: y
|
|
220
|
-
}
|
|
221
|
-
) : /* @__PURE__ */ a(
|
|
222
|
-
g,
|
|
223
|
-
{
|
|
224
|
-
value: l.location ?? ((t = o == null ? void 0 : o.address) == null ? void 0 : t.city) ?? "",
|
|
225
|
-
onChange: (e) => h(e, "location"),
|
|
226
|
-
editable: n,
|
|
227
|
-
placeholder: "Location",
|
|
228
|
-
label: c("profile.location"),
|
|
229
|
-
tooltip: m && (r.line1 || r.line2) ? /* @__PURE__ */ a(A, { children: ["line1", "line2"].map((e) => r[e] ? /* @__PURE__ */ x(f, { children: [
|
|
230
|
-
/* @__PURE__ */ a(
|
|
231
|
-
S,
|
|
232
|
-
{
|
|
233
|
-
variant: "caption",
|
|
234
|
-
component: "p",
|
|
235
|
-
sx: {
|
|
236
|
-
fontWeight: 600,
|
|
237
|
-
mb: 0
|
|
238
|
-
},
|
|
239
|
-
children: c(`profile.address.${e}`)
|
|
240
|
-
}
|
|
241
|
-
),
|
|
242
|
-
/* @__PURE__ */ a(S, { variant: "caption", component: "span", children: r[e] })
|
|
243
|
-
] }, e) : null) }) : null,
|
|
244
|
-
renderValue: () => {
|
|
245
|
-
const d = [r != null && r.country ? vo(r == null ? void 0 : r.country) : "", r.province, r.city || l.location || ""].filter(Boolean).join(" ");
|
|
246
|
-
return /* @__PURE__ */ a(S, { component: "span", children: d });
|
|
247
|
-
},
|
|
248
|
-
icon: /* @__PURE__ */ a(To, { ...z })
|
|
159
|
+
const o = be(l, "detailedAddress");
|
|
160
|
+
o.country || (o.country = h), z({ metadata: a, address: o }), P(!1), C(!1);
|
|
161
|
+
}, D = (o, n = "self") => /* @__PURE__ */ y(
|
|
162
|
+
Re,
|
|
163
|
+
{
|
|
164
|
+
pt: 2,
|
|
165
|
+
display: "flex",
|
|
166
|
+
flexDirection: "column",
|
|
167
|
+
justifyContent: "space-between",
|
|
168
|
+
alignItems: "flex-start",
|
|
169
|
+
gap: x ? "4px" : "16px",
|
|
170
|
+
children: [
|
|
171
|
+
/* @__PURE__ */ t(
|
|
172
|
+
g,
|
|
173
|
+
{
|
|
174
|
+
value: a.bio ?? "",
|
|
175
|
+
onChange: (e) => p(e, "bio"),
|
|
176
|
+
editable: o,
|
|
177
|
+
placeholder: "Bio",
|
|
178
|
+
component: "textarea",
|
|
179
|
+
inline: !1,
|
|
180
|
+
rows: 3,
|
|
181
|
+
label: d("profile.bio"),
|
|
182
|
+
maxLength: U,
|
|
183
|
+
style: {
|
|
184
|
+
...o ? { marginBottom: 8 } : {}
|
|
249
185
|
}
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
186
|
+
}
|
|
187
|
+
),
|
|
188
|
+
!o && s ? /* @__PURE__ */ t(
|
|
189
|
+
j,
|
|
190
|
+
{
|
|
191
|
+
size: x ? "small" : "large",
|
|
192
|
+
variant: "outlined",
|
|
193
|
+
sx: {
|
|
194
|
+
...Q,
|
|
195
|
+
mb: x ? "4px" : 2,
|
|
196
|
+
mt: x ? "4px" : 2,
|
|
197
|
+
height: x ? "32px" : "40px"
|
|
198
|
+
},
|
|
199
|
+
onClick: W,
|
|
200
|
+
fullWidth: !0,
|
|
201
|
+
children: d("profile.editProfile")
|
|
202
|
+
}
|
|
203
|
+
) : null,
|
|
204
|
+
o && s && X ? /* @__PURE__ */ t(
|
|
205
|
+
je,
|
|
206
|
+
{
|
|
207
|
+
address: l,
|
|
208
|
+
errors: u,
|
|
209
|
+
handleChange: Z,
|
|
210
|
+
defaultCountry: h
|
|
211
|
+
}
|
|
212
|
+
) : /* @__PURE__ */ t(
|
|
213
|
+
g,
|
|
214
|
+
{
|
|
215
|
+
value: a.location ?? r?.address?.city ?? "",
|
|
216
|
+
onChange: (e) => p(e, "location"),
|
|
217
|
+
editable: o,
|
|
218
|
+
placeholder: "Location",
|
|
219
|
+
label: d("profile.location"),
|
|
220
|
+
tooltip: s && (l.line1 || l.line2) ? /* @__PURE__ */ t(L, { children: ["line1", "line2"].map((e) => l[e] ? /* @__PURE__ */ y(m, { children: [
|
|
221
|
+
/* @__PURE__ */ t(
|
|
222
|
+
N,
|
|
263
223
|
{
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
224
|
+
variant: "caption",
|
|
225
|
+
component: "p",
|
|
226
|
+
sx: {
|
|
227
|
+
fontWeight: 600,
|
|
228
|
+
mb: 0
|
|
229
|
+
},
|
|
230
|
+
children: d(`profile.address.${e}`)
|
|
268
231
|
}
|
|
269
|
-
)
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
232
|
+
),
|
|
233
|
+
/* @__PURE__ */ t(N, { variant: "caption", component: "span", children: l[e] })
|
|
234
|
+
] }, e) : null) }) : null,
|
|
235
|
+
renderValue: () => {
|
|
236
|
+
const i = [l?.country ? fe(l?.country) : "", l.province, l.city || a.location || ""].filter(Boolean).join(" ");
|
|
237
|
+
return /* @__PURE__ */ t(N, { component: "span", children: i });
|
|
238
|
+
},
|
|
239
|
+
icon: /* @__PURE__ */ t(Ae, { ...E })
|
|
240
|
+
}
|
|
241
|
+
),
|
|
242
|
+
/* @__PURE__ */ t(
|
|
243
|
+
g,
|
|
244
|
+
{
|
|
245
|
+
value: a.timezone || A,
|
|
246
|
+
onChange: (e) => p(e, "timezone"),
|
|
247
|
+
editable: o,
|
|
248
|
+
placeholder: "timezone",
|
|
249
|
+
icon: /* @__PURE__ */ t(Se, { ...E }),
|
|
250
|
+
label: d("profile.timezone"),
|
|
251
|
+
renderValue: (e) => /* @__PURE__ */ t(Ie, { value: e }),
|
|
252
|
+
children: /* @__PURE__ */ t(
|
|
253
|
+
Ne,
|
|
254
|
+
{
|
|
255
|
+
value: a.timezone || A,
|
|
256
|
+
onChange: (e) => p(e, "timezone"),
|
|
257
|
+
disabled: !o,
|
|
258
|
+
mode: n
|
|
259
|
+
}
|
|
260
|
+
)
|
|
261
|
+
}
|
|
262
|
+
),
|
|
263
|
+
/* @__PURE__ */ t(
|
|
264
|
+
g,
|
|
265
|
+
{
|
|
266
|
+
value: a.email ?? r?.email ?? "",
|
|
267
|
+
editable: o,
|
|
268
|
+
hidePreview: !s,
|
|
269
|
+
disabled: r?.sourceProvider === G.EMAIL,
|
|
270
|
+
canEdit: !O,
|
|
271
|
+
verified: O,
|
|
272
|
+
placeholder: "Email",
|
|
273
|
+
icon: /* @__PURE__ */ t(Oe, { ...E }),
|
|
274
|
+
label: /* @__PURE__ */ y(L, { children: [
|
|
275
|
+
d("profile.email"),
|
|
276
|
+
r?.sourceProvider === G.EMAIL ? /* @__PURE__ */ t(ue, { title: d("profile.emailSourceProviderNotAllowEdit"), children: /* @__PURE__ */ t(
|
|
277
|
+
m,
|
|
301
278
|
{
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
279
|
+
component: ce,
|
|
280
|
+
icon: "mdi:info-outline",
|
|
281
|
+
sx: {
|
|
282
|
+
verticalAlign: "middle",
|
|
283
|
+
ml: 0.25
|
|
284
|
+
}
|
|
308
285
|
}
|
|
309
|
-
) : null
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
286
|
+
) }) : null
|
|
287
|
+
] }),
|
|
288
|
+
onChange: (e) => p(e, "email"),
|
|
289
|
+
errorMsg: c.email,
|
|
290
|
+
renderValue: (e) => s ? /* @__PURE__ */ t(
|
|
291
|
+
"a",
|
|
292
|
+
{
|
|
293
|
+
href: `mailto:${e}`,
|
|
294
|
+
style: {
|
|
295
|
+
color: "inherit",
|
|
296
|
+
textDecoration: "none"
|
|
297
|
+
},
|
|
298
|
+
children: e
|
|
313
299
|
}
|
|
300
|
+
) : null,
|
|
301
|
+
onValueValidate: (e) => {
|
|
302
|
+
let i = "";
|
|
303
|
+
e && !we(e) && (i = d("profile.emailInvalid")), c.email = i;
|
|
314
304
|
}
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
305
|
+
}
|
|
306
|
+
),
|
|
307
|
+
/* @__PURE__ */ t(
|
|
308
|
+
g,
|
|
309
|
+
{
|
|
310
|
+
value: B.phone,
|
|
311
|
+
editable: o,
|
|
312
|
+
hidePreview: !s,
|
|
313
|
+
canEdit: !S,
|
|
314
|
+
verified: S,
|
|
315
|
+
placeholder: "Phone",
|
|
316
|
+
icon: /* @__PURE__ */ t(We, { ...E }),
|
|
317
|
+
onChange: (e) => p(e, "phone"),
|
|
318
|
+
label: d("profile.phone"),
|
|
319
|
+
renderValue: () => s ? /* @__PURE__ */ t(M, { value: B, preview: !0 }) : null,
|
|
320
|
+
children: /* @__PURE__ */ t(
|
|
321
|
+
M,
|
|
322
|
+
{
|
|
323
|
+
variant: "outlined",
|
|
324
|
+
className: "editable-field",
|
|
325
|
+
InputProps: {
|
|
326
|
+
sx: { backgroundColor: "transparent" },
|
|
327
|
+
placeholder: "Phone"
|
|
328
|
+
},
|
|
329
|
+
value: B,
|
|
330
|
+
error: !!c.phone,
|
|
331
|
+
helperText: c.phone,
|
|
332
|
+
sx: ge(Pe, c.phone ? {} : Ve),
|
|
333
|
+
onChange: (e) => {
|
|
334
|
+
ye(e.phone, e.country) ? c.phone = "" : c.phone = d("profile.phoneInvalid"), p(
|
|
335
|
+
{
|
|
336
|
+
country: e.country,
|
|
337
|
+
phoneNumber: e.phone
|
|
338
|
+
},
|
|
339
|
+
"phone"
|
|
340
|
+
);
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
)
|
|
344
|
+
}
|
|
345
|
+
),
|
|
346
|
+
/* @__PURE__ */ t(Be, { editable: o, links: ee, onChange: oe }),
|
|
347
|
+
o && s ? /* @__PURE__ */ y(
|
|
348
|
+
m,
|
|
349
|
+
{
|
|
350
|
+
style: { width: "100%" },
|
|
351
|
+
sx: {
|
|
352
|
+
display: "flex",
|
|
353
|
+
gap: 1,
|
|
354
|
+
justifyContent: "flex-end",
|
|
355
|
+
flexDirection: n === "drawer" ? "column" : "row"
|
|
356
|
+
},
|
|
357
|
+
children: [
|
|
358
|
+
/* @__PURE__ */ t(
|
|
359
|
+
j,
|
|
331
360
|
{
|
|
361
|
+
fullWidth: n === "drawer",
|
|
362
|
+
size: "small",
|
|
332
363
|
variant: "outlined",
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
364
|
+
sx: { ...Q, minWidth: "54px" },
|
|
365
|
+
onClick: R,
|
|
366
|
+
children: d("common.cancel")
|
|
367
|
+
}
|
|
368
|
+
),
|
|
369
|
+
/* @__PURE__ */ t(
|
|
370
|
+
j,
|
|
371
|
+
{
|
|
372
|
+
fullWidth: n === "drawer",
|
|
373
|
+
size: "small",
|
|
374
|
+
disabled: !!c.email || !!c.phone,
|
|
375
|
+
variant: "outlined",
|
|
376
|
+
sx: {
|
|
377
|
+
...Le,
|
|
378
|
+
minWidth: "54px",
|
|
379
|
+
"&.Mui-disabled": {
|
|
380
|
+
backgroundColor: "rgba(0, 0, 0, 0.12)"
|
|
381
|
+
}
|
|
337
382
|
},
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
helperText: p.phone,
|
|
341
|
-
sx: Io(Ao, p.phone ? {} : So),
|
|
342
|
-
onChange: (e) => {
|
|
343
|
-
wo(e.phone, e.country) ? p.phone = "" : p.phone = c("profile.phoneInvalid"), h(
|
|
344
|
-
{
|
|
345
|
-
country: e.country,
|
|
346
|
-
phoneNumber: e.phone
|
|
347
|
-
},
|
|
348
|
-
"phone"
|
|
349
|
-
);
|
|
350
|
-
}
|
|
383
|
+
onClick: ne,
|
|
384
|
+
children: d("common.save")
|
|
351
385
|
}
|
|
352
386
|
)
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
justifyContent: "flex-end",
|
|
364
|
-
flexDirection: i === "drawer" ? "column" : "row"
|
|
365
|
-
},
|
|
366
|
-
children: [
|
|
367
|
-
/* @__PURE__ */ a(
|
|
368
|
-
O,
|
|
369
|
-
{
|
|
370
|
-
fullWidth: i === "drawer",
|
|
371
|
-
size: "small",
|
|
372
|
-
variant: "outlined",
|
|
373
|
-
sx: { ...J, minWidth: "54px" },
|
|
374
|
-
onClick: F,
|
|
375
|
-
children: c("common.cancel")
|
|
376
|
-
}
|
|
377
|
-
),
|
|
378
|
-
/* @__PURE__ */ a(
|
|
379
|
-
O,
|
|
380
|
-
{
|
|
381
|
-
fullWidth: i === "drawer",
|
|
382
|
-
size: "small",
|
|
383
|
-
disabled: !!p.email || !!p.phone,
|
|
384
|
-
variant: "outlined",
|
|
385
|
-
sx: {
|
|
386
|
-
...Ro,
|
|
387
|
-
minWidth: "54px",
|
|
388
|
-
"&.Mui-disabled": {
|
|
389
|
-
backgroundColor: "rgba(0, 0, 0, 0.12)"
|
|
390
|
-
}
|
|
391
|
-
},
|
|
392
|
-
onClick: ro,
|
|
393
|
-
children: c("common.save")
|
|
394
|
-
}
|
|
395
|
-
)
|
|
396
|
-
]
|
|
397
|
-
}
|
|
398
|
-
) : null
|
|
399
|
-
]
|
|
400
|
-
}
|
|
401
|
-
);
|
|
402
|
-
};
|
|
403
|
-
return /* @__PURE__ */ x(A, { children: [
|
|
404
|
-
M(Z),
|
|
405
|
-
u && /* @__PURE__ */ x(
|
|
406
|
-
uo,
|
|
387
|
+
]
|
|
388
|
+
}
|
|
389
|
+
) : null
|
|
390
|
+
]
|
|
391
|
+
}
|
|
392
|
+
);
|
|
393
|
+
return /* @__PURE__ */ y(L, { children: [
|
|
394
|
+
D(_),
|
|
395
|
+
b && /* @__PURE__ */ y(
|
|
396
|
+
me,
|
|
407
397
|
{
|
|
408
398
|
sx: {
|
|
409
399
|
zIndex: 9999
|
|
410
400
|
},
|
|
411
401
|
disableSwipeToOpen: !0,
|
|
412
|
-
onOpen:
|
|
413
|
-
open:
|
|
402
|
+
onOpen: W,
|
|
403
|
+
open: q,
|
|
414
404
|
anchor: "bottom",
|
|
415
|
-
onClose:
|
|
405
|
+
onClose: R,
|
|
416
406
|
slots: {
|
|
417
|
-
backdrop:
|
|
407
|
+
backdrop: Y
|
|
418
408
|
},
|
|
419
409
|
slotProps: {
|
|
420
410
|
paper: {
|
|
@@ -428,17 +418,17 @@ function se({
|
|
|
428
418
|
}
|
|
429
419
|
},
|
|
430
420
|
children: [
|
|
431
|
-
/* @__PURE__ */
|
|
432
|
-
|
|
421
|
+
/* @__PURE__ */ t(
|
|
422
|
+
m,
|
|
433
423
|
{
|
|
434
|
-
ref:
|
|
424
|
+
ref: J,
|
|
435
425
|
sx: {
|
|
436
426
|
padding: "16px 32px",
|
|
437
427
|
margin: "-8px auto -16px",
|
|
438
428
|
zIndex: 1
|
|
439
429
|
},
|
|
440
|
-
children: /* @__PURE__ */
|
|
441
|
-
|
|
430
|
+
children: /* @__PURE__ */ t(
|
|
431
|
+
m,
|
|
442
432
|
{
|
|
443
433
|
sx: {
|
|
444
434
|
width: "48px",
|
|
@@ -450,15 +440,15 @@ function se({
|
|
|
450
440
|
)
|
|
451
441
|
}
|
|
452
442
|
),
|
|
453
|
-
/* @__PURE__ */
|
|
454
|
-
|
|
443
|
+
/* @__PURE__ */ t(
|
|
444
|
+
m,
|
|
455
445
|
{
|
|
456
446
|
sx: {
|
|
457
447
|
p: 2,
|
|
458
448
|
maxHeight: "500px",
|
|
459
449
|
overflowY: "auto"
|
|
460
450
|
},
|
|
461
|
-
children:
|
|
451
|
+
children: D(!0, "drawer")
|
|
462
452
|
}
|
|
463
453
|
)
|
|
464
454
|
]
|
|
@@ -466,7 +456,7 @@ function se({
|
|
|
466
456
|
)
|
|
467
457
|
] });
|
|
468
458
|
}
|
|
469
|
-
const
|
|
459
|
+
const Re = he(m)`
|
|
470
460
|
width: 100%;
|
|
471
461
|
|
|
472
462
|
.MuiOutlinedInput-root {
|
|
@@ -505,5 +495,5 @@ const Go = Co(f)`
|
|
|
505
495
|
}
|
|
506
496
|
`;
|
|
507
497
|
export {
|
|
508
|
-
|
|
498
|
+
so as default
|
|
509
499
|
};
|