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