@ethora/chat-component 26.7.4 → 26.7.6

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 (152) hide show
  1. package/README.md +72 -16
  2. package/dist/ChatProfileModal-hxsWI8cx.js +2139 -0
  3. package/dist/FilePreviewModal-CwWnHsB1.js +736 -0
  4. package/dist/ManageDataModal-CDPXcC93.js +159 -0
  5. package/dist/MarkdownBody-DBJGraWM.js +16874 -0
  6. package/dist/SideDrawer-Dr_lkaOW.js +226 -0
  7. package/dist/UserProfileModal-Q_jhXpsX.js +568 -0
  8. package/dist/UserSettingsModal-OcAJao-d.js +50 -0
  9. package/dist/{VideoCallOverlay-BUfKp87t.js → VideoCallOverlay-CC4sShdK.js} +9 -10
  10. package/dist/VisibilityModal-DkMhx_2k.js +132 -0
  11. package/dist/assets/icons.d.ts +30 -0
  12. package/dist/components/ContextMenu/ContextMenuComponents.d.ts +1 -3
  13. package/dist/components/EmojiPicker/LazyEmojiPicker.d.ts +3 -0
  14. package/dist/components/ExampleComponents/CustomMessage.d.ts +3 -3
  15. package/dist/components/Files/FilesList.d.ts +12 -0
  16. package/dist/components/Files/FilesPanel.d.ts +3 -0
  17. package/dist/components/Files/fileCategory.d.ts +13 -0
  18. package/dist/components/InputComponents/AttachmentPreview.d.ts +17 -0
  19. package/dist/components/InputComponents/MentionDropdown.d.ts +13 -0
  20. package/dist/components/InputComponents/MentionPickerModal.d.ts +19 -0
  21. package/dist/components/MainComponents/AttachmentList.d.ts +7 -0
  22. package/dist/components/MainComponents/ChatErrorBoundary.d.ts +53 -0
  23. package/dist/components/MainComponents/ChatErrorScreen.d.ts +24 -0
  24. package/dist/components/MainComponents/HeaderLogo.d.ts +18 -0
  25. package/dist/components/MainComponents/MediaMessage.d.ts +5 -0
  26. package/dist/components/MainComponents/MessageContainer.d.ts +2 -2
  27. package/dist/components/MainComponents/ReduxWrapper.d.ts +1 -2
  28. package/dist/components/MainComponents/SystemMessage.d.ts +1 -2
  29. package/dist/components/MenuRoom/MenuRoom.d.ts +1 -0
  30. package/dist/components/MessageBubble/CustomDivider.d.ts +3 -3
  31. package/dist/components/MessageBubble/Message.d.ts +2 -2
  32. package/dist/components/MessageBubble/MessageTranslate.d.ts +28 -10
  33. package/dist/components/MessageBubble/QuickReplies.d.ts +19 -0
  34. package/dist/components/Modals/ChatProfileModal/ChatProfileMemberRow.d.ts +18 -0
  35. package/dist/components/Modals/FilePreviewModal/FilePreviewModal.d.ts +17 -0
  36. package/dist/components/Modals/FilePreviewModal/ImageLightbox.d.ts +35 -0
  37. package/dist/components/Modals/FilePreviewModal/PdfView.d.ts +14 -3
  38. package/dist/components/Modals/NewChatModal/styledNewChatComponents.d.ts +12 -0
  39. package/dist/components/Modals/SettingsModals/Visibility/StyledComponents.d.ts +1 -1
  40. package/dist/components/Modals/SideDrawer/DrawerProfileParts.d.ts +13 -0
  41. package/dist/components/Modals/SideDrawer/SideDrawer.d.ts +44 -0
  42. package/dist/components/Modals/modalComponents.d.ts +6 -0
  43. package/dist/components/Modals/styledModalComponents.d.ts +14 -3
  44. package/dist/components/RoomComponents/ChatRoomItem.d.ts +0 -1
  45. package/dist/components/RoomComponents/OnlineUsersPopover.d.ts +0 -1
  46. package/dist/components/UsersList/StyledComponents.d.ts +5 -1
  47. package/dist/components/UsersList/UsersList.d.ts +23 -0
  48. package/dist/components/styled/Button.d.ts +11 -1
  49. package/dist/components/styled/ChatWrapperBox.d.ts +3 -1
  50. package/dist/components/styled/PdfMessage.d.ts +13 -0
  51. package/dist/components/styled/RoomListComponents/index.d.ts +22 -1
  52. package/dist/components/styled/SendInput.d.ts +19 -5
  53. package/dist/components/styled/StyledComponents.d.ts +1 -1
  54. package/dist/components/styled/StyledInputComponents/MediaComponents.d.ts +18 -0
  55. package/dist/components/styled/StyledInputComponents/StyledInputComponents.d.ts +21 -0
  56. package/dist/components/styled/TreadLabel.d.ts +2 -2
  57. package/dist/components/styled/UnsupportedType.d.ts +1 -1
  58. package/dist/examples/quiz/QuizDemo.d.ts +3 -0
  59. package/dist/examples/quiz/quizScript.d.ts +38 -0
  60. package/dist/examples/quiz/useDemoSession.d.ts +42 -0
  61. package/dist/examples/quiz/useQuizFlow.d.ts +47 -0
  62. package/dist/firebase-config.d.ts +2 -4
  63. package/dist/handleCopyClick-CpmPa6VI.js +32 -0
  64. package/dist/helpers/MarkdownBody.d.ts +7 -0
  65. package/dist/helpers/attachments.d.ts +33 -0
  66. package/dist/helpers/botMarkup.d.ts +30 -0
  67. package/dist/helpers/constants/MODAL_TYPES.d.ts +11 -7
  68. package/dist/helpers/ethoraLogger.d.ts +8 -0
  69. package/dist/helpers/fileKind.d.ts +17 -0
  70. package/dist/helpers/hiddenRooms.d.ts +1 -1
  71. package/dist/helpers/historyPreloadScheduler.d.ts +1 -0
  72. package/dist/helpers/lazyEmoji.d.ts +3 -0
  73. package/dist/helpers/localStorageUser.d.ts +1 -1
  74. package/dist/helpers/markdownSanitizeSchema.d.ts +3 -0
  75. package/dist/helpers/mentions.d.ts +63 -0
  76. package/dist/helpers/parseMessageBody.d.ts +12 -2
  77. package/dist/helpers/pdf/loadPdfjs.d.ts +64 -0
  78. package/dist/helpers/quickReplies.d.ts +31 -0
  79. package/dist/helpers/remarkLineBreaks.d.ts +42 -0
  80. package/dist/helpers/resolveMessageTranslation.d.ts +34 -0
  81. package/dist/helpers/roomImageGallery.d.ts +53 -0
  82. package/dist/helpers/secureFileUrl.d.ts +8 -0
  83. package/dist/helpers/sendFailureWatchdog.d.ts +62 -0
  84. package/dist/helpers/transformTranslatations.d.ts +1 -2
  85. package/dist/hooks/pushSubscriptionSweep.d.ts +41 -0
  86. package/dist/hooks/useChatWrapperInit.d.ts +1 -0
  87. package/dist/hooks/useFilesEndpointSupport.d.ts +9 -0
  88. package/dist/hooks/useInView.d.ts +17 -0
  89. package/dist/hooks/useMentionComposer.d.ts +45 -0
  90. package/dist/hooks/useMessageHeapState.d.ts +1 -1
  91. package/dist/hooks/useMessageTranslation.d.ts +4 -3
  92. package/dist/hooks/useModalDismiss.d.ts +27 -0
  93. package/dist/hooks/useMyFiles.d.ts +16 -0
  94. package/dist/hooks/usePdfThumbnail.d.ts +22 -0
  95. package/dist/hooks/useRoomMute.d.ts +19 -0
  96. package/dist/hooks/useRoomState.d.ts +1 -1
  97. package/dist/hooks/useSendMessage.d.ts +4 -3
  98. package/dist/hooks/useTypography.d.ts +1 -1
  99. package/dist/hooks/useUnreadMessagesCounter.d.ts +11 -2
  100. package/dist/index.esm-B-3fyDHY.js +28 -0
  101. package/dist/index.esm-CRM4VCRa.js +943 -0
  102. package/dist/index.esm-msbp26WN.js +3352 -0
  103. package/dist/index.esm2017-CL0mvq6y.js +1578 -0
  104. package/dist/main-B-8IhwaP.js +31837 -0
  105. package/dist/main.css +1 -1
  106. package/dist/main.d.ts +16 -0
  107. package/dist/main.js +19 -18
  108. package/dist/module-DGXkb0R_.js +2960 -0
  109. package/dist/native-CDi4YD_s.js +13 -0
  110. package/dist/networking/api-requests/files.api.d.ts +19 -0
  111. package/dist/networking/api-requests/rooms.api.d.ts +10 -2
  112. package/dist/networking/api-requests/translate.api.d.ts +15 -0
  113. package/dist/networking/api-requests/user.api.d.ts +2 -0
  114. package/dist/networking/sharedRequest.d.ts +4 -0
  115. package/dist/networking/xmpp/allRoomPresences.xmpp.d.ts +3 -1
  116. package/dist/networking/xmpp/createTimeoutPromise.xmpp.d.ts +14 -0
  117. package/dist/networking/xmpp/sendTextMessage.xmpp.d.ts +2 -1
  118. package/dist/networking/xmpp/sendTextMessageWithTranslateTag.xmpp.d.ts +2 -1
  119. package/dist/networking/xmppClient.d.ts +12 -3
  120. package/dist/pdf-B5b7qHu6.js +17130 -0
  121. package/dist/pdf.worker.min-COYn-gId.js +24385 -0
  122. package/dist/roomStore/index.d.ts +20 -0
  123. package/dist/roomStore/persistEncryption.d.ts +51 -0
  124. package/dist/roomStore/roomsSlice.d.ts +49 -6
  125. package/dist/styles/classNames.d.ts +35 -0
  126. package/dist/styles/motion.d.ts +44 -0
  127. package/dist/styles/tokens.d.ts +27 -0
  128. package/dist/testIds.d.ts +1 -1
  129. package/dist/types/models/attachment.model.d.ts +33 -0
  130. package/dist/types/models/config.model.d.ts +179 -19
  131. package/dist/types/models/file.model.d.ts +20 -0
  132. package/dist/types/models/message.model.d.ts +16 -6
  133. package/dist/types/models/room.model.d.ts +12 -2
  134. package/dist/types/types.d.ts +3 -1
  135. package/dist/utils/resendMessage.d.ts +22 -1
  136. package/dist/utils/translateModePolicy.d.ts +1 -0
  137. package/dist/wavesurfer.esm-D_a19qBW.js +952 -0
  138. package/package.json +22 -2
  139. package/dist/VideoCallOverlay-BUfKp87t.js.map +0 -1
  140. package/dist/components/MainComponents/VirtualList.d.ts +0 -10
  141. package/dist/components/Modals/SettingsModals/BlockedUsers/BlockedUsersModal.d.ts +0 -6
  142. package/dist/components/Modals/SettingsModals/DocumentShares/DocumentSharesModal.d.ts +0 -6
  143. package/dist/components/Modals/SettingsModals/ManageDataModal/StyledComponents.d.ts +0 -0
  144. package/dist/components/Modals/SettingsModals/ProfileShares/ProfileShares.d.ts +0 -6
  145. package/dist/components/Modals/SettingsModals/Referrals/Referrals.d.ts +0 -6
  146. package/dist/hooks/useMessageQueue.d.ts +0 -4
  147. package/dist/main-DFqqDiy-.js +0 -55707
  148. package/dist/main-DFqqDiy-.js.map +0 -1
  149. package/dist/main.js.map +0 -1
  150. package/dist/networking/xmpp/getHistory.xmpp.d.ts +0 -3
  151. package/dist/networking/xmpp/listenerManager.d.ts +0 -17
  152. package/dist/utils/xmppMemoryMonitor.d.ts +0 -16
