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