@linktr.ee/messaging-react 1.21.2-rc-1771385662 → 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 -871
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/ChannelView.tsx +8 -0
- package/src/components/CustomMessage/CustomMessage.stories.tsx +0 -36
- package/src/components/CustomMessage/MessageTag.stories.tsx +5 -57
- package/src/components/CustomMessage/MessageTag.tsx +5 -7
- 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,105 +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
|
-
|
|
349
|
-
|
|
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 }),
|
|
350
352
|
/* @__PURE__ */ e("span", { children: u })
|
|
351
353
|
] });
|
|
352
354
|
}
|
|
353
355
|
return /* @__PURE__ */ i("div", { className: "message-tag message-tag--chatbot", children: [
|
|
354
|
-
/* @__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, {}) }),
|
|
355
357
|
/* @__PURE__ */ e("span", { className: "message-tag__label", children: "Chatbot" })
|
|
356
358
|
] });
|
|
357
|
-
},
|
|
359
|
+
}, Ue = j.memo(
|
|
358
360
|
({
|
|
359
361
|
channel: t,
|
|
360
362
|
selectedChannel: s,
|
|
361
363
|
onChannelSelect: n,
|
|
362
|
-
debug:
|
|
364
|
+
debug: o = !1,
|
|
363
365
|
unread: l,
|
|
364
|
-
renderMessagePreview:
|
|
366
|
+
renderMessagePreview: d
|
|
365
367
|
}) => {
|
|
366
|
-
var
|
|
367
|
-
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 = () => {
|
|
368
370
|
t && n(t);
|
|
369
|
-
},
|
|
370
|
-
const
|
|
371
|
-
!
|
|
372
|
-
},
|
|
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(
|
|
373
375
|
(I) => {
|
|
374
|
-
var
|
|
375
|
-
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);
|
|
376
378
|
}
|
|
377
|
-
),
|
|
378
|
-
var
|
|
379
|
-
if (
|
|
380
|
-
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];
|
|
381
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";
|
|
382
|
-
})(),
|
|
383
|
-
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", {
|
|
384
386
|
channelId: t == null ? void 0 : t.id,
|
|
385
|
-
isSelected:
|
|
386
|
-
participantName:
|
|
387
|
-
unreadCount:
|
|
388
|
-
hasTimestamp: !!
|
|
387
|
+
isSelected: a,
|
|
388
|
+
participantName: C,
|
|
389
|
+
unreadCount: m,
|
|
390
|
+
hasTimestamp: !!v
|
|
389
391
|
}), /* @__PURE__ */ e(
|
|
390
392
|
"div",
|
|
391
393
|
{
|
|
392
394
|
role: "button",
|
|
393
395
|
tabIndex: 0,
|
|
394
396
|
onClick: u,
|
|
395
|
-
onKeyDown:
|
|
396
|
-
className:
|
|
397
|
+
onKeyDown: f,
|
|
398
|
+
className: R(
|
|
397
399
|
"group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring",
|
|
398
400
|
{
|
|
399
|
-
"bg-primary-alt/10 border-l-4 border-l-primary":
|
|
400
|
-
"hover:bg-sand": !
|
|
401
|
+
"bg-primary-alt/10 border-l-4 border-l-primary": a,
|
|
402
|
+
"hover:bg-sand": !a
|
|
401
403
|
}
|
|
402
404
|
),
|
|
403
405
|
children: /* @__PURE__ */ i("div", { className: "flex items-start gap-3", children: [
|
|
404
406
|
/* @__PURE__ */ e(
|
|
405
|
-
|
|
407
|
+
K,
|
|
406
408
|
{
|
|
407
|
-
id: ((
|
|
408
|
-
name:
|
|
409
|
-
image:
|
|
409
|
+
id: ((B = N == null ? void 0 : N.user) == null ? void 0 : B.id) || t.id || "unknown",
|
|
410
|
+
name: C,
|
|
411
|
+
image: p,
|
|
410
412
|
size: 44,
|
|
411
413
|
className: "[&_.avatar-fallback]:group-hover:bg-[#eeeeee]"
|
|
412
414
|
}
|
|
@@ -416,18 +418,18 @@ const Q = ({
|
|
|
416
418
|
/* @__PURE__ */ e(
|
|
417
419
|
"h3",
|
|
418
420
|
{
|
|
419
|
-
className:
|
|
421
|
+
className: R(
|
|
420
422
|
"text-sm font-medium truncate",
|
|
421
|
-
|
|
423
|
+
a ? "text-primary" : "text-charcoal"
|
|
422
424
|
),
|
|
423
|
-
children:
|
|
425
|
+
children: C
|
|
424
426
|
}
|
|
425
427
|
),
|
|
426
|
-
|
|
428
|
+
v && /* @__PURE__ */ e("span", { className: "text-xs text-stone flex-shrink-0", children: v })
|
|
427
429
|
] }),
|
|
428
430
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
|
|
429
|
-
/* @__PURE__ */ e("p", { className: "text-xs text-stone flex-1 line-clamp-1", children:
|
|
430
|
-
|
|
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 })
|
|
431
433
|
] })
|
|
432
434
|
] })
|
|
433
435
|
] })
|
|
@@ -435,48 +437,48 @@ const Q = ({
|
|
|
435
437
|
);
|
|
436
438
|
}
|
|
437
439
|
);
|
|
438
|
-
|
|
439
|
-
const
|
|
440
|
+
Ue.displayName = "CustomChannelPreview";
|
|
441
|
+
const Be = j.memo(
|
|
440
442
|
({
|
|
441
443
|
onChannelSelect: t,
|
|
442
444
|
selectedChannel: s,
|
|
443
445
|
filters: n,
|
|
444
|
-
className:
|
|
446
|
+
className: o,
|
|
445
447
|
customEmptyStateIndicator: l,
|
|
446
|
-
renderMessagePreview:
|
|
448
|
+
renderMessagePreview: d
|
|
447
449
|
}) => {
|
|
448
|
-
const
|
|
449
|
-
|
|
450
|
+
const a = j.useRef(0);
|
|
451
|
+
a.current++;
|
|
450
452
|
const { debug: u = !1 } = fe();
|
|
451
453
|
u && console.log("📺 [ChannelList] 🔄 RENDER START", {
|
|
452
|
-
renderCount:
|
|
454
|
+
renderCount: a.current,
|
|
453
455
|
selectedChannelId: s == null ? void 0 : s.id,
|
|
454
456
|
filters: n
|
|
455
457
|
});
|
|
456
|
-
const
|
|
457
|
-
|
|
458
|
+
const f = j.useMemo(() => (N) => /* @__PURE__ */ e(
|
|
459
|
+
Ue,
|
|
458
460
|
{
|
|
459
|
-
...
|
|
461
|
+
...N,
|
|
460
462
|
selectedChannel: s,
|
|
461
463
|
onChannelSelect: t,
|
|
462
464
|
debug: u,
|
|
463
|
-
renderMessagePreview:
|
|
465
|
+
renderMessagePreview: d
|
|
464
466
|
}
|
|
465
|
-
), [s, t, u,
|
|
467
|
+
), [s, t, u, d]);
|
|
466
468
|
return /* @__PURE__ */ e(
|
|
467
469
|
"div",
|
|
468
470
|
{
|
|
469
|
-
className:
|
|
471
|
+
className: R(
|
|
470
472
|
"messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
|
|
471
|
-
|
|
473
|
+
o
|
|
472
474
|
),
|
|
473
475
|
children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ e(
|
|
474
|
-
|
|
476
|
+
ts,
|
|
475
477
|
{
|
|
476
478
|
filters: n,
|
|
477
479
|
sort: { last_message_at: -1 },
|
|
478
480
|
options: { limit: 30 },
|
|
479
|
-
Preview:
|
|
481
|
+
Preview: f,
|
|
480
482
|
EmptyStateIndicator: l
|
|
481
483
|
},
|
|
482
484
|
JSON.stringify(n)
|
|
@@ -485,39 +487,39 @@ const Ue = A.memo(
|
|
|
485
487
|
);
|
|
486
488
|
}
|
|
487
489
|
);
|
|
488
|
-
|
|
490
|
+
Be.displayName = "ChannelList";
|
|
489
491
|
const de = ({
|
|
490
492
|
variant: t = "default",
|
|
491
493
|
className: s,
|
|
492
494
|
children: n,
|
|
493
|
-
...
|
|
495
|
+
...o
|
|
494
496
|
}) => /* @__PURE__ */ e(
|
|
495
497
|
"button",
|
|
496
498
|
{
|
|
497
499
|
type: "button",
|
|
498
|
-
className:
|
|
500
|
+
className: R(
|
|
499
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",
|
|
500
502
|
t === "danger" ? "text-danger hover:bg-danger/50" : "text-charcoal hover:bg-sand",
|
|
501
503
|
s
|
|
502
504
|
),
|
|
503
|
-
...
|
|
505
|
+
...o,
|
|
504
506
|
children: n
|
|
505
507
|
}
|
|
506
508
|
);
|
|
507
|
-
function
|
|
509
|
+
function je({ label: t, className: s, children: n, ...o }) {
|
|
508
510
|
return /* @__PURE__ */ i(
|
|
509
511
|
"button",
|
|
510
512
|
{
|
|
511
513
|
type: "button",
|
|
512
|
-
className:
|
|
514
|
+
className: R(
|
|
513
515
|
"rounded-full p-2 transition-colors focus-ring",
|
|
514
516
|
{
|
|
515
|
-
"cursor-not-allowed opacity-50":
|
|
516
|
-
"hover:bg-sand": !
|
|
517
|
+
"cursor-not-allowed opacity-50": o.disabled,
|
|
518
|
+
"hover:bg-sand": !o.disabled
|
|
517
519
|
},
|
|
518
520
|
s
|
|
519
521
|
),
|
|
520
|
-
...
|
|
522
|
+
...o,
|
|
521
523
|
children: [
|
|
522
524
|
/* @__PURE__ */ e("span", { className: "sr-only", children: t }),
|
|
523
525
|
n
|
|
@@ -525,41 +527,41 @@ function Be({ label: t, className: s, children: n, ...a }) {
|
|
|
525
527
|
}
|
|
526
528
|
);
|
|
527
529
|
}
|
|
528
|
-
function
|
|
529
|
-
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" }) });
|
|
530
532
|
}
|
|
531
|
-
const
|
|
532
|
-
function
|
|
533
|
+
const et = (t) => /* @__PURE__ */ e(ns, { ...t, position: "center" }), Ce = "vote_up", Ne = "vote_down";
|
|
534
|
+
function st(t) {
|
|
533
535
|
return t != null && t.length ? t.some((s) => s.type === Ne) ? "down" : t.some((s) => s.type === Ce) ? "up" : null : null;
|
|
534
536
|
}
|
|
535
|
-
function
|
|
536
|
-
const { channel: s } = we(), { client: n } =
|
|
537
|
-
() =>
|
|
537
|
+
function tt(t) {
|
|
538
|
+
const { channel: s } = we(), { client: n } = Le("useMessageVote"), o = be(
|
|
539
|
+
() => st(t.own_reactions),
|
|
538
540
|
[t.own_reactions]
|
|
539
|
-
), l =
|
|
541
|
+
), l = L(async () => {
|
|
540
542
|
if (n != null && n.userID)
|
|
541
543
|
try {
|
|
542
|
-
|
|
544
|
+
o === "up" ? await s.deleteReaction(t.id, Ce) : await s.sendReaction(
|
|
543
545
|
t.id,
|
|
544
546
|
{ type: Ce },
|
|
545
547
|
{ enforce_unique: !0, skip_push: !0 }
|
|
546
548
|
);
|
|
547
549
|
} catch {
|
|
548
550
|
}
|
|
549
|
-
}, [s, n == null ? void 0 : n.userID, t.id,
|
|
551
|
+
}, [s, n == null ? void 0 : n.userID, t.id, o]), d = L(async () => {
|
|
550
552
|
if (n != null && n.userID)
|
|
551
553
|
try {
|
|
552
|
-
|
|
554
|
+
o === "down" ? await s.deleteReaction(t.id, Ne) : await s.sendReaction(
|
|
553
555
|
t.id,
|
|
554
556
|
{ type: Ne },
|
|
555
557
|
{ enforce_unique: !0, skip_push: !0 }
|
|
556
558
|
);
|
|
557
559
|
} catch {
|
|
558
560
|
}
|
|
559
|
-
}, [s, n == null ? void 0 : n.userID, t.id,
|
|
560
|
-
return { selected:
|
|
561
|
+
}, [s, n == null ? void 0 : n.userID, t.id, o]);
|
|
562
|
+
return { selected: o, voteUp: l, voteDown: d };
|
|
561
563
|
}
|
|
562
|
-
const
|
|
564
|
+
const nt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
|
|
563
565
|
"path",
|
|
564
566
|
{
|
|
565
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",
|
|
@@ -569,7 +571,7 @@ const tt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
569
571
|
strokeLinejoin: "round",
|
|
570
572
|
fill: t ? "currentColor" : "none"
|
|
571
573
|
}
|
|
572
|
-
) }),
|
|
574
|
+
) }), rt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
|
|
573
575
|
"path",
|
|
574
576
|
{
|
|
575
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",
|
|
@@ -579,7 +581,7 @@ const tt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
579
581
|
strokeLinejoin: "round",
|
|
580
582
|
fill: t ? "currentColor" : "none"
|
|
581
583
|
}
|
|
582
|
-
) }),
|
|
584
|
+
) }), at = ({
|
|
583
585
|
selected: t,
|
|
584
586
|
onVoteUp: s,
|
|
585
587
|
onVoteDown: n
|
|
@@ -592,7 +594,7 @@ const tt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
592
594
|
onClick: s,
|
|
593
595
|
"aria-label": "Helpful",
|
|
594
596
|
"aria-pressed": t === "up",
|
|
595
|
-
children: /* @__PURE__ */ e(
|
|
597
|
+
children: /* @__PURE__ */ e(nt, { filled: t === "up" })
|
|
596
598
|
}
|
|
597
599
|
),
|
|
598
600
|
/* @__PURE__ */ e(
|
|
@@ -603,175 +605,175 @@ const tt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
603
605
|
onClick: n,
|
|
604
606
|
"aria-label": "Not helpful",
|
|
605
607
|
"aria-pressed": t === "down",
|
|
606
|
-
children: /* @__PURE__ */ e(
|
|
608
|
+
children: /* @__PURE__ */ e(rt, { filled: t === "down" })
|
|
607
609
|
}
|
|
608
610
|
)
|
|
609
|
-
] }),
|
|
610
|
-
var
|
|
611
|
+
] }), ot = (t) => {
|
|
612
|
+
var X, oe;
|
|
611
613
|
const {
|
|
612
614
|
additionalMessageInputProps: s,
|
|
613
615
|
chatbotVotingEnabled: n,
|
|
614
|
-
editing:
|
|
616
|
+
editing: o,
|
|
615
617
|
endOfGroup: l,
|
|
616
|
-
firstOfGroup:
|
|
617
|
-
groupedByUser:
|
|
618
|
+
firstOfGroup: d,
|
|
619
|
+
groupedByUser: a,
|
|
618
620
|
handleAction: u,
|
|
619
|
-
handleOpenThread:
|
|
620
|
-
handleRetry:
|
|
621
|
-
highlighted:
|
|
622
|
-
isMessageAIGenerated:
|
|
623
|
-
isMyMessage:
|
|
624
|
-
message:
|
|
625
|
-
renderText:
|
|
621
|
+
handleOpenThread: f,
|
|
622
|
+
handleRetry: g,
|
|
623
|
+
highlighted: N,
|
|
624
|
+
isMessageAIGenerated: C,
|
|
625
|
+
isMyMessage: p,
|
|
626
|
+
message: r,
|
|
627
|
+
renderText: E,
|
|
626
628
|
threadList: S
|
|
627
|
-
} = t, { client:
|
|
628
|
-
Attachment:
|
|
629
|
-
EditMessageModal:
|
|
630
|
-
MessageBlocked:
|
|
631
|
-
MessageBouncePrompt: I =
|
|
632
|
-
MessageDeleted:
|
|
633
|
-
MessageIsThreadReplyInChannelButtonIndicator:
|
|
634
|
-
MessageRepliesCountButton:
|
|
635
|
-
ReminderNotification:
|
|
636
|
-
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,
|
|
637
639
|
PinIndicator: Y
|
|
638
|
-
} =
|
|
639
|
-
() =>
|
|
640
|
-
[
|
|
640
|
+
} = os("CustomMessage"), se = xs(r), te = bs(r), re = be(
|
|
641
|
+
() => C == null ? void 0 : C(r),
|
|
642
|
+
[C, r]
|
|
641
643
|
), V = be(
|
|
642
|
-
() => !
|
|
643
|
-
[
|
|
644
|
+
() => !r.shared_location && !r.attachments ? [] : r.shared_location ? [r.shared_location, ...r.attachments ?? []] : r.attachments,
|
|
645
|
+
[r]
|
|
644
646
|
);
|
|
645
|
-
if (
|
|
647
|
+
if (Cs(r))
|
|
646
648
|
return null;
|
|
647
|
-
if (
|
|
648
|
-
return /* @__PURE__ */ e(
|
|
649
|
-
if (
|
|
650
|
-
return /* @__PURE__ */ e(
|
|
651
|
-
const
|
|
652
|
-
let
|
|
653
|
-
|
|
654
|
-
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(
|
|
655
657
|
"str-chat__message str-chat__message-simple",
|
|
656
|
-
`str-chat__message--${
|
|
657
|
-
`str-chat__message--${
|
|
658
|
-
|
|
659
|
-
|
|
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",
|
|
660
662
|
{
|
|
661
|
-
"str-chat__message--has-attachment":
|
|
662
|
-
"str-chat__message--highlighted":
|
|
663
|
-
"str-chat__message--pinned pinned-message":
|
|
664
|
-
"str-chat__message--with-reactions":
|
|
665
|
-
"str-chat__message-send-can-be-retried": (
|
|
666
|
-
"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,
|
|
667
669
|
"str-chat__virtual-message__wrapper--end": l,
|
|
668
|
-
"str-chat__virtual-message__wrapper--first":
|
|
669
|
-
"str-chat__virtual-message__wrapper--group":
|
|
670
|
+
"str-chat__virtual-message__wrapper--first": d,
|
|
671
|
+
"str-chat__virtual-message__wrapper--group": a
|
|
670
672
|
}
|
|
671
|
-
),
|
|
673
|
+
), ae = r.poll_id && v.polls.fromState(r.poll_id), Q = Ks(r);
|
|
672
674
|
return /* @__PURE__ */ i(ve, { children: [
|
|
673
|
-
|
|
674
|
-
|
|
675
|
+
o && /* @__PURE__ */ e(
|
|
676
|
+
x,
|
|
675
677
|
{
|
|
676
678
|
additionalMessageInputProps: s
|
|
677
679
|
}
|
|
678
680
|
),
|
|
679
|
-
|
|
680
|
-
|
|
681
|
+
k && /* @__PURE__ */ e(
|
|
682
|
+
ws,
|
|
681
683
|
{
|
|
682
684
|
MessageBouncePrompt: I,
|
|
683
|
-
onClose: () =>
|
|
684
|
-
open:
|
|
685
|
+
onClose: () => b(!1),
|
|
686
|
+
open: k
|
|
685
687
|
}
|
|
686
688
|
),
|
|
687
|
-
/* @__PURE__ */ i("div", { className:
|
|
689
|
+
/* @__PURE__ */ i("div", { className: W, children: [
|
|
688
690
|
Y && /* @__PURE__ */ e(Y, {}),
|
|
689
|
-
!!
|
|
690
|
-
|
|
691
|
-
|
|
691
|
+
!!m && /* @__PURE__ */ e(z, { reminder: m }),
|
|
692
|
+
r.user && /* @__PURE__ */ e(
|
|
693
|
+
K,
|
|
692
694
|
{
|
|
693
695
|
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
694
|
-
id:
|
|
695
|
-
image:
|
|
696
|
-
name:
|
|
696
|
+
id: r.user.id,
|
|
697
|
+
image: r.user.image,
|
|
698
|
+
name: r.user.name || r.user.id
|
|
697
699
|
}
|
|
698
700
|
),
|
|
699
701
|
/* @__PURE__ */ e(
|
|
700
702
|
"div",
|
|
701
703
|
{
|
|
702
|
-
className:
|
|
703
|
-
"str-chat__simple-message--error-failed":
|
|
704
|
+
className: R("str-chat__message-inner", {
|
|
705
|
+
"str-chat__simple-message--error-failed": O || H
|
|
704
706
|
}),
|
|
705
707
|
"data-testid": "message-inner",
|
|
706
|
-
onClick:
|
|
707
|
-
onKeyDown:
|
|
708
|
-
role:
|
|
709
|
-
tabIndex:
|
|
708
|
+
onClick: F,
|
|
709
|
+
onKeyDown: F,
|
|
710
|
+
role: F ? "button" : void 0,
|
|
711
|
+
tabIndex: F ? 0 : void 0,
|
|
710
712
|
style: {
|
|
711
713
|
// Force margins to 0 to prevent hover layout shift
|
|
712
714
|
// Stream Chat CSS sets margin-inline-end/start to 78px, then 0 on hover
|
|
713
715
|
marginInlineEnd: 0,
|
|
714
716
|
marginInlineStart: 0
|
|
715
717
|
},
|
|
716
|
-
children:
|
|
718
|
+
children: Q ? (
|
|
717
719
|
/* Tip-only messages render as a standalone bubble */
|
|
718
|
-
/* @__PURE__ */ e(
|
|
720
|
+
/* @__PURE__ */ e(Fe, { message: r, standalone: !0 })
|
|
719
721
|
) : /* @__PURE__ */ i("div", { className: "str-chat__message-bubble-wrapper", children: [
|
|
720
722
|
/* @__PURE__ */ i("div", { className: "str-chat__message-bubble", children: [
|
|
721
|
-
|
|
722
|
-
V != null && V.length && !
|
|
723
|
-
|
|
723
|
+
ae && /* @__PURE__ */ e(ps, { poll: ae }),
|
|
724
|
+
V != null && V.length && !r.quoted_message ? /* @__PURE__ */ e(
|
|
725
|
+
c,
|
|
724
726
|
{
|
|
725
727
|
actionHandler: u,
|
|
726
728
|
attachments: V
|
|
727
729
|
}
|
|
728
730
|
) : null,
|
|
729
|
-
|
|
730
|
-
|
|
731
|
+
re ? /* @__PURE__ */ e(
|
|
732
|
+
ee,
|
|
731
733
|
{
|
|
732
|
-
message:
|
|
733
|
-
renderText:
|
|
734
|
+
message: r,
|
|
735
|
+
renderText: E
|
|
734
736
|
}
|
|
735
|
-
) : /* @__PURE__ */ e(
|
|
736
|
-
/* @__PURE__ */ e(
|
|
737
|
+
) : /* @__PURE__ */ e(ys, { message: r, renderText: E }),
|
|
738
|
+
/* @__PURE__ */ e(Es, {})
|
|
737
739
|
] }),
|
|
738
|
-
/* @__PURE__ */ e(
|
|
739
|
-
n && ye(
|
|
740
|
-
|
|
740
|
+
/* @__PURE__ */ e(Fe, { message: r }),
|
|
741
|
+
n && ye(r) && /* @__PURE__ */ e(
|
|
742
|
+
at,
|
|
741
743
|
{
|
|
742
|
-
selected:
|
|
743
|
-
onVoteUp:
|
|
744
|
-
onVoteDown:
|
|
744
|
+
selected: w,
|
|
745
|
+
onVoteUp: D,
|
|
746
|
+
onVoteDown: h
|
|
745
747
|
}
|
|
746
748
|
)
|
|
747
749
|
] })
|
|
748
750
|
}
|
|
749
751
|
),
|
|
750
|
-
|
|
751
|
-
|
|
752
|
+
J && /* @__PURE__ */ e(
|
|
753
|
+
G,
|
|
752
754
|
{
|
|
753
|
-
onClick:
|
|
754
|
-
reply_count:
|
|
755
|
+
onClick: f,
|
|
756
|
+
reply_count: r.reply_count
|
|
755
757
|
}
|
|
756
758
|
),
|
|
757
|
-
|
|
758
|
-
] },
|
|
759
|
+
P && /* @__PURE__ */ e(M, {})
|
|
760
|
+
] }, r.id)
|
|
759
761
|
] });
|
|
760
|
-
},
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
),
|
|
764
|
-
const s =
|
|
765
|
-
return /* @__PURE__ */ e(
|
|
766
|
-
},
|
|
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) => ({
|
|
767
769
|
linkPreviews: Array.from(t.previews.values()).filter(
|
|
768
|
-
(s) =>
|
|
770
|
+
(s) => De.previewIsLoaded(s) || De.previewIsLoading(s)
|
|
769
771
|
)
|
|
770
|
-
}),
|
|
772
|
+
}), dt = ({
|
|
771
773
|
link: t,
|
|
772
774
|
onDismiss: s
|
|
773
775
|
}) => {
|
|
774
|
-
const { og_scrape_url: n, title:
|
|
776
|
+
const { og_scrape_url: n, title: o, image_url: l } = t;
|
|
775
777
|
return /* @__PURE__ */ i(
|
|
776
778
|
"a",
|
|
777
779
|
{
|
|
@@ -784,7 +786,7 @@ const tt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
784
786
|
"img",
|
|
785
787
|
{
|
|
786
788
|
src: l,
|
|
787
|
-
alt:
|
|
789
|
+
alt: o || "",
|
|
788
790
|
className: "h-[148px] w-full rounded-[20px] object-cover"
|
|
789
791
|
}
|
|
790
792
|
),
|
|
@@ -792,8 +794,8 @@ const tt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
792
794
|
"button",
|
|
793
795
|
{
|
|
794
796
|
type: "button",
|
|
795
|
-
onClick: (
|
|
796
|
-
|
|
797
|
+
onClick: (a) => {
|
|
798
|
+
a.preventDefault(), s(n);
|
|
797
799
|
},
|
|
798
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",
|
|
799
801
|
"aria-label": "Close link preview",
|
|
@@ -801,38 +803,38 @@ const tt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
801
803
|
}
|
|
802
804
|
),
|
|
803
805
|
/* @__PURE__ */ i("div", { className: "p-2", children: [
|
|
804
|
-
|
|
806
|
+
o && /* @__PURE__ */ e("div", { className: "text-[14px] font-medium leading-5 text-white", children: o }),
|
|
805
807
|
/* @__PURE__ */ e("div", { className: "text-[12px] leading-4 text-white/55", children: n })
|
|
806
808
|
] })
|
|
807
809
|
]
|
|
808
810
|
}
|
|
809
811
|
);
|
|
810
|
-
},
|
|
811
|
-
const { linkPreviewsManager: t } =
|
|
812
|
+
}, ut = () => {
|
|
813
|
+
const { linkPreviewsManager: t } = _s(), { linkPreviews: s } = Ss(
|
|
812
814
|
t.state,
|
|
813
|
-
|
|
815
|
+
ct
|
|
814
816
|
), n = (l) => {
|
|
815
817
|
t.dismissPreview(l);
|
|
816
818
|
};
|
|
817
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(
|
|
818
|
-
|
|
820
|
+
dt,
|
|
819
821
|
{
|
|
820
822
|
link: l,
|
|
821
823
|
onDismiss: n
|
|
822
824
|
},
|
|
823
825
|
l.og_scrape_url
|
|
824
826
|
)) }) : null;
|
|
825
|
-
},
|
|
826
|
-
const { handleSubmit: t } =
|
|
827
|
+
}, mt = () => {
|
|
828
|
+
const { handleSubmit: t } = ks(), s = Rs();
|
|
827
829
|
return /* @__PURE__ */ i(ve, { children: [
|
|
828
|
-
/* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(
|
|
830
|
+
/* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(Ds, {}) }),
|
|
829
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: [
|
|
830
|
-
/* @__PURE__ */ e(Ds, {}),
|
|
831
|
-
/* @__PURE__ */ e(dt, {}),
|
|
832
832
|
/* @__PURE__ */ e(Ts, {}),
|
|
833
|
+
/* @__PURE__ */ e(ut, {}),
|
|
834
|
+
/* @__PURE__ */ e(Fs, {}),
|
|
833
835
|
/* @__PURE__ */ i("div", { className: "flex", children: [
|
|
834
836
|
/* @__PURE__ */ e("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ e(
|
|
835
|
-
|
|
837
|
+
Ls,
|
|
836
838
|
{
|
|
837
839
|
className: "w-full resize-none outline-none leading-6",
|
|
838
840
|
autoFocus: !0,
|
|
@@ -848,18 +850,18 @@ const tt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
848
850
|
disabled: !s,
|
|
849
851
|
onClick: t,
|
|
850
852
|
type: "button",
|
|
851
|
-
children: /* @__PURE__ */ e(
|
|
853
|
+
children: /* @__PURE__ */ e($s, { className: "size-4" })
|
|
852
854
|
}
|
|
853
855
|
)
|
|
854
856
|
] })
|
|
855
857
|
] })
|
|
856
858
|
] });
|
|
857
|
-
},
|
|
859
|
+
}, ht = ({
|
|
858
860
|
renderActions: t
|
|
859
861
|
}) => /* @__PURE__ */ i("div", { className: "message-input flex items-center gap-2 p-4", children: [
|
|
860
862
|
t && (t == null ? void 0 : t()),
|
|
861
|
-
/* @__PURE__ */ e(
|
|
862
|
-
] }),
|
|
863
|
+
/* @__PURE__ */ e(Ms, { Input: mt })
|
|
864
|
+
] }), ft = (t) => {
|
|
863
865
|
const s = t.message.hide_date === !0;
|
|
864
866
|
return /* @__PURE__ */ i("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
865
867
|
/* @__PURE__ */ i("div", { className: "str-chat__message--system__text", children: [
|
|
@@ -867,12 +869,12 @@ const tt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
867
869
|
/* @__PURE__ */ e("p", { children: t.message.text }),
|
|
868
870
|
/* @__PURE__ */ e("div", { className: "str-chat__message--system__line" })
|
|
869
871
|
] }),
|
|
870
|
-
!s && /* @__PURE__ */ e(
|
|
872
|
+
!s && /* @__PURE__ */ e(Ps, { message: t.message })
|
|
871
873
|
] });
|
|
872
|
-
},
|
|
874
|
+
}, gt = () => null, xt = ({ className: t, message: s }) => /* @__PURE__ */ i(
|
|
873
875
|
"div",
|
|
874
876
|
{
|
|
875
|
-
className:
|
|
877
|
+
className: R("flex items-center justify-center h-full", t),
|
|
876
878
|
children: [
|
|
877
879
|
/* @__PURE__ */ i("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
|
|
878
880
|
/* @__PURE__ */ e("circle", { cx: "6", cy: "50", r: "6", children: /* @__PURE__ */ e(
|
|
@@ -912,45 +914,45 @@ const tt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
912
914
|
s && /* @__PURE__ */ e("span", { className: "text-stone", children: s })
|
|
913
915
|
]
|
|
914
916
|
}
|
|
915
|
-
), he =
|
|
916
|
-
/* @__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" }),
|
|
917
919
|
/* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading messages" })
|
|
918
920
|
] }) }));
|
|
919
921
|
he.displayName = "LoadingState";
|
|
920
|
-
const
|
|
922
|
+
const bt = ({
|
|
921
923
|
onBack: t,
|
|
922
924
|
showBackButton: s,
|
|
923
925
|
onShowInfo: n,
|
|
924
|
-
canShowInfo:
|
|
926
|
+
canShowInfo: o,
|
|
925
927
|
showStarButton: l = !1
|
|
926
928
|
}) => {
|
|
927
|
-
var
|
|
928
|
-
const { channel:
|
|
929
|
-
(
|
|
930
|
-
var
|
|
931
|
-
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;
|
|
932
934
|
}
|
|
933
|
-
), [
|
|
934
|
-
!!((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)
|
|
935
937
|
);
|
|
936
|
-
|
|
937
|
-
const
|
|
938
|
-
var
|
|
939
|
-
|
|
940
|
-
|
|
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)
|
|
941
943
|
);
|
|
942
944
|
};
|
|
943
|
-
return
|
|
944
|
-
|
|
945
|
+
return d.on("member.updated", b), () => {
|
|
946
|
+
d.off("member.updated", b);
|
|
945
947
|
};
|
|
946
|
-
}, [
|
|
947
|
-
const
|
|
948
|
+
}, [d]);
|
|
949
|
+
const C = async () => {
|
|
948
950
|
try {
|
|
949
|
-
|
|
950
|
-
} catch (
|
|
951
|
+
g ? await d.unpin() : await d.pin();
|
|
952
|
+
} catch (b) {
|
|
951
953
|
console.error(
|
|
952
954
|
"[CustomChannelHeader] Failed to update pinned status:",
|
|
953
|
-
|
|
955
|
+
b
|
|
954
956
|
);
|
|
955
957
|
}
|
|
956
958
|
};
|
|
@@ -959,23 +961,23 @@ const xt = ({
|
|
|
959
961
|
/* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: s && /* @__PURE__ */ e(
|
|
960
962
|
"button",
|
|
961
963
|
{
|
|
962
|
-
className:
|
|
964
|
+
className: R(
|
|
963
965
|
"size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center"
|
|
964
966
|
),
|
|
965
967
|
onClick: t || (() => {
|
|
966
968
|
}),
|
|
967
969
|
type: "button",
|
|
968
970
|
"aria-label": "Back to conversations",
|
|
969
|
-
children: /* @__PURE__ */ e(
|
|
971
|
+
children: /* @__PURE__ */ e(_e, { className: "size-5 text-black/90" })
|
|
970
972
|
}
|
|
971
973
|
) }),
|
|
972
974
|
/* @__PURE__ */ i("div", { className: "flex flex-col gap-1 items-center", children: [
|
|
973
975
|
/* @__PURE__ */ e(
|
|
974
|
-
|
|
976
|
+
K,
|
|
975
977
|
{
|
|
976
|
-
id: ((
|
|
978
|
+
id: ((v = a == null ? void 0 : a.user) == null ? void 0 : v.id) || d.id || "unknown",
|
|
977
979
|
name: u,
|
|
978
|
-
image:
|
|
980
|
+
image: f,
|
|
979
981
|
size: 40
|
|
980
982
|
}
|
|
981
983
|
),
|
|
@@ -986,17 +988,17 @@ const xt = ({
|
|
|
986
988
|
"button",
|
|
987
989
|
{
|
|
988
990
|
className: "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
|
|
989
|
-
onClick:
|
|
991
|
+
onClick: C,
|
|
990
992
|
type: "button",
|
|
991
|
-
"aria-label":
|
|
993
|
+
"aria-label": g ? "Unstar conversation" : "Star conversation",
|
|
992
994
|
children: /* @__PURE__ */ e(
|
|
993
|
-
|
|
995
|
+
Se,
|
|
994
996
|
{
|
|
995
|
-
className:
|
|
996
|
-
"text-yellow-600":
|
|
997
|
-
"text-black/90": !
|
|
997
|
+
className: R("size-5", {
|
|
998
|
+
"text-yellow-600": g,
|
|
999
|
+
"text-black/90": !g
|
|
998
1000
|
}),
|
|
999
|
-
weight:
|
|
1001
|
+
weight: g ? "duotone" : "regular"
|
|
1000
1002
|
}
|
|
1001
1003
|
)
|
|
1002
1004
|
}
|
|
@@ -1008,7 +1010,7 @@ const xt = ({
|
|
|
1008
1010
|
onClick: n,
|
|
1009
1011
|
type: "button",
|
|
1010
1012
|
"aria-label": "Show info",
|
|
1011
|
-
children: /* @__PURE__ */ e(
|
|
1013
|
+
children: /* @__PURE__ */ e(Me, { className: "size-5 text-black/90" })
|
|
1012
1014
|
}
|
|
1013
1015
|
)
|
|
1014
1016
|
] })
|
|
@@ -1022,15 +1024,15 @@ const xt = ({
|
|
|
1022
1024
|
onClick: t,
|
|
1023
1025
|
className: "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
|
|
1024
1026
|
"aria-label": "Back to conversations",
|
|
1025
|
-
children: /* @__PURE__ */ e(
|
|
1027
|
+
children: /* @__PURE__ */ e(_e, { className: "size-5 text-black/90" })
|
|
1026
1028
|
}
|
|
1027
1029
|
),
|
|
1028
1030
|
/* @__PURE__ */ e(
|
|
1029
|
-
|
|
1031
|
+
K,
|
|
1030
1032
|
{
|
|
1031
|
-
id: ((
|
|
1033
|
+
id: ((k = a == null ? void 0 : a.user) == null ? void 0 : k.id) || d.id || "unknown",
|
|
1032
1034
|
name: u,
|
|
1033
|
-
image:
|
|
1035
|
+
image: f,
|
|
1034
1036
|
size: 40
|
|
1035
1037
|
}
|
|
1036
1038
|
),
|
|
@@ -1041,115 +1043,116 @@ const xt = ({
|
|
|
1041
1043
|
"button",
|
|
1042
1044
|
{
|
|
1043
1045
|
className: "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
|
|
1044
|
-
onClick:
|
|
1046
|
+
onClick: C,
|
|
1045
1047
|
type: "button",
|
|
1046
|
-
"aria-label":
|
|
1048
|
+
"aria-label": g ? "Unstar conversation" : "Star conversation",
|
|
1047
1049
|
children: /* @__PURE__ */ e(
|
|
1048
|
-
|
|
1050
|
+
Se,
|
|
1049
1051
|
{
|
|
1050
|
-
className:
|
|
1051
|
-
"text-yellow-600":
|
|
1052
|
-
"text-black/90": !
|
|
1052
|
+
className: R("size-5", {
|
|
1053
|
+
"text-yellow-600": g,
|
|
1054
|
+
"text-black/90": !g
|
|
1053
1055
|
}),
|
|
1054
|
-
weight:
|
|
1056
|
+
weight: g ? "duotone" : "regular"
|
|
1055
1057
|
}
|
|
1056
1058
|
)
|
|
1057
1059
|
}
|
|
1058
1060
|
),
|
|
1059
|
-
|
|
1061
|
+
o && n && /* @__PURE__ */ e(
|
|
1060
1062
|
"button",
|
|
1061
1063
|
{
|
|
1062
1064
|
className: "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
|
|
1063
1065
|
onClick: n,
|
|
1064
1066
|
type: "button",
|
|
1065
1067
|
"aria-label": "Show info",
|
|
1066
|
-
children: /* @__PURE__ */ e(
|
|
1068
|
+
children: /* @__PURE__ */ e(Me, { className: "size-5 text-black/90" })
|
|
1067
1069
|
}
|
|
1068
1070
|
)
|
|
1069
1071
|
] })
|
|
1070
1072
|
] })
|
|
1071
1073
|
] });
|
|
1072
|
-
},
|
|
1074
|
+
}, Ct = ({
|
|
1073
1075
|
dialogRef: t,
|
|
1074
1076
|
onClose: s,
|
|
1075
1077
|
participant: n,
|
|
1076
|
-
channel:
|
|
1078
|
+
channel: o,
|
|
1077
1079
|
followerStatusLabel: l,
|
|
1078
|
-
onLeaveConversation:
|
|
1079
|
-
onBlockParticipant:
|
|
1080
|
+
onLeaveConversation: d,
|
|
1081
|
+
onBlockParticipant: a,
|
|
1080
1082
|
showDeleteConversation: u = !0,
|
|
1081
|
-
onDeleteConversationClick:
|
|
1082
|
-
onBlockParticipantClick:
|
|
1083
|
-
onReportParticipantClick:
|
|
1083
|
+
onDeleteConversationClick: f,
|
|
1084
|
+
onBlockParticipantClick: g,
|
|
1085
|
+
onReportParticipantClick: N,
|
|
1086
|
+
customChannelActions: C
|
|
1084
1087
|
}) => {
|
|
1085
|
-
var
|
|
1086
|
-
const { service:
|
|
1087
|
-
var
|
|
1088
|
-
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)))
|
|
1089
1092
|
try {
|
|
1090
|
-
const
|
|
1091
|
-
(
|
|
1092
|
-
var
|
|
1093
|
-
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);
|
|
1094
1097
|
}
|
|
1095
1098
|
);
|
|
1096
|
-
|
|
1097
|
-
} catch (
|
|
1099
|
+
S(H);
|
|
1100
|
+
} catch (O) {
|
|
1098
1101
|
console.error(
|
|
1099
1102
|
"[ChannelInfoDialog] Failed to check blocked status:",
|
|
1100
|
-
|
|
1103
|
+
O
|
|
1101
1104
|
);
|
|
1102
1105
|
}
|
|
1103
|
-
}, [
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
}, [
|
|
1107
|
-
const
|
|
1108
|
-
var
|
|
1109
|
-
if (!
|
|
1110
|
-
|
|
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);
|
|
1111
1114
|
try {
|
|
1112
|
-
const
|
|
1113
|
-
await
|
|
1114
|
-
} catch (
|
|
1115
|
-
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);
|
|
1116
1119
|
} finally {
|
|
1117
|
-
|
|
1120
|
+
k(!1);
|
|
1118
1121
|
}
|
|
1119
1122
|
}
|
|
1120
|
-
},
|
|
1121
|
-
var
|
|
1122
|
-
if (!(
|
|
1123
|
-
|
|
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);
|
|
1124
1127
|
try {
|
|
1125
|
-
await
|
|
1126
|
-
} catch (
|
|
1127
|
-
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);
|
|
1128
1131
|
} finally {
|
|
1129
|
-
|
|
1132
|
+
m(!1);
|
|
1130
1133
|
}
|
|
1131
1134
|
}
|
|
1132
|
-
},
|
|
1133
|
-
var
|
|
1134
|
-
if (!(
|
|
1135
|
-
|
|
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);
|
|
1136
1139
|
try {
|
|
1137
|
-
await
|
|
1138
|
-
} catch (
|
|
1139
|
-
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);
|
|
1140
1143
|
} finally {
|
|
1141
|
-
|
|
1144
|
+
m(!1);
|
|
1142
1145
|
}
|
|
1143
1146
|
}
|
|
1144
|
-
},
|
|
1145
|
-
|
|
1147
|
+
}, x = () => {
|
|
1148
|
+
N == null || N(), s(), window.open(
|
|
1146
1149
|
"https://linktr.ee/s/about/trust-center/report",
|
|
1147
1150
|
"_blank",
|
|
1148
1151
|
"noopener,noreferrer"
|
|
1149
1152
|
);
|
|
1150
1153
|
};
|
|
1151
1154
|
if (!n) return null;
|
|
1152
|
-
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";
|
|
1153
1156
|
return (
|
|
1154
1157
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
|
|
1155
1158
|
/* @__PURE__ */ e(
|
|
@@ -1158,13 +1161,13 @@ const xt = ({
|
|
|
1158
1161
|
ref: t,
|
|
1159
1162
|
className: "mes-dialog group",
|
|
1160
1163
|
onClose: s,
|
|
1161
|
-
onClick: (
|
|
1162
|
-
|
|
1164
|
+
onClick: (P) => {
|
|
1165
|
+
P.target === t.current && s();
|
|
1163
1166
|
},
|
|
1164
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: [
|
|
1165
1168
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between border-b border-sand px-4 py-3", children: [
|
|
1166
1169
|
/* @__PURE__ */ e("h2", { className: "text-base font-semibold text-charcoal", children: "Chat info" }),
|
|
1167
|
-
/* @__PURE__ */ e(
|
|
1170
|
+
/* @__PURE__ */ e(Ae, { onClick: s })
|
|
1168
1171
|
] }),
|
|
1169
1172
|
/* @__PURE__ */ i("div", { className: "flex-1 px-2 overflow-y-auto w-full", children: [
|
|
1170
1173
|
/* @__PURE__ */ e(
|
|
@@ -1174,18 +1177,18 @@ const xt = ({
|
|
|
1174
1177
|
style: { backgroundColor: "#FBFAF9" },
|
|
1175
1178
|
children: /* @__PURE__ */ i("div", { className: "flex items-center gap-3 w-full", children: [
|
|
1176
1179
|
/* @__PURE__ */ e(
|
|
1177
|
-
|
|
1180
|
+
K,
|
|
1178
1181
|
{
|
|
1179
|
-
id:
|
|
1180
|
-
name:
|
|
1181
|
-
image:
|
|
1182
|
+
id: z,
|
|
1183
|
+
name: B,
|
|
1184
|
+
image: I,
|
|
1182
1185
|
size: 88,
|
|
1183
1186
|
shape: "circle"
|
|
1184
1187
|
}
|
|
1185
1188
|
),
|
|
1186
1189
|
/* @__PURE__ */ i("div", { className: "flex flex-col min-w-0 flex-1", children: [
|
|
1187
|
-
/* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children:
|
|
1188
|
-
|
|
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 }),
|
|
1189
1192
|
l && /* @__PURE__ */ e(
|
|
1190
1193
|
"span",
|
|
1191
1194
|
{
|
|
@@ -1208,101 +1211,103 @@ const xt = ({
|
|
|
1208
1211
|
u && /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(
|
|
1209
1212
|
de,
|
|
1210
1213
|
{
|
|
1211
|
-
onClick:
|
|
1212
|
-
disabled:
|
|
1213
|
-
"aria-busy":
|
|
1214
|
+
onClick: D,
|
|
1215
|
+
disabled: v,
|
|
1216
|
+
"aria-busy": v,
|
|
1214
1217
|
children: [
|
|
1215
|
-
|
|
1218
|
+
v ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(zs, { className: "h-5 w-5" }),
|
|
1216
1219
|
/* @__PURE__ */ e("span", { children: "Delete Conversation" })
|
|
1217
1220
|
]
|
|
1218
1221
|
}
|
|
1219
1222
|
) }),
|
|
1220
|
-
/* @__PURE__ */ e("li", { children:
|
|
1223
|
+
/* @__PURE__ */ e("li", { children: E ? /* @__PURE__ */ i(
|
|
1221
1224
|
de,
|
|
1222
1225
|
{
|
|
1223
|
-
onClick:
|
|
1224
|
-
disabled:
|
|
1225
|
-
"aria-busy":
|
|
1226
|
+
onClick: c,
|
|
1227
|
+
disabled: b,
|
|
1228
|
+
"aria-busy": b,
|
|
1226
1229
|
children: [
|
|
1227
|
-
|
|
1230
|
+
b ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(ke, { className: "h-5 w-5" }),
|
|
1228
1231
|
/* @__PURE__ */ e("span", { children: "Unblock" })
|
|
1229
1232
|
]
|
|
1230
1233
|
}
|
|
1231
1234
|
) : /* @__PURE__ */ i(
|
|
1232
1235
|
de,
|
|
1233
1236
|
{
|
|
1234
|
-
onClick:
|
|
1235
|
-
disabled:
|
|
1236
|
-
"aria-busy":
|
|
1237
|
+
onClick: h,
|
|
1238
|
+
disabled: b,
|
|
1239
|
+
"aria-busy": b,
|
|
1237
1240
|
children: [
|
|
1238
|
-
|
|
1241
|
+
b ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(ke, { className: "h-5 w-5" }),
|
|
1239
1242
|
/* @__PURE__ */ e("span", { children: "Block" })
|
|
1240
1243
|
]
|
|
1241
1244
|
}
|
|
1242
1245
|
) }),
|
|
1243
|
-
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(de, { variant: "danger", onClick:
|
|
1244
|
-
/* @__PURE__ */ e(
|
|
1246
|
+
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(de, { variant: "danger", onClick: x, children: [
|
|
1247
|
+
/* @__PURE__ */ e(Hs, { className: "h-5 w-5" }),
|
|
1245
1248
|
/* @__PURE__ */ e("span", { children: "Report" })
|
|
1246
|
-
] }) })
|
|
1249
|
+
] }) }),
|
|
1250
|
+
C
|
|
1247
1251
|
] })
|
|
1248
1252
|
] })
|
|
1249
1253
|
] })
|
|
1250
1254
|
}
|
|
1251
1255
|
)
|
|
1252
1256
|
);
|
|
1253
|
-
},
|
|
1257
|
+
}, Nt = ({
|
|
1254
1258
|
onBack: t,
|
|
1255
1259
|
showBackButton: s,
|
|
1256
1260
|
renderMessageInputActions: n,
|
|
1257
|
-
onLeaveConversation:
|
|
1261
|
+
onLeaveConversation: o,
|
|
1258
1262
|
onBlockParticipant: l,
|
|
1259
|
-
showDeleteConversation:
|
|
1260
|
-
onDeleteConversationClick:
|
|
1263
|
+
showDeleteConversation: d = !0,
|
|
1264
|
+
onDeleteConversationClick: a,
|
|
1261
1265
|
onBlockParticipantClick: u,
|
|
1262
|
-
onReportParticipantClick:
|
|
1263
|
-
showStarButton:
|
|
1264
|
-
chatbotVotingEnabled:
|
|
1265
|
-
renderChannelBanner:
|
|
1266
|
+
onReportParticipantClick: f,
|
|
1267
|
+
showStarButton: g = !1,
|
|
1268
|
+
chatbotVotingEnabled: N = !1,
|
|
1269
|
+
renderChannelBanner: C,
|
|
1270
|
+
customChannelActions: p
|
|
1266
1271
|
}) => {
|
|
1267
|
-
const { channel:
|
|
1268
|
-
(
|
|
1269
|
-
var
|
|
1270
|
-
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;
|
|
1271
1276
|
}
|
|
1272
|
-
), [
|
|
1273
|
-
const
|
|
1274
|
-
if (
|
|
1275
|
-
return String(
|
|
1276
|
-
if (
|
|
1277
|
-
return
|
|
1278
|
-
}, [
|
|
1279
|
-
var
|
|
1280
|
-
(
|
|
1281
|
-
}, []),
|
|
1282
|
-
var
|
|
1283
|
-
(
|
|
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();
|
|
1284
1289
|
}, []);
|
|
1285
1290
|
return /* @__PURE__ */ i(ve, { children: [
|
|
1286
1291
|
/* @__PURE__ */ e(
|
|
1287
|
-
|
|
1292
|
+
Us,
|
|
1288
1293
|
{
|
|
1289
1294
|
overrides: {
|
|
1290
|
-
Message: (
|
|
1295
|
+
Message: (m) => /* @__PURE__ */ e(it, { ...m, chatbotVotingEnabled: N })
|
|
1291
1296
|
},
|
|
1292
|
-
children: /* @__PURE__ */ i(
|
|
1297
|
+
children: /* @__PURE__ */ i(Bs, { children: [
|
|
1293
1298
|
/* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ e(
|
|
1294
|
-
|
|
1299
|
+
bt,
|
|
1295
1300
|
{
|
|
1296
1301
|
onBack: t,
|
|
1297
1302
|
showBackButton: s,
|
|
1298
|
-
onShowInfo:
|
|
1299
|
-
canShowInfo: !!
|
|
1300
|
-
showStarButton:
|
|
1303
|
+
onShowInfo: k,
|
|
1304
|
+
canShowInfo: !!S,
|
|
1305
|
+
showStarButton: g
|
|
1301
1306
|
}
|
|
1302
1307
|
) }),
|
|
1303
|
-
|
|
1308
|
+
C == null ? void 0 : C(),
|
|
1304
1309
|
/* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden relative", children: /* @__PURE__ */ e(
|
|
1305
|
-
|
|
1310
|
+
js,
|
|
1306
1311
|
{
|
|
1307
1312
|
hideDeletedMessages: !0,
|
|
1308
1313
|
hideNewMessageSeparator: !1,
|
|
@@ -1310,104 +1315,107 @@ const xt = ({
|
|
|
1310
1315
|
}
|
|
1311
1316
|
) }),
|
|
1312
1317
|
/* @__PURE__ */ e(
|
|
1313
|
-
|
|
1318
|
+
ht,
|
|
1314
1319
|
{
|
|
1315
|
-
renderActions: () => n == null ? void 0 : n(
|
|
1320
|
+
renderActions: () => n == null ? void 0 : n(r)
|
|
1316
1321
|
}
|
|
1317
1322
|
)
|
|
1318
1323
|
] })
|
|
1319
1324
|
}
|
|
1320
1325
|
),
|
|
1321
1326
|
/* @__PURE__ */ e(
|
|
1322
|
-
|
|
1327
|
+
Ct,
|
|
1323
1328
|
{
|
|
1324
|
-
dialogRef:
|
|
1325
|
-
onClose:
|
|
1326
|
-
participant:
|
|
1327
|
-
channel:
|
|
1328
|
-
followerStatusLabel:
|
|
1329
|
-
onLeaveConversation:
|
|
1329
|
+
dialogRef: E,
|
|
1330
|
+
onClose: b,
|
|
1331
|
+
participant: S,
|
|
1332
|
+
channel: r,
|
|
1333
|
+
followerStatusLabel: v,
|
|
1334
|
+
onLeaveConversation: o,
|
|
1330
1335
|
onBlockParticipant: l,
|
|
1331
|
-
showDeleteConversation:
|
|
1332
|
-
onDeleteConversationClick:
|
|
1336
|
+
showDeleteConversation: d,
|
|
1337
|
+
onDeleteConversationClick: a,
|
|
1333
1338
|
onBlockParticipantClick: u,
|
|
1334
|
-
onReportParticipantClick:
|
|
1339
|
+
onReportParticipantClick: f,
|
|
1340
|
+
customChannelActions: p
|
|
1335
1341
|
}
|
|
1336
1342
|
)
|
|
1337
1343
|
] });
|
|
1338
|
-
},
|
|
1344
|
+
}, $e = j.memo(
|
|
1339
1345
|
({
|
|
1340
1346
|
channel: t,
|
|
1341
1347
|
onBack: s,
|
|
1342
1348
|
showBackButton: n = !1,
|
|
1343
|
-
renderMessageInputActions:
|
|
1349
|
+
renderMessageInputActions: o,
|
|
1344
1350
|
onLeaveConversation: l,
|
|
1345
|
-
onBlockParticipant:
|
|
1346
|
-
className:
|
|
1347
|
-
CustomChannelEmptyState: u =
|
|
1348
|
-
showDeleteConversation:
|
|
1349
|
-
onDeleteConversationClick:
|
|
1350
|
-
onBlockParticipantClick:
|
|
1351
|
-
onReportParticipantClick:
|
|
1352
|
-
dmAgentEnabled:
|
|
1353
|
-
messageMetadata:
|
|
1354
|
-
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,
|
|
1355
1361
|
showStarButton: S = !1,
|
|
1356
|
-
chatbotVotingEnabled:
|
|
1357
|
-
renderChannelBanner:
|
|
1362
|
+
chatbotVotingEnabled: v = !1,
|
|
1363
|
+
renderChannelBanner: k,
|
|
1364
|
+
customChannelActions: b
|
|
1358
1365
|
}) => {
|
|
1359
|
-
const
|
|
1360
|
-
async (
|
|
1361
|
-
var
|
|
1362
|
-
const
|
|
1363
|
-
...
|
|
1364
|
-
...
|
|
1365
|
-
...
|
|
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 && {
|
|
1366
1373
|
metadata: {
|
|
1367
|
-
...
|
|
1368
|
-
...
|
|
1374
|
+
...D.metadata ?? {},
|
|
1375
|
+
...r
|
|
1369
1376
|
}
|
|
1370
1377
|
}
|
|
1371
|
-
},
|
|
1372
|
-
...
|
|
1373
|
-
...
|
|
1374
|
-
},
|
|
1375
|
-
return
|
|
1378
|
+
}, I = {
|
|
1379
|
+
...h,
|
|
1380
|
+
...x && { skip_push: !0 }
|
|
1381
|
+
}, T = await t.sendMessage(B, I);
|
|
1382
|
+
return E == null || E(T), T;
|
|
1376
1383
|
},
|
|
1377
|
-
[t,
|
|
1384
|
+
[t, p, r, E]
|
|
1378
1385
|
);
|
|
1379
1386
|
return /* @__PURE__ */ e(
|
|
1380
1387
|
"div",
|
|
1381
1388
|
{
|
|
1382
|
-
className:
|
|
1389
|
+
className: R(
|
|
1383
1390
|
"messaging-channel-view h-full flex flex-col",
|
|
1384
|
-
|
|
1391
|
+
a
|
|
1385
1392
|
),
|
|
1386
1393
|
children: /* @__PURE__ */ e(
|
|
1387
|
-
|
|
1394
|
+
Os,
|
|
1388
1395
|
{
|
|
1389
1396
|
channel: t,
|
|
1390
|
-
MessageSystem:
|
|
1397
|
+
MessageSystem: ft,
|
|
1391
1398
|
EmptyStateIndicator: u,
|
|
1392
1399
|
LoadingIndicator: he,
|
|
1393
|
-
DateSeparator:
|
|
1394
|
-
doSendMessageRequest:
|
|
1400
|
+
DateSeparator: et,
|
|
1401
|
+
doSendMessageRequest: m,
|
|
1395
1402
|
children: /* @__PURE__ */ e(
|
|
1396
|
-
|
|
1403
|
+
Nt,
|
|
1397
1404
|
{
|
|
1398
1405
|
onBack: s,
|
|
1399
1406
|
showBackButton: n,
|
|
1400
|
-
renderMessageInputActions:
|
|
1407
|
+
renderMessageInputActions: o,
|
|
1401
1408
|
onLeaveConversation: l,
|
|
1402
|
-
onBlockParticipant:
|
|
1409
|
+
onBlockParticipant: d,
|
|
1403
1410
|
CustomChannelEmptyState: u,
|
|
1404
|
-
showDeleteConversation:
|
|
1405
|
-
onDeleteConversationClick:
|
|
1406
|
-
onBlockParticipantClick:
|
|
1407
|
-
onReportParticipantClick:
|
|
1411
|
+
showDeleteConversation: f,
|
|
1412
|
+
onDeleteConversationClick: g,
|
|
1413
|
+
onBlockParticipantClick: N,
|
|
1414
|
+
onReportParticipantClick: C,
|
|
1408
1415
|
showStarButton: S,
|
|
1409
|
-
chatbotVotingEnabled:
|
|
1410
|
-
renderChannelBanner:
|
|
1416
|
+
chatbotVotingEnabled: v,
|
|
1417
|
+
renderChannelBanner: k,
|
|
1418
|
+
customChannelActions: b
|
|
1411
1419
|
}
|
|
1412
1420
|
)
|
|
1413
1421
|
}
|
|
@@ -1416,16 +1424,16 @@ const xt = ({
|
|
|
1416
1424
|
);
|
|
1417
1425
|
}
|
|
1418
1426
|
);
|
|
1419
|
-
|
|
1420
|
-
function
|
|
1427
|
+
$e.displayName = "ChannelView";
|
|
1428
|
+
function vt({
|
|
1421
1429
|
searchQuery: t,
|
|
1422
1430
|
setSearchQuery: s,
|
|
1423
1431
|
placeholder: n
|
|
1424
1432
|
}) {
|
|
1425
|
-
const
|
|
1433
|
+
const o = q(null);
|
|
1426
1434
|
return /* @__PURE__ */ i("div", { className: "relative", children: [
|
|
1427
1435
|
/* @__PURE__ */ e(
|
|
1428
|
-
|
|
1436
|
+
Gs,
|
|
1429
1437
|
{
|
|
1430
1438
|
className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-stone",
|
|
1431
1439
|
weight: "bold"
|
|
@@ -1434,7 +1442,7 @@ function Nt({
|
|
|
1434
1442
|
/* @__PURE__ */ e(
|
|
1435
1443
|
"input",
|
|
1436
1444
|
{
|
|
1437
|
-
ref:
|
|
1445
|
+
ref: o,
|
|
1438
1446
|
type: "text",
|
|
1439
1447
|
placeholder: n,
|
|
1440
1448
|
value: t,
|
|
@@ -1443,12 +1451,12 @@ function Nt({
|
|
|
1443
1451
|
}
|
|
1444
1452
|
),
|
|
1445
1453
|
t && /* @__PURE__ */ e(
|
|
1446
|
-
|
|
1454
|
+
je,
|
|
1447
1455
|
{
|
|
1448
1456
|
label: "Clear search",
|
|
1449
1457
|
onClick: () => {
|
|
1450
1458
|
var l;
|
|
1451
|
-
s(""), (l =
|
|
1459
|
+
s(""), (l = o.current) == null || l.focus();
|
|
1452
1460
|
},
|
|
1453
1461
|
className: "absolute right-3 top-1/2 -translate-y-1/2 p-1 text-stone hover:text-charcoal",
|
|
1454
1462
|
children: /* @__PURE__ */ e(pe, { className: "h-4 w-4", weight: "bold" })
|
|
@@ -1456,144 +1464,144 @@ function Nt({
|
|
|
1456
1464
|
)
|
|
1457
1465
|
] });
|
|
1458
1466
|
}
|
|
1459
|
-
const
|
|
1467
|
+
const wt = ({
|
|
1460
1468
|
participantSource: t,
|
|
1461
1469
|
onSelectParticipant: s,
|
|
1462
1470
|
onClose: n,
|
|
1463
|
-
existingParticipantIds:
|
|
1471
|
+
existingParticipantIds: o = /* @__PURE__ */ new Set(),
|
|
1464
1472
|
participantLabel: l = "participants",
|
|
1465
|
-
searchPlaceholder:
|
|
1466
|
-
className:
|
|
1473
|
+
searchPlaceholder: d = "Search participants...",
|
|
1474
|
+
className: a
|
|
1467
1475
|
}) => {
|
|
1468
|
-
const { debug: u } = fe(), [
|
|
1476
|
+
const { debug: u } = fe(), [f, g] = _(""), [N, C] = _([]), [p, r] = _(!1), [E, S] = _(null), [v, k] = _(
|
|
1469
1477
|
null
|
|
1470
|
-
),
|
|
1471
|
-
|
|
1478
|
+
), b = q(!1);
|
|
1479
|
+
Z(() => {
|
|
1472
1480
|
if (t.loading) {
|
|
1473
1481
|
u && console.log(
|
|
1474
1482
|
"[ParticipantPicker] Waiting for participant source to finish loading..."
|
|
1475
1483
|
);
|
|
1476
1484
|
return;
|
|
1477
1485
|
}
|
|
1478
|
-
if (
|
|
1486
|
+
if (b.current) return;
|
|
1479
1487
|
(async () => {
|
|
1480
|
-
u && console.log("[ParticipantPicker] Loading initial participants..."),
|
|
1488
|
+
u && console.log("[ParticipantPicker] Loading initial participants..."), r(!0), S(null);
|
|
1481
1489
|
try {
|
|
1482
|
-
const
|
|
1490
|
+
const c = await t.loadParticipants({
|
|
1483
1491
|
search: "",
|
|
1484
1492
|
// Load all participants initially
|
|
1485
1493
|
limit: 100
|
|
1486
1494
|
});
|
|
1487
|
-
|
|
1495
|
+
C(c.participants), b.current = !0, u && console.log(
|
|
1488
1496
|
"[ParticipantPicker] Participants loaded successfully:",
|
|
1489
|
-
|
|
1497
|
+
c.participants.length
|
|
1490
1498
|
);
|
|
1491
|
-
} catch (
|
|
1492
|
-
const
|
|
1493
|
-
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);
|
|
1494
1502
|
} finally {
|
|
1495
|
-
|
|
1503
|
+
r(!1);
|
|
1496
1504
|
}
|
|
1497
1505
|
})();
|
|
1498
1506
|
}, [t.loading, u]);
|
|
1499
|
-
const
|
|
1500
|
-
var
|
|
1501
|
-
if (!
|
|
1502
|
-
const
|
|
1503
|
-
return
|
|
1504
|
-
}),
|
|
1505
|
-
async (
|
|
1506
|
-
if (!
|
|
1507
|
-
|
|
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);
|
|
1508
1516
|
try {
|
|
1509
|
-
await s(
|
|
1510
|
-
} catch (
|
|
1511
|
-
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);
|
|
1512
1520
|
}
|
|
1513
1521
|
}
|
|
1514
1522
|
},
|
|
1515
|
-
[s,
|
|
1516
|
-
),
|
|
1517
|
-
(
|
|
1523
|
+
[s, v]
|
|
1524
|
+
), D = (h, c) => {
|
|
1525
|
+
(h.key === "Enter" || h.key === " ") && (h.preventDefault(), w(c));
|
|
1518
1526
|
};
|
|
1519
|
-
return /* @__PURE__ */ i("div", { className:
|
|
1527
|
+
return /* @__PURE__ */ i("div", { className: R("flex flex-col h-full", a), children: [
|
|
1520
1528
|
/* @__PURE__ */ i("div", { className: "px-4 py-4 border-b border-sand bg-chalk", children: [
|
|
1521
1529
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between mb-3", children: [
|
|
1522
1530
|
/* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-charcoal", children: "Start a new Conversation" }),
|
|
1523
|
-
/* @__PURE__ */ e(
|
|
1531
|
+
/* @__PURE__ */ e(Ae, { onClick: n })
|
|
1524
1532
|
] }),
|
|
1525
1533
|
/* @__PURE__ */ i("p", { className: "text-xs text-stone mb-3", children: [
|
|
1526
1534
|
"Select a ",
|
|
1527
1535
|
l.slice(0, -1),
|
|
1528
1536
|
" to start messaging (",
|
|
1529
|
-
|
|
1537
|
+
m.length,
|
|
1530
1538
|
" available)",
|
|
1531
1539
|
t.totalCount !== void 0 && ` • ${t.totalCount} ${l} total`
|
|
1532
1540
|
] }),
|
|
1533
1541
|
/* @__PURE__ */ e(
|
|
1534
|
-
|
|
1542
|
+
vt,
|
|
1535
1543
|
{
|
|
1536
|
-
searchQuery:
|
|
1537
|
-
setSearchQuery:
|
|
1538
|
-
placeholder:
|
|
1544
|
+
searchQuery: f,
|
|
1545
|
+
setSearchQuery: g,
|
|
1546
|
+
placeholder: d
|
|
1539
1547
|
}
|
|
1540
1548
|
)
|
|
1541
1549
|
] }),
|
|
1542
|
-
|
|
1550
|
+
E && /* @__PURE__ */ i("div", { className: "p-4 text-sm text-danger bg-danger-alt", children: [
|
|
1543
1551
|
"Error loading ",
|
|
1544
1552
|
l,
|
|
1545
1553
|
": ",
|
|
1546
|
-
|
|
1554
|
+
E
|
|
1547
1555
|
] }),
|
|
1548
|
-
/* @__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: [
|
|
1549
1557
|
/* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
|
|
1550
1558
|
/* @__PURE__ */ i("span", { className: "text-sm text-stone", children: [
|
|
1551
1559
|
"Loading ",
|
|
1552
1560
|
l,
|
|
1553
1561
|
"..."
|
|
1554
1562
|
] })
|
|
1555
|
-
] }) }) :
|
|
1556
|
-
/* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(
|
|
1557
|
-
/* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children:
|
|
1558
|
-
/* @__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` })
|
|
1559
1567
|
] }) : /* @__PURE__ */ i("ul", { className: "space-y-0", children: [
|
|
1560
|
-
|
|
1561
|
-
const
|
|
1568
|
+
m.map((h) => {
|
|
1569
|
+
const c = h.name || h.email || h.id, x = h.email && h.name ? h.email : h.phone;
|
|
1562
1570
|
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
|
|
1563
1571
|
"button",
|
|
1564
1572
|
{
|
|
1565
1573
|
type: "button",
|
|
1566
|
-
onClick: () =>
|
|
1567
|
-
onKeyDown: (
|
|
1574
|
+
onClick: () => w(h),
|
|
1575
|
+
onKeyDown: (B) => D(B, h),
|
|
1568
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",
|
|
1569
1577
|
children: /* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [
|
|
1570
1578
|
/* @__PURE__ */ i("div", { className: "flex items-center space-x-3 flex-1 min-w-0", children: [
|
|
1571
1579
|
/* @__PURE__ */ e(
|
|
1572
|
-
|
|
1580
|
+
K,
|
|
1573
1581
|
{
|
|
1574
|
-
id:
|
|
1575
|
-
name:
|
|
1576
|
-
image:
|
|
1582
|
+
id: h.id,
|
|
1583
|
+
name: c,
|
|
1584
|
+
image: h.image,
|
|
1577
1585
|
size: 40
|
|
1578
1586
|
}
|
|
1579
1587
|
),
|
|
1580
1588
|
/* @__PURE__ */ i("div", { className: "flex-1 min-w-0", children: [
|
|
1581
|
-
/* @__PURE__ */ e("h4", { className: "text-sm font-medium text-charcoal truncate", children:
|
|
1582
|
-
|
|
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 })
|
|
1583
1591
|
] })
|
|
1584
1592
|
] }),
|
|
1585
|
-
/* @__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" }) })
|
|
1586
1594
|
] })
|
|
1587
1595
|
}
|
|
1588
|
-
) },
|
|
1596
|
+
) }, h.id);
|
|
1589
1597
|
}),
|
|
1590
|
-
|
|
1598
|
+
p && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
|
|
1591
1599
|
/* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
|
|
1592
1600
|
/* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading more..." })
|
|
1593
1601
|
] }) })
|
|
1594
1602
|
] }) })
|
|
1595
1603
|
] });
|
|
1596
|
-
},
|
|
1604
|
+
}, pt = ({ className: t }) => /* @__PURE__ */ i(
|
|
1597
1605
|
"svg",
|
|
1598
1606
|
{
|
|
1599
1607
|
width: "140",
|
|
@@ -1727,17 +1735,17 @@ const vt = ({
|
|
|
1727
1735
|
] })
|
|
1728
1736
|
]
|
|
1729
1737
|
}
|
|
1730
|
-
),
|
|
1738
|
+
), ze = j.memo(
|
|
1731
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: [
|
|
1732
|
-
/* @__PURE__ */ e(
|
|
1740
|
+
/* @__PURE__ */ e(pt, {}),
|
|
1733
1741
|
s && !t && /* @__PURE__ */ i("div", { className: "mt-8", children: [
|
|
1734
1742
|
/* @__PURE__ */ e("h2", { className: "font-medium text-black text-[18px] mb-2", children: "Your inbox is empty" }),
|
|
1735
1743
|
/* @__PURE__ */ e("p", { className: "text-[#676B5F] text-sm mb-6", children: "Share with your followers to start receiving messages" })
|
|
1736
1744
|
] })
|
|
1737
1745
|
] }) })
|
|
1738
1746
|
);
|
|
1739
|
-
|
|
1740
|
-
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: [
|
|
1741
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: "⚠️" }) }),
|
|
1742
1750
|
/* @__PURE__ */ e("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
|
|
1743
1751
|
/* @__PURE__ */ e("p", { className: "text-stone text-sm mb-6", children: t }),
|
|
@@ -1752,217 +1760,218 @@ const me = A.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { clas
|
|
|
1752
1760
|
)
|
|
1753
1761
|
] }) }));
|
|
1754
1762
|
me.displayName = "ErrorState";
|
|
1755
|
-
const
|
|
1763
|
+
const Tt = ({
|
|
1756
1764
|
capabilities: t = {},
|
|
1757
1765
|
className: s,
|
|
1758
1766
|
renderMessageInputActions: n,
|
|
1759
|
-
onChannelSelect:
|
|
1767
|
+
onChannelSelect: o,
|
|
1760
1768
|
onParticipantSelect: l,
|
|
1761
|
-
initialParticipantFilter:
|
|
1762
|
-
initialParticipantData:
|
|
1769
|
+
initialParticipantFilter: d,
|
|
1770
|
+
initialParticipantData: a,
|
|
1763
1771
|
CustomChannelEmptyState: u,
|
|
1764
|
-
showChannelList:
|
|
1765
|
-
filters:
|
|
1766
|
-
channelListCustomEmptyStateIndicator:
|
|
1767
|
-
onDeleteConversationClick:
|
|
1768
|
-
onBlockParticipantClick:
|
|
1769
|
-
onReportParticipantClick:
|
|
1770
|
-
dmAgentEnabled:
|
|
1772
|
+
showChannelList: f = !0,
|
|
1773
|
+
filters: g,
|
|
1774
|
+
channelListCustomEmptyStateIndicator: N,
|
|
1775
|
+
onDeleteConversationClick: C,
|
|
1776
|
+
onBlockParticipantClick: p,
|
|
1777
|
+
onReportParticipantClick: r,
|
|
1778
|
+
dmAgentEnabled: E,
|
|
1771
1779
|
messageMetadata: S,
|
|
1772
|
-
onMessageSent:
|
|
1773
|
-
showStarButton:
|
|
1774
|
-
chatbotVotingEnabled:
|
|
1775
|
-
renderMessagePreview:
|
|
1776
|
-
renderChannelBanner:
|
|
1780
|
+
onMessageSent: v,
|
|
1781
|
+
showStarButton: k = !1,
|
|
1782
|
+
chatbotVotingEnabled: b = !1,
|
|
1783
|
+
renderMessagePreview: m,
|
|
1784
|
+
renderChannelBanner: w,
|
|
1785
|
+
customChannelActions: D
|
|
1777
1786
|
}) => {
|
|
1778
1787
|
const {
|
|
1779
|
-
service:
|
|
1780
|
-
client:
|
|
1781
|
-
isConnected:
|
|
1782
|
-
isLoading:
|
|
1783
|
-
error:
|
|
1784
|
-
refreshConnection:
|
|
1785
|
-
debug:
|
|
1786
|
-
} =
|
|
1787
|
-
participantSource:
|
|
1788
|
-
participantLabel:
|
|
1789
|
-
showDeleteConversation:
|
|
1790
|
-
} = t,
|
|
1791
|
-
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;
|
|
1792
1801
|
return {
|
|
1793
1802
|
...{
|
|
1794
1803
|
type: "messaging",
|
|
1795
1804
|
last_message_at: { $exists: !0 },
|
|
1796
|
-
...
|
|
1797
|
-
members: { $in: [
|
|
1805
|
+
...y && {
|
|
1806
|
+
members: { $in: [y] },
|
|
1798
1807
|
hidden: !1
|
|
1799
1808
|
}
|
|
1800
1809
|
},
|
|
1801
|
-
...
|
|
1810
|
+
...g
|
|
1802
1811
|
};
|
|
1803
|
-
}, [
|
|
1804
|
-
if (!
|
|
1805
|
-
const
|
|
1806
|
-
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)
|
|
1807
1816
|
try {
|
|
1808
|
-
|
|
1809
|
-
const
|
|
1817
|
+
M && console.log("[MessagingShell] Syncing channels for user:", y);
|
|
1818
|
+
const $ = await c.queryChannels(
|
|
1810
1819
|
{
|
|
1811
1820
|
type: "messaging",
|
|
1812
|
-
members: { $in: [
|
|
1821
|
+
members: { $in: [y] }
|
|
1813
1822
|
},
|
|
1814
1823
|
{},
|
|
1815
1824
|
{ limit: 100 }
|
|
1816
|
-
),
|
|
1817
|
-
|
|
1818
|
-
const ge =
|
|
1819
|
-
Object.values(ge).forEach((
|
|
1820
|
-
var
|
|
1821
|
-
const xe = (
|
|
1822
|
-
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);
|
|
1823
1832
|
});
|
|
1824
|
-
}),
|
|
1825
|
-
channelCount:
|
|
1826
|
-
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
|
|
1827
1836
|
});
|
|
1828
|
-
} catch (
|
|
1829
|
-
console.error("[MessagingShell] Failed to sync channels:",
|
|
1837
|
+
} catch ($) {
|
|
1838
|
+
console.error("[MessagingShell] Failed to sync channels:", $);
|
|
1830
1839
|
}
|
|
1831
|
-
}, [
|
|
1832
|
-
|
|
1833
|
-
if (!
|
|
1834
|
-
const
|
|
1835
|
-
|
|
1836
|
-
}, [
|
|
1837
|
-
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;
|
|
1838
1847
|
(async () => {
|
|
1839
|
-
const
|
|
1840
|
-
if (
|
|
1848
|
+
const $ = c.userID;
|
|
1849
|
+
if ($)
|
|
1841
1850
|
try {
|
|
1842
|
-
|
|
1851
|
+
M && console.log(
|
|
1843
1852
|
"[MessagingShell] Loading initial conversation with:",
|
|
1844
|
-
|
|
1853
|
+
d
|
|
1845
1854
|
);
|
|
1846
|
-
const
|
|
1855
|
+
const U = await c.queryChannels(
|
|
1847
1856
|
{
|
|
1848
1857
|
type: "messaging",
|
|
1849
|
-
members: { $eq: [
|
|
1858
|
+
members: { $eq: [$, d] }
|
|
1850
1859
|
},
|
|
1851
1860
|
{},
|
|
1852
1861
|
{ limit: 1 }
|
|
1853
1862
|
);
|
|
1854
|
-
if (
|
|
1855
|
-
|
|
1863
|
+
if (U.length > 0)
|
|
1864
|
+
z(U[0]), W(!0), Q(null), o && o(U[0]), M && console.log(
|
|
1856
1865
|
"[MessagingShell] Initial conversation loaded:",
|
|
1857
|
-
|
|
1866
|
+
U[0].id
|
|
1858
1867
|
);
|
|
1859
|
-
else if (
|
|
1860
|
-
|
|
1868
|
+
else if (a && h) {
|
|
1869
|
+
M && console.log(
|
|
1861
1870
|
"[MessagingShell] No conversation found, creating one for:",
|
|
1862
|
-
|
|
1871
|
+
a
|
|
1863
1872
|
);
|
|
1864
1873
|
try {
|
|
1865
|
-
const
|
|
1866
|
-
id:
|
|
1867
|
-
name:
|
|
1868
|
-
email:
|
|
1869
|
-
phone:
|
|
1874
|
+
const A = await h.startChannelWithParticipant({
|
|
1875
|
+
id: a.id,
|
|
1876
|
+
name: a.name,
|
|
1877
|
+
email: a.email,
|
|
1878
|
+
phone: a.phone
|
|
1870
1879
|
});
|
|
1871
|
-
|
|
1880
|
+
z(A), W(!0), Q(null), o && o(A), M && console.log(
|
|
1872
1881
|
"[MessagingShell] Channel created and loaded:",
|
|
1873
|
-
|
|
1882
|
+
A.id
|
|
1874
1883
|
);
|
|
1875
|
-
} catch (
|
|
1884
|
+
} catch (A) {
|
|
1876
1885
|
console.error(
|
|
1877
1886
|
"[MessagingShell] Failed to create conversation:",
|
|
1878
|
-
|
|
1879
|
-
),
|
|
1887
|
+
A
|
|
1888
|
+
), Q("Failed to create conversation");
|
|
1880
1889
|
}
|
|
1881
1890
|
} else
|
|
1882
|
-
|
|
1891
|
+
Q(
|
|
1883
1892
|
"No conversation found with this account"
|
|
1884
|
-
),
|
|
1893
|
+
), M && console.log(
|
|
1885
1894
|
"[MessagingShell] No conversation found for:",
|
|
1886
|
-
|
|
1895
|
+
d
|
|
1887
1896
|
);
|
|
1888
|
-
} catch (
|
|
1897
|
+
} catch (U) {
|
|
1889
1898
|
console.error(
|
|
1890
1899
|
"[MessagingShell] Failed to load initial conversation:",
|
|
1891
|
-
|
|
1892
|
-
),
|
|
1900
|
+
U
|
|
1901
|
+
), Q("Failed to load conversation");
|
|
1893
1902
|
}
|
|
1894
1903
|
})();
|
|
1895
1904
|
}, [
|
|
1896
|
-
c,
|
|
1897
|
-
r,
|
|
1898
1905
|
d,
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1906
|
+
a,
|
|
1907
|
+
c,
|
|
1908
|
+
x,
|
|
1909
|
+
h,
|
|
1910
|
+
M,
|
|
1911
|
+
o
|
|
1903
1912
|
]);
|
|
1904
|
-
const
|
|
1905
|
-
(
|
|
1906
|
-
|
|
1913
|
+
const Ve = L(
|
|
1914
|
+
(y) => {
|
|
1915
|
+
z(y), o == null || o(y);
|
|
1907
1916
|
},
|
|
1908
|
-
[
|
|
1909
|
-
),
|
|
1910
|
-
|
|
1911
|
-
}, [
|
|
1912
|
-
async (
|
|
1913
|
-
var
|
|
1914
|
-
if (
|
|
1917
|
+
[o]
|
|
1918
|
+
), We = L(() => {
|
|
1919
|
+
F || z(null);
|
|
1920
|
+
}, [F]), qe = L(
|
|
1921
|
+
async (y) => {
|
|
1922
|
+
var $;
|
|
1923
|
+
if (h)
|
|
1915
1924
|
try {
|
|
1916
|
-
|
|
1925
|
+
M && console.log(
|
|
1917
1926
|
"[MessagingShell] Starting conversation with:",
|
|
1918
|
-
|
|
1927
|
+
y.id
|
|
1919
1928
|
);
|
|
1920
|
-
const
|
|
1921
|
-
id:
|
|
1922
|
-
name:
|
|
1923
|
-
email:
|
|
1924
|
-
phone:
|
|
1929
|
+
const U = await h.startChannelWithParticipant({
|
|
1930
|
+
id: y.id,
|
|
1931
|
+
name: y.name,
|
|
1932
|
+
email: y.email,
|
|
1933
|
+
phone: y.phone
|
|
1925
1934
|
});
|
|
1926
1935
|
try {
|
|
1927
|
-
await
|
|
1928
|
-
} catch (
|
|
1929
|
-
console.warn("[MessagingShell] Failed to unhide channel:",
|
|
1936
|
+
await U.show();
|
|
1937
|
+
} catch (A) {
|
|
1938
|
+
console.warn("[MessagingShell] Failed to unhide channel:", A);
|
|
1930
1939
|
}
|
|
1931
|
-
|
|
1932
|
-
} catch (
|
|
1933
|
-
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);
|
|
1934
1943
|
}
|
|
1935
1944
|
},
|
|
1936
|
-
[
|
|
1937
|
-
), ie =
|
|
1938
|
-
var
|
|
1939
|
-
|
|
1940
|
-
}, []),
|
|
1941
|
-
(
|
|
1942
|
-
|
|
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();
|
|
1943
1952
|
},
|
|
1944
1953
|
[ie]
|
|
1945
|
-
),
|
|
1946
|
-
async (
|
|
1947
|
-
|
|
1954
|
+
), Ye = L(
|
|
1955
|
+
async (y) => {
|
|
1956
|
+
M && console.log("[MessagingShell] Leaving conversation:", y.id), z(null), W(!1), le.current = null, await ne();
|
|
1948
1957
|
},
|
|
1949
|
-
[
|
|
1950
|
-
),
|
|
1951
|
-
async (
|
|
1952
|
-
|
|
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();
|
|
1953
1962
|
},
|
|
1954
|
-
[
|
|
1955
|
-
), ce = !!
|
|
1956
|
-
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(
|
|
1957
1966
|
me,
|
|
1958
1967
|
{
|
|
1959
1968
|
message: "Not connected to messaging service",
|
|
1960
|
-
onBack:
|
|
1969
|
+
onBack: T
|
|
1961
1970
|
}
|
|
1962
|
-
) }) :
|
|
1971
|
+
) }) : ae ? /* @__PURE__ */ e("div", { className: R("h-full", s), children: /* @__PURE__ */ e(me, { message: ae }) }) : /* @__PURE__ */ i(
|
|
1963
1972
|
"div",
|
|
1964
1973
|
{
|
|
1965
|
-
className:
|
|
1974
|
+
className: R(
|
|
1966
1975
|
"messaging-shell h-full bg-background-primary overflow-hidden",
|
|
1967
1976
|
s
|
|
1968
1977
|
),
|
|
@@ -1971,24 +1980,24 @@ const Dt = ({
|
|
|
1971
1980
|
/* @__PURE__ */ e(
|
|
1972
1981
|
"div",
|
|
1973
1982
|
{
|
|
1974
|
-
className:
|
|
1983
|
+
className: R(
|
|
1975
1984
|
"messaging-channel-list-sidebar min-h-0 min-w-0 lg:flex lg:flex-col",
|
|
1976
1985
|
{
|
|
1977
|
-
"!hidden":
|
|
1986
|
+
"!hidden": f === !1 || F,
|
|
1978
1987
|
// Hide on mobile when channel selected, show on desktop with consistent wide width
|
|
1979
|
-
"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,
|
|
1980
1989
|
// Show on mobile when no channel selected, use same wide width on desktop
|
|
1981
|
-
"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
|
|
1982
1991
|
}
|
|
1983
1992
|
),
|
|
1984
1993
|
children: /* @__PURE__ */ e(
|
|
1985
|
-
|
|
1994
|
+
Be,
|
|
1986
1995
|
{
|
|
1987
|
-
onChannelSelect:
|
|
1988
|
-
selectedChannel:
|
|
1989
|
-
filters:
|
|
1990
|
-
customEmptyStateIndicator:
|
|
1991
|
-
renderMessagePreview:
|
|
1996
|
+
onChannelSelect: Ve,
|
|
1997
|
+
selectedChannel: G || void 0,
|
|
1998
|
+
filters: Ge,
|
|
1999
|
+
customEmptyStateIndicator: N,
|
|
2000
|
+
renderMessagePreview: m
|
|
1992
2001
|
}
|
|
1993
2002
|
)
|
|
1994
2003
|
}
|
|
@@ -1996,80 +2005,81 @@ const Dt = ({
|
|
|
1996
2005
|
/* @__PURE__ */ e(
|
|
1997
2006
|
"div",
|
|
1998
2007
|
{
|
|
1999
|
-
className:
|
|
2008
|
+
className: R(
|
|
2000
2009
|
"messaging-conversation-view flex-1 flex-col min-w-0 min-h-0",
|
|
2001
2010
|
{
|
|
2002
2011
|
// In direct conversation mode (or waiting for it), always show (full width)
|
|
2003
|
-
flex:
|
|
2012
|
+
flex: F || ce || d,
|
|
2004
2013
|
// Normal mode: hide on mobile when no channel selected
|
|
2005
|
-
"hidden lg:flex": !
|
|
2014
|
+
"hidden lg:flex": !F && !ce && !d
|
|
2006
2015
|
}
|
|
2007
2016
|
),
|
|
2008
|
-
children:
|
|
2009
|
-
|
|
2017
|
+
children: G ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
|
|
2018
|
+
$e,
|
|
2010
2019
|
{
|
|
2011
|
-
channel:
|
|
2012
|
-
onBack:
|
|
2013
|
-
showBackButton: !
|
|
2020
|
+
channel: G,
|
|
2021
|
+
onBack: We,
|
|
2022
|
+
showBackButton: !F,
|
|
2014
2023
|
renderMessageInputActions: n,
|
|
2015
|
-
renderChannelBanner:
|
|
2016
|
-
onLeaveConversation:
|
|
2017
|
-
onBlockParticipant:
|
|
2024
|
+
renderChannelBanner: w,
|
|
2025
|
+
onLeaveConversation: Ye,
|
|
2026
|
+
onBlockParticipant: Je,
|
|
2018
2027
|
CustomChannelEmptyState: u,
|
|
2019
|
-
showDeleteConversation:
|
|
2020
|
-
onDeleteConversationClick:
|
|
2021
|
-
onBlockParticipantClick:
|
|
2022
|
-
onReportParticipantClick:
|
|
2023
|
-
dmAgentEnabled:
|
|
2028
|
+
showDeleteConversation: He,
|
|
2029
|
+
onDeleteConversationClick: C,
|
|
2030
|
+
onBlockParticipantClick: p,
|
|
2031
|
+
onReportParticipantClick: r,
|
|
2032
|
+
dmAgentEnabled: E,
|
|
2024
2033
|
messageMetadata: S,
|
|
2025
|
-
onMessageSent:
|
|
2026
|
-
showStarButton:
|
|
2027
|
-
chatbotVotingEnabled:
|
|
2034
|
+
onMessageSent: v,
|
|
2035
|
+
showStarButton: k,
|
|
2036
|
+
chatbotVotingEnabled: b,
|
|
2037
|
+
customChannelActions: D
|
|
2028
2038
|
},
|
|
2029
|
-
|
|
2030
|
-
) }) :
|
|
2039
|
+
G.id
|
|
2040
|
+
) }) : d ? (
|
|
2031
2041
|
// Show loading while creating/loading direct conversation channel
|
|
2032
2042
|
/* @__PURE__ */ e(he, {})
|
|
2033
2043
|
) : /* @__PURE__ */ e(
|
|
2034
|
-
|
|
2044
|
+
ze,
|
|
2035
2045
|
{
|
|
2036
|
-
hasChannels:
|
|
2037
|
-
channelsLoaded:
|
|
2046
|
+
hasChannels: ee,
|
|
2047
|
+
channelsLoaded: se
|
|
2038
2048
|
}
|
|
2039
2049
|
)
|
|
2040
2050
|
}
|
|
2041
2051
|
)
|
|
2042
2052
|
] }),
|
|
2043
|
-
|
|
2053
|
+
oe && // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
|
|
2044
2054
|
/* @__PURE__ */ e(
|
|
2045
2055
|
"dialog",
|
|
2046
2056
|
{
|
|
2047
|
-
ref:
|
|
2057
|
+
ref: X,
|
|
2048
2058
|
className: "mes-dialog",
|
|
2049
|
-
onClick:
|
|
2059
|
+
onClick: Ze,
|
|
2050
2060
|
onClose: ie,
|
|
2051
2061
|
children: /* @__PURE__ */ e("div", { className: "h-full w-full bg-white shadow-max-elevation-light", children: /* @__PURE__ */ e(
|
|
2052
|
-
|
|
2062
|
+
wt,
|
|
2053
2063
|
{
|
|
2054
|
-
participantSource:
|
|
2055
|
-
onSelectParticipant:
|
|
2064
|
+
participantSource: oe,
|
|
2065
|
+
onSelectParticipant: qe,
|
|
2056
2066
|
onClose: ie,
|
|
2057
|
-
existingParticipantIds:
|
|
2058
|
-
participantLabel:
|
|
2059
|
-
searchPlaceholder: `Search ${
|
|
2067
|
+
existingParticipantIds: J,
|
|
2068
|
+
participantLabel: Ee,
|
|
2069
|
+
searchPlaceholder: `Search ${Ee}...`
|
|
2060
2070
|
},
|
|
2061
|
-
|
|
2071
|
+
O
|
|
2062
2072
|
) })
|
|
2063
2073
|
}
|
|
2064
2074
|
)
|
|
2065
2075
|
]
|
|
2066
2076
|
}
|
|
2067
2077
|
);
|
|
2068
|
-
},
|
|
2078
|
+
}, yt = ({
|
|
2069
2079
|
question: t,
|
|
2070
2080
|
onClick: s,
|
|
2071
2081
|
loading: n = !1,
|
|
2072
|
-
className:
|
|
2082
|
+
className: o
|
|
2073
2083
|
}) => /* @__PURE__ */ e(
|
|
2074
2084
|
"button",
|
|
2075
2085
|
{
|
|
@@ -2077,33 +2087,33 @@ const Dt = ({
|
|
|
2077
2087
|
onClick: s,
|
|
2078
2088
|
disabled: n,
|
|
2079
2089
|
style: { backgroundColor: "#E6E5E3" },
|
|
2080
|
-
className:
|
|
2090
|
+
className: R(
|
|
2081
2091
|
"w-full text-center p-4 rounded-xl text-charcoal font-medium transition-colors",
|
|
2082
2092
|
{
|
|
2083
2093
|
"hover:brightness-95 active:brightness-90": !n,
|
|
2084
2094
|
"opacity-50 cursor-not-allowed": n
|
|
2085
2095
|
},
|
|
2086
|
-
|
|
2096
|
+
o
|
|
2087
2097
|
),
|
|
2088
2098
|
children: t
|
|
2089
2099
|
}
|
|
2090
|
-
),
|
|
2100
|
+
), Ft = ({
|
|
2091
2101
|
faqs: t,
|
|
2092
2102
|
onFaqClick: s,
|
|
2093
2103
|
loadingFaqId: n,
|
|
2094
|
-
headerText:
|
|
2104
|
+
headerText: o,
|
|
2095
2105
|
className: l,
|
|
2096
|
-
avatarImage:
|
|
2097
|
-
avatarName:
|
|
2106
|
+
avatarImage: d,
|
|
2107
|
+
avatarName: a
|
|
2098
2108
|
}) => {
|
|
2099
|
-
const u = t.filter((
|
|
2109
|
+
const u = t.filter((f) => f.enabled).sort((f, g) => (f.order ?? 0) - (g.order ?? 0));
|
|
2100
2110
|
return u.length === 0 ? null : /* @__PURE__ */ e("div", { className: l, children: /* @__PURE__ */ i("div", { className: "flex gap-3 items-end", children: [
|
|
2101
|
-
(
|
|
2102
|
-
|
|
2111
|
+
(d || a) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
|
|
2112
|
+
K,
|
|
2103
2113
|
{
|
|
2104
|
-
id:
|
|
2105
|
-
name:
|
|
2106
|
-
image:
|
|
2114
|
+
id: a || "account",
|
|
2115
|
+
name: a || "Account",
|
|
2116
|
+
image: d,
|
|
2107
2117
|
size: 24,
|
|
2108
2118
|
shape: "circle"
|
|
2109
2119
|
}
|
|
@@ -2114,75 +2124,76 @@ const Dt = ({
|
|
|
2114
2124
|
className: "flex-1 flex flex-col gap-3 rounded-lg p-4",
|
|
2115
2125
|
style: { backgroundColor: "#F1F0EE" },
|
|
2116
2126
|
children: [
|
|
2117
|
-
|
|
2118
|
-
u.map((
|
|
2119
|
-
|
|
2127
|
+
o && /* @__PURE__ */ e("p", { className: "text-md text-charcoal mb-4", children: o }),
|
|
2128
|
+
u.map((f) => /* @__PURE__ */ e(
|
|
2129
|
+
yt,
|
|
2120
2130
|
{
|
|
2121
|
-
question:
|
|
2122
|
-
onClick: () => s(
|
|
2123
|
-
loading: n ===
|
|
2131
|
+
question: f.question,
|
|
2132
|
+
onClick: () => s(f.id),
|
|
2133
|
+
loading: n === f.id
|
|
2124
2134
|
},
|
|
2125
|
-
|
|
2135
|
+
f.id
|
|
2126
2136
|
))
|
|
2127
2137
|
]
|
|
2128
2138
|
}
|
|
2129
2139
|
)
|
|
2130
2140
|
] }) });
|
|
2131
|
-
},
|
|
2132
|
-
const { initialSearch: n = "", pageSize:
|
|
2133
|
-
if (
|
|
2134
|
-
const
|
|
2135
|
-
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);
|
|
2136
2146
|
try {
|
|
2137
|
-
const
|
|
2138
|
-
search:
|
|
2139
|
-
limit:
|
|
2140
|
-
cursor:
|
|
2147
|
+
const c = await t.loadParticipants({
|
|
2148
|
+
search: h || void 0,
|
|
2149
|
+
limit: o,
|
|
2150
|
+
cursor: w ? void 0 : E
|
|
2141
2151
|
});
|
|
2142
|
-
|
|
2143
|
-
(
|
|
2144
|
-
),
|
|
2145
|
-
} catch (
|
|
2146
|
-
const
|
|
2147
|
-
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);
|
|
2148
2158
|
} finally {
|
|
2149
2159
|
u(!1);
|
|
2150
2160
|
}
|
|
2151
|
-
}, [t,
|
|
2152
|
-
|
|
2153
|
-
}, [
|
|
2154
|
-
|
|
2155
|
-
}, [
|
|
2156
|
-
S(void 0),
|
|
2157
|
-
}, [
|
|
2158
|
-
return
|
|
2159
|
-
|
|
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);
|
|
2160
2170
|
}, [t.loadParticipants]), {
|
|
2161
2171
|
participants: l,
|
|
2162
|
-
loading:
|
|
2163
|
-
error:
|
|
2164
|
-
searchQuery:
|
|
2165
|
-
hasMore:
|
|
2172
|
+
loading: a,
|
|
2173
|
+
error: f,
|
|
2174
|
+
searchQuery: N,
|
|
2175
|
+
hasMore: p,
|
|
2166
2176
|
totalCount: t.totalCount,
|
|
2167
|
-
loadMore:
|
|
2168
|
-
search:
|
|
2169
|
-
refresh:
|
|
2177
|
+
loadMore: k,
|
|
2178
|
+
search: b,
|
|
2179
|
+
refresh: m
|
|
2170
2180
|
};
|
|
2171
2181
|
};
|
|
2172
2182
|
export {
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
Dt as
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
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
|
|
2187
2198
|
};
|
|
2188
2199
|
//# sourceMappingURL=index.js.map
|