@@ -0,0 +1,568 @@
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
+ };
@@ -0,0 +1,50 @@
1
+ import { jsx as i, jsxs as n } from "react/jsx-runtime";
2
+ import m, { useCallback as D, useMemo as h } from "react";
3
+ import { n as g, a as p, o as w, M as r } from "./main-B-8IhwaP.js";
4
+ import { S as b, D as u, a as k, b as y, c as S, d as f } from "./SideDrawer-Dr_lkaOW.js";
5
+ const T = ({
6
+ handleCloseModal: l
7
+ }) => {
8
+ const t = g(), s = p(), o = D(
9
+ (e) => {
10
+ s(w(e));
11
+ },
12
+ [s]
13
+ ), c = h(
14
+ () => [
15
+ {
16
+ title: t("settings.section.privacy"),
17
+ rows: [
18
+ {
19
+ key: r.MANAGE_DATA,
20
+ label: t("settings.manageData.title"),
21
+ hint: t("settings.manageData.rowHint")
22
+ },
23
+ {
24
+ key: r.VISIBILITY,
25
+ label: t("settings.visibility.title"),
26
+ hint: t("settings.visibility.rowHint")
27
+ }
28
+ ]
29
+ }
30
+ ],
31
+ [t]
32
+ );
33
+ return /* @__PURE__ */ i(b, { title: t("settings.menu.title"), onClose: l, children: c.map((e) => /* @__PURE__ */ n(u, { children: [
34
+ /* @__PURE__ */ i(k, { children: e.title }),
35
+ /* @__PURE__ */ i(y, { children: e.rows.map((a, d) => /* @__PURE__ */ n(m.Fragment, { children: [
36
+ d > 0 && /* @__PURE__ */ i(S, {}),
37
+ /* @__PURE__ */ i(
38
+ f,
39
+ {
40
+ label: a.label,
41
+ hint: a.hint,
42
+ onClick: () => o(a.key)
43
+ }
44
+ )
45
+ ] }, a.key)) })
46
+ ] }, e.title)) });
47
+ };
48
+ export {
49
+ T as default
50
+ };
@@ -1,7 +1,7 @@
1
1
  import { jsxs as z, jsx as M, Fragment as xi } from "react/jsx-runtime";
