@linktr.ee/messaging-react 1.24.3 → 1.24.4-rc-1773844294
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 +31 -1
- package/dist/index.js +918 -904
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/ChannelInfoDialog/ChannelInfoDialog.test.tsx +259 -0
- package/src/components/ChannelInfoDialog/index.tsx +316 -0
- package/src/components/ChannelList/CustomChannelPreview.tsx +2 -0
- package/src/components/ChannelList/index.test.tsx +79 -0
- package/src/components/ChannelList/index.tsx +8 -1
- package/src/components/ChannelView.tsx +7 -309
- package/src/components/MessagingShell/index.tsx +2 -0
- package/src/types.ts +35 -1
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsx as e, jsxs as i, Fragment as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { StreamChatService as
|
|
5
|
-
import { Chat as
|
|
6
|
-
import { GiftIcon as
|
|
1
|
+
import { jsx as e, jsxs as i, Fragment as me } from "react/jsx-runtime";
|
|
2
|
+
import D from "classnames";
|
|
3
|
+
import B, { createContext as ot, useContext as lt, useCallback as L, useState as k, useRef as J, useEffect as Q, useMemo as Ee } from "react";
|
|
4
|
+
import { StreamChatService as it } from "@linktr.ee/messaging-core";
|
|
5
|
+
import { Chat as ct, ChannelList as dt, DateSeparator as ut, useChannelStateContext as Se, useChatContext as $e, areMessageUIPropsEqual as mt, useMessageReminder as ht, useComponentContext as ft, Attachment as gt, EditMessageModal as xt, MessageBlocked as bt, MessageBouncePrompt as Ct, MessageDeleted as Nt, MessageIsThreadReplyInChannelButtonIndicator as vt, MessageRepliesCountButton as wt, ReminderNotification as pt, StreamedMessageText as yt, messageHasAttachments as Et, messageHasReactions as _t, isDateSeparatorMessage as It, isMessageBlocked as St, isMessageBounced as Mt, MessageBounceModal as kt, Poll as Tt, MessageText as Dt, MessageErrorIcon as Rt, useMessageContext as je, useMessageComposer as Lt, useStateStore as Pt, MessageInput as Ut, useMessageInputContext as Ot, useMessageComposerHasSendableData as Ft, SimpleAttachmentSelector as At, QuotedMessagePreview as Bt, AttachmentPreviewList as $t, TextareaComposer as jt, MessageTimestamp as De, Channel as Gt, WithComponents as Vt, Window as Ht, MessageList as zt } from "stream-chat-react";
|
|
6
|
+
import { GiftIcon as Wt, XIcon as Me, SpinnerGapIcon as be, SignOutIcon as qt, ProhibitInsetIcon as Re, FlagIcon as Yt, ArrowUpIcon as Zt, SparkleIcon as Jt, ArrowLeftIcon as Le, StarIcon as Pe, DotsThreeIcon as Ue, MagnifyingGlassIcon as Qt, ChatCircleDotsIcon as Oe } from "@phosphor-icons/react";
|
|
7
7
|
import { LinkPreviewsManager as Fe } from "stream-chat";
|
|
8
|
-
const Ge =
|
|
8
|
+
const Ge = ot({
|
|
9
9
|
service: null,
|
|
10
10
|
client: null,
|
|
11
11
|
isConnected: !1,
|
|
@@ -15,199 +15,199 @@ const Ge = rt({
|
|
|
15
15
|
refreshConnection: async () => {
|
|
16
16
|
},
|
|
17
17
|
debug: !1
|
|
18
|
-
}), ve = () =>
|
|
18
|
+
}), ve = () => lt(Ge), Hs = ({
|
|
19
19
|
children: t,
|
|
20
20
|
user: s,
|
|
21
21
|
serviceConfig: n,
|
|
22
22
|
apiKey: o,
|
|
23
23
|
capabilities: l = {},
|
|
24
|
-
debug:
|
|
24
|
+
debug: h = !1
|
|
25
25
|
}) => {
|
|
26
|
-
const
|
|
27
|
-
(u, ...
|
|
28
|
-
|
|
26
|
+
const r = L(
|
|
27
|
+
(u, ...m) => {
|
|
28
|
+
h && console.log(`🔥 [MessagingProvider] ${u}`, ...m);
|
|
29
29
|
},
|
|
30
|
-
[
|
|
30
|
+
[h]
|
|
31
31
|
);
|
|
32
|
-
|
|
32
|
+
r("🔄 RENDER START", {
|
|
33
33
|
userId: s == null ? void 0 : s.id,
|
|
34
34
|
apiKey: (o == null ? void 0 : o.substring(0, 8)) + "...",
|
|
35
35
|
serviceConfig: !!n,
|
|
36
36
|
capabilities: Object.keys(l)
|
|
37
37
|
});
|
|
38
|
-
const [c,
|
|
38
|
+
const [c, b] = k(null), [f, N] = k(null), [g, E] = k(!1), [a, _] = k(!1), [I, v] = k(null), M = J(!1), p = J({
|
|
39
39
|
userId: s == null ? void 0 : s.id,
|
|
40
40
|
apiKey: o,
|
|
41
41
|
serviceConfig: n,
|
|
42
42
|
capabilities: l
|
|
43
|
-
}),
|
|
44
|
-
|
|
45
|
-
renderCount:
|
|
43
|
+
}), C = J(0);
|
|
44
|
+
C.current++, r("📊 RENDER INFO", {
|
|
45
|
+
renderCount: C.current,
|
|
46
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: p.current.userId !== (s == null ? void 0 : s.id),
|
|
49
|
+
apiKeyChanged: p.current.apiKey !== o,
|
|
50
|
+
serviceConfigChanged: p.current.serviceConfig !== n,
|
|
51
|
+
capabilitiesChanged: p.current.capabilities !== l
|
|
52
52
|
}
|
|
53
|
-
}),
|
|
53
|
+
}), p.current = {
|
|
54
54
|
userId: s == null ? void 0 : s.id,
|
|
55
55
|
apiKey: o,
|
|
56
56
|
serviceConfig: n,
|
|
57
57
|
capabilities: l
|
|
58
58
|
}, Q(() => {
|
|
59
|
-
const u =
|
|
60
|
-
if (
|
|
59
|
+
const u = C.current;
|
|
60
|
+
if (r("🔧 SERVICE INIT EFFECT TRIGGERED", {
|
|
61
61
|
renderCount: u,
|
|
62
62
|
apiKey: !!o,
|
|
63
63
|
serviceConfig: !!n,
|
|
64
64
|
dependencies: {
|
|
65
65
|
apiKey: (o == null ? void 0 : o.substring(0, 8)) + "...",
|
|
66
66
|
serviceConfigRef: n,
|
|
67
|
-
serviceConfigStable:
|
|
68
|
-
apiKeyStable:
|
|
67
|
+
serviceConfigStable: p.current.serviceConfig === n,
|
|
68
|
+
apiKeyStable: p.current.apiKey === o
|
|
69
69
|
}
|
|
70
70
|
}), !o || !n) {
|
|
71
|
-
|
|
71
|
+
r("⚠️ SERVICE INIT SKIPPED", {
|
|
72
72
|
renderCount: u,
|
|
73
73
|
reason: "Missing apiKey or serviceConfig"
|
|
74
74
|
});
|
|
75
75
|
return;
|
|
76
76
|
}
|
|
77
|
-
|
|
77
|
+
r("🚀 CREATING NEW SERVICE", {
|
|
78
78
|
renderCount: u,
|
|
79
79
|
apiKey: (o == null ? void 0 : o.substring(0, 8)) + "...",
|
|
80
|
-
serviceConfigChanged:
|
|
80
|
+
serviceConfigChanged: p.current.serviceConfig !== n
|
|
81
81
|
});
|
|
82
|
-
const
|
|
82
|
+
const m = new it({
|
|
83
83
|
...n,
|
|
84
84
|
apiKey: o,
|
|
85
|
-
debug:
|
|
85
|
+
debug: h
|
|
86
86
|
});
|
|
87
|
-
return
|
|
87
|
+
return b(m), r("✅ SERVICE SET", {
|
|
88
88
|
renderCount: u,
|
|
89
|
-
serviceInstance: !!
|
|
89
|
+
serviceInstance: !!m
|
|
90
90
|
}), () => {
|
|
91
|
-
|
|
91
|
+
r("🧹 SERVICE CLEANUP", {
|
|
92
92
|
renderCount: u,
|
|
93
93
|
reason: "Effect cleanup"
|
|
94
|
-
}),
|
|
94
|
+
}), m.disconnectUser().catch(console.error);
|
|
95
95
|
};
|
|
96
|
-
}, [o, n,
|
|
97
|
-
const
|
|
96
|
+
}, [o, n, h, r]);
|
|
97
|
+
const w = J(null);
|
|
98
98
|
Q(() => {
|
|
99
|
-
var
|
|
100
|
-
if (
|
|
99
|
+
var m, y;
|
|
100
|
+
if (r("🔗 USER CONNECTION EFFECT TRIGGERED", {
|
|
101
101
|
hasService: !!c,
|
|
102
102
|
hasUser: !!s,
|
|
103
103
|
userId: s == null ? void 0 : s.id,
|
|
104
|
-
isConnecting:
|
|
105
|
-
isConnected:
|
|
104
|
+
isConnecting: M.current,
|
|
105
|
+
isConnected: g,
|
|
106
106
|
dependencies: { service: !!c, userId: s == null ? void 0 : s.id }
|
|
107
107
|
}), !c || !s) {
|
|
108
|
-
|
|
108
|
+
r("⚠️ USER CONNECTION SKIPPED", "Missing service or user");
|
|
109
109
|
return;
|
|
110
110
|
}
|
|
111
|
-
if (
|
|
112
|
-
|
|
111
|
+
if (M.current) {
|
|
112
|
+
r("⚠️ USER CONNECTION SKIPPED", "Already connecting");
|
|
113
113
|
return;
|
|
114
114
|
}
|
|
115
|
-
if (((
|
|
116
|
-
|
|
115
|
+
if (((m = w.current) == null ? void 0 : m.serviceId) === c && ((y = w.current) == null ? void 0 : y.userId) === s.id) {
|
|
116
|
+
r(
|
|
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
|
+
r("🚀 STARTING USER CONNECTION", { userId: s.id }), M.current = !0, _(!0), v(null);
|
|
124
124
|
try {
|
|
125
|
-
|
|
126
|
-
const
|
|
127
|
-
N(
|
|
125
|
+
r("📞 CALLING SERVICE.CONNECTUSER", { userId: s.id });
|
|
126
|
+
const x = await c.connectUser(s);
|
|
127
|
+
N(x), E(!0), w.current = { serviceId: c, userId: s.id }, r("✅ USER CONNECTION SUCCESS", {
|
|
128
128
|
userId: s.id,
|
|
129
|
-
clientId:
|
|
129
|
+
clientId: x.userID
|
|
130
130
|
});
|
|
131
|
-
} catch (
|
|
132
|
-
const
|
|
133
|
-
|
|
131
|
+
} catch (x) {
|
|
132
|
+
const P = x instanceof Error ? x.message : "Connection failed";
|
|
133
|
+
v(P), r("❌ USER CONNECTION ERROR", {
|
|
134
134
|
userId: s.id,
|
|
135
|
-
error:
|
|
135
|
+
error: P
|
|
136
136
|
});
|
|
137
137
|
} finally {
|
|
138
|
-
|
|
138
|
+
_(!1), M.current = !1, r("🔄 USER CONNECTION FINISHED", {
|
|
139
139
|
userId: s.id,
|
|
140
|
-
isConnected:
|
|
140
|
+
isConnected: g
|
|
141
141
|
});
|
|
142
142
|
}
|
|
143
143
|
})();
|
|
144
|
-
}, [c, s,
|
|
144
|
+
}, [c, s, r, g]), Q(() => (r("🔌 CLEANUP EFFECT REGISTERED", {
|
|
145
145
|
hasService: !!c,
|
|
146
|
-
isConnected:
|
|
146
|
+
isConnected: g
|
|
147
147
|
}), () => {
|
|
148
|
-
c &&
|
|
148
|
+
c && g ? (r(
|
|
149
149
|
"🧹 CLEANUP EFFECT TRIGGERED",
|
|
150
150
|
"Cleaning up connection on unmount"
|
|
151
|
-
),
|
|
151
|
+
), w.current = null, c.disconnectUser().catch(console.error)) : r("🔇 CLEANUP EFFECT SKIPPED", {
|
|
152
152
|
hasService: !!c,
|
|
153
|
-
isConnected:
|
|
153
|
+
isConnected: g
|
|
154
154
|
});
|
|
155
|
-
}), [c,
|
|
156
|
-
const
|
|
157
|
-
if (
|
|
155
|
+
}), [c, g, r]);
|
|
156
|
+
const R = L(async () => {
|
|
157
|
+
if (r("🔄 REFRESH CONNECTION CALLED", {
|
|
158
158
|
hasService: !!c,
|
|
159
159
|
hasUser: !!s
|
|
160
160
|
}), !c || !s) {
|
|
161
|
-
|
|
161
|
+
r("⚠️ REFRESH CONNECTION SKIPPED", "Missing service or user");
|
|
162
162
|
return;
|
|
163
163
|
}
|
|
164
|
-
|
|
164
|
+
r("🚀 STARTING CONNECTION REFRESH", { userId: s.id }), _(!0);
|
|
165
165
|
try {
|
|
166
|
-
|
|
166
|
+
r("🔌 DISCONNECTING FOR REFRESH"), await c.disconnectUser(), r("📞 RECONNECTING FOR REFRESH");
|
|
167
167
|
const u = await c.connectUser(s);
|
|
168
|
-
N(u),
|
|
168
|
+
N(u), E(!0), v(null), r("✅ CONNECTION REFRESH SUCCESS", { userId: s.id });
|
|
169
169
|
} catch (u) {
|
|
170
|
-
const
|
|
171
|
-
|
|
170
|
+
const m = u instanceof Error ? u.message : "Refresh failed";
|
|
171
|
+
v(m), r("❌ CONNECTION REFRESH ERROR", {
|
|
172
172
|
userId: s.id,
|
|
173
|
-
error:
|
|
173
|
+
error: m
|
|
174
174
|
});
|
|
175
175
|
} finally {
|
|
176
|
-
|
|
176
|
+
_(!1), r("🔄 CONNECTION REFRESH FINISHED", { userId: s.id });
|
|
177
177
|
}
|
|
178
|
-
}, [c, s,
|
|
178
|
+
}, [c, s, r]), d = B.useMemo(() => (r("💫 CONTEXT VALUE MEMOIZATION", {
|
|
179
179
|
hasService: !!c,
|
|
180
180
|
hasClient: !!f,
|
|
181
|
-
isConnected:
|
|
182
|
-
isLoading:
|
|
183
|
-
hasError: !!
|
|
181
|
+
isConnected: g,
|
|
182
|
+
isLoading: a,
|
|
183
|
+
hasError: !!I,
|
|
184
184
|
capabilitiesKeys: Object.keys(l)
|
|
185
185
|
}), {
|
|
186
186
|
service: c,
|
|
187
187
|
client: f,
|
|
188
|
-
isConnected:
|
|
189
|
-
isLoading:
|
|
190
|
-
error:
|
|
188
|
+
isConnected: g,
|
|
189
|
+
isLoading: a,
|
|
190
|
+
error: I,
|
|
191
191
|
capabilities: l,
|
|
192
|
-
refreshConnection:
|
|
193
|
-
debug:
|
|
192
|
+
refreshConnection: R,
|
|
193
|
+
debug: h
|
|
194
194
|
}), [
|
|
195
195
|
c,
|
|
196
196
|
f,
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
197
|
+
g,
|
|
198
|
+
a,
|
|
199
|
+
I,
|
|
200
200
|
l,
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
201
|
+
R,
|
|
202
|
+
h,
|
|
203
|
+
r
|
|
204
204
|
]);
|
|
205
|
-
return
|
|
206
|
-
renderCount:
|
|
207
|
-
willRenderChat: !!(f &&
|
|
208
|
-
contextValueReady: !!
|
|
209
|
-
}), /* @__PURE__ */ e(Ge.Provider, { value:
|
|
210
|
-
|
|
205
|
+
return r("🔄 RENDER END", {
|
|
206
|
+
renderCount: C.current,
|
|
207
|
+
willRenderChat: !!(f && g),
|
|
208
|
+
contextValueReady: !!d
|
|
209
|
+
}), /* @__PURE__ */ e(Ge.Provider, { value: d, children: f && g ? /* @__PURE__ */ e(
|
|
210
|
+
ct,
|
|
211
211
|
{
|
|
212
212
|
client: f,
|
|
213
213
|
customClasses: {
|
|
@@ -216,24 +216,24 @@ const Ge = rt({
|
|
|
216
216
|
children: t
|
|
217
217
|
}
|
|
218
218
|
) : t });
|
|
219
|
-
},
|
|
219
|
+
}, Xt = () => ve(), Ve = B.createContext({
|
|
220
220
|
selectedChannel: void 0,
|
|
221
221
|
onChannelSelect: () => {
|
|
222
222
|
},
|
|
223
223
|
debug: !1,
|
|
224
224
|
renderMessagePreview: void 0
|
|
225
|
-
}),
|
|
225
|
+
}), Kt = Ve.Provider, es = () => B.useContext(Ve), ts = (t, s) => {
|
|
226
226
|
const n = new Date(
|
|
227
227
|
Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate())
|
|
228
228
|
), l = new Date(
|
|
229
229
|
Date.UTC(s.getUTCFullYear(), s.getUTCMonth(), s.getUTCDate())
|
|
230
230
|
).getTime() - n.getTime();
|
|
231
231
|
return Math.floor(l / (1e3 * 60 * 60 * 24));
|
|
232
|
-
},
|
|
232
|
+
}, ss = (t) => {
|
|
233
233
|
const s = /* @__PURE__ */ new Date();
|
|
234
234
|
if (Math.floor((s.getTime() - t.getTime()) / 1e3) < 60)
|
|
235
235
|
return "Just now";
|
|
236
|
-
const o =
|
|
236
|
+
const o = ts(t, s);
|
|
237
237
|
return o === 0 ? t.toLocaleTimeString([], {
|
|
238
238
|
hour: "numeric",
|
|
239
239
|
minute: "2-digit",
|
|
@@ -271,7 +271,7 @@ const Ge = rt({
|
|
|
271
271
|
"🍈"
|
|
272
272
|
// Melon
|
|
273
273
|
];
|
|
274
|
-
function
|
|
274
|
+
function ns(t) {
|
|
275
275
|
let s = 0;
|
|
276
276
|
for (let n = 0; n < t.length; n++) {
|
|
277
277
|
const o = t.charCodeAt(n);
|
|
@@ -279,29 +279,29 @@ function ss(t) {
|
|
|
279
279
|
}
|
|
280
280
|
return Math.abs(s);
|
|
281
281
|
}
|
|
282
|
-
function
|
|
283
|
-
const n =
|
|
282
|
+
function as(t) {
|
|
283
|
+
const n = ns(t) % Ae.length;
|
|
284
284
|
return Ae[n];
|
|
285
285
|
}
|
|
286
|
-
const
|
|
286
|
+
const se = ({
|
|
287
287
|
id: t,
|
|
288
288
|
image: s,
|
|
289
289
|
size: n = 40,
|
|
290
290
|
className: o,
|
|
291
291
|
shape: l = "squircle"
|
|
292
292
|
}) => {
|
|
293
|
-
const
|
|
293
|
+
const h = as(t), c = n < 32 ? "text-xs" : n < 56 ? "text-sm" : n < 120 ? "text-lg" : "text-4xl", b = l === "circle" ? { borderRadius: "50%" } : {
|
|
294
294
|
borderRadius: "33%",
|
|
295
295
|
"corner-shape": "superellipse(1.3)"
|
|
296
296
|
};
|
|
297
297
|
return /* @__PURE__ */ e(
|
|
298
298
|
"div",
|
|
299
299
|
{
|
|
300
|
-
className:
|
|
300
|
+
className: D("flex-shrink-0 overflow-hidden", o),
|
|
301
301
|
style: {
|
|
302
302
|
width: `${n}px`,
|
|
303
303
|
height: `${n}px`,
|
|
304
|
-
...
|
|
304
|
+
...b
|
|
305
305
|
},
|
|
306
306
|
children: s ? /* @__PURE__ */ e(
|
|
307
307
|
"img",
|
|
@@ -314,16 +314,16 @@ const te = ({
|
|
|
314
314
|
"div",
|
|
315
315
|
{
|
|
316
316
|
"aria-hidden": "true",
|
|
317
|
-
className:
|
|
317
|
+
className: D(
|
|
318
318
|
"avatar-fallback flex h-full w-full items-center justify-center font-semibold bg-[#E6E5E3] select-none transition-colors",
|
|
319
319
|
c
|
|
320
320
|
),
|
|
321
|
-
children:
|
|
321
|
+
children: h
|
|
322
322
|
}
|
|
323
323
|
)
|
|
324
324
|
}
|
|
325
325
|
);
|
|
326
|
-
},
|
|
326
|
+
}, rs = ({ size: t = 15 }) => /* @__PURE__ */ e(
|
|
327
327
|
"svg",
|
|
328
328
|
{
|
|
329
329
|
width: t,
|
|
@@ -340,16 +340,16 @@ const te = ({
|
|
|
340
340
|
}
|
|
341
341
|
)
|
|
342
342
|
}
|
|
343
|
-
),
|
|
343
|
+
), os = (t) => {
|
|
344
344
|
var s;
|
|
345
345
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_TIP";
|
|
346
|
-
},
|
|
346
|
+
}, ls = (t) => {
|
|
347
347
|
var s;
|
|
348
348
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_PAID";
|
|
349
349
|
}, ke = (t) => {
|
|
350
350
|
var s;
|
|
351
351
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_CHATBOT";
|
|
352
|
-
}, He = (t) =>
|
|
352
|
+
}, He = (t) => os(t) || ls(t), is = (t) => {
|
|
353
353
|
var s;
|
|
354
354
|
return He(t) && !((s = t.text) != null && s.trim());
|
|
355
355
|
}, ye = ({
|
|
@@ -358,84 +358,85 @@ const te = ({
|
|
|
358
358
|
isMyMessage: n = !1,
|
|
359
359
|
hasAttachment: o = !1
|
|
360
360
|
}) => {
|
|
361
|
-
var
|
|
362
|
-
const l = He(t),
|
|
363
|
-
if (!l && !
|
|
361
|
+
var g;
|
|
362
|
+
const l = He(t), h = ke(t);
|
|
363
|
+
if (!l && !h)
|
|
364
364
|
return null;
|
|
365
365
|
if (l) {
|
|
366
|
-
const
|
|
367
|
-
if (!
|
|
368
|
-
const
|
|
369
|
-
return /* @__PURE__ */ i("div", { className:
|
|
370
|
-
/* @__PURE__ */ e(
|
|
371
|
-
/* @__PURE__ */ e("span", { children:
|
|
366
|
+
const E = (g = t.metadata) == null ? void 0 : g.amount_text;
|
|
367
|
+
if (!E) return null;
|
|
368
|
+
const a = s ? "message-tip-standalone" : "message-tag message-tag--tip", _ = s ? `${E} tip` : `Delivered with ${E} tip`;
|
|
369
|
+
return /* @__PURE__ */ i("div", { className: a, children: [
|
|
370
|
+
/* @__PURE__ */ e(Wt, { size: s ? 14 : 12 }),
|
|
371
|
+
/* @__PURE__ */ e("span", { children: _ })
|
|
372
372
|
] });
|
|
373
373
|
}
|
|
374
|
-
const
|
|
374
|
+
const r = n && o, c = r ? "Sent with AI" : "Sent with DM Agent", b = [
|
|
375
375
|
"message-chatbot-indicator",
|
|
376
376
|
n ? "message-chatbot-indicator--sender" : "message-chatbot-indicator--receiver",
|
|
377
|
-
|
|
378
|
-
].join(" "), f = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__label", children: c }), N = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ e(
|
|
379
|
-
return /* @__PURE__ */ e("div", { className:
|
|
377
|
+
r ? "message-chatbot-indicator--attachment" : "message-chatbot-indicator--text"
|
|
378
|
+
].join(" "), f = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__label", children: c }), N = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ e(rs, { size: r ? 12 : 15 }) });
|
|
379
|
+
return /* @__PURE__ */ e("div", { className: b, "data-testid": "message-chatbot-indicator", children: n && !r ? /* @__PURE__ */ i(me, { children: [
|
|
380
380
|
f,
|
|
381
381
|
N
|
|
382
|
-
] }) : /* @__PURE__ */ i(
|
|
382
|
+
] }) : /* @__PURE__ */ i(me, { children: [
|
|
383
383
|
N,
|
|
384
384
|
f
|
|
385
385
|
] }) });
|
|
386
|
-
}, ze =
|
|
386
|
+
}, ze = B.memo(
|
|
387
387
|
({ channel: t, unread: s }) => {
|
|
388
|
-
var
|
|
389
|
-
const { selectedChannel: n, onChannelSelect: o, debug: l, renderMessagePreview:
|
|
388
|
+
var w, R, d, u;
|
|
389
|
+
const { selectedChannel: n, onChannelSelect: o, debug: l, renderMessagePreview: h } = es(), r = (n == null ? void 0 : n.id) === (t == null ? void 0 : t.id), c = () => {
|
|
390
390
|
t && o(t);
|
|
391
|
-
},
|
|
392
|
-
const
|
|
393
|
-
!
|
|
394
|
-
}, N = Object.values(((
|
|
395
|
-
(
|
|
396
|
-
var
|
|
397
|
-
return ((
|
|
391
|
+
}, b = (m) => {
|
|
392
|
+
const y = m.key === "Enter" || m.key === " ", x = m.repeat;
|
|
393
|
+
!y || x || (m.preventDefault(), c());
|
|
394
|
+
}, N = Object.values(((w = t == null ? void 0 : t.state) == null ? void 0 : w.members) || {}).find(
|
|
395
|
+
(m) => {
|
|
396
|
+
var y, x;
|
|
397
|
+
return ((y = m.user) == null ? void 0 : y.id) && m.user.id !== ((x = t == null ? void 0 : t._client) == null ? void 0 : x.userID);
|
|
398
398
|
}
|
|
399
|
-
),
|
|
400
|
-
var
|
|
401
|
-
const
|
|
402
|
-
if (
|
|
403
|
-
for (let
|
|
404
|
-
if (
|
|
399
|
+
), g = ((R = N == null ? void 0 : N.user) == null ? void 0 : R.name) || "Conversation", E = (d = N == null ? void 0 : N.user) == null ? void 0 : d.image, a = (() => {
|
|
400
|
+
var y;
|
|
401
|
+
const m = (y = t == null ? void 0 : t.state) == null ? void 0 : y.messages;
|
|
402
|
+
if (m != null && m.length) {
|
|
403
|
+
for (let x = m.length - 1; x >= 0; x--)
|
|
404
|
+
if (m[x].type !== "system") return m[x];
|
|
405
405
|
}
|
|
406
|
-
})(),
|
|
407
|
-
var x;
|
|
408
|
-
if (
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
406
|
+
})(), I = (() => {
|
|
407
|
+
var x, P;
|
|
408
|
+
if (a != null && a.text) return a.text;
|
|
409
|
+
if (((x = a == null ? void 0 : a.metadata) == null ? void 0 : x.custom_type) === "MESSAGE_TIP") return "💵 Sent a tip";
|
|
410
|
+
const y = (P = a == null ? void 0 : a.attachments) == null ? void 0 : P[0];
|
|
411
|
+
return y ? y.og_scrape_url ? y.og_scrape_url : y.type === "image" ? "📷 Sent an image" : y.type === "video" ? "🎥 Sent a video" : y.type === "audio" ? "🎵 Sent audio" : y.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
|
|
412
|
+
})(), v = a != null && a.created_at ? ss(new Date(a.created_at)) : "", M = a ? ke(a) : !1, p = h ? h(a, I) : `${M ? "✨ " : ""}${I}`, C = s ?? 0;
|
|
412
413
|
return l && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
|
|
413
414
|
channelId: t == null ? void 0 : t.id,
|
|
414
|
-
isSelected:
|
|
415
|
-
participantName:
|
|
416
|
-
unreadCount:
|
|
417
|
-
hasTimestamp: !!
|
|
415
|
+
isSelected: r,
|
|
416
|
+
participantName: g,
|
|
417
|
+
unreadCount: C,
|
|
418
|
+
hasTimestamp: !!v
|
|
418
419
|
}), /* @__PURE__ */ e(
|
|
419
420
|
"div",
|
|
420
421
|
{
|
|
421
422
|
role: "button",
|
|
422
423
|
tabIndex: 0,
|
|
423
424
|
onClick: c,
|
|
424
|
-
onKeyDown:
|
|
425
|
-
className:
|
|
425
|
+
onKeyDown: b,
|
|
426
|
+
className: D(
|
|
426
427
|
"group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring",
|
|
427
428
|
{
|
|
428
|
-
"bg-primary-alt/10 border-l-4 border-l-primary":
|
|
429
|
-
"hover:bg-sand": !
|
|
429
|
+
"bg-primary-alt/10 border-l-4 border-l-primary": r,
|
|
430
|
+
"hover:bg-sand": !r
|
|
430
431
|
}
|
|
431
432
|
),
|
|
432
433
|
children: /* @__PURE__ */ i("div", { className: "flex items-start gap-3", children: [
|
|
433
434
|
/* @__PURE__ */ e(
|
|
434
|
-
|
|
435
|
+
se,
|
|
435
436
|
{
|
|
436
437
|
id: ((u = N == null ? void 0 : N.user) == null ? void 0 : u.id) || t.id || "unknown",
|
|
437
|
-
name:
|
|
438
|
-
image:
|
|
438
|
+
name: g,
|
|
439
|
+
image: E,
|
|
439
440
|
size: 44,
|
|
440
441
|
className: "[&_.avatar-fallback]:group-hover:bg-[#eeeeee]"
|
|
441
442
|
}
|
|
@@ -445,18 +446,18 @@ const te = ({
|
|
|
445
446
|
/* @__PURE__ */ e(
|
|
446
447
|
"h3",
|
|
447
448
|
{
|
|
448
|
-
className:
|
|
449
|
+
className: D(
|
|
449
450
|
"text-sm font-medium truncate",
|
|
450
|
-
|
|
451
|
+
r ? "text-primary" : "text-charcoal"
|
|
451
452
|
),
|
|
452
|
-
children:
|
|
453
|
+
children: g
|
|
453
454
|
}
|
|
454
455
|
),
|
|
455
|
-
|
|
456
|
+
v && /* @__PURE__ */ e("span", { className: "text-xs text-stone flex-shrink-0", children: v })
|
|
456
457
|
] }),
|
|
457
458
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
|
|
458
|
-
/* @__PURE__ */ e("p", { className: "text-xs text-stone flex-1 line-clamp-1", children:
|
|
459
|
-
|
|
459
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-stone flex-1 line-clamp-1", children: p }),
|
|
460
|
+
C > 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: C > 99 ? "99+" : C })
|
|
460
461
|
] })
|
|
461
462
|
] })
|
|
462
463
|
] })
|
|
@@ -465,51 +466,56 @@ const te = ({
|
|
|
465
466
|
}
|
|
466
467
|
);
|
|
467
468
|
ze.displayName = "CustomChannelPreview";
|
|
468
|
-
const
|
|
469
|
+
const cs = { last_message_at: -1 }, We = B.memo(
|
|
469
470
|
({
|
|
470
471
|
onChannelSelect: t,
|
|
471
472
|
selectedChannel: s,
|
|
472
473
|
filters: n,
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
474
|
+
allowNewMessagesFromUnfilteredChannels: o = !1,
|
|
475
|
+
onMessageNew: l,
|
|
476
|
+
onAddedToChannel: h,
|
|
477
|
+
sort: r = cs,
|
|
478
|
+
className: c,
|
|
479
|
+
customEmptyStateIndicator: b,
|
|
480
|
+
renderMessagePreview: f
|
|
477
481
|
}) => {
|
|
478
|
-
const
|
|
479
|
-
|
|
482
|
+
const N = B.useRef(0);
|
|
483
|
+
N.current++;
|
|
480
484
|
const { debug: g = !1 } = ve();
|
|
481
485
|
g && console.log("📺 [ChannelList] 🔄 RENDER START", {
|
|
482
|
-
renderCount:
|
|
486
|
+
renderCount: N.current,
|
|
483
487
|
selectedChannelId: s == null ? void 0 : s.id,
|
|
484
488
|
filters: n
|
|
485
489
|
});
|
|
486
|
-
const
|
|
490
|
+
const E = B.useMemo(
|
|
487
491
|
() => ({
|
|
488
492
|
selectedChannel: s,
|
|
489
493
|
onChannelSelect: t,
|
|
490
494
|
debug: g,
|
|
491
|
-
renderMessagePreview:
|
|
495
|
+
renderMessagePreview: f
|
|
492
496
|
}),
|
|
493
|
-
[s, t, g,
|
|
497
|
+
[s, t, g, f]
|
|
494
498
|
);
|
|
495
499
|
return /* @__PURE__ */ e(
|
|
496
500
|
"div",
|
|
497
501
|
{
|
|
498
|
-
className:
|
|
502
|
+
className: D(
|
|
499
503
|
"messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
|
|
500
|
-
|
|
504
|
+
c
|
|
501
505
|
),
|
|
502
|
-
children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ e(
|
|
503
|
-
|
|
506
|
+
children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ e(Kt, { value: E, children: /* @__PURE__ */ e(
|
|
507
|
+
dt,
|
|
504
508
|
{
|
|
505
509
|
filters: n,
|
|
506
|
-
sort:
|
|
510
|
+
sort: r,
|
|
507
511
|
options: { limit: 30 },
|
|
508
|
-
allowNewMessagesFromUnfilteredChannels:
|
|
512
|
+
allowNewMessagesFromUnfilteredChannels: o,
|
|
513
|
+
onMessageNew: l,
|
|
514
|
+
onAddedToChannel: h,
|
|
509
515
|
Preview: ze,
|
|
510
|
-
EmptyStateIndicator:
|
|
516
|
+
EmptyStateIndicator: b
|
|
511
517
|
},
|
|
512
|
-
`${JSON.stringify(n)}:${JSON.stringify(
|
|
518
|
+
`${JSON.stringify(n)}:${JSON.stringify(r)}`
|
|
513
519
|
) }) })
|
|
514
520
|
}
|
|
515
521
|
);
|
|
@@ -525,7 +531,7 @@ const xe = ({
|
|
|
525
531
|
"button",
|
|
526
532
|
{
|
|
527
533
|
type: "button",
|
|
528
|
-
className:
|
|
534
|
+
className: D(
|
|
529
535
|
"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",
|
|
530
536
|
t === "danger" ? "text-danger hover:bg-danger/50" : "text-charcoal hover:bg-sand",
|
|
531
537
|
s
|
|
@@ -539,7 +545,7 @@ function qe({ label: t, className: s, children: n, ...o }) {
|
|
|
539
545
|
"button",
|
|
540
546
|
{
|
|
541
547
|
type: "button",
|
|
542
|
-
className:
|
|
548
|
+
className: D(
|
|
543
549
|
"rounded-full p-2 transition-colors focus-ring",
|
|
544
550
|
{
|
|
545
551
|
"cursor-not-allowed opacity-50": o.disabled,
|
|
@@ -558,13 +564,198 @@ function qe({ label: t, className: s, children: n, ...o }) {
|
|
|
558
564
|
function Ye({ onClick: t }) {
|
|
559
565
|
return /* @__PURE__ */ e(qe, { label: "Close", onClick: t, className: "p-1", children: /* @__PURE__ */ e(Me, { className: "h-5 w-5 text-stone", weight: "bold" }) });
|
|
560
566
|
}
|
|
561
|
-
const
|
|
562
|
-
|
|
567
|
+
const ds = ({
|
|
568
|
+
dialogRef: t,
|
|
569
|
+
onClose: s,
|
|
570
|
+
participant: n,
|
|
571
|
+
channel: o,
|
|
572
|
+
followerStatusLabel: l,
|
|
573
|
+
onLeaveConversation: h,
|
|
574
|
+
onBlockParticipant: r,
|
|
575
|
+
showDeleteConversation: c = !0,
|
|
576
|
+
onDeleteConversationClick: b,
|
|
577
|
+
onBlockParticipantClick: f,
|
|
578
|
+
onReportParticipantClick: N,
|
|
579
|
+
customProfileContent: g,
|
|
580
|
+
customChannelActions: E
|
|
581
|
+
}) => {
|
|
582
|
+
var z, j, ne, ae, G, K, re;
|
|
583
|
+
const { service: a, debug: _ } = ve(), [I, v] = k(!1), [M, p] = k(!1), [C, w] = k(!1), R = L(async () => {
|
|
584
|
+
var U;
|
|
585
|
+
if (!(!a || !((U = n == null ? void 0 : n.user) != null && U.id)))
|
|
586
|
+
try {
|
|
587
|
+
const A = (await a.getBlockedUsers()).some(
|
|
588
|
+
(V) => {
|
|
589
|
+
var ce;
|
|
590
|
+
return V.blocked_user_id === ((ce = n == null ? void 0 : n.user) == null ? void 0 : ce.id);
|
|
591
|
+
}
|
|
592
|
+
);
|
|
593
|
+
v(A);
|
|
594
|
+
} catch (O) {
|
|
595
|
+
console.error(
|
|
596
|
+
"[ChannelInfoDialog] Failed to check blocked status:",
|
|
597
|
+
O
|
|
598
|
+
);
|
|
599
|
+
}
|
|
600
|
+
}, [a, (z = n == null ? void 0 : n.user) == null ? void 0 : z.id]);
|
|
601
|
+
Q(() => {
|
|
602
|
+
R();
|
|
603
|
+
}, [R]);
|
|
604
|
+
const d = async () => {
|
|
605
|
+
var U;
|
|
606
|
+
if (!M) {
|
|
607
|
+
b == null || b(), _ && console.log("[ChannelInfoDialog] Leave conversation", o.cid), p(!0);
|
|
608
|
+
try {
|
|
609
|
+
const O = ((U = o._client) == null ? void 0 : U.userID) ?? null;
|
|
610
|
+
await o.hide(O, !1), h && await h(o), s();
|
|
611
|
+
} catch (O) {
|
|
612
|
+
console.error("[ChannelInfoDialog] Failed to leave conversation", O);
|
|
613
|
+
} finally {
|
|
614
|
+
p(!1);
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
}, u = async () => {
|
|
618
|
+
var U, O, A;
|
|
619
|
+
if (!(C || !a)) {
|
|
620
|
+
f == null || f(), _ && console.log("[ChannelInfoDialog] Block member", (U = n == null ? void 0 : n.user) == null ? void 0 : U.id), w(!0);
|
|
621
|
+
try {
|
|
622
|
+
await a.blockUser((O = n == null ? void 0 : n.user) == null ? void 0 : O.id), r && await r((A = n == null ? void 0 : n.user) == null ? void 0 : A.id), s();
|
|
623
|
+
} catch (V) {
|
|
624
|
+
console.error("[ChannelInfoDialog] Failed to block member", V);
|
|
625
|
+
} finally {
|
|
626
|
+
w(!1);
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
}, m = async () => {
|
|
630
|
+
var U, O, A;
|
|
631
|
+
if (!(C || !a)) {
|
|
632
|
+
f == null || f(), _ && console.log("[ChannelInfoDialog] Unblock member", (U = n == null ? void 0 : n.user) == null ? void 0 : U.id), w(!0);
|
|
633
|
+
try {
|
|
634
|
+
await a.unBlockUser((O = n == null ? void 0 : n.user) == null ? void 0 : O.id), r && await r((A = n == null ? void 0 : n.user) == null ? void 0 : A.id), s();
|
|
635
|
+
} catch (V) {
|
|
636
|
+
console.error("[ChannelInfoDialog] Failed to unblock member", V);
|
|
637
|
+
} finally {
|
|
638
|
+
w(!1);
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
}, y = () => {
|
|
642
|
+
N == null || N(), s(), window.open(
|
|
643
|
+
"https://linktr.ee/s/about/trust-center/report",
|
|
644
|
+
"_blank",
|
|
645
|
+
"noopener,noreferrer"
|
|
646
|
+
);
|
|
647
|
+
};
|
|
648
|
+
if (!n) return null;
|
|
649
|
+
const x = ((j = n.user) == null ? void 0 : j.name) || ((ne = n.user) == null ? void 0 : ne.id) || "Unknown member", P = (ae = n.user) == null ? void 0 : ae.image, X = (G = n.user) == null ? void 0 : G.email, Y = (K = n.user) == null ? void 0 : K.username, q = X || (Y ? `linktr.ee/${Y}` : void 0), T = ((re = n.user) == null ? void 0 : re.id) || "unknown";
|
|
650
|
+
return (
|
|
651
|
+
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
|
|
652
|
+
/* @__PURE__ */ e(
|
|
653
|
+
"dialog",
|
|
654
|
+
{
|
|
655
|
+
ref: t,
|
|
656
|
+
className: "mes-dialog group",
|
|
657
|
+
onClose: s,
|
|
658
|
+
onClick: (U) => {
|
|
659
|
+
U.target === t.current && s();
|
|
660
|
+
},
|
|
661
|
+
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: [
|
|
662
|
+
/* @__PURE__ */ i("div", { className: "flex items-center justify-between border-b border-sand px-4 py-3", children: [
|
|
663
|
+
/* @__PURE__ */ e("h2", { className: "text-base font-semibold text-charcoal", children: "Chat info" }),
|
|
664
|
+
/* @__PURE__ */ e(Ye, { onClick: s })
|
|
665
|
+
] }),
|
|
666
|
+
/* @__PURE__ */ i("div", { className: "flex-1 px-2 overflow-y-auto w-full", children: [
|
|
667
|
+
/* @__PURE__ */ e(
|
|
668
|
+
"div",
|
|
669
|
+
{
|
|
670
|
+
className: "flex flex-col items-center gap-3 self-stretch px-4 py-2 mt-6 rounded-lg border border-black/[0.04]",
|
|
671
|
+
style: { backgroundColor: "#FBFAF9" },
|
|
672
|
+
children: /* @__PURE__ */ i("div", { className: "flex items-center gap-3 w-full", children: [
|
|
673
|
+
/* @__PURE__ */ e(
|
|
674
|
+
se,
|
|
675
|
+
{
|
|
676
|
+
id: T,
|
|
677
|
+
name: x,
|
|
678
|
+
image: P,
|
|
679
|
+
size: 88,
|
|
680
|
+
shape: "circle"
|
|
681
|
+
}
|
|
682
|
+
),
|
|
683
|
+
/* @__PURE__ */ i("div", { className: "flex flex-col min-w-0 flex-1", children: [
|
|
684
|
+
/* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: x }),
|
|
685
|
+
q && /* @__PURE__ */ e("p", { className: "truncate text-sm text-[#00000055]", children: q }),
|
|
686
|
+
l && !g && /* @__PURE__ */ e(
|
|
687
|
+
"span",
|
|
688
|
+
{
|
|
689
|
+
className: "mt-1 rounded-full text-xs font-normal w-fit",
|
|
690
|
+
style: {
|
|
691
|
+
padding: "4px 8px",
|
|
692
|
+
backgroundColor: l === "Subscribed to you" ? "#DCFCE7" : "#F5F5F4",
|
|
693
|
+
color: l === "Subscribed to you" ? "#008236" : "#78716C",
|
|
694
|
+
lineHeight: "133.333%",
|
|
695
|
+
letterSpacing: "0.21px"
|
|
696
|
+
},
|
|
697
|
+
children: l
|
|
698
|
+
}
|
|
699
|
+
),
|
|
700
|
+
g
|
|
701
|
+
] })
|
|
702
|
+
] })
|
|
703
|
+
}
|
|
704
|
+
),
|
|
705
|
+
/* @__PURE__ */ i("ul", { className: "flex flex-col gap-2 mt-2", children: [
|
|
706
|
+
c && /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(
|
|
707
|
+
xe,
|
|
708
|
+
{
|
|
709
|
+
onClick: d,
|
|
710
|
+
disabled: M,
|
|
711
|
+
"aria-busy": M,
|
|
712
|
+
children: [
|
|
713
|
+
M ? /* @__PURE__ */ e(be, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(qt, { className: "h-5 w-5" }),
|
|
714
|
+
/* @__PURE__ */ e("span", { children: "Delete Conversation" })
|
|
715
|
+
]
|
|
716
|
+
}
|
|
717
|
+
) }),
|
|
718
|
+
/* @__PURE__ */ e("li", { children: I ? /* @__PURE__ */ i(
|
|
719
|
+
xe,
|
|
720
|
+
{
|
|
721
|
+
onClick: m,
|
|
722
|
+
disabled: C,
|
|
723
|
+
"aria-busy": C,
|
|
724
|
+
children: [
|
|
725
|
+
C ? /* @__PURE__ */ e(be, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Re, { className: "h-5 w-5" }),
|
|
726
|
+
/* @__PURE__ */ e("span", { children: "Unblock" })
|
|
727
|
+
]
|
|
728
|
+
}
|
|
729
|
+
) : /* @__PURE__ */ i(
|
|
730
|
+
xe,
|
|
731
|
+
{
|
|
732
|
+
onClick: u,
|
|
733
|
+
disabled: C,
|
|
734
|
+
"aria-busy": C,
|
|
735
|
+
children: [
|
|
736
|
+
C ? /* @__PURE__ */ e(be, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Re, { className: "h-5 w-5" }),
|
|
737
|
+
/* @__PURE__ */ e("span", { children: "Block" })
|
|
738
|
+
]
|
|
739
|
+
}
|
|
740
|
+
) }),
|
|
741
|
+
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(xe, { variant: "danger", onClick: y, children: [
|
|
742
|
+
/* @__PURE__ */ e(Yt, { className: "h-5 w-5" }),
|
|
743
|
+
/* @__PURE__ */ e("span", { children: "Report" })
|
|
744
|
+
] }) }),
|
|
745
|
+
E
|
|
746
|
+
] })
|
|
747
|
+
] })
|
|
748
|
+
] })
|
|
749
|
+
}
|
|
750
|
+
)
|
|
751
|
+
);
|
|
752
|
+
}, us = (t) => /* @__PURE__ */ e(ut, { ...t, position: "center" }), _e = "vote_up", Ie = "vote_down";
|
|
753
|
+
function ms(t) {
|
|
563
754
|
return t != null && t.length ? t.some((s) => s.type === Ie) ? "down" : t.some((s) => s.type === _e) ? "up" : null : null;
|
|
564
755
|
}
|
|
565
|
-
function
|
|
756
|
+
function hs(t) {
|
|
566
757
|
const { channel: s } = Se(), { client: n } = $e("useMessageVote"), o = Ee(
|
|
567
|
-
() =>
|
|
758
|
+
() => ms(t.own_reactions),
|
|
568
759
|
[t.own_reactions]
|
|
569
760
|
), l = L(async () => {
|
|
570
761
|
if (n != null && n.userID)
|
|
@@ -576,7 +767,7 @@ function us(t) {
|
|
|
576
767
|
);
|
|
577
768
|
} catch {
|
|
578
769
|
}
|
|
579
|
-
}, [s, n == null ? void 0 : n.userID, t.id, o]),
|
|
770
|
+
}, [s, n == null ? void 0 : n.userID, t.id, o]), h = L(async () => {
|
|
580
771
|
if (n != null && n.userID)
|
|
581
772
|
try {
|
|
582
773
|
o === "down" ? await s.deleteReaction(t.id, Ie) : await s.sendReaction(
|
|
@@ -587,9 +778,9 @@ function us(t) {
|
|
|
587
778
|
} catch {
|
|
588
779
|
}
|
|
589
780
|
}, [s, n == null ? void 0 : n.userID, t.id, o]);
|
|
590
|
-
return { selected: o, voteUp: l, voteDown:
|
|
781
|
+
return { selected: o, voteUp: l, voteDown: h };
|
|
591
782
|
}
|
|
592
|
-
const
|
|
783
|
+
const fs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
|
|
593
784
|
"path",
|
|
594
785
|
{
|
|
595
786
|
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",
|
|
@@ -599,7 +790,7 @@ const ms = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
599
790
|
strokeLinejoin: "round",
|
|
600
791
|
fill: t ? "currentColor" : "none"
|
|
601
792
|
}
|
|
602
|
-
) }),
|
|
793
|
+
) }), gs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
|
|
603
794
|
"path",
|
|
604
795
|
{
|
|
605
796
|
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",
|
|
@@ -609,7 +800,7 @@ const ms = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
609
800
|
strokeLinejoin: "round",
|
|
610
801
|
fill: t ? "currentColor" : "none"
|
|
611
802
|
}
|
|
612
|
-
) }),
|
|
803
|
+
) }), xs = ({
|
|
613
804
|
selected: t,
|
|
614
805
|
onVoteUp: s,
|
|
615
806
|
onVoteDown: n
|
|
@@ -622,7 +813,7 @@ const ms = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
622
813
|
onClick: s,
|
|
623
814
|
"aria-label": "Helpful",
|
|
624
815
|
"aria-pressed": t === "up",
|
|
625
|
-
children: /* @__PURE__ */ e(
|
|
816
|
+
children: /* @__PURE__ */ e(fs, { filled: t === "up" })
|
|
626
817
|
}
|
|
627
818
|
),
|
|
628
819
|
/* @__PURE__ */ e(
|
|
@@ -633,104 +824,104 @@ const ms = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
633
824
|
onClick: n,
|
|
634
825
|
"aria-label": "Not helpful",
|
|
635
826
|
"aria-pressed": t === "down",
|
|
636
|
-
children: /* @__PURE__ */ e(
|
|
827
|
+
children: /* @__PURE__ */ e(gs, { filled: t === "down" })
|
|
637
828
|
}
|
|
638
829
|
)
|
|
639
|
-
] }),
|
|
640
|
-
var
|
|
830
|
+
] }), bs = (t) => {
|
|
831
|
+
var de, ue;
|
|
641
832
|
const {
|
|
642
833
|
additionalMessageInputProps: s,
|
|
643
834
|
chatbotVotingEnabled: n,
|
|
644
835
|
editing: o,
|
|
645
836
|
endOfGroup: l,
|
|
646
|
-
firstOfGroup:
|
|
647
|
-
groupedByUser:
|
|
837
|
+
firstOfGroup: h,
|
|
838
|
+
groupedByUser: r,
|
|
648
839
|
handleAction: c,
|
|
649
|
-
handleOpenThread:
|
|
840
|
+
handleOpenThread: b,
|
|
650
841
|
handleRetry: f,
|
|
651
842
|
highlighted: N,
|
|
652
|
-
isMessageAIGenerated:
|
|
653
|
-
isMyMessage:
|
|
654
|
-
message:
|
|
655
|
-
renderText:
|
|
656
|
-
threadList:
|
|
657
|
-
} = t, { client:
|
|
658
|
-
Attachment: u =
|
|
659
|
-
EditMessageModal:
|
|
660
|
-
MessageBlocked:
|
|
661
|
-
MessageBouncePrompt:
|
|
662
|
-
MessageDeleted:
|
|
663
|
-
MessageIsThreadReplyInChannelButtonIndicator:
|
|
664
|
-
MessageRepliesCountButton:
|
|
665
|
-
ReminderNotification:
|
|
666
|
-
StreamedMessageText:
|
|
667
|
-
PinIndicator:
|
|
668
|
-
} =
|
|
669
|
-
() =>
|
|
670
|
-
[
|
|
671
|
-
),
|
|
672
|
-
() => !
|
|
673
|
-
[
|
|
843
|
+
isMessageAIGenerated: g,
|
|
844
|
+
isMyMessage: E,
|
|
845
|
+
message: a,
|
|
846
|
+
renderText: _,
|
|
847
|
+
threadList: I
|
|
848
|
+
} = t, { client: v } = $e("CustomMessage"), [M, p] = k(!1), C = ht(a.id), { selected: w, voteUp: R, voteDown: d } = hs(a), {
|
|
849
|
+
Attachment: u = gt,
|
|
850
|
+
EditMessageModal: m = xt,
|
|
851
|
+
MessageBlocked: y = bt,
|
|
852
|
+
MessageBouncePrompt: x = Ct,
|
|
853
|
+
MessageDeleted: P = Nt,
|
|
854
|
+
MessageIsThreadReplyInChannelButtonIndicator: X = vt,
|
|
855
|
+
MessageRepliesCountButton: Y = wt,
|
|
856
|
+
ReminderNotification: q = pt,
|
|
857
|
+
StreamedMessageText: T = yt,
|
|
858
|
+
PinIndicator: z
|
|
859
|
+
} = ft("CustomMessage"), j = Et(a), ne = _t(a), ae = Ee(
|
|
860
|
+
() => g == null ? void 0 : g(a),
|
|
861
|
+
[g, a]
|
|
862
|
+
), G = Ee(
|
|
863
|
+
() => !a.shared_location && !a.attachments ? [] : a.shared_location ? [a.shared_location, ...a.attachments ?? []] : a.attachments,
|
|
864
|
+
[a]
|
|
674
865
|
);
|
|
675
|
-
if (
|
|
866
|
+
if (It(a))
|
|
676
867
|
return null;
|
|
677
|
-
if (
|
|
678
|
-
return /* @__PURE__ */ e(
|
|
679
|
-
if (
|
|
680
|
-
return /* @__PURE__ */ e(
|
|
681
|
-
const
|
|
868
|
+
if (a.deleted_at || a.type === "deleted")
|
|
869
|
+
return /* @__PURE__ */ e(P, { message: a });
|
|
870
|
+
if (St(a))
|
|
871
|
+
return /* @__PURE__ */ e(y, {});
|
|
872
|
+
const K = !I && !!a.reply_count, re = !I && a.show_in_channel && a.parent_id, U = a.status === "failed" && ((de = a.error) == null ? void 0 : de.status) !== 403, O = Mt(a);
|
|
682
873
|
let A;
|
|
683
|
-
U ? A = () => f(
|
|
684
|
-
const
|
|
874
|
+
U ? A = () => f(a) : O && (A = () => p(!0));
|
|
875
|
+
const V = E(), ce = D(
|
|
685
876
|
"str-chat__message str-chat__message-simple",
|
|
686
|
-
`str-chat__message--${
|
|
687
|
-
`str-chat__message--${
|
|
688
|
-
|
|
689
|
-
|
|
877
|
+
`str-chat__message--${a.type}`,
|
|
878
|
+
`str-chat__message--${a.status}`,
|
|
879
|
+
V ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
|
|
880
|
+
a.text ? "str-chat__message--has-text" : "has-no-text",
|
|
690
881
|
{
|
|
691
|
-
"str-chat__message--has-attachment":
|
|
882
|
+
"str-chat__message--has-attachment": j,
|
|
692
883
|
"str-chat__message--highlighted": N,
|
|
693
|
-
"str-chat__message--pinned pinned-message":
|
|
884
|
+
"str-chat__message--pinned pinned-message": a.pinned,
|
|
694
885
|
"str-chat__message--with-reactions": ne,
|
|
695
|
-
"str-chat__message-send-can-be-retried": (
|
|
696
|
-
"str-chat__message-with-thread-link":
|
|
886
|
+
"str-chat__message-send-can-be-retried": (a == null ? void 0 : a.status) === "failed" && ((ue = a == null ? void 0 : a.error) == null ? void 0 : ue.status) !== 403,
|
|
887
|
+
"str-chat__message-with-thread-link": K || re,
|
|
697
888
|
"str-chat__virtual-message__wrapper--end": l,
|
|
698
|
-
"str-chat__virtual-message__wrapper--first":
|
|
699
|
-
"str-chat__virtual-message__wrapper--group":
|
|
889
|
+
"str-chat__virtual-message__wrapper--first": h,
|
|
890
|
+
"str-chat__virtual-message__wrapper--group": r
|
|
700
891
|
}
|
|
701
|
-
),
|
|
702
|
-
return /* @__PURE__ */ i(
|
|
892
|
+
), W = a.poll_id && v.polls.fromState(a.poll_id), oe = is(a), ee = ke(a), Z = !!(G != null && G.length && !a.quoted_message), te = ee && V && Z;
|
|
893
|
+
return /* @__PURE__ */ i(me, { children: [
|
|
703
894
|
o && /* @__PURE__ */ e(
|
|
704
|
-
|
|
895
|
+
m,
|
|
705
896
|
{
|
|
706
897
|
additionalMessageInputProps: s
|
|
707
898
|
}
|
|
708
899
|
),
|
|
709
|
-
|
|
710
|
-
|
|
900
|
+
M && /* @__PURE__ */ e(
|
|
901
|
+
kt,
|
|
711
902
|
{
|
|
712
|
-
MessageBouncePrompt:
|
|
713
|
-
onClose: () =>
|
|
714
|
-
open:
|
|
903
|
+
MessageBouncePrompt: x,
|
|
904
|
+
onClose: () => p(!1),
|
|
905
|
+
open: M
|
|
715
906
|
}
|
|
716
907
|
),
|
|
717
|
-
/* @__PURE__ */ i("div", { className:
|
|
718
|
-
|
|
719
|
-
!!
|
|
720
|
-
|
|
721
|
-
|
|
908
|
+
/* @__PURE__ */ i("div", { className: ce, children: [
|
|
909
|
+
z && /* @__PURE__ */ e(z, {}),
|
|
910
|
+
!!C && /* @__PURE__ */ e(q, { reminder: C }),
|
|
911
|
+
a.user && /* @__PURE__ */ e(
|
|
912
|
+
se,
|
|
722
913
|
{
|
|
723
914
|
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
724
|
-
id:
|
|
725
|
-
image:
|
|
726
|
-
name:
|
|
915
|
+
id: a.user.id,
|
|
916
|
+
image: a.user.image,
|
|
917
|
+
name: a.user.name || a.user.id
|
|
727
918
|
}
|
|
728
919
|
),
|
|
729
920
|
/* @__PURE__ */ e(
|
|
730
921
|
"div",
|
|
731
922
|
{
|
|
732
|
-
className:
|
|
733
|
-
"str-chat__simple-message--error-failed": U ||
|
|
923
|
+
className: D("str-chat__message-inner", {
|
|
924
|
+
"str-chat__simple-message--error-failed": U || O
|
|
734
925
|
}),
|
|
735
926
|
"data-testid": "message-inner",
|
|
736
927
|
onClick: A,
|
|
@@ -743,76 +934,76 @@ const ms = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
743
934
|
marginInlineEnd: 0,
|
|
744
935
|
marginInlineStart: 0
|
|
745
936
|
},
|
|
746
|
-
children:
|
|
937
|
+
children: oe ? (
|
|
747
938
|
/* Tip-only messages render as a standalone bubble */
|
|
748
|
-
/* @__PURE__ */ e(ye, { message:
|
|
939
|
+
/* @__PURE__ */ e(ye, { message: a, standalone: !0 })
|
|
749
940
|
) : /* @__PURE__ */ i("div", { className: "str-chat__message-bubble-wrapper", children: [
|
|
750
941
|
/* @__PURE__ */ i("div", { className: "str-chat__message-bubble", children: [
|
|
751
|
-
|
|
942
|
+
ee && !te && /* @__PURE__ */ e(
|
|
752
943
|
ye,
|
|
753
944
|
{
|
|
754
|
-
message:
|
|
755
|
-
hasAttachment:
|
|
756
|
-
isMyMessage:
|
|
945
|
+
message: a,
|
|
946
|
+
hasAttachment: Z,
|
|
947
|
+
isMyMessage: V
|
|
757
948
|
}
|
|
758
949
|
),
|
|
759
|
-
|
|
760
|
-
|
|
950
|
+
W && /* @__PURE__ */ e(Tt, { poll: W }),
|
|
951
|
+
G != null && G.length && !a.quoted_message ? /* @__PURE__ */ e(
|
|
761
952
|
u,
|
|
762
953
|
{
|
|
763
954
|
actionHandler: c,
|
|
764
|
-
attachments:
|
|
955
|
+
attachments: G
|
|
765
956
|
}
|
|
766
957
|
) : null,
|
|
767
958
|
ae ? /* @__PURE__ */ e(
|
|
768
|
-
|
|
959
|
+
T,
|
|
769
960
|
{
|
|
770
|
-
message:
|
|
771
|
-
renderText:
|
|
961
|
+
message: a,
|
|
962
|
+
renderText: _
|
|
772
963
|
}
|
|
773
|
-
) : /* @__PURE__ */ e(Dt, { message:
|
|
774
|
-
/* @__PURE__ */ e(
|
|
964
|
+
) : /* @__PURE__ */ e(Dt, { message: a, renderText: _ }),
|
|
965
|
+
/* @__PURE__ */ e(Rt, {})
|
|
775
966
|
] }),
|
|
776
|
-
(!
|
|
967
|
+
(!ee || te) && /* @__PURE__ */ e(
|
|
777
968
|
ye,
|
|
778
969
|
{
|
|
779
|
-
message:
|
|
780
|
-
hasAttachment:
|
|
781
|
-
isMyMessage:
|
|
970
|
+
message: a,
|
|
971
|
+
hasAttachment: Z,
|
|
972
|
+
isMyMessage: V
|
|
782
973
|
}
|
|
783
974
|
),
|
|
784
|
-
n &&
|
|
785
|
-
|
|
975
|
+
n && ee && /* @__PURE__ */ e(
|
|
976
|
+
xs,
|
|
786
977
|
{
|
|
787
|
-
selected:
|
|
788
|
-
onVoteUp:
|
|
789
|
-
onVoteDown:
|
|
978
|
+
selected: w,
|
|
979
|
+
onVoteUp: R,
|
|
980
|
+
onVoteDown: d
|
|
790
981
|
}
|
|
791
982
|
)
|
|
792
983
|
] })
|
|
793
984
|
}
|
|
794
985
|
),
|
|
795
|
-
|
|
796
|
-
|
|
986
|
+
K && /* @__PURE__ */ e(
|
|
987
|
+
Y,
|
|
797
988
|
{
|
|
798
|
-
onClick:
|
|
799
|
-
reply_count:
|
|
989
|
+
onClick: b,
|
|
990
|
+
reply_count: a.reply_count
|
|
800
991
|
}
|
|
801
992
|
),
|
|
802
|
-
|
|
803
|
-
] },
|
|
993
|
+
re && /* @__PURE__ */ e(X, {})
|
|
994
|
+
] }, a.id)
|
|
804
995
|
] });
|
|
805
|
-
},
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
),
|
|
996
|
+
}, Cs = B.memo(
|
|
997
|
+
bs,
|
|
998
|
+
mt
|
|
999
|
+
), Ns = (t) => {
|
|
809
1000
|
const s = je("CustomMessage");
|
|
810
|
-
return /* @__PURE__ */ e(
|
|
811
|
-
},
|
|
1001
|
+
return /* @__PURE__ */ e(Cs, { ...s, ...t });
|
|
1002
|
+
}, vs = (t) => ({
|
|
812
1003
|
linkPreviews: Array.from(t.previews.values()).filter(
|
|
813
1004
|
(s) => Fe.previewIsLoaded(s) || Fe.previewIsLoading(s)
|
|
814
1005
|
)
|
|
815
|
-
}),
|
|
1006
|
+
}), ws = ({
|
|
816
1007
|
link: t,
|
|
817
1008
|
onDismiss: s
|
|
818
1009
|
}) => {
|
|
@@ -837,8 +1028,8 @@ const ms = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
837
1028
|
"button",
|
|
838
1029
|
{
|
|
839
1030
|
type: "button",
|
|
840
|
-
onClick: (
|
|
841
|
-
|
|
1031
|
+
onClick: (r) => {
|
|
1032
|
+
r.preventDefault(), s(n);
|
|
842
1033
|
},
|
|
843
1034
|
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 focus-ring",
|
|
844
1035
|
"aria-label": "Close link preview",
|
|
@@ -852,32 +1043,32 @@ const ms = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
852
1043
|
]
|
|
853
1044
|
}
|
|
854
1045
|
);
|
|
855
|
-
},
|
|
856
|
-
const { linkPreviewsManager: t } =
|
|
1046
|
+
}, ps = () => {
|
|
1047
|
+
const { linkPreviewsManager: t } = Lt(), { linkPreviews: s } = Pt(
|
|
857
1048
|
t.state,
|
|
858
|
-
|
|
1049
|
+
vs
|
|
859
1050
|
), n = (l) => {
|
|
860
1051
|
t.dismissPreview(l);
|
|
861
1052
|
};
|
|
862
1053
|
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(
|
|
863
|
-
|
|
1054
|
+
ws,
|
|
864
1055
|
{
|
|
865
1056
|
link: l,
|
|
866
1057
|
onDismiss: n
|
|
867
1058
|
},
|
|
868
1059
|
l.og_scrape_url
|
|
869
1060
|
)) }) : null;
|
|
870
|
-
},
|
|
871
|
-
const { handleSubmit: t } =
|
|
872
|
-
return /* @__PURE__ */ i(
|
|
873
|
-
/* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(
|
|
1061
|
+
}, ys = () => {
|
|
1062
|
+
const { handleSubmit: t } = Ot(), s = Ft();
|
|
1063
|
+
return /* @__PURE__ */ i(me, { children: [
|
|
1064
|
+
/* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(At, {}) }),
|
|
874
1065
|
/* @__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: [
|
|
875
|
-
/* @__PURE__ */ e(At, {}),
|
|
876
|
-
/* @__PURE__ */ e(vs, {}),
|
|
877
1066
|
/* @__PURE__ */ e(Bt, {}),
|
|
1067
|
+
/* @__PURE__ */ e(ps, {}),
|
|
1068
|
+
/* @__PURE__ */ e($t, {}),
|
|
878
1069
|
/* @__PURE__ */ i("div", { className: "flex", children: [
|
|
879
1070
|
/* @__PURE__ */ e("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ e(
|
|
880
|
-
|
|
1071
|
+
jt,
|
|
881
1072
|
{
|
|
882
1073
|
className: "w-full resize-none outline-none leading-6",
|
|
883
1074
|
autoFocus: !0,
|
|
@@ -893,24 +1084,24 @@ const ms = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
893
1084
|
disabled: !s,
|
|
894
1085
|
onClick: t,
|
|
895
1086
|
type: "button",
|
|
896
|
-
children: /* @__PURE__ */ e(
|
|
1087
|
+
children: /* @__PURE__ */ e(Zt, { className: "size-4" })
|
|
897
1088
|
}
|
|
898
1089
|
)
|
|
899
1090
|
] })
|
|
900
1091
|
] })
|
|
901
1092
|
] });
|
|
902
|
-
},
|
|
1093
|
+
}, Es = ({
|
|
903
1094
|
renderActions: t
|
|
904
1095
|
}) => /* @__PURE__ */ i("div", { className: "message-input flex items-center gap-2 p-4", children: [
|
|
905
1096
|
t && (t == null ? void 0 : t()),
|
|
906
|
-
/* @__PURE__ */ e(
|
|
907
|
-
] }),
|
|
1097
|
+
/* @__PURE__ */ e(Ut, { Input: ys })
|
|
1098
|
+
] }), _s = [
|
|
908
1099
|
"SYSTEM_DM_AGENT_PAUSED",
|
|
909
1100
|
"SYSTEM_DM_AGENT_RESUMED"
|
|
910
|
-
],
|
|
1101
|
+
], Is = {
|
|
911
1102
|
SYSTEM_DM_AGENT_PAUSED: "DM Agent has left the conversation",
|
|
912
1103
|
SYSTEM_DM_AGENT_RESUMED: "DM Agent has rejoined the conversation"
|
|
913
|
-
}, Be = (t) =>
|
|
1104
|
+
}, Be = (t) => _s.includes(t), Ss = (t) => {
|
|
914
1105
|
var o;
|
|
915
1106
|
const s = (o = t.metadata) == null ? void 0 : o.custom_type;
|
|
916
1107
|
if (Be(s))
|
|
@@ -918,11 +1109,11 @@ const ms = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
918
1109
|
const n = t.dm_agent_system_type;
|
|
919
1110
|
if (Be(n))
|
|
920
1111
|
return n;
|
|
921
|
-
},
|
|
1112
|
+
}, Ms = (t) => {
|
|
922
1113
|
var o;
|
|
923
|
-
const s = t.message.hide_date === !0, n =
|
|
1114
|
+
const s = t.message.hide_date === !0, n = Ss(t.message);
|
|
924
1115
|
if (n) {
|
|
925
|
-
const l = ((o = t.message.text) == null ? void 0 : o.trim()) ||
|
|
1116
|
+
const l = ((o = t.message.text) == null ? void 0 : o.trim()) || Is[n];
|
|
926
1117
|
return /* @__PURE__ */ i("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
927
1118
|
/* @__PURE__ */ i(
|
|
928
1119
|
"div",
|
|
@@ -932,7 +1123,7 @@ const ms = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
932
1123
|
"data-dm-agent-system-type": n,
|
|
933
1124
|
children: [
|
|
934
1125
|
/* @__PURE__ */ e(
|
|
935
|
-
|
|
1126
|
+
Jt,
|
|
936
1127
|
{
|
|
937
1128
|
size: 16,
|
|
938
1129
|
weight: "regular",
|
|
@@ -944,7 +1135,7 @@ const ms = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
944
1135
|
]
|
|
945
1136
|
}
|
|
946
1137
|
),
|
|
947
|
-
!s && /* @__PURE__ */ e(
|
|
1138
|
+
!s && /* @__PURE__ */ e(De, { message: t.message })
|
|
948
1139
|
] });
|
|
949
1140
|
}
|
|
950
1141
|
return /* @__PURE__ */ i("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
@@ -953,12 +1144,12 @@ const ms = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
953
1144
|
/* @__PURE__ */ e("p", { children: t.message.text }),
|
|
954
1145
|
/* @__PURE__ */ e("div", { className: "str-chat__message--system__line" })
|
|
955
1146
|
] }),
|
|
956
|
-
!s && /* @__PURE__ */ e(
|
|
1147
|
+
!s && /* @__PURE__ */ e(De, { message: t.message })
|
|
957
1148
|
] });
|
|
958
|
-
},
|
|
1149
|
+
}, ks = () => null, Ts = ({ className: t, message: s }) => /* @__PURE__ */ i(
|
|
959
1150
|
"div",
|
|
960
1151
|
{
|
|
961
|
-
className:
|
|
1152
|
+
className: D("flex items-center justify-center h-full", t),
|
|
962
1153
|
children: [
|
|
963
1154
|
/* @__PURE__ */ i("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
|
|
964
1155
|
/* @__PURE__ */ e("circle", { cx: "6", cy: "50", r: "6", children: /* @__PURE__ */ e(
|
|
@@ -998,45 +1189,45 @@ const ms = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
998
1189
|
s && /* @__PURE__ */ e("span", { className: "text-stone", children: s })
|
|
999
1190
|
]
|
|
1000
1191
|
}
|
|
1001
|
-
), Ne =
|
|
1002
|
-
/* @__PURE__ */ e(
|
|
1192
|
+
), Ne = B.memo(() => /* @__PURE__ */ e("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ i("div", { className: "flex items-center", children: [
|
|
1193
|
+
/* @__PURE__ */ e(Ts, { className: "w-6 h-6" }),
|
|
1003
1194
|
/* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading messages" })
|
|
1004
1195
|
] }) }));
|
|
1005
1196
|
Ne.displayName = "LoadingState";
|
|
1006
|
-
const
|
|
1197
|
+
const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring", Ds = ({
|
|
1007
1198
|
onBack: t,
|
|
1008
1199
|
showBackButton: s,
|
|
1009
1200
|
onShowInfo: n,
|
|
1010
1201
|
canShowInfo: o,
|
|
1011
1202
|
showStarButton: l = !1
|
|
1012
1203
|
}) => {
|
|
1013
|
-
var
|
|
1014
|
-
const { channel:
|
|
1015
|
-
(
|
|
1016
|
-
var
|
|
1017
|
-
return ((
|
|
1204
|
+
var E, a, _, I, v, M;
|
|
1205
|
+
const { channel: h } = Se(), r = B.useMemo(() => Object.values(h.state.members || {}).find(
|
|
1206
|
+
(C) => {
|
|
1207
|
+
var w;
|
|
1208
|
+
return ((w = C.user) == null ? void 0 : w.id) && C.user.id !== h._client.userID;
|
|
1018
1209
|
}
|
|
1019
|
-
), [
|
|
1020
|
-
!!((
|
|
1210
|
+
), [h._client.userID, h.state.members]), c = ((E = r == null ? void 0 : r.user) == null ? void 0 : E.name) || ((a = r == null ? void 0 : r.user) == null ? void 0 : a.id) || "Unknown member", b = (_ = r == null ? void 0 : r.user) == null ? void 0 : _.image, [f, N] = k(
|
|
1211
|
+
!!((I = h.state.membership) != null && I.pinned_at)
|
|
1021
1212
|
);
|
|
1022
1213
|
Q(() => {
|
|
1023
|
-
const
|
|
1024
|
-
var
|
|
1214
|
+
const p = (C) => {
|
|
1215
|
+
var w;
|
|
1025
1216
|
N(
|
|
1026
|
-
|
|
1217
|
+
C != null && C.member ? !!C.member.pinned_at : !!((w = h.state.membership) != null && w.pinned_at)
|
|
1027
1218
|
);
|
|
1028
1219
|
};
|
|
1029
|
-
return
|
|
1030
|
-
|
|
1220
|
+
return h.on("member.updated", p), () => {
|
|
1221
|
+
h.off("member.updated", p);
|
|
1031
1222
|
};
|
|
1032
|
-
}, [
|
|
1033
|
-
const
|
|
1223
|
+
}, [h]);
|
|
1224
|
+
const g = async () => {
|
|
1034
1225
|
try {
|
|
1035
|
-
f ? await
|
|
1036
|
-
} catch (
|
|
1226
|
+
f ? await h.unpin() : await h.pin();
|
|
1227
|
+
} catch (p) {
|
|
1037
1228
|
console.error(
|
|
1038
1229
|
"[CustomChannelHeader] Failed to update pinned status:",
|
|
1039
|
-
|
|
1230
|
+
p
|
|
1040
1231
|
);
|
|
1041
1232
|
}
|
|
1042
1233
|
};
|
|
@@ -1045,21 +1236,21 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1045
1236
|
/* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: s && /* @__PURE__ */ e(
|
|
1046
1237
|
"button",
|
|
1047
1238
|
{
|
|
1048
|
-
className:
|
|
1239
|
+
className: ie,
|
|
1049
1240
|
onClick: t || (() => {
|
|
1050
1241
|
}),
|
|
1051
1242
|
type: "button",
|
|
1052
1243
|
"aria-label": "Back to conversations",
|
|
1053
|
-
children: /* @__PURE__ */ e(
|
|
1244
|
+
children: /* @__PURE__ */ e(Le, { className: "size-5 text-black/90" })
|
|
1054
1245
|
}
|
|
1055
1246
|
) }),
|
|
1056
1247
|
/* @__PURE__ */ i("div", { className: "flex flex-col gap-1 items-center", children: [
|
|
1057
1248
|
/* @__PURE__ */ e(
|
|
1058
|
-
|
|
1249
|
+
se,
|
|
1059
1250
|
{
|
|
1060
|
-
id: ((
|
|
1251
|
+
id: ((v = r == null ? void 0 : r.user) == null ? void 0 : v.id) || h.id || "unknown",
|
|
1061
1252
|
name: c,
|
|
1062
|
-
image:
|
|
1253
|
+
image: b,
|
|
1063
1254
|
size: 40
|
|
1064
1255
|
}
|
|
1065
1256
|
),
|
|
@@ -1069,14 +1260,14 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1069
1260
|
l && /* @__PURE__ */ e(
|
|
1070
1261
|
"button",
|
|
1071
1262
|
{
|
|
1072
|
-
className:
|
|
1073
|
-
onClick:
|
|
1263
|
+
className: ie,
|
|
1264
|
+
onClick: g,
|
|
1074
1265
|
type: "button",
|
|
1075
1266
|
"aria-label": f ? "Unstar conversation" : "Star conversation",
|
|
1076
1267
|
children: /* @__PURE__ */ e(
|
|
1077
|
-
|
|
1268
|
+
Pe,
|
|
1078
1269
|
{
|
|
1079
|
-
className:
|
|
1270
|
+
className: D("size-5", {
|
|
1080
1271
|
"text-yellow-600": f,
|
|
1081
1272
|
"text-black/90": !f
|
|
1082
1273
|
}),
|
|
@@ -1088,11 +1279,11 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1088
1279
|
/* @__PURE__ */ e(
|
|
1089
1280
|
"button",
|
|
1090
1281
|
{
|
|
1091
|
-
className:
|
|
1282
|
+
className: ie,
|
|
1092
1283
|
onClick: n,
|
|
1093
1284
|
type: "button",
|
|
1094
1285
|
"aria-label": "Show info",
|
|
1095
|
-
children: /* @__PURE__ */ e(
|
|
1286
|
+
children: /* @__PURE__ */ e(Ue, { className: "size-5 text-black/90" })
|
|
1096
1287
|
}
|
|
1097
1288
|
)
|
|
1098
1289
|
] })
|
|
@@ -1104,17 +1295,17 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1104
1295
|
{
|
|
1105
1296
|
type: "button",
|
|
1106
1297
|
onClick: t,
|
|
1107
|
-
className:
|
|
1298
|
+
className: ie,
|
|
1108
1299
|
"aria-label": "Back to conversations",
|
|
1109
|
-
children: /* @__PURE__ */ e(
|
|
1300
|
+
children: /* @__PURE__ */ e(Le, { className: "size-5 text-black/90" })
|
|
1110
1301
|
}
|
|
1111
1302
|
),
|
|
1112
1303
|
/* @__PURE__ */ e(
|
|
1113
|
-
|
|
1304
|
+
se,
|
|
1114
1305
|
{
|
|
1115
|
-
id: ((
|
|
1306
|
+
id: ((M = r == null ? void 0 : r.user) == null ? void 0 : M.id) || h.id || "unknown",
|
|
1116
1307
|
name: c,
|
|
1117
|
-
image:
|
|
1308
|
+
image: b,
|
|
1118
1309
|
size: 40
|
|
1119
1310
|
}
|
|
1120
1311
|
),
|
|
@@ -1124,14 +1315,14 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1124
1315
|
l && /* @__PURE__ */ e(
|
|
1125
1316
|
"button",
|
|
1126
1317
|
{
|
|
1127
|
-
className:
|
|
1128
|
-
onClick:
|
|
1318
|
+
className: ie,
|
|
1319
|
+
onClick: g,
|
|
1129
1320
|
type: "button",
|
|
1130
1321
|
"aria-label": f ? "Unstar conversation" : "Star conversation",
|
|
1131
1322
|
children: /* @__PURE__ */ e(
|
|
1132
|
-
|
|
1323
|
+
Pe,
|
|
1133
1324
|
{
|
|
1134
|
-
className:
|
|
1325
|
+
className: D("size-5", {
|
|
1135
1326
|
"text-yellow-600": f,
|
|
1136
1327
|
"text-black/90": !f
|
|
1137
1328
|
}),
|
|
@@ -1143,264 +1334,82 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1143
1334
|
o && n && /* @__PURE__ */ e(
|
|
1144
1335
|
"button",
|
|
1145
1336
|
{
|
|
1146
|
-
className:
|
|
1337
|
+
className: ie,
|
|
1147
1338
|
onClick: n,
|
|
1148
1339
|
type: "button",
|
|
1149
1340
|
"aria-label": "Show info",
|
|
1150
|
-
children: /* @__PURE__ */ e(
|
|
1341
|
+
children: /* @__PURE__ */ e(Ue, { className: "size-5 text-black/90" })
|
|
1151
1342
|
}
|
|
1152
1343
|
)
|
|
1153
1344
|
] })
|
|
1154
1345
|
] })
|
|
1155
1346
|
] });
|
|
1156
|
-
},
|
|
1157
|
-
dialogRef: t,
|
|
1158
|
-
onClose: s,
|
|
1159
|
-
participant: n,
|
|
1160
|
-
channel: o,
|
|
1161
|
-
followerStatusLabel: l,
|
|
1162
|
-
onLeaveConversation: m,
|
|
1163
|
-
onBlockParticipant: a,
|
|
1164
|
-
showDeleteConversation: c = !0,
|
|
1165
|
-
onDeleteConversationClick: g,
|
|
1166
|
-
onBlockParticipantClick: f,
|
|
1167
|
-
onReportParticipantClick: N,
|
|
1168
|
-
customChannelActions: b
|
|
1169
|
-
}) => {
|
|
1170
|
-
var W, B, se, ne, ae, j, re;
|
|
1171
|
-
const { service: y, debug: r } = ve(), [S, v] = k(!1), [w, D] = k(!1), [C, p] = k(!1), E = L(async () => {
|
|
1172
|
-
var P;
|
|
1173
|
-
if (!(!y || !((P = n == null ? void 0 : n.user) != null && P.id)))
|
|
1174
|
-
try {
|
|
1175
|
-
const G = (await y.getBlockedUsers()).some(
|
|
1176
|
-
(A) => {
|
|
1177
|
-
var X;
|
|
1178
|
-
return A.blocked_user_id === ((X = n == null ? void 0 : n.user) == null ? void 0 : X.id);
|
|
1179
|
-
}
|
|
1180
|
-
);
|
|
1181
|
-
v(G);
|
|
1182
|
-
} catch (U) {
|
|
1183
|
-
console.error(
|
|
1184
|
-
"[ChannelInfoDialog] Failed to check blocked status:",
|
|
1185
|
-
U
|
|
1186
|
-
);
|
|
1187
|
-
}
|
|
1188
|
-
}, [y, (W = n == null ? void 0 : n.user) == null ? void 0 : W.id]);
|
|
1189
|
-
Q(() => {
|
|
1190
|
-
E();
|
|
1191
|
-
}, [E]);
|
|
1192
|
-
const _ = async () => {
|
|
1193
|
-
var P;
|
|
1194
|
-
if (!w) {
|
|
1195
|
-
g == null || g(), r && console.log("[ChannelInfoDialog] Leave conversation", o.cid), D(!0);
|
|
1196
|
-
try {
|
|
1197
|
-
const U = ((P = o._client) == null ? void 0 : P.userID) ?? null;
|
|
1198
|
-
await o.hide(U, !1), m && await m(o), s();
|
|
1199
|
-
} catch (U) {
|
|
1200
|
-
console.error("[ChannelInfoDialog] Failed to leave conversation", U);
|
|
1201
|
-
} finally {
|
|
1202
|
-
D(!1);
|
|
1203
|
-
}
|
|
1204
|
-
}
|
|
1205
|
-
}, h = async () => {
|
|
1206
|
-
var P, U, G;
|
|
1207
|
-
if (!(C || !y)) {
|
|
1208
|
-
f == null || f(), r && console.log("[ChannelInfoDialog] Block member", (P = n == null ? void 0 : n.user) == null ? void 0 : P.id), p(!0);
|
|
1209
|
-
try {
|
|
1210
|
-
await y.blockUser((U = n == null ? void 0 : n.user) == null ? void 0 : U.id), a && await a((G = n == null ? void 0 : n.user) == null ? void 0 : G.id), s();
|
|
1211
|
-
} catch (A) {
|
|
1212
|
-
console.error("[ChannelInfoDialog] Failed to block member", A);
|
|
1213
|
-
} finally {
|
|
1214
|
-
p(!1);
|
|
1215
|
-
}
|
|
1216
|
-
}
|
|
1217
|
-
}, u = async () => {
|
|
1218
|
-
var P, U, G;
|
|
1219
|
-
if (!(C || !y)) {
|
|
1220
|
-
f == null || f(), r && console.log("[ChannelInfoDialog] Unblock member", (P = n == null ? void 0 : n.user) == null ? void 0 : P.id), p(!0);
|
|
1221
|
-
try {
|
|
1222
|
-
await y.unBlockUser((U = n == null ? void 0 : n.user) == null ? void 0 : U.id), a && await a((G = n == null ? void 0 : n.user) == null ? void 0 : G.id), s();
|
|
1223
|
-
} catch (A) {
|
|
1224
|
-
console.error("[ChannelInfoDialog] Failed to unblock member", A);
|
|
1225
|
-
} finally {
|
|
1226
|
-
p(!1);
|
|
1227
|
-
}
|
|
1228
|
-
}
|
|
1229
|
-
}, d = () => {
|
|
1230
|
-
N == null || N(), s(), window.open(
|
|
1231
|
-
"https://linktr.ee/s/about/trust-center/report",
|
|
1232
|
-
"_blank",
|
|
1233
|
-
"noopener,noreferrer"
|
|
1234
|
-
);
|
|
1235
|
-
};
|
|
1236
|
-
if (!n) return null;
|
|
1237
|
-
const x = ((B = n.user) == null ? void 0 : B.name) || ((se = n.user) == null ? void 0 : se.id) || "Unknown member", M = (ne = n.user) == null ? void 0 : ne.image, H = (ae = n.user) == null ? void 0 : ae.email, Z = (j = n.user) == null ? void 0 : j.username, z = H || (Z ? `linktr.ee/${Z}` : void 0), T = ((re = n.user) == null ? void 0 : re.id) || "unknown";
|
|
1238
|
-
return (
|
|
1239
|
-
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
|
|
1240
|
-
/* @__PURE__ */ e(
|
|
1241
|
-
"dialog",
|
|
1242
|
-
{
|
|
1243
|
-
ref: t,
|
|
1244
|
-
className: "mes-dialog group",
|
|
1245
|
-
onClose: s,
|
|
1246
|
-
onClick: (P) => {
|
|
1247
|
-
P.target === t.current && s();
|
|
1248
|
-
},
|
|
1249
|
-
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: [
|
|
1250
|
-
/* @__PURE__ */ i("div", { className: "flex items-center justify-between border-b border-sand px-4 py-3", children: [
|
|
1251
|
-
/* @__PURE__ */ e("h2", { className: "text-base font-semibold text-charcoal", children: "Chat info" }),
|
|
1252
|
-
/* @__PURE__ */ e(Ye, { onClick: s })
|
|
1253
|
-
] }),
|
|
1254
|
-
/* @__PURE__ */ i("div", { className: "flex-1 px-2 overflow-y-auto w-full", children: [
|
|
1255
|
-
/* @__PURE__ */ e(
|
|
1256
|
-
"div",
|
|
1257
|
-
{
|
|
1258
|
-
className: "flex flex-col items-center gap-3 self-stretch px-4 py-2 mt-6 rounded-lg border border-black/[0.04]",
|
|
1259
|
-
style: { backgroundColor: "#FBFAF9" },
|
|
1260
|
-
children: /* @__PURE__ */ i("div", { className: "flex items-center gap-3 w-full", children: [
|
|
1261
|
-
/* @__PURE__ */ e(
|
|
1262
|
-
te,
|
|
1263
|
-
{
|
|
1264
|
-
id: T,
|
|
1265
|
-
name: x,
|
|
1266
|
-
image: M,
|
|
1267
|
-
size: 88,
|
|
1268
|
-
shape: "circle"
|
|
1269
|
-
}
|
|
1270
|
-
),
|
|
1271
|
-
/* @__PURE__ */ i("div", { className: "flex flex-col min-w-0 flex-1", children: [
|
|
1272
|
-
/* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: x }),
|
|
1273
|
-
z && /* @__PURE__ */ e("p", { className: "truncate text-sm text-[#00000055]", children: z }),
|
|
1274
|
-
l && /* @__PURE__ */ e(
|
|
1275
|
-
"span",
|
|
1276
|
-
{
|
|
1277
|
-
className: "mt-1 rounded-full text-xs font-normal w-fit",
|
|
1278
|
-
style: {
|
|
1279
|
-
padding: "4px 8px",
|
|
1280
|
-
backgroundColor: l === "Subscribed to you" ? "#DCFCE7" : "#F5F5F4",
|
|
1281
|
-
color: l === "Subscribed to you" ? "#008236" : "#78716C",
|
|
1282
|
-
lineHeight: "133.333%",
|
|
1283
|
-
letterSpacing: "0.21px"
|
|
1284
|
-
},
|
|
1285
|
-
children: l
|
|
1286
|
-
}
|
|
1287
|
-
)
|
|
1288
|
-
] })
|
|
1289
|
-
] })
|
|
1290
|
-
}
|
|
1291
|
-
),
|
|
1292
|
-
/* @__PURE__ */ i("ul", { className: "flex flex-col gap-2 mt-2", children: [
|
|
1293
|
-
c && /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(
|
|
1294
|
-
xe,
|
|
1295
|
-
{
|
|
1296
|
-
onClick: _,
|
|
1297
|
-
disabled: w,
|
|
1298
|
-
"aria-busy": w,
|
|
1299
|
-
children: [
|
|
1300
|
-
w ? /* @__PURE__ */ e(be, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Yt, { className: "h-5 w-5" }),
|
|
1301
|
-
/* @__PURE__ */ e("span", { children: "Delete Conversation" })
|
|
1302
|
-
]
|
|
1303
|
-
}
|
|
1304
|
-
) }),
|
|
1305
|
-
/* @__PURE__ */ e("li", { children: S ? /* @__PURE__ */ i(
|
|
1306
|
-
xe,
|
|
1307
|
-
{
|
|
1308
|
-
onClick: u,
|
|
1309
|
-
disabled: C,
|
|
1310
|
-
"aria-busy": C,
|
|
1311
|
-
children: [
|
|
1312
|
-
C ? /* @__PURE__ */ e(be, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Ue, { className: "h-5 w-5" }),
|
|
1313
|
-
/* @__PURE__ */ e("span", { children: "Unblock" })
|
|
1314
|
-
]
|
|
1315
|
-
}
|
|
1316
|
-
) : /* @__PURE__ */ i(
|
|
1317
|
-
xe,
|
|
1318
|
-
{
|
|
1319
|
-
onClick: h,
|
|
1320
|
-
disabled: C,
|
|
1321
|
-
"aria-busy": C,
|
|
1322
|
-
children: [
|
|
1323
|
-
C ? /* @__PURE__ */ e(be, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Ue, { className: "h-5 w-5" }),
|
|
1324
|
-
/* @__PURE__ */ e("span", { children: "Block" })
|
|
1325
|
-
]
|
|
1326
|
-
}
|
|
1327
|
-
) }),
|
|
1328
|
-
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(xe, { variant: "danger", onClick: d, children: [
|
|
1329
|
-
/* @__PURE__ */ e(Zt, { className: "h-5 w-5" }),
|
|
1330
|
-
/* @__PURE__ */ e("span", { children: "Report" })
|
|
1331
|
-
] }) }),
|
|
1332
|
-
b
|
|
1333
|
-
] })
|
|
1334
|
-
] })
|
|
1335
|
-
] })
|
|
1336
|
-
}
|
|
1337
|
-
)
|
|
1338
|
-
);
|
|
1339
|
-
}, Ts = ({
|
|
1347
|
+
}, Rs = ({
|
|
1340
1348
|
onBack: t,
|
|
1341
1349
|
showBackButton: s,
|
|
1342
1350
|
renderMessageInputActions: n,
|
|
1343
1351
|
renderConversationFooter: o,
|
|
1344
1352
|
onLeaveConversation: l,
|
|
1345
|
-
onBlockParticipant:
|
|
1346
|
-
showDeleteConversation:
|
|
1353
|
+
onBlockParticipant: h,
|
|
1354
|
+
showDeleteConversation: r = !0,
|
|
1347
1355
|
onDeleteConversationClick: c,
|
|
1348
|
-
onBlockParticipantClick:
|
|
1356
|
+
onBlockParticipantClick: b,
|
|
1349
1357
|
onReportParticipantClick: f,
|
|
1350
1358
|
showStarButton: N = !1,
|
|
1351
|
-
chatbotVotingEnabled:
|
|
1352
|
-
renderChannelBanner:
|
|
1353
|
-
|
|
1354
|
-
|
|
1359
|
+
chatbotVotingEnabled: g = !1,
|
|
1360
|
+
renderChannelBanner: E,
|
|
1361
|
+
customProfileContent: a,
|
|
1362
|
+
customChannelActions: _,
|
|
1363
|
+
renderMessage: I
|
|
1355
1364
|
}) => {
|
|
1356
|
-
const { channel: v } = Se(),
|
|
1357
|
-
(
|
|
1358
|
-
var
|
|
1359
|
-
return ((
|
|
1365
|
+
const { channel: v } = Se(), M = J(null), p = B.useMemo(() => Object.values(v.state.members || {}).find(
|
|
1366
|
+
(u) => {
|
|
1367
|
+
var m;
|
|
1368
|
+
return ((m = u.user) == null ? void 0 : m.id) && u.user.id !== v._client.userID;
|
|
1360
1369
|
}
|
|
1361
|
-
), [v._client.userID, v.state.members]), C =
|
|
1362
|
-
const
|
|
1363
|
-
if (
|
|
1364
|
-
return String(
|
|
1365
|
-
if (
|
|
1366
|
-
return
|
|
1367
|
-
}, [v.data]),
|
|
1368
|
-
var
|
|
1369
|
-
(
|
|
1370
|
-
}, []),
|
|
1371
|
-
var
|
|
1372
|
-
(
|
|
1370
|
+
), [v._client.userID, v.state.members]), C = B.useMemo(() => {
|
|
1371
|
+
const d = v.data ?? {};
|
|
1372
|
+
if (d.followerStatus)
|
|
1373
|
+
return String(d.followerStatus);
|
|
1374
|
+
if (d.isFollower !== void 0)
|
|
1375
|
+
return d.isFollower ? "Subscribed to you" : "Not subscribed";
|
|
1376
|
+
}, [v.data]), w = L(() => {
|
|
1377
|
+
var d;
|
|
1378
|
+
(d = M.current) == null || d.showModal();
|
|
1379
|
+
}, []), R = L(() => {
|
|
1380
|
+
var d;
|
|
1381
|
+
(d = M.current) == null || d.close();
|
|
1373
1382
|
}, []);
|
|
1374
|
-
return /* @__PURE__ */ i(
|
|
1383
|
+
return /* @__PURE__ */ i(me, { children: [
|
|
1375
1384
|
/* @__PURE__ */ e(
|
|
1376
|
-
|
|
1385
|
+
Vt,
|
|
1377
1386
|
{
|
|
1378
1387
|
overrides: {
|
|
1379
|
-
Message: (
|
|
1380
|
-
const { message:
|
|
1381
|
-
|
|
1388
|
+
Message: (d) => {
|
|
1389
|
+
const { message: u } = je("ChannelView"), m = /* @__PURE__ */ e(
|
|
1390
|
+
Ns,
|
|
1382
1391
|
{
|
|
1383
|
-
...
|
|
1384
|
-
chatbotVotingEnabled:
|
|
1392
|
+
...d,
|
|
1393
|
+
chatbotVotingEnabled: g
|
|
1385
1394
|
}
|
|
1386
1395
|
);
|
|
1387
|
-
return !
|
|
1396
|
+
return !I || !u ? m : I(m, u);
|
|
1388
1397
|
}
|
|
1389
1398
|
},
|
|
1390
|
-
children: /* @__PURE__ */ i(
|
|
1399
|
+
children: /* @__PURE__ */ i(Ht, { children: [
|
|
1391
1400
|
/* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ e(
|
|
1392
|
-
|
|
1401
|
+
Ds,
|
|
1393
1402
|
{
|
|
1394
1403
|
onBack: t,
|
|
1395
1404
|
showBackButton: s,
|
|
1396
|
-
onShowInfo:
|
|
1397
|
-
canShowInfo: !!
|
|
1405
|
+
onShowInfo: w,
|
|
1406
|
+
canShowInfo: !!p,
|
|
1398
1407
|
showStarButton: N
|
|
1399
1408
|
}
|
|
1400
1409
|
) }),
|
|
1401
|
-
|
|
1410
|
+
E == null ? void 0 : E(),
|
|
1402
1411
|
/* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden relative", children: /* @__PURE__ */ e(
|
|
1403
|
-
|
|
1412
|
+
zt,
|
|
1404
1413
|
{
|
|
1405
1414
|
hideDeletedMessages: !0,
|
|
1406
1415
|
hideNewMessageSeparator: !1,
|
|
@@ -1409,7 +1418,7 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1409
1418
|
) }),
|
|
1410
1419
|
o == null ? void 0 : o(v),
|
|
1411
1420
|
/* @__PURE__ */ e(
|
|
1412
|
-
|
|
1421
|
+
Es,
|
|
1413
1422
|
{
|
|
1414
1423
|
renderActions: () => n == null ? void 0 : n(v)
|
|
1415
1424
|
}
|
|
@@ -1418,102 +1427,105 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1418
1427
|
}
|
|
1419
1428
|
),
|
|
1420
1429
|
/* @__PURE__ */ e(
|
|
1421
|
-
|
|
1430
|
+
ds,
|
|
1422
1431
|
{
|
|
1423
|
-
dialogRef:
|
|
1424
|
-
onClose:
|
|
1425
|
-
participant:
|
|
1432
|
+
dialogRef: M,
|
|
1433
|
+
onClose: R,
|
|
1434
|
+
participant: p,
|
|
1426
1435
|
channel: v,
|
|
1427
1436
|
followerStatusLabel: C,
|
|
1428
1437
|
onLeaveConversation: l,
|
|
1429
|
-
onBlockParticipant:
|
|
1430
|
-
showDeleteConversation:
|
|
1438
|
+
onBlockParticipant: h,
|
|
1439
|
+
showDeleteConversation: r,
|
|
1431
1440
|
onDeleteConversationClick: c,
|
|
1432
|
-
onBlockParticipantClick:
|
|
1441
|
+
onBlockParticipantClick: b,
|
|
1433
1442
|
onReportParticipantClick: f,
|
|
1434
|
-
|
|
1443
|
+
customProfileContent: a,
|
|
1444
|
+
customChannelActions: _
|
|
1435
1445
|
}
|
|
1436
1446
|
)
|
|
1437
1447
|
] });
|
|
1438
|
-
}, Ze =
|
|
1448
|
+
}, Ze = B.memo(
|
|
1439
1449
|
({
|
|
1440
1450
|
channel: t,
|
|
1441
1451
|
onBack: s,
|
|
1442
1452
|
showBackButton: n = !1,
|
|
1443
1453
|
renderMessageInputActions: o,
|
|
1444
1454
|
renderConversationFooter: l,
|
|
1445
|
-
onLeaveConversation:
|
|
1446
|
-
onBlockParticipant:
|
|
1455
|
+
onLeaveConversation: h,
|
|
1456
|
+
onBlockParticipant: r,
|
|
1447
1457
|
className: c,
|
|
1448
|
-
CustomChannelEmptyState:
|
|
1458
|
+
CustomChannelEmptyState: b = ks,
|
|
1449
1459
|
showDeleteConversation: f = !0,
|
|
1450
1460
|
onDeleteConversationClick: N,
|
|
1451
|
-
onBlockParticipantClick:
|
|
1452
|
-
onReportParticipantClick:
|
|
1453
|
-
dmAgentEnabled:
|
|
1454
|
-
messageMetadata:
|
|
1455
|
-
onMessageSent:
|
|
1456
|
-
showStarButton:
|
|
1457
|
-
chatbotVotingEnabled:
|
|
1458
|
-
renderChannelBanner:
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
+
onBlockParticipantClick: g,
|
|
1462
|
+
onReportParticipantClick: E,
|
|
1463
|
+
dmAgentEnabled: a,
|
|
1464
|
+
messageMetadata: _,
|
|
1465
|
+
onMessageSent: I,
|
|
1466
|
+
showStarButton: v = !1,
|
|
1467
|
+
chatbotVotingEnabled: M = !1,
|
|
1468
|
+
renderChannelBanner: p,
|
|
1469
|
+
customProfileContent: C,
|
|
1470
|
+
customChannelActions: w,
|
|
1471
|
+
renderMessage: R
|
|
1461
1472
|
}) => {
|
|
1462
|
-
const
|
|
1463
|
-
async (
|
|
1473
|
+
const d = L(
|
|
1474
|
+
async (u, m, y) => {
|
|
1464
1475
|
var T;
|
|
1465
|
-
const x = ((T = t.data) == null ? void 0 : T.chatbot_paused) === !0,
|
|
1466
|
-
...
|
|
1467
|
-
...
|
|
1468
|
-
...
|
|
1476
|
+
const x = ((T = t.data) == null ? void 0 : T.chatbot_paused) === !0, P = a && !x, X = {
|
|
1477
|
+
...m,
|
|
1478
|
+
...P && { silent: !0 },
|
|
1479
|
+
..._ && {
|
|
1469
1480
|
metadata: {
|
|
1470
|
-
...
|
|
1471
|
-
...
|
|
1481
|
+
...m.metadata ?? {},
|
|
1482
|
+
..._
|
|
1472
1483
|
}
|
|
1473
1484
|
}
|
|
1474
|
-
},
|
|
1475
|
-
...
|
|
1476
|
-
...
|
|
1477
|
-
},
|
|
1478
|
-
return
|
|
1485
|
+
}, Y = {
|
|
1486
|
+
...y,
|
|
1487
|
+
...P && { skip_push: !0 }
|
|
1488
|
+
}, q = await t.sendMessage(X, Y);
|
|
1489
|
+
return I == null || I(q), q;
|
|
1479
1490
|
},
|
|
1480
|
-
[t,
|
|
1491
|
+
[t, a, _, I]
|
|
1481
1492
|
);
|
|
1482
1493
|
return /* @__PURE__ */ e(
|
|
1483
1494
|
"div",
|
|
1484
1495
|
{
|
|
1485
|
-
className:
|
|
1496
|
+
className: D(
|
|
1486
1497
|
"messaging-channel-view h-full flex flex-col",
|
|
1487
1498
|
c
|
|
1488
1499
|
),
|
|
1489
1500
|
children: /* @__PURE__ */ e(
|
|
1490
|
-
|
|
1501
|
+
Gt,
|
|
1491
1502
|
{
|
|
1492
1503
|
channel: t,
|
|
1493
|
-
MessageSystem:
|
|
1494
|
-
EmptyStateIndicator:
|
|
1504
|
+
MessageSystem: Ms,
|
|
1505
|
+
EmptyStateIndicator: b,
|
|
1495
1506
|
LoadingIndicator: Ne,
|
|
1496
|
-
DateSeparator:
|
|
1497
|
-
doSendMessageRequest:
|
|
1507
|
+
DateSeparator: us,
|
|
1508
|
+
doSendMessageRequest: d,
|
|
1498
1509
|
children: /* @__PURE__ */ e(
|
|
1499
|
-
|
|
1510
|
+
Rs,
|
|
1500
1511
|
{
|
|
1501
1512
|
onBack: s,
|
|
1502
1513
|
showBackButton: n,
|
|
1503
1514
|
renderMessageInputActions: o,
|
|
1504
1515
|
renderConversationFooter: l,
|
|
1505
|
-
onLeaveConversation:
|
|
1506
|
-
onBlockParticipant:
|
|
1507
|
-
CustomChannelEmptyState:
|
|
1516
|
+
onLeaveConversation: h,
|
|
1517
|
+
onBlockParticipant: r,
|
|
1518
|
+
CustomChannelEmptyState: b,
|
|
1508
1519
|
showDeleteConversation: f,
|
|
1509
1520
|
onDeleteConversationClick: N,
|
|
1510
|
-
onBlockParticipantClick:
|
|
1511
|
-
onReportParticipantClick:
|
|
1512
|
-
showStarButton:
|
|
1513
|
-
chatbotVotingEnabled:
|
|
1514
|
-
renderChannelBanner:
|
|
1515
|
-
|
|
1516
|
-
|
|
1521
|
+
onBlockParticipantClick: g,
|
|
1522
|
+
onReportParticipantClick: E,
|
|
1523
|
+
showStarButton: v,
|
|
1524
|
+
chatbotVotingEnabled: M,
|
|
1525
|
+
renderChannelBanner: p,
|
|
1526
|
+
customProfileContent: C,
|
|
1527
|
+
customChannelActions: w,
|
|
1528
|
+
renderMessage: R
|
|
1517
1529
|
}
|
|
1518
1530
|
)
|
|
1519
1531
|
}
|
|
@@ -1523,7 +1535,7 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1523
1535
|
}
|
|
1524
1536
|
);
|
|
1525
1537
|
Ze.displayName = "ChannelView";
|
|
1526
|
-
function
|
|
1538
|
+
function Ls({
|
|
1527
1539
|
searchQuery: t,
|
|
1528
1540
|
setSearchQuery: s,
|
|
1529
1541
|
placeholder: n
|
|
@@ -1531,7 +1543,7 @@ function Rs({
|
|
|
1531
1543
|
const o = J(null);
|
|
1532
1544
|
return /* @__PURE__ */ i("div", { className: "relative", children: [
|
|
1533
1545
|
/* @__PURE__ */ e(
|
|
1534
|
-
|
|
1546
|
+
Qt,
|
|
1535
1547
|
{
|
|
1536
1548
|
className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-stone",
|
|
1537
1549
|
weight: "bold"
|
|
@@ -1562,18 +1574,18 @@ function Rs({
|
|
|
1562
1574
|
)
|
|
1563
1575
|
] });
|
|
1564
1576
|
}
|
|
1565
|
-
const
|
|
1577
|
+
const Ps = ({
|
|
1566
1578
|
participantSource: t,
|
|
1567
1579
|
onSelectParticipant: s,
|
|
1568
1580
|
onClose: n,
|
|
1569
1581
|
existingParticipantIds: o = /* @__PURE__ */ new Set(),
|
|
1570
1582
|
participantLabel: l = "participants",
|
|
1571
|
-
searchPlaceholder:
|
|
1572
|
-
className:
|
|
1583
|
+
searchPlaceholder: h = "Search participants...",
|
|
1584
|
+
className: r
|
|
1573
1585
|
}) => {
|
|
1574
|
-
const { debug: c } = ve(), [
|
|
1586
|
+
const { debug: c } = ve(), [b, f] = k(""), [N, g] = k([]), [E, a] = k(!1), [_, I] = k(null), [v, M] = k(
|
|
1575
1587
|
null
|
|
1576
|
-
),
|
|
1588
|
+
), p = J(!1);
|
|
1577
1589
|
Q(() => {
|
|
1578
1590
|
if (t.loading) {
|
|
1579
1591
|
c && console.log(
|
|
@@ -1581,48 +1593,48 @@ const Ls = ({
|
|
|
1581
1593
|
);
|
|
1582
1594
|
return;
|
|
1583
1595
|
}
|
|
1584
|
-
if (
|
|
1596
|
+
if (p.current) return;
|
|
1585
1597
|
(async () => {
|
|
1586
|
-
c && console.log("[ParticipantPicker] Loading initial participants..."),
|
|
1598
|
+
c && console.log("[ParticipantPicker] Loading initial participants..."), a(!0), I(null);
|
|
1587
1599
|
try {
|
|
1588
1600
|
const u = await t.loadParticipants({
|
|
1589
1601
|
search: "",
|
|
1590
1602
|
// Load all participants initially
|
|
1591
1603
|
limit: 100
|
|
1592
1604
|
});
|
|
1593
|
-
|
|
1605
|
+
g(u.participants), p.current = !0, c && console.log(
|
|
1594
1606
|
"[ParticipantPicker] Participants loaded successfully:",
|
|
1595
1607
|
u.participants.length
|
|
1596
1608
|
);
|
|
1597
1609
|
} catch (u) {
|
|
1598
|
-
const
|
|
1599
|
-
|
|
1610
|
+
const m = u instanceof Error ? u.message : "Failed to load participants";
|
|
1611
|
+
I(m), console.error("[ParticipantPicker] Failed to load participants:", u);
|
|
1600
1612
|
} finally {
|
|
1601
|
-
|
|
1613
|
+
a(!1);
|
|
1602
1614
|
}
|
|
1603
1615
|
})();
|
|
1604
1616
|
}, [t.loading, c]);
|
|
1605
|
-
const
|
|
1606
|
-
var
|
|
1607
|
-
if (!
|
|
1608
|
-
const u =
|
|
1609
|
-
return
|
|
1610
|
-
}),
|
|
1611
|
-
async (
|
|
1612
|
-
if (!
|
|
1613
|
-
|
|
1617
|
+
const C = N.filter((d) => !o.has(d.id)).filter((d) => {
|
|
1618
|
+
var m;
|
|
1619
|
+
if (!b) return !0;
|
|
1620
|
+
const u = b.toLowerCase();
|
|
1621
|
+
return d.name.toLowerCase().includes(u) || ((m = d.email) == null ? void 0 : m.toLowerCase().includes(u)) || !1;
|
|
1622
|
+
}), w = L(
|
|
1623
|
+
async (d) => {
|
|
1624
|
+
if (!v) {
|
|
1625
|
+
M(d.id);
|
|
1614
1626
|
try {
|
|
1615
|
-
await s(
|
|
1627
|
+
await s(d);
|
|
1616
1628
|
} catch (u) {
|
|
1617
|
-
console.error("[ParticipantPicker] Failed to start chat:", u),
|
|
1629
|
+
console.error("[ParticipantPicker] Failed to start chat:", u), M(null);
|
|
1618
1630
|
}
|
|
1619
1631
|
}
|
|
1620
1632
|
},
|
|
1621
|
-
[s,
|
|
1622
|
-
),
|
|
1623
|
-
(
|
|
1633
|
+
[s, v]
|
|
1634
|
+
), R = (d, u) => {
|
|
1635
|
+
(d.key === "Enter" || d.key === " ") && (d.preventDefault(), w(u));
|
|
1624
1636
|
};
|
|
1625
|
-
return /* @__PURE__ */ i("div", { className:
|
|
1637
|
+
return /* @__PURE__ */ i("div", { className: D("flex flex-col h-full", r), children: [
|
|
1626
1638
|
/* @__PURE__ */ i("div", { className: "px-4 py-4 border-b border-sand bg-chalk", children: [
|
|
1627
1639
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between mb-3", children: [
|
|
1628
1640
|
/* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-charcoal", children: "Start a new Conversation" }),
|
|
@@ -1632,74 +1644,74 @@ const Ls = ({
|
|
|
1632
1644
|
"Select a ",
|
|
1633
1645
|
l.slice(0, -1),
|
|
1634
1646
|
" to start messaging (",
|
|
1635
|
-
|
|
1647
|
+
C.length,
|
|
1636
1648
|
" available)",
|
|
1637
1649
|
t.totalCount !== void 0 && ` • ${t.totalCount} ${l} total`
|
|
1638
1650
|
] }),
|
|
1639
1651
|
/* @__PURE__ */ e(
|
|
1640
|
-
|
|
1652
|
+
Ls,
|
|
1641
1653
|
{
|
|
1642
|
-
searchQuery:
|
|
1654
|
+
searchQuery: b,
|
|
1643
1655
|
setSearchQuery: f,
|
|
1644
|
-
placeholder:
|
|
1656
|
+
placeholder: h
|
|
1645
1657
|
}
|
|
1646
1658
|
)
|
|
1647
1659
|
] }),
|
|
1648
|
-
|
|
1660
|
+
_ && /* @__PURE__ */ i("div", { className: "p-4 text-sm text-danger bg-danger-alt", children: [
|
|
1649
1661
|
"Error loading ",
|
|
1650
1662
|
l,
|
|
1651
1663
|
": ",
|
|
1652
|
-
|
|
1664
|
+
_
|
|
1653
1665
|
] }),
|
|
1654
|
-
/* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children:
|
|
1666
|
+
/* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: E && C.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: [
|
|
1655
1667
|
/* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
|
|
1656
1668
|
/* @__PURE__ */ i("span", { className: "text-sm text-stone", children: [
|
|
1657
1669
|
"Loading ",
|
|
1658
1670
|
l,
|
|
1659
1671
|
"..."
|
|
1660
1672
|
] })
|
|
1661
|
-
] }) }) :
|
|
1673
|
+
] }) }) : C.length === 0 ? /* @__PURE__ */ i("div", { className: "p-6 text-center", children: [
|
|
1662
1674
|
/* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(Oe, { className: "h-8 w-8 text-charcoal" }) }),
|
|
1663
|
-
/* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children:
|
|
1664
|
-
/* @__PURE__ */ e("p", { className: "text-xs text-stone", children:
|
|
1675
|
+
/* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: b ? `No ${l} found` : N.length > 0 ? `Already chatting with all ${l}` : `No ${l} yet` }),
|
|
1676
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-stone", children: b ? "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` })
|
|
1665
1677
|
] }) : /* @__PURE__ */ i("ul", { className: "space-y-0", children: [
|
|
1666
|
-
|
|
1667
|
-
const u =
|
|
1678
|
+
C.map((d) => {
|
|
1679
|
+
const u = d.name || d.email || d.id, m = d.email && d.name ? d.email : d.phone;
|
|
1668
1680
|
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
|
|
1669
1681
|
"button",
|
|
1670
1682
|
{
|
|
1671
1683
|
type: "button",
|
|
1672
|
-
onClick: () =>
|
|
1673
|
-
onKeyDown: (
|
|
1684
|
+
onClick: () => w(d),
|
|
1685
|
+
onKeyDown: (y) => R(y, d),
|
|
1674
1686
|
className: "w-full px-4 py-3 hover:bg-sand transition-colors border-b border-sand text-left focus-ring",
|
|
1675
1687
|
children: /* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [
|
|
1676
1688
|
/* @__PURE__ */ i("div", { className: "flex items-center space-x-3 flex-1 min-w-0", children: [
|
|
1677
1689
|
/* @__PURE__ */ e(
|
|
1678
|
-
|
|
1690
|
+
se,
|
|
1679
1691
|
{
|
|
1680
|
-
id:
|
|
1692
|
+
id: d.id,
|
|
1681
1693
|
name: u,
|
|
1682
|
-
image:
|
|
1694
|
+
image: d.image,
|
|
1683
1695
|
size: 40
|
|
1684
1696
|
}
|
|
1685
1697
|
),
|
|
1686
1698
|
/* @__PURE__ */ i("div", { className: "flex-1 min-w-0", children: [
|
|
1687
1699
|
/* @__PURE__ */ e("h4", { className: "text-sm font-medium text-charcoal truncate", children: u }),
|
|
1688
|
-
|
|
1700
|
+
m && /* @__PURE__ */ e("p", { className: "text-xs text-stone truncate", children: m })
|
|
1689
1701
|
] })
|
|
1690
1702
|
] }),
|
|
1691
|
-
/* @__PURE__ */ e("div", { className: "flex-shrink-0", children:
|
|
1703
|
+
/* @__PURE__ */ e("div", { className: "flex-shrink-0", children: v === d.id ? /* @__PURE__ */ e(be, { className: "h-5 w-5 text-primary animate-spin" }) : /* @__PURE__ */ e(Oe, { className: "h-5 w-5 text-stone" }) })
|
|
1692
1704
|
] })
|
|
1693
1705
|
}
|
|
1694
|
-
) },
|
|
1706
|
+
) }, d.id);
|
|
1695
1707
|
}),
|
|
1696
|
-
|
|
1708
|
+
E && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
|
|
1697
1709
|
/* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
|
|
1698
1710
|
/* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading more..." })
|
|
1699
1711
|
] }) })
|
|
1700
1712
|
] }) })
|
|
1701
1713
|
] });
|
|
1702
|
-
},
|
|
1714
|
+
}, Us = ({ className: t }) => /* @__PURE__ */ i(
|
|
1703
1715
|
"svg",
|
|
1704
1716
|
{
|
|
1705
1717
|
width: "140",
|
|
@@ -1833,9 +1845,9 @@ const Ls = ({
|
|
|
1833
1845
|
] })
|
|
1834
1846
|
]
|
|
1835
1847
|
}
|
|
1836
|
-
), Je =
|
|
1848
|
+
), Je = B.memo(
|
|
1837
1849
|
({ 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: [
|
|
1838
|
-
/* @__PURE__ */ e(
|
|
1850
|
+
/* @__PURE__ */ e(Us, {}),
|
|
1839
1851
|
s && !t && /* @__PURE__ */ i("div", { className: "mt-8", children: [
|
|
1840
1852
|
/* @__PURE__ */ e("h2", { className: "font-medium text-black text-[18px] mb-2", children: "Your inbox is empty" }),
|
|
1841
1853
|
/* @__PURE__ */ e("p", { className: "text-[#676B5F] text-sm mb-6", children: "Share with your followers to start receiving messages" })
|
|
@@ -1843,7 +1855,7 @@ const Ls = ({
|
|
|
1843
1855
|
] }) })
|
|
1844
1856
|
);
|
|
1845
1857
|
Je.displayName = "EmptyState";
|
|
1846
|
-
const Ce =
|
|
1858
|
+
const Ce = B.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: [
|
|
1847
1859
|
/* @__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: "⚠️" }) }),
|
|
1848
1860
|
/* @__PURE__ */ e("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
|
|
1849
1861
|
/* @__PURE__ */ e("p", { className: "text-stone text-sm mb-6", children: t }),
|
|
@@ -1858,126 +1870,127 @@ const Ce = F.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { clas
|
|
|
1858
1870
|
)
|
|
1859
1871
|
] }) }));
|
|
1860
1872
|
Ce.displayName = "ErrorState";
|
|
1861
|
-
const
|
|
1873
|
+
const zs = ({
|
|
1862
1874
|
capabilities: t = {},
|
|
1863
1875
|
className: s,
|
|
1864
1876
|
renderMessageInputActions: n,
|
|
1865
1877
|
renderConversationFooter: o,
|
|
1866
1878
|
onChannelSelect: l,
|
|
1867
|
-
onParticipantSelect:
|
|
1868
|
-
initialParticipantFilter:
|
|
1879
|
+
onParticipantSelect: h,
|
|
1880
|
+
initialParticipantFilter: r,
|
|
1869
1881
|
initialParticipantData: c,
|
|
1870
|
-
CustomChannelEmptyState:
|
|
1882
|
+
CustomChannelEmptyState: b,
|
|
1871
1883
|
showChannelList: f = !0,
|
|
1872
1884
|
filters: N,
|
|
1873
|
-
channelListCustomEmptyStateIndicator:
|
|
1874
|
-
onDeleteConversationClick:
|
|
1875
|
-
onBlockParticipantClick:
|
|
1876
|
-
onReportParticipantClick:
|
|
1877
|
-
dmAgentEnabled:
|
|
1878
|
-
messageMetadata:
|
|
1879
|
-
onMessageSent:
|
|
1880
|
-
showStarButton:
|
|
1881
|
-
chatbotVotingEnabled:
|
|
1882
|
-
renderMessagePreview:
|
|
1883
|
-
renderChannelBanner:
|
|
1884
|
-
|
|
1885
|
-
|
|
1885
|
+
channelListCustomEmptyStateIndicator: g,
|
|
1886
|
+
onDeleteConversationClick: E,
|
|
1887
|
+
onBlockParticipantClick: a,
|
|
1888
|
+
onReportParticipantClick: _,
|
|
1889
|
+
dmAgentEnabled: I,
|
|
1890
|
+
messageMetadata: v,
|
|
1891
|
+
onMessageSent: M,
|
|
1892
|
+
showStarButton: p = !1,
|
|
1893
|
+
chatbotVotingEnabled: C = !1,
|
|
1894
|
+
renderMessagePreview: w,
|
|
1895
|
+
renderChannelBanner: R,
|
|
1896
|
+
customProfileContent: d,
|
|
1897
|
+
customChannelActions: u,
|
|
1898
|
+
renderMessage: m
|
|
1886
1899
|
}) => {
|
|
1887
1900
|
const {
|
|
1888
|
-
service:
|
|
1901
|
+
service: y,
|
|
1889
1902
|
client: x,
|
|
1890
|
-
isConnected:
|
|
1891
|
-
isLoading:
|
|
1892
|
-
error:
|
|
1893
|
-
refreshConnection:
|
|
1903
|
+
isConnected: P,
|
|
1904
|
+
isLoading: X,
|
|
1905
|
+
error: Y,
|
|
1906
|
+
refreshConnection: q,
|
|
1894
1907
|
debug: T
|
|
1895
|
-
} =
|
|
1896
|
-
participantSource:
|
|
1897
|
-
participantLabel:
|
|
1898
|
-
showDeleteConversation:
|
|
1899
|
-
} = t,
|
|
1900
|
-
const
|
|
1908
|
+
} = Xt(), [z, j] = k(null), [ne, ae] = k(!1), [G, K] = k(!1), [re, U] = k(!1), [O, A] = k(/* @__PURE__ */ new Set()), [V, ce] = k(0), [W, oe] = k(!1), [ee, Z] = k(null), te = J(null), {
|
|
1909
|
+
participantSource: de,
|
|
1910
|
+
participantLabel: ue = "participants",
|
|
1911
|
+
showDeleteConversation: Qe = !0
|
|
1912
|
+
} = t, Xe = B.useMemo(() => {
|
|
1913
|
+
const S = x == null ? void 0 : x.userID;
|
|
1901
1914
|
return {
|
|
1902
1915
|
...{
|
|
1903
1916
|
type: "messaging",
|
|
1904
1917
|
last_message_at: { $exists: !0 },
|
|
1905
|
-
...
|
|
1906
|
-
members: { $in: [
|
|
1918
|
+
...S && {
|
|
1919
|
+
members: { $in: [S] },
|
|
1907
1920
|
hidden: !1
|
|
1908
1921
|
}
|
|
1909
1922
|
},
|
|
1910
1923
|
...N
|
|
1911
1924
|
};
|
|
1912
|
-
}, [N, x == null ? void 0 : x.userID]), he = J(null),
|
|
1913
|
-
if (!x || !
|
|
1914
|
-
const
|
|
1915
|
-
if (
|
|
1925
|
+
}, [N, x == null ? void 0 : x.userID]), he = J(null), le = L(async () => {
|
|
1926
|
+
if (!x || !P) return;
|
|
1927
|
+
const S = x.userID;
|
|
1928
|
+
if (S)
|
|
1916
1929
|
try {
|
|
1917
|
-
T && console.log("[MessagingShell] Syncing channels for user:",
|
|
1918
|
-
const
|
|
1930
|
+
T && console.log("[MessagingShell] Syncing channels for user:", S);
|
|
1931
|
+
const H = await x.queryChannels(
|
|
1919
1932
|
{
|
|
1920
1933
|
type: "messaging",
|
|
1921
|
-
members: { $in: [
|
|
1934
|
+
members: { $in: [S] }
|
|
1922
1935
|
},
|
|
1923
1936
|
{},
|
|
1924
1937
|
{ limit: 100 }
|
|
1925
|
-
),
|
|
1926
|
-
|
|
1938
|
+
), F = /* @__PURE__ */ new Set();
|
|
1939
|
+
H.forEach(($) => {
|
|
1927
1940
|
const we = $.state.members;
|
|
1928
|
-
Object.values(we).forEach((
|
|
1929
|
-
var
|
|
1930
|
-
const pe = (
|
|
1931
|
-
pe && pe !==
|
|
1941
|
+
Object.values(we).forEach((rt) => {
|
|
1942
|
+
var Te;
|
|
1943
|
+
const pe = (Te = rt.user) == null ? void 0 : Te.id;
|
|
1944
|
+
pe && pe !== S && F.add(pe);
|
|
1932
1945
|
});
|
|
1933
|
-
}),
|
|
1934
|
-
channelCount:
|
|
1935
|
-
memberCount:
|
|
1946
|
+
}), A(($) => $.size === F.size && [...$].every((we) => F.has(we)) ? $ : F), ae(H.length > 0), K(!0), he.current = S, T && console.log("[MessagingShell] Channels synced successfully:", {
|
|
1947
|
+
channelCount: H.length,
|
|
1948
|
+
memberCount: F.size
|
|
1936
1949
|
});
|
|
1937
|
-
} catch (
|
|
1938
|
-
console.error("[MessagingShell] Failed to sync channels:",
|
|
1950
|
+
} catch (H) {
|
|
1951
|
+
console.error("[MessagingShell] Failed to sync channels:", H);
|
|
1939
1952
|
}
|
|
1940
|
-
}, [x,
|
|
1953
|
+
}, [x, P, T]);
|
|
1941
1954
|
Q(() => {
|
|
1942
|
-
if (!x || !
|
|
1943
|
-
const
|
|
1944
|
-
|
|
1945
|
-
}, [x,
|
|
1946
|
-
if (!
|
|
1955
|
+
if (!x || !P) return;
|
|
1956
|
+
const S = x.userID;
|
|
1957
|
+
S && he.current !== S && le();
|
|
1958
|
+
}, [x, P, le]), Q(() => {
|
|
1959
|
+
if (!r || !x || !P) return;
|
|
1947
1960
|
(async () => {
|
|
1948
|
-
const
|
|
1949
|
-
if (
|
|
1961
|
+
const H = x.userID;
|
|
1962
|
+
if (H)
|
|
1950
1963
|
try {
|
|
1951
1964
|
T && console.log(
|
|
1952
1965
|
"[MessagingShell] Loading initial conversation with:",
|
|
1953
|
-
|
|
1966
|
+
r
|
|
1954
1967
|
);
|
|
1955
|
-
const
|
|
1968
|
+
const F = await x.queryChannels(
|
|
1956
1969
|
{
|
|
1957
1970
|
type: "messaging",
|
|
1958
|
-
members: { $eq: [
|
|
1971
|
+
members: { $eq: [H, r] }
|
|
1959
1972
|
},
|
|
1960
1973
|
{},
|
|
1961
1974
|
{ limit: 1 }
|
|
1962
1975
|
);
|
|
1963
|
-
if (
|
|
1964
|
-
|
|
1976
|
+
if (F.length > 0)
|
|
1977
|
+
j(F[0]), oe(!0), Z(null), l && l(F[0]), T && console.log(
|
|
1965
1978
|
"[MessagingShell] Initial conversation loaded:",
|
|
1966
|
-
|
|
1979
|
+
F[0].id
|
|
1967
1980
|
);
|
|
1968
|
-
else if (c &&
|
|
1981
|
+
else if (c && y) {
|
|
1969
1982
|
T && console.log(
|
|
1970
1983
|
"[MessagingShell] No conversation found, creating one for:",
|
|
1971
1984
|
c
|
|
1972
1985
|
);
|
|
1973
1986
|
try {
|
|
1974
|
-
const $ = await
|
|
1987
|
+
const $ = await y.startChannelWithParticipant({
|
|
1975
1988
|
id: c.id,
|
|
1976
1989
|
name: c.name,
|
|
1977
1990
|
email: c.email,
|
|
1978
1991
|
phone: c.phone
|
|
1979
1992
|
});
|
|
1980
|
-
|
|
1993
|
+
j($), oe(!0), Z(null), l && l($), T && console.log(
|
|
1981
1994
|
"[MessagingShell] Channel created and loaded:",
|
|
1982
1995
|
$.id
|
|
1983
1996
|
);
|
|
@@ -1985,93 +1998,93 @@ const Hs = ({
|
|
|
1985
1998
|
console.error(
|
|
1986
1999
|
"[MessagingShell] Failed to create conversation:",
|
|
1987
2000
|
$
|
|
1988
|
-
),
|
|
2001
|
+
), Z("Failed to create conversation");
|
|
1989
2002
|
}
|
|
1990
2003
|
} else
|
|
1991
|
-
|
|
2004
|
+
Z(
|
|
1992
2005
|
"No conversation found with this account"
|
|
1993
2006
|
), T && console.log(
|
|
1994
2007
|
"[MessagingShell] No conversation found for:",
|
|
1995
|
-
|
|
2008
|
+
r
|
|
1996
2009
|
);
|
|
1997
|
-
} catch (
|
|
2010
|
+
} catch (F) {
|
|
1998
2011
|
console.error(
|
|
1999
2012
|
"[MessagingShell] Failed to load initial conversation:",
|
|
2000
|
-
|
|
2001
|
-
),
|
|
2013
|
+
F
|
|
2014
|
+
), Z("Failed to load conversation");
|
|
2002
2015
|
}
|
|
2003
2016
|
})();
|
|
2004
2017
|
}, [
|
|
2005
|
-
|
|
2018
|
+
r,
|
|
2006
2019
|
c,
|
|
2007
2020
|
x,
|
|
2008
|
-
|
|
2009
|
-
|
|
2021
|
+
P,
|
|
2022
|
+
y,
|
|
2010
2023
|
T,
|
|
2011
2024
|
l
|
|
2012
2025
|
]);
|
|
2013
|
-
const
|
|
2014
|
-
(
|
|
2015
|
-
|
|
2026
|
+
const Ke = L(
|
|
2027
|
+
(S) => {
|
|
2028
|
+
j(S), l == null || l(S);
|
|
2016
2029
|
},
|
|
2017
2030
|
[l]
|
|
2018
|
-
),
|
|
2019
|
-
|
|
2020
|
-
}, [
|
|
2021
|
-
async (
|
|
2022
|
-
var
|
|
2023
|
-
if (
|
|
2031
|
+
), et = L(() => {
|
|
2032
|
+
W || j(null);
|
|
2033
|
+
}, [W]), tt = L(
|
|
2034
|
+
async (S) => {
|
|
2035
|
+
var H;
|
|
2036
|
+
if (y)
|
|
2024
2037
|
try {
|
|
2025
2038
|
T && console.log(
|
|
2026
2039
|
"[MessagingShell] Starting conversation with:",
|
|
2027
|
-
|
|
2040
|
+
S.id
|
|
2028
2041
|
);
|
|
2029
|
-
const
|
|
2030
|
-
id:
|
|
2031
|
-
name:
|
|
2032
|
-
email:
|
|
2033
|
-
phone:
|
|
2042
|
+
const F = await y.startChannelWithParticipant({
|
|
2043
|
+
id: S.id,
|
|
2044
|
+
name: S.name,
|
|
2045
|
+
email: S.email,
|
|
2046
|
+
phone: S.phone
|
|
2034
2047
|
});
|
|
2035
2048
|
try {
|
|
2036
|
-
await
|
|
2049
|
+
await F.show();
|
|
2037
2050
|
} catch ($) {
|
|
2038
2051
|
console.warn("[MessagingShell] Failed to unhide channel:", $);
|
|
2039
2052
|
}
|
|
2040
|
-
|
|
2041
|
-
} catch (
|
|
2042
|
-
console.error("[MessagingShell] Failed to start conversation:",
|
|
2053
|
+
j(F), U(!1), (H = te.current) == null || H.close(), h == null || h(S);
|
|
2054
|
+
} catch (F) {
|
|
2055
|
+
console.error("[MessagingShell] Failed to start conversation:", F);
|
|
2043
2056
|
}
|
|
2044
2057
|
},
|
|
2045
|
-
[
|
|
2058
|
+
[y, h, T]
|
|
2046
2059
|
), fe = L(() => {
|
|
2047
|
-
var
|
|
2048
|
-
|
|
2049
|
-
}, []),
|
|
2050
|
-
(
|
|
2051
|
-
|
|
2060
|
+
var S;
|
|
2061
|
+
U(!1), (S = te.current) == null || S.close();
|
|
2062
|
+
}, []), st = L(
|
|
2063
|
+
(S) => {
|
|
2064
|
+
S.target === te.current && fe();
|
|
2052
2065
|
},
|
|
2053
2066
|
[fe]
|
|
2054
|
-
), st = L(
|
|
2055
|
-
async (I) => {
|
|
2056
|
-
T && console.log("[MessagingShell] Leaving conversation:", I.id), B(null), ee(!1), he.current = null, await oe();
|
|
2057
|
-
},
|
|
2058
|
-
[oe, T]
|
|
2059
2067
|
), nt = L(
|
|
2060
|
-
async (
|
|
2061
|
-
T && console.log("[MessagingShell]
|
|
2068
|
+
async (S) => {
|
|
2069
|
+
T && console.log("[MessagingShell] Leaving conversation:", S.id), j(null), oe(!1), he.current = null, await le();
|
|
2070
|
+
},
|
|
2071
|
+
[le, T]
|
|
2072
|
+
), at = L(
|
|
2073
|
+
async (S) => {
|
|
2074
|
+
T && console.log("[MessagingShell] Blocking participant:", S), j(null), oe(!1), he.current = null, await le();
|
|
2062
2075
|
},
|
|
2063
|
-
[
|
|
2064
|
-
), ge = !!
|
|
2065
|
-
return
|
|
2076
|
+
[le, T]
|
|
2077
|
+
), ge = !!z;
|
|
2078
|
+
return X ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(Ne, {}) }) : Y ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(Ce, { message: Y, onBack: q }) }) : !P || !x ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(
|
|
2066
2079
|
Ce,
|
|
2067
2080
|
{
|
|
2068
2081
|
message: "Not connected to messaging service",
|
|
2069
|
-
onBack:
|
|
2082
|
+
onBack: q
|
|
2070
2083
|
}
|
|
2071
|
-
) }) :
|
|
2084
|
+
) }) : ee ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(Ce, { message: ee }) }) : /* @__PURE__ */ i(
|
|
2072
2085
|
"div",
|
|
2073
2086
|
{
|
|
2074
|
-
className:
|
|
2087
|
+
className: D(
|
|
2075
2088
|
"messaging-shell h-full bg-background-primary overflow-hidden",
|
|
2076
2089
|
s
|
|
2077
2090
|
),
|
|
@@ -2080,24 +2093,24 @@ const Hs = ({
|
|
|
2080
2093
|
/* @__PURE__ */ e(
|
|
2081
2094
|
"div",
|
|
2082
2095
|
{
|
|
2083
|
-
className:
|
|
2096
|
+
className: D(
|
|
2084
2097
|
"messaging-channel-list-sidebar min-h-0 min-w-0 lg:flex lg:flex-col",
|
|
2085
2098
|
{
|
|
2086
|
-
"!hidden": f === !1 ||
|
|
2099
|
+
"!hidden": f === !1 || W,
|
|
2087
2100
|
// Hide on mobile when channel selected, show on desktop with consistent wide width
|
|
2088
|
-
"hidden lg:flex lg:flex-1 lg:max-w-2xl": f !== !1 && !
|
|
2101
|
+
"hidden lg:flex lg:flex-1 lg:max-w-2xl": f !== !1 && !W && ge,
|
|
2089
2102
|
// Show on mobile when no channel selected, use same wide width on desktop
|
|
2090
|
-
"flex flex-col w-full lg:flex-1 lg:max-w-2xl": f !== !1 && !
|
|
2103
|
+
"flex flex-col w-full lg:flex-1 lg:max-w-2xl": f !== !1 && !W && !ge
|
|
2091
2104
|
}
|
|
2092
2105
|
),
|
|
2093
2106
|
children: /* @__PURE__ */ e(
|
|
2094
2107
|
We,
|
|
2095
2108
|
{
|
|
2096
|
-
onChannelSelect:
|
|
2097
|
-
selectedChannel:
|
|
2098
|
-
filters:
|
|
2099
|
-
customEmptyStateIndicator:
|
|
2100
|
-
renderMessagePreview:
|
|
2109
|
+
onChannelSelect: Ke,
|
|
2110
|
+
selectedChannel: z || void 0,
|
|
2111
|
+
filters: Xe,
|
|
2112
|
+
customEmptyStateIndicator: g,
|
|
2113
|
+
renderMessagePreview: w
|
|
2101
2114
|
}
|
|
2102
2115
|
)
|
|
2103
2116
|
}
|
|
@@ -2105,79 +2118,80 @@ const Hs = ({
|
|
|
2105
2118
|
/* @__PURE__ */ e(
|
|
2106
2119
|
"div",
|
|
2107
2120
|
{
|
|
2108
|
-
className:
|
|
2121
|
+
className: D(
|
|
2109
2122
|
"messaging-conversation-view flex-1 flex-col min-w-0 min-h-0",
|
|
2110
2123
|
{
|
|
2111
2124
|
// In direct conversation mode (or waiting for it), always show (full width)
|
|
2112
|
-
flex:
|
|
2125
|
+
flex: W || ge || r,
|
|
2113
2126
|
// Normal mode: hide on mobile when no channel selected
|
|
2114
|
-
"hidden lg:flex": !
|
|
2127
|
+
"hidden lg:flex": !W && !ge && !r
|
|
2115
2128
|
}
|
|
2116
2129
|
),
|
|
2117
|
-
children:
|
|
2130
|
+
children: z ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
|
|
2118
2131
|
Ze,
|
|
2119
2132
|
{
|
|
2120
|
-
channel:
|
|
2121
|
-
onBack:
|
|
2122
|
-
showBackButton: !
|
|
2133
|
+
channel: z,
|
|
2134
|
+
onBack: et,
|
|
2135
|
+
showBackButton: !W,
|
|
2123
2136
|
renderMessageInputActions: n,
|
|
2124
2137
|
renderConversationFooter: o,
|
|
2125
|
-
renderChannelBanner:
|
|
2126
|
-
onLeaveConversation:
|
|
2127
|
-
onBlockParticipant:
|
|
2128
|
-
CustomChannelEmptyState:
|
|
2129
|
-
showDeleteConversation:
|
|
2130
|
-
onDeleteConversationClick:
|
|
2131
|
-
onBlockParticipantClick:
|
|
2132
|
-
onReportParticipantClick:
|
|
2133
|
-
dmAgentEnabled:
|
|
2134
|
-
messageMetadata:
|
|
2135
|
-
onMessageSent:
|
|
2136
|
-
showStarButton:
|
|
2137
|
-
chatbotVotingEnabled:
|
|
2138
|
-
|
|
2139
|
-
|
|
2138
|
+
renderChannelBanner: R,
|
|
2139
|
+
onLeaveConversation: nt,
|
|
2140
|
+
onBlockParticipant: at,
|
|
2141
|
+
CustomChannelEmptyState: b,
|
|
2142
|
+
showDeleteConversation: Qe,
|
|
2143
|
+
onDeleteConversationClick: E,
|
|
2144
|
+
onBlockParticipantClick: a,
|
|
2145
|
+
onReportParticipantClick: _,
|
|
2146
|
+
dmAgentEnabled: I,
|
|
2147
|
+
messageMetadata: v,
|
|
2148
|
+
onMessageSent: M,
|
|
2149
|
+
showStarButton: p,
|
|
2150
|
+
chatbotVotingEnabled: C,
|
|
2151
|
+
customProfileContent: d,
|
|
2152
|
+
customChannelActions: u,
|
|
2153
|
+
renderMessage: m
|
|
2140
2154
|
},
|
|
2141
|
-
|
|
2142
|
-
) }) :
|
|
2155
|
+
z.id
|
|
2156
|
+
) }) : r ? (
|
|
2143
2157
|
// Show loading while creating/loading direct conversation channel
|
|
2144
2158
|
/* @__PURE__ */ e(Ne, {})
|
|
2145
2159
|
) : /* @__PURE__ */ e(
|
|
2146
2160
|
Je,
|
|
2147
2161
|
{
|
|
2148
|
-
hasChannels:
|
|
2149
|
-
channelsLoaded:
|
|
2162
|
+
hasChannels: ne,
|
|
2163
|
+
channelsLoaded: G
|
|
2150
2164
|
}
|
|
2151
2165
|
)
|
|
2152
2166
|
}
|
|
2153
2167
|
)
|
|
2154
2168
|
] }),
|
|
2155
|
-
|
|
2169
|
+
de && // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
|
|
2156
2170
|
/* @__PURE__ */ e(
|
|
2157
2171
|
"dialog",
|
|
2158
2172
|
{
|
|
2159
|
-
ref:
|
|
2173
|
+
ref: te,
|
|
2160
2174
|
className: "mes-dialog",
|
|
2161
|
-
onClick:
|
|
2175
|
+
onClick: st,
|
|
2162
2176
|
onClose: fe,
|
|
2163
2177
|
children: /* @__PURE__ */ e("div", { className: "h-full w-full bg-white shadow-max-elevation-light", children: /* @__PURE__ */ e(
|
|
2164
|
-
|
|
2178
|
+
Ps,
|
|
2165
2179
|
{
|
|
2166
|
-
participantSource:
|
|
2167
|
-
onSelectParticipant:
|
|
2180
|
+
participantSource: de,
|
|
2181
|
+
onSelectParticipant: tt,
|
|
2168
2182
|
onClose: fe,
|
|
2169
|
-
existingParticipantIds:
|
|
2170
|
-
participantLabel:
|
|
2171
|
-
searchPlaceholder: `Search ${
|
|
2183
|
+
existingParticipantIds: O,
|
|
2184
|
+
participantLabel: ue,
|
|
2185
|
+
searchPlaceholder: `Search ${ue}...`
|
|
2172
2186
|
},
|
|
2173
|
-
|
|
2187
|
+
V
|
|
2174
2188
|
) })
|
|
2175
2189
|
}
|
|
2176
2190
|
)
|
|
2177
2191
|
]
|
|
2178
2192
|
}
|
|
2179
2193
|
);
|
|
2180
|
-
},
|
|
2194
|
+
}, Os = ({
|
|
2181
2195
|
question: t,
|
|
2182
2196
|
onClick: s,
|
|
2183
2197
|
loading: n = !1,
|
|
@@ -2189,7 +2203,7 @@ const Hs = ({
|
|
|
2189
2203
|
onClick: s,
|
|
2190
2204
|
disabled: n,
|
|
2191
2205
|
style: { backgroundColor: "#E6E5E3" },
|
|
2192
|
-
className:
|
|
2206
|
+
className: D(
|
|
2193
2207
|
"w-full text-center p-4 rounded-xl text-charcoal font-medium transition-colors focus-ring",
|
|
2194
2208
|
{
|
|
2195
2209
|
"hover:brightness-95 active:brightness-90": !n,
|
|
@@ -2199,23 +2213,23 @@ const Hs = ({
|
|
|
2199
2213
|
),
|
|
2200
2214
|
children: t
|
|
2201
2215
|
}
|
|
2202
|
-
),
|
|
2216
|
+
), Ws = ({
|
|
2203
2217
|
faqs: t,
|
|
2204
2218
|
onFaqClick: s,
|
|
2205
2219
|
loadingFaqId: n,
|
|
2206
2220
|
headerText: o,
|
|
2207
2221
|
className: l,
|
|
2208
|
-
avatarImage:
|
|
2209
|
-
avatarName:
|
|
2222
|
+
avatarImage: h,
|
|
2223
|
+
avatarName: r
|
|
2210
2224
|
}) => {
|
|
2211
|
-
const c = t.filter((
|
|
2225
|
+
const c = t.filter((b) => b.enabled).sort((b, f) => (b.order ?? 0) - (f.order ?? 0));
|
|
2212
2226
|
return c.length === 0 ? null : /* @__PURE__ */ e("div", { className: l, children: /* @__PURE__ */ i("div", { className: "flex gap-3 items-end", children: [
|
|
2213
|
-
(
|
|
2214
|
-
|
|
2227
|
+
(h || r) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
|
|
2228
|
+
se,
|
|
2215
2229
|
{
|
|
2216
|
-
id:
|
|
2217
|
-
name:
|
|
2218
|
-
image:
|
|
2230
|
+
id: r || "account",
|
|
2231
|
+
name: r || "Account",
|
|
2232
|
+
image: h,
|
|
2219
2233
|
size: 24,
|
|
2220
2234
|
shape: "circle"
|
|
2221
2235
|
}
|
|
@@ -2227,75 +2241,75 @@ const Hs = ({
|
|
|
2227
2241
|
style: { backgroundColor: "#F1F0EE" },
|
|
2228
2242
|
children: [
|
|
2229
2243
|
o && /* @__PURE__ */ e("p", { className: "text-md text-charcoal mb-4", children: o }),
|
|
2230
|
-
c.map((
|
|
2231
|
-
|
|
2244
|
+
c.map((b) => /* @__PURE__ */ e(
|
|
2245
|
+
Os,
|
|
2232
2246
|
{
|
|
2233
|
-
question:
|
|
2234
|
-
onClick: () => s(
|
|
2235
|
-
loading: n ===
|
|
2247
|
+
question: b.question,
|
|
2248
|
+
onClick: () => s(b.id),
|
|
2249
|
+
loading: n === b.id
|
|
2236
2250
|
},
|
|
2237
|
-
|
|
2251
|
+
b.id
|
|
2238
2252
|
))
|
|
2239
2253
|
]
|
|
2240
2254
|
}
|
|
2241
2255
|
)
|
|
2242
2256
|
] }) });
|
|
2243
|
-
},
|
|
2244
|
-
const { initialSearch: n = "", pageSize: o = 20 } = s, [l,
|
|
2245
|
-
if (
|
|
2246
|
-
const
|
|
2257
|
+
}, qs = (t, s = {}) => {
|
|
2258
|
+
const { initialSearch: n = "", pageSize: o = 20 } = s, [l, h] = k([]), [r, c] = k(!1), [b, f] = k(null), [N, g] = k(n), [E, a] = k(!0), [_, I] = k(), v = L(async (w = !1, R) => {
|
|
2259
|
+
if (r) return;
|
|
2260
|
+
const d = R !== void 0 ? R : N;
|
|
2247
2261
|
c(!0), f(null);
|
|
2248
2262
|
try {
|
|
2249
2263
|
const u = await t.loadParticipants({
|
|
2250
|
-
search:
|
|
2264
|
+
search: d || void 0,
|
|
2251
2265
|
limit: o,
|
|
2252
|
-
cursor:
|
|
2266
|
+
cursor: w ? void 0 : _
|
|
2253
2267
|
});
|
|
2254
|
-
|
|
2255
|
-
(
|
|
2256
|
-
),
|
|
2268
|
+
h(
|
|
2269
|
+
(m) => w ? u.participants : [...m, ...u.participants]
|
|
2270
|
+
), a(u.hasMore), I(u.nextCursor);
|
|
2257
2271
|
} catch (u) {
|
|
2258
|
-
const
|
|
2259
|
-
f(
|
|
2272
|
+
const m = u instanceof Error ? u.message : "Failed to load participants";
|
|
2273
|
+
f(m), console.error("[useParticipants] Load error:", u);
|
|
2260
2274
|
} finally {
|
|
2261
2275
|
c(!1);
|
|
2262
2276
|
}
|
|
2263
|
-
}, [t, N,
|
|
2264
|
-
|
|
2265
|
-
}, [
|
|
2266
|
-
|
|
2267
|
-
}, [
|
|
2268
|
-
|
|
2269
|
-
}, [
|
|
2277
|
+
}, [t, N, _, o, r]), M = L(() => {
|
|
2278
|
+
E && !r && v(!1);
|
|
2279
|
+
}, [E, r, v]), p = L((w) => {
|
|
2280
|
+
g(w), I(void 0), v(!0, w);
|
|
2281
|
+
}, [v]), C = L(() => {
|
|
2282
|
+
I(void 0), v(!0);
|
|
2283
|
+
}, [v]);
|
|
2270
2284
|
return Q(() => {
|
|
2271
|
-
|
|
2285
|
+
v(!0);
|
|
2272
2286
|
}, [t.loadParticipants]), {
|
|
2273
2287
|
participants: l,
|
|
2274
|
-
loading:
|
|
2275
|
-
error:
|
|
2288
|
+
loading: r,
|
|
2289
|
+
error: b,
|
|
2276
2290
|
searchQuery: N,
|
|
2277
|
-
hasMore:
|
|
2291
|
+
hasMore: E,
|
|
2278
2292
|
totalCount: t.totalCount,
|
|
2279
|
-
loadMore:
|
|
2280
|
-
search:
|
|
2281
|
-
refresh:
|
|
2293
|
+
loadMore: M,
|
|
2294
|
+
search: p,
|
|
2295
|
+
refresh: C
|
|
2282
2296
|
};
|
|
2283
2297
|
};
|
|
2284
2298
|
export {
|
|
2285
2299
|
xe as ActionButton,
|
|
2286
|
-
|
|
2287
|
-
|
|
2300
|
+
se as Avatar,
|
|
2301
|
+
ks as ChannelEmptyState,
|
|
2288
2302
|
We as ChannelList,
|
|
2289
2303
|
Ze as ChannelView,
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2304
|
+
Ws as FaqList,
|
|
2305
|
+
Os as FaqListItem,
|
|
2306
|
+
xs as MessageVoteButtons,
|
|
2307
|
+
Hs as MessagingProvider,
|
|
2308
|
+
zs as MessagingShell,
|
|
2309
|
+
Ps as ParticipantPicker,
|
|
2310
|
+
ss as formatRelativeTime,
|
|
2311
|
+
hs as useMessageVote,
|
|
2312
|
+
Xt as useMessaging,
|
|
2313
|
+
qs as useParticipants
|
|
2300
2314
|
};
|
|
2301
2315
|
//# sourceMappingURL=index.js.map
|