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