2
2
  import * as F from "react";
3
3
  import { useState as zt, useRef as be, useEffect as ge, useMemo as ln, useCallback as mi } from "react";
4
- import { u as Qi, P as Kn, H as Oi, a as Hd, b as zd, s as po, c as Kd, d as Gd, e as fo, f as Jd, g as Yd, h as $d, i as Xd, r as mo, j as Qd, k as Zd, A as go, V as vo, B as eu, l as bo } from "./main-DFqqDiy-.js";
4
+ import { u as Qi, P as Kn, H as Oi, a as Hd, b as zd, s as po, c as Kd, d as Gd, e as fo, f as Jd, g as Yd, h as mo, i as $d, j as Xd, r as go, k as Qd, l as Zd, A as vo, V as bo, B as eu } from "./main-B-8IhwaP.js";
5
5
  function tu(n, e) {
6
6
  return e.forEach(function(t) {
7
7
  t && typeof t != "string" && !Array.isArray(t) && Object.keys(t).forEach(function(i) {
@@ -22367,7 +22367,7 @@ const Nd = (n) => {
22367
22367
  position: "relative",
22368
22368
  width: "100%",
22369
22369
  height: "100%",
22370
- // Video stage stays dark — that's the convention for video tiles
22370
+ // Video stage stays dark - that's the convention for video tiles
22371
22371
  // (high contrast for skin tones), but the rest of the chrome
22372
22372
  // (top bar, controls tray) uses the chat's light tokens.
22373
22373
  background: "#0B1220"
@@ -23359,7 +23359,7 @@ const Nd = (n) => {
23359
23359
  fontSize: 14
23360
23360
  },
23361
23361
  children: [
23362
- i === "audio" ? /* @__PURE__ */ M(go, { color: pi }) : /* @__PURE__ */ M(vo, { color: pi }),
23362
+ i === "audio" ? /* @__PURE__ */ M(vo, { color: pi }) : /* @__PURE__ */ M(bo, { color: pi }),
23363
23363
  /* @__PURE__ */ M("span", { children: e })
23364
23364
  ]
23365
23365
  }
@@ -23414,7 +23414,7 @@ const Nd = (n) => {
23414
23414
  "aria-label": "Accept call",
23415
23415
  title: "Accept",
23416
23416
  style: Wr("#10B981"),
23417
- children: a?.accept ?? (i === "audio" ? /* @__PURE__ */ M(go, { color: "#FFFFFF" }) : /* @__PURE__ */ M(vo, { color: "#FFFFFF" }))
23417
+ children: a?.accept ?? (i === "audio" ? /* @__PURE__ */ M(vo, { color: "#FFFFFF" }) : /* @__PURE__ */ M(bo, { color: "#FFFFFF" }))
23418
23418
  }
23419
23419
  )
23420
23420
  ] }),
@@ -23449,7 +23449,7 @@ const Nd = (n) => {
23449
23449
  if (e.phase !== "requesting" || e.direction !== "outgoing")
23450
23450
  return;
23451
23451
  const P = window.setTimeout(() => {
23452
- n(po("No answer — call timed out"));
23452
+ n(po("No answer - call timed out"));
23453
23453
  }, Sv);
23454
23454
  return () => window.clearTimeout(P);
23455
23455
  }, [e.phase, e.direction, e.startedAt, n]);
