@linktr.ee/messaging-react 1.34.0 → 1.35.0-rc-1777516745
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/{Card-KHDSM8Zs.js → Card-BXKUE7JN.js} +2 -2
- package/dist/{Card-KHDSM8Zs.js.map → Card-BXKUE7JN.js.map} +1 -1
- package/dist/{Card-mHUN_YWq.js → Card-J-rj8Q6w.js} +2 -2
- package/dist/{Card-mHUN_YWq.js.map → Card-J-rj8Q6w.js.map} +1 -1
- package/dist/assets/index.css +1 -1
- package/dist/{index-DWk0f1PF.js → index-B3H4GLek.js} +1105 -1028
- package/dist/index-B3H4GLek.js.map +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/components/Avatar/Avatar.stories.tsx +29 -0
- package/src/components/Avatar/index.tsx +43 -20
- package/src/components/ChannelView.stories.tsx +45 -1
- package/src/components/ChannelView.tsx +9 -5
- package/src/components/CustomMessage/CustomMessage.stories.tsx +75 -15
- package/src/components/CustomMessage/MessageTag.stories.tsx +1 -1
- package/src/components/CustomTypingIndicator/CustomTypingIndicator.stories.tsx +114 -0
- package/src/components/CustomTypingIndicator/index.tsx +101 -0
- package/src/components/LockedAttachment/LockedAttachment.stories.tsx +91 -50
- package/src/components/MediaMessage/MediaMessage.stories.tsx +55 -17
- package/src/styles.css +0 -4
- package/dist/index-DWk0f1PF.js.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import
|
|
3
|
-
import z, { createContext as ot, useContext as
|
|
4
|
-
import { StreamChatService as
|
|
5
|
-
import { Chat as
|
|
6
|
-
import { StarIcon as
|
|
7
|
-
import { LinkPreviewsManager as
|
|
8
|
-
const
|
|
1
|
+
import { jsx as e, jsxs as c, Fragment as se } from "react/jsx-runtime";
|
|
2
|
+
import O from "classnames";
|
|
3
|
+
import z, { createContext as ot, useContext as ct, useCallback as A, useState as k, useRef as X, useEffect as q, useMemo as Be, Suspense as dt } from "react";
|
|
4
|
+
import { StreamChatService as Dt } from "@linktr.ee/messaging-core";
|
|
5
|
+
import { Chat as Rt, ChannelList as Pt, DateSeparator as Lt, useChannelStateContext as me, useChatContext as Ye, areMessageUIPropsEqual as Ft, useMessageReminder as At, useComponentContext as ut, Attachment as Ot, EditMessageModal as Ut, MessageBlocked as $t, MessageBouncePrompt as zt, MessageDeleted as Bt, MessageIsThreadReplyInChannelButtonIndicator as jt, MessageRepliesCountButton as Gt, ReminderNotification as Vt, StreamedMessageText as Ht, messageHasAttachments as Yt, messageHasReactions as Wt, isDateSeparatorMessage as qt, isMessageBlocked as Zt, isMessageBounced as Xt, MessageBounceModal as Kt, MessageText as Ke, Poll as Jt, MessageErrorIcon as Qt, useMessageContext as mt, useMessageComposer as es, useStateStore as ts, MessageInput as ss, useMessageInputContext as ns, useMessageComposerHasSendableData as as, SimpleAttachmentSelector as rs, QuotedMessagePreview as is, AttachmentPreviewList as ls, TextareaComposer as os, MessageTimestamp as Oe, useTypingContext as cs, Channel as ds, WithComponents as us, Window as ms, MessageList as hs } from "stream-chat-react";
|
|
6
|
+
import { StarIcon as je, GiftIcon as fs, XIcon as Re, SpinnerGapIcon as ke, SignOutIcon as gs, ProhibitInsetIcon as Je, FlagIcon as bs, ArrowUpIcon as ps, SparkleIcon as xs, ProhibitIcon as vs, ArrowLeftIcon as Qe, CaretRightIcon as et, DotsThreeIcon as tt, MagnifyingGlassIcon as ws, ChatCircleDotsIcon as st, FileIcon as ht, ImageIcon as Ns, SpeakerHighIcon as ys, VideoCameraIcon as Cs, FileMdIcon as _s, FileTextIcon as Es, FileZipIcon as Ss, FilePptIcon as Is, FileCsvIcon as ks, FileXlsIcon as Ts, FileDocIcon as Ms, FilePdfIcon as Ds, CircleNotchIcon as ft, PlayIcon as nt, PauseIcon as Rs, LinkIcon as Ps, DownloadSimpleIcon as Ls } from "@phosphor-icons/react";
|
|
7
|
+
import { LinkPreviewsManager as at } from "stream-chat";
|
|
8
|
+
const gt = ot({
|
|
9
9
|
service: null,
|
|
10
10
|
client: null,
|
|
11
11
|
isConnected: !1,
|
|
@@ -15,59 +15,59 @@ const ft = ot({
|
|
|
15
15
|
refreshConnection: async () => {
|
|
16
16
|
},
|
|
17
17
|
debug: !1
|
|
18
|
-
}),
|
|
18
|
+
}), Pe = () => ct(gt), ra = ({
|
|
19
19
|
children: t,
|
|
20
20
|
user: s,
|
|
21
21
|
serviceConfig: n,
|
|
22
|
-
apiKey:
|
|
22
|
+
apiKey: i,
|
|
23
23
|
capabilities: l = {},
|
|
24
|
-
debug:
|
|
24
|
+
debug: u = !1
|
|
25
25
|
}) => {
|
|
26
26
|
const r = A(
|
|
27
|
-
(m, ...
|
|
28
|
-
|
|
27
|
+
(m, ...b) => {
|
|
28
|
+
u && console.log(`🔥 [MessagingProvider] ${m}`, ...b);
|
|
29
29
|
},
|
|
30
|
-
[
|
|
30
|
+
[u]
|
|
31
31
|
);
|
|
32
32
|
r("🔄 RENDER START", {
|
|
33
33
|
userId: s == null ? void 0 : s.id,
|
|
34
|
-
apiKey: (
|
|
34
|
+
apiKey: (i == null ? void 0 : i.substring(0, 8)) + "...",
|
|
35
35
|
serviceConfig: !!n,
|
|
36
36
|
capabilities: Object.keys(l)
|
|
37
37
|
});
|
|
38
|
-
const [
|
|
38
|
+
const [d, x] = k(null), [o, h] = k(null), [f, N] = k(!1), [a, _] = k(!1), [w, g] = k(null), y = X(!1), I = X({
|
|
39
39
|
userId: s == null ? void 0 : s.id,
|
|
40
|
-
apiKey:
|
|
40
|
+
apiKey: i,
|
|
41
41
|
serviceConfig: n,
|
|
42
42
|
capabilities: l
|
|
43
|
-
}),
|
|
44
|
-
|
|
45
|
-
renderCount:
|
|
46
|
-
currentProps: { userId: s == null ? void 0 : s.id, apiKey: (
|
|
43
|
+
}), C = X(0);
|
|
44
|
+
C.current++, r("📊 RENDER INFO", {
|
|
45
|
+
renderCount: C.current,
|
|
46
|
+
currentProps: { userId: s == null ? void 0 : s.id, apiKey: (i == null ? void 0 : i.substring(0, 8)) + "..." },
|
|
47
47
|
propChanges: {
|
|
48
|
-
userChanged:
|
|
49
|
-
apiKeyChanged:
|
|
50
|
-
serviceConfigChanged:
|
|
51
|
-
capabilitiesChanged:
|
|
48
|
+
userChanged: I.current.userId !== (s == null ? void 0 : s.id),
|
|
49
|
+
apiKeyChanged: I.current.apiKey !== i,
|
|
50
|
+
serviceConfigChanged: I.current.serviceConfig !== n,
|
|
51
|
+
capabilitiesChanged: I.current.capabilities !== l
|
|
52
52
|
}
|
|
53
|
-
}),
|
|
53
|
+
}), I.current = {
|
|
54
54
|
userId: s == null ? void 0 : s.id,
|
|
55
|
-
apiKey:
|
|
55
|
+
apiKey: i,
|
|
56
56
|
serviceConfig: n,
|
|
57
57
|
capabilities: l
|
|
58
58
|
}, q(() => {
|
|
59
|
-
const m =
|
|
59
|
+
const m = C.current;
|
|
60
60
|
if (r("🔧 SERVICE INIT EFFECT TRIGGERED", {
|
|
61
61
|
renderCount: m,
|
|
62
|
-
apiKey: !!
|
|
62
|
+
apiKey: !!i,
|
|
63
63
|
serviceConfig: !!n,
|
|
64
64
|
dependencies: {
|
|
65
|
-
apiKey: (
|
|
65
|
+
apiKey: (i == null ? void 0 : i.substring(0, 8)) + "...",
|
|
66
66
|
serviceConfigRef: n,
|
|
67
|
-
serviceConfigStable:
|
|
68
|
-
apiKeyStable:
|
|
67
|
+
serviceConfigStable: I.current.serviceConfig === n,
|
|
68
|
+
apiKeyStable: I.current.apiKey === i
|
|
69
69
|
}
|
|
70
|
-
}), !
|
|
70
|
+
}), !i || !n) {
|
|
71
71
|
r("⚠️ SERVICE INIT SKIPPED", {
|
|
72
72
|
renderCount: m,
|
|
73
73
|
reason: "Missing apiKey or serviceConfig"
|
|
@@ -76,43 +76,43 @@ const ft = ot({
|
|
|
76
76
|
}
|
|
77
77
|
r("🚀 CREATING NEW SERVICE", {
|
|
78
78
|
renderCount: m,
|
|
79
|
-
apiKey: (
|
|
80
|
-
serviceConfigChanged:
|
|
79
|
+
apiKey: (i == null ? void 0 : i.substring(0, 8)) + "...",
|
|
80
|
+
serviceConfigChanged: I.current.serviceConfig !== n
|
|
81
81
|
});
|
|
82
|
-
const
|
|
82
|
+
const b = new Dt({
|
|
83
83
|
...n,
|
|
84
|
-
apiKey:
|
|
85
|
-
debug:
|
|
84
|
+
apiKey: i,
|
|
85
|
+
debug: u
|
|
86
86
|
});
|
|
87
|
-
return x(
|
|
87
|
+
return x(b), r("✅ SERVICE SET", {
|
|
88
88
|
renderCount: m,
|
|
89
|
-
serviceInstance: !!
|
|
89
|
+
serviceInstance: !!b
|
|
90
90
|
}), () => {
|
|
91
91
|
r("🧹 SERVICE CLEANUP", {
|
|
92
92
|
renderCount: m,
|
|
93
93
|
reason: "Effect cleanup"
|
|
94
|
-
}),
|
|
94
|
+
}), b.disconnectUser().catch(console.error);
|
|
95
95
|
};
|
|
96
|
-
}, [
|
|
97
|
-
const
|
|
96
|
+
}, [i, n, u, r]);
|
|
97
|
+
const S = X(null);
|
|
98
98
|
q(() => {
|
|
99
|
-
var
|
|
99
|
+
var b, T;
|
|
100
100
|
if (r("🔗 USER CONNECTION EFFECT TRIGGERED", {
|
|
101
|
-
hasService: !!
|
|
101
|
+
hasService: !!d,
|
|
102
102
|
hasUser: !!s,
|
|
103
103
|
userId: s == null ? void 0 : s.id,
|
|
104
|
-
isConnecting:
|
|
105
|
-
isConnected:
|
|
106
|
-
dependencies: { service: !!
|
|
107
|
-
}), !
|
|
104
|
+
isConnecting: y.current,
|
|
105
|
+
isConnected: f,
|
|
106
|
+
dependencies: { service: !!d, userId: s == null ? void 0 : s.id }
|
|
107
|
+
}), !d || !s) {
|
|
108
108
|
r("⚠️ USER CONNECTION SKIPPED", "Missing service or user");
|
|
109
109
|
return;
|
|
110
110
|
}
|
|
111
|
-
if (
|
|
111
|
+
if (y.current) {
|
|
112
112
|
r("⚠️ USER CONNECTION SKIPPED", "Already connecting");
|
|
113
113
|
return;
|
|
114
114
|
}
|
|
115
|
-
if (((
|
|
115
|
+
if (((b = S.current) == null ? void 0 : b.serviceId) === d && ((T = S.current) == null ? void 0 : T.userId) === s.id) {
|
|
116
116
|
r(
|
|
117
117
|
"⚠️ USER CONNECTION SKIPPED",
|
|
118
118
|
"Already connected this user with this service"
|
|
@@ -120,119 +120,119 @@ const ft = ot({
|
|
|
120
120
|
return;
|
|
121
121
|
}
|
|
122
122
|
(async () => {
|
|
123
|
-
r("🚀 STARTING USER CONNECTION", { userId: s.id }),
|
|
123
|
+
r("🚀 STARTING USER CONNECTION", { userId: s.id }), y.current = !0, _(!0), g(null);
|
|
124
124
|
try {
|
|
125
125
|
r("📞 CALLING SERVICE.CONNECTUSER", { userId: s.id });
|
|
126
|
-
const M = await
|
|
127
|
-
|
|
126
|
+
const M = await d.connectUser(s);
|
|
127
|
+
h(M), N(!0), S.current = { serviceId: d, userId: s.id }, r("✅ USER CONNECTION SUCCESS", {
|
|
128
128
|
userId: s.id,
|
|
129
129
|
clientId: M.userID
|
|
130
130
|
});
|
|
131
131
|
} catch (M) {
|
|
132
|
-
const
|
|
133
|
-
|
|
132
|
+
const P = M instanceof Error ? M.message : "Connection failed";
|
|
133
|
+
g(P), r("❌ USER CONNECTION ERROR", {
|
|
134
134
|
userId: s.id,
|
|
135
|
-
error:
|
|
135
|
+
error: P
|
|
136
136
|
});
|
|
137
137
|
} finally {
|
|
138
|
-
_(!1),
|
|
138
|
+
_(!1), y.current = !1, r("🔄 USER CONNECTION FINISHED", {
|
|
139
139
|
userId: s.id,
|
|
140
|
-
isConnected:
|
|
140
|
+
isConnected: f
|
|
141
141
|
});
|
|
142
142
|
}
|
|
143
143
|
})();
|
|
144
|
-
}, [
|
|
145
|
-
hasService: !!
|
|
146
|
-
isConnected:
|
|
144
|
+
}, [d, s, r, f]), q(() => (r("🔌 CLEANUP EFFECT REGISTERED", {
|
|
145
|
+
hasService: !!d,
|
|
146
|
+
isConnected: f
|
|
147
147
|
}), () => {
|
|
148
|
-
|
|
148
|
+
d && f ? (r(
|
|
149
149
|
"🧹 CLEANUP EFFECT TRIGGERED",
|
|
150
150
|
"Cleaning up connection on unmount"
|
|
151
|
-
),
|
|
152
|
-
hasService: !!
|
|
153
|
-
isConnected:
|
|
151
|
+
), S.current = null, d.disconnectUser().catch(console.error)) : r("🔇 CLEANUP EFFECT SKIPPED", {
|
|
152
|
+
hasService: !!d,
|
|
153
|
+
isConnected: f
|
|
154
154
|
});
|
|
155
|
-
}), [
|
|
156
|
-
const
|
|
155
|
+
}), [d, f, r]);
|
|
156
|
+
const L = A(async () => {
|
|
157
157
|
if (r("🔄 REFRESH CONNECTION CALLED", {
|
|
158
|
-
hasService: !!
|
|
158
|
+
hasService: !!d,
|
|
159
159
|
hasUser: !!s
|
|
160
|
-
}), !
|
|
160
|
+
}), !d || !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
|
-
r("🔌 DISCONNECTING FOR REFRESH"), await
|
|
167
|
-
const m = await
|
|
168
|
-
|
|
166
|
+
r("🔌 DISCONNECTING FOR REFRESH"), await d.disconnectUser(), r("📞 RECONNECTING FOR REFRESH");
|
|
167
|
+
const m = await d.connectUser(s);
|
|
168
|
+
h(m), N(!0), g(null), r("✅ CONNECTION REFRESH SUCCESS", { userId: s.id });
|
|
169
169
|
} catch (m) {
|
|
170
|
-
const
|
|
171
|
-
|
|
170
|
+
const b = m instanceof Error ? m.message : "Refresh failed";
|
|
171
|
+
g(b), r("❌ CONNECTION REFRESH ERROR", {
|
|
172
172
|
userId: s.id,
|
|
173
|
-
error:
|
|
173
|
+
error: b
|
|
174
174
|
});
|
|
175
175
|
} finally {
|
|
176
176
|
_(!1), r("🔄 CONNECTION REFRESH FINISHED", { userId: s.id });
|
|
177
177
|
}
|
|
178
|
-
}, [
|
|
179
|
-
hasService: !!
|
|
180
|
-
hasClient: !!
|
|
181
|
-
isConnected:
|
|
178
|
+
}, [d, s, r]), v = z.useMemo(() => (r("💫 CONTEXT VALUE MEMOIZATION", {
|
|
179
|
+
hasService: !!d,
|
|
180
|
+
hasClient: !!o,
|
|
181
|
+
isConnected: f,
|
|
182
182
|
isLoading: a,
|
|
183
183
|
hasError: !!w,
|
|
184
184
|
capabilitiesKeys: Object.keys(l)
|
|
185
185
|
}), {
|
|
186
|
-
service:
|
|
187
|
-
client:
|
|
188
|
-
isConnected:
|
|
186
|
+
service: d,
|
|
187
|
+
client: o,
|
|
188
|
+
isConnected: f,
|
|
189
189
|
isLoading: a,
|
|
190
190
|
error: w,
|
|
191
191
|
capabilities: l,
|
|
192
|
-
refreshConnection:
|
|
193
|
-
debug:
|
|
192
|
+
refreshConnection: L,
|
|
193
|
+
debug: u
|
|
194
194
|
}), [
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
195
|
+
d,
|
|
196
|
+
o,
|
|
197
|
+
f,
|
|
198
198
|
a,
|
|
199
199
|
w,
|
|
200
200
|
l,
|
|
201
|
-
|
|
202
|
-
|
|
201
|
+
L,
|
|
202
|
+
u,
|
|
203
203
|
r
|
|
204
204
|
]);
|
|
205
205
|
return r("🔄 RENDER END", {
|
|
206
|
-
renderCount:
|
|
207
|
-
willRenderChat: !!(
|
|
206
|
+
renderCount: C.current,
|
|
207
|
+
willRenderChat: !!(o && f),
|
|
208
208
|
contextValueReady: !!v
|
|
209
|
-
}), /* @__PURE__ */ e(
|
|
210
|
-
|
|
209
|
+
}), /* @__PURE__ */ e(gt.Provider, { value: v, children: o && f ? /* @__PURE__ */ e(
|
|
210
|
+
Rt,
|
|
211
211
|
{
|
|
212
|
-
client:
|
|
212
|
+
client: o,
|
|
213
213
|
customClasses: {
|
|
214
214
|
channelList: "str-chat__channel-list str-chat__channel-list-react bg-transparent lg:border-r-2 border-r-0 border-[#0000000A]"
|
|
215
215
|
},
|
|
216
216
|
children: t
|
|
217
217
|
}
|
|
218
218
|
) : t });
|
|
219
|
-
},
|
|
220
|
-
function
|
|
219
|
+
}, Fs = () => Pe();
|
|
220
|
+
function As(t) {
|
|
221
221
|
const s = t.state.pending_messages;
|
|
222
222
|
if (s != null && s.length)
|
|
223
223
|
for (const n of s)
|
|
224
224
|
t.state.addMessageSorted(n.message);
|
|
225
225
|
}
|
|
226
|
-
const
|
|
226
|
+
const bt = z.createContext({
|
|
227
227
|
selectedChannel: void 0,
|
|
228
228
|
onChannelSelect: () => {
|
|
229
229
|
},
|
|
230
230
|
debug: !1,
|
|
231
231
|
renderMessagePreview: void 0
|
|
232
|
-
}),
|
|
233
|
-
var
|
|
234
|
-
const [s, n] =
|
|
235
|
-
!!((l = (
|
|
232
|
+
}), Os = bt.Provider, Us = () => z.useContext(bt), pt = (t) => {
|
|
233
|
+
var i, l;
|
|
234
|
+
const [s, n] = k(
|
|
235
|
+
!!((l = (i = t == null ? void 0 : t.state) == null ? void 0 : i.membership) != null && l.pinned_at)
|
|
236
236
|
);
|
|
237
237
|
return q(() => {
|
|
238
238
|
var r;
|
|
@@ -241,38 +241,38 @@ const gt = z.createContext({
|
|
|
241
241
|
return;
|
|
242
242
|
}
|
|
243
243
|
n(!!((r = t.state.membership) != null && r.pinned_at));
|
|
244
|
-
const
|
|
244
|
+
const u = (d) => {
|
|
245
245
|
var x;
|
|
246
246
|
n(
|
|
247
|
-
|
|
247
|
+
d != null && d.member ? !!d.member.pinned_at : !!((x = t.state.membership) != null && x.pinned_at)
|
|
248
248
|
);
|
|
249
249
|
};
|
|
250
|
-
return t.on("member.updated",
|
|
251
|
-
t.off("member.updated",
|
|
250
|
+
return t.on("member.updated", u), () => {
|
|
251
|
+
t.off("member.updated", u);
|
|
252
252
|
};
|
|
253
253
|
}, [t]), s;
|
|
254
|
-
},
|
|
254
|
+
}, $s = (t, s) => {
|
|
255
255
|
const n = new Date(
|
|
256
256
|
Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate())
|
|
257
257
|
), l = new Date(
|
|
258
258
|
Date.UTC(s.getUTCFullYear(), s.getUTCMonth(), s.getUTCDate())
|
|
259
259
|
).getTime() - n.getTime();
|
|
260
260
|
return Math.floor(l / (1e3 * 60 * 60 * 24));
|
|
261
|
-
},
|
|
261
|
+
}, zs = (t) => {
|
|
262
262
|
const s = /* @__PURE__ */ new Date();
|
|
263
263
|
if (Math.floor((s.getTime() - t.getTime()) / 1e3) < 60)
|
|
264
264
|
return "Just now";
|
|
265
|
-
const
|
|
266
|
-
return
|
|
265
|
+
const i = $s(t, s);
|
|
266
|
+
return i === 0 ? t.toLocaleTimeString([], {
|
|
267
267
|
hour: "numeric",
|
|
268
268
|
minute: "2-digit",
|
|
269
269
|
hour12: !0
|
|
270
|
-
}) :
|
|
270
|
+
}) : i === 1 ? "Yesterday" : i < 7 ? `${i}d` : i < 28 ? `${Math.floor(i / 7)}w` : t.toLocaleDateString("en-US", {
|
|
271
271
|
month: "numeric",
|
|
272
272
|
day: "numeric",
|
|
273
273
|
year: "2-digit"
|
|
274
274
|
});
|
|
275
|
-
},
|
|
275
|
+
}, rt = [
|
|
276
276
|
"🍎",
|
|
277
277
|
// Apple
|
|
278
278
|
"🍌",
|
|
@@ -300,34 +300,55 @@ const gt = z.createContext({
|
|
|
300
300
|
"🍈"
|
|
301
301
|
// Melon
|
|
302
302
|
];
|
|
303
|
-
function
|
|
303
|
+
function Bs(t) {
|
|
304
304
|
let s = 0;
|
|
305
305
|
for (let n = 0; n < t.length; n++) {
|
|
306
|
-
const
|
|
307
|
-
s = (s << 5) - s +
|
|
306
|
+
const i = t.charCodeAt(n);
|
|
307
|
+
s = (s << 5) - s + i, s = s & s;
|
|
308
308
|
}
|
|
309
309
|
return Math.abs(s);
|
|
310
310
|
}
|
|
311
|
-
function
|
|
312
|
-
const n =
|
|
313
|
-
return
|
|
311
|
+
function js(t) {
|
|
312
|
+
const n = Bs(t) % rt.length;
|
|
313
|
+
return rt[n];
|
|
314
314
|
}
|
|
315
|
-
const
|
|
315
|
+
const ae = ({
|
|
316
316
|
id: t,
|
|
317
317
|
image: s,
|
|
318
318
|
size: n = 40,
|
|
319
|
-
className:
|
|
319
|
+
className: i,
|
|
320
320
|
starred: l = !1,
|
|
321
|
-
shape:
|
|
321
|
+
shape: u = "squircle",
|
|
322
|
+
aiActive: r = !1
|
|
322
323
|
}) => {
|
|
323
|
-
const
|
|
324
|
+
const d = js(t), o = n < 32 ? "text-xs" : n < 56 ? "text-sm" : n < 120 ? "text-lg" : "text-4xl", h = Math.max(1, Math.ceil(n / 40)), f = u === "circle" ? { borderRadius: "50%" } : {
|
|
324
325
|
borderRadius: "33%",
|
|
325
326
|
"corner-shape": "superellipse(1.3)"
|
|
326
|
-
}
|
|
327
|
-
|
|
327
|
+
}, N = /* @__PURE__ */ e("div", { className: "h-full w-full overflow-hidden", style: f, children: s ? /* @__PURE__ */ e(
|
|
328
|
+
"img",
|
|
329
|
+
{
|
|
330
|
+
src: s,
|
|
331
|
+
alt: "",
|
|
332
|
+
className: "aspect-square h-full w-full object-cover"
|
|
333
|
+
}
|
|
334
|
+
) : /* @__PURE__ */ e(
|
|
328
335
|
"div",
|
|
329
336
|
{
|
|
330
|
-
|
|
337
|
+
"aria-hidden": "true",
|
|
338
|
+
className: O(
|
|
339
|
+
"avatar-fallback flex h-full w-full items-center justify-center bg-[#E6E5E3] font-semibold select-none transition-colors",
|
|
340
|
+
o
|
|
341
|
+
),
|
|
342
|
+
children: d
|
|
343
|
+
}
|
|
344
|
+
) });
|
|
345
|
+
return /* @__PURE__ */ c(
|
|
346
|
+
"div",
|
|
347
|
+
{
|
|
348
|
+
className: O(
|
|
349
|
+
"relative flex-shrink-0 !bg-transparent",
|
|
350
|
+
i
|
|
351
|
+
),
|
|
331
352
|
style: {
|
|
332
353
|
width: `${n}px`,
|
|
333
354
|
height: `${n}px`
|
|
@@ -338,31 +359,27 @@ const oe = ({
|
|
|
338
359
|
{
|
|
339
360
|
"aria-hidden": "true",
|
|
340
361
|
className: "absolute -left-1.5 -top-1.5 z-10 flex size-5 items-center justify-center rounded-full bg-white shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]",
|
|
341
|
-
children: /* @__PURE__ */ e(
|
|
362
|
+
children: /* @__PURE__ */ e(je, { className: "size-3 text-yellow-600", weight: "duotone" })
|
|
342
363
|
}
|
|
343
364
|
),
|
|
344
|
-
/* @__PURE__ */ e(
|
|
345
|
-
"img",
|
|
346
|
-
{
|
|
347
|
-
src: s,
|
|
348
|
-
alt: "",
|
|
349
|
-
className: "aspect-square h-full w-full object-cover"
|
|
350
|
-
}
|
|
351
|
-
) : /* @__PURE__ */ e(
|
|
365
|
+
/* @__PURE__ */ e(
|
|
352
366
|
"div",
|
|
353
367
|
{
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
x
|
|
368
|
+
className: O(
|
|
369
|
+
"h-full w-full",
|
|
370
|
+
r ? "bg-[linear-gradient(135deg,#A855F7_0%,#8B5CF6_45%,#6D28D9_100%)]" : "bg-transparent"
|
|
358
371
|
),
|
|
359
|
-
|
|
372
|
+
style: {
|
|
373
|
+
...f,
|
|
374
|
+
padding: `${h}px`
|
|
375
|
+
},
|
|
376
|
+
children: N
|
|
360
377
|
}
|
|
361
|
-
)
|
|
378
|
+
)
|
|
362
379
|
]
|
|
363
380
|
}
|
|
364
381
|
);
|
|
365
|
-
},
|
|
382
|
+
}, Gs = ({ size: t = 15 }) => /* @__PURE__ */ e(
|
|
366
383
|
"svg",
|
|
367
384
|
{
|
|
368
385
|
width: t,
|
|
@@ -379,131 +396,131 @@ const oe = ({
|
|
|
379
396
|
}
|
|
380
397
|
)
|
|
381
398
|
}
|
|
382
|
-
),
|
|
399
|
+
), Vs = (t) => {
|
|
383
400
|
var s;
|
|
384
401
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_TIP";
|
|
385
|
-
},
|
|
402
|
+
}, Hs = (t) => {
|
|
386
403
|
var s;
|
|
387
404
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_PAID";
|
|
388
|
-
},
|
|
405
|
+
}, We = (t) => {
|
|
389
406
|
var s;
|
|
390
407
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_CHATBOT";
|
|
391
|
-
},
|
|
408
|
+
}, Ys = (t) => {
|
|
392
409
|
var s;
|
|
393
410
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_ATTACHMENT";
|
|
394
|
-
},
|
|
411
|
+
}, xt = (t) => Vs(t) || Hs(t), Ws = (t) => {
|
|
395
412
|
var s;
|
|
396
|
-
return
|
|
413
|
+
return xt(t) && !((s = t.text) != null && s.trim());
|
|
397
414
|
}, Ue = ({
|
|
398
415
|
message: t,
|
|
399
416
|
standalone: s = !1,
|
|
400
417
|
isMyMessage: n = !1,
|
|
401
|
-
hasAttachment:
|
|
418
|
+
hasAttachment: i = !1
|
|
402
419
|
}) => {
|
|
403
|
-
var
|
|
404
|
-
const l =
|
|
405
|
-
if (!l && !
|
|
420
|
+
var f;
|
|
421
|
+
const l = xt(t), u = We(t);
|
|
422
|
+
if (!l && !u)
|
|
406
423
|
return null;
|
|
407
424
|
if (l) {
|
|
408
|
-
const
|
|
409
|
-
if (!
|
|
410
|
-
const a = s ? "message-tip-standalone" : "message-tag message-tag--tip", _ = s ? `${
|
|
411
|
-
return /* @__PURE__ */
|
|
412
|
-
/* @__PURE__ */ e(
|
|
425
|
+
const N = (f = t.metadata) == null ? void 0 : f.amount_text;
|
|
426
|
+
if (!N) return null;
|
|
427
|
+
const a = s ? "message-tip-standalone" : "message-tag message-tag--tip", _ = s ? `${N} tip` : `Delivered with ${N} tip`;
|
|
428
|
+
return /* @__PURE__ */ c("div", { className: a, children: [
|
|
429
|
+
/* @__PURE__ */ e(fs, { size: s ? 14 : 12 }),
|
|
413
430
|
/* @__PURE__ */ e("span", { children: _ })
|
|
414
431
|
] });
|
|
415
432
|
}
|
|
416
|
-
const r = n &&
|
|
433
|
+
const r = n && i, d = r ? "Sent with AI" : "Sent with DM Agent", x = [
|
|
417
434
|
"message-chatbot-indicator",
|
|
418
435
|
n ? "message-chatbot-indicator--sender" : "message-chatbot-indicator--receiver",
|
|
419
436
|
r ? "message-chatbot-indicator--attachment" : "message-chatbot-indicator--text"
|
|
420
|
-
].join(" "),
|
|
421
|
-
return /* @__PURE__ */ e("div", { className: x, "data-testid": "message-chatbot-indicator", children: n && !r ? /* @__PURE__ */
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
] }) : /* @__PURE__ */
|
|
425
|
-
|
|
426
|
-
|
|
437
|
+
].join(" "), o = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__label", children: d }), h = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ e(Gs, { size: r ? 12 : 15 }) });
|
|
438
|
+
return /* @__PURE__ */ e("div", { className: x, "data-testid": "message-chatbot-indicator", children: n && !r ? /* @__PURE__ */ c(se, { children: [
|
|
439
|
+
o,
|
|
440
|
+
h
|
|
441
|
+
] }) : /* @__PURE__ */ c(se, { children: [
|
|
442
|
+
h,
|
|
443
|
+
o
|
|
427
444
|
] }) });
|
|
428
|
-
},
|
|
445
|
+
}, vt = z.memo(
|
|
429
446
|
({ channel: t, unread: s }) => {
|
|
430
|
-
var
|
|
431
|
-
const { selectedChannel: n, onChannelSelect:
|
|
432
|
-
t &&
|
|
447
|
+
var L, v, m, b;
|
|
448
|
+
const { selectedChannel: n, onChannelSelect: i, debug: l, renderMessagePreview: u } = Us(), r = (n == null ? void 0 : n.id) === (t == null ? void 0 : t.id), d = () => {
|
|
449
|
+
t && i(t);
|
|
433
450
|
}, x = (T) => {
|
|
434
|
-
const M = T.key === "Enter" || T.key === " ",
|
|
435
|
-
!M ||
|
|
436
|
-
},
|
|
451
|
+
const M = T.key === "Enter" || T.key === " ", P = T.repeat;
|
|
452
|
+
!M || P || (T.preventDefault(), d());
|
|
453
|
+
}, h = Object.values(((L = t == null ? void 0 : t.state) == null ? void 0 : L.members) || {}).find(
|
|
437
454
|
(T) => {
|
|
438
|
-
var M,
|
|
439
|
-
return ((M = T.user) == null ? void 0 : M.id) && T.user.id !== ((
|
|
455
|
+
var M, P;
|
|
456
|
+
return ((M = T.user) == null ? void 0 : M.id) && T.user.id !== ((P = t == null ? void 0 : t._client) == null ? void 0 : P.userID);
|
|
440
457
|
}
|
|
441
|
-
),
|
|
458
|
+
), f = ((v = h == null ? void 0 : h.user) == null ? void 0 : v.name) || "Conversation", N = (m = h == null ? void 0 : h.user) == null ? void 0 : m.image, a = (() => {
|
|
442
459
|
var M;
|
|
443
460
|
const T = (M = t == null ? void 0 : t.state) == null ? void 0 : M.messages;
|
|
444
461
|
if (T != null && T.length) {
|
|
445
|
-
for (let
|
|
446
|
-
if (T[
|
|
462
|
+
for (let P = T.length - 1; P >= 0; P--)
|
|
463
|
+
if (T[P].type !== "system") return T[P];
|
|
447
464
|
}
|
|
448
465
|
})(), w = (() => {
|
|
449
|
-
var
|
|
466
|
+
var P, R;
|
|
450
467
|
if (a != null && a.text) return a.text;
|
|
451
|
-
if (((
|
|
468
|
+
if (((P = a == null ? void 0 : a.metadata) == null ? void 0 : P.custom_type) === "MESSAGE_TIP") return "💵 Sent a tip";
|
|
452
469
|
const M = (R = a == null ? void 0 : a.attachments) == null ? void 0 : R[0];
|
|
453
470
|
return M ? M.og_scrape_url ? M.og_scrape_url : M.type === "image" ? "📷 Sent an image" : M.type === "video" ? "🎥 Sent a video" : M.type === "audio" ? "🎵 Sent audio" : M.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
|
|
454
|
-
})(),
|
|
471
|
+
})(), g = a != null && a.created_at ? zs(new Date(a.created_at)) : "", y = a ? We(a) : !1, I = u ? u(a, w) : `${y ? "✨ " : ""}${w}`, C = pt(t), S = s ?? 0;
|
|
455
472
|
return l && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
|
|
456
473
|
channelId: t == null ? void 0 : t.id,
|
|
457
474
|
isSelected: r,
|
|
458
|
-
participantName:
|
|
459
|
-
unreadCount:
|
|
460
|
-
hasTimestamp: !!
|
|
475
|
+
participantName: f,
|
|
476
|
+
unreadCount: S,
|
|
477
|
+
hasTimestamp: !!g
|
|
461
478
|
}), /* @__PURE__ */ e(
|
|
462
479
|
"div",
|
|
463
480
|
{
|
|
464
481
|
role: "button",
|
|
465
482
|
tabIndex: 0,
|
|
466
|
-
onClick:
|
|
483
|
+
onClick: d,
|
|
467
484
|
onKeyDown: x,
|
|
468
|
-
className:
|
|
485
|
+
className: O(
|
|
469
486
|
"group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring",
|
|
470
487
|
{
|
|
471
488
|
"bg-primary-alt/10 border-l-4 border-l-primary": r,
|
|
472
489
|
"hover:bg-sand": !r
|
|
473
490
|
}
|
|
474
491
|
),
|
|
475
|
-
children: /* @__PURE__ */
|
|
492
|
+
children: /* @__PURE__ */ c("div", { className: "flex items-start gap-3", children: [
|
|
476
493
|
/* @__PURE__ */ e(
|
|
477
|
-
|
|
494
|
+
ae,
|
|
478
495
|
{
|
|
479
|
-
id: ((
|
|
480
|
-
name:
|
|
481
|
-
image:
|
|
496
|
+
id: ((b = h == null ? void 0 : h.user) == null ? void 0 : b.id) || t.id || "unknown",
|
|
497
|
+
name: f,
|
|
498
|
+
image: N,
|
|
482
499
|
size: 44,
|
|
483
|
-
starred:
|
|
500
|
+
starred: C,
|
|
484
501
|
className: "[&_.avatar-fallback]:group-hover:bg-[#eeeeee]"
|
|
485
502
|
}
|
|
486
503
|
),
|
|
487
|
-
/* @__PURE__ */
|
|
488
|
-
/* @__PURE__ */
|
|
489
|
-
/* @__PURE__ */
|
|
504
|
+
/* @__PURE__ */ c("div", { className: "flex-1 min-w-0 flex flex-col gap-1", children: [
|
|
505
|
+
/* @__PURE__ */ c("div", { className: "flex items-center justify-between gap-2", children: [
|
|
506
|
+
/* @__PURE__ */ c(
|
|
490
507
|
"h3",
|
|
491
508
|
{
|
|
492
|
-
className:
|
|
509
|
+
className: O(
|
|
493
510
|
"text-sm font-medium truncate",
|
|
494
511
|
r ? "text-primary" : "text-charcoal"
|
|
495
512
|
),
|
|
496
513
|
children: [
|
|
497
|
-
|
|
498
|
-
|
|
514
|
+
C && /* @__PURE__ */ e("span", { className: "sr-only", children: "Starred conversation. " }),
|
|
515
|
+
f
|
|
499
516
|
]
|
|
500
517
|
}
|
|
501
518
|
),
|
|
502
|
-
|
|
519
|
+
g && /* @__PURE__ */ e("span", { className: "text-xs text-stone flex-shrink-0", children: g })
|
|
503
520
|
] }),
|
|
504
|
-
/* @__PURE__ */
|
|
505
|
-
/* @__PURE__ */ e("p", { className: "text-xs text-stone flex-1 line-clamp-1", children:
|
|
506
|
-
|
|
521
|
+
/* @__PURE__ */ c("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
|
|
522
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-stone flex-1 line-clamp-1", children: I }),
|
|
523
|
+
S > 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: S > 99 ? "99+" : S })
|
|
507
524
|
] })
|
|
508
525
|
] })
|
|
509
526
|
] })
|
|
@@ -511,33 +528,33 @@ const oe = ({
|
|
|
511
528
|
);
|
|
512
529
|
}
|
|
513
530
|
);
|
|
514
|
-
|
|
515
|
-
const
|
|
531
|
+
vt.displayName = "CustomChannelPreview";
|
|
532
|
+
const qs = { last_message_at: -1 }, wt = z.memo(
|
|
516
533
|
({
|
|
517
534
|
onChannelSelect: t,
|
|
518
535
|
selectedChannel: s,
|
|
519
536
|
filters: n,
|
|
520
|
-
allowNewMessagesFromUnfilteredChannels:
|
|
537
|
+
allowNewMessagesFromUnfilteredChannels: i = !1,
|
|
521
538
|
onMessageNew: l,
|
|
522
|
-
onAddedToChannel:
|
|
539
|
+
onAddedToChannel: u,
|
|
523
540
|
channelRenderFilterFn: r,
|
|
524
|
-
sort:
|
|
541
|
+
sort: d = qs,
|
|
525
542
|
className: x,
|
|
526
|
-
customEmptyStateIndicator:
|
|
527
|
-
renderMessagePreview:
|
|
543
|
+
customEmptyStateIndicator: o,
|
|
544
|
+
renderMessagePreview: h
|
|
528
545
|
}) => {
|
|
529
|
-
const
|
|
530
|
-
|
|
531
|
-
const { debug:
|
|
546
|
+
const f = z.useRef(0);
|
|
547
|
+
f.current++;
|
|
548
|
+
const { debug: N = !1 } = Pe(), a = z.useCallback(
|
|
532
549
|
(w) => {
|
|
533
|
-
for (const
|
|
534
|
-
|
|
550
|
+
for (const g of w)
|
|
551
|
+
As(g);
|
|
535
552
|
return r ? r(w) : w;
|
|
536
553
|
},
|
|
537
554
|
[r]
|
|
538
555
|
);
|
|
539
|
-
|
|
540
|
-
renderCount:
|
|
556
|
+
N && console.log("📺 [ChannelList] 🔄 RENDER START", {
|
|
557
|
+
renderCount: f.current,
|
|
541
558
|
selectedChannelId: s == null ? void 0 : s.id,
|
|
542
559
|
filters: n
|
|
543
560
|
});
|
|
@@ -545,70 +562,70 @@ const Ys = { last_message_at: -1 }, vt = z.memo(
|
|
|
545
562
|
() => ({
|
|
546
563
|
selectedChannel: s,
|
|
547
564
|
onChannelSelect: t,
|
|
548
|
-
debug:
|
|
549
|
-
renderMessagePreview:
|
|
565
|
+
debug: N,
|
|
566
|
+
renderMessagePreview: h
|
|
550
567
|
}),
|
|
551
|
-
[s, t,
|
|
568
|
+
[s, t, N, h]
|
|
552
569
|
);
|
|
553
570
|
return /* @__PURE__ */ e(
|
|
554
571
|
"div",
|
|
555
572
|
{
|
|
556
|
-
className:
|
|
573
|
+
className: O(
|
|
557
574
|
"messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
|
|
558
575
|
x
|
|
559
576
|
),
|
|
560
|
-
children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ e(
|
|
561
|
-
|
|
577
|
+
children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ e(Os, { value: _, children: /* @__PURE__ */ e(
|
|
578
|
+
Pt,
|
|
562
579
|
{
|
|
563
580
|
filters: n,
|
|
564
|
-
sort:
|
|
581
|
+
sort: d,
|
|
565
582
|
options: { limit: 30 },
|
|
566
|
-
allowNewMessagesFromUnfilteredChannels:
|
|
583
|
+
allowNewMessagesFromUnfilteredChannels: i,
|
|
567
584
|
onMessageNew: l,
|
|
568
|
-
onAddedToChannel:
|
|
585
|
+
onAddedToChannel: u,
|
|
569
586
|
channelRenderFilterFn: a,
|
|
570
|
-
Preview:
|
|
571
|
-
EmptyStateIndicator:
|
|
587
|
+
Preview: vt,
|
|
588
|
+
EmptyStateIndicator: o
|
|
572
589
|
},
|
|
573
|
-
`${JSON.stringify(n)}:${JSON.stringify(
|
|
590
|
+
`${JSON.stringify(n)}:${JSON.stringify(d)}`
|
|
574
591
|
) }) })
|
|
575
592
|
}
|
|
576
593
|
);
|
|
577
594
|
}
|
|
578
595
|
);
|
|
579
|
-
|
|
580
|
-
const
|
|
596
|
+
wt.displayName = "ChannelList";
|
|
597
|
+
const Ie = ({
|
|
581
598
|
variant: t = "default",
|
|
582
599
|
className: s,
|
|
583
600
|
children: n,
|
|
584
|
-
...
|
|
601
|
+
...i
|
|
585
602
|
}) => /* @__PURE__ */ e(
|
|
586
603
|
"button",
|
|
587
604
|
{
|
|
588
605
|
type: "button",
|
|
589
|
-
className:
|
|
606
|
+
className: O(
|
|
590
607
|
"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",
|
|
591
608
|
t === "danger" ? "text-danger hover:bg-danger/50" : "text-charcoal hover:bg-sand",
|
|
592
609
|
s
|
|
593
610
|
),
|
|
594
|
-
...
|
|
611
|
+
...i,
|
|
595
612
|
children: n
|
|
596
613
|
}
|
|
597
614
|
);
|
|
598
|
-
function
|
|
599
|
-
return /* @__PURE__ */
|
|
615
|
+
function Nt({ label: t, className: s, children: n, ...i }) {
|
|
616
|
+
return /* @__PURE__ */ c(
|
|
600
617
|
"button",
|
|
601
618
|
{
|
|
602
619
|
type: "button",
|
|
603
|
-
className:
|
|
620
|
+
className: O(
|
|
604
621
|
"inline-flex items-center justify-center rounded-full transition-colors focus-ring p-2",
|
|
605
622
|
{
|
|
606
|
-
"cursor-not-allowed opacity-50":
|
|
607
|
-
"hover:bg-sand": !
|
|
623
|
+
"cursor-not-allowed opacity-50": i.disabled,
|
|
624
|
+
"hover:bg-sand": !i.disabled
|
|
608
625
|
},
|
|
609
626
|
s
|
|
610
627
|
),
|
|
611
|
-
...
|
|
628
|
+
...i,
|
|
612
629
|
children: [
|
|
613
630
|
/* @__PURE__ */ e("span", { className: "sr-only", children: t }),
|
|
614
631
|
n
|
|
@@ -616,28 +633,28 @@ function wt({ label: t, className: s, children: n, ...o }) {
|
|
|
616
633
|
}
|
|
617
634
|
);
|
|
618
635
|
}
|
|
619
|
-
function
|
|
620
|
-
return /* @__PURE__ */ e(
|
|
636
|
+
function yt({ onClick: t }) {
|
|
637
|
+
return /* @__PURE__ */ e(Nt, { label: "Close", onClick: t, className: "p-1", children: /* @__PURE__ */ e(Re, { className: "h-5 w-5 text-stone", weight: "bold" }) });
|
|
621
638
|
}
|
|
622
|
-
const
|
|
639
|
+
const Zs = ({
|
|
623
640
|
dialogRef: t,
|
|
624
641
|
onClose: s,
|
|
625
642
|
participant: n,
|
|
626
|
-
channel:
|
|
643
|
+
channel: i,
|
|
627
644
|
followerStatusLabel: l,
|
|
628
|
-
onLeaveConversation:
|
|
645
|
+
onLeaveConversation: u,
|
|
629
646
|
onBlockParticipant: r,
|
|
630
|
-
showDeleteConversation:
|
|
647
|
+
showDeleteConversation: d = !0,
|
|
631
648
|
onDeleteConversationClick: x,
|
|
632
|
-
onBlockParticipantClick:
|
|
633
|
-
onReportParticipantClick:
|
|
634
|
-
customProfileContent:
|
|
635
|
-
customChannelActions:
|
|
649
|
+
onBlockParticipantClick: o,
|
|
650
|
+
onReportParticipantClick: h,
|
|
651
|
+
customProfileContent: f,
|
|
652
|
+
customChannelActions: N
|
|
636
653
|
}) => {
|
|
637
|
-
var V, F, H, Z,
|
|
638
|
-
const { service: a, debug: _ } =
|
|
639
|
-
var
|
|
640
|
-
if (!(!a || !((
|
|
654
|
+
var V, F, H, Z, re, K, p;
|
|
655
|
+
const { service: a, debug: _ } = Pe(), [w, g] = k(!1), [y, I] = k(!1), [C, S] = k(!1), L = A(async () => {
|
|
656
|
+
var E;
|
|
657
|
+
if (!(!a || !((E = n == null ? void 0 : n.user) != null && E.id)))
|
|
641
658
|
try {
|
|
642
659
|
const j = (await a.getBlockedUsers()).some(
|
|
643
660
|
(ee) => {
|
|
@@ -645,63 +662,63 @@ const Ws = ({
|
|
|
645
662
|
return ee.blocked_user_id === ((le = n == null ? void 0 : n.user) == null ? void 0 : le.id);
|
|
646
663
|
}
|
|
647
664
|
);
|
|
648
|
-
|
|
649
|
-
} catch (
|
|
665
|
+
g(j);
|
|
666
|
+
} catch (U) {
|
|
650
667
|
console.error(
|
|
651
668
|
"[ChannelInfoDialog] Failed to check blocked status:",
|
|
652
|
-
|
|
669
|
+
U
|
|
653
670
|
);
|
|
654
671
|
}
|
|
655
672
|
}, [a, (V = n == null ? void 0 : n.user) == null ? void 0 : V.id]);
|
|
656
673
|
q(() => {
|
|
657
|
-
|
|
658
|
-
}, [
|
|
674
|
+
L();
|
|
675
|
+
}, [L]);
|
|
659
676
|
const v = async () => {
|
|
660
|
-
var
|
|
661
|
-
if (!
|
|
662
|
-
x == null || x(), _ && console.log("[ChannelInfoDialog] Leave conversation",
|
|
677
|
+
var E;
|
|
678
|
+
if (!y) {
|
|
679
|
+
x == null || x(), _ && console.log("[ChannelInfoDialog] Leave conversation", i.cid), I(!0);
|
|
663
680
|
try {
|
|
664
|
-
const
|
|
665
|
-
await
|
|
666
|
-
} catch (
|
|
667
|
-
console.error("[ChannelInfoDialog] Failed to leave conversation",
|
|
681
|
+
const U = ((E = i._client) == null ? void 0 : E.userID) ?? null;
|
|
682
|
+
await i.hide(U, !1), u && await u(i), s();
|
|
683
|
+
} catch (U) {
|
|
684
|
+
console.error("[ChannelInfoDialog] Failed to leave conversation", U);
|
|
668
685
|
} finally {
|
|
669
|
-
|
|
686
|
+
I(!1);
|
|
670
687
|
}
|
|
671
688
|
}
|
|
672
689
|
}, m = async () => {
|
|
673
|
-
var
|
|
674
|
-
if (!(
|
|
675
|
-
|
|
690
|
+
var E, U, j;
|
|
691
|
+
if (!(C || !a)) {
|
|
692
|
+
o == null || o(), _ && console.log("[ChannelInfoDialog] Block member", (E = n == null ? void 0 : n.user) == null ? void 0 : E.id), S(!0);
|
|
676
693
|
try {
|
|
677
|
-
await a.blockUser((
|
|
694
|
+
await a.blockUser((U = n == null ? void 0 : n.user) == null ? void 0 : U.id), r && await r((j = n == null ? void 0 : n.user) == null ? void 0 : j.id), s();
|
|
678
695
|
} catch (ee) {
|
|
679
696
|
console.error("[ChannelInfoDialog] Failed to block member", ee);
|
|
680
697
|
} finally {
|
|
681
|
-
|
|
698
|
+
S(!1);
|
|
682
699
|
}
|
|
683
700
|
}
|
|
684
|
-
},
|
|
685
|
-
var
|
|
686
|
-
if (!(
|
|
687
|
-
|
|
701
|
+
}, b = async () => {
|
|
702
|
+
var E, U, j;
|
|
703
|
+
if (!(C || !a)) {
|
|
704
|
+
o == null || o(), _ && console.log("[ChannelInfoDialog] Unblock member", (E = n == null ? void 0 : n.user) == null ? void 0 : E.id), S(!0);
|
|
688
705
|
try {
|
|
689
|
-
await a.unBlockUser((
|
|
706
|
+
await a.unBlockUser((U = n == null ? void 0 : n.user) == null ? void 0 : U.id), r && await r((j = n == null ? void 0 : n.user) == null ? void 0 : j.id), s();
|
|
690
707
|
} catch (ee) {
|
|
691
708
|
console.error("[ChannelInfoDialog] Failed to unblock member", ee);
|
|
692
709
|
} finally {
|
|
693
|
-
|
|
710
|
+
S(!1);
|
|
694
711
|
}
|
|
695
712
|
}
|
|
696
713
|
}, T = () => {
|
|
697
|
-
|
|
714
|
+
h == null || h(), s(), window.open(
|
|
698
715
|
"https://linktr.ee/s/about/trust-center/report",
|
|
699
716
|
"_blank",
|
|
700
717
|
"noopener,noreferrer"
|
|
701
718
|
);
|
|
702
719
|
};
|
|
703
720
|
if (!n) return null;
|
|
704
|
-
const M = ((F = n.user) == null ? void 0 : F.name) || ((H = n.user) == null ? void 0 : H.id) || "Unknown member",
|
|
721
|
+
const M = ((F = n.user) == null ? void 0 : F.name) || ((H = n.user) == null ? void 0 : H.id) || "Unknown member", P = (Z = n.user) == null ? void 0 : Z.image, R = (re = n.user) == null ? void 0 : re.email, B = (K = n.user) == null ? void 0 : K.username, Q = R || (B ? `linktr.ee/${B}` : void 0), J = ((p = n.user) == null ? void 0 : p.id) || "unknown";
|
|
705
722
|
return (
|
|
706
723
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
|
|
707
724
|
/* @__PURE__ */ e(
|
|
@@ -710,36 +727,36 @@ const Ws = ({
|
|
|
710
727
|
ref: t,
|
|
711
728
|
className: "mes-dialog group",
|
|
712
729
|
onClose: s,
|
|
713
|
-
onClick: (
|
|
714
|
-
|
|
730
|
+
onClick: (E) => {
|
|
731
|
+
E.target === t.current && s();
|
|
715
732
|
},
|
|
716
|
-
children: /* @__PURE__ */
|
|
717
|
-
/* @__PURE__ */
|
|
733
|
+
children: /* @__PURE__ */ c("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: [
|
|
734
|
+
/* @__PURE__ */ c("div", { className: "flex items-center justify-between border-b border-sand px-4 py-3", children: [
|
|
718
735
|
/* @__PURE__ */ e("h2", { className: "text-base font-semibold text-charcoal", children: "Chat info" }),
|
|
719
|
-
/* @__PURE__ */ e(
|
|
736
|
+
/* @__PURE__ */ e(yt, { onClick: s })
|
|
720
737
|
] }),
|
|
721
|
-
/* @__PURE__ */
|
|
722
|
-
/* @__PURE__ */
|
|
738
|
+
/* @__PURE__ */ c("div", { className: "flex-1 px-2 overflow-y-auto w-full", children: [
|
|
739
|
+
/* @__PURE__ */ c(
|
|
723
740
|
"div",
|
|
724
741
|
{
|
|
725
742
|
className: "flex flex-col items-center gap-3 self-stretch px-4 py-2 mt-6 rounded-lg border border-black/[0.04]",
|
|
726
743
|
style: { backgroundColor: "#FBFAF9" },
|
|
727
744
|
children: [
|
|
728
|
-
/* @__PURE__ */
|
|
745
|
+
/* @__PURE__ */ c("div", { className: "flex items-center gap-3 w-full", children: [
|
|
729
746
|
/* @__PURE__ */ e(
|
|
730
|
-
|
|
747
|
+
ae,
|
|
731
748
|
{
|
|
732
749
|
id: J,
|
|
733
750
|
name: M,
|
|
734
|
-
image:
|
|
751
|
+
image: P,
|
|
735
752
|
size: 88,
|
|
736
753
|
shape: "circle"
|
|
737
754
|
}
|
|
738
755
|
),
|
|
739
|
-
/* @__PURE__ */
|
|
756
|
+
/* @__PURE__ */ c("div", { className: "flex flex-col min-w-0 flex-1", children: [
|
|
740
757
|
/* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: M }),
|
|
741
758
|
Q && /* @__PURE__ */ e("p", { className: "truncate text-sm text-[#00000055]", children: Q }),
|
|
742
|
-
l && !
|
|
759
|
+
l && !f && /* @__PURE__ */ e(
|
|
743
760
|
"span",
|
|
744
761
|
{
|
|
745
762
|
className: "mt-1 rounded-full text-xs font-normal w-fit",
|
|
@@ -755,103 +772,103 @@ const Ws = ({
|
|
|
755
772
|
)
|
|
756
773
|
] })
|
|
757
774
|
] }),
|
|
758
|
-
|
|
775
|
+
f && /* @__PURE__ */ e("div", { className: "w-full", children: f })
|
|
759
776
|
]
|
|
760
777
|
}
|
|
761
778
|
),
|
|
762
|
-
/* @__PURE__ */
|
|
763
|
-
|
|
764
|
-
|
|
779
|
+
/* @__PURE__ */ c("ul", { className: "flex flex-col gap-2 mt-2", children: [
|
|
780
|
+
d && /* @__PURE__ */ e("li", { children: /* @__PURE__ */ c(
|
|
781
|
+
Ie,
|
|
765
782
|
{
|
|
766
783
|
onClick: v,
|
|
767
|
-
disabled:
|
|
768
|
-
"aria-busy":
|
|
784
|
+
disabled: y,
|
|
785
|
+
"aria-busy": y,
|
|
769
786
|
children: [
|
|
770
|
-
|
|
787
|
+
y ? /* @__PURE__ */ e(ke, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(gs, { className: "h-5 w-5" }),
|
|
771
788
|
/* @__PURE__ */ e("span", { children: "Delete Conversation" })
|
|
772
789
|
]
|
|
773
790
|
}
|
|
774
791
|
) }),
|
|
775
|
-
/* @__PURE__ */ e("li", { children: w ? /* @__PURE__ */
|
|
776
|
-
|
|
792
|
+
/* @__PURE__ */ e("li", { children: w ? /* @__PURE__ */ c(
|
|
793
|
+
Ie,
|
|
777
794
|
{
|
|
778
|
-
onClick:
|
|
779
|
-
disabled:
|
|
780
|
-
"aria-busy":
|
|
795
|
+
onClick: b,
|
|
796
|
+
disabled: C,
|
|
797
|
+
"aria-busy": C,
|
|
781
798
|
children: [
|
|
782
|
-
|
|
799
|
+
C ? /* @__PURE__ */ e(ke, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Je, { className: "h-5 w-5" }),
|
|
783
800
|
/* @__PURE__ */ e("span", { children: "Unblock" })
|
|
784
801
|
]
|
|
785
802
|
}
|
|
786
|
-
) : /* @__PURE__ */
|
|
787
|
-
|
|
803
|
+
) : /* @__PURE__ */ c(
|
|
804
|
+
Ie,
|
|
788
805
|
{
|
|
789
806
|
onClick: m,
|
|
790
|
-
disabled:
|
|
791
|
-
"aria-busy":
|
|
807
|
+
disabled: C,
|
|
808
|
+
"aria-busy": C,
|
|
792
809
|
children: [
|
|
793
|
-
|
|
810
|
+
C ? /* @__PURE__ */ e(ke, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Je, { className: "h-5 w-5" }),
|
|
794
811
|
/* @__PURE__ */ e("span", { children: "Block" })
|
|
795
812
|
]
|
|
796
813
|
}
|
|
797
814
|
) }),
|
|
798
|
-
/* @__PURE__ */ e("li", { children: /* @__PURE__ */
|
|
799
|
-
/* @__PURE__ */ e(
|
|
815
|
+
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ c(Ie, { variant: "danger", onClick: T, children: [
|
|
816
|
+
/* @__PURE__ */ e(bs, { className: "h-5 w-5" }),
|
|
800
817
|
/* @__PURE__ */ e("span", { children: "Report" })
|
|
801
818
|
] }) }),
|
|
802
|
-
|
|
819
|
+
N
|
|
803
820
|
] })
|
|
804
821
|
] })
|
|
805
822
|
] })
|
|
806
823
|
}
|
|
807
824
|
)
|
|
808
825
|
);
|
|
809
|
-
},
|
|
810
|
-
function
|
|
811
|
-
return t != null && t.length ? t.some((s) => s.type ===
|
|
826
|
+
}, Xs = (t) => /* @__PURE__ */ e(Lt, { ...t, position: "center" }), Ge = "vote_up", Ve = "vote_down";
|
|
827
|
+
function Ks(t) {
|
|
828
|
+
return t != null && t.length ? t.some((s) => s.type === Ve) ? "down" : t.some((s) => s.type === Ge) ? "up" : null : null;
|
|
812
829
|
}
|
|
813
|
-
function
|
|
814
|
-
const { channel: s } =
|
|
815
|
-
() =>
|
|
830
|
+
function Js(t) {
|
|
831
|
+
const { channel: s } = me(), { client: n } = Ye("useMessageVote"), i = Be(
|
|
832
|
+
() => Ks(t.own_reactions),
|
|
816
833
|
[t.own_reactions]
|
|
817
834
|
), l = A(async () => {
|
|
818
835
|
if (n != null && n.userID)
|
|
819
836
|
try {
|
|
820
|
-
|
|
837
|
+
i === "up" ? await s.deleteReaction(t.id, Ge) : await s.sendReaction(
|
|
821
838
|
t.id,
|
|
822
|
-
{ type:
|
|
839
|
+
{ type: Ge },
|
|
823
840
|
{ enforce_unique: !0, skip_push: !0 }
|
|
824
841
|
);
|
|
825
842
|
} catch {
|
|
826
843
|
}
|
|
827
|
-
}, [s, n == null ? void 0 : n.userID, t.id,
|
|
844
|
+
}, [s, n == null ? void 0 : n.userID, t.id, i]), u = A(async () => {
|
|
828
845
|
if (n != null && n.userID)
|
|
829
846
|
try {
|
|
830
|
-
|
|
847
|
+
i === "down" ? await s.deleteReaction(t.id, Ve) : await s.sendReaction(
|
|
831
848
|
t.id,
|
|
832
|
-
{ type:
|
|
849
|
+
{ type: Ve },
|
|
833
850
|
{ enforce_unique: !0, skip_push: !0 }
|
|
834
851
|
);
|
|
835
852
|
} catch {
|
|
836
853
|
}
|
|
837
|
-
}, [s, n == null ? void 0 : n.userID, t.id,
|
|
838
|
-
return { selected:
|
|
854
|
+
}, [s, n == null ? void 0 : n.userID, t.id, i]);
|
|
855
|
+
return { selected: i, voteUp: l, voteDown: u };
|
|
839
856
|
}
|
|
840
|
-
const
|
|
857
|
+
const Qs = z.lazy(() => import("./Card-BXKUE7JN.js")), en = z.lazy(() => import("./Card-J-rj8Q6w.js")), Ct = () => /* @__PURE__ */ e(
|
|
841
858
|
"div",
|
|
842
859
|
{
|
|
843
860
|
className: "w-[280px] min-h-[200px] animate-pulse rounded-[24px] bg-black/[0.06] shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]",
|
|
844
861
|
"aria-hidden": !0
|
|
845
862
|
}
|
|
846
|
-
),
|
|
863
|
+
), tn = (t) => /* @__PURE__ */ e(dt, { fallback: /* @__PURE__ */ e(Ct, {}), children: /* @__PURE__ */ e(Qs, { ...t }) }), sn = (t) => /* @__PURE__ */ e(dt, { fallback: /* @__PURE__ */ e(Ct, {}), children: /* @__PURE__ */ e(en, { ...t }) }), it = { Creator: tn, Visitor: sn }, nn = {
|
|
847
864
|
isUnlocking: () => !1
|
|
848
|
-
},
|
|
849
|
-
LockedAttachment:
|
|
850
|
-
},
|
|
851
|
-
function
|
|
852
|
-
return
|
|
865
|
+
}, an = {
|
|
866
|
+
LockedAttachment: nn
|
|
867
|
+
}, _t = ot({}), ia = _t.Provider;
|
|
868
|
+
function rn(t) {
|
|
869
|
+
return ct(_t)[t] ?? an[t];
|
|
853
870
|
}
|
|
854
|
-
const
|
|
871
|
+
const ln = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
|
|
855
872
|
"path",
|
|
856
873
|
{
|
|
857
874
|
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",
|
|
@@ -861,7 +878,7 @@ const an = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
861
878
|
strokeLinejoin: "round",
|
|
862
879
|
fill: t ? "currentColor" : "none"
|
|
863
880
|
}
|
|
864
|
-
) }),
|
|
881
|
+
) }), on = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
|
|
865
882
|
"path",
|
|
866
883
|
{
|
|
867
884
|
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",
|
|
@@ -871,11 +888,11 @@ const an = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
871
888
|
strokeLinejoin: "round",
|
|
872
889
|
fill: t ? "currentColor" : "none"
|
|
873
890
|
}
|
|
874
|
-
) }),
|
|
891
|
+
) }), cn = ({
|
|
875
892
|
selected: t,
|
|
876
893
|
onVoteUp: s,
|
|
877
894
|
onVoteDown: n
|
|
878
|
-
}) => /* @__PURE__ */
|
|
895
|
+
}) => /* @__PURE__ */ c("div", { className: "message-vote-buttons", children: [
|
|
879
896
|
/* @__PURE__ */ e(
|
|
880
897
|
"button",
|
|
881
898
|
{
|
|
@@ -884,7 +901,7 @@ const an = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
884
901
|
onClick: s,
|
|
885
902
|
"aria-label": "Helpful",
|
|
886
903
|
"aria-pressed": t === "up",
|
|
887
|
-
children: /* @__PURE__ */ e(
|
|
904
|
+
children: /* @__PURE__ */ e(ln, { filled: t === "up" })
|
|
888
905
|
}
|
|
889
906
|
),
|
|
890
907
|
/* @__PURE__ */ e(
|
|
@@ -895,92 +912,92 @@ const an = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
895
912
|
onClick: n,
|
|
896
913
|
"aria-label": "Not helpful",
|
|
897
914
|
"aria-pressed": t === "down",
|
|
898
|
-
children: /* @__PURE__ */ e(
|
|
915
|
+
children: /* @__PURE__ */ e(on, { filled: t === "down" })
|
|
899
916
|
}
|
|
900
917
|
)
|
|
901
|
-
] }),
|
|
918
|
+
] }), dn = (t) => {
|
|
902
919
|
var ce, ne, Ne, ye, Ce, de, _e, Ee, Se, ue, D, W, $, G;
|
|
903
920
|
const {
|
|
904
921
|
additionalMessageInputProps: s,
|
|
905
922
|
chatbotVotingEnabled: n,
|
|
906
|
-
editing:
|
|
923
|
+
editing: i,
|
|
907
924
|
endOfGroup: l,
|
|
908
|
-
firstOfGroup:
|
|
925
|
+
firstOfGroup: u,
|
|
909
926
|
groupedByUser: r,
|
|
910
|
-
handleAction:
|
|
927
|
+
handleAction: d,
|
|
911
928
|
handleOpenThread: x,
|
|
912
|
-
handleRetry:
|
|
913
|
-
highlighted:
|
|
914
|
-
isMessageAIGenerated:
|
|
915
|
-
isMyMessage:
|
|
929
|
+
handleRetry: o,
|
|
930
|
+
highlighted: h,
|
|
931
|
+
isMessageAIGenerated: f,
|
|
932
|
+
isMyMessage: N,
|
|
916
933
|
message: a,
|
|
917
934
|
renderText: _,
|
|
918
935
|
threadList: w
|
|
919
|
-
} = t, { client:
|
|
920
|
-
Attachment: R =
|
|
921
|
-
EditMessageModal: B =
|
|
922
|
-
MessageBlocked: Q =
|
|
923
|
-
MessageBouncePrompt: J =
|
|
924
|
-
MessageDeleted: V =
|
|
925
|
-
MessageIsThreadReplyInChannelButtonIndicator: F =
|
|
926
|
-
MessageRepliesCountButton: H =
|
|
927
|
-
ReminderNotification: Z =
|
|
928
|
-
StreamedMessageText:
|
|
936
|
+
} = t, { client: g } = Ye("CustomMessage"), { channel: y } = me("CustomMessage"), { isUnlocking: I, onUnlockClick: C, onFetchSource: S, onDownloadClick: L } = rn("LockedAttachment"), [v, m] = k(!1), b = At(a.id), { selected: T, voteUp: M, voteDown: P } = Js(a), {
|
|
937
|
+
Attachment: R = Ot,
|
|
938
|
+
EditMessageModal: B = Ut,
|
|
939
|
+
MessageBlocked: Q = $t,
|
|
940
|
+
MessageBouncePrompt: J = zt,
|
|
941
|
+
MessageDeleted: V = Bt,
|
|
942
|
+
MessageIsThreadReplyInChannelButtonIndicator: F = jt,
|
|
943
|
+
MessageRepliesCountButton: H = Gt,
|
|
944
|
+
ReminderNotification: Z = Vt,
|
|
945
|
+
StreamedMessageText: re = Ht,
|
|
929
946
|
PinIndicator: K
|
|
930
|
-
} =
|
|
931
|
-
() =>
|
|
932
|
-
[
|
|
933
|
-
), j =
|
|
947
|
+
} = ut("CustomMessage"), p = Yt(a), E = Wt(a), U = Be(
|
|
948
|
+
() => f == null ? void 0 : f(a),
|
|
949
|
+
[f, a]
|
|
950
|
+
), j = Be(
|
|
934
951
|
() => !a.shared_location && !a.attachments ? [] : a.shared_location ? [a.shared_location, ...a.attachments ?? []] : a.attachments,
|
|
935
952
|
[a]
|
|
936
953
|
);
|
|
937
|
-
if (
|
|
954
|
+
if (qt(a))
|
|
938
955
|
return null;
|
|
939
956
|
if (a.deleted_at || a.type === "deleted")
|
|
940
957
|
return /* @__PURE__ */ e(V, { message: a });
|
|
941
|
-
if (
|
|
958
|
+
if (Zt(a))
|
|
942
959
|
return /* @__PURE__ */ e(Q, {});
|
|
943
|
-
const ee = !w && !!a.reply_count, le = !w && a.show_in_channel && a.parent_id, pe = a.status === "failed" && ((ce = a.error) == null ? void 0 : ce.status) !== 403,
|
|
960
|
+
const ee = !w && !!a.reply_count, le = !w && a.show_in_channel && a.parent_id, pe = a.status === "failed" && ((ce = a.error) == null ? void 0 : ce.status) !== 403, Le = Xt(a);
|
|
944
961
|
let Y;
|
|
945
|
-
pe ? Y = () =>
|
|
946
|
-
const te =
|
|
962
|
+
pe ? Y = () => o(a) : Le && (Y = () => m(!0));
|
|
963
|
+
const te = N(), xe = O(
|
|
947
964
|
"str-chat__message str-chat__message-simple",
|
|
948
965
|
`str-chat__message--${a.type}`,
|
|
949
966
|
`str-chat__message--${a.status}`,
|
|
950
967
|
te ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
|
|
951
968
|
a.text ? "str-chat__message--has-text" : "has-no-text",
|
|
952
969
|
{
|
|
953
|
-
"str-chat__message--has-attachment":
|
|
954
|
-
"str-chat__message--highlighted":
|
|
970
|
+
"str-chat__message--has-attachment": p,
|
|
971
|
+
"str-chat__message--highlighted": h,
|
|
955
972
|
"str-chat__message--pinned pinned-message": a.pinned,
|
|
956
|
-
"str-chat__message--with-reactions":
|
|
973
|
+
"str-chat__message--with-reactions": E,
|
|
957
974
|
"str-chat__message-send-can-be-retried": (a == null ? void 0 : a.status) === "failed" && ((ne = a == null ? void 0 : a.error) == null ? void 0 : ne.status) !== 403,
|
|
958
975
|
"str-chat__message-with-thread-link": ee || le,
|
|
959
976
|
"str-chat__virtual-message__wrapper--end": l,
|
|
960
|
-
"str-chat__virtual-message__wrapper--first":
|
|
977
|
+
"str-chat__virtual-message__wrapper--first": u,
|
|
961
978
|
"str-chat__virtual-message__wrapper--group": r
|
|
962
979
|
}
|
|
963
|
-
),
|
|
964
|
-
return /* @__PURE__ */
|
|
965
|
-
|
|
980
|
+
), ie = a.poll_id && g.polls.fromState(a.poll_id), he = Ws(a), oe = We(a), ve = Ys(a), ge = !!(j != null && j.length && !a.quoted_message), we = oe && te && ge;
|
|
981
|
+
return /* @__PURE__ */ c(se, { children: [
|
|
982
|
+
i && /* @__PURE__ */ e(
|
|
966
983
|
B,
|
|
967
984
|
{
|
|
968
985
|
additionalMessageInputProps: s
|
|
969
986
|
}
|
|
970
987
|
),
|
|
971
988
|
v && /* @__PURE__ */ e(
|
|
972
|
-
|
|
989
|
+
Kt,
|
|
973
990
|
{
|
|
974
991
|
MessageBouncePrompt: J,
|
|
975
992
|
onClose: () => m(!1),
|
|
976
993
|
open: v
|
|
977
994
|
}
|
|
978
995
|
),
|
|
979
|
-
/* @__PURE__ */
|
|
996
|
+
/* @__PURE__ */ c("div", { className: xe, children: [
|
|
980
997
|
K && /* @__PURE__ */ e(K, {}),
|
|
981
|
-
!!
|
|
998
|
+
!!b && /* @__PURE__ */ e(Z, { reminder: b }),
|
|
982
999
|
a.user && /* @__PURE__ */ e(
|
|
983
|
-
|
|
1000
|
+
ae,
|
|
984
1001
|
{
|
|
985
1002
|
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
986
1003
|
id: a.user.id,
|
|
@@ -991,8 +1008,8 @@ const an = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
991
1008
|
/* @__PURE__ */ e(
|
|
992
1009
|
"div",
|
|
993
1010
|
{
|
|
994
|
-
className:
|
|
995
|
-
"str-chat__simple-message--error-failed": pe ||
|
|
1011
|
+
className: O("str-chat__message-inner", {
|
|
1012
|
+
"str-chat__simple-message--error-failed": pe || Le
|
|
996
1013
|
}),
|
|
997
1014
|
"data-testid": "message-inner",
|
|
998
1015
|
onClick: Y,
|
|
@@ -1005,9 +1022,9 @@ const an = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1005
1022
|
marginInlineEnd: 0,
|
|
1006
1023
|
marginInlineStart: 0
|
|
1007
1024
|
},
|
|
1008
|
-
children: ve ? /* @__PURE__ */
|
|
1025
|
+
children: ve ? /* @__PURE__ */ c("div", { className: "str-chat__message-bubble-wrapper", children: [
|
|
1009
1026
|
te ? /* @__PURE__ */ e(
|
|
1010
|
-
|
|
1027
|
+
it.Creator,
|
|
1011
1028
|
{
|
|
1012
1029
|
title: (Ne = a.metadata) == null ? void 0 : Ne.attachment_title,
|
|
1013
1030
|
mimeType: (ye = a.metadata) == null ? void 0 : ye.attachment_mime_type,
|
|
@@ -1015,12 +1032,12 @@ const an = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1015
1032
|
amountText: (de = a.metadata) == null ? void 0 : de.amount_text,
|
|
1016
1033
|
detail: (_e = a.metadata) == null ? void 0 : _e.attachment_detail,
|
|
1017
1034
|
paymentStatus: (Ee = a.metadata) == null ? void 0 : Ee.payment_status,
|
|
1018
|
-
isUnlocking:
|
|
1019
|
-
onPreviewClick: () =>
|
|
1020
|
-
onFetchSource: async () => await (
|
|
1035
|
+
isUnlocking: I(a.id),
|
|
1036
|
+
onPreviewClick: () => C == null ? void 0 : C(a, y),
|
|
1037
|
+
onFetchSource: async () => await (S == null ? void 0 : S(a, y))
|
|
1021
1038
|
}
|
|
1022
1039
|
) : /* @__PURE__ */ e(
|
|
1023
|
-
|
|
1040
|
+
it.Visitor,
|
|
1024
1041
|
{
|
|
1025
1042
|
title: (Se = a.metadata) == null ? void 0 : Se.attachment_title,
|
|
1026
1043
|
mimeType: (ue = a.metadata) == null ? void 0 : ue.attachment_mime_type,
|
|
@@ -1028,19 +1045,19 @@ const an = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1028
1045
|
amountText: (W = a.metadata) == null ? void 0 : W.amount_text,
|
|
1029
1046
|
detail: ($ = a.metadata) == null ? void 0 : $.attachment_detail,
|
|
1030
1047
|
paymentStatus: (G = a.metadata) == null ? void 0 : G.payment_status,
|
|
1031
|
-
isUnlocking:
|
|
1032
|
-
onUnlockClick: () =>
|
|
1033
|
-
onFetchSource: async () => await (
|
|
1034
|
-
onDownloadClick: () =>
|
|
1048
|
+
isUnlocking: I(a.id),
|
|
1049
|
+
onUnlockClick: () => C == null ? void 0 : C(a, y),
|
|
1050
|
+
onFetchSource: async () => await (S == null ? void 0 : S(a, y)),
|
|
1051
|
+
onDownloadClick: () => L == null ? void 0 : L(a, y)
|
|
1035
1052
|
}
|
|
1036
1053
|
),
|
|
1037
|
-
a.text && /* @__PURE__ */ e("div", { className: "str-chat__message-bubble", children: /* @__PURE__ */ e(
|
|
1038
|
-
] }) :
|
|
1054
|
+
a.text && /* @__PURE__ */ e("div", { className: "str-chat__message-bubble", children: /* @__PURE__ */ e(Ke, { message: a, renderText: _ }) })
|
|
1055
|
+
] }) : he ? (
|
|
1039
1056
|
/* Tip-only messages render as a standalone bubble */
|
|
1040
1057
|
/* @__PURE__ */ e(Ue, { message: a, standalone: !0 })
|
|
1041
|
-
) : /* @__PURE__ */
|
|
1042
|
-
/* @__PURE__ */
|
|
1043
|
-
|
|
1058
|
+
) : /* @__PURE__ */ c("div", { className: "str-chat__message-bubble-wrapper", children: [
|
|
1059
|
+
/* @__PURE__ */ c("div", { className: "str-chat__message-bubble", children: [
|
|
1060
|
+
oe && !we && /* @__PURE__ */ e(
|
|
1044
1061
|
Ue,
|
|
1045
1062
|
{
|
|
1046
1063
|
message: a,
|
|
@@ -1048,24 +1065,24 @@ const an = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1048
1065
|
isMyMessage: te
|
|
1049
1066
|
}
|
|
1050
1067
|
),
|
|
1051
|
-
|
|
1068
|
+
ie && /* @__PURE__ */ e(Jt, { poll: ie }),
|
|
1052
1069
|
j != null && j.length && !a.quoted_message ? /* @__PURE__ */ e(
|
|
1053
1070
|
R,
|
|
1054
1071
|
{
|
|
1055
|
-
actionHandler:
|
|
1072
|
+
actionHandler: d,
|
|
1056
1073
|
attachments: j
|
|
1057
1074
|
}
|
|
1058
1075
|
) : null,
|
|
1059
|
-
|
|
1060
|
-
|
|
1076
|
+
U ? /* @__PURE__ */ e(
|
|
1077
|
+
re,
|
|
1061
1078
|
{
|
|
1062
1079
|
message: a,
|
|
1063
1080
|
renderText: _
|
|
1064
1081
|
}
|
|
1065
|
-
) : /* @__PURE__ */ e(
|
|
1066
|
-
/* @__PURE__ */ e(
|
|
1082
|
+
) : /* @__PURE__ */ e(Ke, { message: a, renderText: _ }),
|
|
1083
|
+
/* @__PURE__ */ e(Qt, {})
|
|
1067
1084
|
] }),
|
|
1068
|
-
(!
|
|
1085
|
+
(!oe || we) && /* @__PURE__ */ e(
|
|
1069
1086
|
Ue,
|
|
1070
1087
|
{
|
|
1071
1088
|
message: a,
|
|
@@ -1073,12 +1090,12 @@ const an = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1073
1090
|
isMyMessage: te
|
|
1074
1091
|
}
|
|
1075
1092
|
),
|
|
1076
|
-
n &&
|
|
1077
|
-
|
|
1093
|
+
n && oe && /* @__PURE__ */ e(
|
|
1094
|
+
cn,
|
|
1078
1095
|
{
|
|
1079
1096
|
selected: T,
|
|
1080
1097
|
onVoteUp: M,
|
|
1081
|
-
onVoteDown:
|
|
1098
|
+
onVoteDown: P
|
|
1082
1099
|
}
|
|
1083
1100
|
)
|
|
1084
1101
|
] })
|
|
@@ -1094,22 +1111,22 @@ const an = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1094
1111
|
le && /* @__PURE__ */ e(F, {})
|
|
1095
1112
|
] }, a.id)
|
|
1096
1113
|
] });
|
|
1097
|
-
},
|
|
1098
|
-
|
|
1099
|
-
(t, s) => t.chatbotVotingEnabled !== s.chatbotVotingEnabled ? !1 :
|
|
1100
|
-
),
|
|
1101
|
-
const s =
|
|
1102
|
-
return /* @__PURE__ */ e(
|
|
1103
|
-
},
|
|
1114
|
+
}, un = z.memo(
|
|
1115
|
+
dn,
|
|
1116
|
+
(t, s) => t.chatbotVotingEnabled !== s.chatbotVotingEnabled ? !1 : Ft(t, s)
|
|
1117
|
+
), mn = (t) => {
|
|
1118
|
+
const s = mt("CustomMessage");
|
|
1119
|
+
return /* @__PURE__ */ e(un, { ...s, ...t });
|
|
1120
|
+
}, hn = (t) => ({
|
|
1104
1121
|
linkPreviews: Array.from(t.previews.values()).filter(
|
|
1105
|
-
(s) =>
|
|
1122
|
+
(s) => at.previewIsLoaded(s) || at.previewIsLoading(s)
|
|
1106
1123
|
)
|
|
1107
|
-
}),
|
|
1124
|
+
}), fn = ({
|
|
1108
1125
|
link: t,
|
|
1109
1126
|
onDismiss: s
|
|
1110
1127
|
}) => {
|
|
1111
|
-
const { og_scrape_url: n, title:
|
|
1112
|
-
return /* @__PURE__ */
|
|
1128
|
+
const { og_scrape_url: n, title: i, image_url: l } = t;
|
|
1129
|
+
return /* @__PURE__ */ c(
|
|
1113
1130
|
"a",
|
|
1114
1131
|
{
|
|
1115
1132
|
href: n,
|
|
@@ -1121,7 +1138,7 @@ const an = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1121
1138
|
"img",
|
|
1122
1139
|
{
|
|
1123
1140
|
src: l,
|
|
1124
|
-
alt:
|
|
1141
|
+
alt: i || "",
|
|
1125
1142
|
className: "h-[148px] w-full rounded-[20px] object-cover"
|
|
1126
1143
|
}
|
|
1127
1144
|
),
|
|
@@ -1137,29 +1154,29 @@ const an = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1137
1154
|
children: /* @__PURE__ */ e(Re, { className: "size-4 text-black/90" })
|
|
1138
1155
|
}
|
|
1139
1156
|
),
|
|
1140
|
-
/* @__PURE__ */
|
|
1141
|
-
|
|
1157
|
+
/* @__PURE__ */ c("div", { className: "p-2", children: [
|
|
1158
|
+
i && /* @__PURE__ */ e("div", { className: "text-[14px] font-medium leading-5 text-white", children: i }),
|
|
1142
1159
|
/* @__PURE__ */ e("div", { className: "text-[12px] leading-4 text-white/55", children: n })
|
|
1143
1160
|
] })
|
|
1144
1161
|
]
|
|
1145
1162
|
}
|
|
1146
1163
|
);
|
|
1147
|
-
},
|
|
1148
|
-
const { linkPreviewsManager: t } =
|
|
1164
|
+
}, gn = () => {
|
|
1165
|
+
const { linkPreviewsManager: t } = es(), { linkPreviews: s } = ts(
|
|
1149
1166
|
t.state,
|
|
1150
|
-
|
|
1167
|
+
hn
|
|
1151
1168
|
), n = (l) => {
|
|
1152
1169
|
t.dismissPreview(l);
|
|
1153
1170
|
};
|
|
1154
1171
|
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(
|
|
1155
|
-
|
|
1172
|
+
fn,
|
|
1156
1173
|
{
|
|
1157
1174
|
link: l,
|
|
1158
1175
|
onDismiss: n
|
|
1159
1176
|
},
|
|
1160
1177
|
l.og_scrape_url
|
|
1161
1178
|
)) }) : null;
|
|
1162
|
-
},
|
|
1179
|
+
}, bn = ({ sendMessage: t, disabled: s, ...n }) => /* @__PURE__ */ e(
|
|
1163
1180
|
"button",
|
|
1164
1181
|
{
|
|
1165
1182
|
...n,
|
|
@@ -1167,22 +1184,22 @@ const an = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1167
1184
|
"aria-label": "Send",
|
|
1168
1185
|
disabled: s,
|
|
1169
1186
|
onClick: t,
|
|
1170
|
-
children: /* @__PURE__ */ e(
|
|
1187
|
+
children: /* @__PURE__ */ e(ps, { weight: "bold", className: "size-4" })
|
|
1171
1188
|
}
|
|
1172
|
-
),
|
|
1173
|
-
var
|
|
1174
|
-
const { channel: t } =
|
|
1189
|
+
), pn = () => {
|
|
1190
|
+
var d;
|
|
1191
|
+
const { channel: t } = me(), s = ((d = t == null ? void 0 : t.data) == null ? void 0 : d.frozen) === !0, { handleSubmit: n } = ns(), { SendButton: i } = ut(
|
|
1175
1192
|
"CustomMessageInput"
|
|
1176
|
-
), l =
|
|
1177
|
-
return /* @__PURE__ */
|
|
1178
|
-
/* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(
|
|
1179
|
-
/* @__PURE__ */
|
|
1180
|
-
/* @__PURE__ */ e(
|
|
1181
|
-
/* @__PURE__ */ e(
|
|
1182
|
-
/* @__PURE__ */ e(
|
|
1183
|
-
/* @__PURE__ */
|
|
1193
|
+
), l = i ?? bn, u = as();
|
|
1194
|
+
return /* @__PURE__ */ c(se, { children: [
|
|
1195
|
+
/* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(rs, {}) }),
|
|
1196
|
+
/* @__PURE__ */ c("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: [
|
|
1197
|
+
/* @__PURE__ */ e(is, {}),
|
|
1198
|
+
/* @__PURE__ */ e(gn, {}),
|
|
1199
|
+
/* @__PURE__ */ e(ls, {}),
|
|
1200
|
+
/* @__PURE__ */ c("div", { className: "flex", children: [
|
|
1184
1201
|
/* @__PURE__ */ e("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ e(
|
|
1185
|
-
|
|
1202
|
+
os,
|
|
1186
1203
|
{
|
|
1187
1204
|
"aria-disabled": s || void 0,
|
|
1188
1205
|
className: "w-full resize-none outline-none leading-6",
|
|
@@ -1199,19 +1216,19 @@ const an = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1199
1216
|
"aria-label": "Send",
|
|
1200
1217
|
className: "str-chat__send-button mt-auto flex justify-center items-center flex-shrink-0 rounded-full size-8 bg-[#121110] disabled:bg-[#F1F0EE] disabled:text-black/20 text-white focus-ring",
|
|
1201
1218
|
"data-testid": "send-button",
|
|
1202
|
-
disabled: s || !
|
|
1219
|
+
disabled: s || !u,
|
|
1203
1220
|
type: "button"
|
|
1204
1221
|
}
|
|
1205
1222
|
)
|
|
1206
1223
|
] })
|
|
1207
1224
|
] })
|
|
1208
1225
|
] });
|
|
1209
|
-
},
|
|
1226
|
+
}, xn = ({
|
|
1210
1227
|
renderActions: t
|
|
1211
1228
|
}) => {
|
|
1212
|
-
var
|
|
1213
|
-
const { channel: s } =
|
|
1214
|
-
return /* @__PURE__ */
|
|
1229
|
+
var i;
|
|
1230
|
+
const { channel: s } = me(), n = ((i = s == null ? void 0 : s.data) == null ? void 0 : i.frozen) === !0;
|
|
1231
|
+
return /* @__PURE__ */ c(
|
|
1215
1232
|
"div",
|
|
1216
1233
|
{
|
|
1217
1234
|
inert: n ? "" : void 0,
|
|
@@ -1219,50 +1236,50 @@ const an = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1219
1236
|
className: "message-input flex items-center gap-2 p-4 aria-disabled:opacity-40",
|
|
1220
1237
|
children: [
|
|
1221
1238
|
t == null ? void 0 : t(),
|
|
1222
|
-
/* @__PURE__ */ e(
|
|
1239
|
+
/* @__PURE__ */ e(ss, { Input: pn })
|
|
1223
1240
|
]
|
|
1224
1241
|
}
|
|
1225
1242
|
);
|
|
1226
|
-
},
|
|
1243
|
+
}, vn = [
|
|
1227
1244
|
"SYSTEM_DM_AGENT_PAUSED",
|
|
1228
1245
|
"SYSTEM_DM_AGENT_RESUMED"
|
|
1229
|
-
],
|
|
1246
|
+
], wn = {
|
|
1230
1247
|
SYSTEM_DM_AGENT_PAUSED: "DM Agent has left the conversation",
|
|
1231
1248
|
SYSTEM_DM_AGENT_RESUMED: "DM Agent has rejoined the conversation"
|
|
1232
|
-
},
|
|
1249
|
+
}, Nn = [
|
|
1233
1250
|
"SYSTEM_AGE_SAFETY_BLOCKED"
|
|
1234
|
-
],
|
|
1251
|
+
], yn = {
|
|
1235
1252
|
SYSTEM_AGE_SAFETY_BLOCKED: "This user isn’t able to reply because they don’t meet our age safety guidelines."
|
|
1236
|
-
}, $e = "age safety guidelines.",
|
|
1237
|
-
var
|
|
1238
|
-
const s = (
|
|
1239
|
-
if (
|
|
1253
|
+
}, $e = "age safety guidelines.", Cn = "https://linktr.ee/s/about/contact", lt = (t) => vn.includes(t), _n = (t) => Nn.includes(t), En = (t) => {
|
|
1254
|
+
var i;
|
|
1255
|
+
const s = (i = t.metadata) == null ? void 0 : i.custom_type;
|
|
1256
|
+
if (lt(s))
|
|
1240
1257
|
return {
|
|
1241
1258
|
kind: "dm-agent",
|
|
1242
1259
|
type: s
|
|
1243
1260
|
};
|
|
1244
|
-
if (
|
|
1261
|
+
if (_n(s))
|
|
1245
1262
|
return {
|
|
1246
1263
|
kind: "age-safety",
|
|
1247
1264
|
type: s
|
|
1248
1265
|
};
|
|
1249
1266
|
const n = t.dm_agent_system_type;
|
|
1250
|
-
if (
|
|
1267
|
+
if (lt(n))
|
|
1251
1268
|
return {
|
|
1252
1269
|
kind: "dm-agent",
|
|
1253
1270
|
type: n
|
|
1254
1271
|
};
|
|
1255
|
-
},
|
|
1272
|
+
}, Sn = (t) => {
|
|
1256
1273
|
const s = t.indexOf($e);
|
|
1257
1274
|
if (s === -1)
|
|
1258
1275
|
return t;
|
|
1259
1276
|
const n = s + $e.length;
|
|
1260
|
-
return /* @__PURE__ */
|
|
1277
|
+
return /* @__PURE__ */ c(se, { children: [
|
|
1261
1278
|
t.slice(0, s),
|
|
1262
1279
|
/* @__PURE__ */ e(
|
|
1263
1280
|
"a",
|
|
1264
1281
|
{
|
|
1265
|
-
href:
|
|
1282
|
+
href: Cn,
|
|
1266
1283
|
target: "_blank",
|
|
1267
1284
|
rel: "noopener noreferrer",
|
|
1268
1285
|
className: "mes-age-safety-system-message__emphasis font-medium text-inherit underline",
|
|
@@ -1271,15 +1288,15 @@ const an = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1271
1288
|
),
|
|
1272
1289
|
t.slice(n)
|
|
1273
1290
|
] });
|
|
1274
|
-
},
|
|
1275
|
-
var
|
|
1276
|
-
const s = t.message.hide_date === !0, n =
|
|
1291
|
+
}, In = (t) => {
|
|
1292
|
+
var i, l;
|
|
1293
|
+
const s = t.message.hide_date === !0, n = En(
|
|
1277
1294
|
t.message
|
|
1278
1295
|
);
|
|
1279
1296
|
if ((n == null ? void 0 : n.kind) === "dm-agent") {
|
|
1280
|
-
const
|
|
1281
|
-
return /* @__PURE__ */
|
|
1282
|
-
/* @__PURE__ */
|
|
1297
|
+
const u = ((i = t.message.text) == null ? void 0 : i.trim()) || wn[n.type];
|
|
1298
|
+
return /* @__PURE__ */ c("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
1299
|
+
/* @__PURE__ */ c(
|
|
1283
1300
|
"div",
|
|
1284
1301
|
{
|
|
1285
1302
|
className: "mes-dm-agent-system-message mx-auto mb-2 inline-flex w-fit max-w-[min(100%,480px)] items-center justify-center gap-[10px] rounded-[12px] border border-[rgba(0,0,0,0.08)] p-3 text-[rgba(0,0,0,0.55)]",
|
|
@@ -1287,7 +1304,7 @@ const an = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1287
1304
|
"data-dm-agent-system-type": n.type,
|
|
1288
1305
|
children: [
|
|
1289
1306
|
/* @__PURE__ */ e(
|
|
1290
|
-
|
|
1307
|
+
xs,
|
|
1291
1308
|
{
|
|
1292
1309
|
size: 16,
|
|
1293
1310
|
weight: "regular",
|
|
@@ -1295,7 +1312,7 @@ const an = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1295
1312
|
className: "mes-dm-agent-system-message__sparkle shrink-0"
|
|
1296
1313
|
}
|
|
1297
1314
|
),
|
|
1298
|
-
/* @__PURE__ */ e("p", { className: "mes-dm-agent-system-message__text m-0 text-center text-[14px] font-normal leading-5 tracking-[0.21px]", children:
|
|
1315
|
+
/* @__PURE__ */ e("p", { className: "mes-dm-agent-system-message__text m-0 text-center text-[14px] font-normal leading-5 tracking-[0.21px]", children: u })
|
|
1299
1316
|
]
|
|
1300
1317
|
}
|
|
1301
1318
|
),
|
|
@@ -1303,9 +1320,9 @@ const an = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1303
1320
|
] });
|
|
1304
1321
|
}
|
|
1305
1322
|
if ((n == null ? void 0 : n.kind) === "age-safety") {
|
|
1306
|
-
const
|
|
1307
|
-
return /* @__PURE__ */
|
|
1308
|
-
/* @__PURE__ */
|
|
1323
|
+
const u = ((l = t.message.text) == null ? void 0 : l.trim()) || yn[n.type];
|
|
1324
|
+
return /* @__PURE__ */ c("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
1325
|
+
/* @__PURE__ */ c(
|
|
1309
1326
|
"div",
|
|
1310
1327
|
{
|
|
1311
1328
|
className: "mes-age-safety-system-message box-border mx-auto mb-2 flex w-full max-w-[329px] items-start justify-center gap-3 rounded-[12px] border border-[var(--border-secondary,rgba(0,0,0,0.08))] bg-[var(--bg-warning-subtle,#fef3c6)] px-2 py-4 pl-5 text-[color:var(--text-warning-on-warning,#894b00)]",
|
|
@@ -1313,7 +1330,7 @@ const an = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1313
1330
|
"data-age-safety-system-type": n.type,
|
|
1314
1331
|
children: [
|
|
1315
1332
|
/* @__PURE__ */ e(
|
|
1316
|
-
|
|
1333
|
+
vs,
|
|
1317
1334
|
{
|
|
1318
1335
|
size: 24,
|
|
1319
1336
|
weight: "duotone",
|
|
@@ -1322,27 +1339,92 @@ const an = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1322
1339
|
"data-testid": "age-safety-system-message-icon"
|
|
1323
1340
|
}
|
|
1324
1341
|
),
|
|
1325
|
-
/* @__PURE__ */ e("div", { className: "mes-age-safety-system-message__content min-w-0 flex-[1_0_0]", children: /* @__PURE__ */ e("p", { className: "m-0 text-balance text-left text-[12px] font-normal leading-4 tracking-[0.21px] text-[color:var(--text-warning-on-warning,#894b00)]", children:
|
|
1342
|
+
/* @__PURE__ */ e("div", { className: "mes-age-safety-system-message__content min-w-0 flex-[1_0_0]", children: /* @__PURE__ */ e("p", { className: "m-0 text-balance text-left text-[12px] font-normal leading-4 tracking-[0.21px] text-[color:var(--text-warning-on-warning,#894b00)]", children: Sn(u) }) })
|
|
1326
1343
|
]
|
|
1327
1344
|
}
|
|
1328
1345
|
),
|
|
1329
1346
|
!s && /* @__PURE__ */ e(Oe, { message: t.message })
|
|
1330
1347
|
] });
|
|
1331
1348
|
}
|
|
1332
|
-
return /* @__PURE__ */
|
|
1333
|
-
/* @__PURE__ */
|
|
1349
|
+
return /* @__PURE__ */ c("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
1350
|
+
/* @__PURE__ */ c("div", { className: "str-chat__message--system__text", children: [
|
|
1334
1351
|
/* @__PURE__ */ e("div", { className: "str-chat__message--system__line" }),
|
|
1335
1352
|
/* @__PURE__ */ e("p", { children: t.message.text }),
|
|
1336
1353
|
/* @__PURE__ */ e("div", { className: "str-chat__message--system__line" })
|
|
1337
1354
|
] }),
|
|
1338
1355
|
!s && /* @__PURE__ */ e(Oe, { message: t.message })
|
|
1339
1356
|
] });
|
|
1340
|
-
},
|
|
1357
|
+
}, ze = ({ cx: t, index: s }) => /* @__PURE__ */ e("circle", { className: "fill-pebble", cx: t, cy: "4", r: "3.9", children: /* @__PURE__ */ e(
|
|
1358
|
+
"animateTransform",
|
|
1359
|
+
{
|
|
1360
|
+
attributeName: "transform",
|
|
1361
|
+
type: "translate",
|
|
1362
|
+
values: "0 0; 0 -2.25; 0 0;",
|
|
1363
|
+
dur: "900ms",
|
|
1364
|
+
begin: `${120 * s}ms`,
|
|
1365
|
+
repeatCount: "indefinite"
|
|
1366
|
+
}
|
|
1367
|
+
) }), kn = ({ threadList: t }) => {
|
|
1368
|
+
var _;
|
|
1369
|
+
const { channel: s, channelConfig: n, thread: i } = me(), { client: l } = Ye(), { typing: u = {} } = cs();
|
|
1370
|
+
if ((n == null ? void 0 : n.typing_events) === !1)
|
|
1371
|
+
return null;
|
|
1372
|
+
const r = t ? [] : Object.values(u).filter(
|
|
1373
|
+
({ parent_id: w, user: g }) => {
|
|
1374
|
+
var y;
|
|
1375
|
+
return (g == null ? void 0 : g.id) !== ((y = l.user) == null ? void 0 : y.id) && !w;
|
|
1376
|
+
}
|
|
1377
|
+
), d = t ? Object.values(u).filter(
|
|
1378
|
+
({ parent_id: w, user: g }) => {
|
|
1379
|
+
var y;
|
|
1380
|
+
return (g == null ? void 0 : g.id) !== ((y = l.user) == null ? void 0 : y.id) && w === (i == null ? void 0 : i.id);
|
|
1381
|
+
}
|
|
1382
|
+
) : [], x = t ? d : r;
|
|
1383
|
+
if (!x.length)
|
|
1384
|
+
return null;
|
|
1385
|
+
const o = (_ = x[0]) == null ? void 0 : _.user, h = o != null && o.id && s.state.members[o.id] ? s.state.members[o.id].user : void 0, f = (o == null ? void 0 : o.id) ?? (h == null ? void 0 : h.id) ?? "typing-user", N = (o == null ? void 0 : o.name) ?? (h == null ? void 0 : h.name) ?? (o == null ? void 0 : o.id) ?? "Typing user", a = (o == null ? void 0 : o.image) ?? (h == null ? void 0 : h.image);
|
|
1386
|
+
return /* @__PURE__ */ c(
|
|
1387
|
+
"div",
|
|
1388
|
+
{
|
|
1389
|
+
className: "str-chat__typing-indicator !items-end",
|
|
1390
|
+
"data-testid": "typing-indicator",
|
|
1391
|
+
style: { insetInlineStart: 0, insetInlineEnd: "auto" },
|
|
1392
|
+
children: [
|
|
1393
|
+
/* @__PURE__ */ e("div", { className: "shrink-0", "aria-hidden": "true", children: /* @__PURE__ */ e(
|
|
1394
|
+
ae,
|
|
1395
|
+
{
|
|
1396
|
+
id: f,
|
|
1397
|
+
name: N,
|
|
1398
|
+
image: a,
|
|
1399
|
+
size: 24,
|
|
1400
|
+
shape: "circle"
|
|
1401
|
+
}
|
|
1402
|
+
) }),
|
|
1403
|
+
/* @__PURE__ */ e("div", { className: "px-4 py-3 rounded-lg bg-[#F1F0EE] h-12 flex flex-col justify-end", children: /* @__PURE__ */ c(
|
|
1404
|
+
"svg",
|
|
1405
|
+
{
|
|
1406
|
+
"aria-hidden": "true",
|
|
1407
|
+
className: "block overflow-visible",
|
|
1408
|
+
viewBox: "0 0 32 8",
|
|
1409
|
+
width: "32",
|
|
1410
|
+
height: "8",
|
|
1411
|
+
overflow: "visible",
|
|
1412
|
+
children: [
|
|
1413
|
+
/* @__PURE__ */ e(ze, { cx: "4", index: 0 }),
|
|
1414
|
+
/* @__PURE__ */ e(ze, { cx: "16", index: 1 }),
|
|
1415
|
+
/* @__PURE__ */ e(ze, { cx: "28", index: 2 })
|
|
1416
|
+
]
|
|
1417
|
+
}
|
|
1418
|
+
) })
|
|
1419
|
+
]
|
|
1420
|
+
}
|
|
1421
|
+
);
|
|
1422
|
+
}, Tn = () => null, Mn = ({ className: t, message: s }) => /* @__PURE__ */ c(
|
|
1341
1423
|
"div",
|
|
1342
1424
|
{
|
|
1343
|
-
className:
|
|
1425
|
+
className: O("flex items-center justify-center h-full", t),
|
|
1344
1426
|
children: [
|
|
1345
|
-
/* @__PURE__ */
|
|
1427
|
+
/* @__PURE__ */ c("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
|
|
1346
1428
|
/* @__PURE__ */ e("circle", { cx: "6", cy: "50", r: "6", children: /* @__PURE__ */ e(
|
|
1347
1429
|
"animateTransform",
|
|
1348
1430
|
{
|
|
@@ -1380,88 +1462,88 @@ const an = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1380
1462
|
s && /* @__PURE__ */ e("span", { className: "text-stone", children: s })
|
|
1381
1463
|
]
|
|
1382
1464
|
}
|
|
1383
|
-
), De = z.memo(() => /* @__PURE__ */ e("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */
|
|
1384
|
-
/* @__PURE__ */ e(
|
|
1465
|
+
), De = z.memo(() => /* @__PURE__ */ e("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ c("div", { className: "flex items-center", children: [
|
|
1466
|
+
/* @__PURE__ */ e(Mn, { className: "w-6 h-6" }),
|
|
1385
1467
|
/* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading messages" })
|
|
1386
1468
|
] }) }));
|
|
1387
1469
|
De.displayName = "LoadingState";
|
|
1388
|
-
const
|
|
1470
|
+
const fe = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring", Dn = ({
|
|
1389
1471
|
onBack: t,
|
|
1390
1472
|
showBackButton: s,
|
|
1391
1473
|
onShowInfo: n,
|
|
1392
|
-
canShowInfo:
|
|
1474
|
+
canShowInfo: i,
|
|
1393
1475
|
showStarButton: l = !1
|
|
1394
1476
|
}) => {
|
|
1395
|
-
var
|
|
1396
|
-
const { channel:
|
|
1397
|
-
(
|
|
1398
|
-
var
|
|
1399
|
-
return ((
|
|
1477
|
+
var f, N, a, _, w;
|
|
1478
|
+
const { channel: u } = me(), r = z.useMemo(() => Object.values(u.state.members || {}).find(
|
|
1479
|
+
(y) => {
|
|
1480
|
+
var I;
|
|
1481
|
+
return ((I = y.user) == null ? void 0 : I.id) && y.user.id !== u._client.userID;
|
|
1400
1482
|
}
|
|
1401
|
-
), [
|
|
1483
|
+
), [u._client.userID, u.state.members]), d = ((f = r == null ? void 0 : r.user) == null ? void 0 : f.name) || ((N = r == null ? void 0 : r.user) == null ? void 0 : N.id) || "Unknown member", x = (a = r == null ? void 0 : r.user) == null ? void 0 : a.image, o = pt(u), h = async () => {
|
|
1402
1484
|
try {
|
|
1403
|
-
|
|
1404
|
-
} catch (
|
|
1485
|
+
o ? await u.unpin() : await u.pin();
|
|
1486
|
+
} catch (g) {
|
|
1405
1487
|
console.error(
|
|
1406
1488
|
"[CustomChannelHeader] Failed to update pinned status:",
|
|
1407
|
-
|
|
1489
|
+
g
|
|
1408
1490
|
);
|
|
1409
1491
|
}
|
|
1410
1492
|
};
|
|
1411
|
-
return /* @__PURE__ */
|
|
1412
|
-
/* @__PURE__ */
|
|
1493
|
+
return /* @__PURE__ */ c("div", { className: "@container", children: [
|
|
1494
|
+
/* @__PURE__ */ c("div", { className: "grid grid-cols-[1fr_auto_1fr] w-full items-center @lg:hidden", children: [
|
|
1413
1495
|
/* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: s && /* @__PURE__ */ e(
|
|
1414
1496
|
"button",
|
|
1415
1497
|
{
|
|
1416
|
-
className:
|
|
1498
|
+
className: fe,
|
|
1417
1499
|
onClick: t || (() => {
|
|
1418
1500
|
}),
|
|
1419
1501
|
type: "button",
|
|
1420
1502
|
"aria-label": "Back to conversations",
|
|
1421
|
-
children: /* @__PURE__ */ e(
|
|
1503
|
+
children: /* @__PURE__ */ e(Qe, { className: "size-5 text-black/90" })
|
|
1422
1504
|
}
|
|
1423
1505
|
) }),
|
|
1424
|
-
/* @__PURE__ */
|
|
1506
|
+
/* @__PURE__ */ c("div", { className: "flex flex-col gap-1 items-center", children: [
|
|
1425
1507
|
/* @__PURE__ */ e(
|
|
1426
|
-
|
|
1508
|
+
ae,
|
|
1427
1509
|
{
|
|
1428
|
-
id: ((_ = r == null ? void 0 : r.user) == null ? void 0 : _.id) ||
|
|
1429
|
-
name:
|
|
1510
|
+
id: ((_ = r == null ? void 0 : r.user) == null ? void 0 : _.id) || u.id || "unknown",
|
|
1511
|
+
name: d,
|
|
1430
1512
|
image: x,
|
|
1431
|
-
starred: l &&
|
|
1513
|
+
starred: l && o,
|
|
1432
1514
|
size: 40
|
|
1433
1515
|
}
|
|
1434
1516
|
),
|
|
1435
|
-
/* @__PURE__ */
|
|
1517
|
+
/* @__PURE__ */ c(
|
|
1436
1518
|
"button",
|
|
1437
1519
|
{
|
|
1438
1520
|
type: "button",
|
|
1439
1521
|
onClick: n,
|
|
1440
1522
|
className: "flex items-center gap-0.5 rounded-full bg-black/[0.05] px-3 py-1 text-xs font-medium text-black/90 hover:bg-black/[0.08] transition-colors",
|
|
1441
|
-
"aria-label": `View info for ${
|
|
1523
|
+
"aria-label": `View info for ${d}`,
|
|
1442
1524
|
children: [
|
|
1443
|
-
|
|
1444
|
-
/* @__PURE__ */ e(
|
|
1525
|
+
d,
|
|
1526
|
+
/* @__PURE__ */ e(et, { className: "size-3 shrink-0" })
|
|
1445
1527
|
]
|
|
1446
1528
|
}
|
|
1447
1529
|
)
|
|
1448
1530
|
] }),
|
|
1449
|
-
/* @__PURE__ */
|
|
1531
|
+
/* @__PURE__ */ c("div", { className: "flex justify-end items-center gap-2", children: [
|
|
1450
1532
|
l && /* @__PURE__ */ e(
|
|
1451
1533
|
"button",
|
|
1452
1534
|
{
|
|
1453
|
-
className:
|
|
1454
|
-
onClick:
|
|
1535
|
+
className: fe,
|
|
1536
|
+
onClick: h,
|
|
1455
1537
|
type: "button",
|
|
1456
|
-
"aria-label":
|
|
1538
|
+
"aria-label": o ? "Unstar conversation" : "Star conversation",
|
|
1457
1539
|
children: /* @__PURE__ */ e(
|
|
1458
|
-
|
|
1540
|
+
je,
|
|
1459
1541
|
{
|
|
1460
|
-
className:
|
|
1461
|
-
"text-yellow-600":
|
|
1462
|
-
"text-black/90": !
|
|
1542
|
+
className: O("size-5", {
|
|
1543
|
+
"text-yellow-600": o,
|
|
1544
|
+
"text-black/90": !o
|
|
1463
1545
|
}),
|
|
1464
|
-
weight:
|
|
1546
|
+
weight: o ? "duotone" : "regular"
|
|
1465
1547
|
}
|
|
1466
1548
|
)
|
|
1467
1549
|
}
|
|
@@ -1469,210 +1551,204 @@ const he = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1469
1551
|
/* @__PURE__ */ e(
|
|
1470
1552
|
"button",
|
|
1471
1553
|
{
|
|
1472
|
-
className:
|
|
1554
|
+
className: fe,
|
|
1473
1555
|
onClick: n,
|
|
1474
1556
|
type: "button",
|
|
1475
1557
|
"aria-label": "Show info",
|
|
1476
|
-
children: /* @__PURE__ */ e(
|
|
1558
|
+
children: /* @__PURE__ */ e(tt, { className: "size-5 text-black/90" })
|
|
1477
1559
|
}
|
|
1478
1560
|
)
|
|
1479
1561
|
] })
|
|
1480
1562
|
] }),
|
|
1481
|
-
/* @__PURE__ */
|
|
1482
|
-
/* @__PURE__ */
|
|
1563
|
+
/* @__PURE__ */ c("div", { className: "hidden @lg:flex items-center justify-between gap-3 min-h-12", children: [
|
|
1564
|
+
/* @__PURE__ */ c("div", { className: "flex items-center gap-4 min-w-0", children: [
|
|
1483
1565
|
s && t && /* @__PURE__ */ e(
|
|
1484
1566
|
"button",
|
|
1485
1567
|
{
|
|
1486
1568
|
type: "button",
|
|
1487
1569
|
onClick: t,
|
|
1488
|
-
className:
|
|
1570
|
+
className: fe,
|
|
1489
1571
|
"aria-label": "Back to conversations",
|
|
1490
|
-
children: /* @__PURE__ */ e(
|
|
1572
|
+
children: /* @__PURE__ */ e(Qe, { className: "size-5 text-black/90" })
|
|
1491
1573
|
}
|
|
1492
1574
|
),
|
|
1493
1575
|
/* @__PURE__ */ e(
|
|
1494
|
-
|
|
1576
|
+
ae,
|
|
1495
1577
|
{
|
|
1496
|
-
id: ((w = r == null ? void 0 : r.user) == null ? void 0 : w.id) ||
|
|
1497
|
-
name:
|
|
1578
|
+
id: ((w = r == null ? void 0 : r.user) == null ? void 0 : w.id) || u.id || "unknown",
|
|
1579
|
+
name: d,
|
|
1498
1580
|
image: x,
|
|
1499
|
-
starred: l &&
|
|
1581
|
+
starred: l && o,
|
|
1500
1582
|
size: 40
|
|
1501
1583
|
}
|
|
1502
1584
|
),
|
|
1503
|
-
/* @__PURE__ */ e("div", { className: "min-w-0", children:
|
|
1585
|
+
/* @__PURE__ */ e("div", { className: "min-w-0", children: i ? /* @__PURE__ */ c(
|
|
1504
1586
|
"button",
|
|
1505
1587
|
{
|
|
1506
1588
|
type: "button",
|
|
1507
1589
|
onClick: n,
|
|
1508
1590
|
className: "flex items-center gap-1 font-medium text-black/90 truncate hover:text-black/70 transition-colors",
|
|
1509
|
-
"aria-label": `View info for ${
|
|
1591
|
+
"aria-label": `View info for ${d}`,
|
|
1510
1592
|
children: [
|
|
1511
|
-
/* @__PURE__ */ e("span", { className: "truncate", children:
|
|
1512
|
-
/* @__PURE__ */ e(
|
|
1593
|
+
/* @__PURE__ */ e("span", { className: "truncate", children: d }),
|
|
1594
|
+
/* @__PURE__ */ e(et, { className: "size-4 shrink-0" })
|
|
1513
1595
|
]
|
|
1514
1596
|
}
|
|
1515
|
-
) : /* @__PURE__ */ e("h1", { className: "font-medium text-black/90 truncate", children:
|
|
1597
|
+
) : /* @__PURE__ */ e("h1", { className: "font-medium text-black/90 truncate", children: d }) })
|
|
1516
1598
|
] }),
|
|
1517
|
-
/* @__PURE__ */
|
|
1599
|
+
/* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: [
|
|
1518
1600
|
l && /* @__PURE__ */ e(
|
|
1519
1601
|
"button",
|
|
1520
1602
|
{
|
|
1521
|
-
className:
|
|
1522
|
-
onClick:
|
|
1603
|
+
className: fe,
|
|
1604
|
+
onClick: h,
|
|
1523
1605
|
type: "button",
|
|
1524
|
-
"aria-label":
|
|
1606
|
+
"aria-label": o ? "Unstar conversation" : "Star conversation",
|
|
1525
1607
|
children: /* @__PURE__ */ e(
|
|
1526
|
-
|
|
1608
|
+
je,
|
|
1527
1609
|
{
|
|
1528
|
-
className:
|
|
1529
|
-
"text-yellow-600":
|
|
1530
|
-
"text-black/90": !
|
|
1610
|
+
className: O("size-5", {
|
|
1611
|
+
"text-yellow-600": o,
|
|
1612
|
+
"text-black/90": !o
|
|
1531
1613
|
}),
|
|
1532
|
-
weight:
|
|
1614
|
+
weight: o ? "duotone" : "regular"
|
|
1533
1615
|
}
|
|
1534
1616
|
)
|
|
1535
1617
|
}
|
|
1536
1618
|
),
|
|
1537
|
-
|
|
1619
|
+
i && n && /* @__PURE__ */ e(
|
|
1538
1620
|
"button",
|
|
1539
1621
|
{
|
|
1540
|
-
className:
|
|
1622
|
+
className: fe,
|
|
1541
1623
|
onClick: n,
|
|
1542
1624
|
type: "button",
|
|
1543
1625
|
"aria-label": "Show info",
|
|
1544
|
-
children: /* @__PURE__ */ e(
|
|
1626
|
+
children: /* @__PURE__ */ e(tt, { className: "size-5 text-black/90" })
|
|
1545
1627
|
}
|
|
1546
1628
|
)
|
|
1547
1629
|
] })
|
|
1548
1630
|
] })
|
|
1549
1631
|
] });
|
|
1550
|
-
},
|
|
1632
|
+
}, Rn = ({
|
|
1551
1633
|
onBack: t,
|
|
1552
1634
|
showBackButton: s,
|
|
1553
1635
|
renderMessageInputActions: n,
|
|
1554
|
-
renderConversationFooter:
|
|
1636
|
+
renderConversationFooter: i,
|
|
1555
1637
|
onLeaveConversation: l,
|
|
1556
|
-
onBlockParticipant:
|
|
1638
|
+
onBlockParticipant: u,
|
|
1557
1639
|
showDeleteConversation: r = !0,
|
|
1558
|
-
onDeleteConversationClick:
|
|
1640
|
+
onDeleteConversationClick: d,
|
|
1559
1641
|
onBlockParticipantClick: x,
|
|
1560
|
-
onReportParticipantClick:
|
|
1561
|
-
showStarButton:
|
|
1562
|
-
chatbotVotingEnabled:
|
|
1563
|
-
renderChannelBanner:
|
|
1642
|
+
onReportParticipantClick: o,
|
|
1643
|
+
showStarButton: h = !1,
|
|
1644
|
+
chatbotVotingEnabled: f = !1,
|
|
1645
|
+
renderChannelBanner: N,
|
|
1564
1646
|
customProfileContent: a,
|
|
1565
1647
|
customChannelActions: _,
|
|
1566
1648
|
renderMessage: w
|
|
1567
1649
|
}) => {
|
|
1568
|
-
const { channel:
|
|
1569
|
-
(
|
|
1650
|
+
const { channel: g } = me(), y = X(null), I = z.useMemo(() => Object.values(g.state.members || {}).find(
|
|
1651
|
+
(b) => {
|
|
1570
1652
|
var T;
|
|
1571
|
-
return ((T =
|
|
1653
|
+
return ((T = b.user) == null ? void 0 : T.id) && b.user.id !== g._client.userID;
|
|
1572
1654
|
}
|
|
1573
|
-
), [
|
|
1574
|
-
const m =
|
|
1655
|
+
), [g._client.userID, g.state.members]), C = z.useMemo(() => {
|
|
1656
|
+
const m = g.data ?? {};
|
|
1575
1657
|
if (m.followerStatus)
|
|
1576
1658
|
return String(m.followerStatus);
|
|
1577
1659
|
if (m.isFollower !== void 0)
|
|
1578
1660
|
return m.isFollower ? "Subscribed to you" : "Not subscribed";
|
|
1579
|
-
}, [
|
|
1661
|
+
}, [g.data]), S = A(() => {
|
|
1580
1662
|
var m;
|
|
1581
|
-
(m =
|
|
1582
|
-
}, []),
|
|
1663
|
+
(m = y.current) == null || m.showModal();
|
|
1664
|
+
}, []), L = A(() => {
|
|
1583
1665
|
var m;
|
|
1584
|
-
(m =
|
|
1666
|
+
(m = y.current) == null || m.close();
|
|
1585
1667
|
}, []), v = A(
|
|
1586
1668
|
(m) => {
|
|
1587
|
-
const { message:
|
|
1588
|
-
|
|
1589
|
-
{
|
|
1590
|
-
...m,
|
|
1591
|
-
chatbotVotingEnabled: h
|
|
1592
|
-
}
|
|
1593
|
-
);
|
|
1594
|
-
return !w || !f ? T : w(T, f);
|
|
1669
|
+
const { message: b } = mt("ChannelView"), T = /* @__PURE__ */ e(mn, { ...m, chatbotVotingEnabled: f });
|
|
1670
|
+
return !w || !b ? T : w(T, b);
|
|
1595
1671
|
},
|
|
1596
|
-
[
|
|
1672
|
+
[f, w]
|
|
1597
1673
|
);
|
|
1598
|
-
return /* @__PURE__ */
|
|
1599
|
-
/* @__PURE__ */ e(
|
|
1674
|
+
return /* @__PURE__ */ c(se, { children: [
|
|
1675
|
+
/* @__PURE__ */ e(us, { overrides: { Message: v }, children: /* @__PURE__ */ c(ms, { children: [
|
|
1600
1676
|
/* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ e(
|
|
1601
|
-
|
|
1677
|
+
Dn,
|
|
1602
1678
|
{
|
|
1603
1679
|
onBack: t,
|
|
1604
1680
|
showBackButton: s,
|
|
1605
|
-
onShowInfo:
|
|
1606
|
-
canShowInfo: !!
|
|
1607
|
-
showStarButton:
|
|
1681
|
+
onShowInfo: S,
|
|
1682
|
+
canShowInfo: !!I,
|
|
1683
|
+
showStarButton: h
|
|
1608
1684
|
}
|
|
1609
1685
|
) }),
|
|
1610
|
-
|
|
1686
|
+
N == null ? void 0 : N(),
|
|
1611
1687
|
/* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden relative", children: /* @__PURE__ */ e(
|
|
1612
|
-
|
|
1688
|
+
hs,
|
|
1613
1689
|
{
|
|
1614
1690
|
hideDeletedMessages: !0,
|
|
1615
1691
|
hideNewMessageSeparator: !1,
|
|
1616
1692
|
messageActions: void 0
|
|
1617
1693
|
}
|
|
1618
1694
|
) }),
|
|
1619
|
-
|
|
1695
|
+
i == null ? void 0 : i(g),
|
|
1620
1696
|
/* @__PURE__ */ e(
|
|
1621
|
-
|
|
1697
|
+
xn,
|
|
1622
1698
|
{
|
|
1623
|
-
renderActions: () => n == null ? void 0 : n(
|
|
1699
|
+
renderActions: () => n == null ? void 0 : n(g)
|
|
1624
1700
|
}
|
|
1625
1701
|
)
|
|
1626
1702
|
] }) }),
|
|
1627
1703
|
/* @__PURE__ */ e(
|
|
1628
|
-
|
|
1704
|
+
Zs,
|
|
1629
1705
|
{
|
|
1630
|
-
dialogRef:
|
|
1631
|
-
onClose:
|
|
1632
|
-
participant:
|
|
1633
|
-
channel:
|
|
1634
|
-
followerStatusLabel:
|
|
1706
|
+
dialogRef: y,
|
|
1707
|
+
onClose: L,
|
|
1708
|
+
participant: I,
|
|
1709
|
+
channel: g,
|
|
1710
|
+
followerStatusLabel: C,
|
|
1635
1711
|
onLeaveConversation: l,
|
|
1636
|
-
onBlockParticipant:
|
|
1712
|
+
onBlockParticipant: u,
|
|
1637
1713
|
showDeleteConversation: r,
|
|
1638
|
-
onDeleteConversationClick:
|
|
1714
|
+
onDeleteConversationClick: d,
|
|
1639
1715
|
onBlockParticipantClick: x,
|
|
1640
|
-
onReportParticipantClick:
|
|
1716
|
+
onReportParticipantClick: o,
|
|
1641
1717
|
customProfileContent: a,
|
|
1642
1718
|
customChannelActions: _
|
|
1643
1719
|
}
|
|
1644
1720
|
)
|
|
1645
1721
|
] });
|
|
1646
|
-
},
|
|
1722
|
+
}, Et = z.memo(
|
|
1647
1723
|
({
|
|
1648
1724
|
channel: t,
|
|
1649
1725
|
onBack: s,
|
|
1650
1726
|
showBackButton: n = !1,
|
|
1651
|
-
renderMessageInputActions:
|
|
1727
|
+
renderMessageInputActions: i,
|
|
1652
1728
|
renderConversationFooter: l,
|
|
1653
|
-
onLeaveConversation:
|
|
1729
|
+
onLeaveConversation: u,
|
|
1654
1730
|
onBlockParticipant: r,
|
|
1655
|
-
className:
|
|
1656
|
-
CustomChannelEmptyState: x =
|
|
1657
|
-
showDeleteConversation:
|
|
1658
|
-
onDeleteConversationClick:
|
|
1659
|
-
onBlockParticipantClick:
|
|
1660
|
-
onReportParticipantClick:
|
|
1731
|
+
className: d,
|
|
1732
|
+
CustomChannelEmptyState: x = Tn,
|
|
1733
|
+
showDeleteConversation: o = !0,
|
|
1734
|
+
onDeleteConversationClick: h,
|
|
1735
|
+
onBlockParticipantClick: f,
|
|
1736
|
+
onReportParticipantClick: N,
|
|
1661
1737
|
dmAgentEnabled: a,
|
|
1662
1738
|
messageMetadata: _,
|
|
1663
1739
|
onMessageSent: w,
|
|
1664
|
-
showStarButton:
|
|
1665
|
-
chatbotVotingEnabled:
|
|
1666
|
-
renderChannelBanner:
|
|
1667
|
-
customProfileContent:
|
|
1668
|
-
customChannelActions:
|
|
1669
|
-
renderMessage:
|
|
1740
|
+
showStarButton: g = !1,
|
|
1741
|
+
chatbotVotingEnabled: y = !1,
|
|
1742
|
+
renderChannelBanner: I,
|
|
1743
|
+
customProfileContent: C,
|
|
1744
|
+
customChannelActions: S,
|
|
1745
|
+
renderMessage: L,
|
|
1670
1746
|
sendButton: v
|
|
1671
1747
|
}) => {
|
|
1672
1748
|
const m = A(
|
|
1673
|
-
async (
|
|
1749
|
+
async (b, T, M) => {
|
|
1674
1750
|
var V;
|
|
1675
|
-
const
|
|
1751
|
+
const P = ((V = t.data) == null ? void 0 : V.chatbot_paused) === !0, R = a && !P, B = {
|
|
1676
1752
|
...T,
|
|
1677
1753
|
...R && { silent: !0 },
|
|
1678
1754
|
..._ && {
|
|
@@ -1692,40 +1768,41 @@ const he = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1692
1768
|
return /* @__PURE__ */ e(
|
|
1693
1769
|
"div",
|
|
1694
1770
|
{
|
|
1695
|
-
className:
|
|
1771
|
+
className: O(
|
|
1696
1772
|
"messaging-channel-view h-full flex flex-col",
|
|
1697
|
-
|
|
1773
|
+
d
|
|
1698
1774
|
),
|
|
1699
1775
|
children: /* @__PURE__ */ e(
|
|
1700
|
-
|
|
1776
|
+
ds,
|
|
1701
1777
|
{
|
|
1702
1778
|
channel: t,
|
|
1703
|
-
MessageSystem:
|
|
1779
|
+
MessageSystem: In,
|
|
1704
1780
|
EmptyStateIndicator: x,
|
|
1705
1781
|
LoadingIndicator: De,
|
|
1706
|
-
DateSeparator:
|
|
1782
|
+
DateSeparator: Xs,
|
|
1783
|
+
TypingIndicator: kn,
|
|
1707
1784
|
doSendMessageRequest: m,
|
|
1708
1785
|
...v ? { SendButton: v } : {},
|
|
1709
1786
|
children: /* @__PURE__ */ e(
|
|
1710
|
-
|
|
1787
|
+
Rn,
|
|
1711
1788
|
{
|
|
1712
1789
|
onBack: s,
|
|
1713
1790
|
showBackButton: n,
|
|
1714
|
-
renderMessageInputActions:
|
|
1791
|
+
renderMessageInputActions: i,
|
|
1715
1792
|
renderConversationFooter: l,
|
|
1716
|
-
onLeaveConversation:
|
|
1793
|
+
onLeaveConversation: u,
|
|
1717
1794
|
onBlockParticipant: r,
|
|
1718
1795
|
CustomChannelEmptyState: x,
|
|
1719
|
-
showDeleteConversation:
|
|
1720
|
-
onDeleteConversationClick:
|
|
1721
|
-
onBlockParticipantClick:
|
|
1722
|
-
onReportParticipantClick:
|
|
1723
|
-
showStarButton:
|
|
1724
|
-
chatbotVotingEnabled:
|
|
1725
|
-
renderChannelBanner:
|
|
1726
|
-
customProfileContent:
|
|
1727
|
-
customChannelActions:
|
|
1728
|
-
renderMessage:
|
|
1796
|
+
showDeleteConversation: o,
|
|
1797
|
+
onDeleteConversationClick: h,
|
|
1798
|
+
onBlockParticipantClick: f,
|
|
1799
|
+
onReportParticipantClick: N,
|
|
1800
|
+
showStarButton: g,
|
|
1801
|
+
chatbotVotingEnabled: y,
|
|
1802
|
+
renderChannelBanner: I,
|
|
1803
|
+
customProfileContent: C,
|
|
1804
|
+
customChannelActions: S,
|
|
1805
|
+
renderMessage: L
|
|
1729
1806
|
}
|
|
1730
1807
|
)
|
|
1731
1808
|
}
|
|
@@ -1734,16 +1811,16 @@ const he = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1734
1811
|
);
|
|
1735
1812
|
}
|
|
1736
1813
|
);
|
|
1737
|
-
|
|
1738
|
-
function
|
|
1814
|
+
Et.displayName = "ChannelView";
|
|
1815
|
+
function Pn({
|
|
1739
1816
|
searchQuery: t,
|
|
1740
1817
|
setSearchQuery: s,
|
|
1741
1818
|
placeholder: n
|
|
1742
1819
|
}) {
|
|
1743
|
-
const
|
|
1744
|
-
return /* @__PURE__ */
|
|
1820
|
+
const i = X(null);
|
|
1821
|
+
return /* @__PURE__ */ c("div", { className: "relative", children: [
|
|
1745
1822
|
/* @__PURE__ */ e(
|
|
1746
|
-
|
|
1823
|
+
ws,
|
|
1747
1824
|
{
|
|
1748
1825
|
className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-stone",
|
|
1749
1826
|
weight: "bold"
|
|
@@ -1752,7 +1829,7 @@ function Mn({
|
|
|
1752
1829
|
/* @__PURE__ */ e(
|
|
1753
1830
|
"input",
|
|
1754
1831
|
{
|
|
1755
|
-
ref:
|
|
1832
|
+
ref: i,
|
|
1756
1833
|
type: "text",
|
|
1757
1834
|
placeholder: n,
|
|
1758
1835
|
value: t,
|
|
@@ -1761,12 +1838,12 @@ function Mn({
|
|
|
1761
1838
|
}
|
|
1762
1839
|
),
|
|
1763
1840
|
t && /* @__PURE__ */ e(
|
|
1764
|
-
|
|
1841
|
+
Nt,
|
|
1765
1842
|
{
|
|
1766
1843
|
label: "Clear search",
|
|
1767
1844
|
onClick: () => {
|
|
1768
1845
|
var l;
|
|
1769
|
-
s(""), (l =
|
|
1846
|
+
s(""), (l = i.current) == null || l.focus();
|
|
1770
1847
|
},
|
|
1771
1848
|
className: "absolute right-3 top-1/2 -translate-y-1/2 p-1 text-stone hover:text-charcoal",
|
|
1772
1849
|
children: /* @__PURE__ */ e(Re, { className: "h-4 w-4", weight: "bold" })
|
|
@@ -1774,122 +1851,122 @@ function Mn({
|
|
|
1774
1851
|
)
|
|
1775
1852
|
] });
|
|
1776
1853
|
}
|
|
1777
|
-
const
|
|
1854
|
+
const Ln = ({
|
|
1778
1855
|
participantSource: t,
|
|
1779
1856
|
onSelectParticipant: s,
|
|
1780
1857
|
onClose: n,
|
|
1781
|
-
existingParticipantIds:
|
|
1858
|
+
existingParticipantIds: i = /* @__PURE__ */ new Set(),
|
|
1782
1859
|
participantLabel: l = "participants",
|
|
1783
|
-
searchPlaceholder:
|
|
1860
|
+
searchPlaceholder: u = "Search participants...",
|
|
1784
1861
|
className: r
|
|
1785
1862
|
}) => {
|
|
1786
|
-
const { debug:
|
|
1863
|
+
const { debug: d } = Pe(), [x, o] = k(""), [h, f] = k([]), [N, a] = k(!1), [_, w] = k(null), [g, y] = k(
|
|
1787
1864
|
null
|
|
1788
|
-
),
|
|
1865
|
+
), I = X(!1);
|
|
1789
1866
|
q(() => {
|
|
1790
|
-
|
|
1867
|
+
I.current = !1;
|
|
1791
1868
|
}, [t]), q(() => {
|
|
1792
1869
|
if (t.loading) {
|
|
1793
|
-
|
|
1870
|
+
d && console.log(
|
|
1794
1871
|
"[ParticipantPicker] Waiting for participant source to finish loading..."
|
|
1795
1872
|
);
|
|
1796
1873
|
return;
|
|
1797
1874
|
}
|
|
1798
|
-
if (
|
|
1875
|
+
if (I.current) return;
|
|
1799
1876
|
(async () => {
|
|
1800
|
-
|
|
1877
|
+
d && console.log("[ParticipantPicker] Loading initial participants..."), a(!0), w(null);
|
|
1801
1878
|
try {
|
|
1802
1879
|
const m = await t.loadParticipants({
|
|
1803
1880
|
search: "",
|
|
1804
1881
|
// Load all participants initially
|
|
1805
1882
|
limit: 100
|
|
1806
1883
|
});
|
|
1807
|
-
|
|
1884
|
+
f(m.participants), I.current = !0, d && console.log(
|
|
1808
1885
|
"[ParticipantPicker] Participants loaded successfully:",
|
|
1809
1886
|
m.participants.length
|
|
1810
1887
|
);
|
|
1811
1888
|
} catch (m) {
|
|
1812
|
-
const
|
|
1813
|
-
w(
|
|
1889
|
+
const b = m instanceof Error ? m.message : "Failed to load participants";
|
|
1890
|
+
w(b), console.error("[ParticipantPicker] Failed to load participants:", m);
|
|
1814
1891
|
} finally {
|
|
1815
1892
|
a(!1);
|
|
1816
1893
|
}
|
|
1817
1894
|
})();
|
|
1818
|
-
}, [t,
|
|
1819
|
-
const
|
|
1820
|
-
var
|
|
1895
|
+
}, [t, d]);
|
|
1896
|
+
const C = h.filter((v) => !i.has(v.id)).filter((v) => {
|
|
1897
|
+
var b;
|
|
1821
1898
|
if (!x) return !0;
|
|
1822
1899
|
const m = x.toLowerCase();
|
|
1823
|
-
return v.name.toLowerCase().includes(m) || ((
|
|
1824
|
-
}),
|
|
1900
|
+
return v.name.toLowerCase().includes(m) || ((b = v.email) == null ? void 0 : b.toLowerCase().includes(m)) || !1;
|
|
1901
|
+
}), S = A(
|
|
1825
1902
|
async (v) => {
|
|
1826
|
-
if (!
|
|
1827
|
-
|
|
1903
|
+
if (!g) {
|
|
1904
|
+
y(v.id);
|
|
1828
1905
|
try {
|
|
1829
1906
|
await s(v);
|
|
1830
1907
|
} catch (m) {
|
|
1831
|
-
console.error("[ParticipantPicker] Failed to start chat:", m),
|
|
1908
|
+
console.error("[ParticipantPicker] Failed to start chat:", m), y(null);
|
|
1832
1909
|
}
|
|
1833
1910
|
}
|
|
1834
1911
|
},
|
|
1835
|
-
[s,
|
|
1836
|
-
),
|
|
1837
|
-
(v.key === "Enter" || v.key === " ") && (v.preventDefault(),
|
|
1912
|
+
[s, g]
|
|
1913
|
+
), L = (v, m) => {
|
|
1914
|
+
(v.key === "Enter" || v.key === " ") && (v.preventDefault(), S(m));
|
|
1838
1915
|
};
|
|
1839
|
-
return /* @__PURE__ */
|
|
1840
|
-
/* @__PURE__ */
|
|
1841
|
-
/* @__PURE__ */
|
|
1916
|
+
return /* @__PURE__ */ c("div", { className: O("flex flex-col h-full", r), children: [
|
|
1917
|
+
/* @__PURE__ */ c("div", { className: "px-4 py-4 border-b border-sand bg-chalk", children: [
|
|
1918
|
+
/* @__PURE__ */ c("div", { className: "flex items-center justify-between mb-3", children: [
|
|
1842
1919
|
/* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-charcoal", children: "Start a new Conversation" }),
|
|
1843
|
-
/* @__PURE__ */ e(
|
|
1920
|
+
/* @__PURE__ */ e(yt, { onClick: n })
|
|
1844
1921
|
] }),
|
|
1845
|
-
/* @__PURE__ */
|
|
1922
|
+
/* @__PURE__ */ c("p", { className: "text-xs text-stone mb-3", children: [
|
|
1846
1923
|
"Select a ",
|
|
1847
1924
|
l.slice(0, -1),
|
|
1848
1925
|
" to start messaging (",
|
|
1849
|
-
|
|
1926
|
+
C.length,
|
|
1850
1927
|
" available)",
|
|
1851
1928
|
t.totalCount !== void 0 && ` • ${t.totalCount} ${l} total`
|
|
1852
1929
|
] }),
|
|
1853
1930
|
/* @__PURE__ */ e(
|
|
1854
|
-
|
|
1931
|
+
Pn,
|
|
1855
1932
|
{
|
|
1856
1933
|
searchQuery: x,
|
|
1857
|
-
setSearchQuery:
|
|
1858
|
-
placeholder:
|
|
1934
|
+
setSearchQuery: o,
|
|
1935
|
+
placeholder: u
|
|
1859
1936
|
}
|
|
1860
1937
|
)
|
|
1861
1938
|
] }),
|
|
1862
|
-
_ && /* @__PURE__ */
|
|
1939
|
+
_ && /* @__PURE__ */ c("div", { className: "p-4 text-sm text-danger bg-danger-alt", children: [
|
|
1863
1940
|
"Error loading ",
|
|
1864
1941
|
l,
|
|
1865
1942
|
": ",
|
|
1866
1943
|
_
|
|
1867
1944
|
] }),
|
|
1868
|
-
/* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children:
|
|
1945
|
+
/* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: N && C.length === 0 ? /* @__PURE__ */ e("div", { className: "h-32 flex items-center justify-center", children: /* @__PURE__ */ c("div", { className: "flex items-center space-x-2", children: [
|
|
1869
1946
|
/* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
|
|
1870
|
-
/* @__PURE__ */
|
|
1947
|
+
/* @__PURE__ */ c("span", { className: "text-sm text-stone", children: [
|
|
1871
1948
|
"Loading ",
|
|
1872
1949
|
l,
|
|
1873
1950
|
"..."
|
|
1874
1951
|
] })
|
|
1875
|
-
] }) }) :
|
|
1876
|
-
/* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(
|
|
1877
|
-
/* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: x ? `No ${l} found` :
|
|
1878
|
-
/* @__PURE__ */ e("p", { className: "text-xs text-stone", children: x ? "Try a different search term" :
|
|
1879
|
-
] }) : /* @__PURE__ */
|
|
1880
|
-
|
|
1881
|
-
const m = v.name || v.email || v.id,
|
|
1952
|
+
] }) }) : C.length === 0 ? /* @__PURE__ */ c("div", { className: "p-6 text-center", children: [
|
|
1953
|
+
/* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(st, { className: "h-8 w-8 text-charcoal" }) }),
|
|
1954
|
+
/* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: x ? `No ${l} found` : h.length > 0 ? `Already chatting with all ${l}` : `No ${l} yet` }),
|
|
1955
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-stone", children: x ? "Try a different search term" : h.length > 0 ? `You have existing conversations with all your ${l}` : `${l.charAt(0).toUpperCase() + l.slice(1)} will appear here` })
|
|
1956
|
+
] }) : /* @__PURE__ */ c("ul", { className: "space-y-0", children: [
|
|
1957
|
+
C.map((v) => {
|
|
1958
|
+
const m = v.name || v.email || v.id, b = v.email && v.name ? v.email : v.phone;
|
|
1882
1959
|
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
|
|
1883
1960
|
"button",
|
|
1884
1961
|
{
|
|
1885
1962
|
type: "button",
|
|
1886
|
-
onClick: () =>
|
|
1887
|
-
onKeyDown: (T) =>
|
|
1963
|
+
onClick: () => S(v),
|
|
1964
|
+
onKeyDown: (T) => L(T, v),
|
|
1888
1965
|
className: "w-full px-4 py-3 hover:bg-sand transition-colors border-b border-sand text-left focus-ring",
|
|
1889
|
-
children: /* @__PURE__ */
|
|
1890
|
-
/* @__PURE__ */
|
|
1966
|
+
children: /* @__PURE__ */ c("div", { className: "flex items-center justify-between", children: [
|
|
1967
|
+
/* @__PURE__ */ c("div", { className: "flex items-center space-x-3 flex-1 min-w-0", children: [
|
|
1891
1968
|
/* @__PURE__ */ e(
|
|
1892
|
-
|
|
1969
|
+
ae,
|
|
1893
1970
|
{
|
|
1894
1971
|
id: v.id,
|
|
1895
1972
|
name: m,
|
|
@@ -1897,23 +1974,23 @@ const Dn = ({
|
|
|
1897
1974
|
size: 40
|
|
1898
1975
|
}
|
|
1899
1976
|
),
|
|
1900
|
-
/* @__PURE__ */
|
|
1977
|
+
/* @__PURE__ */ c("div", { className: "flex-1 min-w-0", children: [
|
|
1901
1978
|
/* @__PURE__ */ e("h4", { className: "text-sm font-medium text-charcoal truncate", children: m }),
|
|
1902
|
-
|
|
1979
|
+
b && /* @__PURE__ */ e("p", { className: "text-xs text-stone truncate", children: b })
|
|
1903
1980
|
] })
|
|
1904
1981
|
] }),
|
|
1905
|
-
/* @__PURE__ */ e("div", { className: "flex-shrink-0", children:
|
|
1982
|
+
/* @__PURE__ */ e("div", { className: "flex-shrink-0", children: g === v.id ? /* @__PURE__ */ e(ke, { className: "h-5 w-5 text-primary animate-spin" }) : /* @__PURE__ */ e(st, { className: "h-5 w-5 text-stone" }) })
|
|
1906
1983
|
] })
|
|
1907
1984
|
}
|
|
1908
1985
|
) }, v.id);
|
|
1909
1986
|
}),
|
|
1910
|
-
|
|
1987
|
+
N && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ c("div", { className: "flex items-center space-x-2", children: [
|
|
1911
1988
|
/* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
|
|
1912
1989
|
/* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading more..." })
|
|
1913
1990
|
] }) })
|
|
1914
1991
|
] }) })
|
|
1915
1992
|
] });
|
|
1916
|
-
},
|
|
1993
|
+
}, Fn = ({ className: t }) => /* @__PURE__ */ c(
|
|
1917
1994
|
"svg",
|
|
1918
1995
|
{
|
|
1919
1996
|
width: "140",
|
|
@@ -1923,7 +2000,7 @@ const Dn = ({
|
|
|
1923
2000
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1924
2001
|
className: t,
|
|
1925
2002
|
children: [
|
|
1926
|
-
/* @__PURE__ */
|
|
2003
|
+
/* @__PURE__ */ c("g", { clipPath: "url(#clip0_empty_state)", children: [
|
|
1927
2004
|
/* @__PURE__ */ e(
|
|
1928
2005
|
"path",
|
|
1929
2006
|
{
|
|
@@ -1952,7 +2029,7 @@ const Dn = ({
|
|
|
1952
2029
|
fill: "white"
|
|
1953
2030
|
}
|
|
1954
2031
|
),
|
|
1955
|
-
/* @__PURE__ */
|
|
2032
|
+
/* @__PURE__ */ c("g", { filter: "url(#filter0_empty_state)", children: [
|
|
1956
2033
|
/* @__PURE__ */ e(
|
|
1957
2034
|
"path",
|
|
1958
2035
|
{
|
|
@@ -1992,8 +2069,8 @@ const Dn = ({
|
|
|
1992
2069
|
}
|
|
1993
2070
|
)
|
|
1994
2071
|
] }),
|
|
1995
|
-
/* @__PURE__ */
|
|
1996
|
-
/* @__PURE__ */
|
|
2072
|
+
/* @__PURE__ */ c("defs", { children: [
|
|
2073
|
+
/* @__PURE__ */ c(
|
|
1997
2074
|
"filter",
|
|
1998
2075
|
{
|
|
1999
2076
|
id: "filter0_empty_state",
|
|
@@ -2047,17 +2124,17 @@ const Dn = ({
|
|
|
2047
2124
|
] })
|
|
2048
2125
|
]
|
|
2049
2126
|
}
|
|
2050
|
-
),
|
|
2051
|
-
({ hasChannels: t, channelsLoaded: s }) => /* @__PURE__ */ e("div", { className: "messaging-empty-state flex items-center justify-center h-full p-8 text-balance", children: /* @__PURE__ */
|
|
2052
|
-
/* @__PURE__ */ e(
|
|
2053
|
-
s && !t && /* @__PURE__ */
|
|
2127
|
+
), St = z.memo(
|
|
2128
|
+
({ hasChannels: t, channelsLoaded: s }) => /* @__PURE__ */ e("div", { className: "messaging-empty-state flex items-center justify-center h-full p-8 text-balance", children: /* @__PURE__ */ c("div", { className: "flex flex-col items-center max-w-sm text-center", children: [
|
|
2129
|
+
/* @__PURE__ */ e(Fn, {}),
|
|
2130
|
+
s && !t && /* @__PURE__ */ c("div", { className: "mt-8", children: [
|
|
2054
2131
|
/* @__PURE__ */ e("h2", { className: "font-medium text-black text-[18px] mb-2", children: "Your inbox is empty" }),
|
|
2055
2132
|
/* @__PURE__ */ e("p", { className: "text-[#676B5F] text-sm mb-6", children: "Share with your followers to start receiving messages" })
|
|
2056
2133
|
] })
|
|
2057
2134
|
] }) })
|
|
2058
2135
|
);
|
|
2059
|
-
|
|
2060
|
-
const Te = z.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */
|
|
2136
|
+
St.displayName = "EmptyState";
|
|
2137
|
+
const Te = z.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */ c("div", { className: "text-center max-w-sm", children: [
|
|
2061
2138
|
/* @__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: "⚠️" }) }),
|
|
2062
2139
|
/* @__PURE__ */ e("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
|
|
2063
2140
|
/* @__PURE__ */ e("p", { className: "text-stone text-sm mb-6", children: t }),
|
|
@@ -2072,45 +2149,45 @@ const Te = z.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { clas
|
|
|
2072
2149
|
)
|
|
2073
2150
|
] }) }));
|
|
2074
2151
|
Te.displayName = "ErrorState";
|
|
2075
|
-
const
|
|
2152
|
+
const la = ({
|
|
2076
2153
|
capabilities: t = {},
|
|
2077
2154
|
className: s,
|
|
2078
2155
|
renderMessageInputActions: n,
|
|
2079
|
-
renderConversationFooter:
|
|
2156
|
+
renderConversationFooter: i,
|
|
2080
2157
|
onChannelSelect: l,
|
|
2081
|
-
onParticipantSelect:
|
|
2158
|
+
onParticipantSelect: u,
|
|
2082
2159
|
initialParticipantFilter: r,
|
|
2083
|
-
initialParticipantData:
|
|
2160
|
+
initialParticipantData: d,
|
|
2084
2161
|
CustomChannelEmptyState: x,
|
|
2085
|
-
showChannelList:
|
|
2086
|
-
filters:
|
|
2087
|
-
channelRenderFilterFn:
|
|
2088
|
-
channelListCustomEmptyStateIndicator:
|
|
2162
|
+
showChannelList: o = !0,
|
|
2163
|
+
filters: h,
|
|
2164
|
+
channelRenderFilterFn: f,
|
|
2165
|
+
channelListCustomEmptyStateIndicator: N,
|
|
2089
2166
|
onDeleteConversationClick: a,
|
|
2090
2167
|
onBlockParticipantClick: _,
|
|
2091
2168
|
onReportParticipantClick: w,
|
|
2092
|
-
dmAgentEnabled:
|
|
2093
|
-
messageMetadata:
|
|
2094
|
-
onMessageSent:
|
|
2095
|
-
showStarButton:
|
|
2096
|
-
chatbotVotingEnabled:
|
|
2097
|
-
renderMessagePreview:
|
|
2169
|
+
dmAgentEnabled: g,
|
|
2170
|
+
messageMetadata: y,
|
|
2171
|
+
onMessageSent: I,
|
|
2172
|
+
showStarButton: C = !1,
|
|
2173
|
+
chatbotVotingEnabled: S = !1,
|
|
2174
|
+
renderMessagePreview: L,
|
|
2098
2175
|
renderChannelBanner: v,
|
|
2099
2176
|
customProfileContent: m,
|
|
2100
|
-
customChannelActions:
|
|
2177
|
+
customChannelActions: b,
|
|
2101
2178
|
renderMessage: T,
|
|
2102
2179
|
sendButton: M
|
|
2103
2180
|
}) => {
|
|
2104
2181
|
const {
|
|
2105
|
-
service:
|
|
2182
|
+
service: P,
|
|
2106
2183
|
client: R,
|
|
2107
2184
|
isConnected: B,
|
|
2108
2185
|
isLoading: Q,
|
|
2109
2186
|
error: J,
|
|
2110
2187
|
refreshConnection: V,
|
|
2111
2188
|
debug: F
|
|
2112
|
-
} =
|
|
2113
|
-
participantSource:
|
|
2189
|
+
} = Fs(), [H, Z] = k(null), [re, K] = k(!1), [p, E] = k(!1), [U, j] = k(!1), [ee, le] = k(/* @__PURE__ */ new Set()), [pe, Le] = k(0), [Y, te] = k(!1), [xe, ie] = k(null), he = X(null), {
|
|
2190
|
+
participantSource: oe,
|
|
2114
2191
|
participantLabel: ve = "participants",
|
|
2115
2192
|
showDeleteConversation: ge = !0
|
|
2116
2193
|
} = t, we = z.useMemo(() => {
|
|
@@ -2124,9 +2201,9 @@ const aa = ({
|
|
|
2124
2201
|
hidden: !1
|
|
2125
2202
|
}
|
|
2126
2203
|
},
|
|
2127
|
-
...
|
|
2204
|
+
...h
|
|
2128
2205
|
};
|
|
2129
|
-
}, [
|
|
2206
|
+
}, [h, R == null ? void 0 : R.userID]), ce = X(null), ne = A(async () => {
|
|
2130
2207
|
if (!R || !B) return;
|
|
2131
2208
|
const D = R.userID;
|
|
2132
2209
|
if (D)
|
|
@@ -2142,12 +2219,12 @@ const aa = ({
|
|
|
2142
2219
|
), $ = /* @__PURE__ */ new Set();
|
|
2143
2220
|
W.forEach((G) => {
|
|
2144
2221
|
const Fe = G.state.members;
|
|
2145
|
-
Object.values(Fe).forEach((
|
|
2146
|
-
var
|
|
2147
|
-
const Ae = (
|
|
2222
|
+
Object.values(Fe).forEach((Mt) => {
|
|
2223
|
+
var Xe;
|
|
2224
|
+
const Ae = (Xe = Mt.user) == null ? void 0 : Xe.id;
|
|
2148
2225
|
Ae && Ae !== D && $.add(Ae);
|
|
2149
2226
|
});
|
|
2150
|
-
}), le((G) => G.size === $.size && [...G].every((Fe) => $.has(Fe)) ? G : $), K(W.length > 0),
|
|
2227
|
+
}), le((G) => G.size === $.size && [...G].every((Fe) => $.has(Fe)) ? G : $), K(W.length > 0), E(!0), ce.current = D, F && console.log("[MessagingShell] Channels synced successfully:", {
|
|
2151
2228
|
channelCount: W.length,
|
|
2152
2229
|
memberCount: $.size
|
|
2153
2230
|
});
|
|
@@ -2178,23 +2255,23 @@ const aa = ({
|
|
|
2178
2255
|
{ limit: 1 }
|
|
2179
2256
|
);
|
|
2180
2257
|
if ($.length > 0)
|
|
2181
|
-
Z($[0]), te(!0),
|
|
2258
|
+
Z($[0]), te(!0), ie(null), l && l($[0]), F && console.log(
|
|
2182
2259
|
"[MessagingShell] Initial conversation loaded:",
|
|
2183
2260
|
$[0].id
|
|
2184
2261
|
);
|
|
2185
|
-
else if (
|
|
2262
|
+
else if (d && P) {
|
|
2186
2263
|
F && console.log(
|
|
2187
2264
|
"[MessagingShell] No conversation found, creating one for:",
|
|
2188
|
-
|
|
2265
|
+
d
|
|
2189
2266
|
);
|
|
2190
2267
|
try {
|
|
2191
|
-
const G = await
|
|
2192
|
-
id:
|
|
2193
|
-
name:
|
|
2194
|
-
email:
|
|
2195
|
-
phone:
|
|
2268
|
+
const G = await P.startChannelWithParticipant({
|
|
2269
|
+
id: d.id,
|
|
2270
|
+
name: d.name,
|
|
2271
|
+
email: d.email,
|
|
2272
|
+
phone: d.phone
|
|
2196
2273
|
});
|
|
2197
|
-
Z(G), te(!0),
|
|
2274
|
+
Z(G), te(!0), ie(null), l && l(G), F && console.log(
|
|
2198
2275
|
"[MessagingShell] Channel created and loaded:",
|
|
2199
2276
|
G.id
|
|
2200
2277
|
);
|
|
@@ -2202,10 +2279,10 @@ const aa = ({
|
|
|
2202
2279
|
console.error(
|
|
2203
2280
|
"[MessagingShell] Failed to create conversation:",
|
|
2204
2281
|
G
|
|
2205
|
-
),
|
|
2282
|
+
), ie("Failed to create conversation");
|
|
2206
2283
|
}
|
|
2207
2284
|
} else
|
|
2208
|
-
|
|
2285
|
+
ie(
|
|
2209
2286
|
"No conversation found with this account"
|
|
2210
2287
|
), F && console.log(
|
|
2211
2288
|
"[MessagingShell] No conversation found for:",
|
|
@@ -2215,15 +2292,15 @@ const aa = ({
|
|
|
2215
2292
|
console.error(
|
|
2216
2293
|
"[MessagingShell] Failed to load initial conversation:",
|
|
2217
2294
|
$
|
|
2218
|
-
),
|
|
2295
|
+
), ie("Failed to load conversation");
|
|
2219
2296
|
}
|
|
2220
2297
|
})();
|
|
2221
2298
|
}, [
|
|
2222
2299
|
r,
|
|
2223
|
-
|
|
2300
|
+
d,
|
|
2224
2301
|
R,
|
|
2225
2302
|
B,
|
|
2226
|
-
|
|
2303
|
+
P,
|
|
2227
2304
|
F,
|
|
2228
2305
|
l
|
|
2229
2306
|
]);
|
|
@@ -2237,13 +2314,13 @@ const aa = ({
|
|
|
2237
2314
|
}, [Y]), Ce = A(
|
|
2238
2315
|
async (D) => {
|
|
2239
2316
|
var W;
|
|
2240
|
-
if (
|
|
2317
|
+
if (P)
|
|
2241
2318
|
try {
|
|
2242
2319
|
F && console.log(
|
|
2243
2320
|
"[MessagingShell] Starting conversation with:",
|
|
2244
2321
|
D.id
|
|
2245
2322
|
);
|
|
2246
|
-
const $ = await
|
|
2323
|
+
const $ = await P.startChannelWithParticipant({
|
|
2247
2324
|
id: D.id,
|
|
2248
2325
|
name: D.name,
|
|
2249
2326
|
email: D.email,
|
|
@@ -2254,18 +2331,18 @@ const aa = ({
|
|
|
2254
2331
|
} catch (G) {
|
|
2255
2332
|
console.warn("[MessagingShell] Failed to unhide channel:", G);
|
|
2256
2333
|
}
|
|
2257
|
-
Z($), j(!1), (W =
|
|
2334
|
+
Z($), j(!1), (W = he.current) == null || W.close(), u == null || u(D);
|
|
2258
2335
|
} catch ($) {
|
|
2259
2336
|
console.error("[MessagingShell] Failed to start conversation:", $);
|
|
2260
2337
|
}
|
|
2261
2338
|
},
|
|
2262
|
-
[
|
|
2339
|
+
[P, u, F]
|
|
2263
2340
|
), de = A(() => {
|
|
2264
2341
|
var D;
|
|
2265
|
-
j(!1), (D =
|
|
2342
|
+
j(!1), (D = he.current) == null || D.close();
|
|
2266
2343
|
}, []), _e = A(
|
|
2267
2344
|
(D) => {
|
|
2268
|
-
D.target ===
|
|
2345
|
+
D.target === he.current && de();
|
|
2269
2346
|
},
|
|
2270
2347
|
[de]
|
|
2271
2348
|
), Ee = A(
|
|
@@ -2279,43 +2356,43 @@ const aa = ({
|
|
|
2279
2356
|
},
|
|
2280
2357
|
[ne, F]
|
|
2281
2358
|
), ue = !!H;
|
|
2282
|
-
return Q ? /* @__PURE__ */ e("div", { className:
|
|
2359
|
+
return Q ? /* @__PURE__ */ e("div", { className: O("h-full", s), children: /* @__PURE__ */ e(De, {}) }) : J ? /* @__PURE__ */ e("div", { className: O("h-full", s), children: /* @__PURE__ */ e(Te, { message: J, onBack: V }) }) : !B || !R ? /* @__PURE__ */ e("div", { className: O("h-full", s), children: /* @__PURE__ */ e(
|
|
2283
2360
|
Te,
|
|
2284
2361
|
{
|
|
2285
2362
|
message: "Not connected to messaging service",
|
|
2286
2363
|
onBack: V
|
|
2287
2364
|
}
|
|
2288
|
-
) }) : xe ? /* @__PURE__ */ e("div", { className:
|
|
2365
|
+
) }) : xe ? /* @__PURE__ */ e("div", { className: O("h-full", s), children: /* @__PURE__ */ e(Te, { message: xe }) }) : /* @__PURE__ */ c(
|
|
2289
2366
|
"div",
|
|
2290
2367
|
{
|
|
2291
|
-
className:
|
|
2368
|
+
className: O(
|
|
2292
2369
|
"messaging-shell h-full bg-background-primary overflow-hidden",
|
|
2293
2370
|
s
|
|
2294
2371
|
),
|
|
2295
2372
|
children: [
|
|
2296
|
-
/* @__PURE__ */
|
|
2373
|
+
/* @__PURE__ */ c("div", { className: "flex h-full min-h-0", children: [
|
|
2297
2374
|
/* @__PURE__ */ e(
|
|
2298
2375
|
"div",
|
|
2299
2376
|
{
|
|
2300
|
-
className:
|
|
2377
|
+
className: O(
|
|
2301
2378
|
"messaging-channel-list-sidebar min-h-0 min-w-0 lg:flex lg:flex-col",
|
|
2302
2379
|
{
|
|
2303
|
-
"!hidden":
|
|
2380
|
+
"!hidden": o === !1 || Y,
|
|
2304
2381
|
// Hide on mobile when channel selected, show on desktop with consistent wide width
|
|
2305
|
-
"hidden lg:flex lg:flex-1 lg:max-w-2xl":
|
|
2382
|
+
"hidden lg:flex lg:flex-1 lg:max-w-2xl": o !== !1 && !Y && ue,
|
|
2306
2383
|
// Show on mobile when no channel selected, use same wide width on desktop
|
|
2307
|
-
"flex flex-col w-full lg:flex-1 lg:max-w-2xl":
|
|
2384
|
+
"flex flex-col w-full lg:flex-1 lg:max-w-2xl": o !== !1 && !Y && !ue
|
|
2308
2385
|
}
|
|
2309
2386
|
),
|
|
2310
2387
|
children: /* @__PURE__ */ e(
|
|
2311
|
-
|
|
2388
|
+
wt,
|
|
2312
2389
|
{
|
|
2313
2390
|
onChannelSelect: Ne,
|
|
2314
2391
|
selectedChannel: H || void 0,
|
|
2315
2392
|
filters: we,
|
|
2316
|
-
channelRenderFilterFn:
|
|
2317
|
-
customEmptyStateIndicator:
|
|
2318
|
-
renderMessagePreview:
|
|
2393
|
+
channelRenderFilterFn: f,
|
|
2394
|
+
customEmptyStateIndicator: N,
|
|
2395
|
+
renderMessagePreview: L
|
|
2319
2396
|
}
|
|
2320
2397
|
)
|
|
2321
2398
|
}
|
|
@@ -2323,7 +2400,7 @@ const aa = ({
|
|
|
2323
2400
|
/* @__PURE__ */ e(
|
|
2324
2401
|
"div",
|
|
2325
2402
|
{
|
|
2326
|
-
className:
|
|
2403
|
+
className: O(
|
|
2327
2404
|
"messaging-conversation-view flex-1 flex-col min-w-0 min-h-0",
|
|
2328
2405
|
{
|
|
2329
2406
|
// In direct conversation mode (or waiting for it), always show (full width)
|
|
@@ -2333,13 +2410,13 @@ const aa = ({
|
|
|
2333
2410
|
}
|
|
2334
2411
|
),
|
|
2335
2412
|
children: H ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
|
|
2336
|
-
|
|
2413
|
+
Et,
|
|
2337
2414
|
{
|
|
2338
2415
|
channel: H,
|
|
2339
2416
|
onBack: ye,
|
|
2340
2417
|
showBackButton: !Y,
|
|
2341
2418
|
renderMessageInputActions: n,
|
|
2342
|
-
renderConversationFooter:
|
|
2419
|
+
renderConversationFooter: i,
|
|
2343
2420
|
renderChannelBanner: v,
|
|
2344
2421
|
onLeaveConversation: Ee,
|
|
2345
2422
|
onBlockParticipant: Se,
|
|
@@ -2348,13 +2425,13 @@ const aa = ({
|
|
|
2348
2425
|
onDeleteConversationClick: a,
|
|
2349
2426
|
onBlockParticipantClick: _,
|
|
2350
2427
|
onReportParticipantClick: w,
|
|
2351
|
-
dmAgentEnabled:
|
|
2352
|
-
messageMetadata:
|
|
2353
|
-
onMessageSent:
|
|
2354
|
-
showStarButton:
|
|
2355
|
-
chatbotVotingEnabled:
|
|
2428
|
+
dmAgentEnabled: g,
|
|
2429
|
+
messageMetadata: y,
|
|
2430
|
+
onMessageSent: I,
|
|
2431
|
+
showStarButton: C,
|
|
2432
|
+
chatbotVotingEnabled: S,
|
|
2356
2433
|
customProfileContent: m,
|
|
2357
|
-
customChannelActions:
|
|
2434
|
+
customChannelActions: b,
|
|
2358
2435
|
renderMessage: T,
|
|
2359
2436
|
sendButton: M
|
|
2360
2437
|
},
|
|
@@ -2363,27 +2440,27 @@ const aa = ({
|
|
|
2363
2440
|
// Show loading while creating/loading direct conversation channel
|
|
2364
2441
|
/* @__PURE__ */ e(De, {})
|
|
2365
2442
|
) : /* @__PURE__ */ e(
|
|
2366
|
-
|
|
2443
|
+
St,
|
|
2367
2444
|
{
|
|
2368
|
-
hasChannels:
|
|
2369
|
-
channelsLoaded:
|
|
2445
|
+
hasChannels: re,
|
|
2446
|
+
channelsLoaded: p
|
|
2370
2447
|
}
|
|
2371
2448
|
)
|
|
2372
2449
|
}
|
|
2373
2450
|
)
|
|
2374
2451
|
] }),
|
|
2375
|
-
|
|
2452
|
+
oe && // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
|
|
2376
2453
|
/* @__PURE__ */ e(
|
|
2377
2454
|
"dialog",
|
|
2378
2455
|
{
|
|
2379
|
-
ref:
|
|
2456
|
+
ref: he,
|
|
2380
2457
|
className: "mes-dialog",
|
|
2381
2458
|
onClick: _e,
|
|
2382
2459
|
onClose: de,
|
|
2383
2460
|
children: /* @__PURE__ */ e("div", { className: "h-full w-full bg-white shadow-max-elevation-light", children: /* @__PURE__ */ e(
|
|
2384
|
-
|
|
2461
|
+
Ln,
|
|
2385
2462
|
{
|
|
2386
|
-
participantSource:
|
|
2463
|
+
participantSource: oe,
|
|
2387
2464
|
onSelectParticipant: Ce,
|
|
2388
2465
|
onClose: de,
|
|
2389
2466
|
existingParticipantIds: ee,
|
|
@@ -2397,11 +2474,11 @@ const aa = ({
|
|
|
2397
2474
|
]
|
|
2398
2475
|
}
|
|
2399
2476
|
);
|
|
2400
|
-
},
|
|
2477
|
+
}, An = ({
|
|
2401
2478
|
question: t,
|
|
2402
2479
|
onClick: s,
|
|
2403
2480
|
loading: n = !1,
|
|
2404
|
-
className:
|
|
2481
|
+
className: i
|
|
2405
2482
|
}) => /* @__PURE__ */ e(
|
|
2406
2483
|
"button",
|
|
2407
2484
|
{
|
|
@@ -2409,46 +2486,46 @@ const aa = ({
|
|
|
2409
2486
|
onClick: s,
|
|
2410
2487
|
disabled: n,
|
|
2411
2488
|
style: { backgroundColor: "#E6E5E3" },
|
|
2412
|
-
className:
|
|
2489
|
+
className: O(
|
|
2413
2490
|
"w-full text-center p-4 rounded-xl text-charcoal font-medium transition-colors focus-ring",
|
|
2414
2491
|
{
|
|
2415
2492
|
"hover:brightness-95 active:brightness-90": !n,
|
|
2416
2493
|
"opacity-50 cursor-not-allowed": n
|
|
2417
2494
|
},
|
|
2418
|
-
|
|
2495
|
+
i
|
|
2419
2496
|
),
|
|
2420
2497
|
children: t
|
|
2421
2498
|
}
|
|
2422
|
-
),
|
|
2499
|
+
), oa = ({
|
|
2423
2500
|
faqs: t,
|
|
2424
2501
|
onFaqClick: s,
|
|
2425
2502
|
loadingFaqId: n,
|
|
2426
|
-
headerText:
|
|
2503
|
+
headerText: i,
|
|
2427
2504
|
className: l,
|
|
2428
|
-
avatarImage:
|
|
2505
|
+
avatarImage: u,
|
|
2429
2506
|
avatarName: r
|
|
2430
2507
|
}) => {
|
|
2431
|
-
const
|
|
2432
|
-
return
|
|
2433
|
-
(
|
|
2434
|
-
|
|
2508
|
+
const d = t.filter((x) => x.enabled).sort((x, o) => (x.order ?? 0) - (o.order ?? 0));
|
|
2509
|
+
return d.length === 0 ? null : /* @__PURE__ */ e("div", { className: l, children: /* @__PURE__ */ c("div", { className: "flex gap-3 items-end", children: [
|
|
2510
|
+
(u || r) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
|
|
2511
|
+
ae,
|
|
2435
2512
|
{
|
|
2436
2513
|
id: r || "account",
|
|
2437
2514
|
name: r || "Account",
|
|
2438
|
-
image:
|
|
2515
|
+
image: u,
|
|
2439
2516
|
size: 24,
|
|
2440
2517
|
shape: "circle"
|
|
2441
2518
|
}
|
|
2442
2519
|
) }),
|
|
2443
|
-
/* @__PURE__ */
|
|
2520
|
+
/* @__PURE__ */ c(
|
|
2444
2521
|
"div",
|
|
2445
2522
|
{
|
|
2446
2523
|
className: "flex-1 flex flex-col gap-3 rounded-lg p-4",
|
|
2447
2524
|
style: { backgroundColor: "#F1F0EE" },
|
|
2448
2525
|
children: [
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2526
|
+
i && /* @__PURE__ */ e("p", { className: "text-md text-charcoal mb-4", children: i }),
|
|
2527
|
+
d.map((x) => /* @__PURE__ */ e(
|
|
2528
|
+
An,
|
|
2452
2529
|
{
|
|
2453
2530
|
question: x.question,
|
|
2454
2531
|
onClick: () => s(x.id),
|
|
@@ -2460,7 +2537,7 @@ const aa = ({
|
|
|
2460
2537
|
}
|
|
2461
2538
|
)
|
|
2462
2539
|
] }) });
|
|
2463
|
-
},
|
|
2540
|
+
}, On = [
|
|
2464
2541
|
[/pdf/, "pdf"],
|
|
2465
2542
|
[/wordprocessingml|msword|\.doc/, "doc"],
|
|
2466
2543
|
[/spreadsheetml|ms-excel|\.xls/, "xls"],
|
|
@@ -2470,125 +2547,125 @@ const aa = ({
|
|
|
2470
2547
|
[/plain|rtf/, "text"],
|
|
2471
2548
|
[/markdown/, "markdown"]
|
|
2472
2549
|
];
|
|
2473
|
-
function
|
|
2550
|
+
function qe(t) {
|
|
2474
2551
|
return t.startsWith("video/") ? "video" : t.startsWith("audio/") ? "audio" : t.startsWith("image/") ? "image" : "document";
|
|
2475
2552
|
}
|
|
2476
|
-
function
|
|
2477
|
-
const s =
|
|
2553
|
+
function Un(t) {
|
|
2554
|
+
const s = On.find(
|
|
2478
2555
|
([n]) => n.test(t)
|
|
2479
2556
|
);
|
|
2480
2557
|
return s ? s[1] : "generic";
|
|
2481
2558
|
}
|
|
2482
|
-
const
|
|
2483
|
-
video:
|
|
2484
|
-
audio:
|
|
2485
|
-
image:
|
|
2486
|
-
document:
|
|
2487
|
-
},
|
|
2488
|
-
pdf:
|
|
2489
|
-
doc:
|
|
2490
|
-
xls:
|
|
2491
|
-
csv:
|
|
2492
|
-
ppt:
|
|
2493
|
-
zip:
|
|
2494
|
-
text:
|
|
2495
|
-
markdown:
|
|
2496
|
-
generic:
|
|
2559
|
+
const $n = {
|
|
2560
|
+
video: Cs,
|
|
2561
|
+
audio: ys,
|
|
2562
|
+
image: Ns,
|
|
2563
|
+
document: ht
|
|
2564
|
+
}, zn = {
|
|
2565
|
+
pdf: Ds,
|
|
2566
|
+
doc: Ms,
|
|
2567
|
+
xls: Ts,
|
|
2568
|
+
csv: ks,
|
|
2569
|
+
ppt: Is,
|
|
2570
|
+
zip: Ss,
|
|
2571
|
+
text: Es,
|
|
2572
|
+
markdown: _s,
|
|
2573
|
+
generic: ht
|
|
2497
2574
|
};
|
|
2498
|
-
function
|
|
2499
|
-
const s =
|
|
2500
|
-
return s !== "document" ?
|
|
2575
|
+
function Bn(t) {
|
|
2576
|
+
const s = qe(t);
|
|
2577
|
+
return s !== "document" ? $n[s] : zn[Un(t)];
|
|
2501
2578
|
}
|
|
2502
|
-
function
|
|
2503
|
-
return z.createElement(
|
|
2579
|
+
function Ze(t, s) {
|
|
2580
|
+
return z.createElement(Bn(t), s);
|
|
2504
2581
|
}
|
|
2505
|
-
const
|
|
2582
|
+
const jn = (t) => {
|
|
2506
2583
|
var s, n;
|
|
2507
2584
|
return "touches" in t ? ((s = t.touches[0]) == null ? void 0 : s.clientX) ?? ((n = t.changedTouches[0]) == null ? void 0 : n.clientX) ?? 0 : t.clientX;
|
|
2508
|
-
},
|
|
2585
|
+
}, He = ({
|
|
2509
2586
|
source: t,
|
|
2510
2587
|
mimeType: s,
|
|
2511
2588
|
poster: n,
|
|
2512
|
-
autoPlay:
|
|
2589
|
+
autoPlay: i = !1,
|
|
2513
2590
|
playing: l,
|
|
2514
|
-
loop:
|
|
2591
|
+
loop: u = !1,
|
|
2515
2592
|
controls: r = !0,
|
|
2516
|
-
showProgress:
|
|
2593
|
+
showProgress: d = !1,
|
|
2517
2594
|
muted: x = !1,
|
|
2518
|
-
onContainerClick:
|
|
2595
|
+
onContainerClick: o
|
|
2519
2596
|
}) => {
|
|
2520
|
-
const
|
|
2521
|
-
|
|
2522
|
-
}, []), V = A((
|
|
2523
|
-
const
|
|
2524
|
-
if (!
|
|
2525
|
-
const
|
|
2597
|
+
const h = qe(s), f = X(null), N = X(null), a = X(null), _ = X(l), [w, g] = k(i), [y, I] = k(0), [C, S] = k(!1), [L, v] = k(!1), [m, b] = k(!1), [T, M] = k(!1), [P, R] = k(!0), [B, Q] = k(null), J = A(() => {
|
|
2598
|
+
b(!1), g(!0);
|
|
2599
|
+
}, []), V = A((p) => {
|
|
2600
|
+
const E = N.current;
|
|
2601
|
+
if (!E) return 0;
|
|
2602
|
+
const U = E.getBoundingClientRect();
|
|
2526
2603
|
return Math.max(
|
|
2527
2604
|
0,
|
|
2528
|
-
Math.min(1, (
|
|
2605
|
+
Math.min(1, (jn(p) - U.left) / U.width)
|
|
2529
2606
|
);
|
|
2530
|
-
}, []), F = A((
|
|
2531
|
-
const
|
|
2532
|
-
|
|
2533
|
-
}, []), H = (
|
|
2534
|
-
|
|
2535
|
-
const
|
|
2536
|
-
|
|
2607
|
+
}, []), F = A((p) => {
|
|
2608
|
+
const E = f.current;
|
|
2609
|
+
E && E.duration && (E.currentTime = p * E.duration);
|
|
2610
|
+
}, []), H = (p) => {
|
|
2611
|
+
p.stopPropagation(), S(!0);
|
|
2612
|
+
const E = V(p);
|
|
2613
|
+
I(E), F(E);
|
|
2537
2614
|
};
|
|
2538
2615
|
q(() => {
|
|
2539
|
-
l !== void 0 && l !== _.current && (_.current = l,
|
|
2616
|
+
l !== void 0 && l !== _.current && (_.current = l, g(l));
|
|
2540
2617
|
}, [l]), q(() => {
|
|
2541
2618
|
if (!w) {
|
|
2542
2619
|
a.current !== null && (cancelAnimationFrame(a.current), a.current = null);
|
|
2543
2620
|
return;
|
|
2544
2621
|
}
|
|
2545
|
-
const
|
|
2546
|
-
const
|
|
2547
|
-
|
|
2622
|
+
const p = () => {
|
|
2623
|
+
const E = f.current;
|
|
2624
|
+
E && E.duration && !C && I(E.currentTime / E.duration), a.current = requestAnimationFrame(p);
|
|
2548
2625
|
};
|
|
2549
|
-
return a.current = requestAnimationFrame(
|
|
2626
|
+
return a.current = requestAnimationFrame(p), () => {
|
|
2550
2627
|
a.current !== null && cancelAnimationFrame(a.current);
|
|
2551
2628
|
};
|
|
2552
|
-
}, [w,
|
|
2553
|
-
const
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
}) :
|
|
2629
|
+
}, [w, C]), q(() => {
|
|
2630
|
+
const p = f.current;
|
|
2631
|
+
p && (w ? p.play().catch((E) => {
|
|
2632
|
+
g(!1), b(!0);
|
|
2633
|
+
}) : p.pause());
|
|
2557
2634
|
}, [w]), q(() => {
|
|
2558
|
-
if (!
|
|
2559
|
-
const
|
|
2560
|
-
|
|
2635
|
+
if (!C) return;
|
|
2636
|
+
const p = (U) => I(V(U)), E = (U) => {
|
|
2637
|
+
S(!1), F(V(U));
|
|
2561
2638
|
};
|
|
2562
|
-
return window.addEventListener("mousemove",
|
|
2563
|
-
window.removeEventListener("mousemove",
|
|
2639
|
+
return window.addEventListener("mousemove", p), window.addEventListener("mouseup", E), window.addEventListener("touchmove", p, { passive: !0 }), window.addEventListener("touchend", E), () => {
|
|
2640
|
+
window.removeEventListener("mousemove", p), window.removeEventListener("mouseup", E), window.removeEventListener("touchmove", p), window.removeEventListener("touchend", E);
|
|
2564
2641
|
};
|
|
2565
|
-
}, [
|
|
2566
|
-
const Z = B ? { aspectRatio: String(B) } : void 0,
|
|
2567
|
-
return /* @__PURE__ */
|
|
2642
|
+
}, [C, V, F]);
|
|
2643
|
+
const Z = B ? { aspectRatio: String(B) } : void 0, re = B ? "" : " aspect-video", K = Math.round(y * 100);
|
|
2644
|
+
return /* @__PURE__ */ c(
|
|
2568
2645
|
"div",
|
|
2569
2646
|
{
|
|
2570
2647
|
role: "button",
|
|
2571
2648
|
tabIndex: 0,
|
|
2572
|
-
className: `relative cursor-pointer overflow-hidden bg-black ${
|
|
2649
|
+
className: `relative cursor-pointer overflow-hidden bg-black ${re}`,
|
|
2573
2650
|
style: Z,
|
|
2574
|
-
onClick: (
|
|
2575
|
-
if (
|
|
2576
|
-
|
|
2651
|
+
onClick: (p) => {
|
|
2652
|
+
if (o) {
|
|
2653
|
+
o(p);
|
|
2577
2654
|
return;
|
|
2578
2655
|
}
|
|
2579
|
-
m || r &&
|
|
2656
|
+
m || r && g((E) => !E);
|
|
2580
2657
|
},
|
|
2581
|
-
onKeyDown: (
|
|
2582
|
-
if (!(
|
|
2583
|
-
if (
|
|
2584
|
-
|
|
2658
|
+
onKeyDown: (p) => {
|
|
2659
|
+
if (!(p.key !== "Enter" && p.key !== " ")) {
|
|
2660
|
+
if (p.preventDefault(), o) {
|
|
2661
|
+
o(p);
|
|
2585
2662
|
return;
|
|
2586
2663
|
}
|
|
2587
|
-
m || r &&
|
|
2664
|
+
m || r && g((E) => !E);
|
|
2588
2665
|
}
|
|
2589
2666
|
},
|
|
2590
2667
|
children: [
|
|
2591
|
-
n && (
|
|
2668
|
+
n && (h === "audio" || P) && /* @__PURE__ */ e(
|
|
2592
2669
|
"img",
|
|
2593
2670
|
{
|
|
2594
2671
|
src: n,
|
|
@@ -2596,16 +2673,16 @@ const $n = (t) => {
|
|
|
2596
2673
|
className: "absolute inset-0 h-full w-full object-cover"
|
|
2597
2674
|
}
|
|
2598
2675
|
),
|
|
2599
|
-
!n && (
|
|
2676
|
+
!n && (h === "audio" || P) && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center", children: Ze(s, {
|
|
2600
2677
|
className: "size-12 text-black/20",
|
|
2601
2678
|
weight: "regular"
|
|
2602
2679
|
}) }),
|
|
2603
|
-
/* @__PURE__ */ e("div", { className: "absolute inset-0", children:
|
|
2680
|
+
/* @__PURE__ */ e("div", { className: "absolute inset-0", children: h === "audio" ? /* @__PURE__ */ e(
|
|
2604
2681
|
"audio",
|
|
2605
2682
|
{
|
|
2606
|
-
ref:
|
|
2683
|
+
ref: f,
|
|
2607
2684
|
src: t,
|
|
2608
|
-
loop:
|
|
2685
|
+
loop: u,
|
|
2609
2686
|
muted: x,
|
|
2610
2687
|
style: { width: "100%", height: "100%" },
|
|
2611
2688
|
onLoadStart: () => M(!0),
|
|
@@ -2613,18 +2690,18 @@ const $n = (t) => {
|
|
|
2613
2690
|
M(!1), R(!1);
|
|
2614
2691
|
},
|
|
2615
2692
|
onWaiting: () => M(!0),
|
|
2616
|
-
onPlay: () =>
|
|
2693
|
+
onPlay: () => b(!1),
|
|
2617
2694
|
onEnded: () => {
|
|
2618
|
-
|
|
2695
|
+
u || (g(!1), I(0));
|
|
2619
2696
|
},
|
|
2620
2697
|
children: /* @__PURE__ */ e("track", { kind: "captions" })
|
|
2621
2698
|
}
|
|
2622
2699
|
) : /* @__PURE__ */ e(
|
|
2623
2700
|
"video",
|
|
2624
2701
|
{
|
|
2625
|
-
ref:
|
|
2702
|
+
ref: f,
|
|
2626
2703
|
src: t,
|
|
2627
|
-
loop:
|
|
2704
|
+
loop: u,
|
|
2628
2705
|
muted: x,
|
|
2629
2706
|
playsInline: !0,
|
|
2630
2707
|
style: { width: "100%", height: "100%" },
|
|
@@ -2633,19 +2710,19 @@ const $n = (t) => {
|
|
|
2633
2710
|
M(!1), R(!1);
|
|
2634
2711
|
},
|
|
2635
2712
|
onWaiting: () => M(!0),
|
|
2636
|
-
onPlay: () =>
|
|
2713
|
+
onPlay: () => b(!1),
|
|
2637
2714
|
onLoadedMetadata: () => {
|
|
2638
|
-
const
|
|
2639
|
-
|
|
2715
|
+
const p = f.current;
|
|
2716
|
+
p instanceof HTMLVideoElement && p.videoWidth && p.videoHeight && Q(p.videoWidth / p.videoHeight);
|
|
2640
2717
|
},
|
|
2641
2718
|
onEnded: () => {
|
|
2642
|
-
|
|
2719
|
+
u || (g(!1), I(0));
|
|
2643
2720
|
},
|
|
2644
2721
|
children: /* @__PURE__ */ e("track", { kind: "captions" })
|
|
2645
2722
|
}
|
|
2646
2723
|
) }),
|
|
2647
2724
|
T && !m && /* @__PURE__ */ e("div", { className: "absolute inset-0 z-10 flex items-center justify-center", children: /* @__PURE__ */ e(
|
|
2648
|
-
|
|
2725
|
+
ft,
|
|
2649
2726
|
{
|
|
2650
2727
|
className: "size-8 animate-spin text-white/80",
|
|
2651
2728
|
weight: "bold"
|
|
@@ -2658,16 +2735,16 @@ const $n = (t) => {
|
|
|
2658
2735
|
role: "button",
|
|
2659
2736
|
tabIndex: 0,
|
|
2660
2737
|
"aria-label": "Play preview",
|
|
2661
|
-
onClick: (
|
|
2662
|
-
|
|
2738
|
+
onClick: (p) => {
|
|
2739
|
+
p.stopPropagation(), J();
|
|
2663
2740
|
},
|
|
2664
|
-
onKeyDown: (
|
|
2665
|
-
|
|
2741
|
+
onKeyDown: (p) => {
|
|
2742
|
+
p.key !== "Enter" && p.key !== " " || (p.preventDefault(), p.stopPropagation(), J());
|
|
2666
2743
|
},
|
|
2667
|
-
children: /* @__PURE__ */ e("span", { className: "flex size-16 items-center justify-center rounded-full bg-white/20 text-white backdrop-blur-sm", children: /* @__PURE__ */ e(
|
|
2744
|
+
children: /* @__PURE__ */ e("span", { className: "flex size-16 items-center justify-center rounded-full bg-white/20 text-white backdrop-blur-sm", children: /* @__PURE__ */ e(nt, { className: "size-9 translate-x-0.5", weight: "fill" }) })
|
|
2668
2745
|
}
|
|
2669
2746
|
),
|
|
2670
|
-
|
|
2747
|
+
d && !r && /* @__PURE__ */ e("div", { className: "absolute inset-x-0 bottom-0 px-3 pb-2.5 pt-6 bg-gradient-to-t from-black/40 to-transparent", children: /* @__PURE__ */ e(
|
|
2671
2748
|
"div",
|
|
2672
2749
|
{
|
|
2673
2750
|
role: "slider",
|
|
@@ -2676,13 +2753,13 @@ const $n = (t) => {
|
|
|
2676
2753
|
"aria-valuemin": 0,
|
|
2677
2754
|
"aria-valuemax": 100,
|
|
2678
2755
|
tabIndex: 0,
|
|
2679
|
-
ref:
|
|
2756
|
+
ref: N,
|
|
2680
2757
|
className: "relative flex h-4 w-full cursor-pointer items-center",
|
|
2681
2758
|
onMouseDown: H,
|
|
2682
2759
|
onTouchStart: H,
|
|
2683
|
-
onClick: (
|
|
2684
|
-
onKeyDown: (
|
|
2685
|
-
|
|
2760
|
+
onClick: (p) => p.stopPropagation(),
|
|
2761
|
+
onKeyDown: (p) => {
|
|
2762
|
+
p.key === "ArrowRight" && F(Math.min(1, y + 0.05)), p.key === "ArrowLeft" && F(Math.max(0, y - 0.05));
|
|
2686
2763
|
},
|
|
2687
2764
|
children: /* @__PURE__ */ e("div", { className: "w-full overflow-hidden rounded-full bg-white/30 h-1", children: /* @__PURE__ */ e(
|
|
2688
2765
|
"div",
|
|
@@ -2693,20 +2770,20 @@ const $n = (t) => {
|
|
|
2693
2770
|
) })
|
|
2694
2771
|
}
|
|
2695
2772
|
) }),
|
|
2696
|
-
r && /* @__PURE__ */
|
|
2773
|
+
r && /* @__PURE__ */ c("div", { className: "absolute inset-x-0 bottom-0 flex items-center gap-2 bg-gradient-to-t from-black/60 to-transparent px-3 pb-2.5 pt-6 transition-all duration-200", children: [
|
|
2697
2774
|
/* @__PURE__ */ e(
|
|
2698
2775
|
"button",
|
|
2699
2776
|
{
|
|
2700
2777
|
type: "button",
|
|
2701
|
-
onClick: (
|
|
2702
|
-
|
|
2778
|
+
onClick: (p) => {
|
|
2779
|
+
p.stopPropagation(), g((E) => !E);
|
|
2703
2780
|
},
|
|
2704
2781
|
className: "shrink-0 text-white",
|
|
2705
2782
|
"aria-label": w ? "Pause" : "Play",
|
|
2706
|
-
children: w ? /* @__PURE__ */ e(
|
|
2783
|
+
children: w ? /* @__PURE__ */ e(Rs, { className: "size-5", weight: "fill" }) : /* @__PURE__ */ e(nt, { className: "size-5 translate-x-px", weight: "fill" })
|
|
2707
2784
|
}
|
|
2708
2785
|
),
|
|
2709
|
-
/* @__PURE__ */
|
|
2786
|
+
/* @__PURE__ */ c(
|
|
2710
2787
|
"div",
|
|
2711
2788
|
{
|
|
2712
2789
|
role: "slider",
|
|
@@ -2715,21 +2792,21 @@ const $n = (t) => {
|
|
|
2715
2792
|
"aria-valuemin": 0,
|
|
2716
2793
|
"aria-valuemax": 100,
|
|
2717
2794
|
tabIndex: 0,
|
|
2718
|
-
ref:
|
|
2795
|
+
ref: N,
|
|
2719
2796
|
className: "relative flex h-4 w-full cursor-pointer items-center",
|
|
2720
2797
|
onMouseDown: H,
|
|
2721
2798
|
onTouchStart: H,
|
|
2722
|
-
onClick: (
|
|
2799
|
+
onClick: (p) => p.stopPropagation(),
|
|
2723
2800
|
onMouseEnter: () => v(!0),
|
|
2724
2801
|
onMouseLeave: () => v(!1),
|
|
2725
|
-
onKeyDown: (
|
|
2726
|
-
|
|
2802
|
+
onKeyDown: (p) => {
|
|
2803
|
+
p.key === "ArrowRight" && F(Math.min(1, y + 0.05)), p.key === "ArrowLeft" && F(Math.max(0, y - 0.05));
|
|
2727
2804
|
},
|
|
2728
2805
|
children: [
|
|
2729
2806
|
/* @__PURE__ */ e(
|
|
2730
2807
|
"div",
|
|
2731
2808
|
{
|
|
2732
|
-
className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${
|
|
2809
|
+
className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${L || C ? "h-1.5" : "h-1"}`,
|
|
2733
2810
|
children: /* @__PURE__ */ e(
|
|
2734
2811
|
"div",
|
|
2735
2812
|
{
|
|
@@ -2742,7 +2819,7 @@ const $n = (t) => {
|
|
|
2742
2819
|
/* @__PURE__ */ e(
|
|
2743
2820
|
"div",
|
|
2744
2821
|
{
|
|
2745
|
-
className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${
|
|
2822
|
+
className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${L || C ? "scale-100 opacity-100" : "scale-0 opacity-0"}`,
|
|
2746
2823
|
style: { left: `${K}%` }
|
|
2747
2824
|
}
|
|
2748
2825
|
)
|
|
@@ -2754,96 +2831,96 @@ const $n = (t) => {
|
|
|
2754
2831
|
}
|
|
2755
2832
|
);
|
|
2756
2833
|
};
|
|
2757
|
-
function
|
|
2834
|
+
function Gn(t) {
|
|
2758
2835
|
return t < 1024 ? `${t} B` : t < 1024 * 1024 ? `${(t / 1024).toFixed(1)} KB` : `${(t / (1024 * 1024)).toFixed(1)} MB`;
|
|
2759
2836
|
}
|
|
2760
|
-
function
|
|
2837
|
+
function Vn(t) {
|
|
2761
2838
|
return `w-[280px] select-none overflow-hidden rounded-[24px] ${t ? "bg-[#121110]" : "bg-[#F3F3F1]"} shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]`;
|
|
2762
2839
|
}
|
|
2763
|
-
function
|
|
2840
|
+
function It(t) {
|
|
2764
2841
|
return t ? "text-white" : "text-black";
|
|
2765
2842
|
}
|
|
2766
2843
|
function be(t) {
|
|
2767
2844
|
return t ? "text-white/55" : "text-black/55";
|
|
2768
2845
|
}
|
|
2769
|
-
function
|
|
2846
|
+
function Hn(t) {
|
|
2770
2847
|
return t ? "text-white/40" : "text-black/40";
|
|
2771
2848
|
}
|
|
2772
2849
|
function kt(t) {
|
|
2773
2850
|
return t ? "bg-white/10" : "bg-black/5";
|
|
2774
2851
|
}
|
|
2775
|
-
function
|
|
2852
|
+
function Tt(t) {
|
|
2776
2853
|
return t ? "text-white/20" : "text-black/20";
|
|
2777
2854
|
}
|
|
2778
|
-
function
|
|
2855
|
+
function Yn(t) {
|
|
2779
2856
|
return t ? "bg-white/10 hover:bg-white/15" : "bg-black/[0.06] hover:bg-black/10";
|
|
2780
2857
|
}
|
|
2781
|
-
async function
|
|
2858
|
+
async function Wn(t, s) {
|
|
2782
2859
|
let n;
|
|
2783
2860
|
try {
|
|
2784
2861
|
n = s ?? new URL(t).pathname.split("/").pop() ?? "download";
|
|
2785
2862
|
} catch {
|
|
2786
2863
|
n = s ?? "download";
|
|
2787
2864
|
}
|
|
2788
|
-
const
|
|
2789
|
-
if (!
|
|
2790
|
-
const l = await
|
|
2791
|
-
r.href =
|
|
2865
|
+
const i = await fetch(t, { mode: "cors" });
|
|
2866
|
+
if (!i.ok) throw new Error(`HTTP ${i.status}`);
|
|
2867
|
+
const l = await i.blob(), u = URL.createObjectURL(l), r = document.createElement("a");
|
|
2868
|
+
r.href = u, r.download = n, r.style.display = "none", document.body.appendChild(r), r.click(), document.body.removeChild(r), URL.revokeObjectURL(u);
|
|
2792
2869
|
}
|
|
2793
|
-
const
|
|
2870
|
+
const qn = ({
|
|
2794
2871
|
url: t,
|
|
2795
2872
|
filename: s,
|
|
2796
2873
|
isMyMessage: n
|
|
2797
2874
|
}) => {
|
|
2798
|
-
const [
|
|
2875
|
+
const [i, l] = k(!1);
|
|
2799
2876
|
return /* @__PURE__ */ e(
|
|
2800
2877
|
"button",
|
|
2801
2878
|
{
|
|
2802
2879
|
type: "button",
|
|
2803
2880
|
onClick: (r) => {
|
|
2804
2881
|
r.stopPropagation();
|
|
2805
|
-
const
|
|
2806
|
-
l(!0),
|
|
2807
|
-
|
|
2882
|
+
const d = window.open("", "_blank", "noopener,noreferrer");
|
|
2883
|
+
l(!0), Wn(t, s).then(() => {
|
|
2884
|
+
d == null || d.close();
|
|
2808
2885
|
}).catch(() => {
|
|
2809
|
-
|
|
2886
|
+
d && (d.location.href = t);
|
|
2810
2887
|
}).finally(() => l(!1));
|
|
2811
2888
|
},
|
|
2812
|
-
disabled:
|
|
2813
|
-
className: `flex size-8 items-center justify-center rounded-full ${
|
|
2889
|
+
disabled: i,
|
|
2890
|
+
className: `flex size-8 items-center justify-center rounded-full ${Yn(n)} disabled:opacity-50`,
|
|
2814
2891
|
"aria-label": "Download",
|
|
2815
|
-
children:
|
|
2892
|
+
children: i ? /* @__PURE__ */ e(ft, { className: `size-4 animate-spin ${be(n)}`, weight: "bold" }) : /* @__PURE__ */ e(Ls, { className: `size-4 ${be(n)}`, weight: "bold" })
|
|
2816
2893
|
}
|
|
2817
2894
|
);
|
|
2818
|
-
}, Me = ({ mimeType: t, title: s, fileSize: n, url:
|
|
2819
|
-
/* @__PURE__ */
|
|
2820
|
-
s && /* @__PURE__ */ e("p", { className: `truncate text-base font-medium ${
|
|
2821
|
-
n !== void 0 && /* @__PURE__ */
|
|
2822
|
-
|
|
2895
|
+
}, Me = ({ mimeType: t, title: s, fileSize: n, url: i, isMyMessage: l }) => /* @__PURE__ */ c("div", { className: "flex items-start gap-2 px-4 pb-3 pt-3", children: [
|
|
2896
|
+
/* @__PURE__ */ c("div", { className: "min-w-0 flex-1", children: [
|
|
2897
|
+
s && /* @__PURE__ */ e("p", { className: `truncate text-base font-medium ${It(l)}`, children: s }),
|
|
2898
|
+
n !== void 0 && /* @__PURE__ */ c("div", { className: "flex items-center gap-1", children: [
|
|
2899
|
+
Ze(t, {
|
|
2823
2900
|
className: `size-5 shrink-0 ${be(l)}`,
|
|
2824
2901
|
weight: "regular"
|
|
2825
2902
|
}),
|
|
2826
|
-
/* @__PURE__ */ e("span", { className: `text-xs font-medium ${be(l)}`, children:
|
|
2903
|
+
/* @__PURE__ */ e("span", { className: `text-xs font-medium ${be(l)}`, children: Gn(n) })
|
|
2827
2904
|
] })
|
|
2828
2905
|
] }),
|
|
2829
|
-
/* @__PURE__ */ e("div", { className: "flex shrink-0 items-center gap-1 pt-0.5", children: /* @__PURE__ */ e(
|
|
2830
|
-
] }),
|
|
2906
|
+
/* @__PURE__ */ e("div", { className: "flex shrink-0 items-center gap-1 pt-0.5", children: /* @__PURE__ */ e(qn, { url: i, filename: s, isMyMessage: l }) })
|
|
2907
|
+
] }), Zn = ({ url: t, mimeType: s, title: n, fileSize: i, isMyMessage: l, onExpand: u }) => {
|
|
2831
2908
|
const r = /* @__PURE__ */ e(
|
|
2832
2909
|
"div",
|
|
2833
2910
|
{
|
|
2834
2911
|
className: `aspect-video w-full ${kt(l)} flex items-center justify-center`,
|
|
2835
|
-
children:
|
|
2836
|
-
className: `size-12 ${
|
|
2912
|
+
children: Ze(s, {
|
|
2913
|
+
className: `size-12 ${Tt(l)}`,
|
|
2837
2914
|
weight: "regular"
|
|
2838
2915
|
})
|
|
2839
2916
|
}
|
|
2840
2917
|
);
|
|
2841
|
-
return /* @__PURE__ */
|
|
2842
|
-
|
|
2918
|
+
return /* @__PURE__ */ c("div", { children: [
|
|
2919
|
+
u ? /* @__PURE__ */ e(
|
|
2843
2920
|
"button",
|
|
2844
2921
|
{
|
|
2845
2922
|
type: "button",
|
|
2846
|
-
onClick:
|
|
2923
|
+
onClick: u,
|
|
2847
2924
|
className: "block w-full",
|
|
2848
2925
|
"aria-label": "Open PDF viewer",
|
|
2849
2926
|
children: r
|
|
@@ -2854,15 +2931,15 @@ const Hn = ({
|
|
|
2854
2931
|
{
|
|
2855
2932
|
mimeType: s,
|
|
2856
2933
|
title: n,
|
|
2857
|
-
fileSize:
|
|
2934
|
+
fileSize: i,
|
|
2858
2935
|
url: t,
|
|
2859
2936
|
isMyMessage: l
|
|
2860
2937
|
}
|
|
2861
2938
|
)
|
|
2862
2939
|
] });
|
|
2863
|
-
},
|
|
2864
|
-
const { title: n, text:
|
|
2865
|
-
return /* @__PURE__ */
|
|
2940
|
+
}, Xn = ({ attachment: t, isMyMessage: s }) => {
|
|
2941
|
+
const { title: n, text: i, image_url: l, og_scrape_url: u, title_link: r } = t, d = u ?? r;
|
|
2942
|
+
return /* @__PURE__ */ c("a", { href: d, target: "_blank", rel: "noopener noreferrer", className: "block no-underline", children: [
|
|
2866
2943
|
/* @__PURE__ */ e("div", { className: "p-2", children: l ? /* @__PURE__ */ e(
|
|
2867
2944
|
"img",
|
|
2868
2945
|
{
|
|
@@ -2874,21 +2951,21 @@ const Hn = ({
|
|
|
2874
2951
|
"div",
|
|
2875
2952
|
{
|
|
2876
2953
|
className: `aspect-video w-full rounded-[20px] ${kt(s)} flex items-center justify-center`,
|
|
2877
|
-
children: /* @__PURE__ */ e(
|
|
2954
|
+
children: /* @__PURE__ */ e(Ps, { className: `size-12 ${Tt(s)}` })
|
|
2878
2955
|
}
|
|
2879
2956
|
) }),
|
|
2880
|
-
/* @__PURE__ */
|
|
2881
|
-
n && /* @__PURE__ */ e("p", { className: `truncate text-[14px] font-medium leading-5 ${
|
|
2882
|
-
|
|
2883
|
-
|
|
2957
|
+
/* @__PURE__ */ c("div", { className: "px-3 pb-3", children: [
|
|
2958
|
+
n && /* @__PURE__ */ e("p", { className: `truncate text-[14px] font-medium leading-5 ${It(s)}`, children: n }),
|
|
2959
|
+
i && /* @__PURE__ */ e("p", { className: `truncate text-[12px] leading-4 ${be(s)}`, children: i }),
|
|
2960
|
+
d && /* @__PURE__ */ e("p", { className: `mt-1 truncate text-[12px] leading-4 ${Hn(s)}`, children: d })
|
|
2884
2961
|
] })
|
|
2885
2962
|
] });
|
|
2886
|
-
},
|
|
2963
|
+
}, Kn = ({ sourceType: t, url: s, mimeType: n, title: i, poster: l, onClose: u }) => {
|
|
2887
2964
|
const r = X(null);
|
|
2888
2965
|
return q(() => {
|
|
2889
|
-
const
|
|
2890
|
-
return
|
|
2891
|
-
|
|
2966
|
+
const o = r.current;
|
|
2967
|
+
return o == null || o.showModal(), () => {
|
|
2968
|
+
o != null && o.open && o.close();
|
|
2892
2969
|
};
|
|
2893
2970
|
}, []), // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
|
|
2894
2971
|
/* @__PURE__ */ e(
|
|
@@ -2896,16 +2973,16 @@ const Hn = ({
|
|
|
2896
2973
|
{
|
|
2897
2974
|
ref: r,
|
|
2898
2975
|
className: "mes-media-viewer",
|
|
2899
|
-
onClose:
|
|
2900
|
-
onClick: (
|
|
2901
|
-
|
|
2976
|
+
onClose: u,
|
|
2977
|
+
onClick: (o) => {
|
|
2978
|
+
o.target === r.current && u();
|
|
2902
2979
|
},
|
|
2903
|
-
children: /* @__PURE__ */
|
|
2980
|
+
children: /* @__PURE__ */ c("div", { className: "relative flex h-full w-full items-center justify-center p-6", children: [
|
|
2904
2981
|
/* @__PURE__ */ e(
|
|
2905
2982
|
"button",
|
|
2906
2983
|
{
|
|
2907
2984
|
type: "button",
|
|
2908
|
-
onClick:
|
|
2985
|
+
onClick: u,
|
|
2909
2986
|
className: "absolute right-4 top-4 z-10 flex size-10 items-center justify-center rounded-full bg-white/10 text-white hover:bg-white/20",
|
|
2910
2987
|
"aria-label": "Close",
|
|
2911
2988
|
children: /* @__PURE__ */ e(Re, { className: "size-5", weight: "bold" })
|
|
@@ -2915,48 +2992,48 @@ const Hn = ({
|
|
|
2915
2992
|
"img",
|
|
2916
2993
|
{
|
|
2917
2994
|
src: s,
|
|
2918
|
-
alt:
|
|
2995
|
+
alt: i ?? "",
|
|
2919
2996
|
className: "max-h-[90vh] max-w-[90vw] rounded-2xl object-contain"
|
|
2920
2997
|
}
|
|
2921
|
-
) : n === "application/pdf" ? /* @__PURE__ */
|
|
2922
|
-
|
|
2998
|
+
) : n === "application/pdf" ? /* @__PURE__ */ c("div", { className: "flex h-full w-full max-w-4xl flex-col pt-14", children: [
|
|
2999
|
+
i && /* @__PURE__ */ e("p", { className: "mb-2 shrink-0 truncate text-sm font-medium text-white/70", children: i }),
|
|
2923
3000
|
/* @__PURE__ */ e(
|
|
2924
3001
|
"iframe",
|
|
2925
3002
|
{
|
|
2926
3003
|
src: s,
|
|
2927
|
-
title:
|
|
3004
|
+
title: i ?? "Document",
|
|
2928
3005
|
className: "w-full flex-1 rounded-xl"
|
|
2929
3006
|
}
|
|
2930
3007
|
)
|
|
2931
|
-
] }) : /* @__PURE__ */
|
|
2932
|
-
|
|
2933
|
-
/* @__PURE__ */ e(
|
|
3008
|
+
] }) : /* @__PURE__ */ c("div", { className: "w-full max-w-2xl", children: [
|
|
3009
|
+
i && /* @__PURE__ */ e("p", { className: "mb-4 text-center text-sm font-medium text-white/70", children: i }),
|
|
3010
|
+
/* @__PURE__ */ e(He, { source: s, mimeType: n, poster: l, controls: !0 })
|
|
2934
3011
|
] })
|
|
2935
3012
|
] })
|
|
2936
3013
|
}
|
|
2937
3014
|
);
|
|
2938
|
-
},
|
|
3015
|
+
}, ca = ({
|
|
2939
3016
|
message: t,
|
|
2940
3017
|
isMyMessage: s = !1
|
|
2941
3018
|
}) => {
|
|
2942
|
-
var
|
|
2943
|
-
const [n,
|
|
2944
|
-
(
|
|
2945
|
-
),
|
|
2946
|
-
(
|
|
2947
|
-
), r = (
|
|
2948
|
-
(
|
|
2949
|
-
),
|
|
2950
|
-
(
|
|
3019
|
+
var C, S, L, v, m;
|
|
3020
|
+
const [n, i] = k(!1), l = (C = t.attachments) == null ? void 0 : C.find(
|
|
3021
|
+
(b) => b.type === "link" || b.og_scrape_url && !b.asset_url
|
|
3022
|
+
), u = (S = t.attachments) == null ? void 0 : S.find(
|
|
3023
|
+
(b) => b.type === "video" && b.asset_url
|
|
3024
|
+
), r = (L = t.attachments) == null ? void 0 : L.find(
|
|
3025
|
+
(b) => b.type === "image" && b.image_url
|
|
3026
|
+
), d = (v = t.attachments) == null ? void 0 : v.find(
|
|
3027
|
+
(b) => b.type === "audio" && b.asset_url
|
|
2951
3028
|
), x = (m = t.attachments) == null ? void 0 : m.find(
|
|
2952
|
-
(
|
|
2953
|
-
),
|
|
2954
|
-
if (!l && !
|
|
2955
|
-
const
|
|
2956
|
-
return /* @__PURE__ */
|
|
2957
|
-
/* @__PURE__ */
|
|
3029
|
+
(b) => b.type === "file" && b.asset_url
|
|
3030
|
+
), o = u ?? r ?? d ?? x, h = (u == null ? void 0 : u.asset_url) ?? (r == null ? void 0 : r.image_url) ?? (d == null ? void 0 : d.asset_url) ?? (x == null ? void 0 : x.asset_url), f = (o == null ? void 0 : o.mime_type) ?? ((o == null ? void 0 : o.type) === "image" ? "image/jpeg" : (o == null ? void 0 : o.type) === "video" ? "video/mp4" : (o == null ? void 0 : o.type) === "audio" ? "audio/mpeg" : "application/octet-stream");
|
|
3031
|
+
if (!l && !h) return null;
|
|
3032
|
+
const N = h ? qe(f) : null, a = o == null ? void 0 : o.title, _ = o == null ? void 0 : o.file_size, w = u == null ? void 0 : u.thumb_url, g = f === "application/pdf", y = s ? "str-chat__message str-chat__message-simple str-chat__message--me str-chat__message-simple--me" : "str-chat__message str-chat__message-simple str-chat__message--other", I = N === "image" || N === "video" || g;
|
|
3033
|
+
return /* @__PURE__ */ c(se, { children: [
|
|
3034
|
+
/* @__PURE__ */ c("div", { className: y, children: [
|
|
2958
3035
|
!s && t.user && /* @__PURE__ */ e(
|
|
2959
|
-
|
|
3036
|
+
ae,
|
|
2960
3037
|
{
|
|
2961
3038
|
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
2962
3039
|
id: t.user.id,
|
|
@@ -2974,77 +3051,77 @@ const Hn = ({
|
|
|
2974
3051
|
{
|
|
2975
3052
|
className: "str-chat__message-bubble",
|
|
2976
3053
|
style: { padding: 0, borderRadius: 0, overflow: "visible", background: "transparent" },
|
|
2977
|
-
children: /* @__PURE__ */ e("div", { className:
|
|
3054
|
+
children: /* @__PURE__ */ e("div", { className: Vn(s), children: l ? /* @__PURE__ */ e(Xn, { attachment: l, isMyMessage: s }) : N === "image" ? /* @__PURE__ */ c(se, { children: [
|
|
2978
3055
|
/* @__PURE__ */ e(
|
|
2979
3056
|
"button",
|
|
2980
3057
|
{
|
|
2981
3058
|
type: "button",
|
|
2982
|
-
onClick: () =>
|
|
3059
|
+
onClick: () => i(!0),
|
|
2983
3060
|
className: "block w-full cursor-zoom-in",
|
|
2984
|
-
children: /* @__PURE__ */ e("img", { src:
|
|
3061
|
+
children: /* @__PURE__ */ e("img", { src: h, alt: a ?? "", className: "block w-full" })
|
|
2985
3062
|
}
|
|
2986
3063
|
),
|
|
2987
3064
|
/* @__PURE__ */ e(
|
|
2988
3065
|
Me,
|
|
2989
3066
|
{
|
|
2990
|
-
mimeType:
|
|
3067
|
+
mimeType: f,
|
|
2991
3068
|
title: a,
|
|
2992
3069
|
fileSize: _,
|
|
2993
|
-
url:
|
|
3070
|
+
url: h,
|
|
2994
3071
|
isMyMessage: s
|
|
2995
3072
|
}
|
|
2996
3073
|
)
|
|
2997
|
-
] }) :
|
|
3074
|
+
] }) : N === "video" ? /* @__PURE__ */ c(se, { children: [
|
|
2998
3075
|
/* @__PURE__ */ e(
|
|
2999
|
-
|
|
3076
|
+
He,
|
|
3000
3077
|
{
|
|
3001
|
-
source:
|
|
3002
|
-
mimeType:
|
|
3078
|
+
source: h,
|
|
3079
|
+
mimeType: f,
|
|
3003
3080
|
poster: w,
|
|
3004
3081
|
controls: !0,
|
|
3005
|
-
onContainerClick: () =>
|
|
3082
|
+
onContainerClick: () => i(!0)
|
|
3006
3083
|
}
|
|
3007
3084
|
),
|
|
3008
3085
|
/* @__PURE__ */ e(
|
|
3009
3086
|
Me,
|
|
3010
3087
|
{
|
|
3011
|
-
mimeType:
|
|
3088
|
+
mimeType: f,
|
|
3012
3089
|
title: a,
|
|
3013
3090
|
fileSize: _,
|
|
3014
|
-
url:
|
|
3091
|
+
url: h,
|
|
3015
3092
|
isMyMessage: s
|
|
3016
3093
|
}
|
|
3017
3094
|
)
|
|
3018
|
-
] }) :
|
|
3095
|
+
] }) : N === "audio" ? /* @__PURE__ */ c(se, { children: [
|
|
3019
3096
|
/* @__PURE__ */ e(
|
|
3020
|
-
|
|
3097
|
+
He,
|
|
3021
3098
|
{
|
|
3022
|
-
source:
|
|
3023
|
-
mimeType:
|
|
3099
|
+
source: h,
|
|
3100
|
+
mimeType: f,
|
|
3024
3101
|
controls: !0
|
|
3025
3102
|
}
|
|
3026
3103
|
),
|
|
3027
3104
|
/* @__PURE__ */ e(
|
|
3028
3105
|
Me,
|
|
3029
3106
|
{
|
|
3030
|
-
mimeType:
|
|
3107
|
+
mimeType: f,
|
|
3031
3108
|
title: a,
|
|
3032
3109
|
fileSize: _,
|
|
3033
|
-
url:
|
|
3110
|
+
url: h,
|
|
3034
3111
|
isMyMessage: s
|
|
3035
3112
|
}
|
|
3036
3113
|
)
|
|
3037
3114
|
] }) : (
|
|
3038
3115
|
// document: PDF gets viewer, unknown gets link-only thumbnail
|
|
3039
3116
|
/* @__PURE__ */ e(
|
|
3040
|
-
|
|
3117
|
+
Zn,
|
|
3041
3118
|
{
|
|
3042
|
-
url:
|
|
3043
|
-
mimeType:
|
|
3119
|
+
url: h,
|
|
3120
|
+
mimeType: f,
|
|
3044
3121
|
title: a,
|
|
3045
3122
|
fileSize: _,
|
|
3046
3123
|
isMyMessage: s,
|
|
3047
|
-
onExpand:
|
|
3124
|
+
onExpand: g ? () => i(!0) : void 0
|
|
3048
3125
|
}
|
|
3049
3126
|
)
|
|
3050
3127
|
) })
|
|
@@ -3053,81 +3130,81 @@ const Hn = ({
|
|
|
3053
3130
|
}
|
|
3054
3131
|
)
|
|
3055
3132
|
] }),
|
|
3056
|
-
n &&
|
|
3057
|
-
|
|
3133
|
+
n && I && h && /* @__PURE__ */ e(
|
|
3134
|
+
Kn,
|
|
3058
3135
|
{
|
|
3059
|
-
sourceType:
|
|
3060
|
-
url:
|
|
3061
|
-
mimeType:
|
|
3136
|
+
sourceType: N,
|
|
3137
|
+
url: h,
|
|
3138
|
+
mimeType: f,
|
|
3062
3139
|
title: a,
|
|
3063
3140
|
poster: w,
|
|
3064
|
-
onClose: () =>
|
|
3141
|
+
onClose: () => i(!1)
|
|
3065
3142
|
}
|
|
3066
3143
|
)
|
|
3067
3144
|
] });
|
|
3068
|
-
},
|
|
3069
|
-
const { initialSearch: n = "", pageSize:
|
|
3145
|
+
}, da = (t, s = {}) => {
|
|
3146
|
+
const { initialSearch: n = "", pageSize: i = 20 } = s, [l, u] = k([]), [r, d] = k(!1), [x, o] = k(null), [h, f] = k(n), [N, a] = k(!0), [_, w] = k(), g = A(async (S = !1, L) => {
|
|
3070
3147
|
if (r) return;
|
|
3071
|
-
const v =
|
|
3072
|
-
|
|
3148
|
+
const v = L !== void 0 ? L : h;
|
|
3149
|
+
d(!0), o(null);
|
|
3073
3150
|
try {
|
|
3074
3151
|
const m = await t.loadParticipants({
|
|
3075
3152
|
search: v || void 0,
|
|
3076
|
-
limit:
|
|
3077
|
-
cursor:
|
|
3153
|
+
limit: i,
|
|
3154
|
+
cursor: S ? void 0 : _
|
|
3078
3155
|
});
|
|
3079
|
-
|
|
3080
|
-
(
|
|
3156
|
+
u(
|
|
3157
|
+
(b) => S ? m.participants : [...b, ...m.participants]
|
|
3081
3158
|
), a(m.hasMore), w(m.nextCursor);
|
|
3082
3159
|
} catch (m) {
|
|
3083
|
-
const
|
|
3084
|
-
|
|
3160
|
+
const b = m instanceof Error ? m.message : "Failed to load participants";
|
|
3161
|
+
o(b), console.error("[useParticipants] Load error:", m);
|
|
3085
3162
|
} finally {
|
|
3086
|
-
|
|
3163
|
+
d(!1);
|
|
3087
3164
|
}
|
|
3088
|
-
}, [t,
|
|
3089
|
-
|
|
3090
|
-
}, [
|
|
3091
|
-
|
|
3092
|
-
}, [
|
|
3093
|
-
w(void 0),
|
|
3094
|
-
}, [
|
|
3165
|
+
}, [t, h, _, i, r]), y = A(() => {
|
|
3166
|
+
N && !r && g(!1);
|
|
3167
|
+
}, [N, r, g]), I = A((S) => {
|
|
3168
|
+
f(S), w(void 0), g(!0, S);
|
|
3169
|
+
}, [g]), C = A(() => {
|
|
3170
|
+
w(void 0), g(!0);
|
|
3171
|
+
}, [g]);
|
|
3095
3172
|
return q(() => {
|
|
3096
|
-
|
|
3173
|
+
g(!0);
|
|
3097
3174
|
}, [t.loadParticipants]), {
|
|
3098
3175
|
participants: l,
|
|
3099
3176
|
loading: r,
|
|
3100
3177
|
error: x,
|
|
3101
|
-
searchQuery:
|
|
3102
|
-
hasMore:
|
|
3178
|
+
searchQuery: h,
|
|
3179
|
+
hasMore: N,
|
|
3103
3180
|
totalCount: t.totalCount,
|
|
3104
|
-
loadMore:
|
|
3105
|
-
search:
|
|
3106
|
-
refresh:
|
|
3181
|
+
loadMore: y,
|
|
3182
|
+
search: I,
|
|
3183
|
+
refresh: C
|
|
3107
3184
|
};
|
|
3108
3185
|
};
|
|
3109
3186
|
export {
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3187
|
+
Ie as A,
|
|
3188
|
+
Tn as C,
|
|
3189
|
+
oa as F,
|
|
3190
|
+
it as L,
|
|
3191
|
+
He as M,
|
|
3192
|
+
Ln as P,
|
|
3193
|
+
ae as a,
|
|
3194
|
+
wt as b,
|
|
3195
|
+
Et as c,
|
|
3196
|
+
ia as d,
|
|
3197
|
+
An as e,
|
|
3198
|
+
ca as f,
|
|
3199
|
+
qe as g,
|
|
3200
|
+
cn as h,
|
|
3201
|
+
ra as i,
|
|
3202
|
+
la as j,
|
|
3203
|
+
zs as k,
|
|
3204
|
+
Js as l,
|
|
3205
|
+
Fs as m,
|
|
3206
|
+
da as n,
|
|
3207
|
+
Ze as r,
|
|
3208
|
+
rn as u
|
|
3132
3209
|
};
|
|
3133
|
-
//# sourceMappingURL=index-
|
|
3210
|
+
//# sourceMappingURL=index-B3H4GLek.js.map
|