@ethora/chat-component 26.7.6 → 26.7.7
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/dist/ChatProfileModal-DehQM4Bo.js +2135 -0
- package/dist/FilePreviewModal-BcZLtVAy.js +743 -0
- package/dist/{ManageDataModal-CDPXcC93.js → ManageDataModal-DWabKhSC.js} +68 -49
- package/dist/{MarkdownBody-DBJGraWM.js → MarkdownBody-CSY3YKDh.js} +1 -1
- package/dist/{SideDrawer-Dr_lkaOW.js → SideDrawer-DewJ-iPn.js} +110 -66
- package/dist/UserProfileModal-BHZ0TULc.js +574 -0
- package/dist/{UserSettingsModal-OcAJao-d.js → UserSettingsModal-BxwVWNKo.js} +2 -2
- package/dist/{VideoCallOverlay-CC4sShdK.js → VideoCallOverlay-D5SuimGP.js} +1 -1
- package/dist/{VisibilityModal-DkMhx_2k.js → VisibilityModal-Bd67b4EM.js} +2 -2
- package/dist/components/MainComponents/ChatRoomOpeningPreview.d.ts +24 -0
- package/dist/components/MainComponents/ChatWrapper.d.ts +1 -0
- package/dist/components/MainComponents/ChooseChatMessage.d.ts +11 -1
- package/dist/components/Modals/Modal/Modal.d.ts +10 -0
- package/dist/components/Modals/Modal/ModalContent.d.ts +21 -0
- package/dist/components/Modals/ModalBox/ModalBox.d.ts +9 -0
- package/dist/components/Modals/ModalReportChat/ModalReportChat.d.ts +6 -1
- package/dist/components/Modals/ModalWrapper/ModalWrapper.d.ts +8 -0
- package/dist/components/Modals/SettingsModals/SharedStyledComponents.d.ts +12 -0
- package/dist/components/Modals/SideDrawer/DrawerProfileParts.d.ts +29 -0
- package/dist/components/Modals/SideDrawer/SideDrawer.d.ts +21 -1
- package/dist/components/Modals/SidePanel/SidePanel.d.ts +31 -0
- package/dist/components/Modals/UserProfileModal/EditUserModal.d.ts +5 -1
- package/dist/components/Modals/motionVariants.d.ts +37 -0
- package/dist/components/Modals/styledModalComponents.d.ts +0 -1
- package/dist/context/ModalTransitionContext.d.ts +2 -0
- package/dist/handleCopyClick-BoZWTBLC.js +108 -0
- package/dist/helpers/buildChatShareLink.d.ts +20 -0
- package/dist/helpers/cacheScope.d.ts +15 -1
- package/dist/helpers/constants/MODAL_TYPES.d.ts +6 -4
- package/dist/helpers/createRoomFromApi.d.ts +1 -1
- package/dist/helpers/formatNumberWithCommas.d.ts +1 -1
- package/dist/hooks/useChatOpenPhase.d.ts +21 -0
- package/dist/hooks/useDelayedAction.d.ts +22 -0
- package/dist/hooks/useExclusiveRightPane.d.ts +25 -0
- package/dist/hooks/useExitTransition.d.ts +24 -0
- package/dist/hooks/useGetNewArchRoom.d.ts +3 -1
- package/dist/hooks/useQRCodeChatHandler.d.ts +29 -1
- package/dist/{main-B-8IhwaP.js → main-C2FKeV6y.js} +8107 -7569
- package/dist/main.css +1 -1
- package/dist/main.js +5 -5
- package/dist/styles/motion.d.ts +27 -0
- package/dist/types/models/room.model.d.ts +28 -0
- package/package.json +1 -1
- package/dist/ChatProfileModal-hxsWI8cx.js +0 -2139
- package/dist/FilePreviewModal-CwWnHsB1.js +0 -736
- package/dist/UserProfileModal-Q_jhXpsX.js +0 -568
- package/dist/handleCopyClick-CpmPa6VI.js +0 -32
|
@@ -1,568 +0,0 @@
|
|
|
1
|
-
import { jsxs as u, Fragment as H, jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { useState as C, useRef as de, useCallback as D, useMemo as T } from "react";
|
|
3
|
-
import { a as pe, n as J, p as me, B as W, C as fe, P as re, I as L, q as he, t as ue, v as ge, w as ve, x as N, y as be, z as ye, D as te, E as xe, F as Ce, G as we, J as Se, u as q, K as Ie, L as De, N as Ne, O as Ue, Q as _, o as Q, R as ke, S as Ae, T as Pe, s as ze, U as Re, W as je, X as Be, Y, Z as j, _ as Fe, V as $e, A as Oe, $ as Ee, a0 as Te, a1 as Le, a2 as Me } from "./main-B-8IhwaP.js";
|
|
4
|
-
import { D as M, a as X, b as Z, e as ee, f as oe, S as Xe } from "./SideDrawer-Dr_lkaOW.js";
|
|
5
|
-
import { P as He, a as We, b as Je, h as Ke } from "./handleCopyClick-CpmPa6VI.js";
|
|
6
|
-
const Ve = (l, n) => {
|
|
7
|
-
const s = atob(l.split(",")[1]), m = new ArrayBuffer(s.length), e = new Uint8Array(m);
|
|
8
|
-
for (let i = 0; i < s.length; i++)
|
|
9
|
-
e[i] = s.charCodeAt(i);
|
|
10
|
-
const c = new Blob([e], { type: "image/jpeg" });
|
|
11
|
-
return new File([c], n, { type: "image/jpeg" });
|
|
12
|
-
}, Ge = ({
|
|
13
|
-
setIsEditing: l,
|
|
14
|
-
modalUser: n,
|
|
15
|
-
config: s
|
|
16
|
-
}) => {
|
|
17
|
-
const m = pe(), e = J(), [c, i] = C(n?.firstName || ""), [a, v] = C(n?.lastName || ""), [w, S] = C(n?.description || ""), [g, b] = C(
|
|
18
|
-
n?.profileImage
|
|
19
|
-
), y = async () => {
|
|
20
|
-
try {
|
|
21
|
-
let t = new FormData();
|
|
22
|
-
if (typeof g == "string" && g.startsWith("data:image/")) {
|
|
23
|
-
const U = Ve(g, "profileImage.jpg");
|
|
24
|
-
t.append("file", U);
|
|
25
|
-
} else g instanceof File && t.append("file", g);
|
|
26
|
-
t.append("firstName", c), t.append("lastName", a), t.append("description", w);
|
|
27
|
-
const { user: k } = await he(t);
|
|
28
|
-
m(
|
|
29
|
-
ue({
|
|
30
|
-
updates: {
|
|
31
|
-
firstName: c,
|
|
32
|
-
lastName: a,
|
|
33
|
-
description: w,
|
|
34
|
-
profileImage: k?.profileImage
|
|
35
|
-
}
|
|
36
|
-
})
|
|
37
|
-
), l(!1);
|
|
38
|
-
} catch (t) {
|
|
39
|
-
ge.log("error", t);
|
|
40
|
-
}
|
|
41
|
-
}, x = (t) => {
|
|
42
|
-
b(t);
|
|
43
|
-
};
|
|
44
|
-
return /* @__PURE__ */ u(H, { children: [
|
|
45
|
-
/* @__PURE__ */ o(
|
|
46
|
-
me,
|
|
47
|
-
{
|
|
48
|
-
leftMenu: /* @__PURE__ */ o(
|
|
49
|
-
W,
|
|
50
|
-
{
|
|
51
|
-
onClick: () => l(!1),
|
|
52
|
-
style: { padding: "13px 8px", width: "100%" },
|
|
53
|
-
children: e("action.cancel")
|
|
54
|
-
}
|
|
55
|
-
),
|
|
56
|
-
rightMenu: /* @__PURE__ */ o(
|
|
57
|
-
W,
|
|
58
|
-
{
|
|
59
|
-
onClick: y,
|
|
60
|
-
variant: "outlined",
|
|
61
|
-
style: { width: "128px" },
|
|
62
|
-
children: e("action.save")
|
|
63
|
-
}
|
|
64
|
-
)
|
|
65
|
-
}
|
|
66
|
-
),
|
|
67
|
-
/* @__PURE__ */ o(fe, { children: /* @__PURE__ */ o(
|
|
68
|
-
re,
|
|
69
|
-
{
|
|
70
|
-
icon: g,
|
|
71
|
-
name: `${c} ${a}`,
|
|
72
|
-
size: 120,
|
|
73
|
-
upload: {
|
|
74
|
-
onUpload: x,
|
|
75
|
-
active: !0
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
) }),
|
|
79
|
-
/* @__PURE__ */ u(
|
|
80
|
-
"div",
|
|
81
|
-
{
|
|
82
|
-
style: {
|
|
83
|
-
boxSizing: "border-box",
|
|
84
|
-
display: "flex",
|
|
85
|
-
flexDirection: "column",
|
|
86
|
-
gap: "32px",
|
|
87
|
-
width: "52%",
|
|
88
|
-
justifyContent: "center",
|
|
89
|
-
alignItems: "center"
|
|
90
|
-
},
|
|
91
|
-
children: [
|
|
92
|
-
/* @__PURE__ */ o(
|
|
93
|
-
L,
|
|
94
|
-
{
|
|
95
|
-
color: s?.colors?.primary,
|
|
96
|
-
colorBg: s?.colors?.colorInput,
|
|
97
|
-
placeholder: e("field.firstName"),
|
|
98
|
-
label: e("field.firstName"),
|
|
99
|
-
value: c,
|
|
100
|
-
onChange: (t) => i(t.target.value)
|
|
101
|
-
}
|
|
102
|
-
),
|
|
103
|
-
/* @__PURE__ */ o(
|
|
104
|
-
L,
|
|
105
|
-
{
|
|
106
|
-
color: s?.colors?.primary,
|
|
107
|
-
colorBg: s?.colors?.colorInput,
|
|
108
|
-
placeholder: e("field.lastName"),
|
|
109
|
-
label: e("field.lastName"),
|
|
110
|
-
value: a,
|
|
111
|
-
onChange: (t) => v(t.target.value)
|
|
112
|
-
}
|
|
113
|
-
),
|
|
114
|
-
/* @__PURE__ */ o(
|
|
115
|
-
L,
|
|
116
|
-
{
|
|
117
|
-
color: s?.colors?.primary,
|
|
118
|
-
colorBg: s?.colors?.colorInput,
|
|
119
|
-
placeholder: e("modal.profile.about"),
|
|
120
|
-
label: e("modal.profile.about"),
|
|
121
|
-
value: w,
|
|
122
|
-
onChange: (t) => S(t.target.value)
|
|
123
|
-
}
|
|
124
|
-
)
|
|
125
|
-
]
|
|
126
|
-
}
|
|
127
|
-
)
|
|
128
|
-
] });
|
|
129
|
-
}, qe = te`
|
|
130
|
-
from {
|
|
131
|
-
transform: rotate(0deg);
|
|
132
|
-
}
|
|
133
|
-
to {
|
|
134
|
-
transform: rotate(180deg);
|
|
135
|
-
}
|
|
136
|
-
`, _e = te`
|
|
137
|
-
from {
|
|
138
|
-
transform: rotate(180deg);
|
|
139
|
-
}
|
|
140
|
-
to {
|
|
141
|
-
transform: rotate(0deg);
|
|
142
|
-
}
|
|
143
|
-
`, Qe = N.div`
|
|
144
|
-
position: relative;
|
|
145
|
-
width: 100%;
|
|
146
|
-
`, Ye = N.div`
|
|
147
|
-
border: 1px solid
|
|
148
|
-
${({ $borderColor: l, $isOpen: n }) => n ? l || "var(--ethora-color-primary, #0052cd)" : l || "var(--ethora-color-border, #e6e8ec)"};
|
|
149
|
-
padding: 0 16px;
|
|
150
|
-
height: 48px;
|
|
151
|
-
box-sizing: border-box;
|
|
152
|
-
display: flex;
|
|
153
|
-
justify-content: space-between;
|
|
154
|
-
align-items: center;
|
|
155
|
-
cursor: pointer;
|
|
156
|
-
background-color: var(--ethora-color-bg, #fff);
|
|
157
|
-
color: var(--ethora-color-text, #141414);
|
|
158
|
-
font-size: var(--ethora-font-size, 16px);
|
|
159
|
-
border-radius: var(--ethora-radius-md, 16px);
|
|
160
|
-
transition:
|
|
161
|
-
border-color var(--ethora-motion-fast, 150ms) var(--ethora-motion-ease, ease),
|
|
162
|
-
box-shadow var(--ethora-motion-fast, 150ms) var(--ethora-motion-ease, ease);
|
|
163
|
-
|
|
164
|
-
${({ $isOpen: l }) => l && be`
|
|
165
|
-
outline: 2px solid var(--ethora-color-primary, #0052cd);
|
|
166
|
-
outline-offset: 1px;
|
|
167
|
-
`}
|
|
168
|
-
|
|
169
|
-
&:focus-visible {
|
|
170
|
-
outline: 2px solid var(--ethora-color-primary, #0052cd);
|
|
171
|
-
outline-offset: 1px;
|
|
172
|
-
}
|
|
173
|
-
`, Ze = N.span`
|
|
174
|
-
color: var(--ethora-color-text-muted, #8c8c8c);
|
|
175
|
-
`, eo = N.span`
|
|
176
|
-
margin-left: 10px;
|
|
177
|
-
display: inline-block;
|
|
178
|
-
color: var(--ethora-color-text-muted, #8c8c8c);
|
|
179
|
-
font-size: 12px;
|
|
180
|
-
animation: ${(l) => l.$isOpen ? qe : _e} 0.3s ease
|
|
181
|
-
forwards;
|
|
182
|
-
`, oo = N.div`
|
|
183
|
-
position: absolute;
|
|
184
|
-
top: 100%;
|
|
185
|
-
left: 0;
|
|
186
|
-
right: 0;
|
|
187
|
-
border: 1px solid var(--ethora-color-border, #e6e8ec);
|
|
188
|
-
background-color: var(--ethora-color-bg, #fff);
|
|
189
|
-
max-height: 200px;
|
|
190
|
-
overflow-y: auto;
|
|
191
|
-
margin-top: 4px;
|
|
192
|
-
border-radius: var(--ethora-radius-md, 16px);
|
|
193
|
-
box-shadow: var(--ethora-shadow-md, 0 4px 12px rgba(16, 24, 40, 0.1));
|
|
194
|
-
z-index: 100;
|
|
195
|
-
${ye}
|
|
196
|
-
`, ao = N.input`
|
|
197
|
-
width: 100%;
|
|
198
|
-
padding: 12px 16px;
|
|
199
|
-
border: none;
|
|
200
|
-
border-bottom: 1px solid var(--ethora-color-border, #e6e8ec);
|
|
201
|
-
outline: none;
|
|
202
|
-
box-sizing: border-box;
|
|
203
|
-
font-size: var(--ethora-font-size-sm, 14px);
|
|
204
|
-
background: transparent;
|
|
205
|
-
color: var(--ethora-color-text, #141414);
|
|
206
|
-
|
|
207
|
-
&::placeholder {
|
|
208
|
-
color: var(--ethora-color-text-muted, #8c8c8c);
|
|
209
|
-
}
|
|
210
|
-
`, ae = N.div`
|
|
211
|
-
padding: 12px 16px;
|
|
212
|
-
cursor: pointer;
|
|
213
|
-
font-size: var(--ethora-font-size-sm, 14px);
|
|
214
|
-
color: var(--ethora-color-text, #141414);
|
|
215
|
-
background-color: ${({ $selected: l }) => l ? "var(--ethora-color-primary-soft, #e7edf9)" : "transparent"};
|
|
216
|
-
transition: background-color var(--ethora-motion-fast, 150ms);
|
|
217
|
-
|
|
218
|
-
&:hover {
|
|
219
|
-
background-color: ${({ $selected: l }) => l ? "var(--ethora-color-primary-soft, #e7edf9)" : "var(--ethora-color-bg-hover, #f0f2f5)"};
|
|
220
|
-
}
|
|
221
|
-
`, ro = ({
|
|
222
|
-
options: l,
|
|
223
|
-
placeholder: n,
|
|
224
|
-
onSelect: s,
|
|
225
|
-
accentColor: m,
|
|
226
|
-
selectedValue: e
|
|
227
|
-
}) => {
|
|
228
|
-
const c = J(), [i, a] = C(!1), [v, w] = C(
|
|
229
|
-
e
|
|
230
|
-
), [S, g] = C(""), b = de(null), y = () => a((r) => !r), x = (r) => {
|
|
231
|
-
w(r), s(r), a(!1), g("");
|
|
232
|
-
}, t = l.filter(
|
|
233
|
-
(r) => r.name.toLowerCase().includes(S.toLowerCase())
|
|
234
|
-
), k = D(() => a(!1), []);
|
|
235
|
-
ve({
|
|
236
|
-
enabled: i,
|
|
237
|
-
onClose: k,
|
|
238
|
-
kind: "menu",
|
|
239
|
-
insideRefs: [b],
|
|
240
|
-
closeOnOutsidePress: !0
|
|
241
|
-
});
|
|
242
|
-
const U = (r) => {
|
|
243
|
-
r.key === "Enter" || r.key === " " ? (r.preventDefault(), y()) : r.key === "Escape" && i && a(!1);
|
|
244
|
-
}, B = (r, A) => {
|
|
245
|
-
(r.key === "Enter" || r.key === " ") && (r.preventDefault(), x(A));
|
|
246
|
-
};
|
|
247
|
-
return /* @__PURE__ */ u(Qe, { ref: b, children: [
|
|
248
|
-
/* @__PURE__ */ u(
|
|
249
|
-
Ye,
|
|
250
|
-
{
|
|
251
|
-
$isOpen: i,
|
|
252
|
-
onClick: y,
|
|
253
|
-
onKeyDown: U,
|
|
254
|
-
$borderColor: m,
|
|
255
|
-
role: "button",
|
|
256
|
-
tabIndex: 0,
|
|
257
|
-
"aria-haspopup": "listbox",
|
|
258
|
-
"aria-expanded": i,
|
|
259
|
-
children: [
|
|
260
|
-
v ? /* @__PURE__ */ o("span", { children: v.name }) : /* @__PURE__ */ o(Ze, { children: n }),
|
|
261
|
-
/* @__PURE__ */ o(eo, { style: { color: m }, $isOpen: i, children: "▼" })
|
|
262
|
-
]
|
|
263
|
-
}
|
|
264
|
-
),
|
|
265
|
-
i && /* @__PURE__ */ u(oo, { role: "listbox", children: [
|
|
266
|
-
/* @__PURE__ */ o(
|
|
267
|
-
ao,
|
|
268
|
-
{
|
|
269
|
-
type: "text",
|
|
270
|
-
placeholder: c("search.placeholder"),
|
|
271
|
-
value: S,
|
|
272
|
-
onChange: (r) => g(r.target.value)
|
|
273
|
-
}
|
|
274
|
-
),
|
|
275
|
-
t.length > 0 ? t.map((r) => /* @__PURE__ */ o(
|
|
276
|
-
ae,
|
|
277
|
-
{
|
|
278
|
-
onClick: () => x(r),
|
|
279
|
-
onKeyDown: (A) => B(A, r),
|
|
280
|
-
role: "option",
|
|
281
|
-
tabIndex: 0,
|
|
282
|
-
"aria-selected": v?.id === r.id,
|
|
283
|
-
$selected: v?.id === r.id,
|
|
284
|
-
children: r.name
|
|
285
|
-
},
|
|
286
|
-
r.id
|
|
287
|
-
)) : /* @__PURE__ */ o(ae, { children: c("select.noOptions") })
|
|
288
|
-
] })
|
|
289
|
-
] });
|
|
290
|
-
}, co = ({
|
|
291
|
-
handleCloseModal: l
|
|
292
|
-
}) => {
|
|
293
|
-
const n = xe(), { client: s } = Ce();
|
|
294
|
-
we();
|
|
295
|
-
const { showToast: m } = Se(), e = J(), { config: c, user: i, selectedUser: a, langSource: v } = q(
|
|
296
|
-
(d) => d.chatSettingStore
|
|
297
|
-
), w = q((d) => d.call.phase), [S, g] = C(!1), b = c?.videoCalls, y = b?.enabled === !0 && !!b?.livekitUrl?.trim() && (b?.allowedRoomTypes || ["private"]).includes("private"), x = y && b?.enableAudioCalls === !0, t = w !== "idle", k = D(() => {
|
|
298
|
-
n(Ie()), l();
|
|
299
|
-
}, []), U = D(() => {
|
|
300
|
-
De.performLogout();
|
|
301
|
-
}, []), B = T(
|
|
302
|
-
() => [
|
|
303
|
-
{
|
|
304
|
-
label: e("action.logOut"),
|
|
305
|
-
icon: /* @__PURE__ */ o(Ne, {}),
|
|
306
|
-
onClick: () => {
|
|
307
|
-
U();
|
|
308
|
-
},
|
|
309
|
-
styles: { color: "var(--ethora-color-danger, #D92D20)" }
|
|
310
|
-
}
|
|
311
|
-
],
|
|
312
|
-
[U, e]
|
|
313
|
-
), r = (d) => {
|
|
314
|
-
n(Me(d.id));
|
|
315
|
-
}, A = D(() => {
|
|
316
|
-
g(!0);
|
|
317
|
-
}, []), ne = async (d, p) => {
|
|
318
|
-
try {
|
|
319
|
-
const h = Ee(
|
|
320
|
-
d,
|
|
321
|
-
c?.xmppSettings?.conference,
|
|
322
|
-
p
|
|
323
|
-
);
|
|
324
|
-
if (!h || !h.jid)
|
|
325
|
-
return console.error(
|
|
326
|
-
"handleRoomCreation: failed to normalize new private room",
|
|
327
|
-
d
|
|
328
|
-
), m({
|
|
329
|
-
id: Date.now().toString(),
|
|
330
|
-
title: e("toast.error"),
|
|
331
|
-
message: e("toast.couldNotOpenPrivateChat"),
|
|
332
|
-
type: "error",
|
|
333
|
-
duration: 4e3
|
|
334
|
-
}), null;
|
|
335
|
-
if (n(
|
|
336
|
-
Te({
|
|
337
|
-
room: h,
|
|
338
|
-
xmpp: s
|
|
339
|
-
})
|
|
340
|
-
), s && h.jid) {
|
|
341
|
-
try {
|
|
342
|
-
await s.presenceInRoomStanza(h.jid);
|
|
343
|
-
} catch (I) {
|
|
344
|
-
console.warn("presenceInRoomStanza failed (non-fatal):", I);
|
|
345
|
-
}
|
|
346
|
-
try {
|
|
347
|
-
s.getHistoryStanza(h.jid, 10);
|
|
348
|
-
} catch (I) {
|
|
349
|
-
console.warn("getHistoryStanza failed (non-fatal):", I);
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
return n(Le({ roomJID: h.jid })), m({
|
|
353
|
-
id: Date.now().toString(),
|
|
354
|
-
title: e("toast.success"),
|
|
355
|
-
message: e("toast.roomCreatedSuccess"),
|
|
356
|
-
type: "success",
|
|
357
|
-
duration: 3e3
|
|
358
|
-
}), { jid: h.jid };
|
|
359
|
-
} catch (h) {
|
|
360
|
-
return console.error("Error handling room creation:", h), null;
|
|
361
|
-
}
|
|
362
|
-
}, z = D(async () => {
|
|
363
|
-
const d = String(
|
|
364
|
-
a?.name || `${a?.firstName || ""} ${a?.lastName || ""}`
|
|
365
|
-
).trim() || "";
|
|
366
|
-
if (c?.newArch !== !1) {
|
|
367
|
-
const O = a?.xmppUsername || a?.userJID || a?.id;
|
|
368
|
-
if (!O)
|
|
369
|
-
return m({
|
|
370
|
-
id: Date.now().toString(),
|
|
371
|
-
title: e("toast.error"),
|
|
372
|
-
message: e("toast.couldNotResolveRecipient"),
|
|
373
|
-
type: "error",
|
|
374
|
-
duration: 4e3
|
|
375
|
-
}), null;
|
|
376
|
-
try {
|
|
377
|
-
const R = await Ue(O), E = await ne(R, 2);
|
|
378
|
-
return E?.jid ? {
|
|
379
|
-
jid: E.jid,
|
|
380
|
-
bareName: E.jid.split("@")[0],
|
|
381
|
-
peerXmppUsername: String(O).split("@")[0],
|
|
382
|
-
peerDisplay: d
|
|
383
|
-
} : null;
|
|
384
|
-
} catch (R) {
|
|
385
|
-
return console.error("postPrivateRoom failed:", R), m({
|
|
386
|
-
id: Date.now().toString(),
|
|
387
|
-
title: e("toast.error"),
|
|
388
|
-
message: R?.message || e("toast.failedToCreatePrivateChat"),
|
|
389
|
-
type: "error",
|
|
390
|
-
duration: 4e3
|
|
391
|
-
}), null;
|
|
392
|
-
}
|
|
393
|
-
}
|
|
394
|
-
const p = _(a.id), $ = [_(i.defaultWallet.walletAddress), p].sort().join(".").toLowerCase(), G = [i.firstName, a.name?.split(" ")?.[0]].sort().join(" and "), P = await s.createPrivateRoomStanza(
|
|
395
|
-
G,
|
|
396
|
-
`Private chat ${G}`,
|
|
397
|
-
$
|
|
398
|
-
);
|
|
399
|
-
return P && (await s.inviteRoomRequestStanza(p, P), await s.getRoomsStanza()), P ? {
|
|
400
|
-
jid: P,
|
|
401
|
-
bareName: String(P).split("@")[0],
|
|
402
|
-
peerXmppUsername: p,
|
|
403
|
-
peerDisplay: d
|
|
404
|
-
} : null;
|
|
405
|
-
}, [a, c?.newArch, s, i]), K = D(async () => {
|
|
406
|
-
m({
|
|
407
|
-
id: Date.now().toString(),
|
|
408
|
-
title: e("toast.roomCreationTitle"),
|
|
409
|
-
message: e("toast.roomCreating"),
|
|
410
|
-
type: "info",
|
|
411
|
-
duration: 3e3
|
|
412
|
-
}), await z(), n(Q());
|
|
413
|
-
}, [z, n, m, e]), F = D(
|
|
414
|
-
async (d) => {
|
|
415
|
-
const p = await z();
|
|
416
|
-
if (!p) return;
|
|
417
|
-
const h = p.peerDisplay || p.bareName;
|
|
418
|
-
n(
|
|
419
|
-
ke({
|
|
420
|
-
roomJid: p.jid,
|
|
421
|
-
roomName: h,
|
|
422
|
-
roomBareName: p.bareName,
|
|
423
|
-
kind: d,
|
|
424
|
-
peerXmppUsername: p.peerXmppUsername || null
|
|
425
|
-
})
|
|
426
|
-
), p.peerXmppUsername && Ae(d, {
|
|
427
|
-
peerXmppUsername: p.peerXmppUsername,
|
|
428
|
-
roomBareName: p.bareName
|
|
429
|
-
}), n(Q());
|
|
430
|
-
try {
|
|
431
|
-
await Pe(p.bareName, { kind: d });
|
|
432
|
-
} catch (I) {
|
|
433
|
-
const $ = I instanceof Error ? I.message : e("toast.failedToCreateCall");
|
|
434
|
-
n(ze($));
|
|
435
|
-
}
|
|
436
|
-
},
|
|
437
|
-
[z, n, e]
|
|
438
|
-
), f = a ?? i, se = () => {
|
|
439
|
-
if (v)
|
|
440
|
-
return Y.find((d) => d.id === v);
|
|
441
|
-
}, ie = a ? void 0 : /* @__PURE__ */ u(H, { children: [
|
|
442
|
-
/* @__PURE__ */ o(W, { onClick: A, "aria-label": e("action.editProfile"), children: /* @__PURE__ */ o(Re, { color: "var(--ethora-color-text-muted, #8C8C8C)" }) }),
|
|
443
|
-
/* @__PURE__ */ o(
|
|
444
|
-
je,
|
|
445
|
-
{
|
|
446
|
-
options: B,
|
|
447
|
-
position: "left",
|
|
448
|
-
menuIcon: /* @__PURE__ */ o(Be, {})
|
|
449
|
-
}
|
|
450
|
-
)
|
|
451
|
-
] }), V = a && a.xmppUsername !== i.xmppUsername && !c?.disableProfilesInteractions, le = T(
|
|
452
|
-
() => /* @__PURE__ */ u(H, { children: [
|
|
453
|
-
/* @__PURE__ */ u(He, { children: [
|
|
454
|
-
/* @__PURE__ */ o(
|
|
455
|
-
re,
|
|
456
|
-
{
|
|
457
|
-
icon: f?.profileImage ?? null,
|
|
458
|
-
name: f?.name ?? f?.firstName,
|
|
459
|
-
size: 96
|
|
460
|
-
}
|
|
461
|
-
),
|
|
462
|
-
/* @__PURE__ */ o(We, { children: f?.name ? `${f?.name}` : `${f?.firstName} ${f?.lastName}` })
|
|
463
|
-
] }),
|
|
464
|
-
/* @__PURE__ */ u(M, { children: [
|
|
465
|
-
/* @__PURE__ */ o(X, { children: e("modal.profile.about") }),
|
|
466
|
-
/* @__PURE__ */ o(Z, { children: /* @__PURE__ */ o(ee, { children: /* @__PURE__ */ o(oe, { children: f?.description && f?.description?.length > 4 ? f.description : e("modal.profile.noDescription") }) }) })
|
|
467
|
-
] }),
|
|
468
|
-
!a && c?.translates?.enabled && /* @__PURE__ */ u(M, { children: [
|
|
469
|
-
/* @__PURE__ */ o(X, { children: e("modal.profile.preferences") }),
|
|
470
|
-
/* @__PURE__ */ o(Z, { children: /* @__PURE__ */ u(ee, { children: [
|
|
471
|
-
/* @__PURE__ */ o(oe, { children: e("modal.profile.languageHint") }),
|
|
472
|
-
/* @__PURE__ */ o(
|
|
473
|
-
ro,
|
|
474
|
-
{
|
|
475
|
-
options: Y,
|
|
476
|
-
placeholder: e("language.select"),
|
|
477
|
-
onSelect: r,
|
|
478
|
-
accentColor: c?.colors?.primary,
|
|
479
|
-
selectedValue: se()
|
|
480
|
-
}
|
|
481
|
-
)
|
|
482
|
-
] }) })
|
|
483
|
-
] }),
|
|
484
|
-
V && /* @__PURE__ */ u(M, { children: [
|
|
485
|
-
/* @__PURE__ */ o(X, { children: e("modal.profile.actions") }),
|
|
486
|
-
/* @__PURE__ */ u(Je, { children: [
|
|
487
|
-
/* @__PURE__ */ o(
|
|
488
|
-
j,
|
|
489
|
-
{
|
|
490
|
-
StartIcon: /* @__PURE__ */ o(Fe, {}),
|
|
491
|
-
onClick: K,
|
|
492
|
-
variant: "filled",
|
|
493
|
-
children: e("action.message")
|
|
494
|
-
}
|
|
495
|
-
),
|
|
496
|
-
y && /* @__PURE__ */ o(
|
|
497
|
-
j,
|
|
498
|
-
{
|
|
499
|
-
StartIcon: /* @__PURE__ */ o($e, { color: "var(--ethora-color-text-on-primary, #FFFFFF)" }),
|
|
500
|
-
onClick: () => {
|
|
501
|
-
F("video");
|
|
502
|
-
},
|
|
503
|
-
disabled: t,
|
|
504
|
-
variant: "filled",
|
|
505
|
-
children: e(x ? "action.videoCall" : "action.call")
|
|
506
|
-
}
|
|
507
|
-
),
|
|
508
|
-
x && /* @__PURE__ */ o(
|
|
509
|
-
j,
|
|
510
|
-
{
|
|
511
|
-
StartIcon: /* @__PURE__ */ o(Oe, { color: "var(--ethora-color-text-on-primary, #FFFFFF)" }),
|
|
512
|
-
onClick: () => {
|
|
513
|
-
F("audio");
|
|
514
|
-
},
|
|
515
|
-
disabled: t,
|
|
516
|
-
variant: "filled",
|
|
517
|
-
children: e("action.audioCall")
|
|
518
|
-
}
|
|
519
|
-
),
|
|
520
|
-
/* @__PURE__ */ o(
|
|
521
|
-
j,
|
|
522
|
-
{
|
|
523
|
-
onClick: () => Ke(a.id),
|
|
524
|
-
variant: "outlined",
|
|
525
|
-
children: e("action.copyUserId")
|
|
526
|
-
}
|
|
527
|
-
)
|
|
528
|
-
] })
|
|
529
|
-
] })
|
|
530
|
-
] }),
|
|
531
|
-
[
|
|
532
|
-
f,
|
|
533
|
-
y,
|
|
534
|
-
x,
|
|
535
|
-
t,
|
|
536
|
-
F,
|
|
537
|
-
K,
|
|
538
|
-
a,
|
|
539
|
-
V,
|
|
540
|
-
i,
|
|
541
|
-
c,
|
|
542
|
-
v,
|
|
543
|
-
e
|
|
544
|
-
]
|
|
545
|
-
), ce = T(
|
|
546
|
-
() => /* @__PURE__ */ o(
|
|
547
|
-
Ge,
|
|
548
|
-
{
|
|
549
|
-
setIsEditing: g,
|
|
550
|
-
modalUser: f,
|
|
551
|
-
config: c
|
|
552
|
-
}
|
|
553
|
-
),
|
|
554
|
-
[f]
|
|
555
|
-
);
|
|
556
|
-
return /* @__PURE__ */ o(
|
|
557
|
-
Xe,
|
|
558
|
-
{
|
|
559
|
-
title: e("modal.profile.title"),
|
|
560
|
-
onClose: k,
|
|
561
|
-
headerActions: S ? void 0 : ie,
|
|
562
|
-
children: S ? ce : le
|
|
563
|
-
}
|
|
564
|
-
);
|
|
565
|
-
};
|
|
566
|
-
export {
|
|
567
|
-
co as default
|
|
568
|
-
};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { x as e } from "./main-B-8IhwaP.js";
|
|
2
|
-
const a = e.div`
|
|
3
|
-
display: flex;
|
|
4
|
-
flex-direction: column;
|
|
5
|
-
align-items: center;
|
|
6
|
-
gap: var(--ethora-space-3, 12px);
|
|
7
|
-
padding: var(--ethora-space-2, 8px) 0 var(--ethora-space-1, 4px);
|
|
8
|
-
text-align: center;
|
|
9
|
-
`, r = e.div`
|
|
10
|
-
font-size: var(--ethora-font-size-lg, 18px);
|
|
11
|
-
font-weight: var(--ethora-font-weight-semibold, 600);
|
|
12
|
-
color: var(--ethora-color-text, #141414);
|
|
13
|
-
overflow-wrap: anywhere;
|
|
14
|
-
`, i = e.div`
|
|
15
|
-
font-size: var(--ethora-font-size-sm, 14px);
|
|
16
|
-
font-weight: var(--ethora-font-weight-regular, 400);
|
|
17
|
-
color: var(--ethora-color-text-muted, #8c8c8c);
|
|
18
|
-
`, c = e.div`
|
|
19
|
-
display: flex;
|
|
20
|
-
flex-direction: column;
|
|
21
|
-
gap: var(--ethora-space-2, 8px);
|
|
22
|
-
width: 100%;
|
|
23
|
-
`, l = (o) => {
|
|
24
|
-
navigator.clipboard.writeText(o);
|
|
25
|
-
};
|
|
26
|
-
export {
|
|
27
|
-
a as P,
|
|
28
|
-
r as a,
|
|
29
|
-
c as b,
|
|
30
|
-
i as c,
|
|
31
|
-
l as h
|
|
32
|
-
};
|