@@ -23509,13 +23509,13 @@ const Nd = (n) => {
23509
23509
  })
23510
23510
  );
23511
23511
  }
23512
- bo(P), n($d());
23512
+ mo(P), n($d());
23513
23513
  },
23514
23514
  [n]
23515
23515
  ), y = mi(() => {
23516
- bo("declined"), n(Xd());
23516
+ mo("declined"), n(Xd());
23517
23517
  }, [n]), m = mi(() => {
23518
- e.direction === "incoming" && e.phase === "ringing-incoming" ? y() : e.phase === "error" ? n(mo()) : p(e.phase === "requesting" ? "cancelled" : "ended");
23518
+ e.direction === "incoming" && e.phase === "ringing-incoming" ? y() : e.phase === "error" ? n(go()) : p(e.phase === "requesting" ? "cancelled" : "ended");
23519
23519
  }, [e.direction, e.phase, y, p, n]), [S, k] = zt(!1), C = Nd(), x = be(null), f = be(null), g = !!e.token && (e.phase === "connecting" || e.phase === "in-call") && !!o, b = S && g;
23520
23520
  if (ge(() => {
23521
23521
  e.phase === "idle" && k(!1);
@@ -23622,7 +23622,7 @@ const Nd = (n) => {
23622
23622
  variant: "error",
23623
23623
  primaryColor: a,
23624
23624
  errorMessage: e.error || (o ? null : "Video calls unavailable: missing livekitUrl in config.videoCalls"),
23625
- onDismiss: () => n(mo())
23625
+ onDismiss: () => n(go())
23626
23626
  }
23627
23627
  ) : /* @__PURE__ */ M(
23628
23628
  Hr,
@@ -23644,4 +23644,3 @@ const Nd = (n) => {
23644
23644
  export {
23645
23645
  Mv as VideoCallOverlay
23646
23646
  };
23647
- //# sourceMappingURL=VideoCallOverlay-BUfKp87t.js.map