@linktr.ee/messaging-react 1.21.1 → 1.21.2-rc-1771424513
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.d.ts +15 -1
- package/dist/index.js +882 -873
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/ChannelView.tsx +8 -0
- package/src/components/MessagingShell/index.tsx +2 -0
- package/src/index.ts +1 -0
- package/src/types.ts +9 -0
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as e, jsxs as i, Fragment as ve } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { StreamChatService as
|
|
5
|
-
import { Chat as
|
|
6
|
-
import { GiftIcon as
|
|
7
|
-
import { LinkPreviewsManager as
|
|
8
|
-
const
|
|
2
|
+
import R from "classnames";
|
|
3
|
+
import j, { createContext as Xe, useContext as Ke, useCallback as L, useState as _, useRef as q, useEffect as Z, useMemo as be } from "react";
|
|
4
|
+
import { StreamChatService as es } from "@linktr.ee/messaging-core";
|
|
5
|
+
import { Chat as ss, ChannelList as ts, DateSeparator as ns, useChannelStateContext as we, useChatContext as Le, areMessageUIPropsEqual as rs, useMessageReminder as as, useComponentContext as os, Attachment as ls, EditMessageModal as is, MessageBlocked as cs, MessageBouncePrompt as ds, MessageDeleted as us, MessageIsThreadReplyInChannelButtonIndicator as ms, MessageRepliesCountButton as hs, ReminderNotification as fs, StreamedMessageText as gs, messageHasAttachments as xs, messageHasReactions as bs, isDateSeparatorMessage as Cs, isMessageBlocked as Ns, isMessageBounced as vs, MessageBounceModal as ws, Poll as ps, MessageText as ys, MessageErrorIcon as Es, useMessageContext as Is, useMessageComposer as _s, useStateStore as Ss, MessageInput as Ms, useMessageInputContext as ks, useMessageComposerHasSendableData as Rs, SimpleAttachmentSelector as Ds, QuotedMessagePreview as Ts, AttachmentPreviewList as Fs, TextareaComposer as Ls, MessageTimestamp as Ps, Channel as Os, WithComponents as Us, Window as Bs, MessageList as js } from "stream-chat-react";
|
|
6
|
+
import { GiftIcon as As, XIcon as pe, ArrowUpIcon as $s, ArrowLeftIcon as _e, StarIcon as Se, DotsThreeIcon as Me, SpinnerGapIcon as ue, SignOutIcon as zs, ProhibitInsetIcon as ke, FlagIcon as Hs, MagnifyingGlassIcon as Gs, ChatCircleDotsIcon as Re } from "@phosphor-icons/react";
|
|
7
|
+
import { LinkPreviewsManager as De } from "stream-chat";
|
|
8
|
+
const Pe = Xe({
|
|
9
9
|
service: null,
|
|
10
10
|
client: null,
|
|
11
11
|
isConnected: !1,
|
|
@@ -15,229 +15,229 @@ const Le = Qe({
|
|
|
15
15
|
refreshConnection: async () => {
|
|
16
16
|
},
|
|
17
17
|
debug: !1
|
|
18
|
-
}), fe = () =>
|
|
18
|
+
}), fe = () => Ke(Pe), Dt = ({
|
|
19
19
|
children: t,
|
|
20
20
|
user: s,
|
|
21
21
|
serviceConfig: n,
|
|
22
|
-
apiKey:
|
|
22
|
+
apiKey: o,
|
|
23
23
|
capabilities: l = {},
|
|
24
|
-
debug:
|
|
24
|
+
debug: d = !1
|
|
25
25
|
}) => {
|
|
26
|
-
const
|
|
27
|
-
(
|
|
28
|
-
|
|
26
|
+
const a = L(
|
|
27
|
+
(c, ...x) => {
|
|
28
|
+
d && console.log(`🔥 [MessagingProvider] ${c}`, ...x);
|
|
29
29
|
},
|
|
30
|
-
[
|
|
30
|
+
[d]
|
|
31
31
|
);
|
|
32
|
-
|
|
32
|
+
a("🔄 RENDER START", {
|
|
33
33
|
userId: s == null ? void 0 : s.id,
|
|
34
|
-
apiKey: (
|
|
34
|
+
apiKey: (o == null ? void 0 : o.substring(0, 8)) + "...",
|
|
35
35
|
serviceConfig: !!n,
|
|
36
36
|
capabilities: Object.keys(l)
|
|
37
37
|
});
|
|
38
|
-
const [u,
|
|
38
|
+
const [u, f] = _(null), [g, N] = _(null), [C, p] = _(!1), [r, E] = _(!1), [S, v] = _(null), k = q(!1), b = q({
|
|
39
39
|
userId: s == null ? void 0 : s.id,
|
|
40
|
-
apiKey:
|
|
40
|
+
apiKey: o,
|
|
41
41
|
serviceConfig: n,
|
|
42
42
|
capabilities: l
|
|
43
|
-
}),
|
|
44
|
-
|
|
45
|
-
renderCount:
|
|
46
|
-
currentProps: { userId: s == null ? void 0 : s.id, apiKey: (
|
|
43
|
+
}), m = q(0);
|
|
44
|
+
m.current++, a("📊 RENDER INFO", {
|
|
45
|
+
renderCount: m.current,
|
|
46
|
+
currentProps: { userId: s == null ? void 0 : s.id, apiKey: (o == null ? void 0 : o.substring(0, 8)) + "..." },
|
|
47
47
|
propChanges: {
|
|
48
|
-
userChanged:
|
|
49
|
-
apiKeyChanged:
|
|
50
|
-
serviceConfigChanged:
|
|
51
|
-
capabilitiesChanged:
|
|
48
|
+
userChanged: b.current.userId !== (s == null ? void 0 : s.id),
|
|
49
|
+
apiKeyChanged: b.current.apiKey !== o,
|
|
50
|
+
serviceConfigChanged: b.current.serviceConfig !== n,
|
|
51
|
+
capabilitiesChanged: b.current.capabilities !== l
|
|
52
52
|
}
|
|
53
|
-
}),
|
|
53
|
+
}), b.current = {
|
|
54
54
|
userId: s == null ? void 0 : s.id,
|
|
55
|
-
apiKey:
|
|
55
|
+
apiKey: o,
|
|
56
56
|
serviceConfig: n,
|
|
57
57
|
capabilities: l
|
|
58
|
-
},
|
|
59
|
-
const
|
|
60
|
-
if (
|
|
61
|
-
renderCount:
|
|
62
|
-
apiKey: !!
|
|
58
|
+
}, Z(() => {
|
|
59
|
+
const c = m.current;
|
|
60
|
+
if (a("🔧 SERVICE INIT EFFECT TRIGGERED", {
|
|
61
|
+
renderCount: c,
|
|
62
|
+
apiKey: !!o,
|
|
63
63
|
serviceConfig: !!n,
|
|
64
64
|
dependencies: {
|
|
65
|
-
apiKey: (
|
|
65
|
+
apiKey: (o == null ? void 0 : o.substring(0, 8)) + "...",
|
|
66
66
|
serviceConfigRef: n,
|
|
67
|
-
serviceConfigStable:
|
|
68
|
-
apiKeyStable:
|
|
67
|
+
serviceConfigStable: b.current.serviceConfig === n,
|
|
68
|
+
apiKeyStable: b.current.apiKey === o
|
|
69
69
|
}
|
|
70
|
-
}), !
|
|
71
|
-
|
|
72
|
-
renderCount:
|
|
70
|
+
}), !o || !n) {
|
|
71
|
+
a("⚠️ SERVICE INIT SKIPPED", {
|
|
72
|
+
renderCount: c,
|
|
73
73
|
reason: "Missing apiKey or serviceConfig"
|
|
74
74
|
});
|
|
75
75
|
return;
|
|
76
76
|
}
|
|
77
|
-
|
|
78
|
-
renderCount:
|
|
79
|
-
apiKey: (
|
|
80
|
-
serviceConfigChanged:
|
|
77
|
+
a("🚀 CREATING NEW SERVICE", {
|
|
78
|
+
renderCount: c,
|
|
79
|
+
apiKey: (o == null ? void 0 : o.substring(0, 8)) + "...",
|
|
80
|
+
serviceConfigChanged: b.current.serviceConfig !== n
|
|
81
81
|
});
|
|
82
|
-
const
|
|
82
|
+
const x = new es({
|
|
83
83
|
...n,
|
|
84
|
-
apiKey:
|
|
85
|
-
debug:
|
|
84
|
+
apiKey: o,
|
|
85
|
+
debug: d
|
|
86
86
|
});
|
|
87
|
-
return
|
|
88
|
-
renderCount:
|
|
89
|
-
serviceInstance: !!
|
|
87
|
+
return f(x), a("✅ SERVICE SET", {
|
|
88
|
+
renderCount: c,
|
|
89
|
+
serviceInstance: !!x
|
|
90
90
|
}), () => {
|
|
91
|
-
|
|
92
|
-
renderCount:
|
|
91
|
+
a("🧹 SERVICE CLEANUP", {
|
|
92
|
+
renderCount: c,
|
|
93
93
|
reason: "Effect cleanup"
|
|
94
|
-
}),
|
|
94
|
+
}), x.disconnectUser().catch(console.error);
|
|
95
95
|
};
|
|
96
|
-
}, [
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
var
|
|
100
|
-
if (
|
|
96
|
+
}, [o, n, d, a]);
|
|
97
|
+
const w = q(null);
|
|
98
|
+
Z(() => {
|
|
99
|
+
var x, B;
|
|
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: k.current,
|
|
105
|
+
isConnected: C,
|
|
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 (
|
|
112
|
-
|
|
111
|
+
if (k.current) {
|
|
112
|
+
a("⚠️ USER CONNECTION SKIPPED", "Already connecting");
|
|
113
113
|
return;
|
|
114
114
|
}
|
|
115
|
-
if (((
|
|
116
|
-
|
|
115
|
+
if (((x = w.current) == null ? void 0 : x.serviceId) === u && ((B = w.current) == null ? void 0 : B.userId) === s.id) {
|
|
116
|
+
a(
|
|
117
117
|
"⚠️ USER CONNECTION SKIPPED",
|
|
118
118
|
"Already connected this user with this service"
|
|
119
119
|
);
|
|
120
120
|
return;
|
|
121
121
|
}
|
|
122
122
|
(async () => {
|
|
123
|
-
|
|
123
|
+
a("🚀 STARTING USER CONNECTION", { userId: s.id }), k.current = !0, E(!0), v(null);
|
|
124
124
|
try {
|
|
125
|
-
|
|
125
|
+
a("📞 CALLING SERVICE.CONNECTUSER", { userId: s.id });
|
|
126
126
|
const I = await u.connectUser(s);
|
|
127
|
-
|
|
127
|
+
N(I), p(!0), w.current = { serviceId: u, userId: s.id }, a("✅ USER CONNECTION SUCCESS", {
|
|
128
128
|
userId: s.id,
|
|
129
129
|
clientId: I.userID
|
|
130
130
|
});
|
|
131
131
|
} catch (I) {
|
|
132
|
-
const
|
|
133
|
-
|
|
132
|
+
const T = I instanceof Error ? I.message : "Connection failed";
|
|
133
|
+
v(T), a("❌ USER CONNECTION ERROR", {
|
|
134
134
|
userId: s.id,
|
|
135
|
-
error:
|
|
135
|
+
error: T
|
|
136
136
|
});
|
|
137
137
|
} finally {
|
|
138
|
-
|
|
138
|
+
E(!1), k.current = !1, a("🔄 USER CONNECTION FINISHED", {
|
|
139
139
|
userId: s.id,
|
|
140
|
-
isConnected:
|
|
140
|
+
isConnected: C
|
|
141
141
|
});
|
|
142
142
|
}
|
|
143
143
|
})();
|
|
144
|
-
}, [u, s,
|
|
144
|
+
}, [u, s, a, C]), Z(() => (a("🔌 CLEANUP EFFECT REGISTERED", {
|
|
145
145
|
hasService: !!u,
|
|
146
|
-
isConnected:
|
|
146
|
+
isConnected: C
|
|
147
147
|
}), () => {
|
|
148
|
-
u &&
|
|
148
|
+
u && C ? (a(
|
|
149
149
|
"🧹 CLEANUP EFFECT TRIGGERED",
|
|
150
150
|
"Cleaning up connection on unmount"
|
|
151
|
-
),
|
|
151
|
+
), w.current = null, u.disconnectUser().catch(console.error)) : a("🔇 CLEANUP EFFECT SKIPPED", {
|
|
152
152
|
hasService: !!u,
|
|
153
|
-
isConnected:
|
|
153
|
+
isConnected: C
|
|
154
154
|
});
|
|
155
|
-
}), [u,
|
|
156
|
-
const
|
|
157
|
-
if (
|
|
155
|
+
}), [u, C, a]);
|
|
156
|
+
const D = L(async () => {
|
|
157
|
+
if (a("🔄 REFRESH CONNECTION CALLED", {
|
|
158
158
|
hasService: !!u,
|
|
159
159
|
hasUser: !!s
|
|
160
160
|
}), !u || !s) {
|
|
161
|
-
|
|
161
|
+
a("⚠️ REFRESH CONNECTION SKIPPED", "Missing service or user");
|
|
162
162
|
return;
|
|
163
163
|
}
|
|
164
|
-
|
|
164
|
+
a("🚀 STARTING CONNECTION REFRESH", { userId: s.id }), E(!0);
|
|
165
165
|
try {
|
|
166
|
-
|
|
167
|
-
const
|
|
168
|
-
|
|
169
|
-
} catch (
|
|
170
|
-
const
|
|
171
|
-
|
|
166
|
+
a("🔌 DISCONNECTING FOR REFRESH"), await u.disconnectUser(), a("📞 RECONNECTING FOR REFRESH");
|
|
167
|
+
const c = await u.connectUser(s);
|
|
168
|
+
N(c), p(!0), v(null), a("✅ CONNECTION REFRESH SUCCESS", { userId: s.id });
|
|
169
|
+
} catch (c) {
|
|
170
|
+
const x = c instanceof Error ? c.message : "Refresh failed";
|
|
171
|
+
v(x), a("❌ CONNECTION REFRESH ERROR", {
|
|
172
172
|
userId: s.id,
|
|
173
|
-
error:
|
|
173
|
+
error: x
|
|
174
174
|
});
|
|
175
175
|
} finally {
|
|
176
|
-
|
|
176
|
+
E(!1), a("🔄 CONNECTION REFRESH FINISHED", { userId: s.id });
|
|
177
177
|
}
|
|
178
|
-
}, [u, s,
|
|
178
|
+
}, [u, s, a]), h = j.useMemo(() => (a("💫 CONTEXT VALUE MEMOIZATION", {
|
|
179
179
|
hasService: !!u,
|
|
180
|
-
hasClient: !!
|
|
181
|
-
isConnected:
|
|
182
|
-
isLoading:
|
|
180
|
+
hasClient: !!g,
|
|
181
|
+
isConnected: C,
|
|
182
|
+
isLoading: r,
|
|
183
183
|
hasError: !!S,
|
|
184
184
|
capabilitiesKeys: Object.keys(l)
|
|
185
185
|
}), {
|
|
186
186
|
service: u,
|
|
187
|
-
client:
|
|
188
|
-
isConnected:
|
|
189
|
-
isLoading:
|
|
187
|
+
client: g,
|
|
188
|
+
isConnected: C,
|
|
189
|
+
isLoading: r,
|
|
190
190
|
error: S,
|
|
191
191
|
capabilities: l,
|
|
192
|
-
refreshConnection:
|
|
193
|
-
debug:
|
|
192
|
+
refreshConnection: D,
|
|
193
|
+
debug: d
|
|
194
194
|
}), [
|
|
195
195
|
u,
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
196
|
+
g,
|
|
197
|
+
C,
|
|
198
|
+
r,
|
|
199
199
|
S,
|
|
200
200
|
l,
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
201
|
+
D,
|
|
202
|
+
d,
|
|
203
|
+
a
|
|
204
204
|
]);
|
|
205
|
-
return
|
|
206
|
-
renderCount:
|
|
207
|
-
willRenderChat: !!(
|
|
208
|
-
contextValueReady: !!
|
|
209
|
-
}), /* @__PURE__ */ e(
|
|
210
|
-
|
|
205
|
+
return a("🔄 RENDER END", {
|
|
206
|
+
renderCount: m.current,
|
|
207
|
+
willRenderChat: !!(g && C),
|
|
208
|
+
contextValueReady: !!h
|
|
209
|
+
}), /* @__PURE__ */ e(Pe.Provider, { value: h, children: g && C ? /* @__PURE__ */ e(
|
|
210
|
+
ss,
|
|
211
211
|
{
|
|
212
|
-
client:
|
|
212
|
+
client: g,
|
|
213
213
|
customClasses: {
|
|
214
214
|
channelList: "str-chat__channel-list str-chat__channel-list-react bg-transparent lg:border-r-2 border-r-0 border-[#0000000A]"
|
|
215
215
|
},
|
|
216
216
|
children: t
|
|
217
217
|
}
|
|
218
218
|
) : t });
|
|
219
|
-
},
|
|
219
|
+
}, Vs = () => fe(), Ws = (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
225
|
return Math.floor(l / (1e3 * 60 * 60 * 24));
|
|
226
|
-
},
|
|
226
|
+
}, qs = (t) => {
|
|
227
227
|
const s = /* @__PURE__ */ new Date();
|
|
228
228
|
if (Math.floor((s.getTime() - t.getTime()) / 1e3) < 60)
|
|
229
229
|
return "Just now";
|
|
230
|
-
const
|
|
231
|
-
return
|
|
230
|
+
const o = Ws(t, s);
|
|
231
|
+
return o === 0 ? t.toLocaleTimeString([], {
|
|
232
232
|
hour: "numeric",
|
|
233
233
|
minute: "2-digit",
|
|
234
234
|
hour12: !0
|
|
235
|
-
}) :
|
|
235
|
+
}) : o === 1 ? "Yesterday" : o < 7 ? `${o}d` : o < 28 ? `${Math.floor(o / 7)}w` : t.toLocaleDateString("en-US", {
|
|
236
236
|
month: "numeric",
|
|
237
237
|
day: "numeric",
|
|
238
238
|
year: "2-digit"
|
|
239
239
|
});
|
|
240
|
-
},
|
|
240
|
+
}, Te = [
|
|
241
241
|
"🍎",
|
|
242
242
|
// Apple
|
|
243
243
|
"🍌",
|
|
@@ -265,37 +265,37 @@ const Le = Qe({
|
|
|
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
|
-
const
|
|
272
|
-
s = (s << 5) - s +
|
|
271
|
+
const o = t.charCodeAt(n);
|
|
272
|
+
s = (s << 5) - s + o, s = s & s;
|
|
273
273
|
}
|
|
274
274
|
return Math.abs(s);
|
|
275
275
|
}
|
|
276
|
-
function
|
|
277
|
-
const n =
|
|
278
|
-
return
|
|
276
|
+
function Ys(t) {
|
|
277
|
+
const n = Zs(t) % Te.length;
|
|
278
|
+
return Te[n];
|
|
279
279
|
}
|
|
280
|
-
const
|
|
280
|
+
const K = ({
|
|
281
281
|
id: t,
|
|
282
282
|
image: s,
|
|
283
283
|
size: n = 40,
|
|
284
|
-
className:
|
|
284
|
+
className: o,
|
|
285
285
|
shape: l = "squircle"
|
|
286
286
|
}) => {
|
|
287
|
-
const
|
|
287
|
+
const d = Ys(t), u = n < 32 ? "text-xs" : n < 56 ? "text-sm" : n < 120 ? "text-lg" : "text-4xl", 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: R("flex-shrink-0 overflow-hidden", o),
|
|
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,107 +308,107 @@ const Q = ({
|
|
|
308
308
|
"div",
|
|
309
309
|
{
|
|
310
310
|
"aria-hidden": "true",
|
|
311
|
-
className:
|
|
311
|
+
className: R(
|
|
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
|
),
|
|
315
|
-
children:
|
|
315
|
+
children: d
|
|
316
316
|
}
|
|
317
317
|
)
|
|
318
318
|
}
|
|
319
319
|
);
|
|
320
|
-
},
|
|
320
|
+
}, Js = () => /* @__PURE__ */ e("svg", { width: "12", height: "12", viewBox: "0 0 10 10", fill: "none", children: /* @__PURE__ */ e(
|
|
321
321
|
"path",
|
|
322
322
|
{
|
|
323
323
|
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",
|
|
324
324
|
fill: "currentColor"
|
|
325
325
|
}
|
|
326
|
-
) }),
|
|
326
|
+
) }), Qs = (t) => {
|
|
327
327
|
var s;
|
|
328
328
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_TIP";
|
|
329
|
-
},
|
|
329
|
+
}, Xs = (t) => {
|
|
330
330
|
var s;
|
|
331
331
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_PAID";
|
|
332
332
|
}, ye = (t) => {
|
|
333
333
|
var s;
|
|
334
334
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_CHATBOT";
|
|
335
|
-
},
|
|
335
|
+
}, Oe = (t) => Qs(t) || Xs(t), Ks = (t) => {
|
|
336
336
|
var s;
|
|
337
|
-
return
|
|
338
|
-
},
|
|
337
|
+
return Oe(t) && !((s = t.text) != null && s.trim());
|
|
338
|
+
}, Fe = ({
|
|
339
339
|
message: t,
|
|
340
340
|
standalone: s = !1
|
|
341
341
|
}) => {
|
|
342
342
|
var l;
|
|
343
|
-
const n =
|
|
344
|
-
if (!n && !
|
|
343
|
+
const n = Oe(t), o = ye(t);
|
|
344
|
+
if (!n && !o)
|
|
345
345
|
return null;
|
|
346
346
|
if (n) {
|
|
347
|
-
const
|
|
348
|
-
if (!
|
|
349
|
-
const
|
|
350
|
-
return /* @__PURE__ */ i("div", { className:
|
|
351
|
-
/* @__PURE__ */ e(
|
|
347
|
+
const d = (l = t.metadata) == null ? void 0 : l.amount_text;
|
|
348
|
+
if (!d) return null;
|
|
349
|
+
const a = s ? "message-tip-standalone" : "message-tag message-tag--tip", u = s ? `${d} tip` : `Delivered with ${d} tip`;
|
|
350
|
+
return /* @__PURE__ */ i("div", { className: a, children: [
|
|
351
|
+
/* @__PURE__ */ e(As, { size: s ? 14 : 12 }),
|
|
352
352
|
/* @__PURE__ */ e("span", { children: u })
|
|
353
353
|
] });
|
|
354
354
|
}
|
|
355
355
|
return /* @__PURE__ */ i("div", { className: "message-tag message-tag--chatbot", children: [
|
|
356
|
-
/* @__PURE__ */ e("span", { className: "message-tag__icon", style: { marginTop: -1 }, children: /* @__PURE__ */ e(
|
|
356
|
+
/* @__PURE__ */ e("span", { className: "message-tag__icon", style: { marginTop: -1 }, children: /* @__PURE__ */ e(Js, {}) }),
|
|
357
357
|
/* @__PURE__ */ e("span", { className: "message-tag__label", children: "Chatbot" })
|
|
358
358
|
] });
|
|
359
|
-
},
|
|
359
|
+
}, Ue = j.memo(
|
|
360
360
|
({
|
|
361
361
|
channel: t,
|
|
362
362
|
selectedChannel: s,
|
|
363
363
|
onChannelSelect: n,
|
|
364
|
-
debug:
|
|
364
|
+
debug: o = !1,
|
|
365
365
|
unread: l,
|
|
366
|
-
renderMessagePreview:
|
|
366
|
+
renderMessagePreview: d
|
|
367
367
|
}) => {
|
|
368
|
-
var
|
|
369
|
-
const
|
|
368
|
+
var w, D, h, c, x, B;
|
|
369
|
+
const a = (s == null ? void 0 : s.id) === (t == null ? void 0 : t.id), u = () => {
|
|
370
370
|
t && n(t);
|
|
371
|
-
},
|
|
372
|
-
const
|
|
373
|
-
!
|
|
374
|
-
},
|
|
371
|
+
}, f = (I) => {
|
|
372
|
+
const T = I.key === "Enter" || I.key === " ", M = I.repeat;
|
|
373
|
+
!T || M || (I.preventDefault(), u());
|
|
374
|
+
}, N = Object.values(((w = t == null ? void 0 : t.state) == null ? void 0 : w.members) || {}).find(
|
|
375
375
|
(I) => {
|
|
376
|
-
var
|
|
377
|
-
return ((
|
|
376
|
+
var T, M;
|
|
377
|
+
return ((T = I.user) == null ? void 0 : T.id) && I.user.id !== ((M = t == null ? void 0 : t._client) == null ? void 0 : M.userID);
|
|
378
378
|
}
|
|
379
|
-
),
|
|
380
|
-
var
|
|
381
|
-
if (
|
|
382
|
-
const I = (
|
|
379
|
+
), C = ((D = N == null ? void 0 : N.user) == null ? void 0 : D.name) || "Conversation", p = (h = N == null ? void 0 : N.user) == null ? void 0 : h.image, r = (x = (c = t == null ? void 0 : t.state) == null ? void 0 : c.messages) == null ? void 0 : x[t.state.messages.length - 1], S = (() => {
|
|
380
|
+
var T;
|
|
381
|
+
if (r != null && r.text) return r.text;
|
|
382
|
+
const I = (T = r == null ? void 0 : r.attachments) == null ? void 0 : T[0];
|
|
383
383
|
return I ? I.og_scrape_url ? I.og_scrape_url : I.type === "image" ? "📷 Sent an image" : I.type === "video" ? "🎥 Sent a video" : I.type === "audio" ? "🎵 Sent audio" : I.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
|
|
384
|
-
})(),
|
|
385
|
-
return
|
|
384
|
+
})(), v = r != null && r.created_at ? qs(new Date(r.created_at)) : "", k = r ? ye(r) : !1, b = d ? d(r, S) : `${k ? "✨ " : ""}${S}`, m = l ?? 0;
|
|
385
|
+
return o && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
|
|
386
386
|
channelId: t == null ? void 0 : t.id,
|
|
387
|
-
isSelected:
|
|
388
|
-
participantName:
|
|
389
|
-
unreadCount:
|
|
390
|
-
hasTimestamp: !!
|
|
387
|
+
isSelected: a,
|
|
388
|
+
participantName: C,
|
|
389
|
+
unreadCount: m,
|
|
390
|
+
hasTimestamp: !!v
|
|
391
391
|
}), /* @__PURE__ */ e(
|
|
392
392
|
"div",
|
|
393
393
|
{
|
|
394
394
|
role: "button",
|
|
395
395
|
tabIndex: 0,
|
|
396
396
|
onClick: u,
|
|
397
|
-
onKeyDown:
|
|
398
|
-
className:
|
|
397
|
+
onKeyDown: f,
|
|
398
|
+
className: R(
|
|
399
399
|
"group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring",
|
|
400
400
|
{
|
|
401
|
-
"bg-primary-alt/10 border-l-4 border-l-primary":
|
|
402
|
-
"hover:bg-sand": !
|
|
401
|
+
"bg-primary-alt/10 border-l-4 border-l-primary": a,
|
|
402
|
+
"hover:bg-sand": !a
|
|
403
403
|
}
|
|
404
404
|
),
|
|
405
405
|
children: /* @__PURE__ */ i("div", { className: "flex items-start gap-3", children: [
|
|
406
406
|
/* @__PURE__ */ e(
|
|
407
|
-
|
|
407
|
+
K,
|
|
408
408
|
{
|
|
409
|
-
id: ((
|
|
410
|
-
name:
|
|
411
|
-
image:
|
|
409
|
+
id: ((B = N == null ? void 0 : N.user) == null ? void 0 : B.id) || t.id || "unknown",
|
|
410
|
+
name: C,
|
|
411
|
+
image: p,
|
|
412
412
|
size: 44,
|
|
413
413
|
className: "[&_.avatar-fallback]:group-hover:bg-[#eeeeee]"
|
|
414
414
|
}
|
|
@@ -418,18 +418,18 @@ const Q = ({
|
|
|
418
418
|
/* @__PURE__ */ e(
|
|
419
419
|
"h3",
|
|
420
420
|
{
|
|
421
|
-
className:
|
|
421
|
+
className: R(
|
|
422
422
|
"text-sm font-medium truncate",
|
|
423
|
-
|
|
423
|
+
a ? "text-primary" : "text-charcoal"
|
|
424
424
|
),
|
|
425
|
-
children:
|
|
425
|
+
children: C
|
|
426
426
|
}
|
|
427
427
|
),
|
|
428
|
-
|
|
428
|
+
v && /* @__PURE__ */ e("span", { className: "text-xs text-stone flex-shrink-0", children: v })
|
|
429
429
|
] }),
|
|
430
430
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
|
|
431
|
-
/* @__PURE__ */ e("p", { className: "text-xs text-stone flex-1 line-clamp-1", children:
|
|
432
|
-
|
|
431
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-stone flex-1 line-clamp-1", children: b }),
|
|
432
|
+
m > 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: m > 99 ? "99+" : m })
|
|
433
433
|
] })
|
|
434
434
|
] })
|
|
435
435
|
] })
|
|
@@ -437,48 +437,48 @@ const Q = ({
|
|
|
437
437
|
);
|
|
438
438
|
}
|
|
439
439
|
);
|
|
440
|
-
|
|
441
|
-
const
|
|
440
|
+
Ue.displayName = "CustomChannelPreview";
|
|
441
|
+
const Be = j.memo(
|
|
442
442
|
({
|
|
443
443
|
onChannelSelect: t,
|
|
444
444
|
selectedChannel: s,
|
|
445
445
|
filters: n,
|
|
446
|
-
className:
|
|
446
|
+
className: o,
|
|
447
447
|
customEmptyStateIndicator: l,
|
|
448
|
-
renderMessagePreview:
|
|
448
|
+
renderMessagePreview: d
|
|
449
449
|
}) => {
|
|
450
|
-
const
|
|
451
|
-
|
|
450
|
+
const a = j.useRef(0);
|
|
451
|
+
a.current++;
|
|
452
452
|
const { debug: u = !1 } = fe();
|
|
453
453
|
u && console.log("📺 [ChannelList] 🔄 RENDER START", {
|
|
454
|
-
renderCount:
|
|
454
|
+
renderCount: a.current,
|
|
455
455
|
selectedChannelId: s == null ? void 0 : s.id,
|
|
456
456
|
filters: n
|
|
457
457
|
});
|
|
458
|
-
const
|
|
459
|
-
|
|
458
|
+
const f = j.useMemo(() => (N) => /* @__PURE__ */ e(
|
|
459
|
+
Ue,
|
|
460
460
|
{
|
|
461
|
-
...
|
|
461
|
+
...N,
|
|
462
462
|
selectedChannel: s,
|
|
463
463
|
onChannelSelect: t,
|
|
464
464
|
debug: u,
|
|
465
|
-
renderMessagePreview:
|
|
465
|
+
renderMessagePreview: d
|
|
466
466
|
}
|
|
467
|
-
), [s, t, u,
|
|
467
|
+
), [s, t, u, d]);
|
|
468
468
|
return /* @__PURE__ */ e(
|
|
469
469
|
"div",
|
|
470
470
|
{
|
|
471
|
-
className:
|
|
471
|
+
className: R(
|
|
472
472
|
"messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
|
|
473
|
-
|
|
473
|
+
o
|
|
474
474
|
),
|
|
475
475
|
children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ e(
|
|
476
|
-
|
|
476
|
+
ts,
|
|
477
477
|
{
|
|
478
478
|
filters: n,
|
|
479
479
|
sort: { last_message_at: -1 },
|
|
480
480
|
options: { limit: 30 },
|
|
481
|
-
Preview:
|
|
481
|
+
Preview: f,
|
|
482
482
|
EmptyStateIndicator: l
|
|
483
483
|
},
|
|
484
484
|
JSON.stringify(n)
|
|
@@ -487,39 +487,39 @@ const Ue = A.memo(
|
|
|
487
487
|
);
|
|
488
488
|
}
|
|
489
489
|
);
|
|
490
|
-
|
|
490
|
+
Be.displayName = "ChannelList";
|
|
491
491
|
const de = ({
|
|
492
492
|
variant: t = "default",
|
|
493
493
|
className: s,
|
|
494
494
|
children: n,
|
|
495
|
-
...
|
|
495
|
+
...o
|
|
496
496
|
}) => /* @__PURE__ */ e(
|
|
497
497
|
"button",
|
|
498
498
|
{
|
|
499
499
|
type: "button",
|
|
500
|
-
className:
|
|
500
|
+
className: R(
|
|
501
501
|
"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",
|
|
502
502
|
t === "danger" ? "text-danger hover:bg-danger/50" : "text-charcoal hover:bg-sand",
|
|
503
503
|
s
|
|
504
504
|
),
|
|
505
|
-
...
|
|
505
|
+
...o,
|
|
506
506
|
children: n
|
|
507
507
|
}
|
|
508
508
|
);
|
|
509
|
-
function
|
|
509
|
+
function je({ label: t, className: s, children: n, ...o }) {
|
|
510
510
|
return /* @__PURE__ */ i(
|
|
511
511
|
"button",
|
|
512
512
|
{
|
|
513
513
|
type: "button",
|
|
514
|
-
className:
|
|
514
|
+
className: R(
|
|
515
515
|
"rounded-full p-2 transition-colors focus-ring",
|
|
516
516
|
{
|
|
517
|
-
"cursor-not-allowed opacity-50":
|
|
518
|
-
"hover:bg-sand": !
|
|
517
|
+
"cursor-not-allowed opacity-50": o.disabled,
|
|
518
|
+
"hover:bg-sand": !o.disabled
|
|
519
519
|
},
|
|
520
520
|
s
|
|
521
521
|
),
|
|
522
|
-
...
|
|
522
|
+
...o,
|
|
523
523
|
children: [
|
|
524
524
|
/* @__PURE__ */ e("span", { className: "sr-only", children: t }),
|
|
525
525
|
n
|
|
@@ -527,41 +527,41 @@ function Be({ label: t, className: s, children: n, ...a }) {
|
|
|
527
527
|
}
|
|
528
528
|
);
|
|
529
529
|
}
|
|
530
|
-
function
|
|
531
|
-
return /* @__PURE__ */ e(
|
|
530
|
+
function Ae({ onClick: t }) {
|
|
531
|
+
return /* @__PURE__ */ e(je, { label: "Close", onClick: t, className: "p-1", children: /* @__PURE__ */ e(pe, { className: "h-5 w-5 text-stone", weight: "bold" }) });
|
|
532
532
|
}
|
|
533
|
-
const
|
|
534
|
-
function
|
|
533
|
+
const et = (t) => /* @__PURE__ */ e(ns, { ...t, position: "center" }), Ce = "vote_up", Ne = "vote_down";
|
|
534
|
+
function st(t) {
|
|
535
535
|
return t != null && t.length ? t.some((s) => s.type === Ne) ? "down" : t.some((s) => s.type === Ce) ? "up" : null : null;
|
|
536
536
|
}
|
|
537
|
-
function
|
|
538
|
-
const { channel: s } = we(), { client: n } =
|
|
539
|
-
() =>
|
|
537
|
+
function tt(t) {
|
|
538
|
+
const { channel: s } = we(), { client: n } = Le("useMessageVote"), o = be(
|
|
539
|
+
() => st(t.own_reactions),
|
|
540
540
|
[t.own_reactions]
|
|
541
|
-
), l =
|
|
541
|
+
), l = L(async () => {
|
|
542
542
|
if (n != null && n.userID)
|
|
543
543
|
try {
|
|
544
|
-
|
|
544
|
+
o === "up" ? await s.deleteReaction(t.id, Ce) : await s.sendReaction(
|
|
545
545
|
t.id,
|
|
546
546
|
{ type: Ce },
|
|
547
547
|
{ enforce_unique: !0, skip_push: !0 }
|
|
548
548
|
);
|
|
549
549
|
} catch {
|
|
550
550
|
}
|
|
551
|
-
}, [s, n == null ? void 0 : n.userID, t.id,
|
|
551
|
+
}, [s, n == null ? void 0 : n.userID, t.id, o]), d = L(async () => {
|
|
552
552
|
if (n != null && n.userID)
|
|
553
553
|
try {
|
|
554
|
-
|
|
554
|
+
o === "down" ? await s.deleteReaction(t.id, Ne) : await s.sendReaction(
|
|
555
555
|
t.id,
|
|
556
556
|
{ type: Ne },
|
|
557
557
|
{ enforce_unique: !0, skip_push: !0 }
|
|
558
558
|
);
|
|
559
559
|
} catch {
|
|
560
560
|
}
|
|
561
|
-
}, [s, n == null ? void 0 : n.userID, t.id,
|
|
562
|
-
return { selected:
|
|
561
|
+
}, [s, n == null ? void 0 : n.userID, t.id, o]);
|
|
562
|
+
return { selected: o, voteUp: l, voteDown: d };
|
|
563
563
|
}
|
|
564
|
-
const
|
|
564
|
+
const nt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
|
|
565
565
|
"path",
|
|
566
566
|
{
|
|
567
567
|
d: "M4.667 7.333l2.666-6A1.333 1.333 0 018.667 2v2.667a.667.667 0 00.666.666h3.764a1.334 1.334 0 011.192 1.93l-2.333 4.666a1.333 1.333 0 01-1.193.738H4.667m0-5.334v5.334m0-5.334H2.667a1.333 1.333 0 00-1.334 1.334v2.666a1.333 1.333 0 001.334 1.334h2",
|
|
@@ -571,7 +571,7 @@ const tt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
571
571
|
strokeLinejoin: "round",
|
|
572
572
|
fill: t ? "currentColor" : "none"
|
|
573
573
|
}
|
|
574
|
-
) }),
|
|
574
|
+
) }), rt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
|
|
575
575
|
"path",
|
|
576
576
|
{
|
|
577
577
|
d: "M11.333 8.667l-2.666 6A1.333 1.333 0 017.333 14v-2.667a.667.667 0 00-.666-.666H2.903a1.334 1.334 0 01-1.192-1.93l2.333-4.666a1.333 1.333 0 011.193-.738h6.096m0 5.334V3.333m0 5.334h2a1.333 1.333 0 001.334-1.334V4.667a1.333 1.333 0 00-1.334-1.334h-2",
|
|
@@ -581,7 +581,7 @@ const tt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
581
581
|
strokeLinejoin: "round",
|
|
582
582
|
fill: t ? "currentColor" : "none"
|
|
583
583
|
}
|
|
584
|
-
) }),
|
|
584
|
+
) }), at = ({
|
|
585
585
|
selected: t,
|
|
586
586
|
onVoteUp: s,
|
|
587
587
|
onVoteDown: n
|
|
@@ -594,7 +594,7 @@ const tt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
594
594
|
onClick: s,
|
|
595
595
|
"aria-label": "Helpful",
|
|
596
596
|
"aria-pressed": t === "up",
|
|
597
|
-
children: /* @__PURE__ */ e(
|
|
597
|
+
children: /* @__PURE__ */ e(nt, { filled: t === "up" })
|
|
598
598
|
}
|
|
599
599
|
),
|
|
600
600
|
/* @__PURE__ */ e(
|
|
@@ -605,175 +605,175 @@ const tt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
605
605
|
onClick: n,
|
|
606
606
|
"aria-label": "Not helpful",
|
|
607
607
|
"aria-pressed": t === "down",
|
|
608
|
-
children: /* @__PURE__ */ e(
|
|
608
|
+
children: /* @__PURE__ */ e(rt, { filled: t === "down" })
|
|
609
609
|
}
|
|
610
610
|
)
|
|
611
|
-
] }),
|
|
612
|
-
var
|
|
611
|
+
] }), ot = (t) => {
|
|
612
|
+
var X, oe;
|
|
613
613
|
const {
|
|
614
614
|
additionalMessageInputProps: s,
|
|
615
615
|
chatbotVotingEnabled: n,
|
|
616
|
-
editing:
|
|
616
|
+
editing: o,
|
|
617
617
|
endOfGroup: l,
|
|
618
|
-
firstOfGroup:
|
|
619
|
-
groupedByUser:
|
|
618
|
+
firstOfGroup: d,
|
|
619
|
+
groupedByUser: a,
|
|
620
620
|
handleAction: u,
|
|
621
|
-
handleOpenThread:
|
|
622
|
-
handleRetry:
|
|
623
|
-
highlighted:
|
|
624
|
-
isMessageAIGenerated:
|
|
625
|
-
isMyMessage:
|
|
626
|
-
message:
|
|
627
|
-
renderText:
|
|
621
|
+
handleOpenThread: f,
|
|
622
|
+
handleRetry: g,
|
|
623
|
+
highlighted: N,
|
|
624
|
+
isMessageAIGenerated: C,
|
|
625
|
+
isMyMessage: p,
|
|
626
|
+
message: r,
|
|
627
|
+
renderText: E,
|
|
628
628
|
threadList: S
|
|
629
|
-
} = t, { client:
|
|
630
|
-
Attachment:
|
|
631
|
-
EditMessageModal:
|
|
632
|
-
MessageBlocked:
|
|
633
|
-
MessageBouncePrompt: I =
|
|
634
|
-
MessageDeleted:
|
|
635
|
-
MessageIsThreadReplyInChannelButtonIndicator:
|
|
636
|
-
MessageRepliesCountButton:
|
|
637
|
-
ReminderNotification:
|
|
638
|
-
StreamedMessageText:
|
|
629
|
+
} = t, { client: v } = Le("CustomMessage"), [k, b] = _(!1), m = as(r.id), { selected: w, voteUp: D, voteDown: h } = tt(r), {
|
|
630
|
+
Attachment: c = ls,
|
|
631
|
+
EditMessageModal: x = is,
|
|
632
|
+
MessageBlocked: B = cs,
|
|
633
|
+
MessageBouncePrompt: I = ds,
|
|
634
|
+
MessageDeleted: T = us,
|
|
635
|
+
MessageIsThreadReplyInChannelButtonIndicator: M = ms,
|
|
636
|
+
MessageRepliesCountButton: G = hs,
|
|
637
|
+
ReminderNotification: z = fs,
|
|
638
|
+
StreamedMessageText: ee = gs,
|
|
639
639
|
PinIndicator: Y
|
|
640
|
-
} =
|
|
641
|
-
() =>
|
|
642
|
-
[
|
|
640
|
+
} = os("CustomMessage"), se = xs(r), te = bs(r), re = be(
|
|
641
|
+
() => C == null ? void 0 : C(r),
|
|
642
|
+
[C, r]
|
|
643
643
|
), V = be(
|
|
644
|
-
() => !
|
|
645
|
-
[
|
|
644
|
+
() => !r.shared_location && !r.attachments ? [] : r.shared_location ? [r.shared_location, ...r.attachments ?? []] : r.attachments,
|
|
645
|
+
[r]
|
|
646
646
|
);
|
|
647
|
-
if (
|
|
647
|
+
if (Cs(r))
|
|
648
648
|
return null;
|
|
649
|
-
if (
|
|
650
|
-
return /* @__PURE__ */ e(
|
|
651
|
-
if (
|
|
652
|
-
return /* @__PURE__ */ e(
|
|
653
|
-
const
|
|
654
|
-
let
|
|
655
|
-
|
|
656
|
-
const
|
|
649
|
+
if (r.deleted_at || r.type === "deleted")
|
|
650
|
+
return /* @__PURE__ */ e(T, { message: r });
|
|
651
|
+
if (Ns(r))
|
|
652
|
+
return /* @__PURE__ */ e(B, {});
|
|
653
|
+
const J = !S && !!r.reply_count, P = !S && r.show_in_channel && r.parent_id, O = r.status === "failed" && ((X = r.error) == null ? void 0 : X.status) !== 403, H = vs(r);
|
|
654
|
+
let F;
|
|
655
|
+
O ? F = () => g(r) : H && (F = () => b(!0));
|
|
656
|
+
const W = R(
|
|
657
657
|
"str-chat__message str-chat__message-simple",
|
|
658
|
-
`str-chat__message--${
|
|
659
|
-
`str-chat__message--${
|
|
660
|
-
|
|
661
|
-
|
|
658
|
+
`str-chat__message--${r.type}`,
|
|
659
|
+
`str-chat__message--${r.status}`,
|
|
660
|
+
p() ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
|
|
661
|
+
r.text ? "str-chat__message--has-text" : "has-no-text",
|
|
662
662
|
{
|
|
663
|
-
"str-chat__message--has-attachment":
|
|
664
|
-
"str-chat__message--highlighted":
|
|
665
|
-
"str-chat__message--pinned pinned-message":
|
|
666
|
-
"str-chat__message--with-reactions":
|
|
667
|
-
"str-chat__message-send-can-be-retried": (
|
|
668
|
-
"str-chat__message-with-thread-link":
|
|
663
|
+
"str-chat__message--has-attachment": se,
|
|
664
|
+
"str-chat__message--highlighted": N,
|
|
665
|
+
"str-chat__message--pinned pinned-message": r.pinned,
|
|
666
|
+
"str-chat__message--with-reactions": te,
|
|
667
|
+
"str-chat__message-send-can-be-retried": (r == null ? void 0 : r.status) === "failed" && ((oe = r == null ? void 0 : r.error) == null ? void 0 : oe.status) !== 403,
|
|
668
|
+
"str-chat__message-with-thread-link": J || P,
|
|
669
669
|
"str-chat__virtual-message__wrapper--end": l,
|
|
670
|
-
"str-chat__virtual-message__wrapper--first":
|
|
671
|
-
"str-chat__virtual-message__wrapper--group":
|
|
670
|
+
"str-chat__virtual-message__wrapper--first": d,
|
|
671
|
+
"str-chat__virtual-message__wrapper--group": a
|
|
672
672
|
}
|
|
673
|
-
),
|
|
673
|
+
), ae = r.poll_id && v.polls.fromState(r.poll_id), Q = Ks(r);
|
|
674
674
|
return /* @__PURE__ */ i(ve, { children: [
|
|
675
|
-
|
|
676
|
-
|
|
675
|
+
o && /* @__PURE__ */ e(
|
|
676
|
+
x,
|
|
677
677
|
{
|
|
678
678
|
additionalMessageInputProps: s
|
|
679
679
|
}
|
|
680
680
|
),
|
|
681
|
-
|
|
682
|
-
|
|
681
|
+
k && /* @__PURE__ */ e(
|
|
682
|
+
ws,
|
|
683
683
|
{
|
|
684
684
|
MessageBouncePrompt: I,
|
|
685
|
-
onClose: () =>
|
|
686
|
-
open:
|
|
685
|
+
onClose: () => b(!1),
|
|
686
|
+
open: k
|
|
687
687
|
}
|
|
688
688
|
),
|
|
689
|
-
/* @__PURE__ */ i("div", { className:
|
|
689
|
+
/* @__PURE__ */ i("div", { className: W, children: [
|
|
690
690
|
Y && /* @__PURE__ */ e(Y, {}),
|
|
691
|
-
!!
|
|
692
|
-
|
|
693
|
-
|
|
691
|
+
!!m && /* @__PURE__ */ e(z, { reminder: m }),
|
|
692
|
+
r.user && /* @__PURE__ */ e(
|
|
693
|
+
K,
|
|
694
694
|
{
|
|
695
695
|
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
696
|
-
id:
|
|
697
|
-
image:
|
|
698
|
-
name:
|
|
696
|
+
id: r.user.id,
|
|
697
|
+
image: r.user.image,
|
|
698
|
+
name: r.user.name || r.user.id
|
|
699
699
|
}
|
|
700
700
|
),
|
|
701
701
|
/* @__PURE__ */ e(
|
|
702
702
|
"div",
|
|
703
703
|
{
|
|
704
|
-
className:
|
|
705
|
-
"str-chat__simple-message--error-failed":
|
|
704
|
+
className: R("str-chat__message-inner", {
|
|
705
|
+
"str-chat__simple-message--error-failed": O || H
|
|
706
706
|
}),
|
|
707
707
|
"data-testid": "message-inner",
|
|
708
|
-
onClick:
|
|
709
|
-
onKeyDown:
|
|
710
|
-
role:
|
|
711
|
-
tabIndex:
|
|
708
|
+
onClick: F,
|
|
709
|
+
onKeyDown: F,
|
|
710
|
+
role: F ? "button" : void 0,
|
|
711
|
+
tabIndex: F ? 0 : void 0,
|
|
712
712
|
style: {
|
|
713
713
|
// Force margins to 0 to prevent hover layout shift
|
|
714
714
|
// Stream Chat CSS sets margin-inline-end/start to 78px, then 0 on hover
|
|
715
715
|
marginInlineEnd: 0,
|
|
716
716
|
marginInlineStart: 0
|
|
717
717
|
},
|
|
718
|
-
children:
|
|
718
|
+
children: Q ? (
|
|
719
719
|
/* Tip-only messages render as a standalone bubble */
|
|
720
|
-
/* @__PURE__ */ e(
|
|
720
|
+
/* @__PURE__ */ e(Fe, { message: r, standalone: !0 })
|
|
721
721
|
) : /* @__PURE__ */ i("div", { className: "str-chat__message-bubble-wrapper", children: [
|
|
722
722
|
/* @__PURE__ */ i("div", { className: "str-chat__message-bubble", children: [
|
|
723
|
-
|
|
724
|
-
V != null && V.length && !
|
|
725
|
-
|
|
723
|
+
ae && /* @__PURE__ */ e(ps, { poll: ae }),
|
|
724
|
+
V != null && V.length && !r.quoted_message ? /* @__PURE__ */ e(
|
|
725
|
+
c,
|
|
726
726
|
{
|
|
727
727
|
actionHandler: u,
|
|
728
728
|
attachments: V
|
|
729
729
|
}
|
|
730
730
|
) : null,
|
|
731
|
-
|
|
732
|
-
|
|
731
|
+
re ? /* @__PURE__ */ e(
|
|
732
|
+
ee,
|
|
733
733
|
{
|
|
734
|
-
message:
|
|
735
|
-
renderText:
|
|
734
|
+
message: r,
|
|
735
|
+
renderText: E
|
|
736
736
|
}
|
|
737
|
-
) : /* @__PURE__ */ e(
|
|
738
|
-
/* @__PURE__ */ e(
|
|
737
|
+
) : /* @__PURE__ */ e(ys, { message: r, renderText: E }),
|
|
738
|
+
/* @__PURE__ */ e(Es, {})
|
|
739
739
|
] }),
|
|
740
|
-
/* @__PURE__ */ e(
|
|
741
|
-
n && ye(
|
|
742
|
-
|
|
740
|
+
/* @__PURE__ */ e(Fe, { message: r }),
|
|
741
|
+
n && ye(r) && /* @__PURE__ */ e(
|
|
742
|
+
at,
|
|
743
743
|
{
|
|
744
|
-
selected:
|
|
745
|
-
onVoteUp:
|
|
746
|
-
onVoteDown:
|
|
744
|
+
selected: w,
|
|
745
|
+
onVoteUp: D,
|
|
746
|
+
onVoteDown: h
|
|
747
747
|
}
|
|
748
748
|
)
|
|
749
749
|
] })
|
|
750
750
|
}
|
|
751
751
|
),
|
|
752
|
-
|
|
753
|
-
|
|
752
|
+
J && /* @__PURE__ */ e(
|
|
753
|
+
G,
|
|
754
754
|
{
|
|
755
|
-
onClick:
|
|
756
|
-
reply_count:
|
|
755
|
+
onClick: f,
|
|
756
|
+
reply_count: r.reply_count
|
|
757
757
|
}
|
|
758
758
|
),
|
|
759
|
-
|
|
760
|
-
] },
|
|
759
|
+
P && /* @__PURE__ */ e(M, {})
|
|
760
|
+
] }, r.id)
|
|
761
761
|
] });
|
|
762
|
-
},
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
),
|
|
766
|
-
const s =
|
|
767
|
-
return /* @__PURE__ */ e(
|
|
768
|
-
},
|
|
762
|
+
}, lt = j.memo(
|
|
763
|
+
ot,
|
|
764
|
+
rs
|
|
765
|
+
), it = (t) => {
|
|
766
|
+
const s = Is("CustomMessage");
|
|
767
|
+
return /* @__PURE__ */ e(lt, { ...s, ...t });
|
|
768
|
+
}, ct = (t) => ({
|
|
769
769
|
linkPreviews: Array.from(t.previews.values()).filter(
|
|
770
|
-
(s) =>
|
|
770
|
+
(s) => De.previewIsLoaded(s) || De.previewIsLoading(s)
|
|
771
771
|
)
|
|
772
|
-
}),
|
|
772
|
+
}), dt = ({
|
|
773
773
|
link: t,
|
|
774
774
|
onDismiss: s
|
|
775
775
|
}) => {
|
|
776
|
-
const { og_scrape_url: n, title:
|
|
776
|
+
const { og_scrape_url: n, title: o, image_url: l } = t;
|
|
777
777
|
return /* @__PURE__ */ i(
|
|
778
778
|
"a",
|
|
779
779
|
{
|
|
@@ -786,7 +786,7 @@ const tt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
786
786
|
"img",
|
|
787
787
|
{
|
|
788
788
|
src: l,
|
|
789
|
-
alt:
|
|
789
|
+
alt: o || "",
|
|
790
790
|
className: "h-[148px] w-full rounded-[20px] object-cover"
|
|
791
791
|
}
|
|
792
792
|
),
|
|
@@ -794,8 +794,8 @@ const tt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
794
794
|
"button",
|
|
795
795
|
{
|
|
796
796
|
type: "button",
|
|
797
|
-
onClick: (
|
|
798
|
-
|
|
797
|
+
onClick: (a) => {
|
|
798
|
+
a.preventDefault(), s(n);
|
|
799
799
|
},
|
|
800
800
|
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",
|
|
801
801
|
"aria-label": "Close link preview",
|
|
@@ -803,38 +803,38 @@ const tt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
803
803
|
}
|
|
804
804
|
),
|
|
805
805
|
/* @__PURE__ */ i("div", { className: "p-2", children: [
|
|
806
|
-
|
|
806
|
+
o && /* @__PURE__ */ e("div", { className: "text-[14px] font-medium leading-5 text-white", children: o }),
|
|
807
807
|
/* @__PURE__ */ e("div", { className: "text-[12px] leading-4 text-white/55", children: n })
|
|
808
808
|
] })
|
|
809
809
|
]
|
|
810
810
|
}
|
|
811
811
|
);
|
|
812
|
-
},
|
|
813
|
-
const { linkPreviewsManager: t } =
|
|
812
|
+
}, ut = () => {
|
|
813
|
+
const { linkPreviewsManager: t } = _s(), { linkPreviews: s } = Ss(
|
|
814
814
|
t.state,
|
|
815
|
-
|
|
815
|
+
ct
|
|
816
816
|
), n = (l) => {
|
|
817
817
|
t.dismissPreview(l);
|
|
818
818
|
};
|
|
819
819
|
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(
|
|
820
|
-
|
|
820
|
+
dt,
|
|
821
821
|
{
|
|
822
822
|
link: l,
|
|
823
823
|
onDismiss: n
|
|
824
824
|
},
|
|
825
825
|
l.og_scrape_url
|
|
826
826
|
)) }) : null;
|
|
827
|
-
},
|
|
828
|
-
const { handleSubmit: t } =
|
|
827
|
+
}, mt = () => {
|
|
828
|
+
const { handleSubmit: t } = ks(), s = Rs();
|
|
829
829
|
return /* @__PURE__ */ i(ve, { children: [
|
|
830
|
-
/* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(
|
|
830
|
+
/* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(Ds, {}) }),
|
|
831
831
|
/* @__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: [
|
|
832
|
-
/* @__PURE__ */ e(Ds, {}),
|
|
833
|
-
/* @__PURE__ */ e(dt, {}),
|
|
834
832
|
/* @__PURE__ */ e(Ts, {}),
|
|
833
|
+
/* @__PURE__ */ e(ut, {}),
|
|
834
|
+
/* @__PURE__ */ e(Fs, {}),
|
|
835
835
|
/* @__PURE__ */ i("div", { className: "flex", children: [
|
|
836
836
|
/* @__PURE__ */ e("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ e(
|
|
837
|
-
|
|
837
|
+
Ls,
|
|
838
838
|
{
|
|
839
839
|
className: "w-full resize-none outline-none leading-6",
|
|
840
840
|
autoFocus: !0,
|
|
@@ -850,18 +850,18 @@ const tt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
850
850
|
disabled: !s,
|
|
851
851
|
onClick: t,
|
|
852
852
|
type: "button",
|
|
853
|
-
children: /* @__PURE__ */ e(
|
|
853
|
+
children: /* @__PURE__ */ e($s, { className: "size-4" })
|
|
854
854
|
}
|
|
855
855
|
)
|
|
856
856
|
] })
|
|
857
857
|
] })
|
|
858
858
|
] });
|
|
859
|
-
},
|
|
859
|
+
}, ht = ({
|
|
860
860
|
renderActions: t
|
|
861
861
|
}) => /* @__PURE__ */ i("div", { className: "message-input flex items-center gap-2 p-4", children: [
|
|
862
862
|
t && (t == null ? void 0 : t()),
|
|
863
|
-
/* @__PURE__ */ e(
|
|
864
|
-
] }),
|
|
863
|
+
/* @__PURE__ */ e(Ms, { Input: mt })
|
|
864
|
+
] }), ft = (t) => {
|
|
865
865
|
const s = t.message.hide_date === !0;
|
|
866
866
|
return /* @__PURE__ */ i("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
867
867
|
/* @__PURE__ */ i("div", { className: "str-chat__message--system__text", children: [
|
|
@@ -869,12 +869,12 @@ const tt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
869
869
|
/* @__PURE__ */ e("p", { children: t.message.text }),
|
|
870
870
|
/* @__PURE__ */ e("div", { className: "str-chat__message--system__line" })
|
|
871
871
|
] }),
|
|
872
|
-
!s && /* @__PURE__ */ e(
|
|
872
|
+
!s && /* @__PURE__ */ e(Ps, { message: t.message })
|
|
873
873
|
] });
|
|
874
|
-
},
|
|
874
|
+
}, gt = () => null, xt = ({ className: t, message: s }) => /* @__PURE__ */ i(
|
|
875
875
|
"div",
|
|
876
876
|
{
|
|
877
|
-
className:
|
|
877
|
+
className: R("flex items-center justify-center h-full", t),
|
|
878
878
|
children: [
|
|
879
879
|
/* @__PURE__ */ i("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
|
|
880
880
|
/* @__PURE__ */ e("circle", { cx: "6", cy: "50", r: "6", children: /* @__PURE__ */ e(
|
|
@@ -914,45 +914,45 @@ const tt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
914
914
|
s && /* @__PURE__ */ e("span", { className: "text-stone", children: s })
|
|
915
915
|
]
|
|
916
916
|
}
|
|
917
|
-
), he =
|
|
918
|
-
/* @__PURE__ */ e(
|
|
917
|
+
), he = j.memo(() => /* @__PURE__ */ e("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ i("div", { className: "flex items-center", children: [
|
|
918
|
+
/* @__PURE__ */ e(xt, { className: "w-6 h-6" }),
|
|
919
919
|
/* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading messages" })
|
|
920
920
|
] }) }));
|
|
921
921
|
he.displayName = "LoadingState";
|
|
922
|
-
const
|
|
922
|
+
const bt = ({
|
|
923
923
|
onBack: t,
|
|
924
924
|
showBackButton: s,
|
|
925
925
|
onShowInfo: n,
|
|
926
|
-
canShowInfo:
|
|
926
|
+
canShowInfo: o,
|
|
927
927
|
showStarButton: l = !1
|
|
928
928
|
}) => {
|
|
929
|
-
var
|
|
930
|
-
const { channel:
|
|
931
|
-
(
|
|
932
|
-
var
|
|
933
|
-
return ((
|
|
929
|
+
var p, r, E, S, v, k;
|
|
930
|
+
const { channel: d } = we(), a = j.useMemo(() => Object.values(d.state.members || {}).find(
|
|
931
|
+
(m) => {
|
|
932
|
+
var w;
|
|
933
|
+
return ((w = m.user) == null ? void 0 : w.id) && m.user.id !== d._client.userID;
|
|
934
934
|
}
|
|
935
|
-
), [
|
|
936
|
-
!!((S =
|
|
935
|
+
), [d._client.userID, d.state.members]), u = ((p = a == null ? void 0 : a.user) == null ? void 0 : p.name) || ((r = a == null ? void 0 : a.user) == null ? void 0 : r.id) || "Unknown member", f = (E = a == null ? void 0 : a.user) == null ? void 0 : E.image, [g, N] = _(
|
|
936
|
+
!!((S = d.state.membership) != null && S.pinned_at)
|
|
937
937
|
);
|
|
938
|
-
|
|
939
|
-
const
|
|
940
|
-
var
|
|
941
|
-
|
|
942
|
-
|
|
938
|
+
Z(() => {
|
|
939
|
+
const b = (m) => {
|
|
940
|
+
var w;
|
|
941
|
+
N(
|
|
942
|
+
m != null && m.member ? !!m.member.pinned_at : !!((w = d.state.membership) != null && w.pinned_at)
|
|
943
943
|
);
|
|
944
944
|
};
|
|
945
|
-
return
|
|
946
|
-
|
|
945
|
+
return d.on("member.updated", b), () => {
|
|
946
|
+
d.off("member.updated", b);
|
|
947
947
|
};
|
|
948
|
-
}, [
|
|
949
|
-
const
|
|
948
|
+
}, [d]);
|
|
949
|
+
const C = async () => {
|
|
950
950
|
try {
|
|
951
|
-
|
|
952
|
-
} catch (
|
|
951
|
+
g ? await d.unpin() : await d.pin();
|
|
952
|
+
} catch (b) {
|
|
953
953
|
console.error(
|
|
954
954
|
"[CustomChannelHeader] Failed to update pinned status:",
|
|
955
|
-
|
|
955
|
+
b
|
|
956
956
|
);
|
|
957
957
|
}
|
|
958
958
|
};
|
|
@@ -961,23 +961,23 @@ const xt = ({
|
|
|
961
961
|
/* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: s && /* @__PURE__ */ e(
|
|
962
962
|
"button",
|
|
963
963
|
{
|
|
964
|
-
className:
|
|
964
|
+
className: R(
|
|
965
965
|
"size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center"
|
|
966
966
|
),
|
|
967
967
|
onClick: t || (() => {
|
|
968
968
|
}),
|
|
969
969
|
type: "button",
|
|
970
970
|
"aria-label": "Back to conversations",
|
|
971
|
-
children: /* @__PURE__ */ e(
|
|
971
|
+
children: /* @__PURE__ */ e(_e, { className: "size-5 text-black/90" })
|
|
972
972
|
}
|
|
973
973
|
) }),
|
|
974
974
|
/* @__PURE__ */ i("div", { className: "flex flex-col gap-1 items-center", children: [
|
|
975
975
|
/* @__PURE__ */ e(
|
|
976
|
-
|
|
976
|
+
K,
|
|
977
977
|
{
|
|
978
|
-
id: ((
|
|
978
|
+
id: ((v = a == null ? void 0 : a.user) == null ? void 0 : v.id) || d.id || "unknown",
|
|
979
979
|
name: u,
|
|
980
|
-
image:
|
|
980
|
+
image: f,
|
|
981
981
|
size: 40
|
|
982
982
|
}
|
|
983
983
|
),
|
|
@@ -988,17 +988,17 @@ const xt = ({
|
|
|
988
988
|
"button",
|
|
989
989
|
{
|
|
990
990
|
className: "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
|
|
991
|
-
onClick:
|
|
991
|
+
onClick: C,
|
|
992
992
|
type: "button",
|
|
993
|
-
"aria-label":
|
|
993
|
+
"aria-label": g ? "Unstar conversation" : "Star conversation",
|
|
994
994
|
children: /* @__PURE__ */ e(
|
|
995
|
-
|
|
995
|
+
Se,
|
|
996
996
|
{
|
|
997
|
-
className:
|
|
998
|
-
"text-yellow-600":
|
|
999
|
-
"text-black/90": !
|
|
997
|
+
className: R("size-5", {
|
|
998
|
+
"text-yellow-600": g,
|
|
999
|
+
"text-black/90": !g
|
|
1000
1000
|
}),
|
|
1001
|
-
weight:
|
|
1001
|
+
weight: g ? "duotone" : "regular"
|
|
1002
1002
|
}
|
|
1003
1003
|
)
|
|
1004
1004
|
}
|
|
@@ -1010,7 +1010,7 @@ const xt = ({
|
|
|
1010
1010
|
onClick: n,
|
|
1011
1011
|
type: "button",
|
|
1012
1012
|
"aria-label": "Show info",
|
|
1013
|
-
children: /* @__PURE__ */ e(
|
|
1013
|
+
children: /* @__PURE__ */ e(Me, { className: "size-5 text-black/90" })
|
|
1014
1014
|
}
|
|
1015
1015
|
)
|
|
1016
1016
|
] })
|
|
@@ -1024,15 +1024,15 @@ const xt = ({
|
|
|
1024
1024
|
onClick: t,
|
|
1025
1025
|
className: "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
|
|
1026
1026
|
"aria-label": "Back to conversations",
|
|
1027
|
-
children: /* @__PURE__ */ e(
|
|
1027
|
+
children: /* @__PURE__ */ e(_e, { className: "size-5 text-black/90" })
|
|
1028
1028
|
}
|
|
1029
1029
|
),
|
|
1030
1030
|
/* @__PURE__ */ e(
|
|
1031
|
-
|
|
1031
|
+
K,
|
|
1032
1032
|
{
|
|
1033
|
-
id: ((
|
|
1033
|
+
id: ((k = a == null ? void 0 : a.user) == null ? void 0 : k.id) || d.id || "unknown",
|
|
1034
1034
|
name: u,
|
|
1035
|
-
image:
|
|
1035
|
+
image: f,
|
|
1036
1036
|
size: 40
|
|
1037
1037
|
}
|
|
1038
1038
|
),
|
|
@@ -1043,115 +1043,116 @@ const xt = ({
|
|
|
1043
1043
|
"button",
|
|
1044
1044
|
{
|
|
1045
1045
|
className: "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
|
|
1046
|
-
onClick:
|
|
1046
|
+
onClick: C,
|
|
1047
1047
|
type: "button",
|
|
1048
|
-
"aria-label":
|
|
1048
|
+
"aria-label": g ? "Unstar conversation" : "Star conversation",
|
|
1049
1049
|
children: /* @__PURE__ */ e(
|
|
1050
|
-
|
|
1050
|
+
Se,
|
|
1051
1051
|
{
|
|
1052
|
-
className:
|
|
1053
|
-
"text-yellow-600":
|
|
1054
|
-
"text-black/90": !
|
|
1052
|
+
className: R("size-5", {
|
|
1053
|
+
"text-yellow-600": g,
|
|
1054
|
+
"text-black/90": !g
|
|
1055
1055
|
}),
|
|
1056
|
-
weight:
|
|
1056
|
+
weight: g ? "duotone" : "regular"
|
|
1057
1057
|
}
|
|
1058
1058
|
)
|
|
1059
1059
|
}
|
|
1060
1060
|
),
|
|
1061
|
-
|
|
1061
|
+
o && n && /* @__PURE__ */ e(
|
|
1062
1062
|
"button",
|
|
1063
1063
|
{
|
|
1064
1064
|
className: "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
|
|
1065
1065
|
onClick: n,
|
|
1066
1066
|
type: "button",
|
|
1067
1067
|
"aria-label": "Show info",
|
|
1068
|
-
children: /* @__PURE__ */ e(
|
|
1068
|
+
children: /* @__PURE__ */ e(Me, { className: "size-5 text-black/90" })
|
|
1069
1069
|
}
|
|
1070
1070
|
)
|
|
1071
1071
|
] })
|
|
1072
1072
|
] })
|
|
1073
1073
|
] });
|
|
1074
|
-
},
|
|
1074
|
+
}, Ct = ({
|
|
1075
1075
|
dialogRef: t,
|
|
1076
1076
|
onClose: s,
|
|
1077
1077
|
participant: n,
|
|
1078
|
-
channel:
|
|
1078
|
+
channel: o,
|
|
1079
1079
|
followerStatusLabel: l,
|
|
1080
|
-
onLeaveConversation:
|
|
1081
|
-
onBlockParticipant:
|
|
1080
|
+
onLeaveConversation: d,
|
|
1081
|
+
onBlockParticipant: a,
|
|
1082
1082
|
showDeleteConversation: u = !0,
|
|
1083
|
-
onDeleteConversationClick:
|
|
1084
|
-
onBlockParticipantClick:
|
|
1085
|
-
onReportParticipantClick:
|
|
1083
|
+
onDeleteConversationClick: f,
|
|
1084
|
+
onBlockParticipantClick: g,
|
|
1085
|
+
onReportParticipantClick: N,
|
|
1086
|
+
customChannelActions: C
|
|
1086
1087
|
}) => {
|
|
1087
|
-
var
|
|
1088
|
-
const { service:
|
|
1089
|
-
var
|
|
1090
|
-
if (!(!
|
|
1088
|
+
var ee, Y, se, te, re, V, J;
|
|
1089
|
+
const { service: p, debug: r } = fe(), [E, S] = _(!1), [v, k] = _(!1), [b, m] = _(!1), w = L(async () => {
|
|
1090
|
+
var P;
|
|
1091
|
+
if (!(!p || !((P = n == null ? void 0 : n.user) != null && P.id)))
|
|
1091
1092
|
try {
|
|
1092
|
-
const
|
|
1093
|
-
(
|
|
1094
|
-
var
|
|
1095
|
-
return
|
|
1093
|
+
const H = (await p.getBlockedUsers()).some(
|
|
1094
|
+
(F) => {
|
|
1095
|
+
var W;
|
|
1096
|
+
return F.blocked_user_id === ((W = n == null ? void 0 : n.user) == null ? void 0 : W.id);
|
|
1096
1097
|
}
|
|
1097
1098
|
);
|
|
1098
|
-
|
|
1099
|
-
} catch (
|
|
1099
|
+
S(H);
|
|
1100
|
+
} catch (O) {
|
|
1100
1101
|
console.error(
|
|
1101
1102
|
"[ChannelInfoDialog] Failed to check blocked status:",
|
|
1102
|
-
|
|
1103
|
+
O
|
|
1103
1104
|
);
|
|
1104
1105
|
}
|
|
1105
|
-
}, [
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
}, [
|
|
1109
|
-
const
|
|
1110
|
-
var
|
|
1111
|
-
if (!
|
|
1112
|
-
|
|
1106
|
+
}, [p, (ee = n == null ? void 0 : n.user) == null ? void 0 : ee.id]);
|
|
1107
|
+
Z(() => {
|
|
1108
|
+
w();
|
|
1109
|
+
}, [w]);
|
|
1110
|
+
const D = async () => {
|
|
1111
|
+
var P;
|
|
1112
|
+
if (!v) {
|
|
1113
|
+
f == null || f(), r && console.log("[ChannelInfoDialog] Leave conversation", o.cid), k(!0);
|
|
1113
1114
|
try {
|
|
1114
|
-
const
|
|
1115
|
-
await
|
|
1116
|
-
} catch (
|
|
1117
|
-
console.error("[ChannelInfoDialog] Failed to leave conversation",
|
|
1115
|
+
const O = ((P = o._client) == null ? void 0 : P.userID) ?? null;
|
|
1116
|
+
await o.hide(O, !1), d && await d(o), s();
|
|
1117
|
+
} catch (O) {
|
|
1118
|
+
console.error("[ChannelInfoDialog] Failed to leave conversation", O);
|
|
1118
1119
|
} finally {
|
|
1119
|
-
|
|
1120
|
+
k(!1);
|
|
1120
1121
|
}
|
|
1121
1122
|
}
|
|
1122
|
-
},
|
|
1123
|
-
var
|
|
1124
|
-
if (!(
|
|
1125
|
-
|
|
1123
|
+
}, h = async () => {
|
|
1124
|
+
var P, O, H;
|
|
1125
|
+
if (!(b || !p)) {
|
|
1126
|
+
g == null || g(), r && console.log("[ChannelInfoDialog] Block member", (P = n == null ? void 0 : n.user) == null ? void 0 : P.id), m(!0);
|
|
1126
1127
|
try {
|
|
1127
|
-
await
|
|
1128
|
-
} catch (
|
|
1129
|
-
console.error("[ChannelInfoDialog] Failed to block member",
|
|
1128
|
+
await p.blockUser((O = n == null ? void 0 : n.user) == null ? void 0 : O.id), a && await a((H = n == null ? void 0 : n.user) == null ? void 0 : H.id), s();
|
|
1129
|
+
} catch (F) {
|
|
1130
|
+
console.error("[ChannelInfoDialog] Failed to block member", F);
|
|
1130
1131
|
} finally {
|
|
1131
|
-
|
|
1132
|
+
m(!1);
|
|
1132
1133
|
}
|
|
1133
1134
|
}
|
|
1134
|
-
},
|
|
1135
|
-
var
|
|
1136
|
-
if (!(
|
|
1137
|
-
|
|
1135
|
+
}, c = async () => {
|
|
1136
|
+
var P, O, H;
|
|
1137
|
+
if (!(b || !p)) {
|
|
1138
|
+
g == null || g(), r && console.log("[ChannelInfoDialog] Unblock member", (P = n == null ? void 0 : n.user) == null ? void 0 : P.id), m(!0);
|
|
1138
1139
|
try {
|
|
1139
|
-
await
|
|
1140
|
-
} catch (
|
|
1141
|
-
console.error("[ChannelInfoDialog] Failed to unblock member",
|
|
1140
|
+
await p.unBlockUser((O = n == null ? void 0 : n.user) == null ? void 0 : O.id), a && await a((H = n == null ? void 0 : n.user) == null ? void 0 : H.id), s();
|
|
1141
|
+
} catch (F) {
|
|
1142
|
+
console.error("[ChannelInfoDialog] Failed to unblock member", F);
|
|
1142
1143
|
} finally {
|
|
1143
|
-
|
|
1144
|
+
m(!1);
|
|
1144
1145
|
}
|
|
1145
1146
|
}
|
|
1146
|
-
},
|
|
1147
|
-
|
|
1147
|
+
}, x = () => {
|
|
1148
|
+
N == null || N(), s(), window.open(
|
|
1148
1149
|
"https://linktr.ee/s/about/trust-center/report",
|
|
1149
1150
|
"_blank",
|
|
1150
1151
|
"noopener,noreferrer"
|
|
1151
1152
|
);
|
|
1152
1153
|
};
|
|
1153
1154
|
if (!n) return null;
|
|
1154
|
-
const
|
|
1155
|
+
const B = ((Y = n.user) == null ? void 0 : Y.name) || ((se = n.user) == null ? void 0 : se.id) || "Unknown member", I = (te = n.user) == null ? void 0 : te.image, T = (re = n.user) == null ? void 0 : re.email, M = (V = n.user) == null ? void 0 : V.username, G = T || (M ? `linktr.ee/${M}` : void 0), z = ((J = n.user) == null ? void 0 : J.id) || "unknown";
|
|
1155
1156
|
return (
|
|
1156
1157
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
|
|
1157
1158
|
/* @__PURE__ */ e(
|
|
@@ -1160,13 +1161,13 @@ const xt = ({
|
|
|
1160
1161
|
ref: t,
|
|
1161
1162
|
className: "mes-dialog group",
|
|
1162
1163
|
onClose: s,
|
|
1163
|
-
onClick: (
|
|
1164
|
-
|
|
1164
|
+
onClick: (P) => {
|
|
1165
|
+
P.target === t.current && s();
|
|
1165
1166
|
},
|
|
1166
1167
|
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: [
|
|
1167
1168
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between border-b border-sand px-4 py-3", children: [
|
|
1168
1169
|
/* @__PURE__ */ e("h2", { className: "text-base font-semibold text-charcoal", children: "Chat info" }),
|
|
1169
|
-
/* @__PURE__ */ e(
|
|
1170
|
+
/* @__PURE__ */ e(Ae, { onClick: s })
|
|
1170
1171
|
] }),
|
|
1171
1172
|
/* @__PURE__ */ i("div", { className: "flex-1 px-2 overflow-y-auto w-full", children: [
|
|
1172
1173
|
/* @__PURE__ */ e(
|
|
@@ -1176,18 +1177,18 @@ const xt = ({
|
|
|
1176
1177
|
style: { backgroundColor: "#FBFAF9" },
|
|
1177
1178
|
children: /* @__PURE__ */ i("div", { className: "flex items-center gap-3 w-full", children: [
|
|
1178
1179
|
/* @__PURE__ */ e(
|
|
1179
|
-
|
|
1180
|
+
K,
|
|
1180
1181
|
{
|
|
1181
|
-
id:
|
|
1182
|
-
name:
|
|
1183
|
-
image:
|
|
1182
|
+
id: z,
|
|
1183
|
+
name: B,
|
|
1184
|
+
image: I,
|
|
1184
1185
|
size: 88,
|
|
1185
1186
|
shape: "circle"
|
|
1186
1187
|
}
|
|
1187
1188
|
),
|
|
1188
1189
|
/* @__PURE__ */ i("div", { className: "flex flex-col min-w-0 flex-1", children: [
|
|
1189
|
-
/* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children:
|
|
1190
|
-
|
|
1190
|
+
/* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: B }),
|
|
1191
|
+
G && /* @__PURE__ */ e("p", { className: "truncate text-sm text-[#00000055]", children: G }),
|
|
1191
1192
|
l && /* @__PURE__ */ e(
|
|
1192
1193
|
"span",
|
|
1193
1194
|
{
|
|
@@ -1210,101 +1211,103 @@ const xt = ({
|
|
|
1210
1211
|
u && /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(
|
|
1211
1212
|
de,
|
|
1212
1213
|
{
|
|
1213
|
-
onClick:
|
|
1214
|
-
disabled:
|
|
1215
|
-
"aria-busy":
|
|
1214
|
+
onClick: D,
|
|
1215
|
+
disabled: v,
|
|
1216
|
+
"aria-busy": v,
|
|
1216
1217
|
children: [
|
|
1217
|
-
|
|
1218
|
+
v ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(zs, { className: "h-5 w-5" }),
|
|
1218
1219
|
/* @__PURE__ */ e("span", { children: "Delete Conversation" })
|
|
1219
1220
|
]
|
|
1220
1221
|
}
|
|
1221
1222
|
) }),
|
|
1222
|
-
/* @__PURE__ */ e("li", { children:
|
|
1223
|
+
/* @__PURE__ */ e("li", { children: E ? /* @__PURE__ */ i(
|
|
1223
1224
|
de,
|
|
1224
1225
|
{
|
|
1225
|
-
onClick:
|
|
1226
|
-
disabled:
|
|
1227
|
-
"aria-busy":
|
|
1226
|
+
onClick: c,
|
|
1227
|
+
disabled: b,
|
|
1228
|
+
"aria-busy": b,
|
|
1228
1229
|
children: [
|
|
1229
|
-
|
|
1230
|
+
b ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(ke, { className: "h-5 w-5" }),
|
|
1230
1231
|
/* @__PURE__ */ e("span", { children: "Unblock" })
|
|
1231
1232
|
]
|
|
1232
1233
|
}
|
|
1233
1234
|
) : /* @__PURE__ */ i(
|
|
1234
1235
|
de,
|
|
1235
1236
|
{
|
|
1236
|
-
onClick:
|
|
1237
|
-
disabled:
|
|
1238
|
-
"aria-busy":
|
|
1237
|
+
onClick: h,
|
|
1238
|
+
disabled: b,
|
|
1239
|
+
"aria-busy": b,
|
|
1239
1240
|
children: [
|
|
1240
|
-
|
|
1241
|
+
b ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(ke, { className: "h-5 w-5" }),
|
|
1241
1242
|
/* @__PURE__ */ e("span", { children: "Block" })
|
|
1242
1243
|
]
|
|
1243
1244
|
}
|
|
1244
1245
|
) }),
|
|
1245
|
-
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(de, { variant: "danger", onClick:
|
|
1246
|
-
/* @__PURE__ */ e(
|
|
1246
|
+
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(de, { variant: "danger", onClick: x, children: [
|
|
1247
|
+
/* @__PURE__ */ e(Hs, { className: "h-5 w-5" }),
|
|
1247
1248
|
/* @__PURE__ */ e("span", { children: "Report" })
|
|
1248
|
-
] }) })
|
|
1249
|
+
] }) }),
|
|
1250
|
+
C
|
|
1249
1251
|
] })
|
|
1250
1252
|
] })
|
|
1251
1253
|
] })
|
|
1252
1254
|
}
|
|
1253
1255
|
)
|
|
1254
1256
|
);
|
|
1255
|
-
},
|
|
1257
|
+
}, Nt = ({
|
|
1256
1258
|
onBack: t,
|
|
1257
1259
|
showBackButton: s,
|
|
1258
1260
|
renderMessageInputActions: n,
|
|
1259
|
-
onLeaveConversation:
|
|
1261
|
+
onLeaveConversation: o,
|
|
1260
1262
|
onBlockParticipant: l,
|
|
1261
|
-
showDeleteConversation:
|
|
1262
|
-
onDeleteConversationClick:
|
|
1263
|
+
showDeleteConversation: d = !0,
|
|
1264
|
+
onDeleteConversationClick: a,
|
|
1263
1265
|
onBlockParticipantClick: u,
|
|
1264
|
-
onReportParticipantClick:
|
|
1265
|
-
showStarButton:
|
|
1266
|
-
chatbotVotingEnabled:
|
|
1267
|
-
renderChannelBanner:
|
|
1266
|
+
onReportParticipantClick: f,
|
|
1267
|
+
showStarButton: g = !1,
|
|
1268
|
+
chatbotVotingEnabled: N = !1,
|
|
1269
|
+
renderChannelBanner: C,
|
|
1270
|
+
customChannelActions: p
|
|
1268
1271
|
}) => {
|
|
1269
|
-
const { channel:
|
|
1270
|
-
(
|
|
1271
|
-
var
|
|
1272
|
-
return ((
|
|
1272
|
+
const { channel: r } = we(), E = q(null), S = j.useMemo(() => Object.values(r.state.members || {}).find(
|
|
1273
|
+
(w) => {
|
|
1274
|
+
var D;
|
|
1275
|
+
return ((D = w.user) == null ? void 0 : D.id) && w.user.id !== r._client.userID;
|
|
1273
1276
|
}
|
|
1274
|
-
), [
|
|
1275
|
-
const
|
|
1276
|
-
if (
|
|
1277
|
-
return String(
|
|
1278
|
-
if (
|
|
1279
|
-
return
|
|
1280
|
-
}, [
|
|
1281
|
-
var
|
|
1282
|
-
(
|
|
1283
|
-
}, []),
|
|
1284
|
-
var
|
|
1285
|
-
(
|
|
1277
|
+
), [r._client.userID, r.state.members]), v = j.useMemo(() => {
|
|
1278
|
+
const m = r.data ?? {};
|
|
1279
|
+
if (m.followerStatus)
|
|
1280
|
+
return String(m.followerStatus);
|
|
1281
|
+
if (m.isFollower !== void 0)
|
|
1282
|
+
return m.isFollower ? "Subscribed to you" : "Not subscribed";
|
|
1283
|
+
}, [r.data]), k = L(() => {
|
|
1284
|
+
var m;
|
|
1285
|
+
(m = E.current) == null || m.showModal();
|
|
1286
|
+
}, []), b = L(() => {
|
|
1287
|
+
var m;
|
|
1288
|
+
(m = E.current) == null || m.close();
|
|
1286
1289
|
}, []);
|
|
1287
1290
|
return /* @__PURE__ */ i(ve, { children: [
|
|
1288
1291
|
/* @__PURE__ */ e(
|
|
1289
|
-
|
|
1292
|
+
Us,
|
|
1290
1293
|
{
|
|
1291
1294
|
overrides: {
|
|
1292
|
-
Message: (
|
|
1295
|
+
Message: (m) => /* @__PURE__ */ e(it, { ...m, chatbotVotingEnabled: N })
|
|
1293
1296
|
},
|
|
1294
|
-
children: /* @__PURE__ */ i(
|
|
1297
|
+
children: /* @__PURE__ */ i(Bs, { children: [
|
|
1295
1298
|
/* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ e(
|
|
1296
|
-
|
|
1299
|
+
bt,
|
|
1297
1300
|
{
|
|
1298
1301
|
onBack: t,
|
|
1299
1302
|
showBackButton: s,
|
|
1300
|
-
onShowInfo:
|
|
1301
|
-
canShowInfo: !!
|
|
1302
|
-
showStarButton:
|
|
1303
|
+
onShowInfo: k,
|
|
1304
|
+
canShowInfo: !!S,
|
|
1305
|
+
showStarButton: g
|
|
1303
1306
|
}
|
|
1304
1307
|
) }),
|
|
1305
|
-
|
|
1308
|
+
C == null ? void 0 : C(),
|
|
1306
1309
|
/* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden relative", children: /* @__PURE__ */ e(
|
|
1307
|
-
|
|
1310
|
+
js,
|
|
1308
1311
|
{
|
|
1309
1312
|
hideDeletedMessages: !0,
|
|
1310
1313
|
hideNewMessageSeparator: !1,
|
|
@@ -1312,104 +1315,107 @@ const xt = ({
|
|
|
1312
1315
|
}
|
|
1313
1316
|
) }),
|
|
1314
1317
|
/* @__PURE__ */ e(
|
|
1315
|
-
|
|
1318
|
+
ht,
|
|
1316
1319
|
{
|
|
1317
|
-
renderActions: () => n == null ? void 0 : n(
|
|
1320
|
+
renderActions: () => n == null ? void 0 : n(r)
|
|
1318
1321
|
}
|
|
1319
1322
|
)
|
|
1320
1323
|
] })
|
|
1321
1324
|
}
|
|
1322
1325
|
),
|
|
1323
1326
|
/* @__PURE__ */ e(
|
|
1324
|
-
|
|
1327
|
+
Ct,
|
|
1325
1328
|
{
|
|
1326
|
-
dialogRef:
|
|
1327
|
-
onClose:
|
|
1328
|
-
participant:
|
|
1329
|
-
channel:
|
|
1330
|
-
followerStatusLabel:
|
|
1331
|
-
onLeaveConversation:
|
|
1329
|
+
dialogRef: E,
|
|
1330
|
+
onClose: b,
|
|
1331
|
+
participant: S,
|
|
1332
|
+
channel: r,
|
|
1333
|
+
followerStatusLabel: v,
|
|
1334
|
+
onLeaveConversation: o,
|
|
1332
1335
|
onBlockParticipant: l,
|
|
1333
|
-
showDeleteConversation:
|
|
1334
|
-
onDeleteConversationClick:
|
|
1336
|
+
showDeleteConversation: d,
|
|
1337
|
+
onDeleteConversationClick: a,
|
|
1335
1338
|
onBlockParticipantClick: u,
|
|
1336
|
-
onReportParticipantClick:
|
|
1339
|
+
onReportParticipantClick: f,
|
|
1340
|
+
customChannelActions: p
|
|
1337
1341
|
}
|
|
1338
1342
|
)
|
|
1339
1343
|
] });
|
|
1340
|
-
},
|
|
1344
|
+
}, $e = j.memo(
|
|
1341
1345
|
({
|
|
1342
1346
|
channel: t,
|
|
1343
1347
|
onBack: s,
|
|
1344
1348
|
showBackButton: n = !1,
|
|
1345
|
-
renderMessageInputActions:
|
|
1349
|
+
renderMessageInputActions: o,
|
|
1346
1350
|
onLeaveConversation: l,
|
|
1347
|
-
onBlockParticipant:
|
|
1348
|
-
className:
|
|
1349
|
-
CustomChannelEmptyState: u =
|
|
1350
|
-
showDeleteConversation:
|
|
1351
|
-
onDeleteConversationClick:
|
|
1352
|
-
onBlockParticipantClick:
|
|
1353
|
-
onReportParticipantClick:
|
|
1354
|
-
dmAgentEnabled:
|
|
1355
|
-
messageMetadata:
|
|
1356
|
-
onMessageSent:
|
|
1351
|
+
onBlockParticipant: d,
|
|
1352
|
+
className: a,
|
|
1353
|
+
CustomChannelEmptyState: u = gt,
|
|
1354
|
+
showDeleteConversation: f = !0,
|
|
1355
|
+
onDeleteConversationClick: g,
|
|
1356
|
+
onBlockParticipantClick: N,
|
|
1357
|
+
onReportParticipantClick: C,
|
|
1358
|
+
dmAgentEnabled: p,
|
|
1359
|
+
messageMetadata: r,
|
|
1360
|
+
onMessageSent: E,
|
|
1357
1361
|
showStarButton: S = !1,
|
|
1358
|
-
chatbotVotingEnabled:
|
|
1359
|
-
renderChannelBanner:
|
|
1362
|
+
chatbotVotingEnabled: v = !1,
|
|
1363
|
+
renderChannelBanner: k,
|
|
1364
|
+
customChannelActions: b
|
|
1360
1365
|
}) => {
|
|
1361
|
-
const
|
|
1362
|
-
async (
|
|
1363
|
-
var
|
|
1364
|
-
const
|
|
1365
|
-
...
|
|
1366
|
-
...
|
|
1367
|
-
...
|
|
1366
|
+
const m = L(
|
|
1367
|
+
async (w, D, h) => {
|
|
1368
|
+
var M;
|
|
1369
|
+
const c = ((M = t.data) == null ? void 0 : M.chatbot_paused) === !0, x = p && !c, B = {
|
|
1370
|
+
...D,
|
|
1371
|
+
...x && { silent: !0 },
|
|
1372
|
+
...r && {
|
|
1368
1373
|
metadata: {
|
|
1369
|
-
...
|
|
1370
|
-
...
|
|
1374
|
+
...D.metadata ?? {},
|
|
1375
|
+
...r
|
|
1371
1376
|
}
|
|
1372
1377
|
}
|
|
1373
|
-
},
|
|
1374
|
-
...
|
|
1375
|
-
...
|
|
1376
|
-
},
|
|
1377
|
-
return
|
|
1378
|
+
}, I = {
|
|
1379
|
+
...h,
|
|
1380
|
+
...x && { skip_push: !0 }
|
|
1381
|
+
}, T = await t.sendMessage(B, I);
|
|
1382
|
+
return E == null || E(T), T;
|
|
1378
1383
|
},
|
|
1379
|
-
[t,
|
|
1384
|
+
[t, p, r, E]
|
|
1380
1385
|
);
|
|
1381
1386
|
return /* @__PURE__ */ e(
|
|
1382
1387
|
"div",
|
|
1383
1388
|
{
|
|
1384
|
-
className:
|
|
1389
|
+
className: R(
|
|
1385
1390
|
"messaging-channel-view h-full flex flex-col",
|
|
1386
|
-
|
|
1391
|
+
a
|
|
1387
1392
|
),
|
|
1388
1393
|
children: /* @__PURE__ */ e(
|
|
1389
|
-
|
|
1394
|
+
Os,
|
|
1390
1395
|
{
|
|
1391
1396
|
channel: t,
|
|
1392
|
-
MessageSystem:
|
|
1397
|
+
MessageSystem: ft,
|
|
1393
1398
|
EmptyStateIndicator: u,
|
|
1394
1399
|
LoadingIndicator: he,
|
|
1395
|
-
DateSeparator:
|
|
1396
|
-
doSendMessageRequest:
|
|
1400
|
+
DateSeparator: et,
|
|
1401
|
+
doSendMessageRequest: m,
|
|
1397
1402
|
children: /* @__PURE__ */ e(
|
|
1398
|
-
|
|
1403
|
+
Nt,
|
|
1399
1404
|
{
|
|
1400
1405
|
onBack: s,
|
|
1401
1406
|
showBackButton: n,
|
|
1402
|
-
renderMessageInputActions:
|
|
1407
|
+
renderMessageInputActions: o,
|
|
1403
1408
|
onLeaveConversation: l,
|
|
1404
|
-
onBlockParticipant:
|
|
1409
|
+
onBlockParticipant: d,
|
|
1405
1410
|
CustomChannelEmptyState: u,
|
|
1406
|
-
showDeleteConversation:
|
|
1407
|
-
onDeleteConversationClick:
|
|
1408
|
-
onBlockParticipantClick:
|
|
1409
|
-
onReportParticipantClick:
|
|
1411
|
+
showDeleteConversation: f,
|
|
1412
|
+
onDeleteConversationClick: g,
|
|
1413
|
+
onBlockParticipantClick: N,
|
|
1414
|
+
onReportParticipantClick: C,
|
|
1410
1415
|
showStarButton: S,
|
|
1411
|
-
chatbotVotingEnabled:
|
|
1412
|
-
renderChannelBanner:
|
|
1416
|
+
chatbotVotingEnabled: v,
|
|
1417
|
+
renderChannelBanner: k,
|
|
1418
|
+
customChannelActions: b
|
|
1413
1419
|
}
|
|
1414
1420
|
)
|
|
1415
1421
|
}
|
|
@@ -1418,16 +1424,16 @@ const xt = ({
|
|
|
1418
1424
|
);
|
|
1419
1425
|
}
|
|
1420
1426
|
);
|
|
1421
|
-
|
|
1422
|
-
function
|
|
1427
|
+
$e.displayName = "ChannelView";
|
|
1428
|
+
function vt({
|
|
1423
1429
|
searchQuery: t,
|
|
1424
1430
|
setSearchQuery: s,
|
|
1425
1431
|
placeholder: n
|
|
1426
1432
|
}) {
|
|
1427
|
-
const
|
|
1433
|
+
const o = q(null);
|
|
1428
1434
|
return /* @__PURE__ */ i("div", { className: "relative", children: [
|
|
1429
1435
|
/* @__PURE__ */ e(
|
|
1430
|
-
|
|
1436
|
+
Gs,
|
|
1431
1437
|
{
|
|
1432
1438
|
className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-stone",
|
|
1433
1439
|
weight: "bold"
|
|
@@ -1436,7 +1442,7 @@ function Nt({
|
|
|
1436
1442
|
/* @__PURE__ */ e(
|
|
1437
1443
|
"input",
|
|
1438
1444
|
{
|
|
1439
|
-
ref:
|
|
1445
|
+
ref: o,
|
|
1440
1446
|
type: "text",
|
|
1441
1447
|
placeholder: n,
|
|
1442
1448
|
value: t,
|
|
@@ -1445,12 +1451,12 @@ function Nt({
|
|
|
1445
1451
|
}
|
|
1446
1452
|
),
|
|
1447
1453
|
t && /* @__PURE__ */ e(
|
|
1448
|
-
|
|
1454
|
+
je,
|
|
1449
1455
|
{
|
|
1450
1456
|
label: "Clear search",
|
|
1451
1457
|
onClick: () => {
|
|
1452
1458
|
var l;
|
|
1453
|
-
s(""), (l =
|
|
1459
|
+
s(""), (l = o.current) == null || l.focus();
|
|
1454
1460
|
},
|
|
1455
1461
|
className: "absolute right-3 top-1/2 -translate-y-1/2 p-1 text-stone hover:text-charcoal",
|
|
1456
1462
|
children: /* @__PURE__ */ e(pe, { className: "h-4 w-4", weight: "bold" })
|
|
@@ -1458,144 +1464,144 @@ function Nt({
|
|
|
1458
1464
|
)
|
|
1459
1465
|
] });
|
|
1460
1466
|
}
|
|
1461
|
-
const
|
|
1467
|
+
const wt = ({
|
|
1462
1468
|
participantSource: t,
|
|
1463
1469
|
onSelectParticipant: s,
|
|
1464
1470
|
onClose: n,
|
|
1465
|
-
existingParticipantIds:
|
|
1471
|
+
existingParticipantIds: o = /* @__PURE__ */ new Set(),
|
|
1466
1472
|
participantLabel: l = "participants",
|
|
1467
|
-
searchPlaceholder:
|
|
1468
|
-
className:
|
|
1473
|
+
searchPlaceholder: d = "Search participants...",
|
|
1474
|
+
className: a
|
|
1469
1475
|
}) => {
|
|
1470
|
-
const { debug: u } = fe(), [
|
|
1476
|
+
const { debug: u } = fe(), [f, g] = _(""), [N, C] = _([]), [p, r] = _(!1), [E, S] = _(null), [v, k] = _(
|
|
1471
1477
|
null
|
|
1472
|
-
),
|
|
1473
|
-
|
|
1478
|
+
), b = q(!1);
|
|
1479
|
+
Z(() => {
|
|
1474
1480
|
if (t.loading) {
|
|
1475
1481
|
u && console.log(
|
|
1476
1482
|
"[ParticipantPicker] Waiting for participant source to finish loading..."
|
|
1477
1483
|
);
|
|
1478
1484
|
return;
|
|
1479
1485
|
}
|
|
1480
|
-
if (
|
|
1486
|
+
if (b.current) return;
|
|
1481
1487
|
(async () => {
|
|
1482
|
-
u && console.log("[ParticipantPicker] Loading initial participants..."),
|
|
1488
|
+
u && console.log("[ParticipantPicker] Loading initial participants..."), r(!0), S(null);
|
|
1483
1489
|
try {
|
|
1484
|
-
const
|
|
1490
|
+
const c = await t.loadParticipants({
|
|
1485
1491
|
search: "",
|
|
1486
1492
|
// Load all participants initially
|
|
1487
1493
|
limit: 100
|
|
1488
1494
|
});
|
|
1489
|
-
|
|
1495
|
+
C(c.participants), b.current = !0, u && console.log(
|
|
1490
1496
|
"[ParticipantPicker] Participants loaded successfully:",
|
|
1491
|
-
|
|
1497
|
+
c.participants.length
|
|
1492
1498
|
);
|
|
1493
|
-
} catch (
|
|
1494
|
-
const
|
|
1495
|
-
S(
|
|
1499
|
+
} catch (c) {
|
|
1500
|
+
const x = c instanceof Error ? c.message : "Failed to load participants";
|
|
1501
|
+
S(x), console.error("[ParticipantPicker] Failed to load participants:", c);
|
|
1496
1502
|
} finally {
|
|
1497
|
-
|
|
1503
|
+
r(!1);
|
|
1498
1504
|
}
|
|
1499
1505
|
})();
|
|
1500
1506
|
}, [t.loading, u]);
|
|
1501
|
-
const
|
|
1502
|
-
var
|
|
1503
|
-
if (!
|
|
1504
|
-
const
|
|
1505
|
-
return
|
|
1506
|
-
}),
|
|
1507
|
-
async (
|
|
1508
|
-
if (!
|
|
1509
|
-
|
|
1507
|
+
const m = N.filter((h) => !o.has(h.id)).filter((h) => {
|
|
1508
|
+
var x;
|
|
1509
|
+
if (!f) return !0;
|
|
1510
|
+
const c = f.toLowerCase();
|
|
1511
|
+
return h.name.toLowerCase().includes(c) || ((x = h.email) == null ? void 0 : x.toLowerCase().includes(c)) || !1;
|
|
1512
|
+
}), w = L(
|
|
1513
|
+
async (h) => {
|
|
1514
|
+
if (!v) {
|
|
1515
|
+
k(h.id);
|
|
1510
1516
|
try {
|
|
1511
|
-
await s(
|
|
1512
|
-
} catch (
|
|
1513
|
-
console.error("[ParticipantPicker] Failed to start chat:",
|
|
1517
|
+
await s(h);
|
|
1518
|
+
} catch (c) {
|
|
1519
|
+
console.error("[ParticipantPicker] Failed to start chat:", c), k(null);
|
|
1514
1520
|
}
|
|
1515
1521
|
}
|
|
1516
1522
|
},
|
|
1517
|
-
[s,
|
|
1518
|
-
),
|
|
1519
|
-
(
|
|
1523
|
+
[s, v]
|
|
1524
|
+
), D = (h, c) => {
|
|
1525
|
+
(h.key === "Enter" || h.key === " ") && (h.preventDefault(), w(c));
|
|
1520
1526
|
};
|
|
1521
|
-
return /* @__PURE__ */ i("div", { className:
|
|
1527
|
+
return /* @__PURE__ */ i("div", { className: R("flex flex-col h-full", a), children: [
|
|
1522
1528
|
/* @__PURE__ */ i("div", { className: "px-4 py-4 border-b border-sand bg-chalk", children: [
|
|
1523
1529
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between mb-3", children: [
|
|
1524
1530
|
/* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-charcoal", children: "Start a new Conversation" }),
|
|
1525
|
-
/* @__PURE__ */ e(
|
|
1531
|
+
/* @__PURE__ */ e(Ae, { onClick: n })
|
|
1526
1532
|
] }),
|
|
1527
1533
|
/* @__PURE__ */ i("p", { className: "text-xs text-stone mb-3", children: [
|
|
1528
1534
|
"Select a ",
|
|
1529
1535
|
l.slice(0, -1),
|
|
1530
1536
|
" to start messaging (",
|
|
1531
|
-
|
|
1537
|
+
m.length,
|
|
1532
1538
|
" available)",
|
|
1533
1539
|
t.totalCount !== void 0 && ` • ${t.totalCount} ${l} total`
|
|
1534
1540
|
] }),
|
|
1535
1541
|
/* @__PURE__ */ e(
|
|
1536
|
-
|
|
1542
|
+
vt,
|
|
1537
1543
|
{
|
|
1538
|
-
searchQuery:
|
|
1539
|
-
setSearchQuery:
|
|
1540
|
-
placeholder:
|
|
1544
|
+
searchQuery: f,
|
|
1545
|
+
setSearchQuery: g,
|
|
1546
|
+
placeholder: d
|
|
1541
1547
|
}
|
|
1542
1548
|
)
|
|
1543
1549
|
] }),
|
|
1544
|
-
|
|
1550
|
+
E && /* @__PURE__ */ i("div", { className: "p-4 text-sm text-danger bg-danger-alt", children: [
|
|
1545
1551
|
"Error loading ",
|
|
1546
1552
|
l,
|
|
1547
1553
|
": ",
|
|
1548
|
-
|
|
1554
|
+
E
|
|
1549
1555
|
] }),
|
|
1550
|
-
/* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children:
|
|
1556
|
+
/* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: p && m.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: [
|
|
1551
1557
|
/* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
|
|
1552
1558
|
/* @__PURE__ */ i("span", { className: "text-sm text-stone", children: [
|
|
1553
1559
|
"Loading ",
|
|
1554
1560
|
l,
|
|
1555
1561
|
"..."
|
|
1556
1562
|
] })
|
|
1557
|
-
] }) }) :
|
|
1558
|
-
/* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(
|
|
1559
|
-
/* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children:
|
|
1560
|
-
/* @__PURE__ */ e("p", { className: "text-xs text-stone", children:
|
|
1563
|
+
] }) }) : m.length === 0 ? /* @__PURE__ */ i("div", { className: "p-6 text-center", children: [
|
|
1564
|
+
/* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(Re, { className: "h-8 w-8 text-charcoal" }) }),
|
|
1565
|
+
/* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: f ? `No ${l} found` : N.length > 0 ? `Already chatting with all ${l}` : `No ${l} yet` }),
|
|
1566
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-stone", children: f ? "Try a different search term" : N.length > 0 ? `You have existing conversations with all your ${l}` : `${l.charAt(0).toUpperCase() + l.slice(1)} will appear here` })
|
|
1561
1567
|
] }) : /* @__PURE__ */ i("ul", { className: "space-y-0", children: [
|
|
1562
|
-
|
|
1563
|
-
const
|
|
1568
|
+
m.map((h) => {
|
|
1569
|
+
const c = h.name || h.email || h.id, x = h.email && h.name ? h.email : h.phone;
|
|
1564
1570
|
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
|
|
1565
1571
|
"button",
|
|
1566
1572
|
{
|
|
1567
1573
|
type: "button",
|
|
1568
|
-
onClick: () =>
|
|
1569
|
-
onKeyDown: (
|
|
1574
|
+
onClick: () => w(h),
|
|
1575
|
+
onKeyDown: (B) => D(B, h),
|
|
1570
1576
|
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",
|
|
1571
1577
|
children: /* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [
|
|
1572
1578
|
/* @__PURE__ */ i("div", { className: "flex items-center space-x-3 flex-1 min-w-0", children: [
|
|
1573
1579
|
/* @__PURE__ */ e(
|
|
1574
|
-
|
|
1580
|
+
K,
|
|
1575
1581
|
{
|
|
1576
|
-
id:
|
|
1577
|
-
name:
|
|
1578
|
-
image:
|
|
1582
|
+
id: h.id,
|
|
1583
|
+
name: c,
|
|
1584
|
+
image: h.image,
|
|
1579
1585
|
size: 40
|
|
1580
1586
|
}
|
|
1581
1587
|
),
|
|
1582
1588
|
/* @__PURE__ */ i("div", { className: "flex-1 min-w-0", children: [
|
|
1583
|
-
/* @__PURE__ */ e("h4", { className: "text-sm font-medium text-charcoal truncate", children:
|
|
1584
|
-
|
|
1589
|
+
/* @__PURE__ */ e("h4", { className: "text-sm font-medium text-charcoal truncate", children: c }),
|
|
1590
|
+
x && /* @__PURE__ */ e("p", { className: "text-xs text-stone truncate", children: x })
|
|
1585
1591
|
] })
|
|
1586
1592
|
] }),
|
|
1587
|
-
/* @__PURE__ */ e("div", { className: "flex-shrink-0", children:
|
|
1593
|
+
/* @__PURE__ */ e("div", { className: "flex-shrink-0", children: v === h.id ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 text-primary animate-spin" }) : /* @__PURE__ */ e(Re, { className: "h-5 w-5 text-stone" }) })
|
|
1588
1594
|
] })
|
|
1589
1595
|
}
|
|
1590
|
-
) },
|
|
1596
|
+
) }, h.id);
|
|
1591
1597
|
}),
|
|
1592
|
-
|
|
1598
|
+
p && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
|
|
1593
1599
|
/* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
|
|
1594
1600
|
/* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading more..." })
|
|
1595
1601
|
] }) })
|
|
1596
1602
|
] }) })
|
|
1597
1603
|
] });
|
|
1598
|
-
},
|
|
1604
|
+
}, pt = ({ className: t }) => /* @__PURE__ */ i(
|
|
1599
1605
|
"svg",
|
|
1600
1606
|
{
|
|
1601
1607
|
width: "140",
|
|
@@ -1729,17 +1735,17 @@ const vt = ({
|
|
|
1729
1735
|
] })
|
|
1730
1736
|
]
|
|
1731
1737
|
}
|
|
1732
|
-
),
|
|
1738
|
+
), ze = j.memo(
|
|
1733
1739
|
({ 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: [
|
|
1734
|
-
/* @__PURE__ */ e(
|
|
1740
|
+
/* @__PURE__ */ e(pt, {}),
|
|
1735
1741
|
s && !t && /* @__PURE__ */ i("div", { className: "mt-8", children: [
|
|
1736
1742
|
/* @__PURE__ */ e("h2", { className: "font-medium text-black text-[18px] mb-2", children: "Your inbox is empty" }),
|
|
1737
1743
|
/* @__PURE__ */ e("p", { className: "text-[#676B5F] text-sm mb-6", children: "Share with your followers to start receiving messages" })
|
|
1738
1744
|
] })
|
|
1739
1745
|
] }) })
|
|
1740
1746
|
);
|
|
1741
|
-
|
|
1742
|
-
const me =
|
|
1747
|
+
ze.displayName = "EmptyState";
|
|
1748
|
+
const me = j.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: [
|
|
1743
1749
|
/* @__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: "⚠️" }) }),
|
|
1744
1750
|
/* @__PURE__ */ e("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
|
|
1745
1751
|
/* @__PURE__ */ e("p", { className: "text-stone text-sm mb-6", children: t }),
|
|
@@ -1754,217 +1760,218 @@ const me = A.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { clas
|
|
|
1754
1760
|
)
|
|
1755
1761
|
] }) }));
|
|
1756
1762
|
me.displayName = "ErrorState";
|
|
1757
|
-
const
|
|
1763
|
+
const Tt = ({
|
|
1758
1764
|
capabilities: t = {},
|
|
1759
1765
|
className: s,
|
|
1760
1766
|
renderMessageInputActions: n,
|
|
1761
|
-
onChannelSelect:
|
|
1767
|
+
onChannelSelect: o,
|
|
1762
1768
|
onParticipantSelect: l,
|
|
1763
|
-
initialParticipantFilter:
|
|
1764
|
-
initialParticipantData:
|
|
1769
|
+
initialParticipantFilter: d,
|
|
1770
|
+
initialParticipantData: a,
|
|
1765
1771
|
CustomChannelEmptyState: u,
|
|
1766
|
-
showChannelList:
|
|
1767
|
-
filters:
|
|
1768
|
-
channelListCustomEmptyStateIndicator:
|
|
1769
|
-
onDeleteConversationClick:
|
|
1770
|
-
onBlockParticipantClick:
|
|
1771
|
-
onReportParticipantClick:
|
|
1772
|
-
dmAgentEnabled:
|
|
1772
|
+
showChannelList: f = !0,
|
|
1773
|
+
filters: g,
|
|
1774
|
+
channelListCustomEmptyStateIndicator: N,
|
|
1775
|
+
onDeleteConversationClick: C,
|
|
1776
|
+
onBlockParticipantClick: p,
|
|
1777
|
+
onReportParticipantClick: r,
|
|
1778
|
+
dmAgentEnabled: E,
|
|
1773
1779
|
messageMetadata: S,
|
|
1774
|
-
onMessageSent:
|
|
1775
|
-
showStarButton:
|
|
1776
|
-
chatbotVotingEnabled:
|
|
1777
|
-
renderMessagePreview:
|
|
1778
|
-
renderChannelBanner:
|
|
1780
|
+
onMessageSent: v,
|
|
1781
|
+
showStarButton: k = !1,
|
|
1782
|
+
chatbotVotingEnabled: b = !1,
|
|
1783
|
+
renderMessagePreview: m,
|
|
1784
|
+
renderChannelBanner: w,
|
|
1785
|
+
customChannelActions: D
|
|
1779
1786
|
}) => {
|
|
1780
1787
|
const {
|
|
1781
|
-
service:
|
|
1782
|
-
client:
|
|
1783
|
-
isConnected:
|
|
1784
|
-
isLoading:
|
|
1785
|
-
error:
|
|
1786
|
-
refreshConnection:
|
|
1787
|
-
debug:
|
|
1788
|
-
} =
|
|
1789
|
-
participantSource:
|
|
1790
|
-
participantLabel:
|
|
1791
|
-
showDeleteConversation:
|
|
1792
|
-
} = t,
|
|
1793
|
-
const
|
|
1788
|
+
service: h,
|
|
1789
|
+
client: c,
|
|
1790
|
+
isConnected: x,
|
|
1791
|
+
isLoading: B,
|
|
1792
|
+
error: I,
|
|
1793
|
+
refreshConnection: T,
|
|
1794
|
+
debug: M
|
|
1795
|
+
} = Vs(), [G, z] = _(null), [ee, Y] = _(!1), [se, te] = _(!1), [re, V] = _(!1), [J, P] = _(/* @__PURE__ */ new Set()), [O, H] = _(0), [F, W] = _(!1), [ae, Q] = _(null), X = q(null), {
|
|
1796
|
+
participantSource: oe,
|
|
1797
|
+
participantLabel: Ee = "participants",
|
|
1798
|
+
showDeleteConversation: He = !0
|
|
1799
|
+
} = t, Ge = j.useMemo(() => {
|
|
1800
|
+
const y = c == null ? void 0 : c.userID;
|
|
1794
1801
|
return {
|
|
1795
1802
|
...{
|
|
1796
1803
|
type: "messaging",
|
|
1797
1804
|
last_message_at: { $exists: !0 },
|
|
1798
|
-
...
|
|
1799
|
-
members: { $in: [
|
|
1805
|
+
...y && {
|
|
1806
|
+
members: { $in: [y] },
|
|
1800
1807
|
hidden: !1
|
|
1801
1808
|
}
|
|
1802
1809
|
},
|
|
1803
|
-
...
|
|
1810
|
+
...g
|
|
1804
1811
|
};
|
|
1805
|
-
}, [
|
|
1806
|
-
if (!
|
|
1807
|
-
const
|
|
1808
|
-
if (
|
|
1812
|
+
}, [g, c == null ? void 0 : c.userID]), le = q(null), ne = L(async () => {
|
|
1813
|
+
if (!c || !x) return;
|
|
1814
|
+
const y = c.userID;
|
|
1815
|
+
if (y)
|
|
1809
1816
|
try {
|
|
1810
|
-
|
|
1811
|
-
const
|
|
1817
|
+
M && console.log("[MessagingShell] Syncing channels for user:", y);
|
|
1818
|
+
const $ = await c.queryChannels(
|
|
1812
1819
|
{
|
|
1813
1820
|
type: "messaging",
|
|
1814
|
-
members: { $in: [
|
|
1821
|
+
members: { $in: [y] }
|
|
1815
1822
|
},
|
|
1816
1823
|
{},
|
|
1817
1824
|
{ limit: 100 }
|
|
1818
|
-
),
|
|
1819
|
-
|
|
1820
|
-
const ge =
|
|
1821
|
-
Object.values(ge).forEach((
|
|
1822
|
-
var
|
|
1823
|
-
const xe = (
|
|
1824
|
-
xe && xe !==
|
|
1825
|
+
), U = /* @__PURE__ */ new Set();
|
|
1826
|
+
$.forEach((A) => {
|
|
1827
|
+
const ge = A.state.members;
|
|
1828
|
+
Object.values(ge).forEach((Qe) => {
|
|
1829
|
+
var Ie;
|
|
1830
|
+
const xe = (Ie = Qe.user) == null ? void 0 : Ie.id;
|
|
1831
|
+
xe && xe !== y && U.add(xe);
|
|
1825
1832
|
});
|
|
1826
|
-
}),
|
|
1827
|
-
channelCount:
|
|
1828
|
-
memberCount:
|
|
1833
|
+
}), P((A) => A.size === U.size && [...A].every((ge) => U.has(ge)) ? A : U), Y($.length > 0), te(!0), le.current = y, M && console.log("[MessagingShell] Channels synced successfully:", {
|
|
1834
|
+
channelCount: $.length,
|
|
1835
|
+
memberCount: U.size
|
|
1829
1836
|
});
|
|
1830
|
-
} catch (
|
|
1831
|
-
console.error("[MessagingShell] Failed to sync channels:",
|
|
1837
|
+
} catch ($) {
|
|
1838
|
+
console.error("[MessagingShell] Failed to sync channels:", $);
|
|
1832
1839
|
}
|
|
1833
|
-
}, [
|
|
1834
|
-
|
|
1835
|
-
if (!
|
|
1836
|
-
const
|
|
1837
|
-
|
|
1838
|
-
}, [
|
|
1839
|
-
if (!
|
|
1840
|
+
}, [c, x, M]);
|
|
1841
|
+
Z(() => {
|
|
1842
|
+
if (!c || !x) return;
|
|
1843
|
+
const y = c.userID;
|
|
1844
|
+
y && le.current !== y && ne();
|
|
1845
|
+
}, [c, x, ne]), Z(() => {
|
|
1846
|
+
if (!d || !c || !x) return;
|
|
1840
1847
|
(async () => {
|
|
1841
|
-
const
|
|
1842
|
-
if (
|
|
1848
|
+
const $ = c.userID;
|
|
1849
|
+
if ($)
|
|
1843
1850
|
try {
|
|
1844
|
-
|
|
1851
|
+
M && console.log(
|
|
1845
1852
|
"[MessagingShell] Loading initial conversation with:",
|
|
1846
|
-
|
|
1853
|
+
d
|
|
1847
1854
|
);
|
|
1848
|
-
const
|
|
1855
|
+
const U = await c.queryChannels(
|
|
1849
1856
|
{
|
|
1850
1857
|
type: "messaging",
|
|
1851
|
-
members: { $eq: [
|
|
1858
|
+
members: { $eq: [$, d] }
|
|
1852
1859
|
},
|
|
1853
1860
|
{},
|
|
1854
1861
|
{ limit: 1 }
|
|
1855
1862
|
);
|
|
1856
|
-
if (
|
|
1857
|
-
|
|
1863
|
+
if (U.length > 0)
|
|
1864
|
+
z(U[0]), W(!0), Q(null), o && o(U[0]), M && console.log(
|
|
1858
1865
|
"[MessagingShell] Initial conversation loaded:",
|
|
1859
|
-
|
|
1866
|
+
U[0].id
|
|
1860
1867
|
);
|
|
1861
|
-
else if (
|
|
1862
|
-
|
|
1868
|
+
else if (a && h) {
|
|
1869
|
+
M && console.log(
|
|
1863
1870
|
"[MessagingShell] No conversation found, creating one for:",
|
|
1864
|
-
|
|
1871
|
+
a
|
|
1865
1872
|
);
|
|
1866
1873
|
try {
|
|
1867
|
-
const
|
|
1868
|
-
id:
|
|
1869
|
-
name:
|
|
1870
|
-
email:
|
|
1871
|
-
phone:
|
|
1874
|
+
const A = await h.startChannelWithParticipant({
|
|
1875
|
+
id: a.id,
|
|
1876
|
+
name: a.name,
|
|
1877
|
+
email: a.email,
|
|
1878
|
+
phone: a.phone
|
|
1872
1879
|
});
|
|
1873
|
-
|
|
1880
|
+
z(A), W(!0), Q(null), o && o(A), M && console.log(
|
|
1874
1881
|
"[MessagingShell] Channel created and loaded:",
|
|
1875
|
-
|
|
1882
|
+
A.id
|
|
1876
1883
|
);
|
|
1877
|
-
} catch (
|
|
1884
|
+
} catch (A) {
|
|
1878
1885
|
console.error(
|
|
1879
1886
|
"[MessagingShell] Failed to create conversation:",
|
|
1880
|
-
|
|
1881
|
-
),
|
|
1887
|
+
A
|
|
1888
|
+
), Q("Failed to create conversation");
|
|
1882
1889
|
}
|
|
1883
1890
|
} else
|
|
1884
|
-
|
|
1891
|
+
Q(
|
|
1885
1892
|
"No conversation found with this account"
|
|
1886
|
-
),
|
|
1893
|
+
), M && console.log(
|
|
1887
1894
|
"[MessagingShell] No conversation found for:",
|
|
1888
|
-
|
|
1895
|
+
d
|
|
1889
1896
|
);
|
|
1890
|
-
} catch (
|
|
1897
|
+
} catch (U) {
|
|
1891
1898
|
console.error(
|
|
1892
1899
|
"[MessagingShell] Failed to load initial conversation:",
|
|
1893
|
-
|
|
1894
|
-
),
|
|
1900
|
+
U
|
|
1901
|
+
), Q("Failed to load conversation");
|
|
1895
1902
|
}
|
|
1896
1903
|
})();
|
|
1897
1904
|
}, [
|
|
1898
|
-
c,
|
|
1899
|
-
r,
|
|
1900
1905
|
d,
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1906
|
+
a,
|
|
1907
|
+
c,
|
|
1908
|
+
x,
|
|
1909
|
+
h,
|
|
1910
|
+
M,
|
|
1911
|
+
o
|
|
1905
1912
|
]);
|
|
1906
|
-
const
|
|
1907
|
-
(
|
|
1908
|
-
|
|
1913
|
+
const Ve = L(
|
|
1914
|
+
(y) => {
|
|
1915
|
+
z(y), o == null || o(y);
|
|
1909
1916
|
},
|
|
1910
|
-
[
|
|
1911
|
-
),
|
|
1912
|
-
|
|
1913
|
-
}, [
|
|
1914
|
-
async (
|
|
1915
|
-
var
|
|
1916
|
-
if (
|
|
1917
|
+
[o]
|
|
1918
|
+
), We = L(() => {
|
|
1919
|
+
F || z(null);
|
|
1920
|
+
}, [F]), qe = L(
|
|
1921
|
+
async (y) => {
|
|
1922
|
+
var $;
|
|
1923
|
+
if (h)
|
|
1917
1924
|
try {
|
|
1918
|
-
|
|
1925
|
+
M && console.log(
|
|
1919
1926
|
"[MessagingShell] Starting conversation with:",
|
|
1920
|
-
|
|
1927
|
+
y.id
|
|
1921
1928
|
);
|
|
1922
|
-
const
|
|
1923
|
-
id:
|
|
1924
|
-
name:
|
|
1925
|
-
email:
|
|
1926
|
-
phone:
|
|
1929
|
+
const U = await h.startChannelWithParticipant({
|
|
1930
|
+
id: y.id,
|
|
1931
|
+
name: y.name,
|
|
1932
|
+
email: y.email,
|
|
1933
|
+
phone: y.phone
|
|
1927
1934
|
});
|
|
1928
1935
|
try {
|
|
1929
|
-
await
|
|
1930
|
-
} catch (
|
|
1931
|
-
console.warn("[MessagingShell] Failed to unhide channel:",
|
|
1936
|
+
await U.show();
|
|
1937
|
+
} catch (A) {
|
|
1938
|
+
console.warn("[MessagingShell] Failed to unhide channel:", A);
|
|
1932
1939
|
}
|
|
1933
|
-
|
|
1934
|
-
} catch (
|
|
1935
|
-
console.error("[MessagingShell] Failed to start conversation:",
|
|
1940
|
+
z(U), V(!1), ($ = X.current) == null || $.close(), l == null || l(y);
|
|
1941
|
+
} catch (U) {
|
|
1942
|
+
console.error("[MessagingShell] Failed to start conversation:", U);
|
|
1936
1943
|
}
|
|
1937
1944
|
},
|
|
1938
|
-
[
|
|
1939
|
-
), ie =
|
|
1940
|
-
var
|
|
1941
|
-
|
|
1942
|
-
}, []),
|
|
1943
|
-
(
|
|
1944
|
-
|
|
1945
|
+
[h, l, M]
|
|
1946
|
+
), ie = L(() => {
|
|
1947
|
+
var y;
|
|
1948
|
+
V(!1), (y = X.current) == null || y.close();
|
|
1949
|
+
}, []), Ze = L(
|
|
1950
|
+
(y) => {
|
|
1951
|
+
y.target === X.current && ie();
|
|
1945
1952
|
},
|
|
1946
1953
|
[ie]
|
|
1947
|
-
),
|
|
1948
|
-
async (
|
|
1949
|
-
|
|
1954
|
+
), Ye = L(
|
|
1955
|
+
async (y) => {
|
|
1956
|
+
M && console.log("[MessagingShell] Leaving conversation:", y.id), z(null), W(!1), le.current = null, await ne();
|
|
1950
1957
|
},
|
|
1951
|
-
[
|
|
1952
|
-
),
|
|
1953
|
-
async (
|
|
1954
|
-
|
|
1958
|
+
[ne, M]
|
|
1959
|
+
), Je = L(
|
|
1960
|
+
async (y) => {
|
|
1961
|
+
M && console.log("[MessagingShell] Blocking participant:", y), z(null), W(!1), le.current = null, await ne();
|
|
1955
1962
|
},
|
|
1956
|
-
[
|
|
1957
|
-
), ce = !!
|
|
1958
|
-
return
|
|
1963
|
+
[ne, M]
|
|
1964
|
+
), ce = !!G;
|
|
1965
|
+
return B ? /* @__PURE__ */ e("div", { className: R("h-full", s), children: /* @__PURE__ */ e(he, {}) }) : I ? /* @__PURE__ */ e("div", { className: R("h-full", s), children: /* @__PURE__ */ e(me, { message: I, onBack: T }) }) : !x || !c ? /* @__PURE__ */ e("div", { className: R("h-full", s), children: /* @__PURE__ */ e(
|
|
1959
1966
|
me,
|
|
1960
1967
|
{
|
|
1961
1968
|
message: "Not connected to messaging service",
|
|
1962
|
-
onBack:
|
|
1969
|
+
onBack: T
|
|
1963
1970
|
}
|
|
1964
|
-
) }) :
|
|
1971
|
+
) }) : ae ? /* @__PURE__ */ e("div", { className: R("h-full", s), children: /* @__PURE__ */ e(me, { message: ae }) }) : /* @__PURE__ */ i(
|
|
1965
1972
|
"div",
|
|
1966
1973
|
{
|
|
1967
|
-
className:
|
|
1974
|
+
className: R(
|
|
1968
1975
|
"messaging-shell h-full bg-background-primary overflow-hidden",
|
|
1969
1976
|
s
|
|
1970
1977
|
),
|
|
@@ -1973,24 +1980,24 @@ const Dt = ({
|
|
|
1973
1980
|
/* @__PURE__ */ e(
|
|
1974
1981
|
"div",
|
|
1975
1982
|
{
|
|
1976
|
-
className:
|
|
1983
|
+
className: R(
|
|
1977
1984
|
"messaging-channel-list-sidebar min-h-0 min-w-0 lg:flex lg:flex-col",
|
|
1978
1985
|
{
|
|
1979
|
-
"!hidden":
|
|
1986
|
+
"!hidden": f === !1 || F,
|
|
1980
1987
|
// Hide on mobile when channel selected, show on desktop with consistent wide width
|
|
1981
|
-
"hidden lg:flex lg:flex-1 lg:max-w-2xl":
|
|
1988
|
+
"hidden lg:flex lg:flex-1 lg:max-w-2xl": f !== !1 && !F && ce,
|
|
1982
1989
|
// Show on mobile when no channel selected, use same wide width on desktop
|
|
1983
|
-
"flex flex-col w-full lg:flex-1 lg:max-w-2xl":
|
|
1990
|
+
"flex flex-col w-full lg:flex-1 lg:max-w-2xl": f !== !1 && !F && !ce
|
|
1984
1991
|
}
|
|
1985
1992
|
),
|
|
1986
1993
|
children: /* @__PURE__ */ e(
|
|
1987
|
-
|
|
1994
|
+
Be,
|
|
1988
1995
|
{
|
|
1989
|
-
onChannelSelect:
|
|
1990
|
-
selectedChannel:
|
|
1991
|
-
filters:
|
|
1992
|
-
customEmptyStateIndicator:
|
|
1993
|
-
renderMessagePreview:
|
|
1996
|
+
onChannelSelect: Ve,
|
|
1997
|
+
selectedChannel: G || void 0,
|
|
1998
|
+
filters: Ge,
|
|
1999
|
+
customEmptyStateIndicator: N,
|
|
2000
|
+
renderMessagePreview: m
|
|
1994
2001
|
}
|
|
1995
2002
|
)
|
|
1996
2003
|
}
|
|
@@ -1998,80 +2005,81 @@ const Dt = ({
|
|
|
1998
2005
|
/* @__PURE__ */ e(
|
|
1999
2006
|
"div",
|
|
2000
2007
|
{
|
|
2001
|
-
className:
|
|
2008
|
+
className: R(
|
|
2002
2009
|
"messaging-conversation-view flex-1 flex-col min-w-0 min-h-0",
|
|
2003
2010
|
{
|
|
2004
2011
|
// In direct conversation mode (or waiting for it), always show (full width)
|
|
2005
|
-
flex:
|
|
2012
|
+
flex: F || ce || d,
|
|
2006
2013
|
// Normal mode: hide on mobile when no channel selected
|
|
2007
|
-
"hidden lg:flex": !
|
|
2014
|
+
"hidden lg:flex": !F && !ce && !d
|
|
2008
2015
|
}
|
|
2009
2016
|
),
|
|
2010
|
-
children:
|
|
2011
|
-
|
|
2017
|
+
children: G ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
|
|
2018
|
+
$e,
|
|
2012
2019
|
{
|
|
2013
|
-
channel:
|
|
2014
|
-
onBack:
|
|
2015
|
-
showBackButton: !
|
|
2020
|
+
channel: G,
|
|
2021
|
+
onBack: We,
|
|
2022
|
+
showBackButton: !F,
|
|
2016
2023
|
renderMessageInputActions: n,
|
|
2017
|
-
renderChannelBanner:
|
|
2018
|
-
onLeaveConversation:
|
|
2019
|
-
onBlockParticipant:
|
|
2024
|
+
renderChannelBanner: w,
|
|
2025
|
+
onLeaveConversation: Ye,
|
|
2026
|
+
onBlockParticipant: Je,
|
|
2020
2027
|
CustomChannelEmptyState: u,
|
|
2021
|
-
showDeleteConversation:
|
|
2022
|
-
onDeleteConversationClick:
|
|
2023
|
-
onBlockParticipantClick:
|
|
2024
|
-
onReportParticipantClick:
|
|
2025
|
-
dmAgentEnabled:
|
|
2028
|
+
showDeleteConversation: He,
|
|
2029
|
+
onDeleteConversationClick: C,
|
|
2030
|
+
onBlockParticipantClick: p,
|
|
2031
|
+
onReportParticipantClick: r,
|
|
2032
|
+
dmAgentEnabled: E,
|
|
2026
2033
|
messageMetadata: S,
|
|
2027
|
-
onMessageSent:
|
|
2028
|
-
showStarButton:
|
|
2029
|
-
chatbotVotingEnabled:
|
|
2034
|
+
onMessageSent: v,
|
|
2035
|
+
showStarButton: k,
|
|
2036
|
+
chatbotVotingEnabled: b,
|
|
2037
|
+
customChannelActions: D
|
|
2030
2038
|
},
|
|
2031
|
-
|
|
2032
|
-
) }) :
|
|
2039
|
+
G.id
|
|
2040
|
+
) }) : d ? (
|
|
2033
2041
|
// Show loading while creating/loading direct conversation channel
|
|
2034
2042
|
/* @__PURE__ */ e(he, {})
|
|
2035
2043
|
) : /* @__PURE__ */ e(
|
|
2036
|
-
|
|
2044
|
+
ze,
|
|
2037
2045
|
{
|
|
2038
|
-
hasChannels:
|
|
2039
|
-
channelsLoaded:
|
|
2046
|
+
hasChannels: ee,
|
|
2047
|
+
channelsLoaded: se
|
|
2040
2048
|
}
|
|
2041
2049
|
)
|
|
2042
2050
|
}
|
|
2043
2051
|
)
|
|
2044
2052
|
] }),
|
|
2045
|
-
|
|
2053
|
+
oe && // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
|
|
2046
2054
|
/* @__PURE__ */ e(
|
|
2047
2055
|
"dialog",
|
|
2048
2056
|
{
|
|
2049
|
-
ref:
|
|
2057
|
+
ref: X,
|
|
2050
2058
|
className: "mes-dialog",
|
|
2051
|
-
onClick:
|
|
2059
|
+
onClick: Ze,
|
|
2052
2060
|
onClose: ie,
|
|
2053
2061
|
children: /* @__PURE__ */ e("div", { className: "h-full w-full bg-white shadow-max-elevation-light", children: /* @__PURE__ */ e(
|
|
2054
|
-
|
|
2062
|
+
wt,
|
|
2055
2063
|
{
|
|
2056
|
-
participantSource:
|
|
2057
|
-
onSelectParticipant:
|
|
2064
|
+
participantSource: oe,
|
|
2065
|
+
onSelectParticipant: qe,
|
|
2058
2066
|
onClose: ie,
|
|
2059
|
-
existingParticipantIds:
|
|
2060
|
-
participantLabel:
|
|
2061
|
-
searchPlaceholder: `Search ${
|
|
2067
|
+
existingParticipantIds: J,
|
|
2068
|
+
participantLabel: Ee,
|
|
2069
|
+
searchPlaceholder: `Search ${Ee}...`
|
|
2062
2070
|
},
|
|
2063
|
-
|
|
2071
|
+
O
|
|
2064
2072
|
) })
|
|
2065
2073
|
}
|
|
2066
2074
|
)
|
|
2067
2075
|
]
|
|
2068
2076
|
}
|
|
2069
2077
|
);
|
|
2070
|
-
},
|
|
2078
|
+
}, yt = ({
|
|
2071
2079
|
question: t,
|
|
2072
2080
|
onClick: s,
|
|
2073
2081
|
loading: n = !1,
|
|
2074
|
-
className:
|
|
2082
|
+
className: o
|
|
2075
2083
|
}) => /* @__PURE__ */ e(
|
|
2076
2084
|
"button",
|
|
2077
2085
|
{
|
|
@@ -2079,33 +2087,33 @@ const Dt = ({
|
|
|
2079
2087
|
onClick: s,
|
|
2080
2088
|
disabled: n,
|
|
2081
2089
|
style: { backgroundColor: "#E6E5E3" },
|
|
2082
|
-
className:
|
|
2090
|
+
className: R(
|
|
2083
2091
|
"w-full text-center p-4 rounded-xl text-charcoal font-medium transition-colors",
|
|
2084
2092
|
{
|
|
2085
2093
|
"hover:brightness-95 active:brightness-90": !n,
|
|
2086
2094
|
"opacity-50 cursor-not-allowed": n
|
|
2087
2095
|
},
|
|
2088
|
-
|
|
2096
|
+
o
|
|
2089
2097
|
),
|
|
2090
2098
|
children: t
|
|
2091
2099
|
}
|
|
2092
|
-
),
|
|
2100
|
+
), Ft = ({
|
|
2093
2101
|
faqs: t,
|
|
2094
2102
|
onFaqClick: s,
|
|
2095
2103
|
loadingFaqId: n,
|
|
2096
|
-
headerText:
|
|
2104
|
+
headerText: o,
|
|
2097
2105
|
className: l,
|
|
2098
|
-
avatarImage:
|
|
2099
|
-
avatarName:
|
|
2106
|
+
avatarImage: d,
|
|
2107
|
+
avatarName: a
|
|
2100
2108
|
}) => {
|
|
2101
|
-
const u = t.filter((
|
|
2109
|
+
const u = t.filter((f) => f.enabled).sort((f, g) => (f.order ?? 0) - (g.order ?? 0));
|
|
2102
2110
|
return u.length === 0 ? null : /* @__PURE__ */ e("div", { className: l, children: /* @__PURE__ */ i("div", { className: "flex gap-3 items-end", children: [
|
|
2103
|
-
(
|
|
2104
|
-
|
|
2111
|
+
(d || a) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
|
|
2112
|
+
K,
|
|
2105
2113
|
{
|
|
2106
|
-
id:
|
|
2107
|
-
name:
|
|
2108
|
-
image:
|
|
2114
|
+
id: a || "account",
|
|
2115
|
+
name: a || "Account",
|
|
2116
|
+
image: d,
|
|
2109
2117
|
size: 24,
|
|
2110
2118
|
shape: "circle"
|
|
2111
2119
|
}
|
|
@@ -2116,75 +2124,76 @@ const Dt = ({
|
|
|
2116
2124
|
className: "flex-1 flex flex-col gap-3 rounded-lg p-4",
|
|
2117
2125
|
style: { backgroundColor: "#F1F0EE" },
|
|
2118
2126
|
children: [
|
|
2119
|
-
|
|
2120
|
-
u.map((
|
|
2121
|
-
|
|
2127
|
+
o && /* @__PURE__ */ e("p", { className: "text-md text-charcoal mb-4", children: o }),
|
|
2128
|
+
u.map((f) => /* @__PURE__ */ e(
|
|
2129
|
+
yt,
|
|
2122
2130
|
{
|
|
2123
|
-
question:
|
|
2124
|
-
onClick: () => s(
|
|
2125
|
-
loading: n ===
|
|
2131
|
+
question: f.question,
|
|
2132
|
+
onClick: () => s(f.id),
|
|
2133
|
+
loading: n === f.id
|
|
2126
2134
|
},
|
|
2127
|
-
|
|
2135
|
+
f.id
|
|
2128
2136
|
))
|
|
2129
2137
|
]
|
|
2130
2138
|
}
|
|
2131
2139
|
)
|
|
2132
2140
|
] }) });
|
|
2133
|
-
},
|
|
2134
|
-
const { initialSearch: n = "", pageSize:
|
|
2135
|
-
if (
|
|
2136
|
-
const
|
|
2137
|
-
u(!0),
|
|
2141
|
+
}, Lt = (t, s = {}) => {
|
|
2142
|
+
const { initialSearch: n = "", pageSize: o = 20 } = s, [l, d] = _([]), [a, u] = _(!1), [f, g] = _(null), [N, C] = _(n), [p, r] = _(!0), [E, S] = _(), v = L(async (w = !1, D) => {
|
|
2143
|
+
if (a) return;
|
|
2144
|
+
const h = D !== void 0 ? D : N;
|
|
2145
|
+
u(!0), g(null);
|
|
2138
2146
|
try {
|
|
2139
|
-
const
|
|
2140
|
-
search:
|
|
2141
|
-
limit:
|
|
2142
|
-
cursor:
|
|
2147
|
+
const c = await t.loadParticipants({
|
|
2148
|
+
search: h || void 0,
|
|
2149
|
+
limit: o,
|
|
2150
|
+
cursor: w ? void 0 : E
|
|
2143
2151
|
});
|
|
2144
|
-
|
|
2145
|
-
(
|
|
2146
|
-
),
|
|
2147
|
-
} catch (
|
|
2148
|
-
const
|
|
2149
|
-
x
|
|
2152
|
+
d(
|
|
2153
|
+
(x) => w ? c.participants : [...x, ...c.participants]
|
|
2154
|
+
), r(c.hasMore), S(c.nextCursor);
|
|
2155
|
+
} catch (c) {
|
|
2156
|
+
const x = c instanceof Error ? c.message : "Failed to load participants";
|
|
2157
|
+
g(x), console.error("[useParticipants] Load error:", c);
|
|
2150
2158
|
} finally {
|
|
2151
2159
|
u(!1);
|
|
2152
2160
|
}
|
|
2153
|
-
}, [t,
|
|
2154
|
-
|
|
2155
|
-
}, [
|
|
2156
|
-
|
|
2157
|
-
}, [
|
|
2158
|
-
S(void 0),
|
|
2159
|
-
}, [
|
|
2160
|
-
return
|
|
2161
|
-
|
|
2161
|
+
}, [t, N, E, o, a]), k = L(() => {
|
|
2162
|
+
p && !a && v(!1);
|
|
2163
|
+
}, [p, a, v]), b = L((w) => {
|
|
2164
|
+
C(w), S(void 0), v(!0, w);
|
|
2165
|
+
}, [v]), m = L(() => {
|
|
2166
|
+
S(void 0), v(!0);
|
|
2167
|
+
}, [v]);
|
|
2168
|
+
return Z(() => {
|
|
2169
|
+
v(!0);
|
|
2162
2170
|
}, [t.loadParticipants]), {
|
|
2163
2171
|
participants: l,
|
|
2164
|
-
loading:
|
|
2165
|
-
error:
|
|
2166
|
-
searchQuery:
|
|
2167
|
-
hasMore:
|
|
2172
|
+
loading: a,
|
|
2173
|
+
error: f,
|
|
2174
|
+
searchQuery: N,
|
|
2175
|
+
hasMore: p,
|
|
2168
2176
|
totalCount: t.totalCount,
|
|
2169
|
-
loadMore:
|
|
2170
|
-
search:
|
|
2171
|
-
refresh:
|
|
2177
|
+
loadMore: k,
|
|
2178
|
+
search: b,
|
|
2179
|
+
refresh: m
|
|
2172
2180
|
};
|
|
2173
2181
|
};
|
|
2174
2182
|
export {
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
Dt as
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2183
|
+
de as ActionButton,
|
|
2184
|
+
K as Avatar,
|
|
2185
|
+
gt as ChannelEmptyState,
|
|
2186
|
+
Be as ChannelList,
|
|
2187
|
+
$e as ChannelView,
|
|
2188
|
+
Ft as FaqList,
|
|
2189
|
+
yt as FaqListItem,
|
|
2190
|
+
at as MessageVoteButtons,
|
|
2191
|
+
Dt as MessagingProvider,
|
|
2192
|
+
Tt as MessagingShell,
|
|
2193
|
+
wt as ParticipantPicker,
|
|
2194
|
+
qs as formatRelativeTime,
|
|
2195
|
+
tt as useMessageVote,
|
|
2196
|
+
Vs as useMessaging,
|
|
2197
|
+
Lt as useParticipants
|
|
2189
2198
|
};
|
|
2190
2199
|
//# sourceMappingURL=index.js.map
|