@linktr.ee/messaging-react 1.14.0 โ 1.15.0
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/index.js +750 -704
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/ChannelView.tsx +83 -29
- package/src/components/CustomMessage/index.tsx +0 -9
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsx as e, jsxs as i, Fragment as
|
|
2
|
-
import
|
|
3
|
-
import P, { createContext as $e, useContext as
|
|
4
|
-
import { StreamChatService as
|
|
5
|
-
import { Chat as
|
|
6
|
-
import { XIcon as
|
|
1
|
+
import { jsx as e, jsxs as i, Fragment as be } from "react/jsx-runtime";
|
|
2
|
+
import M from "classnames";
|
|
3
|
+
import P, { createContext as $e, useContext as ze, useCallback as T, useState as I, useRef as W, useEffect as Z, useMemo as we } from "react";
|
|
4
|
+
import { StreamChatService as Ge } from "@linktr.ee/messaging-core";
|
|
5
|
+
import { Chat as He, ChannelList as Ve, DateSeparator as We, areMessageUIPropsEqual as Ze, useChatContext as qe, useTranslationContext as Ye, useMessageReminder as Je, useComponentContext as Qe, Attachment as Xe, Avatar as Ke, EditMessageModal as es, MessageBlocked as ss, MessageBouncePrompt as ts, MessageDeleted as ns, MessageIsThreadReplyInChannelButtonIndicator as rs, MessageRepliesCountButton as as, MessageStatus as ls, MessageTimestamp as Re, ReminderNotification as os, StreamedMessageText as is, messageHasAttachments as cs, messageHasReactions as ds, isDateSeparatorMessage as ms, isMessageBlocked as us, isMessageBounced as hs, isMessageEdited as fs, MessageBounceModal as gs, Poll as xs, MessageText as Cs, MessageErrorIcon as bs, MessageEditedTimestamp as Ns, useMessageContext as vs, useMessageComposer as ws, useStateStore as ps, MessageInput as ys, useMessageInputContext as Es, useMessageComposerHasSendableData as Is, SimpleAttachmentSelector as Ss, QuotedMessagePreview as _s, AttachmentPreviewList as Ms, TextareaComposer as ks, Channel as Rs, useChannelStateContext as Te, WithComponents as Ts, Window as Ds, MessageList as Fs } from "stream-chat-react";
|
|
6
|
+
import { XIcon as Ne, GiftIcon as Ls, ArrowUpIcon as Ps, ArrowLeftIcon as pe, StarIcon as ye, DotsThreeIcon as Ee, SpinnerGapIcon as de, SignOutIcon as Os, ProhibitInsetIcon as Ie, FlagIcon as Us, MagnifyingGlassIcon as Bs, ChatCircleDotsIcon as Se } from "@phosphor-icons/react";
|
|
7
7
|
import { LinkPreviewsManager as _e } from "stream-chat";
|
|
8
|
-
const
|
|
8
|
+
const De = $e({
|
|
9
9
|
service: null,
|
|
10
10
|
client: null,
|
|
11
11
|
isConnected: !1,
|
|
@@ -15,17 +15,17 @@ const Te = $e({
|
|
|
15
15
|
refreshConnection: async () => {
|
|
16
16
|
},
|
|
17
17
|
debug: !1
|
|
18
|
-
}),
|
|
18
|
+
}), he = () => ze(De), wt = ({
|
|
19
19
|
children: t,
|
|
20
20
|
user: s,
|
|
21
21
|
serviceConfig: n,
|
|
22
22
|
apiKey: r,
|
|
23
|
-
capabilities:
|
|
23
|
+
capabilities: l = {},
|
|
24
24
|
debug: c = !1
|
|
25
25
|
}) => {
|
|
26
|
-
const a =
|
|
27
|
-
(h, ...
|
|
28
|
-
c && console.log(`๐ฅ [MessagingProvider] ${h}`, ...
|
|
26
|
+
const a = T(
|
|
27
|
+
(h, ...p) => {
|
|
28
|
+
c && console.log(`๐ฅ [MessagingProvider] ${h}`, ...p);
|
|
29
29
|
},
|
|
30
30
|
[c]
|
|
31
31
|
);
|
|
@@ -33,30 +33,30 @@ const Te = $e({
|
|
|
33
33
|
userId: s == null ? void 0 : s.id,
|
|
34
34
|
apiKey: (r == null ? void 0 : r.substring(0, 8)) + "...",
|
|
35
35
|
serviceConfig: !!n,
|
|
36
|
-
capabilities: Object.keys(
|
|
36
|
+
capabilities: Object.keys(l)
|
|
37
37
|
});
|
|
38
|
-
const [u,
|
|
38
|
+
const [u, f] = I(null), [x, y] = I(null), [g, o] = I(!1), [_, E] = I(!1), [d, C] = I(null), N = W(!1), v = W({
|
|
39
39
|
userId: s == null ? void 0 : s.id,
|
|
40
40
|
apiKey: r,
|
|
41
41
|
serviceConfig: n,
|
|
42
|
-
capabilities:
|
|
43
|
-
}),
|
|
44
|
-
|
|
45
|
-
renderCount:
|
|
42
|
+
capabilities: l
|
|
43
|
+
}), S = W(0);
|
|
44
|
+
S.current++, a("๐ RENDER INFO", {
|
|
45
|
+
renderCount: S.current,
|
|
46
46
|
currentProps: { userId: s == null ? void 0 : s.id, apiKey: (r == null ? void 0 : r.substring(0, 8)) + "..." },
|
|
47
47
|
propChanges: {
|
|
48
|
-
userChanged:
|
|
49
|
-
apiKeyChanged:
|
|
50
|
-
serviceConfigChanged:
|
|
51
|
-
capabilitiesChanged:
|
|
48
|
+
userChanged: v.current.userId !== (s == null ? void 0 : s.id),
|
|
49
|
+
apiKeyChanged: v.current.apiKey !== r,
|
|
50
|
+
serviceConfigChanged: v.current.serviceConfig !== n,
|
|
51
|
+
capabilitiesChanged: v.current.capabilities !== l
|
|
52
52
|
}
|
|
53
|
-
}),
|
|
53
|
+
}), v.current = {
|
|
54
54
|
userId: s == null ? void 0 : s.id,
|
|
55
55
|
apiKey: r,
|
|
56
56
|
serviceConfig: n,
|
|
57
|
-
capabilities:
|
|
58
|
-
},
|
|
59
|
-
const h =
|
|
57
|
+
capabilities: l
|
|
58
|
+
}, Z(() => {
|
|
59
|
+
const h = S.current;
|
|
60
60
|
if (a("๐ง SERVICE INIT EFFECT TRIGGERED", {
|
|
61
61
|
renderCount: h,
|
|
62
62
|
apiKey: !!r,
|
|
@@ -64,8 +64,8 @@ const Te = $e({
|
|
|
64
64
|
dependencies: {
|
|
65
65
|
apiKey: (r == null ? void 0 : r.substring(0, 8)) + "...",
|
|
66
66
|
serviceConfigRef: n,
|
|
67
|
-
serviceConfigStable:
|
|
68
|
-
apiKeyStable:
|
|
67
|
+
serviceConfigStable: v.current.serviceConfig === n,
|
|
68
|
+
apiKeyStable: v.current.apiKey === r
|
|
69
69
|
}
|
|
70
70
|
}), !r || !n) {
|
|
71
71
|
a("โ ๏ธ SERVICE INIT SKIPPED", {
|
|
@@ -77,42 +77,42 @@ const Te = $e({
|
|
|
77
77
|
a("๐ CREATING NEW SERVICE", {
|
|
78
78
|
renderCount: h,
|
|
79
79
|
apiKey: (r == null ? void 0 : r.substring(0, 8)) + "...",
|
|
80
|
-
serviceConfigChanged:
|
|
80
|
+
serviceConfigChanged: v.current.serviceConfig !== n
|
|
81
81
|
});
|
|
82
|
-
const
|
|
82
|
+
const p = new Ge({
|
|
83
83
|
...n,
|
|
84
84
|
apiKey: r,
|
|
85
85
|
debug: c
|
|
86
86
|
});
|
|
87
|
-
return
|
|
87
|
+
return f(p), a("โ
SERVICE SET", {
|
|
88
88
|
renderCount: h,
|
|
89
|
-
serviceInstance: !!
|
|
89
|
+
serviceInstance: !!p
|
|
90
90
|
}), () => {
|
|
91
91
|
a("๐งน SERVICE CLEANUP", {
|
|
92
92
|
renderCount: h,
|
|
93
93
|
reason: "Effect cleanup"
|
|
94
|
-
}),
|
|
94
|
+
}), p.disconnectUser().catch(console.error);
|
|
95
95
|
};
|
|
96
96
|
}, [r, n, c, a]);
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
var
|
|
97
|
+
const b = W(null);
|
|
98
|
+
Z(() => {
|
|
99
|
+
var p, G;
|
|
100
100
|
if (a("๐ USER CONNECTION EFFECT TRIGGERED", {
|
|
101
101
|
hasService: !!u,
|
|
102
102
|
hasUser: !!s,
|
|
103
103
|
userId: s == null ? void 0 : s.id,
|
|
104
|
-
isConnecting:
|
|
105
|
-
isConnected:
|
|
104
|
+
isConnecting: N.current,
|
|
105
|
+
isConnected: g,
|
|
106
106
|
dependencies: { service: !!u, userId: s == null ? void 0 : s.id }
|
|
107
107
|
}), !u || !s) {
|
|
108
108
|
a("โ ๏ธ USER CONNECTION SKIPPED", "Missing service or user");
|
|
109
109
|
return;
|
|
110
110
|
}
|
|
111
|
-
if (
|
|
111
|
+
if (N.current) {
|
|
112
112
|
a("โ ๏ธ USER CONNECTION SKIPPED", "Already connecting");
|
|
113
113
|
return;
|
|
114
114
|
}
|
|
115
|
-
if (((
|
|
115
|
+
if (((p = b.current) == null ? void 0 : p.serviceId) === u && ((G = b.current) == null ? void 0 : G.userId) === s.id) {
|
|
116
116
|
a(
|
|
117
117
|
"โ ๏ธ USER CONNECTION SKIPPED",
|
|
118
118
|
"Already connected this user with this service"
|
|
@@ -120,40 +120,40 @@ const Te = $e({
|
|
|
120
120
|
return;
|
|
121
121
|
}
|
|
122
122
|
(async () => {
|
|
123
|
-
a("๐ STARTING USER CONNECTION", { userId: s.id }),
|
|
123
|
+
a("๐ STARTING USER CONNECTION", { userId: s.id }), N.current = !0, E(!0), C(null);
|
|
124
124
|
try {
|
|
125
125
|
a("๐ CALLING SERVICE.CONNECTUSER", { userId: s.id });
|
|
126
126
|
const A = await u.connectUser(s);
|
|
127
|
-
|
|
127
|
+
y(A), o(!0), b.current = { serviceId: u, userId: s.id }, a("โ
USER CONNECTION SUCCESS", {
|
|
128
128
|
userId: s.id,
|
|
129
129
|
clientId: A.userID
|
|
130
130
|
});
|
|
131
131
|
} catch (A) {
|
|
132
|
-
const
|
|
133
|
-
|
|
132
|
+
const q = A instanceof Error ? A.message : "Connection failed";
|
|
133
|
+
C(q), a("โ USER CONNECTION ERROR", {
|
|
134
134
|
userId: s.id,
|
|
135
|
-
error:
|
|
135
|
+
error: q
|
|
136
136
|
});
|
|
137
137
|
} finally {
|
|
138
|
-
|
|
138
|
+
E(!1), N.current = !1, a("๐ USER CONNECTION FINISHED", {
|
|
139
139
|
userId: s.id,
|
|
140
|
-
isConnected:
|
|
140
|
+
isConnected: g
|
|
141
141
|
});
|
|
142
142
|
}
|
|
143
143
|
})();
|
|
144
|
-
}, [u, s, a,
|
|
144
|
+
}, [u, s, a, g]), Z(() => (a("๐ CLEANUP EFFECT REGISTERED", {
|
|
145
145
|
hasService: !!u,
|
|
146
|
-
isConnected:
|
|
146
|
+
isConnected: g
|
|
147
147
|
}), () => {
|
|
148
|
-
u &&
|
|
148
|
+
u && g ? (a(
|
|
149
149
|
"๐งน CLEANUP EFFECT TRIGGERED",
|
|
150
150
|
"Cleaning up connection on unmount"
|
|
151
|
-
),
|
|
151
|
+
), b.current = null, u.disconnectUser().catch(console.error)) : a("๐ CLEANUP EFFECT SKIPPED", {
|
|
152
152
|
hasService: !!u,
|
|
153
|
-
isConnected:
|
|
153
|
+
isConnected: g
|
|
154
154
|
});
|
|
155
|
-
}), [u,
|
|
156
|
-
const
|
|
155
|
+
}), [u, g, a]);
|
|
156
|
+
const k = T(async () => {
|
|
157
157
|
if (a("๐ REFRESH CONNECTION CALLED", {
|
|
158
158
|
hasService: !!u,
|
|
159
159
|
hasUser: !!s
|
|
@@ -161,53 +161,53 @@ const Te = $e({
|
|
|
161
161
|
a("โ ๏ธ REFRESH CONNECTION SKIPPED", "Missing service or user");
|
|
162
162
|
return;
|
|
163
163
|
}
|
|
164
|
-
a("๐ STARTING CONNECTION REFRESH", { userId: s.id }),
|
|
164
|
+
a("๐ STARTING CONNECTION REFRESH", { userId: s.id }), E(!0);
|
|
165
165
|
try {
|
|
166
166
|
a("๐ DISCONNECTING FOR REFRESH"), await u.disconnectUser(), a("๐ RECONNECTING FOR REFRESH");
|
|
167
167
|
const h = await u.connectUser(s);
|
|
168
|
-
|
|
168
|
+
y(h), o(!0), C(null), a("โ
CONNECTION REFRESH SUCCESS", { userId: s.id });
|
|
169
169
|
} catch (h) {
|
|
170
|
-
const
|
|
171
|
-
|
|
170
|
+
const p = h instanceof Error ? h.message : "Refresh failed";
|
|
171
|
+
C(p), a("โ CONNECTION REFRESH ERROR", {
|
|
172
172
|
userId: s.id,
|
|
173
|
-
error:
|
|
173
|
+
error: p
|
|
174
174
|
});
|
|
175
175
|
} finally {
|
|
176
|
-
|
|
176
|
+
E(!1), a("๐ CONNECTION REFRESH FINISHED", { userId: s.id });
|
|
177
177
|
}
|
|
178
178
|
}, [u, s, a]), m = P.useMemo(() => (a("๐ซ CONTEXT VALUE MEMOIZATION", {
|
|
179
179
|
hasService: !!u,
|
|
180
180
|
hasClient: !!x,
|
|
181
|
-
isConnected:
|
|
182
|
-
isLoading:
|
|
181
|
+
isConnected: g,
|
|
182
|
+
isLoading: _,
|
|
183
183
|
hasError: !!d,
|
|
184
|
-
capabilitiesKeys: Object.keys(
|
|
184
|
+
capabilitiesKeys: Object.keys(l)
|
|
185
185
|
}), {
|
|
186
186
|
service: u,
|
|
187
187
|
client: x,
|
|
188
|
-
isConnected:
|
|
189
|
-
isLoading:
|
|
188
|
+
isConnected: g,
|
|
189
|
+
isLoading: _,
|
|
190
190
|
error: d,
|
|
191
|
-
capabilities:
|
|
192
|
-
refreshConnection:
|
|
191
|
+
capabilities: l,
|
|
192
|
+
refreshConnection: k,
|
|
193
193
|
debug: c
|
|
194
194
|
}), [
|
|
195
195
|
u,
|
|
196
196
|
x,
|
|
197
|
-
|
|
198
|
-
|
|
197
|
+
g,
|
|
198
|
+
_,
|
|
199
199
|
d,
|
|
200
|
-
|
|
201
|
-
|
|
200
|
+
l,
|
|
201
|
+
k,
|
|
202
202
|
c,
|
|
203
203
|
a
|
|
204
204
|
]);
|
|
205
205
|
return a("๐ RENDER END", {
|
|
206
|
-
renderCount:
|
|
207
|
-
willRenderChat: !!(x &&
|
|
206
|
+
renderCount: S.current,
|
|
207
|
+
willRenderChat: !!(x && g),
|
|
208
208
|
contextValueReady: !!m
|
|
209
|
-
}), /* @__PURE__ */ e(
|
|
210
|
-
|
|
209
|
+
}), /* @__PURE__ */ e(De.Provider, { value: m, children: x && g ? /* @__PURE__ */ e(
|
|
210
|
+
He,
|
|
211
211
|
{
|
|
212
212
|
client: x,
|
|
213
213
|
customClasses: {
|
|
@@ -216,14 +216,14 @@ const Te = $e({
|
|
|
216
216
|
children: t
|
|
217
217
|
}
|
|
218
218
|
) : t });
|
|
219
|
-
},
|
|
219
|
+
}, As = () => he(), js = (t, s) => {
|
|
220
220
|
const n = new Date(
|
|
221
221
|
Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate())
|
|
222
|
-
),
|
|
222
|
+
), l = new Date(
|
|
223
223
|
Date.UTC(s.getUTCFullYear(), s.getUTCMonth(), s.getUTCDate())
|
|
224
224
|
).getTime() - n.getTime();
|
|
225
|
-
return Math.floor(
|
|
226
|
-
},
|
|
225
|
+
return Math.floor(l / (1e3 * 60 * 60 * 24));
|
|
226
|
+
}, $s = (t) => {
|
|
227
227
|
const s = /* @__PURE__ */ new Date();
|
|
228
228
|
if (Math.floor((s.getTime() - t.getTime()) / 1e3) < 60)
|
|
229
229
|
return "Just now";
|
|
@@ -237,7 +237,7 @@ const Te = $e({
|
|
|
237
237
|
day: "numeric",
|
|
238
238
|
year: "2-digit"
|
|
239
239
|
});
|
|
240
|
-
},
|
|
240
|
+
}, Me = [
|
|
241
241
|
"๐",
|
|
242
242
|
// Apple
|
|
243
243
|
"๐",
|
|
@@ -265,7 +265,7 @@ const Te = $e({
|
|
|
265
265
|
"๐"
|
|
266
266
|
// Melon
|
|
267
267
|
];
|
|
268
|
-
function
|
|
268
|
+
function zs(t) {
|
|
269
269
|
let s = 0;
|
|
270
270
|
for (let n = 0; n < t.length; n++) {
|
|
271
271
|
const r = t.charCodeAt(n);
|
|
@@ -273,29 +273,29 @@ function Gs(t) {
|
|
|
273
273
|
}
|
|
274
274
|
return Math.abs(s);
|
|
275
275
|
}
|
|
276
|
-
function
|
|
277
|
-
const n =
|
|
278
|
-
return
|
|
276
|
+
function Gs(t) {
|
|
277
|
+
const n = zs(t) % Me.length;
|
|
278
|
+
return Me[n];
|
|
279
279
|
}
|
|
280
|
-
const
|
|
280
|
+
const te = ({
|
|
281
281
|
id: t,
|
|
282
282
|
image: s,
|
|
283
283
|
size: n = 40,
|
|
284
284
|
className: r,
|
|
285
|
-
shape:
|
|
285
|
+
shape: l = "squircle"
|
|
286
286
|
}) => {
|
|
287
|
-
const c =
|
|
287
|
+
const c = Gs(t), u = n < 32 ? "text-xs" : n < 56 ? "text-sm" : "text-lg", f = l === "circle" ? { borderRadius: "50%" } : {
|
|
288
288
|
borderRadius: "33%",
|
|
289
289
|
"corner-shape": "superellipse(1.3)"
|
|
290
290
|
};
|
|
291
291
|
return /* @__PURE__ */ e(
|
|
292
292
|
"div",
|
|
293
293
|
{
|
|
294
|
-
className:
|
|
294
|
+
className: M("flex-shrink-0 overflow-hidden", r),
|
|
295
295
|
style: {
|
|
296
296
|
width: `${n}px`,
|
|
297
297
|
height: `${n}px`,
|
|
298
|
-
...
|
|
298
|
+
...f
|
|
299
299
|
},
|
|
300
300
|
children: s ? /* @__PURE__ */ e(
|
|
301
301
|
"img",
|
|
@@ -308,7 +308,7 @@ const ne = ({
|
|
|
308
308
|
"div",
|
|
309
309
|
{
|
|
310
310
|
"aria-hidden": "true",
|
|
311
|
-
className:
|
|
311
|
+
className: M(
|
|
312
312
|
"avatar-fallback flex h-full w-full items-center justify-center font-semibold bg-[#E6E5E3] select-none transition-colors",
|
|
313
313
|
u
|
|
314
314
|
),
|
|
@@ -317,34 +317,34 @@ const ne = ({
|
|
|
317
317
|
)
|
|
318
318
|
}
|
|
319
319
|
);
|
|
320
|
-
},
|
|
321
|
-
({ channel: t, selectedChannel: s, onChannelSelect: n, debug: r = !1, unread:
|
|
322
|
-
var
|
|
320
|
+
}, Fe = P.memo(
|
|
321
|
+
({ channel: t, selectedChannel: s, onChannelSelect: n, debug: r = !1, unread: l }) => {
|
|
322
|
+
var C, N, v, S, b, k;
|
|
323
323
|
const c = (s == null ? void 0 : s.id) === (t == null ? void 0 : t.id), a = () => {
|
|
324
324
|
t && n(t);
|
|
325
|
-
},
|
|
325
|
+
}, f = Object.values(((C = t == null ? void 0 : t.state) == null ? void 0 : C.members) || {}).find(
|
|
326
326
|
(m) => {
|
|
327
|
-
var h,
|
|
328
|
-
return ((h = m.user) == null ? void 0 : h.id) && m.user.id !== ((
|
|
327
|
+
var h, p;
|
|
328
|
+
return ((h = m.user) == null ? void 0 : h.id) && m.user.id !== ((p = t == null ? void 0 : t._client) == null ? void 0 : p.userID);
|
|
329
329
|
}
|
|
330
|
-
), x = ((
|
|
330
|
+
), x = ((N = f == null ? void 0 : f.user) == null ? void 0 : N.name) || "Conversation", y = (v = f == null ? void 0 : f.user) == null ? void 0 : v.image, g = (b = (S = t == null ? void 0 : t.state) == null ? void 0 : S.messages) == null ? void 0 : b[t.state.messages.length - 1], _ = (() => {
|
|
331
331
|
var h;
|
|
332
|
-
if (
|
|
333
|
-
const m = (h =
|
|
332
|
+
if (g != null && g.text) return g.text;
|
|
333
|
+
const m = (h = g == null ? void 0 : g.attachments) == null ? void 0 : h[0];
|
|
334
334
|
return m ? m.og_scrape_url ? m.og_scrape_url : m.type === "image" ? "๐ท Sent an image" : m.type === "video" ? "๐ฅ Sent a video" : m.type === "audio" ? "๐ต Sent audio" : m.type === "file" ? "๐ Sent a file" : "๐ Sent an attachment" : "No messages yet";
|
|
335
|
-
})(),
|
|
335
|
+
})(), E = g != null && g.created_at ? $s(new Date(g.created_at)) : "", d = l ?? 0;
|
|
336
336
|
return r && console.log("๐บ [ChannelList] ๐ CHANNEL PREVIEW RENDER", {
|
|
337
337
|
channelId: t == null ? void 0 : t.id,
|
|
338
338
|
isSelected: c,
|
|
339
339
|
participantName: x,
|
|
340
340
|
unreadCount: d,
|
|
341
|
-
hasTimestamp: !!
|
|
341
|
+
hasTimestamp: !!E
|
|
342
342
|
}), /* @__PURE__ */ e(
|
|
343
343
|
"button",
|
|
344
344
|
{
|
|
345
345
|
type: "button",
|
|
346
346
|
onClick: a,
|
|
347
|
-
className:
|
|
347
|
+
className: M(
|
|
348
348
|
"group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring",
|
|
349
349
|
{
|
|
350
350
|
"bg-primary-alt/10 border-l-4 border-l-primary": c,
|
|
@@ -353,11 +353,11 @@ const ne = ({
|
|
|
353
353
|
),
|
|
354
354
|
children: /* @__PURE__ */ i("div", { className: "flex items-start gap-3", children: [
|
|
355
355
|
/* @__PURE__ */ e(
|
|
356
|
-
|
|
356
|
+
te,
|
|
357
357
|
{
|
|
358
|
-
id: ((
|
|
358
|
+
id: ((k = f == null ? void 0 : f.user) == null ? void 0 : k.id) || t.id || "unknown",
|
|
359
359
|
name: x,
|
|
360
|
-
image:
|
|
360
|
+
image: y,
|
|
361
361
|
size: 44,
|
|
362
362
|
className: "[&_.avatar-fallback]:group-hover:bg-[#eeeeee]"
|
|
363
363
|
}
|
|
@@ -367,17 +367,17 @@ const ne = ({
|
|
|
367
367
|
/* @__PURE__ */ e(
|
|
368
368
|
"h3",
|
|
369
369
|
{
|
|
370
|
-
className:
|
|
370
|
+
className: M(
|
|
371
371
|
"text-sm font-medium truncate",
|
|
372
372
|
c ? "text-primary" : "text-charcoal"
|
|
373
373
|
),
|
|
374
374
|
children: x
|
|
375
375
|
}
|
|
376
376
|
),
|
|
377
|
-
|
|
377
|
+
E && /* @__PURE__ */ e("span", { className: "text-xs text-stone flex-shrink-0", children: E })
|
|
378
378
|
] }),
|
|
379
379
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
|
|
380
|
-
/* @__PURE__ */ e("p", { className: "text-xs text-stone mr-2 flex-1 line-clamp-2", children:
|
|
380
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-stone mr-2 flex-1 line-clamp-2", children: _ }),
|
|
381
381
|
d > 0 && /* @__PURE__ */ e("span", { className: "bg-[#7f22fe] text-white text-xs px-2 py-0.5 rounded-full min-w-[20px] text-center flex-shrink-0", children: d > 99 ? "99+" : d })
|
|
382
382
|
] })
|
|
383
383
|
] })
|
|
@@ -386,25 +386,25 @@ const ne = ({
|
|
|
386
386
|
);
|
|
387
387
|
}
|
|
388
388
|
);
|
|
389
|
-
|
|
390
|
-
const
|
|
389
|
+
Fe.displayName = "CustomChannelPreview";
|
|
390
|
+
const Le = P.memo(
|
|
391
391
|
({
|
|
392
392
|
onChannelSelect: t,
|
|
393
393
|
selectedChannel: s,
|
|
394
394
|
filters: n,
|
|
395
395
|
className: r,
|
|
396
|
-
customEmptyStateIndicator:
|
|
396
|
+
customEmptyStateIndicator: l
|
|
397
397
|
}) => {
|
|
398
398
|
const c = P.useRef(0);
|
|
399
399
|
c.current++;
|
|
400
|
-
const { debug: a = !1 } =
|
|
400
|
+
const { debug: a = !1 } = he();
|
|
401
401
|
a && console.log("๐บ [ChannelList] ๐ RENDER START", {
|
|
402
402
|
renderCount: c.current,
|
|
403
403
|
selectedChannelId: s == null ? void 0 : s.id,
|
|
404
404
|
filters: n
|
|
405
405
|
});
|
|
406
406
|
const u = P.useMemo(() => (x) => /* @__PURE__ */ e(
|
|
407
|
-
|
|
407
|
+
Fe,
|
|
408
408
|
{
|
|
409
409
|
...x,
|
|
410
410
|
selectedChannel: s,
|
|
@@ -415,18 +415,18 @@ const Fe = P.memo(
|
|
|
415
415
|
return /* @__PURE__ */ e(
|
|
416
416
|
"div",
|
|
417
417
|
{
|
|
418
|
-
className:
|
|
418
|
+
className: M(
|
|
419
419
|
"messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
|
|
420
420
|
r
|
|
421
421
|
),
|
|
422
422
|
children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ e(
|
|
423
|
-
|
|
423
|
+
Ve,
|
|
424
424
|
{
|
|
425
425
|
filters: n,
|
|
426
426
|
sort: { last_message_at: -1 },
|
|
427
427
|
options: { limit: 30 },
|
|
428
428
|
Preview: u,
|
|
429
|
-
EmptyStateIndicator:
|
|
429
|
+
EmptyStateIndicator: l
|
|
430
430
|
},
|
|
431
431
|
JSON.stringify(n)
|
|
432
432
|
) })
|
|
@@ -434,8 +434,8 @@ const Fe = P.memo(
|
|
|
434
434
|
);
|
|
435
435
|
}
|
|
436
436
|
);
|
|
437
|
-
|
|
438
|
-
const
|
|
437
|
+
Le.displayName = "ChannelList";
|
|
438
|
+
const ce = ({
|
|
439
439
|
variant: t = "default",
|
|
440
440
|
className: s,
|
|
441
441
|
children: n,
|
|
@@ -444,7 +444,7 @@ const me = ({
|
|
|
444
444
|
"button",
|
|
445
445
|
{
|
|
446
446
|
type: "button",
|
|
447
|
-
className:
|
|
447
|
+
className: M(
|
|
448
448
|
"flex w-full items-center gap-3 rounded-lg px-4 py-3 text-left text-sm transition-colors focus-ring disabled:cursor-not-allowed disabled:opacity-60",
|
|
449
449
|
t === "danger" ? "text-danger hover:bg-danger/50" : "text-charcoal hover:bg-sand",
|
|
450
450
|
s
|
|
@@ -453,12 +453,12 @@ const me = ({
|
|
|
453
453
|
children: n
|
|
454
454
|
}
|
|
455
455
|
);
|
|
456
|
-
function
|
|
456
|
+
function Pe({ label: t, className: s, children: n, ...r }) {
|
|
457
457
|
return /* @__PURE__ */ i(
|
|
458
458
|
"button",
|
|
459
459
|
{
|
|
460
460
|
type: "button",
|
|
461
|
-
className:
|
|
461
|
+
className: M(
|
|
462
462
|
"rounded-full p-2 transition-colors focus-ring",
|
|
463
463
|
{
|
|
464
464
|
"cursor-not-allowed opacity-50": r.disabled,
|
|
@@ -475,218 +475,211 @@ function Le({ label: t, className: s, children: n, ...r }) {
|
|
|
475
475
|
);
|
|
476
476
|
}
|
|
477
477
|
function Oe({ onClick: t }) {
|
|
478
|
-
return /* @__PURE__ */ e(
|
|
478
|
+
return /* @__PURE__ */ e(Pe, { label: "Close", onClick: t, className: "p-1", children: /* @__PURE__ */ e(Ne, { className: "h-5 w-5 text-stone", weight: "bold" }) });
|
|
479
479
|
}
|
|
480
|
-
const
|
|
480
|
+
const Hs = (t) => /* @__PURE__ */ e(We, { ...t, position: "center" }), Vs = () => /* @__PURE__ */ e("svg", { width: "12", height: "12", viewBox: "0 0 10 10", fill: "none", children: /* @__PURE__ */ e(
|
|
481
481
|
"path",
|
|
482
482
|
{
|
|
483
483
|
d: "M10.003 5a.705.705 0 0 1-.469.67L6.7 6.7 5.67 9.535a.715.715 0 0 1-1.34 0L3.3 6.7.466 5.67a.715.715 0 0 1 0-1.34L3.3 3.3 4.33.466a.715.715 0 0 1 1.34 0L6.7 3.3l2.834 1.03a.705.705 0 0 1 .469.67",
|
|
484
484
|
fill: "currentColor"
|
|
485
485
|
}
|
|
486
|
-
) }),
|
|
486
|
+
) }), Ws = (t) => {
|
|
487
487
|
var s;
|
|
488
488
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_TIP";
|
|
489
|
-
},
|
|
489
|
+
}, Zs = (t) => {
|
|
490
490
|
var s;
|
|
491
491
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_PAID";
|
|
492
|
-
},
|
|
492
|
+
}, qs = (t) => {
|
|
493
493
|
var s;
|
|
494
494
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_CHATBOT";
|
|
495
|
-
},
|
|
495
|
+
}, Ue = (t) => Ws(t) || Zs(t), Ys = (t) => {
|
|
496
496
|
var s;
|
|
497
|
-
return
|
|
498
|
-
},
|
|
497
|
+
return Ue(t) && !((s = t.text) != null && s.trim());
|
|
498
|
+
}, ke = ({
|
|
499
499
|
message: t,
|
|
500
500
|
standalone: s = !1
|
|
501
501
|
}) => {
|
|
502
|
-
var
|
|
503
|
-
const n =
|
|
502
|
+
var l;
|
|
503
|
+
const n = Ue(t), r = qs(t);
|
|
504
504
|
if (!n && !r)
|
|
505
505
|
return null;
|
|
506
506
|
if (n) {
|
|
507
|
-
const c = (
|
|
507
|
+
const c = (l = t.metadata) == null ? void 0 : l.amount_text;
|
|
508
508
|
if (!c) return null;
|
|
509
509
|
const a = s ? "message-tip-standalone" : "message-tag message-tag--tip", u = s ? `${c} tip` : `Delivered with ${c} tip`;
|
|
510
510
|
return /* @__PURE__ */ i("div", { className: a, children: [
|
|
511
|
-
/* @__PURE__ */ e(
|
|
511
|
+
/* @__PURE__ */ e(Ls, { size: s ? 14 : 12 }),
|
|
512
512
|
/* @__PURE__ */ e("span", { children: u })
|
|
513
513
|
] });
|
|
514
514
|
}
|
|
515
515
|
return /* @__PURE__ */ i("div", { className: "message-tag message-tag--chatbot", children: [
|
|
516
|
-
/* @__PURE__ */ e("span", { className: "message-tag__icon", style: { marginTop: -1 }, children: /* @__PURE__ */ e(
|
|
516
|
+
/* @__PURE__ */ e("span", { className: "message-tag__icon", style: { marginTop: -1 }, children: /* @__PURE__ */ e(Vs, {}) }),
|
|
517
517
|
/* @__PURE__ */ e("span", { className: "message-tag__label", children: "Chatbot" })
|
|
518
518
|
] });
|
|
519
|
-
},
|
|
520
|
-
var
|
|
519
|
+
}, Js = (t) => {
|
|
520
|
+
var X, w;
|
|
521
521
|
const {
|
|
522
522
|
additionalMessageInputProps: s,
|
|
523
523
|
editing: n,
|
|
524
524
|
endOfGroup: r,
|
|
525
|
-
firstOfGroup:
|
|
525
|
+
firstOfGroup: l,
|
|
526
526
|
groupedByUser: c,
|
|
527
527
|
handleAction: a,
|
|
528
528
|
handleOpenThread: u,
|
|
529
|
-
handleRetry:
|
|
529
|
+
handleRetry: f,
|
|
530
530
|
highlighted: x,
|
|
531
|
-
isMessageAIGenerated:
|
|
532
|
-
isMyMessage:
|
|
533
|
-
message:
|
|
534
|
-
onUserClick:
|
|
535
|
-
onUserHover:
|
|
531
|
+
isMessageAIGenerated: y,
|
|
532
|
+
isMyMessage: g,
|
|
533
|
+
message: o,
|
|
534
|
+
onUserClick: _,
|
|
535
|
+
onUserHover: E,
|
|
536
536
|
renderText: d,
|
|
537
|
-
threadList:
|
|
538
|
-
} = t, { client:
|
|
539
|
-
Attachment:
|
|
540
|
-
Avatar:
|
|
541
|
-
EditMessageModal: A =
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
() =>
|
|
557
|
-
[
|
|
558
|
-
), $ = we(
|
|
559
|
-
() => !l.shared_location && !l.attachments ? [] : l.shared_location ? [l.shared_location, ...l.attachments ?? []] : l.attachments,
|
|
560
|
-
[l]
|
|
537
|
+
threadList: C
|
|
538
|
+
} = t, { client: N } = qe("CustomMessage"), { t: v } = Ye("CustomMessage"), [S, b] = I(!1), [k, m] = I(!1), h = Je(o.id), {
|
|
539
|
+
Attachment: p = Xe,
|
|
540
|
+
Avatar: G = Ke,
|
|
541
|
+
EditMessageModal: A = es,
|
|
542
|
+
MessageBlocked: q = ss,
|
|
543
|
+
MessageBouncePrompt: Y = ts,
|
|
544
|
+
MessageDeleted: ne = ns,
|
|
545
|
+
MessageIsThreadReplyInChannelButtonIndicator: K = rs,
|
|
546
|
+
MessageRepliesCountButton: ee = as,
|
|
547
|
+
MessageStatus: re = ls,
|
|
548
|
+
MessageTimestamp: O = Re,
|
|
549
|
+
ReminderNotification: H = os,
|
|
550
|
+
StreamedMessageText: J = is,
|
|
551
|
+
PinIndicator: z
|
|
552
|
+
} = Qe("CustomMessage"), R = cs(o), D = ds(o), U = we(
|
|
553
|
+
() => y == null ? void 0 : y(o),
|
|
554
|
+
[y, o]
|
|
555
|
+
), j = we(
|
|
556
|
+
() => !o.shared_location && !o.attachments ? [] : o.shared_location ? [o.shared_location, ...o.attachments ?? []] : o.attachments,
|
|
557
|
+
[o]
|
|
561
558
|
);
|
|
562
|
-
if (
|
|
559
|
+
if (ms(o))
|
|
563
560
|
return null;
|
|
564
|
-
if (
|
|
565
|
-
return /* @__PURE__ */ e(
|
|
566
|
-
if (
|
|
567
|
-
return /* @__PURE__ */ e(
|
|
568
|
-
const
|
|
569
|
-
let
|
|
570
|
-
|
|
571
|
-
const
|
|
561
|
+
if (o.deleted_at || o.type === "deleted")
|
|
562
|
+
return /* @__PURE__ */ e(ne, { message: o });
|
|
563
|
+
if (us(o))
|
|
564
|
+
return /* @__PURE__ */ e(q, {});
|
|
565
|
+
const se = !c || r, Q = !C && !!o.reply_count, V = !C && o.show_in_channel && o.parent_id, le = o.status === "failed" && ((X = o.error) == null ? void 0 : X.status) !== 403, oe = hs(o), ae = fs(o) && !U;
|
|
566
|
+
let $;
|
|
567
|
+
le ? $ = () => f(o) : oe ? $ = () => b(!0) : ae && ($ = () => m((L) => !L));
|
|
568
|
+
const fe = M(
|
|
572
569
|
"str-chat__message str-chat__message-simple",
|
|
573
|
-
`str-chat__message--${
|
|
574
|
-
`str-chat__message--${
|
|
575
|
-
|
|
576
|
-
|
|
570
|
+
`str-chat__message--${o.type}`,
|
|
571
|
+
`str-chat__message--${o.status}`,
|
|
572
|
+
g() ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
|
|
573
|
+
o.text ? "str-chat__message--has-text" : "has-no-text",
|
|
577
574
|
{
|
|
578
|
-
"str-chat__message--has-attachment":
|
|
575
|
+
"str-chat__message--has-attachment": R,
|
|
579
576
|
"str-chat__message--highlighted": x,
|
|
580
|
-
"str-chat__message--pinned pinned-message":
|
|
581
|
-
"str-chat__message--with-reactions":
|
|
582
|
-
"str-chat__message-send-can-be-retried": (
|
|
583
|
-
"str-chat__message-with-thread-link":
|
|
577
|
+
"str-chat__message--pinned pinned-message": o.pinned,
|
|
578
|
+
"str-chat__message--with-reactions": D,
|
|
579
|
+
"str-chat__message-send-can-be-retried": (o == null ? void 0 : o.status) === "failed" && ((w = o == null ? void 0 : o.error) == null ? void 0 : w.status) !== 403,
|
|
580
|
+
"str-chat__message-with-thread-link": Q || V,
|
|
584
581
|
"str-chat__virtual-message__wrapper--end": r,
|
|
585
|
-
"str-chat__virtual-message__wrapper--first":
|
|
582
|
+
"str-chat__virtual-message__wrapper--first": l,
|
|
586
583
|
"str-chat__virtual-message__wrapper--group": c
|
|
587
584
|
}
|
|
588
|
-
),
|
|
589
|
-
return /* @__PURE__ */ i(
|
|
585
|
+
), ie = o.poll_id && N.polls.fromState(o.poll_id), ge = Ys(o);
|
|
586
|
+
return /* @__PURE__ */ i(be, { children: [
|
|
590
587
|
n && /* @__PURE__ */ e(
|
|
591
588
|
A,
|
|
592
589
|
{
|
|
593
590
|
additionalMessageInputProps: s
|
|
594
591
|
}
|
|
595
592
|
),
|
|
596
|
-
|
|
597
|
-
|
|
593
|
+
S && /* @__PURE__ */ e(
|
|
594
|
+
gs,
|
|
598
595
|
{
|
|
599
|
-
MessageBouncePrompt:
|
|
600
|
-
onClose: () =>
|
|
601
|
-
open:
|
|
596
|
+
MessageBouncePrompt: Y,
|
|
597
|
+
onClose: () => b(!1),
|
|
598
|
+
open: S
|
|
602
599
|
}
|
|
603
600
|
),
|
|
604
|
-
/* @__PURE__ */ i("div", { className:
|
|
605
|
-
|
|
606
|
-
!!h && /* @__PURE__ */ e(
|
|
607
|
-
|
|
608
|
-
|
|
601
|
+
/* @__PURE__ */ i("div", { className: fe, children: [
|
|
602
|
+
z && /* @__PURE__ */ e(z, {}),
|
|
603
|
+
!!h && /* @__PURE__ */ e(H, { reminder: h }),
|
|
604
|
+
o.user && /* @__PURE__ */ e(
|
|
605
|
+
G,
|
|
609
606
|
{
|
|
610
|
-
image:
|
|
611
|
-
name:
|
|
612
|
-
onClick:
|
|
613
|
-
onMouseOver:
|
|
614
|
-
user:
|
|
607
|
+
image: o.user.image,
|
|
608
|
+
name: o.user.name || o.user.id,
|
|
609
|
+
onClick: _,
|
|
610
|
+
onMouseOver: E,
|
|
611
|
+
user: o.user
|
|
615
612
|
}
|
|
616
613
|
),
|
|
617
|
-
/* @__PURE__ */
|
|
614
|
+
/* @__PURE__ */ e(
|
|
618
615
|
"div",
|
|
619
616
|
{
|
|
620
|
-
className:
|
|
621
|
-
"str-chat__simple-message--error-failed":
|
|
617
|
+
className: M("str-chat__message-inner", {
|
|
618
|
+
"str-chat__simple-message--error-failed": le || oe
|
|
622
619
|
}),
|
|
623
620
|
"data-testid": "message-inner",
|
|
624
|
-
onClick:
|
|
625
|
-
onKeyDown:
|
|
626
|
-
role:
|
|
627
|
-
tabIndex:
|
|
628
|
-
children:
|
|
629
|
-
/*
|
|
630
|
-
/* @__PURE__ */ e(
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
/* @__PURE__ */ e(
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
] }),
|
|
653
|
-
/* @__PURE__ */ e(Me, { message: l })
|
|
654
|
-
] })
|
|
655
|
-
]
|
|
621
|
+
onClick: $,
|
|
622
|
+
onKeyDown: $,
|
|
623
|
+
role: $ ? "button" : void 0,
|
|
624
|
+
tabIndex: $ ? 0 : void 0,
|
|
625
|
+
children: ge ? (
|
|
626
|
+
/* Tip-only messages render as a standalone bubble */
|
|
627
|
+
/* @__PURE__ */ e(ke, { message: o, standalone: !0 })
|
|
628
|
+
) : /* @__PURE__ */ i("div", { className: "str-chat__message-bubble-wrapper", children: [
|
|
629
|
+
/* @__PURE__ */ i("div", { className: "str-chat__message-bubble", children: [
|
|
630
|
+
ie && /* @__PURE__ */ e(xs, { poll: ie }),
|
|
631
|
+
j != null && j.length && !o.quoted_message ? /* @__PURE__ */ e(
|
|
632
|
+
p,
|
|
633
|
+
{
|
|
634
|
+
actionHandler: a,
|
|
635
|
+
attachments: j
|
|
636
|
+
}
|
|
637
|
+
) : null,
|
|
638
|
+
U ? /* @__PURE__ */ e(
|
|
639
|
+
J,
|
|
640
|
+
{
|
|
641
|
+
message: o,
|
|
642
|
+
renderText: d
|
|
643
|
+
}
|
|
644
|
+
) : /* @__PURE__ */ e(Cs, { message: o, renderText: d }),
|
|
645
|
+
/* @__PURE__ */ e(bs, {})
|
|
646
|
+
] }),
|
|
647
|
+
/* @__PURE__ */ e(ke, { message: o })
|
|
648
|
+
] })
|
|
656
649
|
}
|
|
657
650
|
),
|
|
658
|
-
|
|
659
|
-
|
|
651
|
+
Q && /* @__PURE__ */ e(
|
|
652
|
+
ee,
|
|
660
653
|
{
|
|
661
654
|
onClick: u,
|
|
662
|
-
reply_count:
|
|
655
|
+
reply_count: o.reply_count
|
|
663
656
|
}
|
|
664
657
|
),
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
/* @__PURE__ */ e(
|
|
668
|
-
!
|
|
669
|
-
/* @__PURE__ */ e(
|
|
670
|
-
|
|
671
|
-
|
|
658
|
+
V && /* @__PURE__ */ e(K, {}),
|
|
659
|
+
se && /* @__PURE__ */ i("div", { className: "str-chat__message-metadata", children: [
|
|
660
|
+
/* @__PURE__ */ e(re, {}),
|
|
661
|
+
!g() && !!o.user && /* @__PURE__ */ e("span", { className: "str-chat__message-simple-name", children: o.user.name || o.user.id }),
|
|
662
|
+
/* @__PURE__ */ e(O, { customClass: "str-chat__message-simple-timestamp" }),
|
|
663
|
+
ae && /* @__PURE__ */ e("span", { className: "str-chat__mesage-simple-edited", children: v("Edited") }),
|
|
664
|
+
ae && /* @__PURE__ */ e(Ns, { calendar: !0, open: k })
|
|
672
665
|
] })
|
|
673
|
-
] },
|
|
666
|
+
] }, o.id)
|
|
674
667
|
] });
|
|
675
|
-
},
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
),
|
|
679
|
-
const s =
|
|
680
|
-
return /* @__PURE__ */ e(
|
|
681
|
-
},
|
|
668
|
+
}, Qs = P.memo(
|
|
669
|
+
Js,
|
|
670
|
+
Ze
|
|
671
|
+
), Xs = (t) => {
|
|
672
|
+
const s = vs("CustomMessage");
|
|
673
|
+
return /* @__PURE__ */ e(Qs, { ...s, ...t });
|
|
674
|
+
}, Ks = (t) => ({
|
|
682
675
|
linkPreviews: Array.from(t.previews.values()).filter(
|
|
683
676
|
(s) => _e.previewIsLoaded(s) || _e.previewIsLoading(s)
|
|
684
677
|
)
|
|
685
|
-
}),
|
|
678
|
+
}), et = ({
|
|
686
679
|
link: t,
|
|
687
680
|
onDismiss: s
|
|
688
681
|
}) => {
|
|
689
|
-
const { og_scrape_url: n, title: r, image_url:
|
|
682
|
+
const { og_scrape_url: n, title: r, image_url: l } = t;
|
|
690
683
|
return /* @__PURE__ */ i(
|
|
691
684
|
"a",
|
|
692
685
|
{
|
|
@@ -695,10 +688,10 @@ const Vs = (t) => /* @__PURE__ */ e(Ve, { ...t, position: "center" }), Ws = () =
|
|
|
695
688
|
rel: "noopener noreferrer",
|
|
696
689
|
className: "relative w-full block rounded-[24px] bg-[#121110] p-2 no-underline transition-opacity hover:opacity-90",
|
|
697
690
|
children: [
|
|
698
|
-
|
|
691
|
+
l && /* @__PURE__ */ e(
|
|
699
692
|
"img",
|
|
700
693
|
{
|
|
701
|
-
src:
|
|
694
|
+
src: l,
|
|
702
695
|
alt: r || "",
|
|
703
696
|
className: "h-[148px] w-full rounded-[20px] object-cover"
|
|
704
697
|
}
|
|
@@ -712,7 +705,7 @@ const Vs = (t) => /* @__PURE__ */ e(Ve, { ...t, position: "center" }), Ws = () =
|
|
|
712
705
|
},
|
|
713
706
|
className: "absolute right-4 top-4 flex size-6 items-center justify-center rounded-full border border-white/40 bg-white/70 backdrop-blur-2xl",
|
|
714
707
|
"aria-label": "Close link preview",
|
|
715
|
-
children: /* @__PURE__ */ e(
|
|
708
|
+
children: /* @__PURE__ */ e(Ne, { className: "size-4 text-black/90" })
|
|
716
709
|
}
|
|
717
710
|
),
|
|
718
711
|
/* @__PURE__ */ i("div", { className: "p-2", children: [
|
|
@@ -722,32 +715,32 @@ const Vs = (t) => /* @__PURE__ */ e(Ve, { ...t, position: "center" }), Ws = () =
|
|
|
722
715
|
]
|
|
723
716
|
}
|
|
724
717
|
);
|
|
725
|
-
},
|
|
726
|
-
const { linkPreviewsManager: t } =
|
|
718
|
+
}, st = () => {
|
|
719
|
+
const { linkPreviewsManager: t } = ws(), { linkPreviews: s } = ps(
|
|
727
720
|
t.state,
|
|
728
|
-
|
|
729
|
-
), n = (
|
|
730
|
-
t.dismissPreview(
|
|
721
|
+
Ks
|
|
722
|
+
), n = (l) => {
|
|
723
|
+
t.dismissPreview(l);
|
|
731
724
|
};
|
|
732
|
-
return s.length > 0 ? /* @__PURE__ */ e("div", { className: "flex flex-col items-center w-full gap-2 mb-4", children: s.map((
|
|
733
|
-
|
|
725
|
+
return s.length > 0 ? /* @__PURE__ */ e("div", { className: "flex flex-col items-center w-full gap-2 mb-4", children: s.map((l) => /* @__PURE__ */ e(
|
|
726
|
+
et,
|
|
734
727
|
{
|
|
735
|
-
link:
|
|
728
|
+
link: l,
|
|
736
729
|
onDismiss: n
|
|
737
730
|
},
|
|
738
|
-
|
|
731
|
+
l.og_scrape_url
|
|
739
732
|
)) }) : null;
|
|
740
|
-
},
|
|
741
|
-
const { handleSubmit: t } =
|
|
742
|
-
return /* @__PURE__ */ i(
|
|
733
|
+
}, tt = () => {
|
|
734
|
+
const { handleSubmit: t } = Es(), s = Is();
|
|
735
|
+
return /* @__PURE__ */ i(be, { children: [
|
|
743
736
|
/* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(Ss, {}) }),
|
|
744
737
|
/* @__PURE__ */ i("div", { className: "central-container min-w-0 w-full p-2 bg-white rounded-[1.5rem] shadow-[0_4px_16px_0_rgba(0,0,0,0.08),0_1px_2px_0_rgba(0,0,0,0.04),0_0_0_1px_rgba(0,0,0,0.04)]", children: [
|
|
738
|
+
/* @__PURE__ */ e(_s, {}),
|
|
739
|
+
/* @__PURE__ */ e(st, {}),
|
|
745
740
|
/* @__PURE__ */ e(Ms, {}),
|
|
746
|
-
/* @__PURE__ */ e(tt, {}),
|
|
747
|
-
/* @__PURE__ */ e(ks, {}),
|
|
748
741
|
/* @__PURE__ */ i("div", { className: "flex", children: [
|
|
749
742
|
/* @__PURE__ */ e("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ e(
|
|
750
|
-
|
|
743
|
+
ks,
|
|
751
744
|
{
|
|
752
745
|
className: "w-full resize-none outline-none leading-6",
|
|
753
746
|
autoFocus: !0,
|
|
@@ -769,12 +762,12 @@ const Vs = (t) => /* @__PURE__ */ e(Ve, { ...t, position: "center" }), Ws = () =
|
|
|
769
762
|
] })
|
|
770
763
|
] })
|
|
771
764
|
] });
|
|
772
|
-
},
|
|
765
|
+
}, nt = ({
|
|
773
766
|
renderActions: t
|
|
774
767
|
}) => /* @__PURE__ */ i("div", { className: "message-input flex items-center gap-2 p-4", children: [
|
|
775
768
|
t && (t == null ? void 0 : t()),
|
|
776
|
-
/* @__PURE__ */ e(
|
|
777
|
-
] }),
|
|
769
|
+
/* @__PURE__ */ e(ys, { Input: tt })
|
|
770
|
+
] }), rt = (t) => {
|
|
778
771
|
const s = t.message.hide_date === !0;
|
|
779
772
|
return /* @__PURE__ */ i("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
780
773
|
/* @__PURE__ */ i("div", { className: "str-chat__message--system__text", children: [
|
|
@@ -782,12 +775,12 @@ const Vs = (t) => /* @__PURE__ */ e(Ve, { ...t, position: "center" }), Ws = () =
|
|
|
782
775
|
/* @__PURE__ */ e("p", { children: t.message.text }),
|
|
783
776
|
/* @__PURE__ */ e("div", { className: "str-chat__message--system__line" })
|
|
784
777
|
] }),
|
|
785
|
-
!s && /* @__PURE__ */ e(
|
|
778
|
+
!s && /* @__PURE__ */ e(Re, { message: t.message })
|
|
786
779
|
] });
|
|
787
|
-
},
|
|
780
|
+
}, at = () => null, lt = ({ className: t, message: s }) => /* @__PURE__ */ i(
|
|
788
781
|
"div",
|
|
789
782
|
{
|
|
790
|
-
className:
|
|
783
|
+
className: M("flex items-center justify-center h-full", t),
|
|
791
784
|
children: [
|
|
792
785
|
/* @__PURE__ */ i("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
|
|
793
786
|
/* @__PURE__ */ e("circle", { cx: "6", cy: "50", r: "6", children: /* @__PURE__ */ e(
|
|
@@ -827,40 +820,59 @@ const Vs = (t) => /* @__PURE__ */ e(Ve, { ...t, position: "center" }), Ws = () =
|
|
|
827
820
|
s && /* @__PURE__ */ e("span", { className: "text-stone", children: s })
|
|
828
821
|
]
|
|
829
822
|
}
|
|
830
|
-
),
|
|
831
|
-
/* @__PURE__ */ e(
|
|
823
|
+
), ue = P.memo(() => /* @__PURE__ */ e("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ i("div", { className: "flex items-center", children: [
|
|
824
|
+
/* @__PURE__ */ e(lt, { className: "w-6 h-6" }),
|
|
832
825
|
/* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading messages" })
|
|
833
826
|
] }) }));
|
|
834
|
-
|
|
835
|
-
const
|
|
836
|
-
var g,
|
|
837
|
-
const { channel:
|
|
838
|
-
(
|
|
839
|
-
var
|
|
840
|
-
return ((
|
|
827
|
+
ue.displayName = "LoadingState";
|
|
828
|
+
const ot = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) => {
|
|
829
|
+
var g, o, _, E, d, C;
|
|
830
|
+
const { channel: l } = Te(), c = P.useMemo(() => Object.values(l.state.members || {}).find(
|
|
831
|
+
(v) => {
|
|
832
|
+
var S;
|
|
833
|
+
return ((S = v.user) == null ? void 0 : S.id) && v.user.id !== l._client.userID;
|
|
834
|
+
}
|
|
835
|
+
), [l._client.userID, l.state.members]), a = ((g = c == null ? void 0 : c.user) == null ? void 0 : g.name) || ((o = c == null ? void 0 : c.user) == null ? void 0 : o.id) || "Unknown member", u = (_ = c == null ? void 0 : c.user) == null ? void 0 : _.image, [f, x] = I(!!((E = l.state.membership) != null && E.pinned_at));
|
|
836
|
+
Z(() => {
|
|
837
|
+
const N = (v) => {
|
|
838
|
+
var S;
|
|
839
|
+
x(v != null && v.member ? !!v.member.pinned_at : !!((S = l.state.membership) != null && S.pinned_at));
|
|
840
|
+
};
|
|
841
|
+
return l.on("member.updated", N), () => {
|
|
842
|
+
l.off("member.updated", N);
|
|
843
|
+
};
|
|
844
|
+
}, [l]);
|
|
845
|
+
const y = async () => {
|
|
846
|
+
try {
|
|
847
|
+
f ? await l.unpin() : await l.pin();
|
|
848
|
+
} catch (N) {
|
|
849
|
+
console.error("[CustomChannelHeader] Failed to update pinned status:", N);
|
|
841
850
|
}
|
|
842
|
-
|
|
851
|
+
};
|
|
843
852
|
return /* @__PURE__ */ i("div", { className: "@container", children: [
|
|
844
853
|
/* @__PURE__ */ i("div", { className: "flex justify-between items-center @lg:hidden", children: [
|
|
845
|
-
/* @__PURE__ */
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
854
|
+
/* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
|
|
855
|
+
/* @__PURE__ */ e(
|
|
856
|
+
"button",
|
|
857
|
+
{
|
|
858
|
+
className: M(
|
|
859
|
+
"size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
|
|
860
|
+
!s && "invisible"
|
|
861
|
+
),
|
|
862
|
+
onClick: t || (() => {
|
|
863
|
+
}),
|
|
864
|
+
type: "button",
|
|
865
|
+
"aria-label": "Back to conversations",
|
|
866
|
+
children: /* @__PURE__ */ e(pe, { className: "size-5 text-black/90" })
|
|
867
|
+
}
|
|
868
|
+
),
|
|
869
|
+
/* @__PURE__ */ e("div", { className: "size-10" })
|
|
870
|
+
] }),
|
|
859
871
|
/* @__PURE__ */ i("div", { className: "flex flex-col gap-1 items-center", children: [
|
|
860
872
|
/* @__PURE__ */ e(
|
|
861
|
-
|
|
873
|
+
te,
|
|
862
874
|
{
|
|
863
|
-
id: ((
|
|
875
|
+
id: ((d = c == null ? void 0 : c.user) == null ? void 0 : d.id) || l.id || "unknown",
|
|
864
876
|
name: a,
|
|
865
877
|
image: u,
|
|
866
878
|
size: 40
|
|
@@ -868,18 +880,34 @@ const it = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
|
|
|
868
880
|
),
|
|
869
881
|
/* @__PURE__ */ e("h1", { className: "text-xs font-medium text-black/90", children: a })
|
|
870
882
|
] }),
|
|
871
|
-
/* @__PURE__ */
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
"size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center"
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
+
/* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
|
|
884
|
+
/* @__PURE__ */ e(
|
|
885
|
+
"button",
|
|
886
|
+
{
|
|
887
|
+
className: "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
|
|
888
|
+
onClick: y,
|
|
889
|
+
type: "button",
|
|
890
|
+
"aria-label": f ? "Unstar conversation" : "Star conversation",
|
|
891
|
+
children: /* @__PURE__ */ e(
|
|
892
|
+
ye,
|
|
893
|
+
{
|
|
894
|
+
className: "size-5 text-black/90",
|
|
895
|
+
weight: f ? "fill" : "regular"
|
|
896
|
+
}
|
|
897
|
+
)
|
|
898
|
+
}
|
|
899
|
+
),
|
|
900
|
+
/* @__PURE__ */ e(
|
|
901
|
+
"button",
|
|
902
|
+
{
|
|
903
|
+
className: "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
|
|
904
|
+
onClick: n,
|
|
905
|
+
type: "button",
|
|
906
|
+
"aria-label": "Show info",
|
|
907
|
+
children: /* @__PURE__ */ e(Ee, { className: "size-5 text-black/90" })
|
|
908
|
+
}
|
|
909
|
+
)
|
|
910
|
+
] })
|
|
883
911
|
] }),
|
|
884
912
|
/* @__PURE__ */ i("div", { className: "hidden @lg:flex items-center justify-between gap-3 min-h-12", children: [
|
|
885
913
|
/* @__PURE__ */ i("div", { className: "flex items-center gap-4 min-w-0", children: [
|
|
@@ -894,9 +922,9 @@ const it = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
|
|
|
894
922
|
}
|
|
895
923
|
),
|
|
896
924
|
/* @__PURE__ */ e(
|
|
897
|
-
|
|
925
|
+
te,
|
|
898
926
|
{
|
|
899
|
-
id: ((
|
|
927
|
+
id: ((C = c == null ? void 0 : c.user) == null ? void 0 : C.id) || l.id || "unknown",
|
|
900
928
|
name: a,
|
|
901
929
|
image: u,
|
|
902
930
|
size: 40
|
|
@@ -904,99 +932,117 @@ const it = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
|
|
|
904
932
|
),
|
|
905
933
|
/* @__PURE__ */ e("div", { className: "min-w-0", children: /* @__PURE__ */ e("h1", { className: "font-medium text-black/90 truncate", children: a }) })
|
|
906
934
|
] }),
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
"size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center"
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
935
|
+
/* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
|
|
936
|
+
/* @__PURE__ */ e(
|
|
937
|
+
"button",
|
|
938
|
+
{
|
|
939
|
+
className: "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
|
|
940
|
+
onClick: y,
|
|
941
|
+
type: "button",
|
|
942
|
+
"aria-label": f ? "Unstar conversation" : "Star conversation",
|
|
943
|
+
children: /* @__PURE__ */ e(
|
|
944
|
+
ye,
|
|
945
|
+
{
|
|
946
|
+
className: "size-5 text-black/90",
|
|
947
|
+
weight: f ? "fill" : "regular"
|
|
948
|
+
}
|
|
949
|
+
)
|
|
950
|
+
}
|
|
951
|
+
),
|
|
952
|
+
r && n && /* @__PURE__ */ e(
|
|
953
|
+
"button",
|
|
954
|
+
{
|
|
955
|
+
className: "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
|
|
956
|
+
onClick: n,
|
|
957
|
+
type: "button",
|
|
958
|
+
"aria-label": "Show info",
|
|
959
|
+
children: /* @__PURE__ */ e(Ee, { className: "size-5 text-black/90" })
|
|
960
|
+
}
|
|
961
|
+
)
|
|
962
|
+
] })
|
|
917
963
|
] })
|
|
918
964
|
] });
|
|
919
|
-
},
|
|
965
|
+
}, it = ({
|
|
920
966
|
dialogRef: t,
|
|
921
967
|
onClose: s,
|
|
922
968
|
participant: n,
|
|
923
969
|
channel: r,
|
|
924
|
-
followerStatusLabel:
|
|
970
|
+
followerStatusLabel: l,
|
|
925
971
|
onLeaveConversation: c,
|
|
926
972
|
onBlockParticipant: a,
|
|
927
973
|
showDeleteConversation: u = !0,
|
|
928
|
-
onDeleteConversationClick:
|
|
974
|
+
onDeleteConversationClick: f,
|
|
929
975
|
onBlockParticipantClick: x,
|
|
930
|
-
onReportParticipantClick:
|
|
976
|
+
onReportParticipantClick: y
|
|
931
977
|
}) => {
|
|
932
|
-
var
|
|
933
|
-
const { service:
|
|
934
|
-
var
|
|
935
|
-
if (!(!
|
|
978
|
+
var K, ee, re, O, H, J, z;
|
|
979
|
+
const { service: g, debug: o } = he(), [_, E] = I(!1), [d, C] = I(!1), [N, v] = I(!1), S = T(async () => {
|
|
980
|
+
var R;
|
|
981
|
+
if (!(!g || !((R = n == null ? void 0 : n.user) != null && R.id)))
|
|
936
982
|
try {
|
|
937
|
-
const
|
|
938
|
-
(
|
|
939
|
-
var
|
|
940
|
-
return
|
|
983
|
+
const U = (await g.getBlockedUsers()).some(
|
|
984
|
+
(j) => {
|
|
985
|
+
var se;
|
|
986
|
+
return j.blocked_user_id === ((se = n == null ? void 0 : n.user) == null ? void 0 : se.id);
|
|
941
987
|
}
|
|
942
988
|
);
|
|
943
|
-
|
|
944
|
-
} catch (
|
|
989
|
+
E(U);
|
|
990
|
+
} catch (D) {
|
|
945
991
|
console.error(
|
|
946
992
|
"[ChannelInfoDialog] Failed to check blocked status:",
|
|
947
|
-
|
|
993
|
+
D
|
|
948
994
|
);
|
|
949
995
|
}
|
|
950
|
-
}, [
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
}, [
|
|
954
|
-
const
|
|
955
|
-
var
|
|
996
|
+
}, [g, (K = n == null ? void 0 : n.user) == null ? void 0 : K.id]);
|
|
997
|
+
Z(() => {
|
|
998
|
+
S();
|
|
999
|
+
}, [S]);
|
|
1000
|
+
const b = async () => {
|
|
1001
|
+
var R;
|
|
956
1002
|
if (!d) {
|
|
957
|
-
|
|
1003
|
+
f == null || f(), o && console.log("[ChannelInfoDialog] Leave conversation", r.cid), C(!0);
|
|
958
1004
|
try {
|
|
959
|
-
const
|
|
960
|
-
await r.hide(
|
|
961
|
-
} catch (
|
|
962
|
-
console.error("[ChannelInfoDialog] Failed to leave conversation",
|
|
1005
|
+
const D = ((R = r._client) == null ? void 0 : R.userID) ?? null;
|
|
1006
|
+
await r.hide(D, !1), c && await c(r), s();
|
|
1007
|
+
} catch (D) {
|
|
1008
|
+
console.error("[ChannelInfoDialog] Failed to leave conversation", D);
|
|
963
1009
|
} finally {
|
|
964
|
-
|
|
1010
|
+
C(!1);
|
|
965
1011
|
}
|
|
966
1012
|
}
|
|
967
|
-
},
|
|
968
|
-
var
|
|
969
|
-
if (!(
|
|
970
|
-
x == null || x(),
|
|
1013
|
+
}, k = async () => {
|
|
1014
|
+
var R, D, U;
|
|
1015
|
+
if (!(N || !g)) {
|
|
1016
|
+
x == null || x(), o && console.log("[ChannelInfoDialog] Block member", (R = n == null ? void 0 : n.user) == null ? void 0 : R.id), v(!0);
|
|
971
1017
|
try {
|
|
972
|
-
await
|
|
973
|
-
} catch (
|
|
974
|
-
console.error("[ChannelInfoDialog] Failed to block member",
|
|
1018
|
+
await g.blockUser((D = n == null ? void 0 : n.user) == null ? void 0 : D.id), a && await a((U = n == null ? void 0 : n.user) == null ? void 0 : U.id), s();
|
|
1019
|
+
} catch (j) {
|
|
1020
|
+
console.error("[ChannelInfoDialog] Failed to block member", j);
|
|
975
1021
|
} finally {
|
|
976
|
-
|
|
1022
|
+
v(!1);
|
|
977
1023
|
}
|
|
978
1024
|
}
|
|
979
1025
|
}, m = async () => {
|
|
980
|
-
var
|
|
981
|
-
if (!(
|
|
982
|
-
x == null || x(),
|
|
1026
|
+
var R, D, U;
|
|
1027
|
+
if (!(N || !g)) {
|
|
1028
|
+
x == null || x(), o && console.log("[ChannelInfoDialog] Unblock member", (R = n == null ? void 0 : n.user) == null ? void 0 : R.id), v(!0);
|
|
983
1029
|
try {
|
|
984
|
-
await
|
|
985
|
-
} catch (
|
|
986
|
-
console.error("[ChannelInfoDialog] Failed to unblock member",
|
|
1030
|
+
await g.unBlockUser((D = n == null ? void 0 : n.user) == null ? void 0 : D.id), a && await a((U = n == null ? void 0 : n.user) == null ? void 0 : U.id), s();
|
|
1031
|
+
} catch (j) {
|
|
1032
|
+
console.error("[ChannelInfoDialog] Failed to unblock member", j);
|
|
987
1033
|
} finally {
|
|
988
|
-
|
|
1034
|
+
v(!1);
|
|
989
1035
|
}
|
|
990
1036
|
}
|
|
991
1037
|
}, h = () => {
|
|
992
|
-
|
|
1038
|
+
y == null || y(), s(), window.open(
|
|
993
1039
|
"https://linktr.ee/s/about/trust-center/report",
|
|
994
1040
|
"_blank",
|
|
995
1041
|
"noopener,noreferrer"
|
|
996
1042
|
);
|
|
997
1043
|
};
|
|
998
1044
|
if (!n) return null;
|
|
999
|
-
const
|
|
1045
|
+
const p = ((ee = n.user) == null ? void 0 : ee.name) || ((re = n.user) == null ? void 0 : re.id) || "Unknown member", G = (O = n.user) == null ? void 0 : O.image, A = (H = n.user) == null ? void 0 : H.email, q = (J = n.user) == null ? void 0 : J.username, Y = A || (q ? `linktr.ee/${q}` : void 0), ne = ((z = n.user) == null ? void 0 : z.id) || "unknown";
|
|
1000
1046
|
return (
|
|
1001
1047
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
|
|
1002
1048
|
/* @__PURE__ */ e(
|
|
@@ -1005,8 +1051,8 @@ const it = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
|
|
|
1005
1051
|
ref: t,
|
|
1006
1052
|
className: "mes-dialog group",
|
|
1007
1053
|
onClose: s,
|
|
1008
|
-
onClick: (
|
|
1009
|
-
|
|
1054
|
+
onClick: (R) => {
|
|
1055
|
+
R.target === t.current && s();
|
|
1010
1056
|
},
|
|
1011
1057
|
children: /* @__PURE__ */ i("div", { className: "ml-auto flex h-full w-full flex-col bg-white shadow-none transition-shadow duration-200 group-open:shadow-max-elevation-light", children: [
|
|
1012
1058
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between border-b border-sand px-4 py-3", children: [
|
|
@@ -1021,30 +1067,30 @@ const it = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
|
|
|
1021
1067
|
style: { backgroundColor: "#FBFAF9" },
|
|
1022
1068
|
children: /* @__PURE__ */ i("div", { className: "flex items-center gap-3 w-full", children: [
|
|
1023
1069
|
/* @__PURE__ */ e(
|
|
1024
|
-
|
|
1070
|
+
te,
|
|
1025
1071
|
{
|
|
1026
|
-
id:
|
|
1027
|
-
name:
|
|
1028
|
-
image:
|
|
1072
|
+
id: ne,
|
|
1073
|
+
name: p,
|
|
1074
|
+
image: G,
|
|
1029
1075
|
size: 88,
|
|
1030
1076
|
shape: "circle"
|
|
1031
1077
|
}
|
|
1032
1078
|
),
|
|
1033
1079
|
/* @__PURE__ */ i("div", { className: "flex flex-col min-w-0 flex-1", children: [
|
|
1034
|
-
/* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children:
|
|
1080
|
+
/* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: p }),
|
|
1035
1081
|
Y && /* @__PURE__ */ e("p", { className: "truncate text-sm text-[#00000055]", children: Y }),
|
|
1036
|
-
|
|
1082
|
+
l && /* @__PURE__ */ e(
|
|
1037
1083
|
"span",
|
|
1038
1084
|
{
|
|
1039
1085
|
className: "mt-1 rounded-full text-xs font-normal w-fit",
|
|
1040
1086
|
style: {
|
|
1041
1087
|
padding: "4px 8px",
|
|
1042
|
-
backgroundColor:
|
|
1043
|
-
color:
|
|
1088
|
+
backgroundColor: l === "Subscribed to you" ? "#DCFCE7" : "#F5F5F4",
|
|
1089
|
+
color: l === "Subscribed to you" ? "#008236" : "#78716C",
|
|
1044
1090
|
lineHeight: "133.333%",
|
|
1045
1091
|
letterSpacing: "0.21px"
|
|
1046
1092
|
},
|
|
1047
|
-
children:
|
|
1093
|
+
children: l
|
|
1048
1094
|
}
|
|
1049
1095
|
)
|
|
1050
1096
|
] })
|
|
@@ -1053,42 +1099,42 @@ const it = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
|
|
|
1053
1099
|
),
|
|
1054
1100
|
/* @__PURE__ */ i("ul", { className: "flex flex-col gap-2 mt-2", children: [
|
|
1055
1101
|
u && /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(
|
|
1056
|
-
|
|
1102
|
+
ce,
|
|
1057
1103
|
{
|
|
1058
|
-
onClick:
|
|
1104
|
+
onClick: b,
|
|
1059
1105
|
disabled: d,
|
|
1060
1106
|
"aria-busy": d,
|
|
1061
1107
|
children: [
|
|
1062
|
-
d ? /* @__PURE__ */ e(
|
|
1108
|
+
d ? /* @__PURE__ */ e(de, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Os, { className: "h-5 w-5" }),
|
|
1063
1109
|
/* @__PURE__ */ e("span", { children: "Delete Conversation" })
|
|
1064
1110
|
]
|
|
1065
1111
|
}
|
|
1066
1112
|
) }),
|
|
1067
|
-
/* @__PURE__ */ e("li", { children:
|
|
1068
|
-
|
|
1113
|
+
/* @__PURE__ */ e("li", { children: _ ? /* @__PURE__ */ i(
|
|
1114
|
+
ce,
|
|
1069
1115
|
{
|
|
1070
1116
|
onClick: m,
|
|
1071
|
-
disabled:
|
|
1072
|
-
"aria-busy":
|
|
1117
|
+
disabled: N,
|
|
1118
|
+
"aria-busy": N,
|
|
1073
1119
|
children: [
|
|
1074
|
-
|
|
1120
|
+
N ? /* @__PURE__ */ e(de, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Ie, { className: "h-5 w-5" }),
|
|
1075
1121
|
/* @__PURE__ */ e("span", { children: "Unblock" })
|
|
1076
1122
|
]
|
|
1077
1123
|
}
|
|
1078
1124
|
) : /* @__PURE__ */ i(
|
|
1079
|
-
|
|
1125
|
+
ce,
|
|
1080
1126
|
{
|
|
1081
|
-
onClick:
|
|
1082
|
-
disabled:
|
|
1083
|
-
"aria-busy":
|
|
1127
|
+
onClick: k,
|
|
1128
|
+
disabled: N,
|
|
1129
|
+
"aria-busy": N,
|
|
1084
1130
|
children: [
|
|
1085
|
-
|
|
1131
|
+
N ? /* @__PURE__ */ e(de, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Ie, { className: "h-5 w-5" }),
|
|
1086
1132
|
/* @__PURE__ */ e("span", { children: "Block" })
|
|
1087
1133
|
]
|
|
1088
1134
|
}
|
|
1089
1135
|
) }),
|
|
1090
|
-
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(
|
|
1091
|
-
/* @__PURE__ */ e(
|
|
1136
|
+
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(ce, { variant: "danger", onClick: h, children: [
|
|
1137
|
+
/* @__PURE__ */ e(Us, { className: "h-5 w-5" }),
|
|
1092
1138
|
/* @__PURE__ */ e("span", { children: "Report" })
|
|
1093
1139
|
] }) })
|
|
1094
1140
|
] })
|
|
@@ -1097,54 +1143,54 @@ const it = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
|
|
|
1097
1143
|
}
|
|
1098
1144
|
)
|
|
1099
1145
|
);
|
|
1100
|
-
},
|
|
1146
|
+
}, ct = ({
|
|
1101
1147
|
onBack: t,
|
|
1102
1148
|
showBackButton: s,
|
|
1103
1149
|
renderMessageInputActions: n,
|
|
1104
1150
|
onLeaveConversation: r,
|
|
1105
|
-
onBlockParticipant:
|
|
1151
|
+
onBlockParticipant: l,
|
|
1106
1152
|
showDeleteConversation: c = !0,
|
|
1107
1153
|
onDeleteConversationClick: a,
|
|
1108
1154
|
onBlockParticipantClick: u,
|
|
1109
|
-
onReportParticipantClick:
|
|
1155
|
+
onReportParticipantClick: f
|
|
1110
1156
|
}) => {
|
|
1111
|
-
const { channel: x } =
|
|
1112
|
-
(
|
|
1113
|
-
var
|
|
1114
|
-
return ((
|
|
1157
|
+
const { channel: x } = Te(), y = W(null), g = P.useMemo(() => Object.values(x.state.members || {}).find(
|
|
1158
|
+
(C) => {
|
|
1159
|
+
var N;
|
|
1160
|
+
return ((N = C.user) == null ? void 0 : N.id) && C.user.id !== x._client.userID;
|
|
1115
1161
|
}
|
|
1116
|
-
), [x._client.userID, x.state.members]),
|
|
1162
|
+
), [x._client.userID, x.state.members]), o = P.useMemo(() => {
|
|
1117
1163
|
const d = x.data ?? {};
|
|
1118
1164
|
if (d.followerStatus)
|
|
1119
1165
|
return String(d.followerStatus);
|
|
1120
1166
|
if (d.isFollower !== void 0)
|
|
1121
1167
|
return d.isFollower ? "Subscribed to you" : "Not subscribed";
|
|
1122
|
-
}, [x.data]),
|
|
1168
|
+
}, [x.data]), _ = T(() => {
|
|
1123
1169
|
var d;
|
|
1124
|
-
(d =
|
|
1125
|
-
}, []),
|
|
1170
|
+
(d = y.current) == null || d.showModal();
|
|
1171
|
+
}, []), E = T(() => {
|
|
1126
1172
|
var d;
|
|
1127
|
-
(d =
|
|
1173
|
+
(d = y.current) == null || d.close();
|
|
1128
1174
|
}, []);
|
|
1129
|
-
return /* @__PURE__ */ i(
|
|
1175
|
+
return /* @__PURE__ */ i(be, { children: [
|
|
1130
1176
|
/* @__PURE__ */ e(
|
|
1131
|
-
|
|
1177
|
+
Ts,
|
|
1132
1178
|
{
|
|
1133
1179
|
overrides: {
|
|
1134
|
-
Message: (d) => /* @__PURE__ */ e(
|
|
1180
|
+
Message: (d) => /* @__PURE__ */ e(Xs, { ...d })
|
|
1135
1181
|
},
|
|
1136
|
-
children: /* @__PURE__ */ i(
|
|
1182
|
+
children: /* @__PURE__ */ i(Ds, { children: [
|
|
1137
1183
|
/* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ e(
|
|
1138
|
-
|
|
1184
|
+
ot,
|
|
1139
1185
|
{
|
|
1140
1186
|
onBack: t,
|
|
1141
1187
|
showBackButton: s,
|
|
1142
|
-
onShowInfo:
|
|
1143
|
-
canShowInfo: !!
|
|
1188
|
+
onShowInfo: _,
|
|
1189
|
+
canShowInfo: !!g
|
|
1144
1190
|
}
|
|
1145
1191
|
) }),
|
|
1146
1192
|
/* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden relative", children: /* @__PURE__ */ e(
|
|
1147
|
-
|
|
1193
|
+
Fs,
|
|
1148
1194
|
{
|
|
1149
1195
|
hideDeletedMessages: !0,
|
|
1150
1196
|
hideNewMessageSeparator: !1,
|
|
@@ -1152,7 +1198,7 @@ const it = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
|
|
|
1152
1198
|
}
|
|
1153
1199
|
) }),
|
|
1154
1200
|
/* @__PURE__ */ e(
|
|
1155
|
-
|
|
1201
|
+
nt,
|
|
1156
1202
|
{
|
|
1157
1203
|
renderActions: () => n == null ? void 0 : n(x)
|
|
1158
1204
|
}
|
|
@@ -1161,64 +1207,64 @@ const it = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
|
|
|
1161
1207
|
}
|
|
1162
1208
|
),
|
|
1163
1209
|
/* @__PURE__ */ e(
|
|
1164
|
-
|
|
1210
|
+
it,
|
|
1165
1211
|
{
|
|
1166
|
-
dialogRef:
|
|
1167
|
-
onClose:
|
|
1168
|
-
participant:
|
|
1212
|
+
dialogRef: y,
|
|
1213
|
+
onClose: E,
|
|
1214
|
+
participant: g,
|
|
1169
1215
|
channel: x,
|
|
1170
|
-
followerStatusLabel:
|
|
1216
|
+
followerStatusLabel: o,
|
|
1171
1217
|
onLeaveConversation: r,
|
|
1172
|
-
onBlockParticipant:
|
|
1218
|
+
onBlockParticipant: l,
|
|
1173
1219
|
showDeleteConversation: c,
|
|
1174
1220
|
onDeleteConversationClick: a,
|
|
1175
1221
|
onBlockParticipantClick: u,
|
|
1176
|
-
onReportParticipantClick:
|
|
1222
|
+
onReportParticipantClick: f
|
|
1177
1223
|
}
|
|
1178
1224
|
)
|
|
1179
1225
|
] });
|
|
1180
|
-
},
|
|
1226
|
+
}, Be = P.memo(
|
|
1181
1227
|
({
|
|
1182
1228
|
channel: t,
|
|
1183
1229
|
onBack: s,
|
|
1184
1230
|
showBackButton: n = !1,
|
|
1185
1231
|
renderMessageInputActions: r,
|
|
1186
|
-
onLeaveConversation:
|
|
1232
|
+
onLeaveConversation: l,
|
|
1187
1233
|
onBlockParticipant: c,
|
|
1188
1234
|
className: a,
|
|
1189
|
-
CustomChannelEmptyState: u =
|
|
1190
|
-
showDeleteConversation:
|
|
1235
|
+
CustomChannelEmptyState: u = at,
|
|
1236
|
+
showDeleteConversation: f = !0,
|
|
1191
1237
|
onDeleteConversationClick: x,
|
|
1192
|
-
onBlockParticipantClick:
|
|
1193
|
-
onReportParticipantClick:
|
|
1238
|
+
onBlockParticipantClick: y,
|
|
1239
|
+
onReportParticipantClick: g
|
|
1194
1240
|
}) => /* @__PURE__ */ e(
|
|
1195
1241
|
"div",
|
|
1196
1242
|
{
|
|
1197
|
-
className:
|
|
1243
|
+
className: M(
|
|
1198
1244
|
"messaging-channel-view h-full flex flex-col",
|
|
1199
1245
|
a
|
|
1200
1246
|
),
|
|
1201
1247
|
children: /* @__PURE__ */ e(
|
|
1202
|
-
|
|
1248
|
+
Rs,
|
|
1203
1249
|
{
|
|
1204
1250
|
channel: t,
|
|
1205
|
-
MessageSystem:
|
|
1251
|
+
MessageSystem: rt,
|
|
1206
1252
|
EmptyStateIndicator: u,
|
|
1207
|
-
LoadingIndicator:
|
|
1208
|
-
DateSeparator:
|
|
1253
|
+
LoadingIndicator: ue,
|
|
1254
|
+
DateSeparator: Hs,
|
|
1209
1255
|
children: /* @__PURE__ */ e(
|
|
1210
|
-
|
|
1256
|
+
ct,
|
|
1211
1257
|
{
|
|
1212
1258
|
onBack: s,
|
|
1213
1259
|
showBackButton: n,
|
|
1214
1260
|
renderMessageInputActions: r,
|
|
1215
|
-
onLeaveConversation:
|
|
1261
|
+
onLeaveConversation: l,
|
|
1216
1262
|
onBlockParticipant: c,
|
|
1217
1263
|
CustomChannelEmptyState: u,
|
|
1218
|
-
showDeleteConversation:
|
|
1264
|
+
showDeleteConversation: f,
|
|
1219
1265
|
onDeleteConversationClick: x,
|
|
1220
|
-
onBlockParticipantClick:
|
|
1221
|
-
onReportParticipantClick:
|
|
1266
|
+
onBlockParticipantClick: y,
|
|
1267
|
+
onReportParticipantClick: g
|
|
1222
1268
|
}
|
|
1223
1269
|
)
|
|
1224
1270
|
}
|
|
@@ -1226,8 +1272,8 @@ const it = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
|
|
|
1226
1272
|
}
|
|
1227
1273
|
)
|
|
1228
1274
|
);
|
|
1229
|
-
|
|
1230
|
-
function
|
|
1275
|
+
Be.displayName = "ChannelView";
|
|
1276
|
+
function dt({
|
|
1231
1277
|
searchQuery: t,
|
|
1232
1278
|
setSearchQuery: s,
|
|
1233
1279
|
placeholder: n
|
|
@@ -1235,7 +1281,7 @@ function mt({
|
|
|
1235
1281
|
const r = W(null);
|
|
1236
1282
|
return /* @__PURE__ */ i("div", { className: "relative", children: [
|
|
1237
1283
|
/* @__PURE__ */ e(
|
|
1238
|
-
|
|
1284
|
+
Bs,
|
|
1239
1285
|
{
|
|
1240
1286
|
className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-stone",
|
|
1241
1287
|
weight: "bold"
|
|
@@ -1248,85 +1294,85 @@ function mt({
|
|
|
1248
1294
|
type: "text",
|
|
1249
1295
|
placeholder: n,
|
|
1250
1296
|
value: t,
|
|
1251
|
-
onChange: (
|
|
1297
|
+
onChange: (l) => s(l.target.value),
|
|
1252
1298
|
className: "w-full pl-10 pr-10 py-3 text-sm border border-sand rounded-xl focus:outline-none focus:ring-2 focus:ring-black focus:border-transparent"
|
|
1253
1299
|
}
|
|
1254
1300
|
),
|
|
1255
1301
|
t && /* @__PURE__ */ e(
|
|
1256
|
-
|
|
1302
|
+
Pe,
|
|
1257
1303
|
{
|
|
1258
1304
|
label: "Clear search",
|
|
1259
1305
|
onClick: () => {
|
|
1260
|
-
var
|
|
1261
|
-
s(""), (
|
|
1306
|
+
var l;
|
|
1307
|
+
s(""), (l = r.current) == null || l.focus();
|
|
1262
1308
|
},
|
|
1263
1309
|
className: "absolute right-3 top-1/2 -translate-y-1/2 p-1 text-stone hover:text-charcoal",
|
|
1264
|
-
children: /* @__PURE__ */ e(
|
|
1310
|
+
children: /* @__PURE__ */ e(Ne, { className: "h-4 w-4", weight: "bold" })
|
|
1265
1311
|
}
|
|
1266
1312
|
)
|
|
1267
1313
|
] });
|
|
1268
1314
|
}
|
|
1269
|
-
const
|
|
1315
|
+
const mt = ({
|
|
1270
1316
|
participantSource: t,
|
|
1271
1317
|
onSelectParticipant: s,
|
|
1272
1318
|
onClose: n,
|
|
1273
1319
|
existingParticipantIds: r = /* @__PURE__ */ new Set(),
|
|
1274
|
-
participantLabel:
|
|
1320
|
+
participantLabel: l = "participants",
|
|
1275
1321
|
searchPlaceholder: c = "Search participants...",
|
|
1276
1322
|
className: a
|
|
1277
1323
|
}) => {
|
|
1278
|
-
const { debug: u } =
|
|
1324
|
+
const { debug: u } = he(), [f, x] = I(""), [y, g] = I([]), [o, _] = I(!1), [E, d] = I(null), [C, N] = I(
|
|
1279
1325
|
null
|
|
1280
|
-
),
|
|
1281
|
-
|
|
1326
|
+
), v = W(!1);
|
|
1327
|
+
Z(() => {
|
|
1282
1328
|
if (t.loading) {
|
|
1283
1329
|
u && console.log(
|
|
1284
1330
|
"[ParticipantPicker] Waiting for participant source to finish loading..."
|
|
1285
1331
|
);
|
|
1286
1332
|
return;
|
|
1287
1333
|
}
|
|
1288
|
-
if (
|
|
1334
|
+
if (v.current) return;
|
|
1289
1335
|
(async () => {
|
|
1290
|
-
u && console.log("[ParticipantPicker] Loading initial participants..."),
|
|
1336
|
+
u && console.log("[ParticipantPicker] Loading initial participants..."), _(!0), d(null);
|
|
1291
1337
|
try {
|
|
1292
1338
|
const h = await t.loadParticipants({
|
|
1293
1339
|
search: "",
|
|
1294
1340
|
// Load all participants initially
|
|
1295
1341
|
limit: 100
|
|
1296
1342
|
});
|
|
1297
|
-
|
|
1343
|
+
g(h.participants), v.current = !0, u && console.log(
|
|
1298
1344
|
"[ParticipantPicker] Participants loaded successfully:",
|
|
1299
1345
|
h.participants.length
|
|
1300
1346
|
);
|
|
1301
1347
|
} catch (h) {
|
|
1302
|
-
const
|
|
1303
|
-
d(
|
|
1348
|
+
const p = h instanceof Error ? h.message : "Failed to load participants";
|
|
1349
|
+
d(p), console.error("[ParticipantPicker] Failed to load participants:", h);
|
|
1304
1350
|
} finally {
|
|
1305
|
-
|
|
1351
|
+
_(!1);
|
|
1306
1352
|
}
|
|
1307
1353
|
})();
|
|
1308
1354
|
}, [t.loading, u]);
|
|
1309
|
-
const
|
|
1310
|
-
var
|
|
1311
|
-
if (!
|
|
1312
|
-
const h =
|
|
1313
|
-
return m.name.toLowerCase().includes(h) || ((
|
|
1314
|
-
}),
|
|
1355
|
+
const S = y.filter((m) => !r.has(m.id)).filter((m) => {
|
|
1356
|
+
var p;
|
|
1357
|
+
if (!f) return !0;
|
|
1358
|
+
const h = f.toLowerCase();
|
|
1359
|
+
return m.name.toLowerCase().includes(h) || ((p = m.email) == null ? void 0 : p.toLowerCase().includes(h)) || !1;
|
|
1360
|
+
}), b = T(
|
|
1315
1361
|
async (m) => {
|
|
1316
|
-
if (!
|
|
1317
|
-
|
|
1362
|
+
if (!C) {
|
|
1363
|
+
N(m.id);
|
|
1318
1364
|
try {
|
|
1319
1365
|
await s(m);
|
|
1320
1366
|
} catch (h) {
|
|
1321
|
-
console.error("[ParticipantPicker] Failed to start chat:", h),
|
|
1367
|
+
console.error("[ParticipantPicker] Failed to start chat:", h), N(null);
|
|
1322
1368
|
}
|
|
1323
1369
|
}
|
|
1324
1370
|
},
|
|
1325
|
-
[s,
|
|
1326
|
-
),
|
|
1327
|
-
(m.key === "Enter" || m.key === " ") && (m.preventDefault(),
|
|
1371
|
+
[s, C]
|
|
1372
|
+
), k = (m, h) => {
|
|
1373
|
+
(m.key === "Enter" || m.key === " ") && (m.preventDefault(), b(h));
|
|
1328
1374
|
};
|
|
1329
|
-
return /* @__PURE__ */ i("div", { className:
|
|
1375
|
+
return /* @__PURE__ */ i("div", { className: M("flex flex-col h-full", a), children: [
|
|
1330
1376
|
/* @__PURE__ */ i("div", { className: "px-4 py-4 border-b border-sand bg-chalk", children: [
|
|
1331
1377
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between mb-3", children: [
|
|
1332
1378
|
/* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-charcoal", children: "Start a new Conversation" }),
|
|
@@ -1334,52 +1380,52 @@ const ut = ({
|
|
|
1334
1380
|
] }),
|
|
1335
1381
|
/* @__PURE__ */ i("p", { className: "text-xs text-stone mb-3", children: [
|
|
1336
1382
|
"Select a ",
|
|
1337
|
-
|
|
1383
|
+
l.slice(0, -1),
|
|
1338
1384
|
" to start messaging (",
|
|
1339
|
-
|
|
1385
|
+
S.length,
|
|
1340
1386
|
" available)",
|
|
1341
|
-
t.totalCount !== void 0 && ` โข ${t.totalCount} ${
|
|
1387
|
+
t.totalCount !== void 0 && ` โข ${t.totalCount} ${l} total`
|
|
1342
1388
|
] }),
|
|
1343
1389
|
/* @__PURE__ */ e(
|
|
1344
|
-
|
|
1390
|
+
dt,
|
|
1345
1391
|
{
|
|
1346
|
-
searchQuery:
|
|
1392
|
+
searchQuery: f,
|
|
1347
1393
|
setSearchQuery: x,
|
|
1348
1394
|
placeholder: c
|
|
1349
1395
|
}
|
|
1350
1396
|
)
|
|
1351
1397
|
] }),
|
|
1352
|
-
|
|
1398
|
+
E && /* @__PURE__ */ i("div", { className: "p-4 text-sm text-danger bg-danger-alt", children: [
|
|
1353
1399
|
"Error loading ",
|
|
1354
|
-
|
|
1400
|
+
l,
|
|
1355
1401
|
": ",
|
|
1356
|
-
|
|
1402
|
+
E
|
|
1357
1403
|
] }),
|
|
1358
|
-
/* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children:
|
|
1404
|
+
/* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: o && S.length === 0 ? /* @__PURE__ */ e("div", { className: "h-32 flex items-center justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
|
|
1359
1405
|
/* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
|
|
1360
1406
|
/* @__PURE__ */ i("span", { className: "text-sm text-stone", children: [
|
|
1361
1407
|
"Loading ",
|
|
1362
|
-
|
|
1408
|
+
l,
|
|
1363
1409
|
"..."
|
|
1364
1410
|
] })
|
|
1365
|
-
] }) }) :
|
|
1366
|
-
/* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(
|
|
1367
|
-
/* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children:
|
|
1368
|
-
/* @__PURE__ */ e("p", { className: "text-xs text-stone", children:
|
|
1411
|
+
] }) }) : S.length === 0 ? /* @__PURE__ */ i("div", { className: "p-6 text-center", children: [
|
|
1412
|
+
/* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(Se, { className: "h-8 w-8 text-charcoal" }) }),
|
|
1413
|
+
/* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: f ? `No ${l} found` : y.length > 0 ? `Already chatting with all ${l}` : `No ${l} yet` }),
|
|
1414
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-stone", children: f ? "Try a different search term" : y.length > 0 ? `You have existing conversations with all your ${l}` : `${l.charAt(0).toUpperCase() + l.slice(1)} will appear here` })
|
|
1369
1415
|
] }) : /* @__PURE__ */ i("ul", { className: "space-y-0", children: [
|
|
1370
|
-
|
|
1371
|
-
const h = m.name || m.email || m.id,
|
|
1416
|
+
S.map((m) => {
|
|
1417
|
+
const h = m.name || m.email || m.id, p = m.email && m.name ? m.email : m.phone;
|
|
1372
1418
|
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
|
|
1373
1419
|
"button",
|
|
1374
1420
|
{
|
|
1375
1421
|
type: "button",
|
|
1376
|
-
onClick: () =>
|
|
1377
|
-
onKeyDown: (
|
|
1422
|
+
onClick: () => b(m),
|
|
1423
|
+
onKeyDown: (G) => k(G, m),
|
|
1378
1424
|
className: "w-full px-4 py-3 hover:bg-sand transition-colors border-b border-sand text-left focus:outline-none focus:ring-2 focus:ring-black",
|
|
1379
1425
|
children: /* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [
|
|
1380
1426
|
/* @__PURE__ */ i("div", { className: "flex items-center space-x-3 flex-1 min-w-0", children: [
|
|
1381
1427
|
/* @__PURE__ */ e(
|
|
1382
|
-
|
|
1428
|
+
te,
|
|
1383
1429
|
{
|
|
1384
1430
|
id: m.id,
|
|
1385
1431
|
name: h,
|
|
@@ -1389,21 +1435,21 @@ const ut = ({
|
|
|
1389
1435
|
),
|
|
1390
1436
|
/* @__PURE__ */ i("div", { className: "flex-1 min-w-0", children: [
|
|
1391
1437
|
/* @__PURE__ */ e("h4", { className: "text-sm font-medium text-charcoal truncate", children: h }),
|
|
1392
|
-
|
|
1438
|
+
p && /* @__PURE__ */ e("p", { className: "text-xs text-stone truncate", children: p })
|
|
1393
1439
|
] })
|
|
1394
1440
|
] }),
|
|
1395
|
-
/* @__PURE__ */ e("div", { className: "flex-shrink-0", children:
|
|
1441
|
+
/* @__PURE__ */ e("div", { className: "flex-shrink-0", children: C === m.id ? /* @__PURE__ */ e(de, { className: "h-5 w-5 text-primary animate-spin" }) : /* @__PURE__ */ e(Se, { className: "h-5 w-5 text-stone" }) })
|
|
1396
1442
|
] })
|
|
1397
1443
|
}
|
|
1398
1444
|
) }, m.id);
|
|
1399
1445
|
}),
|
|
1400
|
-
|
|
1446
|
+
o && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
|
|
1401
1447
|
/* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
|
|
1402
1448
|
/* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading more..." })
|
|
1403
1449
|
] }) })
|
|
1404
1450
|
] }) })
|
|
1405
1451
|
] });
|
|
1406
|
-
},
|
|
1452
|
+
}, ut = ({ className: t }) => /* @__PURE__ */ i(
|
|
1407
1453
|
"svg",
|
|
1408
1454
|
{
|
|
1409
1455
|
width: "140",
|
|
@@ -1537,17 +1583,17 @@ const ut = ({
|
|
|
1537
1583
|
] })
|
|
1538
1584
|
]
|
|
1539
1585
|
}
|
|
1540
|
-
),
|
|
1586
|
+
), Ae = P.memo(
|
|
1541
1587
|
({ hasChannels: t, channelsLoaded: s }) => /* @__PURE__ */ e("div", { className: "messaging-empty-state flex items-center justify-center h-full p-8 text-balance", children: /* @__PURE__ */ i("div", { className: "flex flex-col items-center max-w-sm text-center", children: [
|
|
1542
|
-
/* @__PURE__ */ e(
|
|
1588
|
+
/* @__PURE__ */ e(ut, {}),
|
|
1543
1589
|
s && !t && /* @__PURE__ */ i("div", { className: "mt-8", children: [
|
|
1544
1590
|
/* @__PURE__ */ e("h2", { className: "font-medium text-black text-[18px] mb-2", children: "Your inbox is empty" }),
|
|
1545
1591
|
/* @__PURE__ */ e("p", { className: "text-[#676B5F] text-sm mb-6", children: "Share with your followers to start receiving messages" })
|
|
1546
1592
|
] })
|
|
1547
1593
|
] }) })
|
|
1548
1594
|
);
|
|
1549
|
-
|
|
1550
|
-
const
|
|
1595
|
+
Ae.displayName = "EmptyState";
|
|
1596
|
+
const me = P.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */ i("div", { className: "text-center max-w-sm", children: [
|
|
1551
1597
|
/* @__PURE__ */ e("div", { className: "w-24 h-24 bg-danger-alt/20 rounded-full flex items-center justify-center mx-auto mb-6", children: /* @__PURE__ */ e("span", { className: "text-4xl", children: "โ ๏ธ" }) }),
|
|
1552
1598
|
/* @__PURE__ */ e("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
|
|
1553
1599
|
/* @__PURE__ */ e("p", { className: "text-stone text-sm mb-6", children: t }),
|
|
@@ -1561,137 +1607,137 @@ const he = P.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { clas
|
|
|
1561
1607
|
}
|
|
1562
1608
|
)
|
|
1563
1609
|
] }) }));
|
|
1564
|
-
|
|
1565
|
-
const
|
|
1610
|
+
me.displayName = "ErrorState";
|
|
1611
|
+
const pt = ({
|
|
1566
1612
|
capabilities: t = {},
|
|
1567
1613
|
className: s,
|
|
1568
1614
|
renderMessageInputActions: n,
|
|
1569
1615
|
onChannelSelect: r,
|
|
1570
|
-
onParticipantSelect:
|
|
1616
|
+
onParticipantSelect: l,
|
|
1571
1617
|
initialParticipantFilter: c,
|
|
1572
1618
|
initialParticipantData: a,
|
|
1573
1619
|
CustomChannelEmptyState: u,
|
|
1574
|
-
showChannelList:
|
|
1620
|
+
showChannelList: f = !0,
|
|
1575
1621
|
filters: x,
|
|
1576
|
-
channelListCustomEmptyStateIndicator:
|
|
1577
|
-
onDeleteConversationClick:
|
|
1578
|
-
onBlockParticipantClick:
|
|
1579
|
-
onReportParticipantClick:
|
|
1622
|
+
channelListCustomEmptyStateIndicator: y,
|
|
1623
|
+
onDeleteConversationClick: g,
|
|
1624
|
+
onBlockParticipantClick: o,
|
|
1625
|
+
onReportParticipantClick: _
|
|
1580
1626
|
}) => {
|
|
1581
1627
|
const {
|
|
1582
|
-
service:
|
|
1628
|
+
service: E,
|
|
1583
1629
|
client: d,
|
|
1584
|
-
isConnected:
|
|
1585
|
-
isLoading:
|
|
1586
|
-
error:
|
|
1587
|
-
refreshConnection:
|
|
1588
|
-
debug:
|
|
1589
|
-
} =
|
|
1590
|
-
participantSource:
|
|
1591
|
-
participantLabel:
|
|
1592
|
-
showDeleteConversation:
|
|
1593
|
-
} = t,
|
|
1594
|
-
const
|
|
1630
|
+
isConnected: C,
|
|
1631
|
+
isLoading: N,
|
|
1632
|
+
error: v,
|
|
1633
|
+
refreshConnection: S,
|
|
1634
|
+
debug: b
|
|
1635
|
+
} = As(), [k, m] = I(null), [h, p] = I(!1), [G, A] = I(!1), [q, Y] = I(!1), [ne, K] = I(/* @__PURE__ */ new Set()), [ee, re] = I(0), [O, H] = I(!1), [J, z] = I(null), R = W(null), {
|
|
1636
|
+
participantSource: D,
|
|
1637
|
+
participantLabel: U = "participants",
|
|
1638
|
+
showDeleteConversation: j = !0
|
|
1639
|
+
} = t, se = P.useMemo(() => {
|
|
1640
|
+
const w = d == null ? void 0 : d.userID;
|
|
1595
1641
|
return {
|
|
1596
1642
|
...{
|
|
1597
1643
|
type: "messaging",
|
|
1598
1644
|
last_message_at: { $exists: !0 },
|
|
1599
|
-
...
|
|
1600
|
-
members: { $in: [
|
|
1645
|
+
...w && {
|
|
1646
|
+
members: { $in: [w] },
|
|
1601
1647
|
hidden: !1
|
|
1602
1648
|
}
|
|
1603
1649
|
},
|
|
1604
1650
|
...x
|
|
1605
1651
|
};
|
|
1606
|
-
}, [x, d == null ? void 0 : d.userID]),
|
|
1607
|
-
if (!d || !
|
|
1608
|
-
const
|
|
1609
|
-
if (
|
|
1652
|
+
}, [x, d == null ? void 0 : d.userID]), Q = W(null), V = T(async () => {
|
|
1653
|
+
if (!d || !C) return;
|
|
1654
|
+
const w = d.userID;
|
|
1655
|
+
if (w)
|
|
1610
1656
|
try {
|
|
1611
|
-
|
|
1612
|
-
const
|
|
1657
|
+
b && console.log("[MessagingShell] Syncing channels for user:", w);
|
|
1658
|
+
const L = await d.queryChannels(
|
|
1613
1659
|
{
|
|
1614
1660
|
type: "messaging",
|
|
1615
|
-
members: { $in: [
|
|
1661
|
+
members: { $in: [w] }
|
|
1616
1662
|
},
|
|
1617
1663
|
{},
|
|
1618
1664
|
{ limit: 100 }
|
|
1619
|
-
),
|
|
1620
|
-
|
|
1621
|
-
const
|
|
1622
|
-
Object.values(
|
|
1665
|
+
), F = /* @__PURE__ */ new Set();
|
|
1666
|
+
L.forEach((B) => {
|
|
1667
|
+
const xe = B.state.members;
|
|
1668
|
+
Object.values(xe).forEach((je) => {
|
|
1623
1669
|
var ve;
|
|
1624
|
-
const Ce = (ve =
|
|
1625
|
-
Ce && Ce !==
|
|
1670
|
+
const Ce = (ve = je.user) == null ? void 0 : ve.id;
|
|
1671
|
+
Ce && Ce !== w && F.add(Ce);
|
|
1626
1672
|
});
|
|
1627
|
-
}),
|
|
1628
|
-
channelCount:
|
|
1629
|
-
memberCount:
|
|
1673
|
+
}), K((B) => B.size === F.size && [...B].every((xe) => F.has(xe)) ? B : F), p(L.length > 0), A(!0), Q.current = w, b && console.log("[MessagingShell] Channels synced successfully:", {
|
|
1674
|
+
channelCount: L.length,
|
|
1675
|
+
memberCount: F.size
|
|
1630
1676
|
});
|
|
1631
|
-
} catch (
|
|
1632
|
-
console.error("[MessagingShell] Failed to sync channels:",
|
|
1677
|
+
} catch (L) {
|
|
1678
|
+
console.error("[MessagingShell] Failed to sync channels:", L);
|
|
1633
1679
|
}
|
|
1634
|
-
}, [d,
|
|
1635
|
-
|
|
1636
|
-
if (!d || !
|
|
1637
|
-
const
|
|
1638
|
-
|
|
1639
|
-
}, [d,
|
|
1640
|
-
if (!c || !d || !
|
|
1680
|
+
}, [d, C, b]);
|
|
1681
|
+
Z(() => {
|
|
1682
|
+
if (!d || !C) return;
|
|
1683
|
+
const w = d.userID;
|
|
1684
|
+
w && Q.current !== w && V();
|
|
1685
|
+
}, [d, C, V]), Z(() => {
|
|
1686
|
+
if (!c || !d || !C) return;
|
|
1641
1687
|
(async () => {
|
|
1642
|
-
const
|
|
1643
|
-
if (
|
|
1688
|
+
const L = d.userID;
|
|
1689
|
+
if (L)
|
|
1644
1690
|
try {
|
|
1645
|
-
|
|
1691
|
+
b && console.log(
|
|
1646
1692
|
"[MessagingShell] Loading initial conversation with:",
|
|
1647
1693
|
c
|
|
1648
1694
|
);
|
|
1649
|
-
const
|
|
1695
|
+
const F = await d.queryChannels(
|
|
1650
1696
|
{
|
|
1651
1697
|
type: "messaging",
|
|
1652
|
-
members: { $eq: [
|
|
1698
|
+
members: { $eq: [L, c] }
|
|
1653
1699
|
},
|
|
1654
1700
|
{},
|
|
1655
1701
|
{ limit: 1 }
|
|
1656
1702
|
);
|
|
1657
|
-
if (
|
|
1658
|
-
m(
|
|
1703
|
+
if (F.length > 0)
|
|
1704
|
+
m(F[0]), H(!0), z(null), r && r(F[0]), b && console.log(
|
|
1659
1705
|
"[MessagingShell] Initial conversation loaded:",
|
|
1660
|
-
|
|
1706
|
+
F[0].id
|
|
1661
1707
|
);
|
|
1662
|
-
else if (a &&
|
|
1663
|
-
|
|
1708
|
+
else if (a && E) {
|
|
1709
|
+
b && console.log(
|
|
1664
1710
|
"[MessagingShell] No conversation found, creating one for:",
|
|
1665
1711
|
a
|
|
1666
1712
|
);
|
|
1667
1713
|
try {
|
|
1668
|
-
const
|
|
1714
|
+
const B = await E.startChannelWithParticipant({
|
|
1669
1715
|
id: a.id,
|
|
1670
1716
|
name: a.name,
|
|
1671
1717
|
email: a.email,
|
|
1672
1718
|
phone: a.phone
|
|
1673
1719
|
});
|
|
1674
|
-
m(
|
|
1720
|
+
m(B), H(!0), z(null), r && r(B), b && console.log(
|
|
1675
1721
|
"[MessagingShell] Channel created and loaded:",
|
|
1676
|
-
|
|
1722
|
+
B.id
|
|
1677
1723
|
);
|
|
1678
|
-
} catch (
|
|
1724
|
+
} catch (B) {
|
|
1679
1725
|
console.error(
|
|
1680
1726
|
"[MessagingShell] Failed to create conversation:",
|
|
1681
|
-
|
|
1727
|
+
B
|
|
1682
1728
|
), z("Failed to create conversation");
|
|
1683
1729
|
}
|
|
1684
1730
|
} else
|
|
1685
1731
|
z(
|
|
1686
1732
|
"No conversation found with this account"
|
|
1687
|
-
),
|
|
1733
|
+
), b && console.log(
|
|
1688
1734
|
"[MessagingShell] No conversation found for:",
|
|
1689
1735
|
c
|
|
1690
1736
|
);
|
|
1691
|
-
} catch (
|
|
1737
|
+
} catch (F) {
|
|
1692
1738
|
console.error(
|
|
1693
1739
|
"[MessagingShell] Failed to load initial conversation:",
|
|
1694
|
-
|
|
1740
|
+
F
|
|
1695
1741
|
), z("Failed to load conversation");
|
|
1696
1742
|
}
|
|
1697
1743
|
})();
|
|
@@ -1699,73 +1745,73 @@ const yt = ({
|
|
|
1699
1745
|
c,
|
|
1700
1746
|
a,
|
|
1701
1747
|
d,
|
|
1702
|
-
N,
|
|
1703
|
-
p,
|
|
1704
1748
|
C,
|
|
1749
|
+
E,
|
|
1750
|
+
b,
|
|
1705
1751
|
r
|
|
1706
1752
|
]);
|
|
1707
|
-
const
|
|
1708
|
-
(
|
|
1709
|
-
m(
|
|
1753
|
+
const le = T(
|
|
1754
|
+
(w) => {
|
|
1755
|
+
m(w), r == null || r(w);
|
|
1710
1756
|
},
|
|
1711
1757
|
[r]
|
|
1712
|
-
),
|
|
1713
|
-
|
|
1714
|
-
}, [
|
|
1715
|
-
async (
|
|
1716
|
-
var
|
|
1717
|
-
if (
|
|
1758
|
+
), oe = T(() => {
|
|
1759
|
+
O || m(null);
|
|
1760
|
+
}, [O]), ae = T(
|
|
1761
|
+
async (w) => {
|
|
1762
|
+
var L;
|
|
1763
|
+
if (E)
|
|
1718
1764
|
try {
|
|
1719
|
-
|
|
1765
|
+
b && console.log(
|
|
1720
1766
|
"[MessagingShell] Starting conversation with:",
|
|
1721
|
-
|
|
1767
|
+
w.id
|
|
1722
1768
|
);
|
|
1723
|
-
const
|
|
1724
|
-
id:
|
|
1725
|
-
name:
|
|
1726
|
-
email:
|
|
1727
|
-
phone:
|
|
1769
|
+
const F = await E.startChannelWithParticipant({
|
|
1770
|
+
id: w.id,
|
|
1771
|
+
name: w.name,
|
|
1772
|
+
email: w.email,
|
|
1773
|
+
phone: w.phone
|
|
1728
1774
|
});
|
|
1729
1775
|
try {
|
|
1730
|
-
await
|
|
1731
|
-
} catch (
|
|
1732
|
-
console.warn("[MessagingShell] Failed to unhide channel:",
|
|
1776
|
+
await F.show();
|
|
1777
|
+
} catch (B) {
|
|
1778
|
+
console.warn("[MessagingShell] Failed to unhide channel:", B);
|
|
1733
1779
|
}
|
|
1734
|
-
m(
|
|
1735
|
-
} catch (
|
|
1736
|
-
console.error("[MessagingShell] Failed to start conversation:",
|
|
1780
|
+
m(F), Y(!1), (L = R.current) == null || L.close(), l == null || l(w);
|
|
1781
|
+
} catch (F) {
|
|
1782
|
+
console.error("[MessagingShell] Failed to start conversation:", F);
|
|
1737
1783
|
}
|
|
1738
1784
|
},
|
|
1739
|
-
[
|
|
1740
|
-
),
|
|
1741
|
-
var
|
|
1742
|
-
Y(!1), (
|
|
1743
|
-
}, []),
|
|
1744
|
-
(
|
|
1745
|
-
|
|
1785
|
+
[E, l, b]
|
|
1786
|
+
), $ = T(() => {
|
|
1787
|
+
var w;
|
|
1788
|
+
Y(!1), (w = R.current) == null || w.close();
|
|
1789
|
+
}, []), fe = T(
|
|
1790
|
+
(w) => {
|
|
1791
|
+
w.target === R.current && $();
|
|
1746
1792
|
},
|
|
1747
|
-
[
|
|
1748
|
-
),
|
|
1749
|
-
async (
|
|
1750
|
-
|
|
1793
|
+
[$]
|
|
1794
|
+
), ie = T(
|
|
1795
|
+
async (w) => {
|
|
1796
|
+
b && console.log("[MessagingShell] Leaving conversation:", w.id), m(null), H(!1), Q.current = null, await V();
|
|
1751
1797
|
},
|
|
1752
|
-
[
|
|
1753
|
-
),
|
|
1754
|
-
async (
|
|
1755
|
-
|
|
1798
|
+
[V, b]
|
|
1799
|
+
), ge = T(
|
|
1800
|
+
async (w) => {
|
|
1801
|
+
b && console.log("[MessagingShell] Blocking participant:", w), m(null), H(!1), Q.current = null, await V();
|
|
1756
1802
|
},
|
|
1757
|
-
[
|
|
1758
|
-
),
|
|
1759
|
-
return
|
|
1760
|
-
|
|
1803
|
+
[V, b]
|
|
1804
|
+
), X = !!k;
|
|
1805
|
+
return N ? /* @__PURE__ */ e("div", { className: M("h-full", s), children: /* @__PURE__ */ e(ue, {}) }) : v ? /* @__PURE__ */ e("div", { className: M("h-full", s), children: /* @__PURE__ */ e(me, { message: v, onBack: S }) }) : !C || !d ? /* @__PURE__ */ e("div", { className: M("h-full", s), children: /* @__PURE__ */ e(
|
|
1806
|
+
me,
|
|
1761
1807
|
{
|
|
1762
1808
|
message: "Not connected to messaging service",
|
|
1763
|
-
onBack:
|
|
1809
|
+
onBack: S
|
|
1764
1810
|
}
|
|
1765
|
-
) }) : J ? /* @__PURE__ */ e("div", { className:
|
|
1811
|
+
) }) : J ? /* @__PURE__ */ e("div", { className: M("h-full", s), children: /* @__PURE__ */ e(me, { message: J }) }) : /* @__PURE__ */ i(
|
|
1766
1812
|
"div",
|
|
1767
1813
|
{
|
|
1768
|
-
className:
|
|
1814
|
+
className: M(
|
|
1769
1815
|
"messaging-shell h-full bg-background-primary overflow-hidden",
|
|
1770
1816
|
s
|
|
1771
1817
|
),
|
|
@@ -1774,23 +1820,23 @@ const yt = ({
|
|
|
1774
1820
|
/* @__PURE__ */ e(
|
|
1775
1821
|
"div",
|
|
1776
1822
|
{
|
|
1777
|
-
className:
|
|
1823
|
+
className: M(
|
|
1778
1824
|
"messaging-channel-list-sidebar min-h-0 min-w-0 lg:flex lg:flex-col",
|
|
1779
1825
|
{
|
|
1780
|
-
"!hidden":
|
|
1826
|
+
"!hidden": f === !1 || O,
|
|
1781
1827
|
// Hide on mobile when channel selected, show on desktop with consistent wide width
|
|
1782
|
-
"hidden lg:flex lg:flex-1 lg:max-w-2xl":
|
|
1828
|
+
"hidden lg:flex lg:flex-1 lg:max-w-2xl": f !== !1 && !O && X,
|
|
1783
1829
|
// Show on mobile when no channel selected, use same wide width on desktop
|
|
1784
|
-
"flex flex-col w-full lg:flex-1 lg:max-w-2xl":
|
|
1830
|
+
"flex flex-col w-full lg:flex-1 lg:max-w-2xl": f !== !1 && !O && !X
|
|
1785
1831
|
}
|
|
1786
1832
|
),
|
|
1787
1833
|
children: /* @__PURE__ */ e(
|
|
1788
|
-
|
|
1834
|
+
Le,
|
|
1789
1835
|
{
|
|
1790
|
-
onChannelSelect:
|
|
1791
|
-
selectedChannel:
|
|
1792
|
-
filters:
|
|
1793
|
-
customEmptyStateIndicator:
|
|
1836
|
+
onChannelSelect: le,
|
|
1837
|
+
selectedChannel: k || void 0,
|
|
1838
|
+
filters: se,
|
|
1839
|
+
customEmptyStateIndicator: y
|
|
1794
1840
|
}
|
|
1795
1841
|
)
|
|
1796
1842
|
}
|
|
@@ -1798,70 +1844,70 @@ const yt = ({
|
|
|
1798
1844
|
/* @__PURE__ */ e(
|
|
1799
1845
|
"div",
|
|
1800
1846
|
{
|
|
1801
|
-
className:
|
|
1847
|
+
className: M(
|
|
1802
1848
|
"messaging-conversation-view flex-1 flex-col min-w-0 min-h-0",
|
|
1803
1849
|
{
|
|
1804
1850
|
// In direct conversation mode (or waiting for it), always show (full width)
|
|
1805
|
-
flex:
|
|
1851
|
+
flex: O || X || c,
|
|
1806
1852
|
// Normal mode: hide on mobile when no channel selected
|
|
1807
|
-
"hidden lg:flex": !
|
|
1853
|
+
"hidden lg:flex": !O && !X && !c
|
|
1808
1854
|
}
|
|
1809
1855
|
),
|
|
1810
|
-
children:
|
|
1811
|
-
|
|
1856
|
+
children: k ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
|
|
1857
|
+
Be,
|
|
1812
1858
|
{
|
|
1813
|
-
channel:
|
|
1814
|
-
onBack:
|
|
1815
|
-
showBackButton: !
|
|
1859
|
+
channel: k,
|
|
1860
|
+
onBack: oe,
|
|
1861
|
+
showBackButton: !O,
|
|
1816
1862
|
renderMessageInputActions: n,
|
|
1817
|
-
onLeaveConversation:
|
|
1818
|
-
onBlockParticipant:
|
|
1863
|
+
onLeaveConversation: ie,
|
|
1864
|
+
onBlockParticipant: ge,
|
|
1819
1865
|
CustomChannelEmptyState: u,
|
|
1820
|
-
showDeleteConversation:
|
|
1821
|
-
onDeleteConversationClick:
|
|
1822
|
-
onBlockParticipantClick:
|
|
1823
|
-
onReportParticipantClick:
|
|
1866
|
+
showDeleteConversation: j,
|
|
1867
|
+
onDeleteConversationClick: g,
|
|
1868
|
+
onBlockParticipantClick: o,
|
|
1869
|
+
onReportParticipantClick: _
|
|
1824
1870
|
},
|
|
1825
|
-
|
|
1871
|
+
k.id
|
|
1826
1872
|
) }) : c ? (
|
|
1827
1873
|
// Show loading while creating/loading direct conversation channel
|
|
1828
|
-
/* @__PURE__ */ e(
|
|
1874
|
+
/* @__PURE__ */ e(ue, {})
|
|
1829
1875
|
) : /* @__PURE__ */ e(
|
|
1830
|
-
|
|
1876
|
+
Ae,
|
|
1831
1877
|
{
|
|
1832
1878
|
hasChannels: h,
|
|
1833
|
-
channelsLoaded:
|
|
1879
|
+
channelsLoaded: G
|
|
1834
1880
|
}
|
|
1835
1881
|
)
|
|
1836
1882
|
}
|
|
1837
1883
|
)
|
|
1838
1884
|
] }),
|
|
1839
|
-
|
|
1885
|
+
D && // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
|
|
1840
1886
|
/* @__PURE__ */ e(
|
|
1841
1887
|
"dialog",
|
|
1842
1888
|
{
|
|
1843
|
-
ref:
|
|
1889
|
+
ref: R,
|
|
1844
1890
|
className: "mes-dialog",
|
|
1845
|
-
onClick:
|
|
1846
|
-
onClose:
|
|
1891
|
+
onClick: fe,
|
|
1892
|
+
onClose: $,
|
|
1847
1893
|
children: /* @__PURE__ */ e("div", { className: "h-full w-full bg-white shadow-max-elevation-light", children: /* @__PURE__ */ e(
|
|
1848
|
-
|
|
1894
|
+
mt,
|
|
1849
1895
|
{
|
|
1850
|
-
participantSource:
|
|
1851
|
-
onSelectParticipant:
|
|
1852
|
-
onClose:
|
|
1853
|
-
existingParticipantIds:
|
|
1854
|
-
participantLabel:
|
|
1855
|
-
searchPlaceholder: `Search ${
|
|
1896
|
+
participantSource: D,
|
|
1897
|
+
onSelectParticipant: ae,
|
|
1898
|
+
onClose: $,
|
|
1899
|
+
existingParticipantIds: ne,
|
|
1900
|
+
participantLabel: U,
|
|
1901
|
+
searchPlaceholder: `Search ${U}...`
|
|
1856
1902
|
},
|
|
1857
|
-
|
|
1903
|
+
ee
|
|
1858
1904
|
) })
|
|
1859
1905
|
}
|
|
1860
1906
|
)
|
|
1861
1907
|
]
|
|
1862
1908
|
}
|
|
1863
1909
|
);
|
|
1864
|
-
},
|
|
1910
|
+
}, ht = ({
|
|
1865
1911
|
question: t,
|
|
1866
1912
|
onClick: s,
|
|
1867
1913
|
loading: n = !1,
|
|
@@ -1873,7 +1919,7 @@ const yt = ({
|
|
|
1873
1919
|
onClick: s,
|
|
1874
1920
|
disabled: n,
|
|
1875
1921
|
style: { backgroundColor: "#E6E5E3" },
|
|
1876
|
-
className:
|
|
1922
|
+
className: M(
|
|
1877
1923
|
"w-full text-center p-4 rounded-xl text-charcoal font-medium transition-colors",
|
|
1878
1924
|
{
|
|
1879
1925
|
"hover:brightness-95 active:brightness-90": !n,
|
|
@@ -1883,19 +1929,19 @@ const yt = ({
|
|
|
1883
1929
|
),
|
|
1884
1930
|
children: t
|
|
1885
1931
|
}
|
|
1886
|
-
),
|
|
1932
|
+
), yt = ({
|
|
1887
1933
|
faqs: t,
|
|
1888
1934
|
onFaqClick: s,
|
|
1889
1935
|
loadingFaqId: n,
|
|
1890
1936
|
headerText: r,
|
|
1891
|
-
className:
|
|
1937
|
+
className: l,
|
|
1892
1938
|
avatarImage: c,
|
|
1893
1939
|
avatarName: a
|
|
1894
1940
|
}) => {
|
|
1895
|
-
const u = t.filter((
|
|
1896
|
-
return u.length === 0 ? null : /* @__PURE__ */ e("div", { className:
|
|
1941
|
+
const u = t.filter((f) => f.enabled).sort((f, x) => (f.order ?? 0) - (x.order ?? 0));
|
|
1942
|
+
return u.length === 0 ? null : /* @__PURE__ */ e("div", { className: l, children: /* @__PURE__ */ i("div", { className: "flex gap-3 items-end", children: [
|
|
1897
1943
|
(c || a) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
|
|
1898
|
-
|
|
1944
|
+
te,
|
|
1899
1945
|
{
|
|
1900
1946
|
id: a || "account",
|
|
1901
1947
|
name: a || "Account",
|
|
@@ -1911,72 +1957,72 @@ const yt = ({
|
|
|
1911
1957
|
style: { backgroundColor: "#F1F0EE" },
|
|
1912
1958
|
children: [
|
|
1913
1959
|
r && /* @__PURE__ */ e("p", { className: "text-md text-charcoal mb-4", children: r }),
|
|
1914
|
-
u.map((
|
|
1915
|
-
|
|
1960
|
+
u.map((f) => /* @__PURE__ */ e(
|
|
1961
|
+
ht,
|
|
1916
1962
|
{
|
|
1917
|
-
question:
|
|
1918
|
-
onClick: () => s(
|
|
1919
|
-
loading: n ===
|
|
1963
|
+
question: f.question,
|
|
1964
|
+
onClick: () => s(f.id),
|
|
1965
|
+
loading: n === f.id
|
|
1920
1966
|
},
|
|
1921
|
-
|
|
1967
|
+
f.id
|
|
1922
1968
|
))
|
|
1923
1969
|
]
|
|
1924
1970
|
}
|
|
1925
1971
|
)
|
|
1926
1972
|
] }) });
|
|
1927
|
-
},
|
|
1928
|
-
const { initialSearch: n = "", pageSize: r = 20 } = s, [
|
|
1973
|
+
}, Et = (t, s = {}) => {
|
|
1974
|
+
const { initialSearch: n = "", pageSize: r = 20 } = s, [l, c] = I([]), [a, u] = I(!1), [f, x] = I(null), [y, g] = I(n), [o, _] = I(!0), [E, d] = I(), C = T(async (b = !1, k) => {
|
|
1929
1975
|
if (a) return;
|
|
1930
|
-
const m =
|
|
1976
|
+
const m = k !== void 0 ? k : y;
|
|
1931
1977
|
u(!0), x(null);
|
|
1932
1978
|
try {
|
|
1933
1979
|
const h = await t.loadParticipants({
|
|
1934
1980
|
search: m || void 0,
|
|
1935
1981
|
limit: r,
|
|
1936
|
-
cursor:
|
|
1982
|
+
cursor: b ? void 0 : E
|
|
1937
1983
|
});
|
|
1938
1984
|
c(
|
|
1939
|
-
(
|
|
1940
|
-
),
|
|
1985
|
+
(p) => b ? h.participants : [...p, ...h.participants]
|
|
1986
|
+
), _(h.hasMore), d(h.nextCursor);
|
|
1941
1987
|
} catch (h) {
|
|
1942
|
-
const
|
|
1943
|
-
x(
|
|
1988
|
+
const p = h instanceof Error ? h.message : "Failed to load participants";
|
|
1989
|
+
x(p), console.error("[useParticipants] Load error:", h);
|
|
1944
1990
|
} finally {
|
|
1945
1991
|
u(!1);
|
|
1946
1992
|
}
|
|
1947
|
-
}, [t,
|
|
1948
|
-
|
|
1949
|
-
}, [
|
|
1950
|
-
|
|
1951
|
-
}, [
|
|
1952
|
-
d(void 0),
|
|
1953
|
-
}, [
|
|
1954
|
-
return
|
|
1955
|
-
|
|
1993
|
+
}, [t, y, E, r, a]), N = T(() => {
|
|
1994
|
+
o && !a && C(!1);
|
|
1995
|
+
}, [o, a, C]), v = T((b) => {
|
|
1996
|
+
g(b), d(void 0), C(!0, b);
|
|
1997
|
+
}, [C]), S = T(() => {
|
|
1998
|
+
d(void 0), C(!0);
|
|
1999
|
+
}, [C]);
|
|
2000
|
+
return Z(() => {
|
|
2001
|
+
C(!0);
|
|
1956
2002
|
}, [t.loadParticipants]), {
|
|
1957
|
-
participants:
|
|
2003
|
+
participants: l,
|
|
1958
2004
|
loading: a,
|
|
1959
|
-
error:
|
|
1960
|
-
searchQuery:
|
|
1961
|
-
hasMore:
|
|
2005
|
+
error: f,
|
|
2006
|
+
searchQuery: y,
|
|
2007
|
+
hasMore: o,
|
|
1962
2008
|
totalCount: t.totalCount,
|
|
1963
|
-
loadMore:
|
|
1964
|
-
search:
|
|
1965
|
-
refresh:
|
|
2009
|
+
loadMore: N,
|
|
2010
|
+
search: v,
|
|
2011
|
+
refresh: S
|
|
1966
2012
|
};
|
|
1967
2013
|
};
|
|
1968
2014
|
export {
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
2015
|
+
te as Avatar,
|
|
2016
|
+
at as ChannelEmptyState,
|
|
2017
|
+
Le as ChannelList,
|
|
2018
|
+
Be as ChannelView,
|
|
2019
|
+
yt as FaqList,
|
|
2020
|
+
ht as FaqListItem,
|
|
2021
|
+
wt as MessagingProvider,
|
|
2022
|
+
pt as MessagingShell,
|
|
2023
|
+
mt as ParticipantPicker,
|
|
2024
|
+
$s as formatRelativeTime,
|
|
2025
|
+
As as useMessaging,
|
|
2026
|
+
Et as useParticipants
|
|
1981
2027
|
};
|
|
1982
2028
|
//# sourceMappingURL=index.js.map
|