@codingfactory/messenger-client 0.4.9 → 0.4.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +888 -887
- package/dist/stores/messaging.d.ts +2 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ref as N, getCurrentInstance as Ds, computed as C, watch as Xe, onUnmounted as Nt, toValue as or, onMounted as Yt, nextTick as ct, defineComponent as at, openBlock as m, createElementBlock as
|
|
1
|
+
import { ref as N, getCurrentInstance as Ds, computed as C, watch as Xe, onUnmounted as Nt, toValue as or, onMounted as Yt, nextTick as ct, defineComponent as at, openBlock as m, createElementBlock as b, normalizeStyle as rt, normalizeClass as xe, createElementVNode as c, toDisplayString as J, useAttrs as Qa, onBeforeUnmount as Us, Fragment as ze, mergeProps as lr, unref as Lt, renderList as dt, withModifiers as Ge, createCommentVNode as K, createTextVNode as yt, withKeys as Dt, createVNode as Re, createBlock as st, Teleport as ns, resolveDynamicComponent as cr, withCtx as it, Transition as Wt, renderSlot as Vn, createStaticVNode as eo, withDirectives as un, vModelText as dn, TransitionGroup as to } from "vue";
|
|
2
2
|
import { defineStore as ur, storeToRefs as no } from "pinia";
|
|
3
3
|
import Fs, { isAxiosError as so, AxiosHeaders as bi } from "axios";
|
|
4
4
|
import { isAxiosError as Yg } from "axios";
|
|
@@ -396,19 +396,19 @@ function Jo(e) {
|
|
|
396
396
|
const t = typeof e.id == "string" ? e.id.trim() : "", n = gn(e.title) ?? "", i = typeof e.url == "string" ? e.url.trim() : "";
|
|
397
397
|
if (t.length === 0 || n.length === 0 || i.length === 0)
|
|
398
398
|
return;
|
|
399
|
-
const o = gn(e.excerpt) ?? null, l = typeof e.media_thumbnail == "string" && e.media_thumbnail.trim().length > 0 ? e.media_thumbnail.trim() : null, u = gt(e.author) ? e.author : null,
|
|
399
|
+
const o = gn(e.excerpt) ?? null, l = typeof e.media_thumbnail == "string" && e.media_thumbnail.trim().length > 0 ? e.media_thumbnail.trim() : null, u = gt(e.author) ? e.author : null, p = u && typeof u.id == "string" ? u.id.trim() : "", h = gn(u?.name) ?? "", w = u && typeof u.avatar == "string" && u.avatar.trim().length > 0 ? u.avatar.trim() : null, y = u && typeof u.handle == "string" && u.handle.trim().length > 0 ? u.handle.trim() : null;
|
|
400
400
|
return {
|
|
401
401
|
id: t,
|
|
402
402
|
title: n,
|
|
403
403
|
url: i,
|
|
404
404
|
...o ? { excerpt: o } : {},
|
|
405
405
|
...l ? { media_thumbnail: l } : {},
|
|
406
|
-
...
|
|
406
|
+
...p.length > 0 && h.length > 0 ? {
|
|
407
407
|
author: {
|
|
408
|
-
id:
|
|
408
|
+
id: p,
|
|
409
409
|
name: h,
|
|
410
410
|
...w ? { avatar: w } : {},
|
|
411
|
-
...
|
|
411
|
+
...y ? { handle: y } : {}
|
|
412
412
|
}
|
|
413
413
|
} : {}
|
|
414
414
|
};
|
|
@@ -435,12 +435,12 @@ function Zo(e, t = []) {
|
|
|
435
435
|
name: i.user.name,
|
|
436
436
|
...l ? { avatar: l } : {},
|
|
437
437
|
...i.user.handle ? { handle: i.user.handle } : {}
|
|
438
|
-
} : void 0,
|
|
439
|
-
if (
|
|
438
|
+
} : void 0, p = xi(i.last_read_message_id);
|
|
439
|
+
if (p)
|
|
440
440
|
return {
|
|
441
441
|
...i,
|
|
442
442
|
...u ? { user: u } : {},
|
|
443
|
-
last_read_message_id:
|
|
443
|
+
last_read_message_id: p
|
|
444
444
|
};
|
|
445
445
|
if (o)
|
|
446
446
|
return {
|
|
@@ -467,7 +467,7 @@ function el(e, t) {
|
|
|
467
467
|
return Object.prototype.hasOwnProperty.call(e, "folder_id") ? e.folder_id ?? null : e.me?.folder_id === null ? null : typeof e.me?.folder_id == "string" ? e.me.folder_id : t?.folder_id;
|
|
468
468
|
}
|
|
469
469
|
function Cn(e, t) {
|
|
470
|
-
const n = Qo(e, t), i = typeof e.is_muted == "boolean" ? e.is_muted : n !== null || t?.is_muted === !0, o = e.last_message ? Yn(e.last_message) : t?.last_message, l = e.last_message_at ?? t?.last_message_at, u = typeof e.unread_count == "number" ? e.unread_count : t?.unread_count ?? 0,
|
|
470
|
+
const n = Qo(e, t), i = typeof e.is_muted == "boolean" ? e.is_muted : n !== null || t?.is_muted === !0, o = e.last_message ? Yn(e.last_message) : t?.last_message, l = e.last_message_at ?? t?.last_message_at, u = typeof e.unread_count == "number" ? e.unread_count : t?.unread_count ?? 0, p = typeof e.is_pinned == "boolean" ? e.is_pinned : e.me?.is_pinned ?? t?.is_pinned ?? !1, h = typeof e.is_archived == "boolean" ? e.is_archived : e.me?.is_archived ?? t?.is_archived ?? !1, w = el(e, t), y = typeof e.created_at == "string" ? e.created_at : t?.created_at ?? "", k = (() => {
|
|
471
471
|
if (!t || t.unread_count !== 0 || u <= 0)
|
|
472
472
|
return !1;
|
|
473
473
|
const x = t.last_message?.id, M = e.last_message?.id;
|
|
@@ -479,10 +479,10 @@ function Cn(e, t) {
|
|
|
479
479
|
participants: Zo(e.participants, t?.participants),
|
|
480
480
|
is_muted: i,
|
|
481
481
|
muted_until: n,
|
|
482
|
-
is_pinned:
|
|
482
|
+
is_pinned: p,
|
|
483
483
|
is_archived: h,
|
|
484
484
|
folder_id: w,
|
|
485
|
-
created_at:
|
|
485
|
+
created_at: y,
|
|
486
486
|
...o ? { last_message: o } : {},
|
|
487
487
|
...l ? { last_message_at: l } : {}
|
|
488
488
|
};
|
|
@@ -640,8 +640,8 @@ async function Li(e) {
|
|
|
640
640
|
const u = i.get(l);
|
|
641
641
|
return u ? {
|
|
642
642
|
...o,
|
|
643
|
-
participants: o.participants.map((
|
|
644
|
-
...
|
|
643
|
+
participants: o.participants.map((p) => p.user_id !== l ? p : {
|
|
644
|
+
...p,
|
|
645
645
|
user: u
|
|
646
646
|
})
|
|
647
647
|
} : o;
|
|
@@ -840,18 +840,18 @@ const Gt = ur("messaging", {
|
|
|
840
840
|
return e || (this.conversations = [], this.normalizeFolderAssignmentsState()), Ti();
|
|
841
841
|
const o = i?.includePresence ?? !0, l = {};
|
|
842
842
|
o && (l.include_presence = 1), e && (l.cursor = e), t && (l.filter = t), typeof n == "string" && n.length > 0 && (l.folder_id = n);
|
|
843
|
-
const u = await Ne().get("/v1/messaging/conversations", { params: l }), { items:
|
|
843
|
+
const u = await Ne().get("/v1/messaging/conversations", { params: l }), { items: p, nextCursor: h } = Gn(
|
|
844
844
|
u.data,
|
|
845
845
|
"conversations"
|
|
846
|
-
), w =
|
|
846
|
+
), w = p.map((x) => {
|
|
847
847
|
const M = this.conversations.find(
|
|
848
848
|
(A) => A.id === x.id
|
|
849
849
|
);
|
|
850
850
|
return Cn(x, M);
|
|
851
|
-
}),
|
|
852
|
-
e ? this.conversations.push(...
|
|
851
|
+
}), y = await Li(w);
|
|
852
|
+
e ? this.conversations.push(...y) : this.conversations = y, this.normalizeFolderAssignmentsState(), this.lastFetch = Date.now();
|
|
853
853
|
const k = {
|
|
854
|
-
data:
|
|
854
|
+
data: y,
|
|
855
855
|
has_more: !!h
|
|
856
856
|
};
|
|
857
857
|
return h !== void 0 && (k.next_cursor = h), k;
|
|
@@ -880,13 +880,13 @@ const Gt = ur("messaging", {
|
|
|
880
880
|
try {
|
|
881
881
|
const t = await Ne().get(`/v1/messaging/conversations/${e}`, {
|
|
882
882
|
params: { include_presence: 1 }
|
|
883
|
-
}), n = this.conversations.find((
|
|
883
|
+
}), n = this.conversations.find((p) => p.id === e);
|
|
884
884
|
let i = Cn(t.data.data || t.data, n);
|
|
885
885
|
const o = Lr(i);
|
|
886
886
|
o && (i = await Ii(i, o));
|
|
887
|
-
const l = this.conversations.findIndex((
|
|
887
|
+
const l = this.conversations.findIndex((p) => p.id === e);
|
|
888
888
|
l >= 0 ? this.conversations[l] = i : this.conversations.push(i);
|
|
889
|
-
const u = this.requests.findIndex((
|
|
889
|
+
const u = this.requests.findIndex((p) => p.id === e);
|
|
890
890
|
return i.is_request === !0 ? u >= 0 ? this.requests[u] = i : this.requests = kn(this.requests, i) : u >= 0 && (this.requests[u] = i), this.normalizeFolderAssignmentsState(), i;
|
|
891
891
|
} catch (t) {
|
|
892
892
|
throw this.error = Je(t), t;
|
|
@@ -908,15 +908,15 @@ const Gt = ur("messaging", {
|
|
|
908
908
|
n.data,
|
|
909
909
|
"conversations"
|
|
910
910
|
), l = i.map((h) => {
|
|
911
|
-
const w = this.requests.find((
|
|
911
|
+
const w = this.requests.find((y) => y.id === h.id);
|
|
912
912
|
return Cn(h, w);
|
|
913
913
|
}), u = await Li(l);
|
|
914
914
|
e ? this.requests.push(...u) : this.requests = u, this.normalizeFolderAssignmentsState();
|
|
915
|
-
const
|
|
915
|
+
const p = {
|
|
916
916
|
data: u,
|
|
917
917
|
has_more: !!o
|
|
918
918
|
};
|
|
919
|
-
return o !== void 0 && (
|
|
919
|
+
return o !== void 0 && (p.next_cursor = o), p;
|
|
920
920
|
} catch (t) {
|
|
921
921
|
throw this.error = Je(t), t;
|
|
922
922
|
} finally {
|
|
@@ -940,7 +940,7 @@ const Gt = ur("messaging", {
|
|
|
940
940
|
const { items: l, nextCursor: u } = Gn(
|
|
941
941
|
o.data,
|
|
942
942
|
"messages"
|
|
943
|
-
),
|
|
943
|
+
), p = l.map(Yn), h = [...p].reverse();
|
|
944
944
|
if (t ? this.messages[e] = [...h, ...this.messages[e] || []] : this.messages[e] = h, (() => {
|
|
945
945
|
const k = this.conversations.find((x) => x.id === e) ?? this.requests.find((x) => x.id === e);
|
|
946
946
|
return k ? !k.last_message || !k.last_message_at : !1;
|
|
@@ -949,11 +949,11 @@ const Gt = ur("messaging", {
|
|
|
949
949
|
k && this.updateConversationLastMessage(e, k);
|
|
950
950
|
}
|
|
951
951
|
u ? (this.conversationCursors[e] = u, this.conversationHasMore[e] = !0) : (delete this.conversationCursors[e], this.conversationHasMore[e] = !1);
|
|
952
|
-
const
|
|
953
|
-
data:
|
|
952
|
+
const y = {
|
|
953
|
+
data: p,
|
|
954
954
|
has_more: !!u
|
|
955
955
|
};
|
|
956
|
-
return u !== void 0 && (
|
|
956
|
+
return u !== void 0 && (y.next_cursor = u), y;
|
|
957
957
|
} catch (n) {
|
|
958
958
|
throw this.error = Je(n), n;
|
|
959
959
|
} finally {
|
|
@@ -961,14 +961,14 @@ const Gt = ur("messaging", {
|
|
|
961
961
|
}
|
|
962
962
|
},
|
|
963
963
|
async sendMessage(e, t, n, i, o, l, u) {
|
|
964
|
-
const
|
|
964
|
+
const p = It()(), h = `temp-${Date.now()}-${Math.random()}`, w = typeof l == "string" && l.trim().length > 0 ? l.trim() : null, y = Jo(u), k = p.currentUser, x = {
|
|
965
965
|
id: h,
|
|
966
966
|
conversation_id: e,
|
|
967
967
|
author_id: k?.id || "",
|
|
968
968
|
body: t || "",
|
|
969
969
|
attachments: [],
|
|
970
970
|
meta: w ? { shared_post_id: w } : {},
|
|
971
|
-
...
|
|
971
|
+
...y ? { shared_post: y } : {},
|
|
972
972
|
is_deleted: !1,
|
|
973
973
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
974
974
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
@@ -985,7 +985,7 @@ const Gt = ur("messaging", {
|
|
|
985
985
|
body: t || "",
|
|
986
986
|
...i ? { reply_to_id: i } : {},
|
|
987
987
|
...w ? { shared_post_id: w } : {},
|
|
988
|
-
...
|
|
988
|
+
...y ? { shared_post_preview: y } : {}
|
|
989
989
|
};
|
|
990
990
|
if (n && n.length > 0) {
|
|
991
991
|
const L = await Promise.all(
|
|
@@ -1024,9 +1024,9 @@ const Gt = ur("messaging", {
|
|
|
1024
1024
|
try {
|
|
1025
1025
|
const i = await Ne().patch(`/v1/messaging/conversations/${e}/messages/${t}`, {
|
|
1026
1026
|
body: n
|
|
1027
|
-
}), o = i.data.data || i.data, l = this.messages[e] || [], u = l.findIndex((
|
|
1027
|
+
}), o = i.data.data || i.data, l = this.messages[e] || [], u = l.findIndex((p) => p.id === t);
|
|
1028
1028
|
if (u >= 0) {
|
|
1029
|
-
const
|
|
1029
|
+
const p = l[u], h = o.id ? { ...p, ...o } : { ...p, body: n, edited_at: (/* @__PURE__ */ new Date()).toISOString() };
|
|
1030
1030
|
return l[u] = h, h;
|
|
1031
1031
|
}
|
|
1032
1032
|
return o;
|
|
@@ -1107,8 +1107,8 @@ const Gt = ur("messaging", {
|
|
|
1107
1107
|
const u = t[l];
|
|
1108
1108
|
if (u) {
|
|
1109
1109
|
if (o.status === "fulfilled") {
|
|
1110
|
-
const
|
|
1111
|
-
|
|
1110
|
+
const p = this.conversations.find((h) => h.id === u.conversationId);
|
|
1111
|
+
p && (p.unread_count = 0);
|
|
1112
1112
|
return;
|
|
1113
1113
|
}
|
|
1114
1114
|
i === null && (i = o.reason);
|
|
@@ -1128,7 +1128,7 @@ const Gt = ur("messaging", {
|
|
|
1128
1128
|
},
|
|
1129
1129
|
async muteConversation(e, t) {
|
|
1130
1130
|
try {
|
|
1131
|
-
const n = { minutes: t }, i = await Ne().patch(`/v1/messaging/conversations/${e}/mute`, n), l = (i.data.data || i.data).muted_until || null, u = this.conversations.find((
|
|
1131
|
+
const n = { minutes: t }, i = await Ne().patch(`/v1/messaging/conversations/${e}/mute`, n), l = (i.data.data || i.data).muted_until || null, u = this.conversations.find((p) => p.id === e);
|
|
1132
1132
|
u && (u.is_muted = l !== null, u.muted_until = l);
|
|
1133
1133
|
} catch (n) {
|
|
1134
1134
|
throw this.error = Je(n), n;
|
|
@@ -1148,8 +1148,8 @@ const Gt = ur("messaging", {
|
|
|
1148
1148
|
try {
|
|
1149
1149
|
const n = await Ne().patch(`/v1/messaging/conversations/${e}`, {
|
|
1150
1150
|
title: t
|
|
1151
|
-
}), i = n.data.data || n.data, o = typeof i?.title == "string" ? i.title : t, l = (u) => u.map((
|
|
1152
|
-
...
|
|
1151
|
+
}), i = n.data.data || n.data, o = typeof i?.title == "string" ? i.title : t, l = (u) => u.map((p) => p.id !== e ? p : {
|
|
1152
|
+
...p,
|
|
1153
1153
|
title: o
|
|
1154
1154
|
});
|
|
1155
1155
|
this.conversations = l(this.conversations), this.requests = l(this.requests);
|
|
@@ -1259,30 +1259,30 @@ const Gt = ur("messaging", {
|
|
|
1259
1259
|
return;
|
|
1260
1260
|
const l = It()();
|
|
1261
1261
|
if (n.author_id === l.currentUser?.id) {
|
|
1262
|
-
const w = i.findIndex((
|
|
1262
|
+
const w = i.findIndex((y) => y.id.startsWith("temp-"));
|
|
1263
1263
|
if (w >= 0) {
|
|
1264
|
-
const
|
|
1264
|
+
const y = i[w]?.id ?? "";
|
|
1265
1265
|
this.messages[t] = [
|
|
1266
1266
|
...i.slice(0, w),
|
|
1267
1267
|
n,
|
|
1268
1268
|
...i.slice(w + 1)
|
|
1269
|
-
], this._pendingSendIds.delete(
|
|
1269
|
+
], this._pendingSendIds.delete(y), this.updateConversationLastMessage(t, n);
|
|
1270
1270
|
return;
|
|
1271
1271
|
}
|
|
1272
1272
|
}
|
|
1273
1273
|
const u = n.created_at;
|
|
1274
|
-
let
|
|
1274
|
+
let p = i.length;
|
|
1275
1275
|
for (let w = i.length - 1; w >= 0; w--) {
|
|
1276
|
-
const
|
|
1277
|
-
if (
|
|
1276
|
+
const y = i[w];
|
|
1277
|
+
if (y && y.created_at <= u)
|
|
1278
1278
|
break;
|
|
1279
|
-
|
|
1279
|
+
p = w;
|
|
1280
1280
|
}
|
|
1281
|
-
const h =
|
|
1281
|
+
const h = p === i.length;
|
|
1282
1282
|
this.messages[t] = [
|
|
1283
|
-
...i.slice(0,
|
|
1283
|
+
...i.slice(0, p),
|
|
1284
1284
|
n,
|
|
1285
|
-
...i.slice(
|
|
1285
|
+
...i.slice(p)
|
|
1286
1286
|
], h && this.updateConversationLastMessage(t, n);
|
|
1287
1287
|
},
|
|
1288
1288
|
updateMessage(e) {
|
|
@@ -1307,30 +1307,30 @@ const Gt = ur("messaging", {
|
|
|
1307
1307
|
i && this.addMessage(i);
|
|
1308
1308
|
return;
|
|
1309
1309
|
}
|
|
1310
|
-
const
|
|
1311
|
-
if (
|
|
1312
|
-
const h = u[
|
|
1310
|
+
const p = u.findIndex((h) => h.id === t);
|
|
1311
|
+
if (p >= 0) {
|
|
1312
|
+
const h = u[p];
|
|
1313
1313
|
h && (this.messages[e] = [
|
|
1314
|
-
...u.slice(0,
|
|
1314
|
+
...u.slice(0, p),
|
|
1315
1315
|
n(h),
|
|
1316
|
-
...u.slice(
|
|
1316
|
+
...u.slice(p + 1)
|
|
1317
1317
|
]);
|
|
1318
1318
|
return;
|
|
1319
1319
|
}
|
|
1320
1320
|
i && this.addMessage(i);
|
|
1321
1321
|
},
|
|
1322
1322
|
async toggleReaction(e, t, n) {
|
|
1323
|
-
const i = `/v1/messaging/conversations/${e}/messages/${t}/reactions`, o = { reaction: n }, u = this.messages[e]?.find((
|
|
1323
|
+
const i = `/v1/messaging/conversations/${e}/messages/${t}/reactions`, o = { reaction: n }, u = this.messages[e]?.find((p) => p.id === t)?.reactions ?? [];
|
|
1324
1324
|
try {
|
|
1325
|
-
let
|
|
1325
|
+
let p;
|
|
1326
1326
|
try {
|
|
1327
|
-
|
|
1327
|
+
p = await Ne().post(i, o);
|
|
1328
1328
|
} catch (k) {
|
|
1329
1329
|
if (!nl(k))
|
|
1330
1330
|
throw k;
|
|
1331
|
-
|
|
1331
|
+
p = await Ne().post(i, o);
|
|
1332
1332
|
}
|
|
1333
|
-
const h = gt(
|
|
1333
|
+
const h = gt(p.data) && "data" in p.data ? p.data.data : p.data, w = $i(
|
|
1334
1334
|
gt(h) ? h.reactions : void 0
|
|
1335
1335
|
);
|
|
1336
1336
|
(w.length > 0 || u.length === 0) && this.updateMessageReactions(e, t, w);
|
|
@@ -1341,8 +1341,8 @@ const Gt = ur("messaging", {
|
|
|
1341
1341
|
this.updateMessageReactions(e, t, M);
|
|
1342
1342
|
} catch {
|
|
1343
1343
|
}
|
|
1344
|
-
} catch (
|
|
1345
|
-
throw this.error = Je(
|
|
1344
|
+
} catch (p) {
|
|
1345
|
+
throw this.error = Je(p), p;
|
|
1346
1346
|
}
|
|
1347
1347
|
},
|
|
1348
1348
|
updateMessageReactions(e, t, n) {
|
|
@@ -1361,9 +1361,9 @@ const Gt = ur("messaging", {
|
|
|
1361
1361
|
if (!l) return;
|
|
1362
1362
|
const u = l.findIndex((k) => k.id === t);
|
|
1363
1363
|
if (u < 0) return;
|
|
1364
|
-
const
|
|
1365
|
-
if (!
|
|
1366
|
-
const h = { ...
|
|
1364
|
+
const p = l[u];
|
|
1365
|
+
if (!p) return;
|
|
1366
|
+
const h = { ...p };
|
|
1367
1367
|
n !== void 0 && (h.body = n), i !== void 0 && (h.edited_at = i), o !== void 0 && (h.meta = o), this.messages[e] = [
|
|
1368
1368
|
...l.slice(0, u),
|
|
1369
1369
|
h,
|
|
@@ -1371,8 +1371,8 @@ const Gt = ur("messaging", {
|
|
|
1371
1371
|
];
|
|
1372
1372
|
const w = this.conversations.find((k) => k.id === e);
|
|
1373
1373
|
w?.last_message?.id === t && (w.last_message = h);
|
|
1374
|
-
const
|
|
1375
|
-
|
|
1374
|
+
const y = this.requests.find((k) => k.id === e);
|
|
1375
|
+
y?.last_message?.id === t && (y.last_message = h);
|
|
1376
1376
|
},
|
|
1377
1377
|
addTypingUser(e, t) {
|
|
1378
1378
|
const n = this.typingUsers[e] ?? [];
|
|
@@ -1383,17 +1383,17 @@ const Gt = ur("messaging", {
|
|
|
1383
1383
|
},
|
|
1384
1384
|
updateConversationLastMessage(e, t) {
|
|
1385
1385
|
const n = (l) => {
|
|
1386
|
-
const u = l.find((
|
|
1386
|
+
const u = l.find((p) => p.id === e);
|
|
1387
1387
|
return u ? (u.last_message = t, u.last_message_at = t.created_at, !0) : !1;
|
|
1388
1388
|
}, i = n(this.conversations), o = n(this.requests);
|
|
1389
1389
|
i && this.conversations.sort(En), o && this.requests.sort(En);
|
|
1390
1390
|
},
|
|
1391
|
-
updatePresenceForUser(e, t, n) {
|
|
1392
|
-
const
|
|
1393
|
-
for (const
|
|
1394
|
-
|
|
1391
|
+
updatePresenceForUser(e, t, n, i = "realtime") {
|
|
1392
|
+
const o = t === "online" || t === "idle" || t === "dnd", l = (u) => {
|
|
1393
|
+
for (const p of u)
|
|
1394
|
+
p.type !== "dm" || p.other_user_id !== e || i === "snapshot" && o && Object.prototype.hasOwnProperty.call(p, "other_last_seen_at") && p.other_presence_status === "offline" && p.other_last_seen_at === null || (p.other_presence_status = t, p.other_online = o, n !== void 0 && (p.other_last_seen_at = n));
|
|
1395
1395
|
};
|
|
1396
|
-
|
|
1396
|
+
l(this.conversations), l(this.requests);
|
|
1397
1397
|
},
|
|
1398
1398
|
async refreshPresenceForUsers(e) {
|
|
1399
1399
|
const t = [...new Set(
|
|
@@ -1406,7 +1406,7 @@ const Gt = ur("messaging", {
|
|
|
1406
1406
|
}), i = n.data?.data?.items ?? n.data?.items ?? [];
|
|
1407
1407
|
for (const o of i) {
|
|
1408
1408
|
const l = Zn(o);
|
|
1409
|
-
l.status !== null && this.updatePresenceForUser(o.id, l.status, l.lastSeenAt);
|
|
1409
|
+
l.status !== null && this.updatePresenceForUser(o.id, l.status, l.lastSeenAt, "snapshot");
|
|
1410
1410
|
}
|
|
1411
1411
|
},
|
|
1412
1412
|
async acceptRequest(e) {
|
|
@@ -1498,15 +1498,15 @@ const Gt = ur("messaging", {
|
|
|
1498
1498
|
}
|
|
1499
1499
|
});
|
|
1500
1500
|
function ll(e) {
|
|
1501
|
-
const t = Gt(), n = It()(), i = N(!1), o = N(null), l = N(null), u = Ds(),
|
|
1502
|
-
let
|
|
1501
|
+
const t = Gt(), n = It()(), i = N(!1), o = N(null), l = N(null), u = Ds(), p = u !== null, h = 20, w = 250;
|
|
1502
|
+
let y = 0, k = null, x = null;
|
|
1503
1503
|
const M = C(() => n.currentUser?.id), A = () => or(e)?.trim() ?? "";
|
|
1504
1504
|
function P() {
|
|
1505
|
-
k && (clearTimeout(k), k = null),
|
|
1505
|
+
k && (clearTimeout(k), k = null), y = 0;
|
|
1506
1506
|
}
|
|
1507
1507
|
function $() {
|
|
1508
|
-
!
|
|
1509
|
-
k = null,
|
|
1508
|
+
!p || i.value || k || y >= h || (k = setTimeout(() => {
|
|
1509
|
+
k = null, y += 1, B();
|
|
1510
1510
|
}, w));
|
|
1511
1511
|
}
|
|
1512
1512
|
function R(O) {
|
|
@@ -1696,12 +1696,12 @@ function Rg(e = {}) {
|
|
|
1696
1696
|
const i = _l(e.source ?? "app"), o = {
|
|
1697
1697
|
...yl,
|
|
1698
1698
|
...e.icons
|
|
1699
|
-
}, l = N(i.getConnectionStatus()), u = N(null),
|
|
1699
|
+
}, l = N(i.getConnectionStatus()), u = N(null), p = N(0), h = N(!1), w = N(!1), y = N(!1), k = N(!1);
|
|
1700
1700
|
let x = null, M = null, A = null, P = null, $ = null, R = null, U = null;
|
|
1701
1701
|
const ae = C(() => l.value === "connected"), ce = C(() => l.value === "connecting"), E = C(() => l.value === "disconnected"), L = C(() => l.value === "error"), ee = C(() => E.value || L.value), ne = C(() => {
|
|
1702
1702
|
switch (l.value) {
|
|
1703
1703
|
case "connecting":
|
|
1704
|
-
return
|
|
1704
|
+
return p.value > 0 ? "Reconnecting..." : "Connecting...";
|
|
1705
1705
|
case "connected":
|
|
1706
1706
|
return "Connected";
|
|
1707
1707
|
case "disconnected":
|
|
@@ -1737,11 +1737,11 @@ function Rg(e = {}) {
|
|
|
1737
1737
|
return o.unknown;
|
|
1738
1738
|
}
|
|
1739
1739
|
}), pe = async () => {
|
|
1740
|
-
Ui.debug("Manual reconnect triggered"),
|
|
1740
|
+
Ui.debug("Manual reconnect triggered"), p.value += 1, await i.reconnect();
|
|
1741
1741
|
}, de = (V, H = l.value) => {
|
|
1742
1742
|
if (V !== "connecting" && M && (clearTimeout(M), M = null), V === "disconnected" || V === "error") {
|
|
1743
|
-
const I = !k.value && H === V,
|
|
1744
|
-
if (
|
|
1743
|
+
const I = !k.value && H === V, v = !w.value && (I || H === "connected" || H === "connecting");
|
|
1744
|
+
if (y.value = !0, v) {
|
|
1745
1745
|
h.value = !1, A && clearTimeout(A), A = setTimeout(() => {
|
|
1746
1746
|
A = null, l.value !== "connected" && (h.value = !0);
|
|
1747
1747
|
}, 5e3);
|
|
@@ -1751,7 +1751,7 @@ function Rg(e = {}) {
|
|
|
1751
1751
|
return;
|
|
1752
1752
|
}
|
|
1753
1753
|
if (V === "connected") {
|
|
1754
|
-
A && (clearTimeout(A), A = null), h.value = !1, w.value = !1,
|
|
1754
|
+
A && (clearTimeout(A), A = null), h.value = !1, w.value = !1, y.value = !1;
|
|
1755
1755
|
return;
|
|
1756
1756
|
}
|
|
1757
1757
|
if (V === "connecting") {
|
|
@@ -1759,7 +1759,7 @@ function Rg(e = {}) {
|
|
|
1759
1759
|
h.value = !0;
|
|
1760
1760
|
return;
|
|
1761
1761
|
}
|
|
1762
|
-
if (
|
|
1762
|
+
if (y.value || (h.value = !1), M)
|
|
1763
1763
|
return;
|
|
1764
1764
|
M = setTimeout(() => {
|
|
1765
1765
|
if (M = null, l.value === "connecting") {
|
|
@@ -1767,7 +1767,7 @@ function Rg(e = {}) {
|
|
|
1767
1767
|
O("connected");
|
|
1768
1768
|
return;
|
|
1769
1769
|
}
|
|
1770
|
-
w.value = !0, Ui.warn("Still connecting after 10s, treating as disconnected"), O("disconnected"),
|
|
1770
|
+
w.value = !0, Ui.warn("Still connecting after 10s, treating as disconnected"), O("disconnected"), p.value += 1, i.reconnect();
|
|
1771
1771
|
}
|
|
1772
1772
|
}, 1e4);
|
|
1773
1773
|
}
|
|
@@ -1777,7 +1777,7 @@ function Rg(e = {}) {
|
|
|
1777
1777
|
l.value = "disconnected", de("disconnected", H);
|
|
1778
1778
|
return;
|
|
1779
1779
|
}
|
|
1780
|
-
l.value = V, V === "connecting" && (H === "disconnected" || H === "error") &&
|
|
1780
|
+
l.value = V, V === "connecting" && (H === "disconnected" || H === "error") && p.value === 0 && (p.value = 1), V === "connected" && (u.value = /* @__PURE__ */ new Date(), p.value = 0), de(V, H);
|
|
1781
1781
|
}, j = () => {
|
|
1782
1782
|
const V = Ni(i), H = l.value;
|
|
1783
1783
|
if (V === "connected" && H !== "connected") {
|
|
@@ -1853,7 +1853,7 @@ function Rg(e = {}) {
|
|
|
1853
1853
|
showConnectionBanner: C(() => h.value),
|
|
1854
1854
|
lastConnectionTime: C(() => u.value),
|
|
1855
1855
|
connectionUptime: ge,
|
|
1856
|
-
reconnectAttempts: C(() =>
|
|
1856
|
+
reconnectAttempts: C(() => p.value),
|
|
1857
1857
|
reconnect: pe
|
|
1858
1858
|
};
|
|
1859
1859
|
}
|
|
@@ -1871,8 +1871,8 @@ function kl() {
|
|
|
1871
1871
|
}
|
|
1872
1872
|
const rn = Xs()("GlobalMessaging"), Sl = 25, Tl = 3e3, Ml = (e) => e.replace(/\/+$/, ""), xl = (e) => Ml(window.location.pathname) === `/messages/${e}`, El = (e) => e.is_muted ? !0 : typeof e.muted_until == "string" && e.muted_until.length > 0;
|
|
1873
1873
|
function Pg() {
|
|
1874
|
-
const e = Gt(), t = It()(), n = wl(), i = js(), o = dr(), l = Ds(), { conversations: u, requestConversations:
|
|
1875
|
-
let
|
|
1874
|
+
const e = Gt(), t = It()(), n = wl(), i = js(), o = dr(), l = Ds(), { conversations: u, requestConversations: p } = no(e), h = /* @__PURE__ */ new Set(), w = /* @__PURE__ */ new Map();
|
|
1875
|
+
let y = !1;
|
|
1876
1876
|
function k(B) {
|
|
1877
1877
|
const X = w.get(B);
|
|
1878
1878
|
if (X) {
|
|
@@ -1904,12 +1904,12 @@ function Pg() {
|
|
|
1904
1904
|
if (!X || h.has(B)) return;
|
|
1905
1905
|
const pe = `conversation.${B}`;
|
|
1906
1906
|
k(B);
|
|
1907
|
-
const de = X.private(pe), O = (
|
|
1908
|
-
if (!vo(
|
|
1909
|
-
rn.warn("Dropping malformed ConversationMessageSent event",
|
|
1907
|
+
const de = X.private(pe), O = (v) => {
|
|
1908
|
+
if (!vo(v)) {
|
|
1909
|
+
rn.warn("Dropping malformed ConversationMessageSent event", v);
|
|
1910
1910
|
return;
|
|
1911
1911
|
}
|
|
1912
|
-
const f =
|
|
1912
|
+
const f = v, T = t.currentUser?.id;
|
|
1913
1913
|
if (!T || f.message.author_id === T) return;
|
|
1914
1914
|
e.addMessage(f.message);
|
|
1915
1915
|
const ie = e.hasDetailSubscription(f.conversation_id), Ce = xl(f.conversation_id);
|
|
@@ -1924,25 +1924,25 @@ function Pg() {
|
|
|
1924
1924
|
const we = El(Se);
|
|
1925
1925
|
we || Se.unread_count++, n(we);
|
|
1926
1926
|
}
|
|
1927
|
-
}, j = (
|
|
1928
|
-
if (!go(
|
|
1929
|
-
rn.warn("Dropping malformed ConversationMessageRead event",
|
|
1927
|
+
}, j = (v) => {
|
|
1928
|
+
if (!go(v)) {
|
|
1929
|
+
rn.warn("Dropping malformed ConversationMessageRead event", v);
|
|
1930
1930
|
return;
|
|
1931
1931
|
}
|
|
1932
|
-
e.applyParticipantReadState(
|
|
1933
|
-
}, me = (
|
|
1934
|
-
if (!_o(
|
|
1935
|
-
rn.warn("Dropping malformed MessageReactionToggled event",
|
|
1932
|
+
e.applyParticipantReadState(v);
|
|
1933
|
+
}, me = (v) => {
|
|
1934
|
+
if (!_o(v)) {
|
|
1935
|
+
rn.warn("Dropping malformed MessageReactionToggled event", v);
|
|
1936
1936
|
return;
|
|
1937
1937
|
}
|
|
1938
|
-
const f =
|
|
1938
|
+
const f = v;
|
|
1939
1939
|
e.updateMessageReactions(f.conversation_id, f.message_id, f.reactions);
|
|
1940
|
-
}, ge = (
|
|
1941
|
-
if (!bo(
|
|
1942
|
-
rn.warn("Dropping malformed ConversationMessageEdited event",
|
|
1940
|
+
}, ge = (v) => {
|
|
1941
|
+
if (!bo(v)) {
|
|
1942
|
+
rn.warn("Dropping malformed ConversationMessageEdited event", v);
|
|
1943
1943
|
return;
|
|
1944
1944
|
}
|
|
1945
|
-
const f =
|
|
1945
|
+
const f = v;
|
|
1946
1946
|
e.applyMessageEdit(
|
|
1947
1947
|
f.conversation_id,
|
|
1948
1948
|
f.message.id,
|
|
@@ -1950,19 +1950,19 @@ function Pg() {
|
|
|
1950
1950
|
f.message.edited_at,
|
|
1951
1951
|
f.message.meta
|
|
1952
1952
|
);
|
|
1953
|
-
}, V = (
|
|
1954
|
-
if (!yo(
|
|
1955
|
-
rn.warn("Dropping malformed ConversationMessageDeleted event",
|
|
1953
|
+
}, V = (v) => {
|
|
1954
|
+
if (!yo(v)) {
|
|
1955
|
+
rn.warn("Dropping malformed ConversationMessageDeleted event", v);
|
|
1956
1956
|
return;
|
|
1957
1957
|
}
|
|
1958
|
-
const f =
|
|
1958
|
+
const f = v;
|
|
1959
1959
|
e.removeMessage(f.conversation_id, f.message_id);
|
|
1960
|
-
}, H = (
|
|
1961
|
-
if (!wo(
|
|
1962
|
-
rn.warn("Dropping malformed ConversationRequestAccepted event",
|
|
1960
|
+
}, H = (v) => {
|
|
1961
|
+
if (!wo(v)) {
|
|
1962
|
+
rn.warn("Dropping malformed ConversationRequestAccepted event", v);
|
|
1963
1963
|
return;
|
|
1964
1964
|
}
|
|
1965
|
-
const f =
|
|
1965
|
+
const f = v, T = e.getConversationById(f.conversation_id);
|
|
1966
1966
|
T && (T.is_request = !1), e.requests = e.requests.filter(
|
|
1967
1967
|
(ie) => ie.id !== f.conversation_id
|
|
1968
1968
|
);
|
|
@@ -2036,7 +2036,8 @@ function Pg() {
|
|
|
2036
2036
|
X.status !== null && e.updatePresenceForUser(
|
|
2037
2037
|
B.user_id,
|
|
2038
2038
|
X.status,
|
|
2039
|
-
X.lastSeenAt
|
|
2039
|
+
X.lastSeenAt,
|
|
2040
|
+
"realtime"
|
|
2040
2041
|
);
|
|
2041
2042
|
}
|
|
2042
2043
|
async function R() {
|
|
@@ -2050,17 +2051,17 @@ function Pg() {
|
|
|
2050
2051
|
}), pe = X.data?.data?.items ?? X.data?.items ?? [];
|
|
2051
2052
|
for (const de of pe) {
|
|
2052
2053
|
const O = Zn(de);
|
|
2053
|
-
O.status !== null && e.updatePresenceForUser(de.id, O.status, O.lastSeenAt);
|
|
2054
|
+
O.status !== null && e.updatePresenceForUser(de.id, O.status, O.lastSeenAt, "snapshot");
|
|
2054
2055
|
}
|
|
2055
2056
|
} catch (X) {
|
|
2056
2057
|
rn.warn("Failed to refresh messaging presence snapshot", X);
|
|
2057
2058
|
}
|
|
2058
2059
|
}
|
|
2059
2060
|
function U() {
|
|
2060
|
-
!Zt() ||
|
|
2061
|
+
!Zt() || y || (oo($), y = !0);
|
|
2061
2062
|
}
|
|
2062
2063
|
function ae() {
|
|
2063
|
-
|
|
2064
|
+
y && (lo(), y = !1);
|
|
2064
2065
|
}
|
|
2065
2066
|
const ce = Xe(
|
|
2066
2067
|
u,
|
|
@@ -2069,7 +2070,7 @@ function Pg() {
|
|
|
2069
2070
|
},
|
|
2070
2071
|
{ deep: !1, immediate: !0 }
|
|
2071
2072
|
), E = Xe(
|
|
2072
|
-
|
|
2073
|
+
p,
|
|
2073
2074
|
() => {
|
|
2074
2075
|
P();
|
|
2075
2076
|
},
|
|
@@ -2254,7 +2255,7 @@ function Xl(e, t, n) {
|
|
|
2254
2255
|
}
|
|
2255
2256
|
function Lg() {
|
|
2256
2257
|
const e = It()(), t = $l(), n = js(), i = jl(t.clientIdStorageKey);
|
|
2257
|
-
let o = null, l = null, u = !1,
|
|
2258
|
+
let o = null, l = null, u = !1, p = Ts(t.accountLimitedUntilStorageKey), h = !1, w = !1, y = null, k = 0;
|
|
2258
2259
|
const x = () => Pl(t) ? t.authTokenResolver() !== null : !0, M = () => {
|
|
2259
2260
|
o && (clearInterval(o), o = null);
|
|
2260
2261
|
}, A = () => {
|
|
@@ -2264,24 +2265,24 @@ function Lg() {
|
|
|
2264
2265
|
B();
|
|
2265
2266
|
}, t.heartbeatIntervalMs);
|
|
2266
2267
|
}, $ = (j) => {
|
|
2267
|
-
|
|
2268
|
+
p || console.warn(j), ql(t.accountLimitedUntilStorageKey), p = !0, u = !1, y = null, M(), A();
|
|
2268
2269
|
}, R = async (j) => {
|
|
2269
|
-
if (!(!u || w ||
|
|
2270
|
+
if (!(!u || w || p || h) && x() && y !== j)
|
|
2270
2271
|
try {
|
|
2271
|
-
await n.patch(t.statusUrl, { status: j }),
|
|
2272
|
+
await n.patch(t.statusUrl, { status: j }), y = j;
|
|
2272
2273
|
} catch (me) {
|
|
2273
2274
|
if (ks(me)) {
|
|
2274
2275
|
$("[Presence] Presence updates paused: account is temporarily limited");
|
|
2275
2276
|
return;
|
|
2276
2277
|
}
|
|
2277
|
-
Ss(me) && (h = !0, u = !1,
|
|
2278
|
+
Ss(me) && (h = !0, u = !1, y = null, M(), A());
|
|
2278
2279
|
}
|
|
2279
2280
|
}, U = () => {
|
|
2280
|
-
A(), !(!u || w ||
|
|
2281
|
+
A(), !(!u || w || p || h || document.visibilityState !== "visible") && (l = setTimeout(() => {
|
|
2281
2282
|
l = null, R("idle");
|
|
2282
2283
|
}, t.idleAfterMs));
|
|
2283
2284
|
}, ae = () => {
|
|
2284
|
-
if (w || !u ||
|
|
2285
|
+
if (w || !u || p || h || document.visibilityState !== "visible")
|
|
2285
2286
|
return;
|
|
2286
2287
|
const j = Date.now();
|
|
2287
2288
|
j - k < t.activityDebounceMs || (k = j, R("online"), U());
|
|
@@ -2293,14 +2294,14 @@ function Lg() {
|
|
|
2293
2294
|
typeof document > "u" || typeof window > "u" || (document.removeEventListener("pointerdown", ce), document.removeEventListener("keydown", ce), document.removeEventListener("touchstart", ce), window.removeEventListener("focus", ce));
|
|
2294
2295
|
}, ee = async () => {
|
|
2295
2296
|
if (Ts(t.accountLimitedUntilStorageKey))
|
|
2296
|
-
return
|
|
2297
|
+
return p = !0, "account_limited";
|
|
2297
2298
|
try {
|
|
2298
2299
|
return await n.post(t.sessionOpenUrl, {
|
|
2299
2300
|
client_id: i,
|
|
2300
2301
|
user_agent: t.userAgentResolver()
|
|
2301
|
-
}), Hl(t.accountLimitedUntilStorageKey),
|
|
2302
|
+
}), Hl(t.accountLimitedUntilStorageKey), p = !1, h = !1, u = !0, y = null, "opened";
|
|
2302
2303
|
} catch (j) {
|
|
2303
|
-
return ks(j) ? ($("[Presence] Session open skipped: account is temporarily limited"), "account_limited") : Ss(j) ? (h = !0, u = !1,
|
|
2304
|
+
return ks(j) ? ($("[Presence] Session open skipped: account is temporarily limited"), "account_limited") : Ss(j) ? (h = !0, u = !1, y = null, M(), A(), "account_suspended") : "failed";
|
|
2304
2305
|
}
|
|
2305
2306
|
}, ne = async () => {
|
|
2306
2307
|
for (let j = 0; j < Nl; j += 1)
|
|
@@ -2316,12 +2317,12 @@ function Lg() {
|
|
|
2316
2317
|
$("[Presence] Heartbeat paused: account is temporarily limited");
|
|
2317
2318
|
return;
|
|
2318
2319
|
}
|
|
2319
|
-
Ss(j) && (h = !0, u = !1,
|
|
2320
|
+
Ss(j) && (h = !0, u = !1, y = null, M(), A());
|
|
2320
2321
|
}
|
|
2321
2322
|
}, X = () => {
|
|
2322
2323
|
if (!u)
|
|
2323
2324
|
return;
|
|
2324
|
-
u = !1,
|
|
2325
|
+
u = !1, y = null, A();
|
|
2325
2326
|
const j = Xl(
|
|
2326
2327
|
t.sessionCloseUrl,
|
|
2327
2328
|
i,
|
|
@@ -2349,10 +2350,10 @@ function Lg() {
|
|
|
2349
2350
|
return;
|
|
2350
2351
|
}
|
|
2351
2352
|
if (document.visibilityState === "visible" && !u) {
|
|
2352
|
-
|
|
2353
|
+
p = Ts(t.accountLimitedUntilStorageKey), !p && !h && pe();
|
|
2353
2354
|
return;
|
|
2354
2355
|
}
|
|
2355
|
-
document.visibilityState === "visible" && u && !
|
|
2356
|
+
document.visibilityState === "visible" && u && !p && !h && ae();
|
|
2356
2357
|
}
|
|
2357
2358
|
}, O = () => {
|
|
2358
2359
|
w || (X(), M(), A());
|
|
@@ -2371,7 +2372,7 @@ function Lg() {
|
|
|
2371
2372
|
}
|
|
2372
2373
|
const Kl = 12e3;
|
|
2373
2374
|
function Yl(e) {
|
|
2374
|
-
const t = Gt(), n = It()(), i = N(!1), o = N(null), l = N(null), u = N([]),
|
|
2375
|
+
const t = Gt(), n = It()(), i = N(!1), o = N(null), l = N(null), u = N([]), p = /* @__PURE__ */ new Map(), h = Ds(), w = h !== null, y = 20, k = 250;
|
|
2375
2376
|
let x = !1, M = null, A = 0, P = null;
|
|
2376
2377
|
const $ = C(() => n.currentUser?.id), R = () => or(e)?.trim() ?? "", U = () => {
|
|
2377
2378
|
const f = l.value?.trim() ?? "";
|
|
@@ -2385,24 +2386,24 @@ function Yl(e) {
|
|
|
2385
2386
|
t.removeTypingUser(f, ie.id);
|
|
2386
2387
|
u.value = [];
|
|
2387
2388
|
}, E = (f) => {
|
|
2388
|
-
const T =
|
|
2389
|
-
T && (clearTimeout(T),
|
|
2389
|
+
const T = p.get(f);
|
|
2390
|
+
T && (clearTimeout(T), p.delete(f));
|
|
2390
2391
|
}, L = () => {
|
|
2391
|
-
for (const f of
|
|
2392
|
+
for (const f of p.values())
|
|
2392
2393
|
clearTimeout(f);
|
|
2393
|
-
|
|
2394
|
+
p.clear();
|
|
2394
2395
|
}, ee = () => {
|
|
2395
2396
|
P && (clearTimeout(P), P = null), A = 0;
|
|
2396
2397
|
}, ne = () => {
|
|
2397
|
-
!w || i.value || P || A >=
|
|
2398
|
+
!w || i.value || P || A >= y || (P = setTimeout(() => {
|
|
2398
2399
|
P = null, A += 1, de();
|
|
2399
2400
|
}, k));
|
|
2400
2401
|
}, B = (f, T) => {
|
|
2401
2402
|
E(f);
|
|
2402
2403
|
const ie = setTimeout(() => {
|
|
2403
|
-
|
|
2404
|
+
p.delete(f), t.removeTypingUser(T, f), u.value = u.value.filter((Ce) => Ce.id !== f);
|
|
2404
2405
|
}, Kl);
|
|
2405
|
-
|
|
2406
|
+
p.set(f, ie);
|
|
2406
2407
|
}, X = () => {
|
|
2407
2408
|
x = !0, ee();
|
|
2408
2409
|
}, pe = (f) => {
|
|
@@ -2496,7 +2497,7 @@ function Yl(e) {
|
|
|
2496
2497
|
R() && (M && (M(), M = null), i.value = !1, l.value = null, de());
|
|
2497
2498
|
};
|
|
2498
2499
|
typeof window < "u" && window.addEventListener(Pn(), I);
|
|
2499
|
-
const
|
|
2500
|
+
const v = is((f) => {
|
|
2500
2501
|
if (f === "connected") {
|
|
2501
2502
|
i.value || de();
|
|
2502
2503
|
return;
|
|
@@ -2508,7 +2509,7 @@ function Yl(e) {
|
|
|
2508
2509
|
}
|
|
2509
2510
|
});
|
|
2510
2511
|
return h !== null && Nt(() => {
|
|
2511
|
-
X(),
|
|
2512
|
+
X(), v(), L(), O(), typeof window < "u" && window.removeEventListener(Pn(), I);
|
|
2512
2513
|
}), {
|
|
2513
2514
|
isSubscribed: C(() => i.value),
|
|
2514
2515
|
error: C(() => o.value),
|
|
@@ -2520,7 +2521,7 @@ function Yl(e) {
|
|
|
2520
2521
|
};
|
|
2521
2522
|
}
|
|
2522
2523
|
const Jl = () => {
|
|
2523
|
-
const e = typeof window < "u", t = N(e ? window.innerWidth : 1024), n = N(e ? window.innerHeight : 768), i = N(e ? window.matchMedia("(pointer: coarse)").matches : !1), o = C(() => i.value && n.value <= 500), l = C(() => t.value < 768 || o.value), u = C(() => !o.value && t.value >= 768 && t.value < 1024),
|
|
2524
|
+
const e = typeof window < "u", t = N(e ? window.innerWidth : 1024), n = N(e ? window.innerHeight : 768), i = N(e ? window.matchMedia("(pointer: coarse)").matches : !1), o = C(() => i.value && n.value <= 500), l = C(() => t.value < 768 || o.value), u = C(() => !o.value && t.value >= 768 && t.value < 1024), p = C(() => !o.value && t.value >= 1024);
|
|
2524
2525
|
let h = null;
|
|
2525
2526
|
const w = () => {
|
|
2526
2527
|
h !== null && clearTimeout(h), h = setTimeout(() => {
|
|
@@ -2537,7 +2538,7 @@ const Jl = () => {
|
|
|
2537
2538
|
isMobile: l,
|
|
2538
2539
|
isPhoneLandscape: o,
|
|
2539
2540
|
isTablet: u,
|
|
2540
|
-
isDesktop:
|
|
2541
|
+
isDesktop: p
|
|
2541
2542
|
};
|
|
2542
2543
|
};
|
|
2543
2544
|
function Zl(e) {
|
|
@@ -2550,14 +2551,14 @@ function Zl(e) {
|
|
|
2550
2551
|
}, u = () => {
|
|
2551
2552
|
const A = e.containerRef.value;
|
|
2552
2553
|
A instanceof HTMLElement && M(A.scrollTop);
|
|
2553
|
-
},
|
|
2554
|
+
}, p = () => {
|
|
2554
2555
|
i && (i.removeEventListener("scroll", u, { capture: !1 }), i = null);
|
|
2555
2556
|
}, h = () => {
|
|
2556
2557
|
const A = e.containerRef.value;
|
|
2557
|
-
i !== A && (
|
|
2558
|
+
i !== A && (p(), A instanceof HTMLElement && (i = A, A.addEventListener("scroll", u, { passive: !0 })));
|
|
2558
2559
|
}, w = () => {
|
|
2559
|
-
t?.disconnect(), t = null,
|
|
2560
|
-
},
|
|
2560
|
+
t?.disconnect(), t = null, p();
|
|
2561
|
+
}, y = () => {
|
|
2561
2562
|
if (h(), t?.disconnect(), t = null, typeof window > "u" || typeof window.IntersectionObserver != "function")
|
|
2562
2563
|
return;
|
|
2563
2564
|
const A = e.containerRef.value, P = e.sentinelRef.value;
|
|
@@ -2587,12 +2588,12 @@ function Zl(e) {
|
|
|
2587
2588
|
[e.containerRef, e.sentinelRef],
|
|
2588
2589
|
() => {
|
|
2589
2590
|
ct(() => {
|
|
2590
|
-
|
|
2591
|
+
y();
|
|
2591
2592
|
});
|
|
2592
2593
|
}
|
|
2593
2594
|
), Yt(() => {
|
|
2594
2595
|
ct(() => {
|
|
2595
|
-
|
|
2596
|
+
y();
|
|
2596
2597
|
});
|
|
2597
2598
|
}), Nt(() => {
|
|
2598
2599
|
w();
|
|
@@ -2601,7 +2602,7 @@ function Zl(e) {
|
|
|
2601
2602
|
destroyInfiniteObserver: w,
|
|
2602
2603
|
maybeLoadMoreAtScrollTop: M,
|
|
2603
2604
|
resetDebounce: x,
|
|
2604
|
-
setupInfiniteObserver:
|
|
2605
|
+
setupInfiniteObserver: y
|
|
2605
2606
|
};
|
|
2606
2607
|
}
|
|
2607
2608
|
function Hr(e) {
|
|
@@ -2612,7 +2613,7 @@ function Ql(e) {
|
|
|
2612
2613
|
let i = null;
|
|
2613
2614
|
const o = C(() => {
|
|
2614
2615
|
const w = e.currentUserId.value;
|
|
2615
|
-
return e.typingUsers.value.filter((
|
|
2616
|
+
return e.typingUsers.value.filter((y) => y.id !== w);
|
|
2616
2617
|
}), l = () => {
|
|
2617
2618
|
i !== null && (clearTimeout(i), i = null);
|
|
2618
2619
|
}, u = () => {
|
|
@@ -2634,12 +2635,12 @@ function Ql(e) {
|
|
|
2634
2635
|
immediate: !0
|
|
2635
2636
|
}
|
|
2636
2637
|
);
|
|
2637
|
-
const
|
|
2638
|
+
const p = C(() => t.value.length > 0), h = C(() => Hr(t.value));
|
|
2638
2639
|
return Nt(() => {
|
|
2639
2640
|
l();
|
|
2640
2641
|
}), {
|
|
2641
2642
|
clearVisibleTypingUsers: u,
|
|
2642
|
-
hasVisibleTypingUsers:
|
|
2643
|
+
hasVisibleTypingUsers: p,
|
|
2643
2644
|
typingText: h,
|
|
2644
2645
|
visibleTypingUsers: t
|
|
2645
2646
|
};
|
|
@@ -3718,17 +3719,17 @@ function Mc() {
|
|
|
3718
3719
|
};
|
|
3719
3720
|
return n[l].call(u.exports, u, u.exports, o), u.l = !0, u.exports;
|
|
3720
3721
|
}
|
|
3721
|
-
return o.m = n, o.c = i, o.d = function(l, u,
|
|
3722
|
-
o.o(l, u) || Object.defineProperty(l, u, { enumerable: !0, get:
|
|
3722
|
+
return o.m = n, o.c = i, o.d = function(l, u, p) {
|
|
3723
|
+
o.o(l, u) || Object.defineProperty(l, u, { enumerable: !0, get: p });
|
|
3723
3724
|
}, o.r = function(l) {
|
|
3724
3725
|
typeof Symbol < "u" && Symbol.toStringTag && Object.defineProperty(l, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(l, "__esModule", { value: !0 });
|
|
3725
3726
|
}, o.t = function(l, u) {
|
|
3726
3727
|
if (u & 1 && (l = o(l)), u & 8 || u & 4 && typeof l == "object" && l && l.__esModule) return l;
|
|
3727
|
-
var
|
|
3728
|
-
if (o.r(
|
|
3728
|
+
var p = /* @__PURE__ */ Object.create(null);
|
|
3729
|
+
if (o.r(p), Object.defineProperty(p, "default", { enumerable: !0, value: l }), u & 2 && typeof l != "string") for (var h in l) o.d(p, h, (function(w) {
|
|
3729
3730
|
return l[w];
|
|
3730
3731
|
}).bind(null, h));
|
|
3731
|
-
return
|
|
3732
|
+
return p;
|
|
3732
3733
|
}, o.n = function(l) {
|
|
3733
3734
|
var u = l && l.__esModule ? (
|
|
3734
3735
|
/******/
|
|
@@ -3766,7 +3767,7 @@ function Mc() {
|
|
|
3766
3767
|
};
|
|
3767
3768
|
})();
|
|
3768
3769
|
Object.defineProperty(i, "__esModule", { value: !0 });
|
|
3769
|
-
var u = 256,
|
|
3770
|
+
var u = 256, p = (
|
|
3770
3771
|
/** @class */
|
|
3771
3772
|
(function() {
|
|
3772
3773
|
function P($) {
|
|
@@ -3815,16 +3816,16 @@ function Mc() {
|
|
|
3815
3816
|
}, P;
|
|
3816
3817
|
})()
|
|
3817
3818
|
);
|
|
3818
|
-
i.Coder =
|
|
3819
|
-
var h = new
|
|
3819
|
+
i.Coder = p;
|
|
3820
|
+
var h = new p();
|
|
3820
3821
|
function w(P) {
|
|
3821
3822
|
return h.encode(P);
|
|
3822
3823
|
}
|
|
3823
3824
|
i.encode = w;
|
|
3824
|
-
function
|
|
3825
|
+
function y(P) {
|
|
3825
3826
|
return h.decode(P);
|
|
3826
3827
|
}
|
|
3827
|
-
i.decode =
|
|
3828
|
+
i.decode = y;
|
|
3828
3829
|
var k = (
|
|
3829
3830
|
/** @class */
|
|
3830
3831
|
(function(P) {
|
|
@@ -3839,7 +3840,7 @@ function Mc() {
|
|
|
3839
3840
|
var U = u;
|
|
3840
3841
|
return U += (44 - R & R - 46) >>> 8 & -u + R - 45 + 62, U += (94 - R & R - 96) >>> 8 & -u + R - 95 + 63, U += (47 - R & R - 58) >>> 8 & -u + R - 48 + 52, U += (64 - R & R - 91) >>> 8 & -u + R - 65 + 0, U += (96 - R & R - 123) >>> 8 & -u + R - 97 + 26, U;
|
|
3841
3842
|
}, $;
|
|
3842
|
-
})(
|
|
3843
|
+
})(p)
|
|
3843
3844
|
);
|
|
3844
3845
|
i.URLSafeCoder = k;
|
|
3845
3846
|
var x = new k();
|
|
@@ -3863,17 +3864,17 @@ function Mc() {
|
|
|
3863
3864
|
(function(n, i, o) {
|
|
3864
3865
|
Object.defineProperty(i, "__esModule", { value: !0 });
|
|
3865
3866
|
var l = "utf8: invalid string", u = "utf8: invalid source encoding";
|
|
3866
|
-
function y
|
|
3867
|
-
for (var k = new Uint8Array(h(
|
|
3868
|
-
var A =
|
|
3869
|
-
A < 128 ? k[x++] = A : A < 2048 ? (k[x++] = 192 | A >> 6, k[x++] = 128 | A & 63) : A < 55296 ? (k[x++] = 224 | A >> 12, k[x++] = 128 | A >> 6 & 63, k[x++] = 128 | A & 63) : (M++, A = (A & 1023) << 10, A |=
|
|
3867
|
+
function p(y) {
|
|
3868
|
+
for (var k = new Uint8Array(h(y)), x = 0, M = 0; M < y.length; M++) {
|
|
3869
|
+
var A = y.charCodeAt(M);
|
|
3870
|
+
A < 128 ? k[x++] = A : A < 2048 ? (k[x++] = 192 | A >> 6, k[x++] = 128 | A & 63) : A < 55296 ? (k[x++] = 224 | A >> 12, k[x++] = 128 | A >> 6 & 63, k[x++] = 128 | A & 63) : (M++, A = (A & 1023) << 10, A |= y.charCodeAt(M) & 1023, A += 65536, k[x++] = 240 | A >> 18, k[x++] = 128 | A >> 12 & 63, k[x++] = 128 | A >> 6 & 63, k[x++] = 128 | A & 63);
|
|
3870
3871
|
}
|
|
3871
3872
|
return k;
|
|
3872
3873
|
}
|
|
3873
|
-
i.encode =
|
|
3874
|
-
function h(
|
|
3875
|
-
for (var k = 0, x = 0; x <
|
|
3876
|
-
var M =
|
|
3874
|
+
i.encode = p;
|
|
3875
|
+
function h(y) {
|
|
3876
|
+
for (var k = 0, x = 0; x < y.length; x++) {
|
|
3877
|
+
var M = y.charCodeAt(x);
|
|
3877
3878
|
if (M < 128)
|
|
3878
3879
|
k += 1;
|
|
3879
3880
|
else if (M < 2048)
|
|
@@ -3881,7 +3882,7 @@ function Mc() {
|
|
|
3881
3882
|
else if (M < 55296)
|
|
3882
3883
|
k += 3;
|
|
3883
3884
|
else if (M <= 57343) {
|
|
3884
|
-
if (x >=
|
|
3885
|
+
if (x >= y.length - 1)
|
|
3885
3886
|
throw new Error(l);
|
|
3886
3887
|
x++, k += 4;
|
|
3887
3888
|
} else
|
|
@@ -3890,29 +3891,29 @@ function Mc() {
|
|
|
3890
3891
|
return k;
|
|
3891
3892
|
}
|
|
3892
3893
|
i.encodedLength = h;
|
|
3893
|
-
function w(
|
|
3894
|
-
for (var k = [], x = 0; x <
|
|
3895
|
-
var M =
|
|
3894
|
+
function w(y) {
|
|
3895
|
+
for (var k = [], x = 0; x < y.length; x++) {
|
|
3896
|
+
var M = y[x];
|
|
3896
3897
|
if (M & 128) {
|
|
3897
3898
|
var A = void 0;
|
|
3898
3899
|
if (M < 224) {
|
|
3899
|
-
if (x >=
|
|
3900
|
+
if (x >= y.length)
|
|
3900
3901
|
throw new Error(u);
|
|
3901
|
-
var P =
|
|
3902
|
+
var P = y[++x];
|
|
3902
3903
|
if ((P & 192) !== 128)
|
|
3903
3904
|
throw new Error(u);
|
|
3904
3905
|
M = (M & 31) << 6 | P & 63, A = 128;
|
|
3905
3906
|
} else if (M < 240) {
|
|
3906
|
-
if (x >=
|
|
3907
|
+
if (x >= y.length - 1)
|
|
3907
3908
|
throw new Error(u);
|
|
3908
|
-
var P =
|
|
3909
|
+
var P = y[++x], $ = y[++x];
|
|
3909
3910
|
if ((P & 192) !== 128 || ($ & 192) !== 128)
|
|
3910
3911
|
throw new Error(u);
|
|
3911
3912
|
M = (M & 15) << 12 | (P & 63) << 6 | $ & 63, A = 2048;
|
|
3912
3913
|
} else if (M < 248) {
|
|
3913
|
-
if (x >=
|
|
3914
|
+
if (x >= y.length - 2)
|
|
3914
3915
|
throw new Error(u);
|
|
3915
|
-
var P =
|
|
3916
|
+
var P = y[++x], $ = y[++x], R = y[++x];
|
|
3916
3917
|
if ((P & 192) !== 128 || ($ & 192) !== 128 || (R & 192) !== 128)
|
|
3917
3918
|
throw new Error(u);
|
|
3918
3919
|
M = (M & 15) << 18 | (P & 63) << 12 | ($ & 63) << 6 | R & 63, A = 65536;
|
|
@@ -3947,16 +3948,16 @@ function Mc() {
|
|
|
3947
3948
|
}
|
|
3948
3949
|
create(s) {
|
|
3949
3950
|
this.lastId++;
|
|
3950
|
-
var r = this.lastId, d = this.prefix + r,
|
|
3951
|
+
var r = this.lastId, d = this.prefix + r, g = this.name + "[" + r + "]", G = !1, he = function() {
|
|
3951
3952
|
G || (s.apply(null, arguments), G = !0);
|
|
3952
3953
|
};
|
|
3953
|
-
return this[r] = he, { number: r, id: d, name:
|
|
3954
|
+
return this[r] = he, { number: r, id: d, name: g, callback: he };
|
|
3954
3955
|
}
|
|
3955
3956
|
remove(s) {
|
|
3956
3957
|
delete this[s.number];
|
|
3957
3958
|
}
|
|
3958
3959
|
}
|
|
3959
|
-
var u = new l("_pusher_script_", "Pusher.ScriptReceivers"),
|
|
3960
|
+
var u = new l("_pusher_script_", "Pusher.ScriptReceivers"), p = {
|
|
3960
3961
|
VERSION: "8.4.0",
|
|
3961
3962
|
PROTOCOL: 7,
|
|
3962
3963
|
wsPort: 80,
|
|
@@ -3983,21 +3984,21 @@ function Mc() {
|
|
|
3983
3984
|
cdn_http: "http://js.pusher.com",
|
|
3984
3985
|
cdn_https: "https://js.pusher.com",
|
|
3985
3986
|
dependency_suffix: ""
|
|
3986
|
-
}, h =
|
|
3987
|
+
}, h = p;
|
|
3987
3988
|
class w {
|
|
3988
3989
|
constructor(s) {
|
|
3989
3990
|
this.options = s, this.receivers = s.receivers || u, this.loading = {};
|
|
3990
3991
|
}
|
|
3991
3992
|
load(s, r, d) {
|
|
3992
|
-
var
|
|
3993
|
-
if (
|
|
3994
|
-
|
|
3993
|
+
var g = this;
|
|
3994
|
+
if (g.loading[s] && g.loading[s].length > 0)
|
|
3995
|
+
g.loading[s].push(d);
|
|
3995
3996
|
else {
|
|
3996
|
-
|
|
3997
|
-
var G = Ue.createScriptRequest(
|
|
3998
|
-
if (
|
|
3999
|
-
var Oe =
|
|
4000
|
-
delete
|
|
3997
|
+
g.loading[s] = [d];
|
|
3998
|
+
var G = Ue.createScriptRequest(g.getPath(s, r)), he = g.receivers.create(function(Me) {
|
|
3999
|
+
if (g.receivers.remove(he), g.loading[s]) {
|
|
4000
|
+
var Oe = g.loading[s];
|
|
4001
|
+
delete g.loading[s];
|
|
4001
4002
|
for (var Ye = function(vt) {
|
|
4002
4003
|
vt || G.cleanup();
|
|
4003
4004
|
}, Qe = 0; Qe < Oe.length; Qe++)
|
|
@@ -4015,12 +4016,12 @@ function Mc() {
|
|
|
4015
4016
|
return this.getRoot(r) + "/" + s + this.options.suffix + ".js";
|
|
4016
4017
|
}
|
|
4017
4018
|
}
|
|
4018
|
-
var
|
|
4019
|
+
var y = new l("_pusher_dependencies", "Pusher.DependenciesReceivers"), k = new w({
|
|
4019
4020
|
cdn_http: h.cdn_http,
|
|
4020
4021
|
cdn_https: h.cdn_https,
|
|
4021
4022
|
version: h.VERSION,
|
|
4022
4023
|
suffix: h.dependency_suffix,
|
|
4023
|
-
receivers:
|
|
4024
|
+
receivers: y
|
|
4024
4025
|
});
|
|
4025
4026
|
const x = {
|
|
4026
4027
|
baseUrl: "https://pusher.com",
|
|
@@ -4097,7 +4098,7 @@ function Mc() {
|
|
|
4097
4098
|
super(r), this.status = s, Object.setPrototypeOf(this, new.target.prototype);
|
|
4098
4099
|
}
|
|
4099
4100
|
}
|
|
4100
|
-
var X = function(a, s, r, d,
|
|
4101
|
+
var X = function(a, s, r, d, g) {
|
|
4101
4102
|
const G = Ue.createXHR();
|
|
4102
4103
|
G.open("POST", r.endpoint, !0), G.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
|
|
4103
4104
|
for (var he in r.headers)
|
|
@@ -4114,9 +4115,9 @@ function Mc() {
|
|
|
4114
4115
|
try {
|
|
4115
4116
|
Me = JSON.parse(G.responseText), Oe = !0;
|
|
4116
4117
|
} catch {
|
|
4117
|
-
|
|
4118
|
+
g(new ne(200, `JSON returned from ${d.toString()} endpoint was invalid, yet status code was 200. Data was: ${G.responseText}`), null);
|
|
4118
4119
|
}
|
|
4119
|
-
Oe &&
|
|
4120
|
+
Oe && g(null, Me);
|
|
4120
4121
|
} else {
|
|
4121
4122
|
let Me = "";
|
|
4122
4123
|
switch (d) {
|
|
@@ -4127,7 +4128,7 @@ function Mc() {
|
|
|
4127
4128
|
Me = `Clients must be authorized to join private or presence channels. ${A.buildLogSuffix("authorizationEndpoint")}`;
|
|
4128
4129
|
break;
|
|
4129
4130
|
}
|
|
4130
|
-
|
|
4131
|
+
g(new ne(G.status, `Unable to retrieve auth string from ${d.toString()} endpoint - received status: ${G.status} from ${r.endpoint}. ${Me}`), null);
|
|
4131
4132
|
}
|
|
4132
4133
|
}, G.send(s), G;
|
|
4133
4134
|
};
|
|
@@ -4151,9 +4152,9 @@ function Mc() {
|
|
|
4151
4152
|
return a.replace(/[\s\S]{1,3}/g, ge);
|
|
4152
4153
|
};
|
|
4153
4154
|
class H {
|
|
4154
|
-
constructor(s, r, d,
|
|
4155
|
+
constructor(s, r, d, g) {
|
|
4155
4156
|
this.clear = r, this.timer = s(() => {
|
|
4156
|
-
this.timer && (this.timer =
|
|
4157
|
+
this.timer && (this.timer = g(this.timer));
|
|
4157
4158
|
}, d);
|
|
4158
4159
|
}
|
|
4159
4160
|
isRunning() {
|
|
@@ -4164,7 +4165,7 @@ function Mc() {
|
|
|
4164
4165
|
}
|
|
4165
4166
|
}
|
|
4166
4167
|
var I = H;
|
|
4167
|
-
function
|
|
4168
|
+
function v(a) {
|
|
4168
4169
|
window.clearTimeout(a);
|
|
4169
4170
|
}
|
|
4170
4171
|
function f(a) {
|
|
@@ -4172,7 +4173,7 @@ function Mc() {
|
|
|
4172
4173
|
}
|
|
4173
4174
|
class T extends I {
|
|
4174
4175
|
constructor(s, r) {
|
|
4175
|
-
super(setTimeout,
|
|
4176
|
+
super(setTimeout, v, s, function(d) {
|
|
4176
4177
|
return r(), null;
|
|
4177
4178
|
});
|
|
4178
4179
|
}
|
|
@@ -4201,8 +4202,8 @@ function Mc() {
|
|
|
4201
4202
|
function we(a, ...s) {
|
|
4202
4203
|
for (var r = 0; r < s.length; r++) {
|
|
4203
4204
|
var d = s[r];
|
|
4204
|
-
for (var
|
|
4205
|
-
d[
|
|
4205
|
+
for (var g in d)
|
|
4206
|
+
d[g] && d[g].constructor && d[g].constructor === Object ? a[g] = we(a[g] || {}, d[g]) : a[g] = d[g];
|
|
4206
4207
|
}
|
|
4207
4208
|
return a;
|
|
4208
4209
|
}
|
|
@@ -4217,7 +4218,7 @@ function Mc() {
|
|
|
4217
4218
|
return -1;
|
|
4218
4219
|
if (r && a.indexOf === r)
|
|
4219
4220
|
return a.indexOf(s);
|
|
4220
|
-
for (var d = 0,
|
|
4221
|
+
for (var d = 0, g = a.length; d < g; d++)
|
|
4221
4222
|
if (a[d] === s)
|
|
4222
4223
|
return d;
|
|
4223
4224
|
return -1;
|
|
@@ -4249,13 +4250,13 @@ function Mc() {
|
|
|
4249
4250
|
}
|
|
4250
4251
|
function ve(a, s) {
|
|
4251
4252
|
var r = {};
|
|
4252
|
-
return Ze(a, function(d,
|
|
4253
|
-
r[
|
|
4253
|
+
return Ze(a, function(d, g) {
|
|
4254
|
+
r[g] = s(d);
|
|
4254
4255
|
}), r;
|
|
4255
4256
|
}
|
|
4256
4257
|
function Te(a, s) {
|
|
4257
|
-
s = s || function(
|
|
4258
|
-
return !!
|
|
4258
|
+
s = s || function(g) {
|
|
4259
|
+
return !!g;
|
|
4259
4260
|
};
|
|
4260
4261
|
for (var r = [], d = 0; d < a.length; d++)
|
|
4261
4262
|
s(a[d], d, a, r) && r.push(a[d]);
|
|
@@ -4263,8 +4264,8 @@ function Mc() {
|
|
|
4263
4264
|
}
|
|
4264
4265
|
function De(a, s) {
|
|
4265
4266
|
var r = {};
|
|
4266
|
-
return Ze(a, function(d,
|
|
4267
|
-
(s && s(d,
|
|
4267
|
+
return Ze(a, function(d, g) {
|
|
4268
|
+
(s && s(d, g, a, r) || d) && (r[g] = d);
|
|
4268
4269
|
}), r;
|
|
4269
4270
|
}
|
|
4270
4271
|
function Be(a) {
|
|
@@ -4298,28 +4299,28 @@ function Mc() {
|
|
|
4298
4299
|
}
|
|
4299
4300
|
function Ee(a) {
|
|
4300
4301
|
var s = [], r = [];
|
|
4301
|
-
return (function d(
|
|
4302
|
+
return (function d(g, G) {
|
|
4302
4303
|
var he, Me, Oe;
|
|
4303
|
-
switch (typeof
|
|
4304
|
+
switch (typeof g) {
|
|
4304
4305
|
case "object":
|
|
4305
|
-
if (!
|
|
4306
|
+
if (!g)
|
|
4306
4307
|
return null;
|
|
4307
4308
|
for (he = 0; he < s.length; he += 1)
|
|
4308
|
-
if (s[he] ===
|
|
4309
|
+
if (s[he] === g)
|
|
4309
4310
|
return { $ref: r[he] };
|
|
4310
|
-
if (s.push(
|
|
4311
|
-
for (Oe = [], he = 0; he <
|
|
4312
|
-
Oe[he] = d(
|
|
4311
|
+
if (s.push(g), r.push(G), Object.prototype.toString.apply(g) === "[object Array]")
|
|
4312
|
+
for (Oe = [], he = 0; he < g.length; he += 1)
|
|
4313
|
+
Oe[he] = d(g[he], G + "[" + he + "]");
|
|
4313
4314
|
else {
|
|
4314
4315
|
Oe = {};
|
|
4315
|
-
for (Me in
|
|
4316
|
-
Object.prototype.hasOwnProperty.call(
|
|
4316
|
+
for (Me in g)
|
|
4317
|
+
Object.prototype.hasOwnProperty.call(g, Me) && (Oe[Me] = d(g[Me], G + "[" + JSON.stringify(Me) + "]"));
|
|
4317
4318
|
}
|
|
4318
4319
|
return Oe;
|
|
4319
4320
|
case "number":
|
|
4320
4321
|
case "string":
|
|
4321
4322
|
case "boolean":
|
|
4322
|
-
return
|
|
4323
|
+
return g;
|
|
4323
4324
|
}
|
|
4324
4325
|
})(a, "$");
|
|
4325
4326
|
}
|
|
@@ -4356,13 +4357,13 @@ function Mc() {
|
|
|
4356
4357
|
vs.log ? vs.log(d) : vs.logToConsole && s.bind(this)(d);
|
|
4357
4358
|
}
|
|
4358
4359
|
}
|
|
4359
|
-
var Pe = new He(), zt = function(a, s, r, d,
|
|
4360
|
+
var Pe = new He(), zt = function(a, s, r, d, g) {
|
|
4360
4361
|
(r.headers !== void 0 || r.headersProvider != null) && Pe.warn(`To send headers with the ${d.toString()} request, you must use AJAX, rather than JSONP.`);
|
|
4361
4362
|
var G = a.nextAuthCallbackID.toString();
|
|
4362
4363
|
a.nextAuthCallbackID++;
|
|
4363
4364
|
var he = a.getDocument(), Me = he.createElement("script");
|
|
4364
4365
|
a.auth_callbacks[G] = function(Qe) {
|
|
4365
|
-
|
|
4366
|
+
g(null, Qe);
|
|
4366
4367
|
};
|
|
4367
4368
|
var Oe = "Pusher.auth_callbacks['" + G + "']";
|
|
4368
4369
|
Me.src = r.endpoint + "?callback=" + encodeURIComponent(Oe) + "&" + s;
|
|
@@ -4382,8 +4383,8 @@ function Mc() {
|
|
|
4382
4383
|
}) : r.script.onreadystatechange = function() {
|
|
4383
4384
|
(r.script.readyState === "loaded" || r.script.readyState === "complete") && s.callback(null);
|
|
4384
4385
|
}, r.script.async === void 0 && document.attachEvent && /opera/i.test(navigator.userAgent) ? (r.errorScript = document.createElement("script"), r.errorScript.id = s.id + "_error", r.errorScript.text = s.name + "('" + d + "');", r.script.async = r.errorScript.async = !1) : r.script.async = !0;
|
|
4385
|
-
var
|
|
4386
|
-
|
|
4386
|
+
var g = document.getElementsByTagName("head")[0];
|
|
4387
|
+
g.insertBefore(r.script, g.firstChild), r.errorScript && g.insertBefore(r.errorScript, r.script.nextSibling);
|
|
4387
4388
|
}
|
|
4388
4389
|
cleanup() {
|
|
4389
4390
|
this.script && (this.script.onload = this.script.onerror = null, this.script.onreadystatechange = null), this.script && this.script.parentNode && this.script.parentNode.removeChild(this.script), this.errorScript && this.errorScript.parentNode && this.errorScript.parentNode.removeChild(this.errorScript), this.script = null, this.errorScript = null;
|
|
@@ -4405,7 +4406,7 @@ function Mc() {
|
|
|
4405
4406
|
}
|
|
4406
4407
|
var Ut = function(a, s) {
|
|
4407
4408
|
return function(r, d) {
|
|
4408
|
-
var
|
|
4409
|
+
var g = "http" + (s ? "s" : "") + "://", G = g + (a.host || a.options.host) + a.options.path, he = Ue.createJSONPRequest(G, r), Me = Ue.ScriptReceivers.create(function(Oe, Ye) {
|
|
4409
4410
|
u.remove(Me), he.cleanup(), Ye && Ye.host && (a.host = Ye.host), d && d(Oe, Ye);
|
|
4410
4411
|
});
|
|
4411
4412
|
he.send(Me);
|
|
@@ -4415,8 +4416,8 @@ function Mc() {
|
|
|
4415
4416
|
getAgent: Ut
|
|
4416
4417
|
}, wt = Ve;
|
|
4417
4418
|
function lt(a, s, r) {
|
|
4418
|
-
var d = a + (s.useTLS ? "s" : ""),
|
|
4419
|
-
return d + "://" +
|
|
4419
|
+
var d = a + (s.useTLS ? "s" : ""), g = s.useTLS ? s.hostTLS : s.hostNonTLS;
|
|
4420
|
+
return d + "://" + g + r;
|
|
4420
4421
|
}
|
|
4421
4422
|
function Ct(a, s) {
|
|
4422
4423
|
var r = "/app/" + a, d = "?protocol=" + h.PROTOCOL + "&client=js&version=" + h.VERSION + (s ? "&" + s : "");
|
|
@@ -4448,8 +4449,8 @@ function Mc() {
|
|
|
4448
4449
|
return this._callbacks[ue(s)];
|
|
4449
4450
|
}
|
|
4450
4451
|
add(s, r, d) {
|
|
4451
|
-
var
|
|
4452
|
-
this._callbacks[
|
|
4452
|
+
var g = ue(s);
|
|
4453
|
+
this._callbacks[g] = this._callbacks[g] || [], this._callbacks[g].push({
|
|
4453
4454
|
fn: r,
|
|
4454
4455
|
context: d
|
|
4455
4456
|
});
|
|
@@ -4459,14 +4460,14 @@ function Mc() {
|
|
|
4459
4460
|
this._callbacks = {};
|
|
4460
4461
|
return;
|
|
4461
4462
|
}
|
|
4462
|
-
var
|
|
4463
|
-
r || d ? this.removeCallback(
|
|
4463
|
+
var g = s ? [ue(s)] : ht(this._callbacks);
|
|
4464
|
+
r || d ? this.removeCallback(g, r, d) : this.removeAllCallbacks(g);
|
|
4464
4465
|
}
|
|
4465
4466
|
removeCallback(s, r, d) {
|
|
4466
|
-
se(s, function(
|
|
4467
|
-
this._callbacks[
|
|
4467
|
+
se(s, function(g) {
|
|
4468
|
+
this._callbacks[g] = Te(this._callbacks[g] || [], function(G) {
|
|
4468
4469
|
return r && r !== G.fn || d && d !== G.context;
|
|
4469
|
-
}), this._callbacks[
|
|
4470
|
+
}), this._callbacks[g].length === 0 && delete this._callbacks[g];
|
|
4470
4471
|
}, this);
|
|
4471
4472
|
}
|
|
4472
4473
|
removeAllCallbacks(s) {
|
|
@@ -4498,19 +4499,19 @@ function Mc() {
|
|
|
4498
4499
|
return this.unbind(), this.unbind_global(), this;
|
|
4499
4500
|
}
|
|
4500
4501
|
emit(s, r, d) {
|
|
4501
|
-
for (var
|
|
4502
|
-
this.global_callbacks[
|
|
4502
|
+
for (var g = 0; g < this.global_callbacks.length; g++)
|
|
4503
|
+
this.global_callbacks[g](s, r);
|
|
4503
4504
|
var G = this.callbacks.get(s), he = [];
|
|
4504
4505
|
if (d ? he.push(r, d) : r && he.push(r), G && G.length > 0)
|
|
4505
|
-
for (var
|
|
4506
|
-
G[
|
|
4506
|
+
for (var g = 0; g < G.length; g++)
|
|
4507
|
+
G[g].fn.apply(G[g].context || window, he);
|
|
4507
4508
|
else this.failThrough && this.failThrough(s, r);
|
|
4508
4509
|
return this;
|
|
4509
4510
|
}
|
|
4510
4511
|
}
|
|
4511
4512
|
class Z extends te {
|
|
4512
|
-
constructor(s, r, d,
|
|
4513
|
-
super(), this.initialize = Ue.transportConnectionInitializer, this.hooks = s, this.name = r, this.priority = d, this.key =
|
|
4513
|
+
constructor(s, r, d, g, G) {
|
|
4514
|
+
super(), this.initialize = Ue.transportConnectionInitializer, this.hooks = s, this.name = r, this.priority = d, this.key = g, this.options = G, this.state = "new", this.timeline = G.timeline, this.activityTimeout = G.activityTimeout, this.id = this.timeline.generateUniqueID();
|
|
4514
4515
|
}
|
|
4515
4516
|
handlesActivityChecks() {
|
|
4516
4517
|
return !!this.hooks.handlesActivityChecks;
|
|
@@ -4594,8 +4595,8 @@ function Mc() {
|
|
|
4594
4595
|
isSupported(s) {
|
|
4595
4596
|
return this.hooks.isSupported(s);
|
|
4596
4597
|
}
|
|
4597
|
-
createConnection(s, r, d,
|
|
4598
|
-
return new Z(this.hooks, s, r, d,
|
|
4598
|
+
createConnection(s, r, d, g) {
|
|
4599
|
+
return new Z(this.hooks, s, r, d, g);
|
|
4599
4600
|
}
|
|
4600
4601
|
}
|
|
4601
4602
|
var et = new je({
|
|
@@ -4685,11 +4686,11 @@ function Mc() {
|
|
|
4685
4686
|
constructor(s, r, d) {
|
|
4686
4687
|
this.manager = s, this.transport = r, this.minPingDelay = d.minPingDelay, this.maxPingDelay = d.maxPingDelay, this.pingDelay = void 0;
|
|
4687
4688
|
}
|
|
4688
|
-
createConnection(s, r, d,
|
|
4689
|
-
|
|
4689
|
+
createConnection(s, r, d, g) {
|
|
4690
|
+
g = we({}, g, {
|
|
4690
4691
|
activityTimeout: this.pingDelay
|
|
4691
4692
|
});
|
|
4692
|
-
var G = this.transport.createConnection(s, r, d,
|
|
4693
|
+
var G = this.transport.createConnection(s, r, d, g), he = null, Me = function() {
|
|
4693
4694
|
G.unbind("open", Me), G.bind("closed", Oe), he = Se.now();
|
|
4694
4695
|
}, Oe = (Ye) => {
|
|
4695
4696
|
if (G.unbind("closed", Oe), Ye.code === 1002 || Ye.code === 1003)
|
|
@@ -4720,8 +4721,8 @@ function Mc() {
|
|
|
4720
4721
|
data: r
|
|
4721
4722
|
};
|
|
4722
4723
|
return s.user_id && (d.user_id = s.user_id), d;
|
|
4723
|
-
} catch (
|
|
4724
|
-
throw { type: "MessageParseError", error:
|
|
4724
|
+
} catch (g) {
|
|
4725
|
+
throw { type: "MessageParseError", error: g, data: a.data };
|
|
4725
4726
|
}
|
|
4726
4727
|
},
|
|
4727
4728
|
encodeMessage: function(a) {
|
|
@@ -4771,8 +4772,8 @@ function Mc() {
|
|
|
4771
4772
|
return this.transport.send(s);
|
|
4772
4773
|
}
|
|
4773
4774
|
send_event(s, r, d) {
|
|
4774
|
-
var
|
|
4775
|
-
return d && (
|
|
4775
|
+
var g = { event: s, data: r };
|
|
4776
|
+
return d && (g.channel = d), Pe.debug("Event sent", g), this.send($e.encodeMessage(g));
|
|
4776
4777
|
}
|
|
4777
4778
|
ping() {
|
|
4778
4779
|
this.transport.supportsPing() ? this.transport.ping() : this.send_event("pusher:ping", {});
|
|
@@ -4783,9 +4784,9 @@ function Mc() {
|
|
|
4783
4784
|
bindListeners() {
|
|
4784
4785
|
var s = {
|
|
4785
4786
|
message: (d) => {
|
|
4786
|
-
var
|
|
4787
|
+
var g;
|
|
4787
4788
|
try {
|
|
4788
|
-
|
|
4789
|
+
g = $e.decodeMessage(d);
|
|
4789
4790
|
} catch (G) {
|
|
4790
4791
|
this.emit("error", {
|
|
4791
4792
|
type: "MessageParseError",
|
|
@@ -4793,12 +4794,12 @@ function Mc() {
|
|
|
4793
4794
|
data: d.data
|
|
4794
4795
|
});
|
|
4795
4796
|
}
|
|
4796
|
-
if (
|
|
4797
|
-
switch (Pe.debug("Event recd",
|
|
4797
|
+
if (g !== void 0) {
|
|
4798
|
+
switch (Pe.debug("Event recd", g), g.event) {
|
|
4798
4799
|
case "pusher:error":
|
|
4799
4800
|
this.emit("error", {
|
|
4800
4801
|
type: "PusherError",
|
|
4801
|
-
data:
|
|
4802
|
+
data: g.data
|
|
4802
4803
|
});
|
|
4803
4804
|
break;
|
|
4804
4805
|
case "pusher:ping":
|
|
@@ -4808,7 +4809,7 @@ function Mc() {
|
|
|
4808
4809
|
this.emit("pong");
|
|
4809
4810
|
break;
|
|
4810
4811
|
}
|
|
4811
|
-
this.emit("message",
|
|
4812
|
+
this.emit("message", g);
|
|
4812
4813
|
}
|
|
4813
4814
|
},
|
|
4814
4815
|
activity: () => {
|
|
@@ -4821,12 +4822,12 @@ function Mc() {
|
|
|
4821
4822
|
r(), d && d.code && this.handleCloseEvent(d), this.transport = null, this.emit("closed");
|
|
4822
4823
|
}
|
|
4823
4824
|
}, r = () => {
|
|
4824
|
-
Ze(s, (d,
|
|
4825
|
-
this.transport.unbind(
|
|
4825
|
+
Ze(s, (d, g) => {
|
|
4826
|
+
this.transport.unbind(g, d);
|
|
4826
4827
|
});
|
|
4827
4828
|
};
|
|
4828
|
-
Ze(s, (d,
|
|
4829
|
-
this.transport.bind(
|
|
4829
|
+
Ze(s, (d, g) => {
|
|
4830
|
+
this.transport.bind(g, d);
|
|
4830
4831
|
});
|
|
4831
4832
|
}
|
|
4832
4833
|
handleCloseEvent(s) {
|
|
@@ -4878,7 +4879,7 @@ function Mc() {
|
|
|
4878
4879
|
}
|
|
4879
4880
|
class Xt extends te {
|
|
4880
4881
|
constructor(s, r) {
|
|
4881
|
-
super(function(d,
|
|
4882
|
+
super(function(d, g) {
|
|
4882
4883
|
Pe.debug("No callbacks on " + s + " for " + d);
|
|
4883
4884
|
}), this.name = s, this.pusher = r, this.subscribed = !1, this.subscriptionPending = !1, this.subscriptionCancelled = !1;
|
|
4884
4885
|
}
|
|
@@ -4904,8 +4905,8 @@ function Mc() {
|
|
|
4904
4905
|
else if (r === "pusher_internal:subscription_count")
|
|
4905
4906
|
this.handleSubscriptionCountEvent(s);
|
|
4906
4907
|
else if (r.indexOf("pusher_internal:") !== 0) {
|
|
4907
|
-
var
|
|
4908
|
-
this.emit(r, d,
|
|
4908
|
+
var g = {};
|
|
4909
|
+
this.emit(r, d, g);
|
|
4909
4910
|
}
|
|
4910
4911
|
}
|
|
4911
4912
|
handleSubscriptionSucceededEvent(s) {
|
|
@@ -4979,7 +4980,7 @@ function Mc() {
|
|
|
4979
4980
|
}
|
|
4980
4981
|
}
|
|
4981
4982
|
var os = function(a, s, r, d) {
|
|
4982
|
-
function
|
|
4983
|
+
function g(G) {
|
|
4983
4984
|
return G instanceof r ? G : new r(function(he) {
|
|
4984
4985
|
he(G);
|
|
4985
4986
|
});
|
|
@@ -5000,7 +5001,7 @@ function Mc() {
|
|
|
5000
5001
|
}
|
|
5001
5002
|
}
|
|
5002
5003
|
function Ye(Qe) {
|
|
5003
|
-
Qe.done ? G(Qe.value) :
|
|
5004
|
+
Qe.done ? G(Qe.value) : g(Qe.value).then(Me, Oe);
|
|
5004
5005
|
}
|
|
5005
5006
|
Ye((d = d.apply(a, s || [])).next());
|
|
5006
5007
|
});
|
|
@@ -5010,10 +5011,10 @@ function Mc() {
|
|
|
5010
5011
|
super(s, r), this.members = new as();
|
|
5011
5012
|
}
|
|
5012
5013
|
authorize(s, r) {
|
|
5013
|
-
super.authorize(s, (d,
|
|
5014
|
+
super.authorize(s, (d, g) => os(this, void 0, void 0, function* () {
|
|
5014
5015
|
if (!d)
|
|
5015
|
-
if (
|
|
5016
|
-
var G = JSON.parse(
|
|
5016
|
+
if (g = g, g.channel_data != null) {
|
|
5017
|
+
var G = JSON.parse(g.channel_data);
|
|
5017
5018
|
this.members.setMyID(G.user_id);
|
|
5018
5019
|
} else if (yield this.pusher.user.signinDonePromise, this.pusher.user.user_data != null)
|
|
5019
5020
|
this.members.setMyID(this.pusher.user.user_data.id);
|
|
@@ -5022,7 +5023,7 @@ function Mc() {
|
|
|
5022
5023
|
Pe.error(`Invalid auth response for channel '${this.name}', expected 'channel_data' field. ${he}, or the user should be signed in.`), r("Invalid auth response");
|
|
5023
5024
|
return;
|
|
5024
5025
|
}
|
|
5025
|
-
r(d,
|
|
5026
|
+
r(d, g);
|
|
5026
5027
|
}));
|
|
5027
5028
|
}
|
|
5028
5029
|
handleEvent(s) {
|
|
@@ -5030,8 +5031,8 @@ function Mc() {
|
|
|
5030
5031
|
if (r.indexOf("pusher_internal:") === 0)
|
|
5031
5032
|
this.handleInternalEvent(s);
|
|
5032
5033
|
else {
|
|
5033
|
-
var d = s.data,
|
|
5034
|
-
s.user_id && (
|
|
5034
|
+
var d = s.data, g = {};
|
|
5035
|
+
s.user_id && (g.user_id = s.user_id), this.emit(r, d, g);
|
|
5035
5036
|
}
|
|
5036
5037
|
}
|
|
5037
5038
|
handleInternalEvent(s) {
|
|
@@ -5044,8 +5045,8 @@ function Mc() {
|
|
|
5044
5045
|
this.handleSubscriptionCountEvent(s);
|
|
5045
5046
|
break;
|
|
5046
5047
|
case "pusher_internal:member_added":
|
|
5047
|
-
var
|
|
5048
|
-
this.emit("pusher:member_added",
|
|
5048
|
+
var g = this.members.addMember(d);
|
|
5049
|
+
this.emit("pusher:member_added", g);
|
|
5049
5050
|
break;
|
|
5050
5051
|
case "pusher_internal:member_removed":
|
|
5051
5052
|
var G = this.members.removeMember(d);
|
|
@@ -5066,17 +5067,17 @@ function Mc() {
|
|
|
5066
5067
|
super(s, r), this.key = null, this.nacl = d;
|
|
5067
5068
|
}
|
|
5068
5069
|
authorize(s, r) {
|
|
5069
|
-
super.authorize(s, (d,
|
|
5070
|
+
super.authorize(s, (d, g) => {
|
|
5070
5071
|
if (d) {
|
|
5071
|
-
r(d,
|
|
5072
|
+
r(d, g);
|
|
5072
5073
|
return;
|
|
5073
5074
|
}
|
|
5074
|
-
let G =
|
|
5075
|
+
let G = g.shared_secret;
|
|
5075
5076
|
if (!G) {
|
|
5076
5077
|
r(new Error(`No shared_secret key in auth payload for encrypted channel: ${this.name}`), null);
|
|
5077
5078
|
return;
|
|
5078
5079
|
}
|
|
5079
|
-
this.key = Object(on.decode)(G), delete
|
|
5080
|
+
this.key = Object(on.decode)(G), delete g.shared_secret, r(null, g);
|
|
5080
5081
|
});
|
|
5081
5082
|
}
|
|
5082
5083
|
trigger(s, r) {
|
|
@@ -5104,19 +5105,19 @@ function Mc() {
|
|
|
5104
5105
|
Pe.error(`Expected encrypted event ciphertext length to be ${this.nacl.secretbox.overheadLength}, got: ${d.length}`);
|
|
5105
5106
|
return;
|
|
5106
5107
|
}
|
|
5107
|
-
let
|
|
5108
|
-
if (
|
|
5109
|
-
Pe.error(`Expected encrypted event nonce length to be ${this.nacl.secretbox.nonceLength}, got: ${
|
|
5108
|
+
let g = Object(on.decode)(r.nonce);
|
|
5109
|
+
if (g.length < this.nacl.secretbox.nonceLength) {
|
|
5110
|
+
Pe.error(`Expected encrypted event nonce length to be ${this.nacl.secretbox.nonceLength}, got: ${g.length}`);
|
|
5110
5111
|
return;
|
|
5111
5112
|
}
|
|
5112
|
-
let G = this.nacl.secretbox.open(d,
|
|
5113
|
+
let G = this.nacl.secretbox.open(d, g, this.key);
|
|
5113
5114
|
if (G === null) {
|
|
5114
5115
|
Pe.debug("Failed to decrypt an event, probably because it was encrypted with a different key. Fetching a new key from the authEndpoint..."), this.authorize(this.pusher.connection.socket_id, (he, Me) => {
|
|
5115
5116
|
if (he) {
|
|
5116
5117
|
Pe.error(`Failed to make a request to the authEndpoint: ${Me}. Unable to fetch new key, so dropping encrypted event`);
|
|
5117
5118
|
return;
|
|
5118
5119
|
}
|
|
5119
|
-
if (G = this.nacl.secretbox.open(d,
|
|
5120
|
+
if (G = this.nacl.secretbox.open(d, g, this.key), G === null) {
|
|
5120
5121
|
Pe.error("Failed to decrypt event with new key. Dropping encrypted event");
|
|
5121
5122
|
return;
|
|
5122
5123
|
}
|
|
@@ -5283,8 +5284,8 @@ function Mc() {
|
|
|
5283
5284
|
updateState(s, r) {
|
|
5284
5285
|
var d = this.state;
|
|
5285
5286
|
if (this.state = s, d !== s) {
|
|
5286
|
-
var
|
|
5287
|
-
|
|
5287
|
+
var g = s;
|
|
5288
|
+
g === "connected" && (g += " with new socket ID " + r.socket_id), Pe.debug("State changed", d + " -> " + g), this.timeline.info({ state: s, params: r }), this.emit("state_change", { previous: d, current: s }), this.emit(s, r);
|
|
5288
5289
|
}
|
|
5289
5290
|
}
|
|
5290
5291
|
shouldRetry() {
|
|
@@ -5384,10 +5385,10 @@ function Mc() {
|
|
|
5384
5385
|
return Q(this.strategies, Se.method("isSupported"));
|
|
5385
5386
|
}
|
|
5386
5387
|
connect(s, r) {
|
|
5387
|
-
var d = this.strategies,
|
|
5388
|
-
Ye ? r(null, Ye) : (
|
|
5388
|
+
var d = this.strategies, g = 0, G = this.timeout, he = null, Me = (Oe, Ye) => {
|
|
5389
|
+
Ye ? r(null, Ye) : (g = g + 1, this.loop && (g = g % d.length), g < d.length ? (G && (G = G * 2, this.timeoutLimit && (G = Math.min(G, this.timeoutLimit))), he = this.tryStrategy(d[g], s, { timeout: G, failFast: this.failFast }, Me)) : r(!0));
|
|
5389
5390
|
};
|
|
5390
|
-
return he = this.tryStrategy(d[
|
|
5391
|
+
return he = this.tryStrategy(d[g], s, { timeout: G, failFast: this.failFast }, Me), {
|
|
5391
5392
|
abort: function() {
|
|
5392
5393
|
he.abort();
|
|
5393
5394
|
},
|
|
@@ -5396,12 +5397,12 @@ function Mc() {
|
|
|
5396
5397
|
}
|
|
5397
5398
|
};
|
|
5398
5399
|
}
|
|
5399
|
-
tryStrategy(s, r, d,
|
|
5400
|
+
tryStrategy(s, r, d, g) {
|
|
5400
5401
|
var G = null, he = null;
|
|
5401
5402
|
return d.timeout > 0 && (G = new T(d.timeout, function() {
|
|
5402
|
-
he.abort(),
|
|
5403
|
+
he.abort(), g(!0);
|
|
5403
5404
|
})), he = s.connect(r, function(Me, Oe) {
|
|
5404
|
-
Me && G && G.isRunning() && !d.failFast || (G && G.ensureAborted(),
|
|
5405
|
+
Me && G && G.isRunning() && !d.failFast || (G && G.ensureAborted(), g(Me, Oe));
|
|
5405
5406
|
}), {
|
|
5406
5407
|
abort: function() {
|
|
5407
5408
|
G && G.ensureAborted(), he.abort();
|
|
@@ -5420,13 +5421,13 @@ function Mc() {
|
|
|
5420
5421
|
return Q(this.strategies, Se.method("isSupported"));
|
|
5421
5422
|
}
|
|
5422
5423
|
connect(s, r) {
|
|
5423
|
-
return yn(this.strategies, s, function(d,
|
|
5424
|
+
return yn(this.strategies, s, function(d, g) {
|
|
5424
5425
|
return function(G, he) {
|
|
5425
|
-
if (
|
|
5426
|
-
hs(
|
|
5426
|
+
if (g[d].error = G, G) {
|
|
5427
|
+
hs(g) && r(!0);
|
|
5427
5428
|
return;
|
|
5428
5429
|
}
|
|
5429
|
-
se(
|
|
5430
|
+
se(g, function(Me) {
|
|
5430
5431
|
Me.forceMinPriority(he.transport.priority);
|
|
5431
5432
|
}), r(null, he);
|
|
5432
5433
|
};
|
|
@@ -5434,16 +5435,16 @@ function Mc() {
|
|
|
5434
5435
|
}
|
|
5435
5436
|
}
|
|
5436
5437
|
function yn(a, s, r) {
|
|
5437
|
-
var d = ye(a, function(
|
|
5438
|
-
return
|
|
5438
|
+
var d = ye(a, function(g, G, he, Me) {
|
|
5439
|
+
return g.connect(s, r(G, Me));
|
|
5439
5440
|
});
|
|
5440
5441
|
return {
|
|
5441
5442
|
abort: function() {
|
|
5442
5443
|
se(d, Un);
|
|
5443
5444
|
},
|
|
5444
|
-
forceMinPriority: function(
|
|
5445
|
+
forceMinPriority: function(g) {
|
|
5445
5446
|
se(d, function(G) {
|
|
5446
|
-
G.forceMinPriority(
|
|
5447
|
+
G.forceMinPriority(g);
|
|
5447
5448
|
});
|
|
5448
5449
|
}
|
|
5449
5450
|
};
|
|
@@ -5464,15 +5465,15 @@ function Mc() {
|
|
|
5464
5465
|
return this.strategy.isSupported();
|
|
5465
5466
|
}
|
|
5466
5467
|
connect(s, r) {
|
|
5467
|
-
var d = this.usingTLS,
|
|
5468
|
-
if (
|
|
5469
|
-
var Me = this.transports[
|
|
5470
|
-
Me && (["ws", "wss"].includes(
|
|
5468
|
+
var d = this.usingTLS, g = Fn(d), G = g && g.cacheSkipCount ? g.cacheSkipCount : 0, he = [this.strategy];
|
|
5469
|
+
if (g && g.timestamp + this.ttl >= Se.now()) {
|
|
5470
|
+
var Me = this.transports[g.transport];
|
|
5471
|
+
Me && (["ws", "wss"].includes(g.transport) || G > 3 ? (this.timeline.info({
|
|
5471
5472
|
cached: !0,
|
|
5472
|
-
transport:
|
|
5473
|
-
latency:
|
|
5473
|
+
transport: g.transport,
|
|
5474
|
+
latency: g.latency
|
|
5474
5475
|
}), he.push(new Jt([Me], {
|
|
5475
|
-
timeout:
|
|
5476
|
+
timeout: g.latency * 2 + 1e3,
|
|
5476
5477
|
failFast: !0
|
|
5477
5478
|
}))) : G++);
|
|
5478
5479
|
}
|
|
@@ -5505,10 +5506,10 @@ function Mc() {
|
|
|
5505
5506
|
return null;
|
|
5506
5507
|
}
|
|
5507
5508
|
function ms(a, s, r, d) {
|
|
5508
|
-
var
|
|
5509
|
-
if (
|
|
5509
|
+
var g = Ue.getLocalStorage();
|
|
5510
|
+
if (g)
|
|
5510
5511
|
try {
|
|
5511
|
-
|
|
5512
|
+
g[_n(a)] = be({
|
|
5512
5513
|
timestamp: Se.now(),
|
|
5513
5514
|
transport: s,
|
|
5514
5515
|
latency: r,
|
|
@@ -5533,15 +5534,15 @@ function Mc() {
|
|
|
5533
5534
|
return this.strategy.isSupported();
|
|
5534
5535
|
}
|
|
5535
5536
|
connect(s, r) {
|
|
5536
|
-
var d = this.strategy,
|
|
5537
|
-
|
|
5537
|
+
var d = this.strategy, g, G = new T(this.options.delay, function() {
|
|
5538
|
+
g = d.connect(s, r);
|
|
5538
5539
|
});
|
|
5539
5540
|
return {
|
|
5540
5541
|
abort: function() {
|
|
5541
|
-
G.ensureAborted(),
|
|
5542
|
+
G.ensureAborted(), g && g.abort();
|
|
5542
5543
|
},
|
|
5543
5544
|
forceMinPriority: function(he) {
|
|
5544
|
-
s = he,
|
|
5545
|
+
s = he, g && g.forceMinPriority(he);
|
|
5545
5546
|
}
|
|
5546
5547
|
};
|
|
5547
5548
|
}
|
|
@@ -5567,8 +5568,8 @@ function Mc() {
|
|
|
5567
5568
|
return this.strategy.isSupported();
|
|
5568
5569
|
}
|
|
5569
5570
|
connect(s, r) {
|
|
5570
|
-
var d = this.strategy.connect(s, function(
|
|
5571
|
-
G && d.abort(), r(
|
|
5571
|
+
var d = this.strategy.connect(s, function(g, G) {
|
|
5572
|
+
G && d.abort(), r(g, G);
|
|
5572
5573
|
});
|
|
5573
5574
|
return d;
|
|
5574
5575
|
}
|
|
@@ -5580,7 +5581,7 @@ function Mc() {
|
|
|
5580
5581
|
}
|
|
5581
5582
|
var S = function(a, s, r) {
|
|
5582
5583
|
var d = {};
|
|
5583
|
-
function
|
|
5584
|
+
function g(vi, Ka, Ya, Ja, Za) {
|
|
5584
5585
|
var gi = r(a, vi, Ka, Ya, Ja, Za);
|
|
5585
5586
|
return d[vi] = gi, gi;
|
|
5586
5587
|
}
|
|
@@ -5605,7 +5606,7 @@ function Mc() {
|
|
|
5605
5606
|
lives: 2,
|
|
5606
5607
|
minPingDelay: 1e4,
|
|
5607
5608
|
maxPingDelay: a.activityTimeout
|
|
5608
|
-
}), vt =
|
|
5609
|
+
}), vt = g("ws", "ws", 3, G, Ye), Hn = g("wss", "ws", 3, he, Ye), Ha = g("sockjs", "sockjs", 1, Me), ui = g("xhr_streaming", "xhr_streaming", 1, Me, Qe), Va = g("xdr_streaming", "xdr_streaming", 1, Me, Qe), di = g("xhr_polling", "xhr_polling", 1, Me), Wa = g("xdr_polling", "xdr_polling", 1, Me), hi = new Jt([vt], Oe), Ga = new Jt([Hn], Oe), Xa = new Jt([Ha], Oe), fi = new Jt([
|
|
5609
5610
|
new tn(Kt(ui), ui, Va)
|
|
5610
5611
|
], Oe), mi = new Jt([
|
|
5611
5612
|
new tn(Kt(di), di, Wa)
|
|
@@ -5731,8 +5732,8 @@ function Mc() {
|
|
|
5731
5732
|
break;
|
|
5732
5733
|
case "a":
|
|
5733
5734
|
r = JSON.parse(s.data.slice(1) || "[]");
|
|
5734
|
-
for (var
|
|
5735
|
-
this.onEvent(r[
|
|
5735
|
+
for (var g = 0; g < r.length; g++)
|
|
5736
|
+
this.onEvent(r[g]);
|
|
5736
5737
|
break;
|
|
5737
5738
|
case "m":
|
|
5738
5739
|
r = JSON.parse(s.data.slice(1) || "null"), this.onEvent(r);
|
|
@@ -5870,7 +5871,7 @@ function Mc() {
|
|
|
5870
5871
|
nextAuthCallbackID: 1,
|
|
5871
5872
|
auth_callbacks: {},
|
|
5872
5873
|
ScriptReceivers: u,
|
|
5873
|
-
DependenciesReceivers:
|
|
5874
|
+
DependenciesReceivers: y,
|
|
5874
5875
|
getDefaultStrategy: Y,
|
|
5875
5876
|
Transports: le,
|
|
5876
5877
|
transportConnectionInitializer: Ae,
|
|
@@ -5994,8 +5995,8 @@ function Mc() {
|
|
|
5994
5995
|
features: this.options.features,
|
|
5995
5996
|
timeline: this.events
|
|
5996
5997
|
}, this.options.params);
|
|
5997
|
-
return this.events = [], s(d, (
|
|
5998
|
-
|
|
5998
|
+
return this.events = [], s(d, (g, G) => {
|
|
5999
|
+
g || this.sent++, r && r(g, G);
|
|
5999
6000
|
}), !0;
|
|
6000
6001
|
}
|
|
6001
6002
|
generateUniqueID() {
|
|
@@ -6003,8 +6004,8 @@ function Mc() {
|
|
|
6003
6004
|
}
|
|
6004
6005
|
}
|
|
6005
6006
|
class _a {
|
|
6006
|
-
constructor(s, r, d,
|
|
6007
|
-
this.name = s, this.priority = r, this.transport = d, this.options =
|
|
6007
|
+
constructor(s, r, d, g) {
|
|
6008
|
+
this.name = s, this.priority = r, this.transport = d, this.options = g || {};
|
|
6008
6009
|
}
|
|
6009
6010
|
isSupported() {
|
|
6010
6011
|
return this.transport.isSupported({
|
|
@@ -6016,10 +6017,10 @@ function Mc() {
|
|
|
6016
6017
|
if (this.priority < s)
|
|
6017
6018
|
return ci(new ae(), r);
|
|
6018
6019
|
} else return ci(new ee(), r);
|
|
6019
|
-
var d = !1,
|
|
6020
|
-
|
|
6020
|
+
var d = !1, g = this.transport.createConnection(this.name, this.priority, this.options.key, this.options), G = null, he = function() {
|
|
6021
|
+
g.unbind("initialized", he), g.connect();
|
|
6021
6022
|
}, Me = function() {
|
|
6022
|
-
G = Bt.createHandshake(
|
|
6023
|
+
G = Bt.createHandshake(g, function(vt) {
|
|
6023
6024
|
d = !0, Qe(), r(null, vt);
|
|
6024
6025
|
});
|
|
6025
6026
|
}, Oe = function(vt) {
|
|
@@ -6027,16 +6028,16 @@ function Mc() {
|
|
|
6027
6028
|
}, Ye = function() {
|
|
6028
6029
|
Qe();
|
|
6029
6030
|
var vt;
|
|
6030
|
-
vt = be(
|
|
6031
|
+
vt = be(g), r(new ce(vt));
|
|
6031
6032
|
}, Qe = function() {
|
|
6032
|
-
|
|
6033
|
+
g.unbind("initialized", he), g.unbind("open", Me), g.unbind("error", Oe), g.unbind("closed", Ye);
|
|
6033
6034
|
};
|
|
6034
|
-
return
|
|
6035
|
+
return g.bind("initialized", he), g.bind("open", Me), g.bind("error", Oe), g.bind("closed", Ye), g.initialize(), {
|
|
6035
6036
|
abort: () => {
|
|
6036
|
-
d || (Qe(), G ? G.close() :
|
|
6037
|
+
d || (Qe(), G ? G.close() : g.close());
|
|
6037
6038
|
},
|
|
6038
6039
|
forceMinPriority: (vt) => {
|
|
6039
|
-
d || this.priority < vt && (G ? G.close() :
|
|
6040
|
+
d || this.priority < vt && (G ? G.close() : g.close());
|
|
6040
6041
|
}
|
|
6041
6042
|
};
|
|
6042
6043
|
}
|
|
@@ -6052,12 +6053,12 @@ function Mc() {
|
|
|
6052
6053
|
};
|
|
6053
6054
|
}
|
|
6054
6055
|
const { Transports: wa } = Ue;
|
|
6055
|
-
var Ca = function(a, s, r, d,
|
|
6056
|
+
var Ca = function(a, s, r, d, g, G) {
|
|
6056
6057
|
var he = wa[r];
|
|
6057
6058
|
if (!he)
|
|
6058
6059
|
throw new L(r);
|
|
6059
6060
|
var Me = (!a.enabledTransports || ot(a.enabledTransports, s) !== -1) && (!a.disabledTransports || ot(a.disabledTransports, s) === -1), Oe;
|
|
6060
|
-
return Me ? (
|
|
6061
|
+
return Me ? (g = Object.assign({ ignoreNullOrigin: a.ignoreNullOrigin }, g), Oe = new _a(s, d, G ? G.getAssistant(he) : he, g)) : Oe = ka, Oe;
|
|
6061
6062
|
}, ka = {
|
|
6062
6063
|
isSupported: function() {
|
|
6063
6064
|
return !1;
|
|
@@ -6087,9 +6088,9 @@ function Mc() {
|
|
|
6087
6088
|
for (var d in s.params)
|
|
6088
6089
|
r += "&" + encodeURIComponent(d) + "=" + encodeURIComponent(s.params[d]);
|
|
6089
6090
|
if (s.paramsProvider != null) {
|
|
6090
|
-
let
|
|
6091
|
-
for (var d in
|
|
6092
|
-
r += "&" + encodeURIComponent(d) + "=" + encodeURIComponent(
|
|
6091
|
+
let g = s.paramsProvider();
|
|
6092
|
+
for (var d in g)
|
|
6093
|
+
r += "&" + encodeURIComponent(d) + "=" + encodeURIComponent(g[d]);
|
|
6093
6094
|
}
|
|
6094
6095
|
return r;
|
|
6095
6096
|
};
|
|
@@ -6107,9 +6108,9 @@ function Mc() {
|
|
|
6107
6108
|
for (var d in s.params)
|
|
6108
6109
|
r += "&" + encodeURIComponent(d) + "=" + encodeURIComponent(s.params[d]);
|
|
6109
6110
|
if (s.paramsProvider != null) {
|
|
6110
|
-
let
|
|
6111
|
-
for (var d in
|
|
6112
|
-
r += "&" + encodeURIComponent(d) + "=" + encodeURIComponent(
|
|
6111
|
+
let g = s.paramsProvider();
|
|
6112
|
+
for (var d in g)
|
|
6113
|
+
r += "&" + encodeURIComponent(d) + "=" + encodeURIComponent(g[d]);
|
|
6113
6114
|
}
|
|
6114
6115
|
return r;
|
|
6115
6116
|
};
|
|
@@ -6130,9 +6131,9 @@ function Mc() {
|
|
|
6130
6131
|
headers: s.headers
|
|
6131
6132
|
}
|
|
6132
6133
|
};
|
|
6133
|
-
return (
|
|
6134
|
-
const he = a.channel(
|
|
6135
|
-
r(he, d).authorize(
|
|
6134
|
+
return (g, G) => {
|
|
6135
|
+
const he = a.channel(g.channelName);
|
|
6136
|
+
r(he, d).authorize(g.socketId, G);
|
|
6136
6137
|
};
|
|
6137
6138
|
};
|
|
6138
6139
|
function Aa(a, s) {
|
|
@@ -6207,8 +6208,8 @@ function Mc() {
|
|
|
6207
6208
|
}
|
|
6208
6209
|
function za() {
|
|
6209
6210
|
let a, s;
|
|
6210
|
-
return { promise: new Promise((d,
|
|
6211
|
-
a = d, s =
|
|
6211
|
+
return { promise: new Promise((d, g) => {
|
|
6212
|
+
a = d, s = g;
|
|
6212
6213
|
}), resolve: a, reject: s };
|
|
6213
6214
|
}
|
|
6214
6215
|
var ja = za;
|
|
@@ -6298,7 +6299,7 @@ function Mc() {
|
|
|
6298
6299
|
host: this.config.statsHost,
|
|
6299
6300
|
path: "/timeline/v2/" + Ue.TimelineTransport.name
|
|
6300
6301
|
}));
|
|
6301
|
-
var d = (
|
|
6302
|
+
var d = (g) => Ue.getDefaultStrategy(this.config, g, Ca);
|
|
6302
6303
|
this.connection = Bt.createConnectionManager(this.key, {
|
|
6303
6304
|
getStrategy: d,
|
|
6304
6305
|
timeline: this.timeline,
|
|
@@ -6308,19 +6309,19 @@ function Mc() {
|
|
|
6308
6309
|
useTLS: !!this.config.useTLS
|
|
6309
6310
|
}), this.connection.bind("connected", () => {
|
|
6310
6311
|
this.subscribeAll(), this.timelineSender && this.timelineSender.send(this.connection.isUsingTLS());
|
|
6311
|
-
}), this.connection.bind("message", (
|
|
6312
|
-
var G =
|
|
6313
|
-
if (
|
|
6314
|
-
var Me = this.channel(
|
|
6315
|
-
Me && Me.handleEvent(
|
|
6312
|
+
}), this.connection.bind("message", (g) => {
|
|
6313
|
+
var G = g.event, he = G.indexOf("pusher_internal:") === 0;
|
|
6314
|
+
if (g.channel) {
|
|
6315
|
+
var Me = this.channel(g.channel);
|
|
6316
|
+
Me && Me.handleEvent(g);
|
|
6316
6317
|
}
|
|
6317
|
-
he || this.global_emitter.emit(
|
|
6318
|
+
he || this.global_emitter.emit(g.event, g.data);
|
|
6318
6319
|
}), this.connection.bind("connecting", () => {
|
|
6319
6320
|
this.channels.disconnect();
|
|
6320
6321
|
}), this.connection.bind("disconnected", () => {
|
|
6321
6322
|
this.channels.disconnect();
|
|
6322
|
-
}), this.connection.bind("error", (
|
|
6323
|
-
Pe.warn(
|
|
6323
|
+
}), this.connection.bind("error", (g) => {
|
|
6324
|
+
Pe.warn(g);
|
|
6324
6325
|
}), Et.instances.push(this), this.timeline.info({ instances: Et.instances.length }), this.user = new Ba(this), Et.isReady && this.connect();
|
|
6325
6326
|
}
|
|
6326
6327
|
channel(s) {
|
|
@@ -6594,9 +6595,9 @@ function ln(e, t, n, i) {
|
|
|
6594
6595
|
function Ug(e) {
|
|
6595
6596
|
const t = e.initializedEvent ?? "messenger-client:echo-initialized", n = e.bootstrapEndpoint ?? $c, i = e.bootstrapRefreshSkewMs ?? Ac, o = e.presenceFreshnessTtlMs ?? Pc, l = (e.createLogger ?? Xs())("MessengerEcho");
|
|
6596
6597
|
typeof window < "u" && (window.Pusher = Ec);
|
|
6597
|
-
let u = null,
|
|
6598
|
+
let u = null, p = null, h = null, w = null, y = "disconnected", k = "available", x = null, M = null;
|
|
6598
6599
|
const A = /* @__PURE__ */ new Set(), P = /* @__PURE__ */ new Set(), $ = /* @__PURE__ */ new Map(), R = (oe) => {
|
|
6599
|
-
|
|
6600
|
+
y = oe;
|
|
6600
6601
|
for (const se of A)
|
|
6601
6602
|
se(oe);
|
|
6602
6603
|
}, U = (oe) => {
|
|
@@ -6608,12 +6609,12 @@ function Ug(e) {
|
|
|
6608
6609
|
}, ce = (oe = !0) => {
|
|
6609
6610
|
h !== null && (h.disconnect(), h = null), w = null, oe && R("disconnected");
|
|
6610
6611
|
}, E = () => {
|
|
6611
|
-
ae(), u = null,
|
|
6612
|
+
ae(), u = null, p = null, x = null, U("available"), ce(), $.clear();
|
|
6612
6613
|
}, L = () => {
|
|
6613
6614
|
if (!e.getSourceToken)
|
|
6614
6615
|
return null;
|
|
6615
6616
|
const oe = e.getSourceToken();
|
|
6616
|
-
return oe === null ? (E(), null) : (x !== null && x !== oe && (ae(), u = null,
|
|
6617
|
+
return oe === null ? (E(), null) : (x !== null && x !== oe && (ae(), u = null, p = null, U("available"), ce()), x = oe, oe);
|
|
6617
6618
|
}, ee = (oe) => {
|
|
6618
6619
|
if (Nc(oe.service.apiBaseUrl)) {
|
|
6619
6620
|
const se = L();
|
|
@@ -6638,7 +6639,7 @@ function Ug(e) {
|
|
|
6638
6639
|
M = setTimeout(() => {
|
|
6639
6640
|
pe();
|
|
6640
6641
|
}, ye);
|
|
6641
|
-
}, X = async (oe = !1) => e.getSourceToken && L() === null || !oe && k === "account_suspended" ? null : !oe && ne(u) ? u : !oe &&
|
|
6642
|
+
}, X = async (oe = !1) => e.getSourceToken && L() === null || !oe && k === "account_suspended" ? null : !oe && ne(u) ? u : !oe && p !== null ? await p : (p = (async () => {
|
|
6642
6643
|
try {
|
|
6643
6644
|
const ye = await e.bootstrapClient.get(
|
|
6644
6645
|
n,
|
|
@@ -6651,8 +6652,8 @@ function Ug(e) {
|
|
|
6651
6652
|
throw ye;
|
|
6652
6653
|
}
|
|
6653
6654
|
})().finally(() => {
|
|
6654
|
-
|
|
6655
|
-
}), await
|
|
6655
|
+
p = null;
|
|
6656
|
+
}), await p), pe = async () => {
|
|
6656
6657
|
const oe = h !== null;
|
|
6657
6658
|
try {
|
|
6658
6659
|
if (await X(!0), !oe)
|
|
@@ -6741,7 +6742,7 @@ function Ug(e) {
|
|
|
6741
6742
|
return Promise.reject(oe);
|
|
6742
6743
|
}
|
|
6743
6744
|
);
|
|
6744
|
-
const me = () => k === "account_suspended" ? null : h, ge = (oe) => (A.add(oe), oe(
|
|
6745
|
+
const me = () => k === "account_suspended" ? null : h, ge = (oe) => (A.add(oe), oe(y), () => {
|
|
6745
6746
|
A.delete(oe);
|
|
6746
6747
|
}), V = (oe) => (P.add(oe), oe(k), () => {
|
|
6747
6748
|
P.delete(oe);
|
|
@@ -6760,7 +6761,7 @@ function Ug(e) {
|
|
|
6760
6761
|
for (const [De, Be] of $.entries())
|
|
6761
6762
|
Te - Be.seenAt > o && $.delete(De);
|
|
6762
6763
|
return !0;
|
|
6763
|
-
},
|
|
6764
|
+
}, v = (oe) => {
|
|
6764
6765
|
const se = me();
|
|
6765
6766
|
if (!se || typeof se.join != "function")
|
|
6766
6767
|
return;
|
|
@@ -6923,12 +6924,12 @@ function Ug(e) {
|
|
|
6923
6924
|
initializedEvent: t,
|
|
6924
6925
|
getEcho: me,
|
|
6925
6926
|
waitForEcho: ht,
|
|
6926
|
-
getConnectionStatus: () =>
|
|
6927
|
+
getConnectionStatus: () => y,
|
|
6927
6928
|
getAccessState: () => k,
|
|
6928
6929
|
onConnectionStatusChange: ge,
|
|
6929
6930
|
onAccessStateChange: V,
|
|
6930
6931
|
reconnect: Ze,
|
|
6931
|
-
subscribeToPresenceStatus:
|
|
6932
|
+
subscribeToPresenceStatus: v,
|
|
6932
6933
|
unsubscribeFromPresenceStatus: f,
|
|
6933
6934
|
subscribeToConversation: ie,
|
|
6934
6935
|
unsubscribeFromConversation: Ce,
|
|
@@ -7076,7 +7077,7 @@ const Fg = (e, t, n, i) => {
|
|
|
7076
7077
|
return null;
|
|
7077
7078
|
const o = e.participants.find((u) => u.user_id === n || u.user?.id === n)?.last_read_message_id;
|
|
7078
7079
|
if (typeof o == "string" && o.length > 0) {
|
|
7079
|
-
const u = t.findIndex((
|
|
7080
|
+
const u = t.findIndex((p) => p.id === o);
|
|
7080
7081
|
if (u >= 0)
|
|
7081
7082
|
return t[u + 1]?.id ?? null;
|
|
7082
7083
|
}
|
|
@@ -7239,7 +7240,7 @@ function ri() {
|
|
|
7239
7240
|
onInterrupt: L
|
|
7240
7241
|
}
|
|
7241
7242
|
);
|
|
7242
|
-
},
|
|
7243
|
+
}, p = (E) => {
|
|
7243
7244
|
const L = () => i(E);
|
|
7244
7245
|
if (n(E, "opacity"), !e.shouldAnimate) {
|
|
7245
7246
|
e.set(E, { opacity: 1 }), L();
|
|
@@ -7283,7 +7284,7 @@ function ri() {
|
|
|
7283
7284
|
);
|
|
7284
7285
|
}, w = (E, L) => {
|
|
7285
7286
|
l(E, L);
|
|
7286
|
-
},
|
|
7287
|
+
}, y = (E) => {
|
|
7287
7288
|
u(E);
|
|
7288
7289
|
}, k = (E) => {
|
|
7289
7290
|
E.querySelectorAll(".message-send-ripple").forEach((B) => B.remove());
|
|
@@ -7458,7 +7459,7 @@ function ri() {
|
|
|
7458
7459
|
I();
|
|
7459
7460
|
return;
|
|
7460
7461
|
}
|
|
7461
|
-
const
|
|
7462
|
+
const v = Math.max(18, Math.abs(j) * 0.12);
|
|
7462
7463
|
e.timeline().fromTo(
|
|
7463
7464
|
ge,
|
|
7464
7465
|
{
|
|
@@ -7470,7 +7471,7 @@ function ri() {
|
|
|
7470
7471
|
},
|
|
7471
7472
|
{
|
|
7472
7473
|
x: j * 0.45,
|
|
7473
|
-
y: me * 0.5 -
|
|
7474
|
+
y: me * 0.5 - v,
|
|
7474
7475
|
scale: 0.94,
|
|
7475
7476
|
opacity: 1,
|
|
7476
7477
|
duration: 0.16,
|
|
@@ -7590,10 +7591,10 @@ function ri() {
|
|
|
7590
7591
|
return Nt(ce), {
|
|
7591
7592
|
animateOutgoingMessageEnter: l,
|
|
7592
7593
|
animateIncomingMessageEnter: u,
|
|
7593
|
-
animateHistoryMessageAppear:
|
|
7594
|
+
animateHistoryMessageAppear: p,
|
|
7594
7595
|
animateOptimisticResolve: h,
|
|
7595
7596
|
animateSentBubbleFromComposer: w,
|
|
7596
|
-
animateReceivedBubbleEntry:
|
|
7597
|
+
animateReceivedBubbleEntry: y,
|
|
7597
7598
|
animateActiveConversationPulse: x,
|
|
7598
7599
|
animateSendRipple: k,
|
|
7599
7600
|
animateComposerReset: M,
|
|
@@ -7618,7 +7619,7 @@ const mu = ["data-testid", "aria-label"], pu = { class: "day-separator__chip" },
|
|
|
7618
7619
|
const t = e, n = C(() => ({
|
|
7619
7620
|
"--day-separator-top": `${t.stickyTopPx}px`
|
|
7620
7621
|
})), i = C(() => t.testId.length > 0 ? t.testId : void 0);
|
|
7621
|
-
return (o, l) => (m(),
|
|
7622
|
+
return (o, l) => (m(), b("div", {
|
|
7622
7623
|
class: xe([
|
|
7623
7624
|
"day-separator",
|
|
7624
7625
|
{
|
|
@@ -7678,7 +7679,7 @@ const mu = ["data-testid", "aria-label"], pu = { class: "day-separator__chip" },
|
|
|
7678
7679
|
},
|
|
7679
7680
|
setup(e) {
|
|
7680
7681
|
const t = e, n = C(() => t.size ? typeof t.size == "number" ? `${t.size}px` : t.size : "1em"), i = C(() => bu[t.name] ?? "");
|
|
7681
|
-
return (o, l) => (m(),
|
|
7682
|
+
return (o, l) => (m(), b("svg", {
|
|
7682
7683
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7683
7684
|
viewBox: "0 0 512 512",
|
|
7684
7685
|
width: n.value,
|
|
@@ -7706,7 +7707,7 @@ const mu = ["data-testid", "aria-label"], pu = { class: "day-separator__chip" },
|
|
|
7706
7707
|
const h = l.value;
|
|
7707
7708
|
!h || i.autoGrow === !1 || (h.style.height = "auto", h.style.height = h.scrollHeight + "px");
|
|
7708
7709
|
}
|
|
7709
|
-
function
|
|
7710
|
+
function p(h) {
|
|
7710
7711
|
o("update:modelValue", h.target.value), o("input", h), ct(u);
|
|
7711
7712
|
}
|
|
7712
7713
|
return Xe(() => i.modelValue, () => ct(u)), Yt(u), t({
|
|
@@ -7714,7 +7715,7 @@ const mu = ["data-testid", "aria-label"], pu = { class: "day-separator__chip" },
|
|
|
7714
7715
|
$el: l,
|
|
7715
7716
|
/** Programmatic focus */
|
|
7716
7717
|
setFocus: () => l.value?.focus()
|
|
7717
|
-
}), (h, w) => (m(),
|
|
7718
|
+
}), (h, w) => (m(), b("textarea", {
|
|
7718
7719
|
ref_key: "textareaRef",
|
|
7719
7720
|
ref: l,
|
|
7720
7721
|
class: "msg-textarea",
|
|
@@ -7723,10 +7724,10 @@ const mu = ["data-testid", "aria-label"], pu = { class: "day-separator__chip" },
|
|
|
7723
7724
|
disabled: e.disabled,
|
|
7724
7725
|
rows: e.rows ?? 1,
|
|
7725
7726
|
maxlength: e.maxlength,
|
|
7726
|
-
onInput:
|
|
7727
|
-
onKeydown: w[0] || (w[0] = (
|
|
7728
|
-
onFocus: w[1] || (w[1] = (
|
|
7729
|
-
onBlur: w[2] || (w[2] = (
|
|
7727
|
+
onInput: p,
|
|
7728
|
+
onKeydown: w[0] || (w[0] = (y) => h.$emit("keydown", y)),
|
|
7729
|
+
onFocus: w[1] || (w[1] = (y) => h.$emit("focus", y)),
|
|
7730
|
+
onBlur: w[2] || (w[2] = (y) => h.$emit("blur", y))
|
|
7730
7731
|
}, null, 40, _u));
|
|
7731
7732
|
}
|
|
7732
7733
|
});
|
|
@@ -7734,35 +7735,35 @@ class wu {
|
|
|
7734
7735
|
async create(t) {
|
|
7735
7736
|
const n = document.createElement("div"), i = {};
|
|
7736
7737
|
if (n.className = `msg-action-sheet-overlay ${t.cssClass ?? ""}`, t.htmlAttributes)
|
|
7737
|
-
for (const [
|
|
7738
|
-
n.setAttribute(
|
|
7738
|
+
for (const [y, k] of Object.entries(t.htmlAttributes))
|
|
7739
|
+
n.setAttribute(y, k);
|
|
7739
7740
|
let o = null;
|
|
7740
|
-
const l = new Promise((
|
|
7741
|
-
o =
|
|
7742
|
-
}), u = async (
|
|
7743
|
-
n.classList.add("msg-action-sheet-overlay--closing"), await new Promise((k) => setTimeout(k, 200)), n.remove(), o && (o({ role:
|
|
7744
|
-
},
|
|
7745
|
-
|
|
7741
|
+
const l = new Promise((y) => {
|
|
7742
|
+
o = y;
|
|
7743
|
+
}), u = async (y) => {
|
|
7744
|
+
n.classList.add("msg-action-sheet-overlay--closing"), await new Promise((k) => setTimeout(k, 200)), n.remove(), o && (o({ role: y }), o = null);
|
|
7745
|
+
}, p = document.createElement("button");
|
|
7746
|
+
p.type = "button", p.className = "msg-action-sheet-backdrop", p.setAttribute("aria-label", "Close"), p.addEventListener("click", () => {
|
|
7746
7747
|
u("backdrop");
|
|
7747
|
-
}), n.appendChild(
|
|
7748
|
+
}), n.appendChild(p);
|
|
7748
7749
|
const h = document.createElement("div");
|
|
7749
7750
|
if (h.className = "msg-action-sheet", t.header) {
|
|
7750
|
-
const
|
|
7751
|
-
|
|
7751
|
+
const y = document.createElement("div");
|
|
7752
|
+
y.className = "msg-action-sheet__header", y.textContent = t.header, h.appendChild(y);
|
|
7752
7753
|
}
|
|
7753
7754
|
if (t.subHeader) {
|
|
7754
|
-
const
|
|
7755
|
-
|
|
7755
|
+
const y = document.createElement("div");
|
|
7756
|
+
y.className = "msg-action-sheet__subheader", y.textContent = t.subHeader, h.appendChild(y);
|
|
7756
7757
|
}
|
|
7757
7758
|
const w = document.createElement("div");
|
|
7758
7759
|
w.className = "msg-action-sheet__group";
|
|
7759
|
-
for (const
|
|
7760
|
+
for (const y of t.buttons) {
|
|
7760
7761
|
const k = document.createElement("button");
|
|
7761
|
-
if (k.type = "button", k.className = `action-sheet-button msg-action-sheet__button ${
|
|
7762
|
-
for (const [x, M] of Object.entries(
|
|
7762
|
+
if (k.type = "button", k.className = `action-sheet-button msg-action-sheet__button ${y.cssClass ?? ""}`, y.role === "destructive" && k.classList.add("msg-action-sheet__button--destructive"), y.role === "cancel" && k.classList.add("msg-action-sheet__button--cancel"), y.role === "selected" && k.classList.add("msg-action-sheet__button--selected"), y.htmlAttributes)
|
|
7763
|
+
for (const [x, M] of Object.entries(y.htmlAttributes))
|
|
7763
7764
|
k.setAttribute(x, M);
|
|
7764
|
-
k.textContent =
|
|
7765
|
-
|
|
7765
|
+
k.textContent = y.text, k.addEventListener("click", () => {
|
|
7766
|
+
y.handler && y.handler() === !1 || u(y.role ?? "selected");
|
|
7766
7767
|
}), w.appendChild(k);
|
|
7767
7768
|
}
|
|
7768
7769
|
return h.appendChild(w), n.appendChild(h), i.present = async () => {
|
|
@@ -7776,30 +7777,30 @@ class Cu {
|
|
|
7776
7777
|
const n = document.createElement("div"), i = {};
|
|
7777
7778
|
n.className = `msg-alert-overlay ${t.cssClass ?? ""}`;
|
|
7778
7779
|
let o = null;
|
|
7779
|
-
const l = new Promise((
|
|
7780
|
-
o =
|
|
7781
|
-
}), u = async (
|
|
7782
|
-
n.classList.add("msg-alert-overlay--closing"), await new Promise((k) => setTimeout(k, 200)), n.remove(), o && (o({ role:
|
|
7783
|
-
},
|
|
7784
|
-
|
|
7780
|
+
const l = new Promise((y) => {
|
|
7781
|
+
o = y;
|
|
7782
|
+
}), u = async (y) => {
|
|
7783
|
+
n.classList.add("msg-alert-overlay--closing"), await new Promise((k) => setTimeout(k, 200)), n.remove(), o && (o({ role: y }), o = null);
|
|
7784
|
+
}, p = document.createElement("div");
|
|
7785
|
+
p.className = "msg-alert-backdrop", n.appendChild(p);
|
|
7785
7786
|
const h = document.createElement("div");
|
|
7786
7787
|
if (h.className = "msg-alert-card", t.header) {
|
|
7787
|
-
const
|
|
7788
|
-
|
|
7788
|
+
const y = document.createElement("h3");
|
|
7789
|
+
y.className = "msg-alert-card__header", y.textContent = t.header, h.appendChild(y);
|
|
7789
7790
|
}
|
|
7790
7791
|
if (t.message) {
|
|
7791
|
-
const
|
|
7792
|
-
|
|
7792
|
+
const y = document.createElement("p");
|
|
7793
|
+
y.className = "msg-alert-card__message", y.textContent = t.message, h.appendChild(y);
|
|
7793
7794
|
}
|
|
7794
7795
|
const w = document.createElement("div");
|
|
7795
7796
|
w.className = "msg-alert-card__buttons";
|
|
7796
|
-
for (const
|
|
7797
|
+
for (const y of t.buttons) {
|
|
7797
7798
|
const k = document.createElement("button");
|
|
7798
|
-
if (k.type = "button", k.className = `msg-alert-card__button ${
|
|
7799
|
-
for (const [x, M] of Object.entries(
|
|
7799
|
+
if (k.type = "button", k.className = `msg-alert-card__button ${y.cssClass ?? ""}`, y.role === "destructive" && k.classList.add("msg-alert-card__button--destructive"), y.role === "cancel" && k.classList.add("msg-alert-card__button--cancel"), y.htmlAttributes)
|
|
7800
|
+
for (const [x, M] of Object.entries(y.htmlAttributes))
|
|
7800
7801
|
k.setAttribute(x, M);
|
|
7801
|
-
k.textContent =
|
|
7802
|
-
|
|
7802
|
+
k.textContent = y.text, k.addEventListener("click", () => {
|
|
7803
|
+
y.handler && y.handler(), u(y.role ?? "selected");
|
|
7803
7804
|
}), w.appendChild(k);
|
|
7804
7805
|
}
|
|
7805
7806
|
return h.appendChild(w), n.appendChild(h), i.present = async () => {
|
|
@@ -7823,24 +7824,24 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
7823
7824
|
},
|
|
7824
7825
|
setup(e) {
|
|
7825
7826
|
const t = Qa(), n = e, i = N(!1), o = N(0), l = N(null), u = N({});
|
|
7826
|
-
let
|
|
7827
|
-
const w = /* @__PURE__ */ new Map(),
|
|
7828
|
-
() => n.attachments.filter((
|
|
7827
|
+
let p = null, h = 0;
|
|
7828
|
+
const w = /* @__PURE__ */ new Map(), y = C(
|
|
7829
|
+
() => n.attachments.filter((v) => v.type.startsWith("image/"))
|
|
7829
7830
|
), k = C(
|
|
7830
|
-
() => n.attachments.filter((
|
|
7831
|
+
() => n.attachments.filter((v) => v.type.startsWith("video/"))
|
|
7831
7832
|
), x = C(
|
|
7832
|
-
() => n.attachments.filter((
|
|
7833
|
-
), M = (
|
|
7834
|
-
const f = w.get(
|
|
7835
|
-
f !== void 0 && (URL.revokeObjectURL(f), w.delete(
|
|
7836
|
-
}, $ = (
|
|
7833
|
+
() => n.attachments.filter((v) => !v.type.startsWith("image/") && !v.type.startsWith("video/"))
|
|
7834
|
+
), M = (v) => mc(v), A = (v) => v.id !== "" ? v.id : v.url, P = (v) => {
|
|
7835
|
+
const f = w.get(v);
|
|
7836
|
+
f !== void 0 && (URL.revokeObjectURL(f), w.delete(v));
|
|
7837
|
+
}, $ = (v) => {
|
|
7837
7838
|
for (const [f] of w)
|
|
7838
|
-
|
|
7839
|
-
}, R = async (
|
|
7839
|
+
v.has(f) || P(f);
|
|
7840
|
+
}, R = async (v) => {
|
|
7840
7841
|
const f = uc();
|
|
7841
7842
|
if (f === null)
|
|
7842
7843
|
return;
|
|
7843
|
-
const T = await fetch(
|
|
7844
|
+
const T = await fetch(v, {
|
|
7844
7845
|
headers: {
|
|
7845
7846
|
Authorization: `Bearer ${f}`
|
|
7846
7847
|
}
|
|
@@ -7849,9 +7850,9 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
7849
7850
|
return;
|
|
7850
7851
|
const ie = await T.blob();
|
|
7851
7852
|
return URL.createObjectURL(ie);
|
|
7852
|
-
}, U = async (
|
|
7853
|
+
}, U = async (v) => {
|
|
7853
7854
|
const f = ++h, T = {}, ie = /* @__PURE__ */ new Set();
|
|
7854
|
-
for (const Ce of
|
|
7855
|
+
for (const Ce of v) {
|
|
7855
7856
|
const Se = A(Ce);
|
|
7856
7857
|
ie.add(Se);
|
|
7857
7858
|
const we = zi(Ce) ?? "";
|
|
@@ -7881,28 +7882,28 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
7881
7882
|
T[Se] = we;
|
|
7882
7883
|
}
|
|
7883
7884
|
$(ie), u.value = T;
|
|
7884
|
-
}, ae = (
|
|
7885
|
-
const f = A(
|
|
7886
|
-
return u.value[f] ?? zi(
|
|
7885
|
+
}, ae = (v) => {
|
|
7886
|
+
const f = A(v);
|
|
7887
|
+
return u.value[f] ?? zi(v) ?? "";
|
|
7887
7888
|
}, ce = C(
|
|
7888
|
-
() =>
|
|
7889
|
+
() => y.value.slice(0, xn)
|
|
7889
7890
|
), E = C(
|
|
7890
|
-
() => Math.max(0,
|
|
7891
|
-
), L = C(() => `img-grid img-grid--${Math.min(
|
|
7892
|
-
const f = Math.min(
|
|
7893
|
-
return f === 1 ? "img-cell--single" : f === 2 ? "img-cell--half" : f === 3 ?
|
|
7891
|
+
() => Math.max(0, y.value.length - xn)
|
|
7892
|
+
), L = C(() => `img-grid img-grid--${Math.min(y.value.length, xn)}`), ee = (v) => {
|
|
7893
|
+
const f = Math.min(y.value.length, xn);
|
|
7894
|
+
return f === 1 ? "img-cell--single" : f === 2 ? "img-cell--half" : f === 3 ? v === 0 ? "img-cell--top-full" : "img-cell--bottom-half" : "img-cell--quarter";
|
|
7894
7895
|
}, ne = C(
|
|
7895
|
-
() =>
|
|
7896
|
-
), B = (
|
|
7897
|
-
|
|
7896
|
+
() => y.value[o.value] ?? null
|
|
7897
|
+
), B = (v) => {
|
|
7898
|
+
p = document.activeElement instanceof HTMLElement ? document.activeElement : null, o.value = v, i.value = !0;
|
|
7898
7899
|
}, X = () => {
|
|
7899
|
-
i.value = !1,
|
|
7900
|
+
i.value = !1, p && (p.focus(), p = null);
|
|
7900
7901
|
}, pe = () => {
|
|
7901
7902
|
o.value > 0 && o.value--;
|
|
7902
7903
|
}, de = () => {
|
|
7903
|
-
o.value <
|
|
7904
|
-
}, O = (
|
|
7905
|
-
if (
|
|
7904
|
+
o.value < y.value.length - 1 && o.value++;
|
|
7905
|
+
}, O = (v) => {
|
|
7906
|
+
if (v.key !== "Tab") return;
|
|
7906
7907
|
const f = l.value;
|
|
7907
7908
|
if (!f) return;
|
|
7908
7909
|
const T = f.querySelectorAll(
|
|
@@ -7910,48 +7911,48 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
7910
7911
|
);
|
|
7911
7912
|
if (T.length === 0) return;
|
|
7912
7913
|
const ie = T[0], Ce = T[T.length - 1];
|
|
7913
|
-
|
|
7914
|
-
}, j = (
|
|
7915
|
-
if (
|
|
7916
|
-
O(
|
|
7914
|
+
v.shiftKey ? document.activeElement === ie && (v.preventDefault(), Ce.focus()) : document.activeElement === Ce && (v.preventDefault(), ie.focus());
|
|
7915
|
+
}, j = (v) => {
|
|
7916
|
+
if (v.key === "Tab") {
|
|
7917
|
+
O(v);
|
|
7917
7918
|
return;
|
|
7918
7919
|
}
|
|
7919
|
-
|
|
7920
|
+
v.key === "Escape" && X(), v.key === "ArrowLeft" && pe(), v.key === "ArrowRight" && de();
|
|
7920
7921
|
};
|
|
7921
|
-
Xe(i, async (
|
|
7922
|
-
|
|
7922
|
+
Xe(i, async (v) => {
|
|
7923
|
+
v ? (document.addEventListener("keydown", j), await ct(), l.value?.querySelector(
|
|
7923
7924
|
'[data-testid="btn-close-image-viewer"]'
|
|
7924
7925
|
)?.focus()) : document.removeEventListener("keydown", j);
|
|
7925
|
-
}), Xe(k, (
|
|
7926
|
-
U(
|
|
7926
|
+
}), Xe(k, (v) => {
|
|
7927
|
+
U(v);
|
|
7927
7928
|
}, { immediate: !0 }), Us(() => {
|
|
7928
7929
|
document.removeEventListener("keydown", j);
|
|
7929
|
-
for (const [
|
|
7930
|
-
P(
|
|
7930
|
+
for (const [v] of w)
|
|
7931
|
+
P(v);
|
|
7931
7932
|
});
|
|
7932
|
-
const me = (
|
|
7933
|
-
if (
|
|
7934
|
-
const f = 1024, T = ["B", "KB", "MB", "GB"], ie = Math.floor(Math.log(
|
|
7935
|
-
return `${parseFloat((
|
|
7936
|
-
}, I = async (
|
|
7933
|
+
const me = (v) => v.startsWith("image/") ? "imageOutline" : v.startsWith("video/") ? "videocamOutline" : v.startsWith("audio/") ? "musicalNotesOutline" : v === "application/pdf" ? "documentOutline" : ["text/javascript", "text/typescript", "text/html", "text/css", "application/json", "text/xml", "text/yaml", "text/plain"].includes(v) ? "codeSlashOutline" : ["application/zip", "application/x-rar-compressed", "application/x-7z-compressed", "application/gzip"].includes(v) ? "archiveOutline" : "documentOutline", ge = (v) => v.startsWith("image/") ? "bg-green-500/15" : v.startsWith("video/") ? "bg-purple-500/15" : v.startsWith("audio/") ? "bg-yellow-500/15" : v === "application/pdf" ? "bg-red-500/15" : "bg-gray-500/15", V = (v) => v.startsWith("image/") ? "text-green-500" : v.startsWith("video/") ? "text-purple-500" : v.startsWith("audio/") ? "text-yellow-500" : v === "application/pdf" ? "text-red-500" : "text-gray-400", H = (v) => {
|
|
7934
|
+
if (v === 0) return "0 B";
|
|
7935
|
+
const f = 1024, T = ["B", "KB", "MB", "GB"], ie = Math.floor(Math.log(v) / Math.log(f));
|
|
7936
|
+
return `${parseFloat((v / Math.pow(f, ie)).toFixed(1))} ${T[ie]}`;
|
|
7937
|
+
}, I = async (v) => {
|
|
7937
7938
|
try {
|
|
7938
7939
|
const f = document.createElement("a");
|
|
7939
|
-
f.href =
|
|
7940
|
+
f.href = v.url, f.download = v.name, f.target = "_blank", document.body.appendChild(f), f.click(), document.body.removeChild(f), tt(`Downloading ${v.name}`, "success");
|
|
7940
7941
|
} catch {
|
|
7941
7942
|
tt("Failed to download file", "error");
|
|
7942
7943
|
}
|
|
7943
7944
|
};
|
|
7944
|
-
return (
|
|
7945
|
+
return (v, f) => (m(), b(ze, null, [
|
|
7945
7946
|
c("div", lr(Lt(t), {
|
|
7946
7947
|
class: "msg-attachments",
|
|
7947
7948
|
"data-testid": `attachments-${e.messageId}`
|
|
7948
7949
|
}), [
|
|
7949
|
-
|
|
7950
|
+
y.value.length > 0 ? (m(), b("div", {
|
|
7950
7951
|
key: 0,
|
|
7951
7952
|
class: xe(L.value),
|
|
7952
7953
|
"data-testid": `image-grid-${e.messageId}`
|
|
7953
7954
|
}, [
|
|
7954
|
-
(m(!0),
|
|
7955
|
+
(m(!0), b(ze, null, dt(ce.value, (T, ie) => (m(), b("button", {
|
|
7955
7956
|
key: T.id,
|
|
7956
7957
|
type: "button",
|
|
7957
7958
|
class: xe(["img-cell", ee(ie)]),
|
|
@@ -7965,13 +7966,13 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
7965
7966
|
class: "img-cell-image",
|
|
7966
7967
|
loading: "lazy"
|
|
7967
7968
|
}, null, 8, xu),
|
|
7968
|
-
ie === xn - 1 && E.value > 0 ? (m(),
|
|
7969
|
+
ie === xn - 1 && E.value > 0 ? (m(), b("div", Eu, [
|
|
7969
7970
|
c("span", $u, "+" + J(E.value), 1)
|
|
7970
7971
|
])) : K("", !0),
|
|
7971
7972
|
f[3] || (f[3] = c("div", { class: "img-cell-hover" }, null, -1))
|
|
7972
7973
|
], 10, Mu))), 128))
|
|
7973
7974
|
], 10, Tu)) : K("", !0),
|
|
7974
|
-
(m(!0),
|
|
7975
|
+
(m(!0), b(ze, null, dt(k.value, (T) => (m(), b("div", {
|
|
7975
7976
|
key: T.id,
|
|
7976
7977
|
class: "relative mt-1.5",
|
|
7977
7978
|
"data-testid": `attachment-video-${T.id}`
|
|
@@ -7993,7 +7994,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
7993
7994
|
])], 8, Ru),
|
|
7994
7995
|
c("div", Pu, J(H(T.size)), 1)
|
|
7995
7996
|
], 8, Au))), 128)),
|
|
7996
|
-
(m(!0),
|
|
7997
|
+
(m(!0), b(ze, null, dt(x.value, (T) => (m(), b("div", {
|
|
7997
7998
|
key: T.id,
|
|
7998
7999
|
class: xe(["file-card", e.isOwnMessage ? "file-card--own" : "file-card--other"]),
|
|
7999
8000
|
"data-testid": `attachment-file-${T.id}`,
|
|
@@ -8027,7 +8028,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
8027
8028
|
], 42, Iu))), 128))
|
|
8028
8029
|
], 16, Su),
|
|
8029
8030
|
(m(), st(ns, { to: "body" }, [
|
|
8030
|
-
i.value ? (m(),
|
|
8031
|
+
i.value ? (m(), b("div", {
|
|
8031
8032
|
key: 0,
|
|
8032
8033
|
ref_key: "lightboxOverlayRef",
|
|
8033
8034
|
ref: l,
|
|
@@ -8057,8 +8058,8 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
8057
8058
|
class: "w-6 h-6"
|
|
8058
8059
|
})
|
|
8059
8060
|
]),
|
|
8060
|
-
|
|
8061
|
-
o.value > 0 ? (m(),
|
|
8061
|
+
y.value.length > 1 ? (m(), b("div", Fu, J(o.value + 1) + " / " + J(y.value.length), 1)) : K("", !0),
|
|
8062
|
+
o.value > 0 ? (m(), b("button", {
|
|
8062
8063
|
key: 1,
|
|
8063
8064
|
class: "lightbox-nav lightbox-nav--prev",
|
|
8064
8065
|
"aria-label": "Previous image",
|
|
@@ -8070,7 +8071,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
8070
8071
|
class: "w-6 h-6"
|
|
8071
8072
|
})
|
|
8072
8073
|
])) : K("", !0),
|
|
8073
|
-
o.value <
|
|
8074
|
+
o.value < y.value.length - 1 ? (m(), b("button", {
|
|
8074
8075
|
key: 2,
|
|
8075
8076
|
class: "lightbox-nav lightbox-nav--next",
|
|
8076
8077
|
"aria-label": "Next image",
|
|
@@ -8082,7 +8083,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
8082
8083
|
class: "w-6 h-6"
|
|
8083
8084
|
})
|
|
8084
8085
|
])) : K("", !0),
|
|
8085
|
-
ne.value ? (m(),
|
|
8086
|
+
ne.value ? (m(), b("img", {
|
|
8086
8087
|
key: 3,
|
|
8087
8088
|
src: ne.value.url,
|
|
8088
8089
|
alt: ne.value.name || "Image",
|
|
@@ -8096,7 +8097,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
8096
8097
|
}, ["stop"]))
|
|
8097
8098
|
}, [
|
|
8098
8099
|
c("span", zu, J(ne.value?.name || "Image"), 1),
|
|
8099
|
-
ne.value ? (m(),
|
|
8100
|
+
ne.value ? (m(), b("button", {
|
|
8100
8101
|
key: 0,
|
|
8101
8102
|
class: "lightbox-download",
|
|
8102
8103
|
"data-testid": "btn-download-current-image",
|
|
@@ -8136,7 +8137,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
8136
8137
|
const o = i.target;
|
|
8137
8138
|
o && (o.style.display = "none");
|
|
8138
8139
|
};
|
|
8139
|
-
return (i, o) => (m(),
|
|
8140
|
+
return (i, o) => (m(), b("a", {
|
|
8140
8141
|
href: e.preview.url,
|
|
8141
8142
|
target: "_blank",
|
|
8142
8143
|
rel: "noopener noreferrer",
|
|
@@ -8146,7 +8147,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
8146
8147
|
onClick: o[0] || (o[0] = Ge(() => {
|
|
8147
8148
|
}, ["stop"]))
|
|
8148
8149
|
}, [
|
|
8149
|
-
e.preview.image ? (m(),
|
|
8150
|
+
e.preview.image ? (m(), b("div", Hu, [
|
|
8150
8151
|
c("img", {
|
|
8151
8152
|
src: e.preview.image,
|
|
8152
8153
|
alt: e.preview.title ?? "Link preview",
|
|
@@ -8156,8 +8157,8 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
8156
8157
|
])) : K("", !0),
|
|
8157
8158
|
c("div", Wu, [
|
|
8158
8159
|
c("span", Gu, J(e.preview.domain), 1),
|
|
8159
|
-
e.preview.title ? (m(),
|
|
8160
|
-
e.preview.description ? (m(),
|
|
8160
|
+
e.preview.title ? (m(), b("span", Xu, J(e.preview.title), 1)) : K("", !0),
|
|
8161
|
+
e.preview.description ? (m(), b("span", Ku, J(e.preview.description), 1)) : K("", !0)
|
|
8161
8162
|
])
|
|
8162
8163
|
], 10, qu));
|
|
8163
8164
|
}
|
|
@@ -8233,7 +8234,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
8233
8234
|
},
|
|
8234
8235
|
emits: ["edit", "delete", "copy", "retry", "react", "reply", "scroll-to-message"],
|
|
8235
8236
|
setup(e, { emit: t }) {
|
|
8236
|
-
const n = e, i = t, o = It()(), l = ss(), { term: u } = Vr(),
|
|
8237
|
+
const n = e, i = t, o = It()(), l = ss(), { term: u } = Vr(), p = ri(), h = N(!1), w = N(!1), y = N(""), k = N(!1), x = N(!1), M = N(!0), A = N(null), P = N(null), $ = N(null), R = N(null), U = N(null), ae = /* @__PURE__ */ new Map(), ce = N(null), E = N(null);
|
|
8237
8238
|
let L, ee, ne = null, B = 0, X = 0, pe = !1;
|
|
8238
8239
|
const de = [
|
|
8239
8240
|
{ type: "heart", emoji: "❤️", label: "heart" },
|
|
@@ -8285,7 +8286,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
8285
8286
|
}, H = C(() => V(n.message.author_id)), I = C(() => {
|
|
8286
8287
|
const S = H.value;
|
|
8287
8288
|
return n.participantNames[n.message.author_id] ?? (S ? n.participantNames[S] : void 0) ?? n.message.author?.name ?? "Unknown";
|
|
8288
|
-
}),
|
|
8289
|
+
}), v = C(() => {
|
|
8289
8290
|
const S = H.value;
|
|
8290
8291
|
return n.participantAvatars[n.message.author_id] ?? (S ? n.participantAvatars[S] : void 0) ?? n.message.author?.avatar ?? void 0;
|
|
8291
8292
|
}), f = C(() => ge(I.value)), T = C(
|
|
@@ -8470,7 +8471,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
8470
8471
|
if (Ae.classList.contains("reaction-emoji-btn")) {
|
|
8471
8472
|
ce.value = S;
|
|
8472
8473
|
const bt = en() ?? $.value;
|
|
8473
|
-
bt instanceof HTMLElement &&
|
|
8474
|
+
bt instanceof HTMLElement && p.animateReactionPickerToBubbleArc(Ae, bt, S);
|
|
8474
8475
|
}
|
|
8475
8476
|
Ae.classList.contains("reaction-pill") && qe(S) && (E.value = {
|
|
8476
8477
|
reaction: S,
|
|
@@ -8487,14 +8488,14 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
8487
8488
|
const jn = Ae[nn] ?? 0, Bn = Y[nn] ?? 0;
|
|
8488
8489
|
if (Bn > jn && (ct(() => {
|
|
8489
8490
|
const Ht = ae.get(nn);
|
|
8490
|
-
Ht instanceof HTMLElement &&
|
|
8491
|
+
Ht instanceof HTMLElement && p.animateReactionLandingBounce(Ht);
|
|
8491
8492
|
const Ft = en();
|
|
8492
|
-
Ft instanceof HTMLElement &&
|
|
8493
|
+
Ft instanceof HTMLElement && p.animateReactionNeighborScoot(Ft, Ht ?? null);
|
|
8493
8494
|
}), ce.value === nn && (ce.value = null)), Bn < jn) {
|
|
8494
8495
|
const Ht = E.value;
|
|
8495
8496
|
ct(() => {
|
|
8496
8497
|
const Ft = en();
|
|
8497
|
-
Ft instanceof HTMLElement && (Ht !== null && Ht.reaction === nn && (
|
|
8498
|
+
Ft instanceof HTMLElement && (Ht !== null && Ht.reaction === nn && (p.animateReactionRemovalPuff(Ft, Ht.rect, nn), E.value = null), p.animateReactionNeighborScoot(Ft));
|
|
8498
8499
|
});
|
|
8499
8500
|
}
|
|
8500
8501
|
}), ft.value = Y;
|
|
@@ -8611,11 +8612,11 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
8611
8612
|
buttons: S
|
|
8612
8613
|
})).present();
|
|
8613
8614
|
}, pn = () => {
|
|
8614
|
-
z(),
|
|
8615
|
+
z(), y.value = n.message.body || "", h.value = !0;
|
|
8615
8616
|
}, yn = () => {
|
|
8616
|
-
h.value = !1,
|
|
8617
|
+
h.value = !1, y.value = "";
|
|
8617
8618
|
}, hs = () => {
|
|
8618
|
-
const S =
|
|
8619
|
+
const S = y.value.trim();
|
|
8619
8620
|
if (!S || S === n.message.body) {
|
|
8620
8621
|
yn();
|
|
8621
8622
|
return;
|
|
@@ -8666,8 +8667,8 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
8666
8667
|
}));
|
|
8667
8668
|
}), Nt(() => {
|
|
8668
8669
|
clearTimeout(L), clearTimeout(ee), w.value = !1, ae.clear(), Kt?.disconnect(), Kt = null, typeof document < "u" && (document.removeEventListener("pointerdown", Bt), document.removeEventListener("keydown", mn));
|
|
8669
|
-
}), (S, Y) => (m(),
|
|
8670
|
-
e.showTimestamp ? (m(),
|
|
8670
|
+
}), (S, Y) => (m(), b(ze, null, [
|
|
8671
|
+
e.showTimestamp ? (m(), b("div", {
|
|
8671
8672
|
key: 0,
|
|
8672
8673
|
class: "flex items-center justify-center my-5",
|
|
8673
8674
|
"data-testid": `timestamp-separator-${e.message.id}`
|
|
@@ -8685,7 +8686,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
8685
8686
|
"data-testid": `message-${e.message.id}`,
|
|
8686
8687
|
"data-message-id": e.message.id
|
|
8687
8688
|
}, [
|
|
8688
|
-
e.message.is_deleted ? K("", !0) : (m(),
|
|
8689
|
+
e.message.is_deleted ? K("", !0) : (m(), b("div", {
|
|
8689
8690
|
key: 0,
|
|
8690
8691
|
class: xe([
|
|
8691
8692
|
"message-row__reply-indicator",
|
|
@@ -8703,7 +8704,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
8703
8704
|
class: "w-3.5 h-3.5"
|
|
8704
8705
|
})
|
|
8705
8706
|
], 10, nd)),
|
|
8706
|
-
e.isOwnMessage ? K("", !0) : (m(),
|
|
8707
|
+
e.isOwnMessage ? K("", !0) : (m(), b("div", sd, [
|
|
8707
8708
|
e.isLastInGroup ? (m(), st(cr(Ce.value), {
|
|
8708
8709
|
key: 0,
|
|
8709
8710
|
class: xe(["w-7 h-7 rounded-full overflow-hidden msg-avatar-placeholder", { "msg-avatar-placeholder--interactive": Se.value }]),
|
|
@@ -8714,13 +8715,13 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
8714
8715
|
onClick: _n
|
|
8715
8716
|
}, {
|
|
8716
8717
|
default: it(() => [
|
|
8717
|
-
|
|
8718
|
+
v.value ? (m(), b("img", {
|
|
8718
8719
|
key: 0,
|
|
8719
|
-
src:
|
|
8720
|
+
src: v.value,
|
|
8720
8721
|
alt: I.value,
|
|
8721
8722
|
class: "w-full h-full object-cover",
|
|
8722
8723
|
loading: "lazy"
|
|
8723
|
-
}, null, 8, id)) : (m(),
|
|
8724
|
+
}, null, 8, id)) : (m(), b("div", {
|
|
8724
8725
|
key: 1,
|
|
8725
8726
|
class: "w-full h-full flex items-center justify-center text-[10px] font-semibold text-white",
|
|
8726
8727
|
style: rt({ backgroundColor: T.value })
|
|
@@ -8740,7 +8741,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
8740
8741
|
onPointerup: ke,
|
|
8741
8742
|
onPointercancel: ke
|
|
8742
8743
|
}, [
|
|
8743
|
-
k.value ? (m(),
|
|
8744
|
+
k.value ? (m(), b("button", {
|
|
8744
8745
|
key: 0,
|
|
8745
8746
|
type: "button",
|
|
8746
8747
|
class: "reaction-picker-backdrop",
|
|
@@ -8750,7 +8751,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
8750
8751
|
}, null, 8, ad)) : K("", !0),
|
|
8751
8752
|
Re(Wt, { name: "reaction-picker" }, {
|
|
8752
8753
|
default: it(() => [
|
|
8753
|
-
k.value ? (m(),
|
|
8754
|
+
k.value ? (m(), b("div", {
|
|
8754
8755
|
key: 0,
|
|
8755
8756
|
ref_key: "reactionPickerRef",
|
|
8756
8757
|
ref: R,
|
|
@@ -8763,7 +8764,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
8763
8764
|
"aria-label": "Add reaction"
|
|
8764
8765
|
}, [
|
|
8765
8766
|
c("div", ld, [
|
|
8766
|
-
(m(),
|
|
8767
|
+
(m(), b(ze, null, dt(de, (Ae) => c("button", {
|
|
8767
8768
|
key: Ae.type,
|
|
8768
8769
|
type: "button",
|
|
8769
8770
|
class: "reaction-emoji-btn w-8 h-8 flex items-center justify-center rounded-full hover:scale-125 active:scale-95 transition-all duration-150 text-xl",
|
|
@@ -8785,7 +8786,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
8785
8786
|
}),
|
|
8786
8787
|
Re(Wt, { name: "message-hover-time" }, {
|
|
8787
8788
|
default: it(() => [
|
|
8788
|
-
oe.value ? (m(),
|
|
8789
|
+
oe.value ? (m(), b("div", {
|
|
8789
8790
|
key: 0,
|
|
8790
8791
|
class: xe([
|
|
8791
8792
|
"message-hover-timestamp absolute z-20 pointer-events-none",
|
|
@@ -8821,8 +8822,8 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
8821
8822
|
Dt(Ge(z, ["prevent"]), ["esc"])
|
|
8822
8823
|
]
|
|
8823
8824
|
}, [
|
|
8824
|
-
e.conversationType === "group" && e.isFirstInGroup ? (m(),
|
|
8825
|
-
e.message.reply_to && !e.message.is_deleted ? (m(),
|
|
8825
|
+
e.conversationType === "group" && e.isFirstInGroup ? (m(), b("div", hd, J(I.value), 1)) : K("", !0),
|
|
8826
|
+
e.message.reply_to && !e.message.is_deleted ? (m(), b("button", {
|
|
8826
8827
|
key: 1,
|
|
8827
8828
|
type: "button",
|
|
8828
8829
|
class: xe(["reply-preview", e.isOwnMessage ? "reply-preview--own" : "reply-preview--other"]),
|
|
@@ -8836,22 +8837,22 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
8836
8837
|
c("span", vd, J(kt.value), 1)
|
|
8837
8838
|
])
|
|
8838
8839
|
], 10, fd)) : K("", !0),
|
|
8839
|
-
e.message.is_deleted ? (m(),
|
|
8840
|
+
e.message.is_deleted ? (m(), b("div", Ad, [
|
|
8840
8841
|
Re(We, {
|
|
8841
8842
|
name: "trashOutline",
|
|
8842
8843
|
class: "w-3.5 h-3.5",
|
|
8843
8844
|
"aria-hidden": "true"
|
|
8844
8845
|
}),
|
|
8845
8846
|
Y[7] || (Y[7] = c("span", null, "This message was deleted", -1))
|
|
8846
|
-
])) : (m(),
|
|
8847
|
-
e.message.body ? (m(),
|
|
8847
|
+
])) : (m(), b("div", gd, [
|
|
8848
|
+
e.message.body ? (m(), b("div", bd, [
|
|
8848
8849
|
Re(Zu, {
|
|
8849
8850
|
tag: "p",
|
|
8850
8851
|
class: "whitespace-pre-wrap break-words text-[15px] leading-relaxed",
|
|
8851
8852
|
html: wt.value
|
|
8852
8853
|
}, null, 8, ["html"])
|
|
8853
8854
|
])) : K("", !0),
|
|
8854
|
-
be.value ? (m(),
|
|
8855
|
+
be.value ? (m(), b("button", {
|
|
8855
8856
|
key: 1,
|
|
8856
8857
|
type: "button",
|
|
8857
8858
|
class: xe(["shared-post-embed", e.isOwnMessage ? "shared-post-embed--own" : "shared-post-embed--other"]),
|
|
@@ -8860,17 +8861,17 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
8860
8861
|
onClick: fs
|
|
8861
8862
|
}, [
|
|
8862
8863
|
c("div", _d, [
|
|
8863
|
-
zt.value ? (m(),
|
|
8864
|
+
zt.value ? (m(), b("img", {
|
|
8864
8865
|
key: 0,
|
|
8865
8866
|
src: zt.value,
|
|
8866
8867
|
alt: `${Pe.value} avatar`,
|
|
8867
8868
|
class: "shared-post-embed__author-avatar",
|
|
8868
8869
|
loading: "lazy"
|
|
8869
|
-
}, null, 8, wd)) : (m(),
|
|
8870
|
+
}, null, 8, wd)) : (m(), b("div", Cd, J(Ke.value), 1)),
|
|
8870
8871
|
c("span", kd, J(Pe.value), 1)
|
|
8871
8872
|
]),
|
|
8872
|
-
pt.value ? (m(),
|
|
8873
|
-
Mt.value ? (m(),
|
|
8873
|
+
pt.value ? (m(), b("div", Sd, [
|
|
8874
|
+
Mt.value ? (m(), b("video", {
|
|
8874
8875
|
key: 0,
|
|
8875
8876
|
src: pt.value,
|
|
8876
8877
|
class: "shared-post-embed__thumbnail",
|
|
@@ -8879,7 +8880,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
8879
8880
|
preload: "metadata",
|
|
8880
8881
|
draggable: "false",
|
|
8881
8882
|
"aria-hidden": "true"
|
|
8882
|
-
}, null, 8, Td)) : (m(),
|
|
8883
|
+
}, null, 8, Td)) : (m(), b("img", {
|
|
8883
8884
|
key: 1,
|
|
8884
8885
|
src: pt.value,
|
|
8885
8886
|
alt: `Shared ${He.value} preview`,
|
|
@@ -8907,15 +8908,15 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
8907
8908
|
"message-id": e.message.id,
|
|
8908
8909
|
class: "mt-1.5"
|
|
8909
8910
|
}, null, 8, ["attachments", "is-own-message", "message-id"])) : K("", !0),
|
|
8910
|
-
e.message.edited_at ? (m(),
|
|
8911
|
+
e.message.edited_at ? (m(), b("span", $d, " edited ")) : K("", !0)
|
|
8911
8912
|
])),
|
|
8912
|
-
e.isOwnMessage && e.isLastInGroup ? (m(),
|
|
8913
|
+
e.isOwnMessage && e.isLastInGroup ? (m(), b("div", Rd, [
|
|
8913
8914
|
c("span", Pd, J(Ze.value), 1),
|
|
8914
8915
|
se.value === "sending" ? (m(), st(We, {
|
|
8915
8916
|
key: 0,
|
|
8916
8917
|
name: "timeOutline",
|
|
8917
8918
|
class: "w-3 h-3 text-white/40"
|
|
8918
|
-
})) : se.value === "failed" ? (m(),
|
|
8919
|
+
})) : se.value === "failed" ? (m(), b("button", {
|
|
8919
8920
|
key: 1,
|
|
8920
8921
|
class: "text-red-300 hover:text-red-100 transition-colors",
|
|
8921
8922
|
"data-testid": "btn-retry-message",
|
|
@@ -8940,11 +8941,11 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
8940
8941
|
class: "w-3 h-3 text-blue-200"
|
|
8941
8942
|
})) : K("", !0)
|
|
8942
8943
|
])) : K("", !0),
|
|
8943
|
-
!e.isOwnMessage && e.isLastInGroup ? (m(),
|
|
8944
|
+
!e.isOwnMessage && e.isLastInGroup ? (m(), b("div", Id, [
|
|
8944
8945
|
c("span", Ld, J(Ze.value), 1)
|
|
8945
8946
|
])) : K("", !0)
|
|
8946
8947
|
], 42, dd),
|
|
8947
|
-
Ie.value ? (m(),
|
|
8948
|
+
Ie.value ? (m(), b("div", {
|
|
8948
8949
|
key: 1,
|
|
8949
8950
|
ref_key: "reactionContainerRef",
|
|
8950
8951
|
ref: U,
|
|
@@ -8954,7 +8955,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
8954
8955
|
]),
|
|
8955
8956
|
"data-testid": `reactions-${e.message.id}`
|
|
8956
8957
|
}, [
|
|
8957
|
-
(m(!0),
|
|
8958
|
+
(m(!0), b(ze, null, dt(q.value, (Ae) => (m(), b("button", {
|
|
8958
8959
|
key: Ae.reaction,
|
|
8959
8960
|
ref_for: !0,
|
|
8960
8961
|
ref: (bt) => Qt(Ae.reaction, bt),
|
|
@@ -8983,7 +8984,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
8983
8984
|
c("div", {
|
|
8984
8985
|
class: xe(["message-actions", e.isOwnMessage ? "message-actions--own" : "message-actions--other"])
|
|
8985
8986
|
}, [
|
|
8986
|
-
e.message.is_deleted ? K("", !0) : (m(),
|
|
8987
|
+
e.message.is_deleted ? K("", !0) : (m(), b("button", {
|
|
8987
8988
|
key: 0,
|
|
8988
8989
|
type: "button",
|
|
8989
8990
|
class: "msg-action-btn",
|
|
@@ -8996,7 +8997,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
8996
8997
|
class: "w-3.5 h-3.5"
|
|
8997
8998
|
})
|
|
8998
8999
|
], 8, Nd)),
|
|
8999
|
-
e.message.is_deleted ? K("", !0) : (m(),
|
|
9000
|
+
e.message.is_deleted ? K("", !0) : (m(), b("button", {
|
|
9000
9001
|
key: 1,
|
|
9001
9002
|
type: "button",
|
|
9002
9003
|
class: "msg-action-btn",
|
|
@@ -9009,7 +9010,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
9009
9010
|
class: "w-3.5 h-3.5"
|
|
9010
9011
|
})
|
|
9011
9012
|
], 8, zd)),
|
|
9012
|
-
ye.value ? (m(),
|
|
9013
|
+
ye.value ? (m(), b("button", {
|
|
9013
9014
|
key: 2,
|
|
9014
9015
|
type: "button",
|
|
9015
9016
|
class: "msg-action-btn",
|
|
@@ -9034,7 +9035,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
9034
9035
|
class: "w-3.5 h-3.5"
|
|
9035
9036
|
})
|
|
9036
9037
|
], 8, Bd),
|
|
9037
|
-
ve.value ? (m(),
|
|
9038
|
+
ve.value ? (m(), b("button", {
|
|
9038
9039
|
key: 3,
|
|
9039
9040
|
type: "button",
|
|
9040
9041
|
class: "msg-action-btn msg-action-btn--danger",
|
|
@@ -9049,7 +9050,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
9049
9050
|
], 8, qd)) : K("", !0)
|
|
9050
9051
|
], 2)
|
|
9051
9052
|
], 10, td),
|
|
9052
|
-
h.value ? (m(),
|
|
9053
|
+
h.value ? (m(), b("div", Hd, [
|
|
9053
9054
|
c("div", {
|
|
9054
9055
|
class: "edit-modal-card rounded-2xl shadow-2xl p-5 w-full max-w-md",
|
|
9055
9056
|
onClick: Y[4] || (Y[4] = Ge(() => {
|
|
@@ -9060,8 +9061,8 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
9060
9061
|
style: { color: "var(--app-text)" }
|
|
9061
9062
|
}, " Edit Message ", -1)),
|
|
9062
9063
|
Re(ta, {
|
|
9063
|
-
modelValue:
|
|
9064
|
-
"onUpdate:modelValue": Y[3] || (Y[3] = (Ae) =>
|
|
9064
|
+
modelValue: y.value,
|
|
9065
|
+
"onUpdate:modelValue": Y[3] || (Y[3] = (Ae) => y.value = Ae),
|
|
9065
9066
|
placeholder: "Edit your message...",
|
|
9066
9067
|
rows: 3,
|
|
9067
9068
|
"auto-grow": !0,
|
|
@@ -9077,7 +9078,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
9077
9078
|
onClick: yn
|
|
9078
9079
|
}, " Cancel "),
|
|
9079
9080
|
c("button", {
|
|
9080
|
-
disabled: !
|
|
9081
|
+
disabled: !y.value.trim() || y.value.trim() === e.message.body,
|
|
9081
9082
|
class: "px-4 py-2 text-sm font-medium text-white rounded-lg transition-all disabled:opacity-40 disabled:cursor-not-allowed edit-modal-save",
|
|
9082
9083
|
"data-testid": "btn-save-edit",
|
|
9083
9084
|
"aria-label": "Save edited message",
|
|
@@ -9086,7 +9087,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
9086
9087
|
])
|
|
9087
9088
|
])
|
|
9088
9089
|
])) : K("", !0),
|
|
9089
|
-
w.value ? (m(),
|
|
9090
|
+
w.value ? (m(), b("div", Gd, [
|
|
9090
9091
|
c("div", {
|
|
9091
9092
|
class: "edit-modal-card rounded-2xl shadow-2xl p-5 w-full max-w-md",
|
|
9092
9093
|
onClick: Y[5] || (Y[5] = Ge(() => {
|
|
@@ -9125,7 +9126,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
9125
9126
|
size: {}
|
|
9126
9127
|
},
|
|
9127
9128
|
setup(e) {
|
|
9128
|
-
return (t, n) => (m(),
|
|
9129
|
+
return (t, n) => (m(), b("span", {
|
|
9129
9130
|
class: xe(["msg-spinner", e.size ? `msg-spinner--${e.size}` : ""]),
|
|
9130
9131
|
role: "status",
|
|
9131
9132
|
"aria-label": "Loading"
|
|
@@ -9166,45 +9167,45 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
9166
9167
|
"text/xml",
|
|
9167
9168
|
"text/yaml",
|
|
9168
9169
|
"text/plain"
|
|
9169
|
-
].includes(t.attachment.file.type) || t.attachment.file.name.match(/\.(js|ts|html|css|json|xml|yaml|yml|txt|md)$/i)),
|
|
9170
|
+
].includes(t.attachment.file.type) || t.attachment.file.name.match(/\.(js|ts|html|css|json|xml|yaml|yml|txt|md)$/i)), p = C(() => [
|
|
9170
9171
|
"application/zip",
|
|
9171
9172
|
"application/x-rar-compressed",
|
|
9172
9173
|
"application/x-7z-compressed",
|
|
9173
9174
|
"application/gzip"
|
|
9174
|
-
].includes(t.attachment.file.type) || t.attachment.file.name.match(/\.(zip|rar|7z|tar|gz)$/i)), h = C(() => t.attachment.file.name.split(".").pop()?.toUpperCase() || "FILE"), w = C(() => `btn-remove-attachment-${t.attachment.file.name.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || "file"}`),
|
|
9175
|
+
].includes(t.attachment.file.type) || t.attachment.file.name.match(/\.(zip|rar|7z|tar|gz)$/i)), h = C(() => t.attachment.file.name.split(".").pop()?.toUpperCase() || "FILE"), w = C(() => `btn-remove-attachment-${t.attachment.file.name.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || "file"}`), y = () => n.value ? "imageOutline" : i.value ? "videocamOutline" : o.value ? "musicalNotesOutline" : l.value ? "documentOutline" : u.value ? "codeSlashOutline" : p.value ? "archiveOutline" : "documentOutline", k = (x) => {
|
|
9175
9176
|
if (x === 0) return "0 B";
|
|
9176
9177
|
const M = 1024, A = ["B", "KB", "MB", "GB"], P = Math.floor(Math.log(x) / Math.log(M));
|
|
9177
9178
|
return `${parseFloat((x / Math.pow(M, P)).toFixed(1))} ${A[P]}`;
|
|
9178
9179
|
};
|
|
9179
|
-
return (x, M) => (m(),
|
|
9180
|
+
return (x, M) => (m(), b("div", {
|
|
9180
9181
|
class: "attachment-preview relative inline-block w-20 h-20 rounded-lg overflow-hidden",
|
|
9181
9182
|
"data-testid": `attachment-preview-${e.attachment.file.name}`
|
|
9182
9183
|
}, [
|
|
9183
|
-
n.value ? (m(),
|
|
9184
|
+
n.value ? (m(), b("div", eh, [
|
|
9184
9185
|
c("img", {
|
|
9185
9186
|
src: e.attachment.preview,
|
|
9186
9187
|
alt: e.attachment.file.name,
|
|
9187
9188
|
class: "w-full h-full object-cover"
|
|
9188
9189
|
}, null, 8, th)
|
|
9189
|
-
])) : (m(),
|
|
9190
|
+
])) : (m(), b("div", nh, [
|
|
9190
9191
|
Re(We, {
|
|
9191
|
-
name:
|
|
9192
|
+
name: y(),
|
|
9192
9193
|
class: "w-6 h-6 mb-1"
|
|
9193
9194
|
}, null, 8, ["name"]),
|
|
9194
9195
|
c("span", sh, J(h.value), 1)
|
|
9195
9196
|
])),
|
|
9196
|
-
e.uploading ? (m(),
|
|
9197
|
+
e.uploading ? (m(), b("div", ih, [
|
|
9197
9198
|
c("div", rh, [
|
|
9198
9199
|
Re(na, { class: "w-4 h-4 text-white" }),
|
|
9199
9200
|
c("div", ah, J((e.progress ?? 0) > 0 ? `${Math.round(e.progress)}%` : "Sending…"), 1)
|
|
9200
9201
|
])
|
|
9201
|
-
])) : e.attachment.error ? (m(),
|
|
9202
|
+
])) : e.attachment.error ? (m(), b("div", oh, [
|
|
9202
9203
|
Re(We, {
|
|
9203
9204
|
name: "alertCircleOutline",
|
|
9204
9205
|
class: "w-4 h-4 text-white"
|
|
9205
9206
|
})
|
|
9206
9207
|
])) : K("", !0),
|
|
9207
|
-
e.uploading ? K("", !0) : (m(),
|
|
9208
|
+
e.uploading ? K("", !0) : (m(), b("button", {
|
|
9208
9209
|
key: 4,
|
|
9209
9210
|
type: "button",
|
|
9210
9211
|
class: "msg-btn absolute top-1 right-1 z-10 w-6 h-6 rounded-full p-0",
|
|
@@ -9217,7 +9218,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
9217
9218
|
class: "w-3 h-3"
|
|
9218
9219
|
})
|
|
9219
9220
|
], 8, lh)),
|
|
9220
|
-
!e.uploading && !e.attachment.error ? (m(),
|
|
9221
|
+
!e.uploading && !e.attachment.error ? (m(), b("div", ch, J(k(e.attachment.file.size)), 1)) : K("", !0)
|
|
9221
9222
|
], 8, Qd));
|
|
9222
9223
|
}
|
|
9223
9224
|
}), dh = /* @__PURE__ */ _t(uh, [["__scopeId", "data-v-177d3c09"]]), hh = {
|
|
@@ -9320,35 +9321,35 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
9320
9321
|
return h || n[0];
|
|
9321
9322
|
}), u = (h) => {
|
|
9322
9323
|
o.value = h;
|
|
9323
|
-
},
|
|
9324
|
+
}, p = (h) => {
|
|
9324
9325
|
i("select", h);
|
|
9325
9326
|
};
|
|
9326
|
-
return (h, w) => (m(),
|
|
9327
|
+
return (h, w) => (m(), b("div", hh, [
|
|
9327
9328
|
c("div", fh, [
|
|
9328
|
-
(m(),
|
|
9329
|
-
key:
|
|
9329
|
+
(m(), b(ze, null, dt(n, (y) => c("button", {
|
|
9330
|
+
key: y.id,
|
|
9330
9331
|
type: "button",
|
|
9331
|
-
class: xe(["emoji-picker__category-btn", { "emoji-picker__category-btn--active":
|
|
9332
|
-
"data-testid": `emoji-picker-category-${
|
|
9333
|
-
"aria-label": `Show ${
|
|
9334
|
-
"aria-selected":
|
|
9332
|
+
class: xe(["emoji-picker__category-btn", { "emoji-picker__category-btn--active": y.id === o.value }]),
|
|
9333
|
+
"data-testid": `emoji-picker-category-${y.id}`,
|
|
9334
|
+
"aria-label": `Show ${y.label} emojis`,
|
|
9335
|
+
"aria-selected": y.id === o.value,
|
|
9335
9336
|
role: "tab",
|
|
9336
|
-
onClick: (k) => u(
|
|
9337
|
+
onClick: (k) => u(y.id)
|
|
9337
9338
|
}, [
|
|
9338
|
-
c("span", ph, J(
|
|
9339
|
+
c("span", ph, J(y.icon), 1)
|
|
9339
9340
|
], 10, mh)), 64))
|
|
9340
9341
|
]),
|
|
9341
9342
|
c("div", vh, [
|
|
9342
|
-
(m(!0),
|
|
9343
|
-
key: `${l.value.id}-${
|
|
9343
|
+
(m(!0), b(ze, null, dt(l.value.emojis, (y, k) => (m(), b("button", {
|
|
9344
|
+
key: `${l.value.id}-${y.value}`,
|
|
9344
9345
|
type: "button",
|
|
9345
9346
|
class: "emoji-picker__emoji-btn",
|
|
9346
9347
|
"data-testid": `emoji-picker-option-${l.value.id}-${k}`,
|
|
9347
|
-
"aria-label": `Insert ${
|
|
9348
|
+
"aria-label": `Insert ${y.label}`,
|
|
9348
9349
|
"aria-selected": "false",
|
|
9349
9350
|
role: "option",
|
|
9350
|
-
onClick: (x) => y
|
|
9351
|
-
}, J(
|
|
9351
|
+
onClick: (x) => p(y.value)
|
|
9352
|
+
}, J(y.value), 9, gh))), 128))
|
|
9352
9353
|
])
|
|
9353
9354
|
]));
|
|
9354
9355
|
}
|
|
@@ -9394,7 +9395,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
9394
9395
|
},
|
|
9395
9396
|
emits: ["update:message", "send", "typing", "stop-typing", "attach-file", "cancel-reply"],
|
|
9396
9397
|
setup(e, { expose: t, emit: n }) {
|
|
9397
|
-
const i = e, o = It()(), l = n, u = N(),
|
|
9398
|
+
const i = e, o = It()(), l = n, u = N(), p = N(null), h = N(), w = N(null), y = N(null), k = N(null), x = N(null), M = N(i.message), A = N([]), P = N(!1), $ = N(!1), R = N(!1), U = N(!1), ae = N(""), ce = N(!1), E = N("Draft restored"), L = N(!1), ee = N(!1), ne = N(!0), B = ri();
|
|
9398
9399
|
let X = null, pe = 0, de = null, O = null, j = 0;
|
|
9399
9400
|
const me = () => {
|
|
9400
9401
|
de !== null && (clearTimeout(de), de = null);
|
|
@@ -9406,7 +9407,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
9406
9407
|
O !== null && (clearTimeout(O), O = null);
|
|
9407
9408
|
}, I = () => {
|
|
9408
9409
|
X && (clearTimeout(X), X = null);
|
|
9409
|
-
},
|
|
9410
|
+
}, v = () => {
|
|
9410
9411
|
I(), l("stop-typing");
|
|
9411
9412
|
}, f = C(() => {
|
|
9412
9413
|
if (!i.replyToMessage) return "";
|
|
@@ -9553,7 +9554,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
9553
9554
|
ft instanceof Node && z.contains(ft) || ft instanceof Node && fe instanceof Node && fe.contains(ft) || Ke();
|
|
9554
9555
|
}, wt = (_) => {
|
|
9555
9556
|
_.key === "Escape" && R.value && (_.preventDefault(), Ke());
|
|
9556
|
-
}, lt = () =>
|
|
9557
|
+
}, lt = () => p.value?.closest(".ion-page") ?? null, Ct = () => {
|
|
9557
9558
|
const _ = lt();
|
|
9558
9559
|
if (!_) {
|
|
9559
9560
|
ne.value = !0;
|
|
@@ -9564,7 +9565,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
9564
9565
|
};
|
|
9565
9566
|
let kt = null;
|
|
9566
9567
|
Yt(async () => {
|
|
9567
|
-
|
|
9568
|
+
p.value?.addEventListener("dragenter", be), p.value?.addEventListener("dragover", He), p.value?.addEventListener("dragleave", Pe), p.value?.addEventListener("drop", zt), await ct();
|
|
9568
9569
|
const _ = De();
|
|
9569
9570
|
_ && (Te = _.querySelector("textarea"), Te?.addEventListener("input", Ie), Te?.addEventListener("paste", Ee), W(Te), Te && (Te.style.caretColor = "var(--app-accent, #f59e0b)")), document.addEventListener("pointerdown", Ve, !0), document.addEventListener("mousedown", Ve, !0), document.addEventListener("touchstart", Ve, !0), document.addEventListener("click", Ve, !0), document.addEventListener("keydown", wt), Ct();
|
|
9570
9571
|
const z = lt();
|
|
@@ -9575,7 +9576,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
9575
9576
|
attributeFilter: ["class", "style", "aria-hidden", "hidden"]
|
|
9576
9577
|
}));
|
|
9577
9578
|
}), Us(() => {
|
|
9578
|
-
|
|
9579
|
+
v(), Ke(), me(), H(), ye(), p.value?.removeEventListener("dragenter", be), p.value?.removeEventListener("dragover", He), p.value?.removeEventListener("dragleave", Pe), p.value?.removeEventListener("drop", zt), nt && (nt.dismiss().catch(() => {
|
|
9579
9580
|
}), nt = null), document.removeEventListener("pointerdown", Ve, !0), document.removeEventListener("mousedown", Ve, !0), document.removeEventListener("touchstart", Ve, !0), document.removeEventListener("click", Ve, !0), document.removeEventListener("keydown", wt), Te?.removeEventListener("input", Ie), Te?.removeEventListener("paste", Ee), kt?.disconnect(), kt = null, Te = null, B.cleanup();
|
|
9580
9581
|
});
|
|
9581
9582
|
const xt = (_) => {
|
|
@@ -9599,7 +9600,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
9599
9600
|
}, jt = () => {
|
|
9600
9601
|
$.value = !0;
|
|
9601
9602
|
}, ue = () => {
|
|
9602
|
-
$.value = !1,
|
|
9603
|
+
$.value = !1, v();
|
|
9603
9604
|
}, te = () => {
|
|
9604
9605
|
const _ = Date.now();
|
|
9605
9606
|
_ - pe > Lh && (l("typing"), pe = _), I(), X = setTimeout(() => {
|
|
@@ -9611,14 +9612,14 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
9611
9612
|
})));
|
|
9612
9613
|
}, je = async () => {
|
|
9613
9614
|
if (q(), !Ce.value) return;
|
|
9614
|
-
|
|
9615
|
+
v(), me(), ce.value = !1;
|
|
9615
9616
|
const _ = M.value.trim(), z = A.value.map(($e) => $e.file), fe = A.value.map(($e) => ({ ...$e }));
|
|
9616
9617
|
if (w.value && B.animateSendRipple(w.value), Ke(), M.value = "", A.value.length > 0) {
|
|
9617
9618
|
P.value = !0;
|
|
9618
9619
|
for (const $e of A.value)
|
|
9619
9620
|
$e.uploading = !0;
|
|
9620
9621
|
}
|
|
9621
|
-
|
|
9622
|
+
y.value && B.animateComposerReset(y.value);
|
|
9622
9623
|
try {
|
|
9623
9624
|
i.onSend ? await i.onSend(_, z) : l("send", _, z), oe(), P.value = !1, A.value = [], l("attach-file", []), await Q();
|
|
9624
9625
|
} catch ($e) {
|
|
@@ -9758,14 +9759,14 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
9758
9759
|
};
|
|
9759
9760
|
return t({ focus: () => {
|
|
9760
9761
|
u.value?.$el.setFocus();
|
|
9761
|
-
} }), (_, z) => (m(),
|
|
9762
|
+
} }), (_, z) => (m(), b(ze, null, [
|
|
9762
9763
|
c("div", {
|
|
9763
9764
|
ref_key: "composerRootRef",
|
|
9764
|
-
ref:
|
|
9765
|
+
ref: p,
|
|
9765
9766
|
class: xe(["message-composer", { "message-composer--drag-active": L.value }]),
|
|
9766
9767
|
"data-testid": "message-composer"
|
|
9767
9768
|
}, [
|
|
9768
|
-
e.replyToMessage ? (m(),
|
|
9769
|
+
e.replyToMessage ? (m(), b("div", _h, [
|
|
9769
9770
|
z[1] || (z[1] = c("div", { class: "composer-reply-bar" }, null, -1)),
|
|
9770
9771
|
c("div", wh, [
|
|
9771
9772
|
c("span", Ch, J(f.value), 1),
|
|
@@ -9783,9 +9784,9 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
9783
9784
|
])) : K("", !0),
|
|
9784
9785
|
Re(Wt, { name: "attachments-slide" }, {
|
|
9785
9786
|
default: it(() => [
|
|
9786
|
-
A.value.length > 0 ? (m(),
|
|
9787
|
+
A.value.length > 0 ? (m(), b("div", Sh, [
|
|
9787
9788
|
c("div", Th, [
|
|
9788
|
-
(m(!0),
|
|
9789
|
+
(m(!0), b(ze, null, dt(A.value, (fe) => (m(), st(dh, {
|
|
9789
9790
|
key: ke(fe),
|
|
9790
9791
|
attachment: fe,
|
|
9791
9792
|
uploading: fe.uploading,
|
|
@@ -9799,7 +9800,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
9799
9800
|
}),
|
|
9800
9801
|
Re(Wt, { name: "status-fade" }, {
|
|
9801
9802
|
default: it(() => [
|
|
9802
|
-
P.value ? (m(),
|
|
9803
|
+
P.value ? (m(), b("div", Mh, [
|
|
9803
9804
|
Re(na, { class: "w-4 h-4 mr-2" }),
|
|
9804
9805
|
c("span", null, "Uploading " + J(ht.value) + " file" + J(ht.value !== 1 ? "s" : "") + "...", 1)
|
|
9805
9806
|
])) : K("", !0)
|
|
@@ -9808,7 +9809,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
9808
9809
|
}),
|
|
9809
9810
|
Re(Wt, { name: "status-fade" }, {
|
|
9810
9811
|
default: it(() => [
|
|
9811
|
-
U.value ? (m(),
|
|
9812
|
+
U.value ? (m(), b("div", xh, [
|
|
9812
9813
|
Re(We, {
|
|
9813
9814
|
name: "alertCircleOutline",
|
|
9814
9815
|
class: "send-failed-icon"
|
|
@@ -9836,7 +9837,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
9836
9837
|
}),
|
|
9837
9838
|
Re(Wt, { name: "draft-restored-fade" }, {
|
|
9838
9839
|
default: it(() => [
|
|
9839
|
-
ce.value ? (m(),
|
|
9840
|
+
ce.value ? (m(), b("div", $h, J(E.value), 1)) : K("", !0)
|
|
9840
9841
|
]),
|
|
9841
9842
|
_: 1
|
|
9842
9843
|
}),
|
|
@@ -9856,7 +9857,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
9856
9857
|
], 10, Rh),
|
|
9857
9858
|
c("div", {
|
|
9858
9859
|
ref_key: "composerInputBubbleRef",
|
|
9859
|
-
ref:
|
|
9860
|
+
ref: y,
|
|
9860
9861
|
class: xe(["composer-input-bubble", {
|
|
9861
9862
|
"composer-input-bubble--focused": $.value,
|
|
9862
9863
|
"composer-input-bubble--disabled": e.disabled,
|
|
@@ -9901,7 +9902,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
9901
9902
|
Re(We, { name: "happyOutline" })
|
|
9902
9903
|
], 8, Ph),
|
|
9903
9904
|
(m(), st(ns, { to: "body" }, [
|
|
9904
|
-
R.value ? (m(),
|
|
9905
|
+
R.value ? (m(), b("button", {
|
|
9905
9906
|
key: 0,
|
|
9906
9907
|
type: "button",
|
|
9907
9908
|
class: "composer-emoji-backdrop",
|
|
@@ -9970,7 +9971,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
9970
9971
|
testId: { default: "unread-divider" }
|
|
9971
9972
|
},
|
|
9972
9973
|
setup(e) {
|
|
9973
|
-
return (t, n) => (m(),
|
|
9974
|
+
return (t, n) => (m(), b("div", {
|
|
9974
9975
|
class: "unread-divider",
|
|
9975
9976
|
"data-testid": e.testId,
|
|
9976
9977
|
role: "separator",
|
|
@@ -10019,7 +10020,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
10019
10020
|
minimized: { type: Boolean }
|
|
10020
10021
|
},
|
|
10021
10022
|
setup(e) {
|
|
10022
|
-
const t = e, n = Gt(), i = ea(), o = It()(), { subscribe: l } = ll(t.conversationId), { subscribe: u, unsubscribe:
|
|
10023
|
+
const t = e, n = Gt(), i = ea(), o = It()(), { subscribe: l } = ll(t.conversationId), { subscribe: u, unsubscribe: p } = Yl(t.conversationId), h = N(null), w = N(null), y = N(null), k = N(null), x = N(null), M = N(""), A = N(null), P = N(!1), $ = N(!1), R = N(/* @__PURE__ */ new Set()), U = N([]), ae = N([]), ce = N(!1), E = N(!0), L = N(!1), ee = N(0), ne = N(null);
|
|
10023
10024
|
let B = null, X = !1, pe = 0;
|
|
10024
10025
|
const de = C(() => `widget:${t.conversationId}`), O = ri(), j = C(() => n.getConversationById(t.conversationId)), me = C(() => {
|
|
10025
10026
|
const D = j.value?.participants;
|
|
@@ -10045,7 +10046,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
10045
10046
|
return;
|
|
10046
10047
|
const le = V(o.currentUser?.id);
|
|
10047
10048
|
return D.participants.find((_e) => V(_e.user_id) !== le);
|
|
10048
|
-
}),
|
|
10049
|
+
}), v = C(() => {
|
|
10049
10050
|
const D = j.value;
|
|
10050
10051
|
return D ? D.type === "group" && D.title ? D.title : I.value?.user?.name ?? "Unknown" : "Chat";
|
|
10051
10052
|
}), f = C(() => {
|
|
@@ -10060,7 +10061,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
10060
10061
|
for (let z = 0; z < _e.length; z++)
|
|
10061
10062
|
_ = _e.charCodeAt(z) + ((_ << 5) - _);
|
|
10062
10063
|
return D[Math.abs(_) % D.length] ?? "#3a3a3c";
|
|
10063
|
-
}), ie = C(() => Ve(
|
|
10064
|
+
}), ie = C(() => Ve(v.value)), Ce = C(() => {
|
|
10064
10065
|
const D = j.value;
|
|
10065
10066
|
if (!D || D.type !== "dm") return !1;
|
|
10066
10067
|
const le = Jn(
|
|
@@ -10340,7 +10341,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
10340
10341
|
function Rt(D) {
|
|
10341
10342
|
const le = we.value.find((_e) => _e.id === D);
|
|
10342
10343
|
!le || le.is_deleted || (A.value = le, ct(() => {
|
|
10343
|
-
|
|
10344
|
+
y.value?.focus?.();
|
|
10344
10345
|
}));
|
|
10345
10346
|
}
|
|
10346
10347
|
function Pt() {
|
|
@@ -10425,48 +10426,48 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
10425
10426
|
() => t.minimized,
|
|
10426
10427
|
(D) => {
|
|
10427
10428
|
D || (qe(), ct(() => {
|
|
10428
|
-
xt(),
|
|
10429
|
+
xt(), y.value?.focus?.();
|
|
10429
10430
|
}), lt());
|
|
10430
10431
|
}
|
|
10431
10432
|
), Yt(() => {
|
|
10432
10433
|
Array.isArray(n.messages[t.conversationId]) && Q(), l(), u(), qe(), be.setupInfiniteObserver(), t.minimized || lt();
|
|
10433
10434
|
}), Nt(() => {
|
|
10434
|
-
ye(), ae.value = [], Z(),
|
|
10435
|
-
}), (D, le) => (m(),
|
|
10435
|
+
ye(), ae.value = [], Z(), p(), be.destroyInfiniteObserver(), O.cleanup();
|
|
10436
|
+
}), (D, le) => (m(), b("div", {
|
|
10436
10437
|
class: xe(["chat-window", {
|
|
10437
10438
|
"chat-window--minimized": e.minimized
|
|
10438
10439
|
}]),
|
|
10439
10440
|
"data-testid": `chat-window-${e.conversationId}`,
|
|
10440
|
-
"aria-label": `Chat with ${
|
|
10441
|
+
"aria-label": `Chat with ${v.value}`,
|
|
10441
10442
|
role: "dialog"
|
|
10442
10443
|
}, [
|
|
10443
|
-
e.minimized ? (m(),
|
|
10444
|
+
e.minimized ? (m(), b("button", {
|
|
10444
10445
|
key: 0,
|
|
10445
10446
|
class: "chat-window__minimized-btn",
|
|
10446
10447
|
"data-testid": `chat-window-min-btn-${e.conversationId}`,
|
|
10447
|
-
"aria-label": `Open chat with ${
|
|
10448
|
+
"aria-label": `Open chat with ${v.value}`,
|
|
10448
10449
|
onClick: At
|
|
10449
10450
|
}, [
|
|
10450
10451
|
c("div", Hh, [
|
|
10451
|
-
f.value ? (m(),
|
|
10452
|
+
f.value ? (m(), b("img", {
|
|
10452
10453
|
key: 0,
|
|
10453
10454
|
src: f.value,
|
|
10454
|
-
alt:
|
|
10455
|
+
alt: v.value,
|
|
10455
10456
|
class: "chat-window__minimized-avatar-img"
|
|
10456
|
-
}, null, 8, Vh)) : (m(),
|
|
10457
|
+
}, null, 8, Vh)) : (m(), b("div", {
|
|
10457
10458
|
key: 1,
|
|
10458
10459
|
class: "chat-window__minimized-avatar-initials",
|
|
10459
10460
|
style: rt({ backgroundColor: T.value })
|
|
10460
10461
|
}, J(ie.value), 5)),
|
|
10461
|
-
Ce.value ? (m(),
|
|
10462
|
-
Se.value > 0 ? (m(),
|
|
10462
|
+
Ce.value ? (m(), b("span", Wh)) : K("", !0),
|
|
10463
|
+
Se.value > 0 ? (m(), b("span", Gh, J(Se.value > 9 ? "9+" : Se.value), 1)) : K("", !0)
|
|
10463
10464
|
]),
|
|
10464
10465
|
c("div", {
|
|
10465
10466
|
role: "button",
|
|
10466
10467
|
tabindex: "0",
|
|
10467
10468
|
class: "chat-window__minimized-close",
|
|
10468
10469
|
"data-testid": `chat-window-min-close-${e.conversationId}`,
|
|
10469
|
-
"aria-label": `Close chat with ${
|
|
10470
|
+
"aria-label": `Close chat with ${v.value}`,
|
|
10470
10471
|
onClick: Ge(nt, ["stop"]),
|
|
10471
10472
|
onKeydown: [
|
|
10472
10473
|
Dt(Ge(nt, ["stop"]), ["enter"]),
|
|
@@ -10499,7 +10500,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
10499
10500
|
})
|
|
10500
10501
|
], -1)
|
|
10501
10502
|
])], 40, Xh)
|
|
10502
|
-
], 8, qh)) : (m(),
|
|
10503
|
+
], 8, qh)) : (m(), b(ze, { key: 1 }, [
|
|
10503
10504
|
c("div", {
|
|
10504
10505
|
class: "chat-window__header",
|
|
10505
10506
|
"data-testid": `chat-window-header-${e.conversationId}`
|
|
@@ -10507,25 +10508,25 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
10507
10508
|
c("button", {
|
|
10508
10509
|
class: "chat-window__header-user",
|
|
10509
10510
|
"data-testid": `chat-window-toggle-user-${e.conversationId}`,
|
|
10510
|
-
"aria-label": `Minimize chat with ${
|
|
10511
|
+
"aria-label": `Minimize chat with ${v.value}`,
|
|
10511
10512
|
onClick: At
|
|
10512
10513
|
}, [
|
|
10513
10514
|
c("div", Jh, [
|
|
10514
|
-
f.value ? (m(),
|
|
10515
|
+
f.value ? (m(), b("img", {
|
|
10515
10516
|
key: 0,
|
|
10516
10517
|
src: f.value,
|
|
10517
|
-
alt:
|
|
10518
|
+
alt: v.value,
|
|
10518
10519
|
class: "chat-window__header-avatar-img"
|
|
10519
|
-
}, null, 8, Zh)) : (m(),
|
|
10520
|
+
}, null, 8, Zh)) : (m(), b("div", {
|
|
10520
10521
|
key: 1,
|
|
10521
10522
|
class: "chat-window__header-avatar-initials",
|
|
10522
10523
|
style: rt({ backgroundColor: T.value })
|
|
10523
10524
|
}, J(ie.value), 5)),
|
|
10524
|
-
Ce.value ? (m(),
|
|
10525
|
+
Ce.value ? (m(), b("span", Qh)) : K("", !0)
|
|
10525
10526
|
]),
|
|
10526
10527
|
c("div", ef, [
|
|
10527
|
-
c("span", tf, J(
|
|
10528
|
-
Ce.value ? (m(),
|
|
10528
|
+
c("span", tf, J(v.value), 1),
|
|
10529
|
+
Ce.value ? (m(), b("span", nf, "Active now")) : K("", !0)
|
|
10529
10530
|
])
|
|
10530
10531
|
], 8, Yh),
|
|
10531
10532
|
c("div", sf, [
|
|
@@ -10603,8 +10604,8 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
10603
10604
|
"data-testid": "chat-window-top-sentinel",
|
|
10604
10605
|
"aria-hidden": "true"
|
|
10605
10606
|
}, null, 512),
|
|
10606
|
-
P.value ? (m(),
|
|
10607
|
-
(m(!0),
|
|
10607
|
+
P.value ? (m(), b("div", lf, " Loading earlier messages... ")) : K("", !0),
|
|
10608
|
+
(m(!0), b(ze, null, dt(we.value, (_e, _) => (m(), b(ze, {
|
|
10608
10609
|
key: _e.id
|
|
10609
10610
|
}, [
|
|
10610
10611
|
Mt(_) ? (m(), st(gu, {
|
|
@@ -10641,13 +10642,13 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
10641
10642
|
}, null, 8, ["message", "conversation-type", "is-own-message", "is-read-by-other", "show-avatar", "show-timestamp", "is-first-in-group", "is-last-in-group", "participant-names", "participant-avatars"])
|
|
10642
10643
|
], 8, cf)
|
|
10643
10644
|
], 64))), 128)),
|
|
10644
|
-
we.value.length === 0 && !$.value ? (m(),
|
|
10645
|
+
we.value.length === 0 && !$.value ? (m(), b("div", uf, [...le[4] || (le[4] = [
|
|
10645
10646
|
c("p", null, "Say hello!", -1)
|
|
10646
10647
|
])])) : K("", !0)
|
|
10647
10648
|
], 40, of),
|
|
10648
10649
|
Re(Wt, { name: "chat-window-jump" }, {
|
|
10649
10650
|
default: it(() => [
|
|
10650
|
-
L.value ? (m(),
|
|
10651
|
+
L.value ? (m(), b("button", {
|
|
10651
10652
|
key: 0,
|
|
10652
10653
|
class: "chat-window__jump-latest",
|
|
10653
10654
|
"data-testid": "btn-chat-window-jump-latest",
|
|
@@ -10655,12 +10656,12 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
10655
10656
|
onClick: St
|
|
10656
10657
|
}, [
|
|
10657
10658
|
le[5] || (le[5] = c("span", null, "Jump to latest", -1)),
|
|
10658
|
-
ee.value > 0 ? (m(),
|
|
10659
|
+
ee.value > 0 ? (m(), b("span", df, J(ee.value > 99 ? "99+" : ee.value), 1)) : K("", !0)
|
|
10659
10660
|
])) : K("", !0)
|
|
10660
10661
|
]),
|
|
10661
10662
|
_: 1
|
|
10662
10663
|
}),
|
|
10663
|
-
ce.value ? (m(),
|
|
10664
|
+
ce.value ? (m(), b("div", {
|
|
10664
10665
|
key: 0,
|
|
10665
10666
|
ref_key: "typingIndicatorRef",
|
|
10666
10667
|
ref: x,
|
|
@@ -10682,7 +10683,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
10682
10683
|
}, [
|
|
10683
10684
|
Re(Uh, {
|
|
10684
10685
|
ref_key: "composerRef",
|
|
10685
|
-
ref:
|
|
10686
|
+
ref: y,
|
|
10686
10687
|
message: M.value,
|
|
10687
10688
|
"onUpdate:message": le[0] || (le[0] = (_e) => M.value = _e),
|
|
10688
10689
|
"conversation-id": e.conversationId,
|
|
@@ -10739,51 +10740,51 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
10739
10740
|
return "";
|
|
10740
10741
|
}
|
|
10741
10742
|
}
|
|
10742
|
-
const o = Gt(), l = ea(), u = It()(), { isMobile:
|
|
10743
|
-
function w(
|
|
10744
|
-
if (
|
|
10743
|
+
const o = Gt(), l = ea(), u = It()(), { isMobile: p, windowWidth: h } = Jl();
|
|
10744
|
+
function w(v) {
|
|
10745
|
+
if (v.type !== "dm" || v.is_request !== !0)
|
|
10745
10746
|
return !1;
|
|
10746
|
-
const f = u.currentUser?.id ?? u.user?.id, T =
|
|
10747
|
+
const f = u.currentUser?.id ?? u.user?.id, T = v.created_by;
|
|
10747
10748
|
if (typeof T == "string" && T.length > 0)
|
|
10748
10749
|
return T !== f;
|
|
10749
|
-
const ie = f ?? null, Ce =
|
|
10750
|
-
return
|
|
10751
|
-
}
|
|
10752
|
-
const
|
|
10753
|
-
const
|
|
10754
|
-
return
|
|
10755
|
-
}), k = C(() => o.requestConversations.filter((
|
|
10756
|
-
const
|
|
10757
|
-
if (x.value <= 0 &&
|
|
10750
|
+
const ie = f ?? null, Ce = v.participants.find((we) => we.user_id !== ie);
|
|
10751
|
+
return v.last_message?.author_id === Ce?.user_id;
|
|
10752
|
+
}
|
|
10753
|
+
const y = C(() => {
|
|
10754
|
+
const v = i(), f = Tn().messagesRoute;
|
|
10755
|
+
return v === f || v.startsWith(f + "/");
|
|
10756
|
+
}), k = C(() => o.requestConversations.filter((v) => w(v)).length), x = C(() => o.unreadCount + k.value), M = C(() => {
|
|
10757
|
+
const v = k.value;
|
|
10758
|
+
if (x.value <= 0 && v <= 0)
|
|
10758
10759
|
return "Open messages";
|
|
10759
10760
|
const f = [];
|
|
10760
|
-
return o.unreadCount > 0 && f.push(`${o.unreadCount} unread`),
|
|
10761
|
-
}), A = C(() =>
|
|
10761
|
+
return o.unreadCount > 0 && f.push(`${o.unreadCount} unread`), v > 0 && f.push(`${v} message request${v === 1 ? "" : "s"}`), `Open messages, ${f.join(", ")}`;
|
|
10762
|
+
}), A = C(() => p.value ? !1 : !y.value && !l.panelOpen), P = C(() => p.value ? 0 : h.value < 1240 ? 1 : h.value < 1640 ? 2 : 3), $ = C(() => [...o.conversations].filter((f) => !f.is_archived).sort((f, T) => {
|
|
10762
10763
|
if (f.is_pinned && !T.is_pinned) return -1;
|
|
10763
10764
|
if (!f.is_pinned && T.is_pinned) return 1;
|
|
10764
10765
|
const ie = f.last_message_at ?? f.created_at, Ce = T.last_message_at ?? T.created_at;
|
|
10765
10766
|
return new Date(Ce).getTime() - new Date(ie).getTime();
|
|
10766
10767
|
})), R = C(() => {
|
|
10767
|
-
const
|
|
10768
|
-
return new Map(
|
|
10768
|
+
const v = o.sortedFolders.map((f) => [f.id, f]);
|
|
10769
|
+
return new Map(v);
|
|
10769
10770
|
});
|
|
10770
|
-
function U(
|
|
10771
|
-
const f =
|
|
10771
|
+
function U(v) {
|
|
10772
|
+
const f = v?.avatar ?? v?.avatar_url;
|
|
10772
10773
|
if (!(typeof f != "string" || f.trim().length === 0))
|
|
10773
10774
|
return f;
|
|
10774
10775
|
}
|
|
10775
|
-
function ae(
|
|
10776
|
-
if (typeof
|
|
10776
|
+
function ae(v) {
|
|
10777
|
+
if (typeof v != "string")
|
|
10777
10778
|
return;
|
|
10778
|
-
const f =
|
|
10779
|
+
const f = v.trim().toLowerCase();
|
|
10779
10780
|
return f.length > 0 ? f : void 0;
|
|
10780
10781
|
}
|
|
10781
|
-
function ce(
|
|
10782
|
+
function ce(v) {
|
|
10782
10783
|
const f = ae(u.currentUser?.id);
|
|
10783
|
-
return
|
|
10784
|
+
return v.participants.find((T) => ae(T.user_id) !== f);
|
|
10784
10785
|
}
|
|
10785
10786
|
function E() {
|
|
10786
|
-
if (
|
|
10787
|
+
if (p.value) {
|
|
10787
10788
|
n?.push(Tn().messagesRoute);
|
|
10788
10789
|
return;
|
|
10789
10790
|
}
|
|
@@ -10793,64 +10794,64 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
10793
10794
|
function L() {
|
|
10794
10795
|
l.closePanel(), n?.push(Tn().messagesRoute);
|
|
10795
10796
|
}
|
|
10796
|
-
function ee(
|
|
10797
|
-
if (
|
|
10798
|
-
l.closePanel(), l.closeAllWindows(), n?.push(`${Tn().messagesRoute}/${
|
|
10797
|
+
function ee(v) {
|
|
10798
|
+
if (p.value) {
|
|
10799
|
+
l.closePanel(), l.closeAllWindows(), n?.push(`${Tn().messagesRoute}/${v.id}`);
|
|
10799
10800
|
return;
|
|
10800
10801
|
}
|
|
10801
|
-
l.openWindow(
|
|
10802
|
+
l.openWindow(v.id);
|
|
10802
10803
|
}
|
|
10803
10804
|
function ne() {
|
|
10804
10805
|
l.closePanel(), n?.push(`${Tn().messagesRoute}?new=true`);
|
|
10805
10806
|
}
|
|
10806
|
-
function B(
|
|
10807
|
-
return
|
|
10807
|
+
function B(v) {
|
|
10808
|
+
return v.type === "group" && v.title ? v.title : ce(v)?.user?.name ?? "Unknown";
|
|
10808
10809
|
}
|
|
10809
|
-
function X(
|
|
10810
|
-
if (
|
|
10811
|
-
const f = ce(
|
|
10810
|
+
function X(v) {
|
|
10811
|
+
if (v.type === "group") return;
|
|
10812
|
+
const f = ce(v);
|
|
10812
10813
|
return U(f?.user);
|
|
10813
10814
|
}
|
|
10814
|
-
function pe(
|
|
10815
|
-
const f = ["#3a3a3c", "#2a2a2c", "#f093fb", "#f5576c", "#4facfe", "#00f2fe", "#43e97b", "#fa709a"], ie = ce(
|
|
10815
|
+
function pe(v) {
|
|
10816
|
+
const f = ["#3a3a3c", "#2a2a2c", "#f093fb", "#f5576c", "#4facfe", "#00f2fe", "#43e97b", "#fa709a"], ie = ce(v)?.user_id ?? v.id;
|
|
10816
10817
|
let Ce = 0;
|
|
10817
10818
|
for (let Se = 0; Se < ie.length; Se++)
|
|
10818
10819
|
Ce = ie.charCodeAt(Se) + ((Ce << 5) - Ce);
|
|
10819
10820
|
return f[Math.abs(Ce) % f.length] ?? "#3a3a3c";
|
|
10820
10821
|
}
|
|
10821
|
-
function de(
|
|
10822
|
-
if (typeof
|
|
10823
|
-
const f =
|
|
10822
|
+
function de(v) {
|
|
10823
|
+
if (typeof v != "string") return "?";
|
|
10824
|
+
const f = v.trim();
|
|
10824
10825
|
if (f.length === 0) return "?";
|
|
10825
10826
|
const T = f.split(/\s+/).map((ie) => ie[0]).filter(Boolean).slice(0, 2).join("").toUpperCase();
|
|
10826
10827
|
return T.length > 0 ? T : "?";
|
|
10827
10828
|
}
|
|
10828
|
-
function O(
|
|
10829
|
-
return
|
|
10829
|
+
function O(v) {
|
|
10830
|
+
return v.last_message ? v.last_message.is_deleted ? "Message deleted" : v.last_message.attachments?.length > 0 ? "Sent an attachment" : H(v.last_message.body ?? "", 40) : "No messages yet";
|
|
10830
10831
|
}
|
|
10831
|
-
function j(
|
|
10832
|
-
const f =
|
|
10832
|
+
function j(v) {
|
|
10833
|
+
const f = v.folder_id;
|
|
10833
10834
|
return typeof f != "string" || f.length === 0 ? null : R.value.get(f) ?? null;
|
|
10834
10835
|
}
|
|
10835
|
-
function me(
|
|
10836
|
-
const f =
|
|
10836
|
+
function me(v) {
|
|
10837
|
+
const f = v.folder_id;
|
|
10837
10838
|
return typeof f == "string" && f.length > 0;
|
|
10838
10839
|
}
|
|
10839
|
-
function ge(
|
|
10840
|
-
return j(
|
|
10840
|
+
function ge(v) {
|
|
10841
|
+
return j(v)?.name ?? "Folder";
|
|
10841
10842
|
}
|
|
10842
|
-
function V(
|
|
10843
|
-
const T = j(
|
|
10843
|
+
function V(v) {
|
|
10844
|
+
const T = j(v)?.color;
|
|
10844
10845
|
return {
|
|
10845
10846
|
backgroundColor: typeof T == "string" && T.length > 0 ? T : "var(--app-primary)"
|
|
10846
10847
|
};
|
|
10847
10848
|
}
|
|
10848
|
-
function H(
|
|
10849
|
-
return
|
|
10849
|
+
function H(v, f) {
|
|
10850
|
+
return v.length <= f ? v : v.slice(0, f) + "...";
|
|
10850
10851
|
}
|
|
10851
|
-
function I(
|
|
10852
|
-
if (!
|
|
10853
|
-
const f = new Date(
|
|
10852
|
+
function I(v) {
|
|
10853
|
+
if (!v) return "";
|
|
10854
|
+
const f = new Date(v), ie = (/* @__PURE__ */ new Date()).getTime() - f.getTime(), Ce = Math.floor(ie / 6e4);
|
|
10854
10855
|
if (Ce < 1) return "now";
|
|
10855
10856
|
if (Ce < 60) return `${Ce}m`;
|
|
10856
10857
|
const Se = Math.floor(Ce / 60);
|
|
@@ -10858,14 +10859,14 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
10858
10859
|
const we = Math.floor(Se / 24);
|
|
10859
10860
|
return we < 7 ? `${we}d` : `${Math.floor(we / 7)}w`;
|
|
10860
10861
|
}
|
|
10861
|
-
return Xe(
|
|
10862
|
-
|
|
10863
|
-
}), Xe(
|
|
10864
|
-
|
|
10865
|
-
}, { immediate: !0 }), Xe(P, (
|
|
10866
|
-
|
|
10867
|
-
}, { immediate: !0 }), (
|
|
10868
|
-
A.value ? (m(),
|
|
10862
|
+
return Xe(y, (v) => {
|
|
10863
|
+
v && (l.closePanel(), l.closeAllWindows());
|
|
10864
|
+
}), Xe(p, (v) => {
|
|
10865
|
+
v && l.closeAllWindows();
|
|
10866
|
+
}, { immediate: !0 }), Xe(P, (v) => {
|
|
10867
|
+
v <= 0 || l.setMaxWindows(v);
|
|
10868
|
+
}, { immediate: !0 }), (v, f) => (m(), st(ns, { to: "body" }, [
|
|
10869
|
+
A.value ? (m(), b("button", {
|
|
10869
10870
|
key: 0,
|
|
10870
10871
|
"data-testid": "chat-widget-button",
|
|
10871
10872
|
class: xe(["chat-widget-fab", { "chat-widget-fab--has-unread": x.value > 0 }]),
|
|
@@ -10886,17 +10887,17 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
10886
10887
|
}, [
|
|
10887
10888
|
c("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" })
|
|
10888
10889
|
], -1)),
|
|
10889
|
-
x.value > 0 ? (m(),
|
|
10890
|
+
x.value > 0 ? (m(), b("span", {
|
|
10890
10891
|
key: 0,
|
|
10891
10892
|
class: "chat-widget-fab__badge",
|
|
10892
10893
|
"data-testid": "chat-widget-badge",
|
|
10893
10894
|
"aria-label": `${x.value} unread messages`
|
|
10894
10895
|
}, J(x.value > 99 ? "99+" : x.value), 9, bf)) : K("", !0)
|
|
10895
10896
|
], 10, gf)) : K("", !0),
|
|
10896
|
-
Lt(l).panelOpen && !
|
|
10897
|
+
Lt(l).panelOpen && !y.value ? (m(), b("div", {
|
|
10897
10898
|
key: 1,
|
|
10898
10899
|
"data-testid": "chat-widget-panel",
|
|
10899
|
-
class: xe(["chat-widget-panel", { "chat-widget-panel--mobile": Lt(
|
|
10900
|
+
class: xe(["chat-widget-panel", { "chat-widget-panel--mobile": Lt(p) }]),
|
|
10900
10901
|
role: "dialog",
|
|
10901
10902
|
"aria-label": "Messages"
|
|
10902
10903
|
}, [
|
|
@@ -10980,8 +10981,8 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
10980
10981
|
], -1)
|
|
10981
10982
|
])]),
|
|
10982
10983
|
c("div", _f, [
|
|
10983
|
-
Lt(o).loading && $.value.length === 0 ? (m(),
|
|
10984
|
-
(m(),
|
|
10984
|
+
Lt(o).loading && $.value.length === 0 ? (m(), b("div", wf, [
|
|
10985
|
+
(m(), b(ze, null, dt(5, (T) => c("div", {
|
|
10985
10986
|
key: T,
|
|
10986
10987
|
class: "chat-widget-panel__skeleton"
|
|
10987
10988
|
}, [...f[7] || (f[7] = [
|
|
@@ -10991,8 +10992,8 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
10991
10992
|
c("div", { class: "chat-widget-panel__skeleton-line chat-widget-panel__skeleton-line--msg" })
|
|
10992
10993
|
], -1)
|
|
10993
10994
|
])])), 64))
|
|
10994
|
-
])) : $.value.length > 0 ? (m(),
|
|
10995
|
-
(m(!0),
|
|
10995
|
+
])) : $.value.length > 0 ? (m(), b("div", Cf, [
|
|
10996
|
+
(m(!0), b(ze, null, dt($.value, (T) => (m(), b("div", {
|
|
10996
10997
|
key: T.id,
|
|
10997
10998
|
class: xe(["chat-widget-panel__item", { "chat-widget-panel__item--unread": T.unread_count > 0 }]),
|
|
10998
10999
|
"data-testid": `chat-widget-conv-${T.id}`,
|
|
@@ -11006,24 +11007,24 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
11006
11007
|
]
|
|
11007
11008
|
}, [
|
|
11008
11009
|
c("div", Sf, [
|
|
11009
|
-
X(T) ? (m(),
|
|
11010
|
+
X(T) ? (m(), b("img", {
|
|
11010
11011
|
key: 0,
|
|
11011
11012
|
src: X(T),
|
|
11012
11013
|
alt: B(T),
|
|
11013
11014
|
class: "chat-widget-panel__item-avatar-img"
|
|
11014
|
-
}, null, 8, Tf)) : (m(),
|
|
11015
|
+
}, null, 8, Tf)) : (m(), b("div", {
|
|
11015
11016
|
key: 1,
|
|
11016
11017
|
class: "chat-widget-panel__item-avatar-initials",
|
|
11017
11018
|
style: rt({ backgroundColor: pe(T) })
|
|
11018
11019
|
}, J(de(B(T))), 5)),
|
|
11019
|
-
T.type === "dm" && T.other_presence_status && T.other_presence_status !== "offline" ? (m(),
|
|
11020
|
-
T.unread_count > 0 ? (m(),
|
|
11020
|
+
T.type === "dm" && T.other_presence_status && T.other_presence_status !== "offline" ? (m(), b("span", Mf)) : K("", !0),
|
|
11021
|
+
T.unread_count > 0 ? (m(), b("span", xf)) : K("", !0)
|
|
11021
11022
|
]),
|
|
11022
11023
|
c("div", Ef, [
|
|
11023
11024
|
c("div", $f, [
|
|
11024
11025
|
c("div", Af, [
|
|
11025
11026
|
c("span", Rf, J(B(T)), 1),
|
|
11026
|
-
me(T) ? (m(),
|
|
11027
|
+
me(T) ? (m(), b("span", {
|
|
11027
11028
|
key: 0,
|
|
11028
11029
|
"data-testid": `chat-widget-folder-indicator-${T.id}`,
|
|
11029
11030
|
class: "chat-widget-panel__item-folder-indicator",
|
|
@@ -11041,7 +11042,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
11041
11042
|
c("div", Lf, J(O(T)), 1)
|
|
11042
11043
|
])
|
|
11043
11044
|
], 42, kf))), 128))
|
|
11044
|
-
])) : (m(),
|
|
11045
|
+
])) : (m(), b("div", Of, [
|
|
11045
11046
|
f[8] || (f[8] = c("svg", {
|
|
11046
11047
|
xmlns: "http://www.w3.org/2000/svg",
|
|
11047
11048
|
width: "40",
|
|
@@ -11066,14 +11067,14 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
11066
11067
|
]))
|
|
11067
11068
|
])
|
|
11068
11069
|
], 2)) : K("", !0),
|
|
11069
|
-
Lt(l).panelOpen && Lt(
|
|
11070
|
+
Lt(l).panelOpen && Lt(p) && !y.value ? (m(), b("div", {
|
|
11070
11071
|
key: 2,
|
|
11071
11072
|
class: "chat-widget-backdrop",
|
|
11072
11073
|
"data-testid": "chat-widget-backdrop",
|
|
11073
11074
|
onClick: f[1] || (f[1] = (T) => Lt(l).closePanel())
|
|
11074
11075
|
})) : K("", !0),
|
|
11075
|
-
!
|
|
11076
|
-
(m(!0),
|
|
11076
|
+
!y.value && !Lt(p) && Lt(l).openWindows.length > 0 ? (m(), b("div", Df, [
|
|
11077
|
+
(m(!0), b(ze, null, dt(Lt(l).openWindows, (T) => (m(), st(vf, {
|
|
11077
11078
|
key: T.conversationId,
|
|
11078
11079
|
"conversation-id": T.conversationId,
|
|
11079
11080
|
minimized: T.minimized
|
|
@@ -11106,19 +11107,19 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
11106
11107
|
function u() {
|
|
11107
11108
|
l();
|
|
11108
11109
|
}
|
|
11109
|
-
function
|
|
11110
|
+
function p(h) {
|
|
11110
11111
|
h.key === "Escape" && o.value && l();
|
|
11111
11112
|
}
|
|
11112
11113
|
return Xe(o, (h) => {
|
|
11113
11114
|
h ? document.body.style.overflow = "hidden" : document.body.style.overflow = "";
|
|
11114
11115
|
}), Yt(() => {
|
|
11115
|
-
document.addEventListener("keydown",
|
|
11116
|
+
document.addEventListener("keydown", p);
|
|
11116
11117
|
}), Nt(() => {
|
|
11117
|
-
document.removeEventListener("keydown",
|
|
11118
|
+
document.removeEventListener("keydown", p), document.body.style.overflow = "";
|
|
11118
11119
|
}), (h, w) => (m(), st(ns, { to: "body" }, [
|
|
11119
11120
|
Re(Wt, { name: "messenger-modal" }, {
|
|
11120
11121
|
default: it(() => [
|
|
11121
|
-
o.value ? (m(),
|
|
11122
|
+
o.value ? (m(), b("div", {
|
|
11122
11123
|
key: 0,
|
|
11123
11124
|
class: "messenger-modal-overlay",
|
|
11124
11125
|
"data-test-id": h.$attrs["data-test-id"],
|
|
@@ -11134,7 +11135,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
11134
11135
|
"aria-modal": "true",
|
|
11135
11136
|
"aria-label": e.title
|
|
11136
11137
|
}, [
|
|
11137
|
-
h.$slots.header || e.title ? (m(),
|
|
11138
|
+
h.$slots.header || e.title ? (m(), b("div", zf, [
|
|
11138
11139
|
Vn(h.$slots, "header", {}, () => [
|
|
11139
11140
|
c("h2", jf, J(e.title), 1),
|
|
11140
11141
|
c("button", {
|
|
@@ -11173,19 +11174,19 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
11173
11174
|
Vn(h.$slots, "default")
|
|
11174
11175
|
])
|
|
11175
11176
|
]),
|
|
11176
|
-
h.$slots.footer || e.showConfirm || e.showCancel ? (m(),
|
|
11177
|
+
h.$slots.footer || e.showConfirm || e.showCancel ? (m(), b("div", qf, [
|
|
11177
11178
|
Vn(h.$slots, "footer", {}, () => [
|
|
11178
|
-
e.showCancel ? (m(),
|
|
11179
|
+
e.showCancel ? (m(), b("button", {
|
|
11179
11180
|
key: 0,
|
|
11180
11181
|
class: "messenger-modal-btn messenger-modal-btn--cancel",
|
|
11181
11182
|
type: "button",
|
|
11182
11183
|
onClick: l
|
|
11183
11184
|
}, " Cancel ")) : K("", !0),
|
|
11184
|
-
e.showConfirm ? (m(),
|
|
11185
|
+
e.showConfirm ? (m(), b("button", {
|
|
11185
11186
|
key: 1,
|
|
11186
11187
|
class: "messenger-modal-btn messenger-modal-btn--confirm",
|
|
11187
11188
|
type: "button",
|
|
11188
|
-
onClick: w[0] || (w[0] = (
|
|
11189
|
+
onClick: w[0] || (w[0] = (y) => h.$emit("confirm"))
|
|
11189
11190
|
}, " Confirm ")) : K("", !0)
|
|
11190
11191
|
])
|
|
11191
11192
|
])) : K("", !0)
|
|
@@ -11255,7 +11256,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
11255
11256
|
},
|
|
11256
11257
|
emits: ["click", "folder-assigned", "request-create-folder", "archive-toggled"],
|
|
11257
11258
|
setup(e, { emit: t }) {
|
|
11258
|
-
const n = e, i = t, o = Gt(), l = It()(), u = C(() => l.user),
|
|
11259
|
+
const n = e, i = t, o = Gt(), l = It()(), u = C(() => l.user), p = N(!1), h = N(!1), w = N(!1), y = N(!1), k = N(!1), x = N(!1), M = C(() => n.conversation.is_request === !0), A = C(() => {
|
|
11259
11260
|
if (!M.value || n.conversation.type !== "dm") return !1;
|
|
11260
11261
|
const F = n.conversation.created_by;
|
|
11261
11262
|
if (typeof F == "string" && F.length > 0)
|
|
@@ -11274,8 +11275,8 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
11274
11275
|
".msg-action-sheet-overlay.conversation-folder-sheet",
|
|
11275
11276
|
".msg-action-sheet-overlay.conversation-folder-create-sheet"
|
|
11276
11277
|
].join(", "), X = () => {
|
|
11277
|
-
|
|
11278
|
-
|
|
11278
|
+
y.value || (y.value = !0), E !== null && clearTimeout(E), E = setTimeout(() => {
|
|
11279
|
+
y.value = !1, E = null;
|
|
11279
11280
|
}, fm);
|
|
11280
11281
|
}, pe = () => {
|
|
11281
11282
|
k.value || (k.value = !0), L !== null && clearTimeout(L), L = setTimeout(() => {
|
|
@@ -11312,7 +11313,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
11312
11313
|
]);
|
|
11313
11314
|
} catch {
|
|
11314
11315
|
}
|
|
11315
|
-
},
|
|
11316
|
+
}, v = async (F) => {
|
|
11316
11317
|
if (F !== null) {
|
|
11317
11318
|
try {
|
|
11318
11319
|
await F.dismiss();
|
|
@@ -11325,7 +11326,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
11325
11326
|
typeof F.remove == "function" && F.remove();
|
|
11326
11327
|
}
|
|
11327
11328
|
}, f = async (F) => {
|
|
11328
|
-
await
|
|
11329
|
+
await v(F);
|
|
11329
11330
|
}, T = () => {
|
|
11330
11331
|
ne !== null && (clearTimeout(ne), ne = null);
|
|
11331
11332
|
}, ie = (F) => {
|
|
@@ -11574,7 +11575,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
11574
11575
|
document.querySelectorAll(".msg-alert-overlay.conversation-delete-alert")
|
|
11575
11576
|
);
|
|
11576
11577
|
for (const re of F)
|
|
11577
|
-
await
|
|
11578
|
+
await v(re);
|
|
11578
11579
|
w.value = !0;
|
|
11579
11580
|
}, Be = async () => {
|
|
11580
11581
|
try {
|
|
@@ -11584,13 +11585,13 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
11584
11585
|
}, Q = async () => {
|
|
11585
11586
|
await Be();
|
|
11586
11587
|
}, W = async () => {
|
|
11587
|
-
|
|
11588
|
+
p.value = !0;
|
|
11588
11589
|
try {
|
|
11589
11590
|
await o.acceptRequest(n.conversation.id), tt("Message request accepted", "success");
|
|
11590
11591
|
} catch {
|
|
11591
11592
|
tt("Failed to accept request", "error");
|
|
11592
11593
|
} finally {
|
|
11593
|
-
|
|
11594
|
+
p.value = !1;
|
|
11594
11595
|
}
|
|
11595
11596
|
}, q = async () => {
|
|
11596
11597
|
const F = await ku.create({
|
|
@@ -11787,7 +11788,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
11787
11788
|
}
|
|
11788
11789
|
), Us(() => {
|
|
11789
11790
|
R !== null && (clearTimeout(R), R = null), E !== null && (clearTimeout(E), E = null), L !== null && (clearTimeout(L), L = null), ee !== null && (clearTimeout(ee), ee = null), T();
|
|
11790
|
-
}), (F, re) => (m(),
|
|
11791
|
+
}), (F, re) => (m(), b("button", {
|
|
11791
11792
|
type: "button",
|
|
11792
11793
|
"data-testid": `conversation-${e.conversation.id}`,
|
|
11793
11794
|
class: xe(["conversation-row", {
|
|
@@ -11795,7 +11796,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
11795
11796
|
"conversation-row--pinned": e.conversation.is_pinned,
|
|
11796
11797
|
"conversation-row--selected": e.isSelected,
|
|
11797
11798
|
"conversation-row--request": M.value,
|
|
11798
|
-
"conversation-row--activity-pulse":
|
|
11799
|
+
"conversation-row--activity-pulse": y.value
|
|
11799
11800
|
}]),
|
|
11800
11801
|
"aria-label": $.value,
|
|
11801
11802
|
role: "listitem",
|
|
@@ -11807,40 +11808,40 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
11807
11808
|
onTouchcancel: me
|
|
11808
11809
|
}, [
|
|
11809
11810
|
c("div", Xf, [
|
|
11810
|
-
e.conversation.type === "dm" ? (m(),
|
|
11811
|
-
Pe.value?.avatar ? (m(),
|
|
11811
|
+
e.conversation.type === "dm" ? (m(), b(ze, { key: 0 }, [
|
|
11812
|
+
Pe.value?.avatar ? (m(), b("img", {
|
|
11812
11813
|
key: 0,
|
|
11813
11814
|
src: Pe.value.avatar,
|
|
11814
11815
|
alt: Pe.value.name || "User",
|
|
11815
11816
|
class: "conversation-avatar__img"
|
|
11816
|
-
}, null, 8, Kf)) : (m(),
|
|
11817
|
+
}, null, 8, Kf)) : (m(), b("div", {
|
|
11817
11818
|
key: 1,
|
|
11818
11819
|
class: "conversation-avatar__initials",
|
|
11819
11820
|
style: rt({ backgroundColor: ue.value })
|
|
11820
11821
|
}, J(xt.value), 5))
|
|
11821
|
-
], 64)) : (m(),
|
|
11822
|
-
(m(!0),
|
|
11822
|
+
], 64)) : (m(), b("div", Yf, [
|
|
11823
|
+
(m(!0), b(ze, null, dt(Z.value, (ke, Le) => (m(), b(ze, {
|
|
11823
11824
|
key: ke.user_id
|
|
11824
11825
|
}, [
|
|
11825
|
-
ke.user?.avatar ? (m(),
|
|
11826
|
+
ke.user?.avatar ? (m(), b("img", {
|
|
11826
11827
|
key: 0,
|
|
11827
11828
|
src: ke.user.avatar,
|
|
11828
11829
|
alt: ke.user.name || "User",
|
|
11829
11830
|
class: xe(["conversation-avatar__group-img", Le === 0 ? "conversation-avatar__group-img--first" : "conversation-avatar__group-img--second"])
|
|
11830
|
-
}, null, 10, Jf)) : (m(),
|
|
11831
|
+
}, null, 10, Jf)) : (m(), b("div", {
|
|
11831
11832
|
key: 1,
|
|
11832
11833
|
class: xe(["conversation-avatar__group-initials", Le === 0 ? "conversation-avatar__group-img--first" : "conversation-avatar__group-img--second"]),
|
|
11833
11834
|
style: rt({ backgroundColor: te(ke.user_id) })
|
|
11834
11835
|
}, J(kt(ke.user?.name)), 7))
|
|
11835
11836
|
], 64))), 128))
|
|
11836
11837
|
])),
|
|
11837
|
-
wt.value ? (m(),
|
|
11838
|
+
wt.value ? (m(), b("span", {
|
|
11838
11839
|
key: 2,
|
|
11839
11840
|
class: xe(["conversation-avatar__badge", { "conversation-avatar__badge--pulse": k.value }]),
|
|
11840
11841
|
"data-testid": `unread-badge-${e.conversation.id}`,
|
|
11841
11842
|
"aria-label": `${e.conversation.unread_count} unread messages`
|
|
11842
11843
|
}, J(e.conversation.unread_count > 99 ? "99+" : e.conversation.unread_count), 11, Zf)) : K("", !0),
|
|
11843
|
-
e.conversation.type === "dm" && lt.value !== "offline" ? (m(),
|
|
11844
|
+
e.conversation.type === "dm" && lt.value !== "offline" ? (m(), b("span", {
|
|
11844
11845
|
key: 3,
|
|
11845
11846
|
class: xe(["conversation-avatar__presence", `conversation-avatar__presence--${lt.value}`]),
|
|
11846
11847
|
"data-testid": `presence-${e.conversation.id}`,
|
|
@@ -11859,7 +11860,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
11859
11860
|
c("span", {
|
|
11860
11861
|
class: xe(["conversation-content__name", { "font-bold": wt.value }])
|
|
11861
11862
|
}, J(Ke.value), 3),
|
|
11862
|
-
Mt.value ? (m(),
|
|
11863
|
+
Mt.value ? (m(), b("span", {
|
|
11863
11864
|
key: 1,
|
|
11864
11865
|
"data-testid": `folder-indicator-${e.conversation.id}`,
|
|
11865
11866
|
class: "conversation-content__folder-indicator",
|
|
@@ -11878,7 +11879,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
11878
11879
|
c("div", {
|
|
11879
11880
|
class: xe(["conversation-content__bottom", { "conversation-content__bottom--pulse": x.value }])
|
|
11880
11881
|
}, [
|
|
11881
|
-
P.value ? (m(),
|
|
11882
|
+
P.value ? (m(), b("span", {
|
|
11882
11883
|
key: 0,
|
|
11883
11884
|
class: "conversation-content__request-sent",
|
|
11884
11885
|
"data-testid": `request-sent-${e.conversation.id}`
|
|
@@ -11888,8 +11889,8 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
11888
11889
|
class: "conversation-content__request-sent-icon"
|
|
11889
11890
|
}),
|
|
11890
11891
|
re[1] || (re[1] = yt(" Request sent ", -1))
|
|
11891
|
-
], 8, am)) : (m(),
|
|
11892
|
-
je.value.length > 0 ? (m(),
|
|
11892
|
+
], 8, am)) : (m(), b(ze, { key: 1 }, [
|
|
11893
|
+
je.value.length > 0 ? (m(), b("span", {
|
|
11893
11894
|
key: 0,
|
|
11894
11895
|
class: xe(["conversation-content__typing", { "conversation-content__typing--pulse": x.value }]),
|
|
11895
11896
|
"data-testid": `typing-indicator-${e.conversation.id}`,
|
|
@@ -11901,7 +11902,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
11901
11902
|
c("span", { class: "typing-dot" })
|
|
11902
11903
|
], -1)),
|
|
11903
11904
|
yt(" " + J(et.value), 1)
|
|
11904
|
-
], 10, om)) : (m(),
|
|
11905
|
+
], 10, om)) : (m(), b("span", {
|
|
11905
11906
|
key: 1,
|
|
11906
11907
|
class: xe(["conversation-content__preview", {
|
|
11907
11908
|
"conversation-content__preview--unread": wt.value,
|
|
@@ -11924,7 +11925,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
11924
11925
|
})) : K("", !0)
|
|
11925
11926
|
])
|
|
11926
11927
|
], 2),
|
|
11927
|
-
A.value ? (m(),
|
|
11928
|
+
A.value ? (m(), b("div", {
|
|
11928
11929
|
key: 0,
|
|
11929
11930
|
class: "conversation-content__request-actions",
|
|
11930
11931
|
"data-testid": `request-actions-${e.conversation.id}`
|
|
@@ -11933,7 +11934,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
11933
11934
|
class: "conversation-request-btn conversation-request-btn--accept",
|
|
11934
11935
|
"data-testid": `btn-accept-request-${e.conversation.id}`,
|
|
11935
11936
|
"aria-label": "Accept message request",
|
|
11936
|
-
disabled:
|
|
11937
|
+
disabled: p.value || h.value,
|
|
11937
11938
|
onClick: Ge(W, ["stop"])
|
|
11938
11939
|
}, [
|
|
11939
11940
|
Re(We, { name: "checkmarkOutline" }),
|
|
@@ -11943,7 +11944,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
11943
11944
|
class: "conversation-request-btn conversation-request-btn--decline",
|
|
11944
11945
|
"data-testid": `btn-decline-request-${e.conversation.id}`,
|
|
11945
11946
|
"aria-label": "Decline message request",
|
|
11946
|
-
disabled:
|
|
11947
|
+
disabled: p.value || h.value,
|
|
11947
11948
|
onClick: Ge(q, ["stop"])
|
|
11948
11949
|
}, [
|
|
11949
11950
|
Re(We, { name: "closeOutline" }),
|
|
@@ -11966,7 +11967,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
11966
11967
|
}), jg = /* @__PURE__ */ _t(ym, [["__scopeId", "data-v-a3560a6c"]]), _m = { class: "flex mb-4 animate-pulse" }, wm = /* @__PURE__ */ at({
|
|
11967
11968
|
__name: "MessageSkeleton",
|
|
11968
11969
|
setup(e) {
|
|
11969
|
-
return (t, n) => (m(),
|
|
11970
|
+
return (t, n) => (m(), b("div", _m, [...n[0] || (n[0] = [
|
|
11970
11971
|
eo('<div class="w-8 h-8 mr-2 flex-shrink-0" data-v-2e6a7887><div class="skeleton-avatar w-full h-full rounded-full" data-v-2e6a7887></div></div><div class="flex-1" data-v-2e6a7887><div class="skeleton-bubble max-w-xs rounded-lg p-3" data-v-2e6a7887><div class="space-y-2" data-v-2e6a7887><div class="skeleton-line h-3 rounded w-3/4" data-v-2e6a7887></div><div class="skeleton-line h-3 rounded w-1/2" data-v-2e6a7887></div></div></div><div class="mt-1" data-v-2e6a7887><div class="skeleton-timestamp h-2 rounded w-12" data-v-2e6a7887></div></div></div>', 2)
|
|
11971
11972
|
])]));
|
|
11972
11973
|
}
|
|
@@ -11977,7 +11978,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
11977
11978
|
},
|
|
11978
11979
|
setup(e) {
|
|
11979
11980
|
const t = e, n = ["100px", "130px", "110px", "140px", "95px"], i = ["180px", "220px", "160px", "240px", "200px"], o = C(() => n[t.index % n.length] ?? "120px"), l = C(() => i[t.index % i.length] ?? "200px");
|
|
11980
|
-
return (u,
|
|
11981
|
+
return (u, p) => (m(), b("div", {
|
|
11981
11982
|
class: "skeleton-row",
|
|
11982
11983
|
style: rt({ animationDelay: `${e.index * 80}ms` }),
|
|
11983
11984
|
"data-testid": "skeleton-conversation",
|
|
@@ -12022,14 +12023,14 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
12022
12023
|
},
|
|
12023
12024
|
emits: ["update:modelValue"],
|
|
12024
12025
|
setup(e) {
|
|
12025
|
-
return (t, n) => (m(),
|
|
12026
|
+
return (t, n) => (m(), b("label", {
|
|
12026
12027
|
class: "messenger-toggle",
|
|
12027
12028
|
"data-testid": e.testId || void 0,
|
|
12028
12029
|
"aria-label": e.ariaLabel || e.label
|
|
12029
12030
|
}, [
|
|
12030
12031
|
c("div", Mm, [
|
|
12031
|
-
e.label ? (m(),
|
|
12032
|
-
e.description ? (m(),
|
|
12032
|
+
e.label ? (m(), b("span", xm, J(e.label), 1)) : K("", !0),
|
|
12033
|
+
e.description ? (m(), b("span", Em, J(e.description), 1)) : K("", !0)
|
|
12033
12034
|
]),
|
|
12034
12035
|
c("button", {
|
|
12035
12036
|
type: "button",
|
|
@@ -12136,7 +12137,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
12136
12137
|
},
|
|
12137
12138
|
emits: ["close"],
|
|
12138
12139
|
setup(e, { emit: t }) {
|
|
12139
|
-
const n = e, i = t, o = Gt(), l = It()(), u = ss(),
|
|
12140
|
+
const n = e, i = t, o = Gt(), l = It()(), u = ss(), p = C(() => l.user?.id ?? ""), h = C(() => n.conversation?.type === "group"), w = C(() => n.conversation?.participants ?? []), y = N({}), k = N(Date.now());
|
|
12140
12141
|
let x = null, M = null;
|
|
12141
12142
|
const A = () => {
|
|
12142
12143
|
M !== null && (clearInterval(M), M = null);
|
|
@@ -12147,7 +12148,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
12147
12148
|
k.value = Date.now();
|
|
12148
12149
|
}, Op);
|
|
12149
12150
|
}, R = async () => {
|
|
12150
|
-
const ue = w.value.filter((te) => te.user_id !==
|
|
12151
|
+
const ue = w.value.filter((te) => te.user_id !== p.value).map((te) => te.user_id);
|
|
12151
12152
|
if (ue.length !== 0)
|
|
12152
12153
|
try {
|
|
12153
12154
|
const te = await Ne().get("/v1/presence/users", {
|
|
@@ -12160,12 +12161,12 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
12160
12161
|
lastSeenAt: nt.lastSeenAt
|
|
12161
12162
|
};
|
|
12162
12163
|
}
|
|
12163
|
-
|
|
12164
|
+
y.value = je;
|
|
12164
12165
|
} catch {
|
|
12165
12166
|
}
|
|
12166
12167
|
}, U = (ue) => {
|
|
12167
|
-
if (ue ===
|
|
12168
|
-
const te =
|
|
12168
|
+
if (ue === p.value) return "online";
|
|
12169
|
+
const te = y.value[ue];
|
|
12169
12170
|
return te ? Jn(te.status, te.lastSeenAt, {
|
|
12170
12171
|
now: k.value
|
|
12171
12172
|
}) ?? "offline" : "offline";
|
|
@@ -12182,7 +12183,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
12182
12183
|
}
|
|
12183
12184
|
}, ce = (ue) => ae(U(ue)), E = C(() => {
|
|
12184
12185
|
const ue = pe.value?.user_id;
|
|
12185
|
-
return ue &&
|
|
12186
|
+
return ue && y.value[ue] ? U(ue) : Jn(
|
|
12186
12187
|
n.conversation?.other_presence_status ?? null,
|
|
12187
12188
|
n.conversation?.other_last_seen_at ?? null,
|
|
12188
12189
|
{
|
|
@@ -12192,8 +12193,8 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
12192
12193
|
}), L = C(() => ae(E.value)), ee = C(() => E.value === "online" ? "Active now" : L.value), ne = C(() => w.value.filter(
|
|
12193
12194
|
(ue) => U(ue.user_id) !== "offline"
|
|
12194
12195
|
).length), B = C(
|
|
12195
|
-
() => w.value.find((ue) => ue.user_id ===
|
|
12196
|
-
), X = C(() => B.value?.role === "admin"), pe = C(() => h.value ? null : w.value.find((ue) => ue.user_id !==
|
|
12196
|
+
() => w.value.find((ue) => ue.user_id === p.value)
|
|
12197
|
+
), X = C(() => B.value?.role === "admin"), pe = C(() => h.value ? null : w.value.find((ue) => ue.user_id !== p.value)), de = C(() => {
|
|
12197
12198
|
const ue = pe.value;
|
|
12198
12199
|
if (!ue)
|
|
12199
12200
|
return null;
|
|
@@ -12208,8 +12209,8 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
12208
12209
|
}, ge = async (ue) => {
|
|
12209
12210
|
const Z = ue.user?.handle?.trim() || ue.user?.id || ue.user_id;
|
|
12210
12211
|
!Z || Z.trim().length === 0 || (i("close"), await u.push(`/profile/${Z}`));
|
|
12211
|
-
}, V = C(() => [...w.value].sort((te, Z) => te.user_id ===
|
|
12212
|
-
H.value = null, I.value = null,
|
|
12212
|
+
}, V = C(() => [...w.value].sort((te, Z) => te.user_id === p.value ? -1 : Z.user_id === p.value ? 1 : te.role === "admin" && Z.role !== "admin" ? -1 : te.role !== "admin" && Z.role === "admin" ? 1 : (te.user?.name ?? "").localeCompare(Z.user?.name ?? ""))), H = N(null), I = N(null), v = N(""), f = C(() => H.value === "remove-member" ? "Remove Member" : H.value === "delete-conversation" ? "Delete Conversation" : "Leave Group"), T = C(() => H.value === "remove-member" ? `Remove ${v.value || "this member"} from the group?` : H.value === "delete-conversation" ? "Delete this conversation from your inbox? This action cannot be undone." : "Are you sure you want to leave this group? You won't be able to see its messages anymore."), ie = C(() => H.value === "remove-member" ? "Remove" : H.value === "delete-conversation" ? "Delete" : "Leave"), Ce = C(() => H.value === "remove-member" ? `Confirm removal of ${v.value || "member"}` : H.value === "delete-conversation" ? "Confirm deleting conversation" : "Confirm leaving group"), Se = () => {
|
|
12213
|
+
H.value = null, I.value = null, v.value = "";
|
|
12213
12214
|
}, we = () => {
|
|
12214
12215
|
if (H.value === "remove-member" && I.value) {
|
|
12215
12216
|
const ue = I.value;
|
|
@@ -12254,7 +12255,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
12254
12255
|
const te = ue.trim().split(/\s+/);
|
|
12255
12256
|
return te.length >= 2 ? ((te[0]?.[0] ?? "") + (te[te.length - 1]?.[0] ?? "")).toUpperCase() : ue.substring(0, 2).toUpperCase();
|
|
12256
12257
|
}, oe = C(
|
|
12257
|
-
() => w.value.filter((ue) => ue.user_id !==
|
|
12258
|
+
() => w.value.filter((ue) => ue.user_id !== p.value).slice(0, 3)
|
|
12258
12259
|
), se = (ue) => ["cim-avatar--first", "cim-avatar--second", "cim-avatar--third"][ue] ?? "", ye = N(!1), ve = N(""), Te = N(null), De = () => {
|
|
12259
12260
|
ve.value = n.conversation?.title ?? "", ye.value = !0, ct(() => {
|
|
12260
12261
|
Te.value?.focus(), Te.value?.select();
|
|
@@ -12272,7 +12273,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
12272
12273
|
tt("Failed to update group name", "error");
|
|
12273
12274
|
}
|
|
12274
12275
|
}, W = (ue) => {
|
|
12275
|
-
I.value = ue.user_id,
|
|
12276
|
+
I.value = ue.user_id, v.value = ue.user?.name || "this member", H.value = "remove-member";
|
|
12276
12277
|
}, q = async (ue) => {
|
|
12277
12278
|
if (n.conversation)
|
|
12278
12279
|
try {
|
|
@@ -12287,7 +12288,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
12287
12288
|
}, be = async () => {
|
|
12288
12289
|
if (n.conversation)
|
|
12289
12290
|
try {
|
|
12290
|
-
await o.removeParticipant(n.conversation.id,
|
|
12291
|
+
await o.removeParticipant(n.conversation.id, p.value), tt("You left the group", "success"), window.location.href = "/messages";
|
|
12291
12292
|
} catch {
|
|
12292
12293
|
tt("Failed to leave group", "error");
|
|
12293
12294
|
}
|
|
@@ -12328,7 +12329,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
12328
12329
|
Mt.value = Z.map((et) => {
|
|
12329
12330
|
const nt = et.id || "", At = et.doc && !Array.isArray(et.doc) ? et.doc : null, Rt = et.author_name || At?.name || "Unknown", Pt = et.author_handle || At?.handle, qt = et.author_avatar || At?.avatar, F = { id: nt, name: Rt };
|
|
12330
12331
|
return Pt && (F.handle = Pt), qt && (F.avatar = qt), F;
|
|
12331
|
-
}).filter((et) => !je.has(et.id) && et.id !==
|
|
12332
|
+
}).filter((et) => !je.has(et.id) && et.id !== p.value);
|
|
12332
12333
|
} catch {
|
|
12333
12334
|
Mt.value = [];
|
|
12334
12335
|
} finally {
|
|
@@ -12359,8 +12360,8 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
12359
12360
|
}), Xe(() => n.isOpen, (ue) => {
|
|
12360
12361
|
ue ? ($(), R(), A(), M = setInterval(() => {
|
|
12361
12362
|
R();
|
|
12362
|
-
}, Dp)) : (P(), A(), ye.value = !1, Ke.value = !1, Se(), pt.value = "", Mt.value = [], Ve.value = [],
|
|
12363
|
-
}, { immediate: !0 }), (ue, te) => (m(),
|
|
12363
|
+
}, Dp)) : (P(), A(), ye.value = !1, Ke.value = !1, Se(), pt.value = "", Mt.value = [], Ve.value = [], y.value = {});
|
|
12364
|
+
}, { immediate: !0 }), (ue, te) => (m(), b(ze, null, [
|
|
12364
12365
|
Re(hn, {
|
|
12365
12366
|
"model-value": e.isOpen,
|
|
12366
12367
|
title: h.value ? "Group Info" : "Conversation Info",
|
|
@@ -12376,35 +12377,35 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
12376
12377
|
}, {
|
|
12377
12378
|
body: it(() => [
|
|
12378
12379
|
c("div", Pm, [
|
|
12379
|
-
h.value ? (m(),
|
|
12380
|
-
(m(!0),
|
|
12380
|
+
h.value ? (m(), b("div", Im, [
|
|
12381
|
+
(m(!0), b(ze, null, dt(oe.value, (Z, je) => (m(), b(ze, {
|
|
12381
12382
|
key: Z.user_id
|
|
12382
12383
|
}, [
|
|
12383
|
-
Z.user?.avatar ? (m(),
|
|
12384
|
+
Z.user?.avatar ? (m(), b("img", {
|
|
12384
12385
|
key: 0,
|
|
12385
12386
|
src: Z.user.avatar,
|
|
12386
12387
|
alt: Z.user.name || "User",
|
|
12387
12388
|
class: xe(["cim-profile__avatar-img", se(je)])
|
|
12388
|
-
}, null, 10, Lm)) : (m(),
|
|
12389
|
+
}, null, 10, Lm)) : (m(), b("div", {
|
|
12389
12390
|
key: 1,
|
|
12390
12391
|
class: xe(["cim-profile__avatar-initials", se(je)]),
|
|
12391
12392
|
style: rt({ backgroundColor: Ze(Z.user_id) })
|
|
12392
12393
|
}, J(ht(Z.user?.name)), 7))
|
|
12393
12394
|
], 64))), 128))
|
|
12394
|
-
])) : (m(),
|
|
12395
|
-
pe.value?.user?.avatar ? (m(),
|
|
12395
|
+
])) : (m(), b("div", Om, [
|
|
12396
|
+
pe.value?.user?.avatar ? (m(), b("img", {
|
|
12396
12397
|
key: 0,
|
|
12397
12398
|
src: pe.value.user.avatar,
|
|
12398
12399
|
alt: pe.value.user.name || "User",
|
|
12399
12400
|
class: "cim-profile__avatar-single-img"
|
|
12400
|
-
}, null, 8, Dm)) : (m(),
|
|
12401
|
+
}, null, 8, Dm)) : (m(), b("div", {
|
|
12401
12402
|
key: 1,
|
|
12402
12403
|
class: "cim-profile__avatar-single-initials",
|
|
12403
12404
|
style: rt({ backgroundColor: Ze(pe.value?.user_id ?? "") })
|
|
12404
12405
|
}, J(ht(pe.value?.user?.name)), 5))
|
|
12405
12406
|
])),
|
|
12406
12407
|
c("div", Um, [
|
|
12407
|
-
h.value && ye.value ? (m(),
|
|
12408
|
+
h.value && ye.value ? (m(), b(ze, { key: 0 }, [
|
|
12408
12409
|
un(c("input", {
|
|
12409
12410
|
ref_key: "titleInput",
|
|
12410
12411
|
ref: Te,
|
|
@@ -12434,9 +12435,9 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
12434
12435
|
onClick: Be
|
|
12435
12436
|
}, " Cancel ")
|
|
12436
12437
|
])
|
|
12437
|
-
], 64)) : (m(),
|
|
12438
|
+
], 64)) : (m(), b(ze, { key: 1 }, [
|
|
12438
12439
|
c("h3", Fm, J(j.value), 1),
|
|
12439
|
-
h.value && X.value ? (m(),
|
|
12440
|
+
h.value && X.value ? (m(), b("button", {
|
|
12440
12441
|
key: 0,
|
|
12441
12442
|
class: "cim-edit-btn",
|
|
12442
12443
|
"data-testid": "btn-edit-group-title",
|
|
@@ -12459,12 +12460,12 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
12459
12460
|
])])) : K("", !0)
|
|
12460
12461
|
], 64))
|
|
12461
12462
|
]),
|
|
12462
|
-
h.value ? (m(),
|
|
12463
|
+
h.value ? (m(), b("p", Nm, [
|
|
12463
12464
|
yt(J(w.value.length) + " member" + J(w.value.length !== 1 ? "s" : "") + " ", 1),
|
|
12464
|
-
ne.value > 0 ? (m(),
|
|
12465
|
-
])) : pe.value?.user?.handle ? (m(),
|
|
12466
|
-
!h.value && pe.value ? (m(),
|
|
12467
|
-
E.value !== "offline" ? (m(),
|
|
12465
|
+
ne.value > 0 ? (m(), b("span", zm, " · " + J(ne.value) + " online ", 1)) : K("", !0)
|
|
12466
|
+
])) : pe.value?.user?.handle ? (m(), b("p", jm, " @" + J(pe.value.user.handle), 1)) : K("", !0),
|
|
12467
|
+
!h.value && pe.value ? (m(), b("div", Bm, [
|
|
12468
|
+
E.value !== "offline" ? (m(), b("span", {
|
|
12468
12469
|
key: 0,
|
|
12469
12470
|
class: xe(["cim-profile__presence", `cim-profile__presence--${E.value}`]),
|
|
12470
12471
|
"data-testid": "conversation-info-presence",
|
|
@@ -12473,10 +12474,10 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
12473
12474
|
c("span", Hm, J(ee.value), 1)
|
|
12474
12475
|
])) : K("", !0)
|
|
12475
12476
|
]),
|
|
12476
|
-
h.value ? (m(),
|
|
12477
|
+
h.value ? (m(), b("div", Vm, [
|
|
12477
12478
|
c("div", Wm, [
|
|
12478
12479
|
te[10] || (te[10] = c("h4", { class: "cim-section__title" }, " Members ", -1)),
|
|
12479
|
-
X.value ? (m(),
|
|
12480
|
+
X.value ? (m(), b("button", {
|
|
12480
12481
|
key: 0,
|
|
12481
12482
|
class: "cim-add-btn",
|
|
12482
12483
|
"data-testid": "btn-add-members",
|
|
@@ -12515,31 +12516,31 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
12515
12516
|
])])) : K("", !0)
|
|
12516
12517
|
]),
|
|
12517
12518
|
c("div", Gm, [
|
|
12518
|
-
(m(!0),
|
|
12519
|
+
(m(!0), b(ze, null, dt(V.value, (Z) => (m(), b("div", {
|
|
12519
12520
|
key: Z.user_id,
|
|
12520
|
-
class: xe(["cim-member", { "cim-member--clickable": Z.user_id !==
|
|
12521
|
+
class: xe(["cim-member", { "cim-member--clickable": Z.user_id !== p.value }]),
|
|
12521
12522
|
"data-testid": `member-${Z.user_id}`,
|
|
12522
|
-
role: Z.user_id !==
|
|
12523
|
-
tabindex: Z.user_id !==
|
|
12524
|
-
"aria-label": Z.user_id !==
|
|
12525
|
-
onClick: (je) => Z.user_id !==
|
|
12523
|
+
role: Z.user_id !== p.value ? "button" : void 0,
|
|
12524
|
+
tabindex: Z.user_id !== p.value ? 0 : void 0,
|
|
12525
|
+
"aria-label": Z.user_id !== p.value ? `View ${Z.user?.name || "member"}'s profile` : void 0,
|
|
12526
|
+
onClick: (je) => Z.user_id !== p.value ? ge(Z) : void 0,
|
|
12526
12527
|
onKeydown: [
|
|
12527
|
-
Dt((je) => Z.user_id !==
|
|
12528
|
-
Dt(Ge((je) => Z.user_id !==
|
|
12528
|
+
Dt((je) => Z.user_id !== p.value ? ge(Z) : void 0, ["enter"]),
|
|
12529
|
+
Dt(Ge((je) => Z.user_id !== p.value ? ge(Z) : void 0, ["prevent"]), ["space"])
|
|
12529
12530
|
]
|
|
12530
12531
|
}, [
|
|
12531
12532
|
c("div", Km, [
|
|
12532
|
-
Z.user?.avatar ? (m(),
|
|
12533
|
+
Z.user?.avatar ? (m(), b("img", {
|
|
12533
12534
|
key: 0,
|
|
12534
12535
|
src: Z.user.avatar,
|
|
12535
12536
|
alt: Z.user.name || "User",
|
|
12536
12537
|
class: "cim-member__avatar-img"
|
|
12537
|
-
}, null, 8, Ym)) : (m(),
|
|
12538
|
+
}, null, 8, Ym)) : (m(), b("div", {
|
|
12538
12539
|
key: 1,
|
|
12539
12540
|
class: "cim-member__avatar-initials",
|
|
12540
12541
|
style: rt({ backgroundColor: Ze(Z.user_id) })
|
|
12541
12542
|
}, J(ht(Z.user?.name)), 5)),
|
|
12542
|
-
U(Z.user_id) !== "offline" ? (m(),
|
|
12543
|
+
U(Z.user_id) !== "offline" ? (m(), b("span", {
|
|
12543
12544
|
key: 2,
|
|
12544
12545
|
class: xe(["cim-member__presence", `cim-member__presence--${U(Z.user_id)}`]),
|
|
12545
12546
|
"data-testid": `presence-${Z.user_id}`,
|
|
@@ -12549,12 +12550,12 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
12549
12550
|
c("div", Zm, [
|
|
12550
12551
|
c("div", Qm, [
|
|
12551
12552
|
c("span", ep, J(Z.user?.name || "Unknown User"), 1),
|
|
12552
|
-
Z.user_id ===
|
|
12553
|
-
Z.role === "admin" ? (m(),
|
|
12553
|
+
Z.user_id === p.value ? (m(), b("span", tp, " You ")) : K("", !0),
|
|
12554
|
+
Z.role === "admin" ? (m(), b("span", np, " Admin ")) : K("", !0)
|
|
12554
12555
|
]),
|
|
12555
|
-
Z.user?.handle ? (m(),
|
|
12556
|
+
Z.user?.handle ? (m(), b("span", sp, " @" + J(Z.user.handle), 1)) : K("", !0)
|
|
12556
12557
|
]),
|
|
12557
|
-
X.value && Z.user_id !==
|
|
12558
|
+
X.value && Z.user_id !== p.value ? (m(), b("button", {
|
|
12558
12559
|
key: 0,
|
|
12559
12560
|
class: "cim-remove-btn",
|
|
12560
12561
|
"data-testid": n.isOpen ? `btn-remove-member-${Z.user_id}` : void 0,
|
|
@@ -12576,12 +12577,12 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
12576
12577
|
], 42, Xm))), 128))
|
|
12577
12578
|
])
|
|
12578
12579
|
])) : K("", !0),
|
|
12579
|
-
!h.value && pe.value ? (m(),
|
|
12580
|
+
!h.value && pe.value ? (m(), b("div", rp, [
|
|
12580
12581
|
te[12] || (te[12] = c("h4", { class: "cim-section__title" }, " About ", -1)),
|
|
12581
12582
|
c("div", ap, [
|
|
12582
12583
|
c("div", op, [
|
|
12583
12584
|
c("span", lp, J(pe.value.user?.name || "Unknown User"), 1),
|
|
12584
|
-
pe.value.user?.handle ? (m(),
|
|
12585
|
+
pe.value.user?.handle ? (m(), b("span", cp, " @" + J(pe.value.user.handle), 1)) : K("", !0)
|
|
12585
12586
|
]),
|
|
12586
12587
|
c("button", {
|
|
12587
12588
|
class: "cim-action-btn cim-action-btn--primary",
|
|
@@ -12602,7 +12603,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
12602
12603
|
"onUpdate:modelValue": zt
|
|
12603
12604
|
}, null, 8, ["model-value", "test-id"])
|
|
12604
12605
|
]),
|
|
12605
|
-
h.value ? (m(),
|
|
12606
|
+
h.value ? (m(), b("div", hp, [
|
|
12606
12607
|
c("button", {
|
|
12607
12608
|
class: "cim-leave-btn",
|
|
12608
12609
|
"data-testid": "btn-leave-group",
|
|
@@ -12630,7 +12631,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
12630
12631
|
], -1),
|
|
12631
12632
|
yt(" Leave Group ", -1)
|
|
12632
12633
|
])])
|
|
12633
|
-
])) : (m(),
|
|
12634
|
+
])) : (m(), b("div", fp, [
|
|
12634
12635
|
c("button", {
|
|
12635
12636
|
class: "cim-delete-btn",
|
|
12636
12637
|
"data-testid": "btn-delete-conversation",
|
|
@@ -12655,7 +12656,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
12655
12656
|
yt(" Delete Conversation ", -1)
|
|
12656
12657
|
])])
|
|
12657
12658
|
])),
|
|
12658
|
-
H.value ? (m(),
|
|
12659
|
+
H.value ? (m(), b("div", mp, [
|
|
12659
12660
|
c("div", pp, [
|
|
12660
12661
|
c("h4", vp, J(f.value), 1),
|
|
12661
12662
|
c("p", gp, J(T.value), 1),
|
|
@@ -12731,8 +12732,8 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
12731
12732
|
[dn, pt.value]
|
|
12732
12733
|
])
|
|
12733
12734
|
]),
|
|
12734
|
-
Ve.value.length > 0 ? (m(),
|
|
12735
|
-
(m(!0),
|
|
12735
|
+
Ve.value.length > 0 ? (m(), b("div", kp, [
|
|
12736
|
+
(m(!0), b(ze, null, dt(Ve.value, (Z) => (m(), b("button", {
|
|
12736
12737
|
key: Z.id,
|
|
12737
12738
|
class: "cim-chip",
|
|
12738
12739
|
"data-testid": `chip-new-member-${Z.id}`,
|
|
@@ -12753,8 +12754,8 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
12753
12754
|
], -1))
|
|
12754
12755
|
], 8, Sp))), 128))
|
|
12755
12756
|
])) : K("", !0),
|
|
12756
|
-
Ut.value ? (m(),
|
|
12757
|
-
(m(!0),
|
|
12757
|
+
Ut.value ? (m(), b("div", Tp, " Searching... ")) : Mt.value.length > 0 ? (m(), b("div", Mp, [
|
|
12758
|
+
(m(!0), b(ze, null, dt(Mt.value, (Z) => (m(), b("button", {
|
|
12758
12759
|
key: Z.id,
|
|
12759
12760
|
class: "cim-result",
|
|
12760
12761
|
"data-testid": `item-add-member-${Z.id}`,
|
|
@@ -12762,12 +12763,12 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
12762
12763
|
onClick: (je) => kt(Z)
|
|
12763
12764
|
}, [
|
|
12764
12765
|
c("div", Ep, [
|
|
12765
|
-
Z.avatar ? (m(),
|
|
12766
|
+
Z.avatar ? (m(), b("img", {
|
|
12766
12767
|
key: 0,
|
|
12767
12768
|
src: Z.avatar,
|
|
12768
12769
|
alt: Z.name,
|
|
12769
12770
|
class: "cim-result__avatar-img"
|
|
12770
|
-
}, null, 8, $p)) : (m(),
|
|
12771
|
+
}, null, 8, $p)) : (m(), b("div", {
|
|
12771
12772
|
key: 1,
|
|
12772
12773
|
class: "cim-result__avatar-initials",
|
|
12773
12774
|
style: rt({ backgroundColor: Ze(Z.id) })
|
|
@@ -12775,13 +12776,13 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
12775
12776
|
]),
|
|
12776
12777
|
c("div", Ap, [
|
|
12777
12778
|
c("span", Rp, J(Z.name), 1),
|
|
12778
|
-
Z.handle ? (m(),
|
|
12779
|
+
Z.handle ? (m(), b("span", Pp, "@" + J(Z.handle), 1)) : K("", !0)
|
|
12779
12780
|
]),
|
|
12780
|
-
$t(Z.id) ? (m(),
|
|
12781
|
+
$t(Z.id) ? (m(), b("svg", Ip, [...te[19] || (te[19] = [
|
|
12781
12782
|
c("polyline", { points: "20 6 9 17 4 12" }, null, -1)
|
|
12782
12783
|
])])) : K("", !0)
|
|
12783
12784
|
], 8, xp))), 128))
|
|
12784
|
-
])) : pt.value.length >= 2 ? (m(),
|
|
12785
|
+
])) : pt.value.length >= 2 ? (m(), b("div", Lp, " No users found ")) : K("", !0)
|
|
12785
12786
|
]),
|
|
12786
12787
|
_: 1
|
|
12787
12788
|
}, 8, ["modelValue"])
|
|
@@ -12856,8 +12857,8 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
12856
12857
|
emits: ["close", "created"],
|
|
12857
12858
|
setup(e, { emit: t }) {
|
|
12858
12859
|
const n = e, i = t, o = N(null), l = N(null), u = N(n.isOpen);
|
|
12859
|
-
let
|
|
12860
|
-
const w = N("dm"),
|
|
12860
|
+
let p = !1, h = null;
|
|
12861
|
+
const w = N("dm"), y = N(""), k = N(""), x = N([]), M = N([]), A = N([]), P = N(!1), $ = N(!1), R = N(!1), U = N(""), ae = N(null), ce = N(!1), E = N(!1), L = N(/* @__PURE__ */ new Map());
|
|
12861
12862
|
let ee = null;
|
|
12862
12863
|
const ne = ss(), B = Gt(), X = It()(), pe = [
|
|
12863
12864
|
"#6366f1",
|
|
@@ -12893,7 +12894,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
12893
12894
|
const W = Q.trim().split(/\s+/);
|
|
12894
12895
|
return W.length >= 2 ? ((W[0]?.[0] ?? "") + (W[W.length - 1]?.[0] ?? "")).toUpperCase() : Q.substring(0, 2).toUpperCase();
|
|
12895
12896
|
}
|
|
12896
|
-
const me = C(() => R.value || ce.value ? !1 : w.value === "dm" ? x.value.length === 1 && ae.value === null : x.value.length >= 1 &&
|
|
12897
|
+
const me = C(() => R.value || ce.value ? !1 : w.value === "dm" ? x.value.length === 1 && ae.value === null : x.value.length >= 1 && y.value.trim().length > 0);
|
|
12897
12898
|
Xe(() => n.isOpen, (Q) => {
|
|
12898
12899
|
u.value = Q;
|
|
12899
12900
|
}, { immediate: !0 });
|
|
@@ -12901,7 +12902,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
12901
12902
|
T();
|
|
12902
12903
|
}
|
|
12903
12904
|
const V = () => {
|
|
12904
|
-
|
|
12905
|
+
p || (p = !0, i("close"), ie());
|
|
12905
12906
|
};
|
|
12906
12907
|
function H(Q) {
|
|
12907
12908
|
return Q.presented === !0 || Q.isOpen === !0 || Q.classList.contains("show-modal") ? !0 : getComputedStyle(Q).display !== "none";
|
|
@@ -12909,7 +12910,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
12909
12910
|
function I(Q) {
|
|
12910
12911
|
Q.style.display = "none", Q.classList.remove("show-modal"), Q.classList.add("overlay-hidden"), Q.setAttribute("aria-hidden", "true");
|
|
12911
12912
|
}
|
|
12912
|
-
function
|
|
12913
|
+
function v() {
|
|
12913
12914
|
const Q = [], W = /* @__PURE__ */ new Set(), q = l.value?.$el;
|
|
12914
12915
|
q instanceof HTMLElement && (W.add(q), Q.push(q));
|
|
12915
12916
|
const Ie = Array.from(document.querySelectorAll("ion-modal"));
|
|
@@ -12922,21 +12923,21 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
12922
12923
|
return Q.sort((Ee, be) => Number(H(be)) - Number(H(Ee))), Q;
|
|
12923
12924
|
}
|
|
12924
12925
|
async function f() {
|
|
12925
|
-
const Q =
|
|
12926
|
+
const Q = v().filter((W) => H(W));
|
|
12926
12927
|
Q.length !== 0 && await Promise.allSettled(Q.map(async (W) => {
|
|
12927
12928
|
typeof W.dismiss == "function" && await W.dismiss().catch(() => {
|
|
12928
12929
|
}), I(W);
|
|
12929
12930
|
}));
|
|
12930
12931
|
}
|
|
12931
12932
|
function T() {
|
|
12932
|
-
return h !== null || (
|
|
12933
|
+
return h !== null || (p = !1, u.value = !1, h = (async () => {
|
|
12933
12934
|
await f(), await ct(), V();
|
|
12934
12935
|
})().finally(() => {
|
|
12935
12936
|
h = null;
|
|
12936
12937
|
})), h;
|
|
12937
12938
|
}
|
|
12938
12939
|
function ie() {
|
|
12939
|
-
w.value = "dm",
|
|
12940
|
+
w.value = "dm", y.value = "", k.value = "", x.value = [], M.value = [], A.value = [], U.value = "", R.value = !1, ae.value = null, ce.value = !1, E.value = !1, L.value = /* @__PURE__ */ new Map();
|
|
12940
12941
|
}
|
|
12941
12942
|
function Ce(Q) {
|
|
12942
12943
|
w.value = Q, Q === "dm" && x.value.length > 1 && (x.value = x.value.slice(0, 1)), Q === "group" && (ae.value = null);
|
|
@@ -13069,7 +13070,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
13069
13070
|
} else {
|
|
13070
13071
|
const Ee = x.value.map((be) => be.id);
|
|
13071
13072
|
Q = await B.createGroupConversation(
|
|
13072
|
-
|
|
13073
|
+
y.value.trim(),
|
|
13073
13074
|
Ee
|
|
13074
13075
|
);
|
|
13075
13076
|
}
|
|
@@ -13089,7 +13090,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
13089
13090
|
}
|
|
13090
13091
|
}
|
|
13091
13092
|
return Xe(() => n.isOpen, (Q) => {
|
|
13092
|
-
Q && (
|
|
13093
|
+
Q && (p = !1, ie(), Se(), setTimeout(() => {
|
|
13093
13094
|
o.value?.focus();
|
|
13094
13095
|
}, 400));
|
|
13095
13096
|
}, { flush: "post", immediate: !0 }), (Q, W) => (m(), st(hn, {
|
|
@@ -13194,19 +13195,19 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
13194
13195
|
]),
|
|
13195
13196
|
Re(Wt, { name: "slide-fade" }, {
|
|
13196
13197
|
default: it(() => [
|
|
13197
|
-
w.value === "group" ? (m(),
|
|
13198
|
+
w.value === "group" ? (m(), b("div", jp, [
|
|
13198
13199
|
c("label", Bp, [
|
|
13199
13200
|
W[9] || (W[9] = yt(" Group Name ", -1)),
|
|
13200
13201
|
un(c("input", {
|
|
13201
13202
|
id: "input-group-title",
|
|
13202
|
-
"onUpdate:modelValue": W[2] || (W[2] = (q) =>
|
|
13203
|
+
"onUpdate:modelValue": W[2] || (W[2] = (q) => y.value = q),
|
|
13203
13204
|
type: "text",
|
|
13204
13205
|
class: "ncm-group-name__input",
|
|
13205
13206
|
placeholder: "Name your group...",
|
|
13206
13207
|
"data-testid": "input-group-title",
|
|
13207
13208
|
"aria-label": "Group name"
|
|
13208
13209
|
}, null, 512), [
|
|
13209
|
-
[dn,
|
|
13210
|
+
[dn, y.value]
|
|
13210
13211
|
])
|
|
13211
13212
|
])
|
|
13212
13213
|
])) : K("", !0)
|
|
@@ -13218,7 +13219,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
13218
13219
|
c("div", Hp, [
|
|
13219
13220
|
Re(to, { name: "chip" }, {
|
|
13220
13221
|
default: it(() => [
|
|
13221
|
-
(m(!0),
|
|
13222
|
+
(m(!0), b(ze, null, dt(x.value, (q) => (m(), b("button", {
|
|
13222
13223
|
key: q.id,
|
|
13223
13224
|
class: "ncm-chip",
|
|
13224
13225
|
"data-testid": `chip-selected-user-${q.id}`,
|
|
@@ -13229,12 +13230,12 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
13229
13230
|
class: "ncm-chip__avatar",
|
|
13230
13231
|
style: rt({ backgroundColor: O(q.id) })
|
|
13231
13232
|
}, [
|
|
13232
|
-
q.avatar ? (m(),
|
|
13233
|
+
q.avatar ? (m(), b("img", {
|
|
13233
13234
|
key: 0,
|
|
13234
13235
|
src: q.avatar,
|
|
13235
13236
|
alt: q.name,
|
|
13236
13237
|
class: "ncm-chip__avatar-img"
|
|
13237
|
-
}, null, 8, Wp)) : (m(),
|
|
13238
|
+
}, null, 8, Wp)) : (m(), b("span", Gp, J(j(q.name)), 1))
|
|
13238
13239
|
], 4),
|
|
13239
13240
|
c("span", Xp, J(q.name), 1),
|
|
13240
13241
|
W[10] || (W[10] = c("svg", {
|
|
@@ -13266,11 +13267,11 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
13266
13267
|
])
|
|
13267
13268
|
]),
|
|
13268
13269
|
c("div", Yp, [
|
|
13269
|
-
P.value ? (m(),
|
|
13270
|
+
P.value ? (m(), b("div", Jp, [...W[12] || (W[12] = [
|
|
13270
13271
|
c("div", { class: "ncm-loading__spinner" }, null, -1),
|
|
13271
13272
|
c("span", { class: "ncm-loading__text" }, "Searching...", -1)
|
|
13272
|
-
])])) : k.value.trim() && M.value.length > 0 ? (m(),
|
|
13273
|
-
(m(!0),
|
|
13273
|
+
])])) : k.value.trim() && M.value.length > 0 ? (m(), b("div", Zp, [
|
|
13274
|
+
(m(!0), b(ze, null, dt(M.value, (q) => (m(), b("button", {
|
|
13274
13275
|
key: q.id,
|
|
13275
13276
|
class: xe(["ncm-user-row", {
|
|
13276
13277
|
"ncm-user-row--selected": ve(q),
|
|
@@ -13287,21 +13288,21 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
13287
13288
|
class: "ncm-user-row__avatar",
|
|
13288
13289
|
style: rt({ backgroundColor: q.avatar ? "transparent" : O(q.id) })
|
|
13289
13290
|
}, [
|
|
13290
|
-
q.avatar ? (m(),
|
|
13291
|
+
q.avatar ? (m(), b("img", {
|
|
13291
13292
|
key: 0,
|
|
13292
13293
|
src: q.avatar,
|
|
13293
13294
|
alt: q.name,
|
|
13294
13295
|
class: "ncm-user-row__avatar-img"
|
|
13295
|
-
}, null, 8, tv)) : (m(),
|
|
13296
|
+
}, null, 8, tv)) : (m(), b("span", nv, J(j(q.name)), 1))
|
|
13296
13297
|
], 4),
|
|
13297
|
-
q.presenceStatus && q.presenceStatus !== "offline" ? (m(),
|
|
13298
|
+
q.presenceStatus && q.presenceStatus !== "offline" ? (m(), b("span", {
|
|
13298
13299
|
key: 0,
|
|
13299
13300
|
class: xe(["ncm-user-row__presence", `ncm-user-row__presence--${q.presenceStatus}`])
|
|
13300
13301
|
}, null, 2)) : K("", !0)
|
|
13301
13302
|
]),
|
|
13302
13303
|
c("div", sv, [
|
|
13303
13304
|
c("span", iv, J(q.name), 1),
|
|
13304
|
-
w.value === "dm" && Te(q) ? (m(),
|
|
13305
|
+
w.value === "dm" && Te(q) ? (m(), b("span", rv, [
|
|
13305
13306
|
W[13] || (W[13] = c("svg", {
|
|
13306
13307
|
width: "12",
|
|
13307
13308
|
height: "12",
|
|
@@ -13311,9 +13312,9 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
13311
13312
|
c("path", { d: "M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1s3.1 1.39 3.1 3.1v2z" })
|
|
13312
13313
|
], -1)),
|
|
13313
13314
|
yt(" " + J(De(q)), 1)
|
|
13314
|
-
])) : (m(),
|
|
13315
|
+
])) : (m(), b("span", av, "@" + J(q.handle), 1))
|
|
13315
13316
|
]),
|
|
13316
|
-
ve(q) ? (m(),
|
|
13317
|
+
ve(q) ? (m(), b("div", ov, [...W[14] || (W[14] = [
|
|
13317
13318
|
c("svg", {
|
|
13318
13319
|
width: "20",
|
|
13319
13320
|
height: "20",
|
|
@@ -13324,7 +13325,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
13324
13325
|
], -1)
|
|
13325
13326
|
])])) : K("", !0)
|
|
13326
13327
|
], 10, Qp))), 128))
|
|
13327
|
-
])) : k.value.trim() && !P.value && M.value.length === 0 ? (m(),
|
|
13328
|
+
])) : k.value.trim() && !P.value && M.value.length === 0 ? (m(), b("div", lv, [
|
|
13328
13329
|
W[15] || (W[15] = c("svg", {
|
|
13329
13330
|
class: "ncm-empty__icon",
|
|
13330
13331
|
width: "48",
|
|
@@ -13346,10 +13347,10 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
13346
13347
|
], -1)),
|
|
13347
13348
|
W[16] || (W[16] = c("p", { class: "ncm-empty__title" }, " No users found ", -1)),
|
|
13348
13349
|
c("p", cv, ' No results for "' + J(k.value) + '" ', 1)
|
|
13349
|
-
])) : k.value.trim() ? K("", !0) : (m(),
|
|
13350
|
-
A.value.length > 0 ? (m(),
|
|
13350
|
+
])) : k.value.trim() ? K("", !0) : (m(), b("div", uv, [
|
|
13351
|
+
A.value.length > 0 ? (m(), b(ze, { key: 0 }, [
|
|
13351
13352
|
W[19] || (W[19] = c("div", { class: "ncm-section-label" }, " Recent Contacts ", -1)),
|
|
13352
|
-
(m(!0),
|
|
13353
|
+
(m(!0), b(ze, null, dt(A.value, (q) => (m(), b("button", {
|
|
13353
13354
|
key: q.id,
|
|
13354
13355
|
class: xe(["ncm-user-row", {
|
|
13355
13356
|
"ncm-user-row--selected": ve(q),
|
|
@@ -13366,21 +13367,21 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
13366
13367
|
class: "ncm-user-row__avatar",
|
|
13367
13368
|
style: rt({ backgroundColor: q.avatar ? "transparent" : O(q.id) })
|
|
13368
13369
|
}, [
|
|
13369
|
-
q.avatar ? (m(),
|
|
13370
|
+
q.avatar ? (m(), b("img", {
|
|
13370
13371
|
key: 0,
|
|
13371
13372
|
src: q.avatar,
|
|
13372
13373
|
alt: q.name,
|
|
13373
13374
|
class: "ncm-user-row__avatar-img"
|
|
13374
|
-
}, null, 8, fv)) : (m(),
|
|
13375
|
+
}, null, 8, fv)) : (m(), b("span", mv, J(j(q.name)), 1))
|
|
13375
13376
|
], 4),
|
|
13376
|
-
q.presenceStatus && q.presenceStatus !== "offline" ? (m(),
|
|
13377
|
+
q.presenceStatus && q.presenceStatus !== "offline" ? (m(), b("span", {
|
|
13377
13378
|
key: 0,
|
|
13378
13379
|
class: xe(["ncm-user-row__presence", `ncm-user-row__presence--${q.presenceStatus}`])
|
|
13379
13380
|
}, null, 2)) : K("", !0)
|
|
13380
13381
|
]),
|
|
13381
13382
|
c("div", pv, [
|
|
13382
13383
|
c("span", vv, J(q.name), 1),
|
|
13383
|
-
w.value === "dm" && Te(q) ? (m(),
|
|
13384
|
+
w.value === "dm" && Te(q) ? (m(), b("span", gv, [
|
|
13384
13385
|
W[17] || (W[17] = c("svg", {
|
|
13385
13386
|
width: "12",
|
|
13386
13387
|
height: "12",
|
|
@@ -13390,9 +13391,9 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
13390
13391
|
c("path", { d: "M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1s3.1 1.39 3.1 3.1v2z" })
|
|
13391
13392
|
], -1)),
|
|
13392
13393
|
yt(" " + J(De(q)), 1)
|
|
13393
|
-
])) : (m(),
|
|
13394
|
+
])) : (m(), b("span", bv, "@" + J(q.handle), 1))
|
|
13394
13395
|
]),
|
|
13395
|
-
ve(q) ? (m(),
|
|
13396
|
+
ve(q) ? (m(), b("div", yv, [...W[18] || (W[18] = [
|
|
13396
13397
|
c("svg", {
|
|
13397
13398
|
width: "20",
|
|
13398
13399
|
height: "20",
|
|
@@ -13404,7 +13405,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
13404
13405
|
])])) : K("", !0)
|
|
13405
13406
|
], 10, dv))), 128))
|
|
13406
13407
|
], 64)) : K("", !0),
|
|
13407
|
-
!$.value && A.value.length === 0 ? (m(),
|
|
13408
|
+
!$.value && A.value.length === 0 ? (m(), b("div", _v, [...W[20] || (W[20] = [
|
|
13408
13409
|
c("svg", {
|
|
13409
13410
|
class: "ncm-empty__icon",
|
|
13410
13411
|
width: "48",
|
|
@@ -13426,14 +13427,14 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
13426
13427
|
c("p", { class: "ncm-empty__title" }, " Find someone to message ", -1),
|
|
13427
13428
|
c("p", { class: "ncm-empty__subtitle" }, " Search by name or handle above ", -1)
|
|
13428
13429
|
])])) : K("", !0),
|
|
13429
|
-
$.value ? (m(),
|
|
13430
|
+
$.value ? (m(), b("div", wv, [...W[21] || (W[21] = [
|
|
13430
13431
|
c("div", { class: "ncm-loading__spinner" }, null, -1)
|
|
13431
13432
|
])])) : K("", !0)
|
|
13432
13433
|
]))
|
|
13433
13434
|
]),
|
|
13434
13435
|
Re(Wt, { name: "slide-fade" }, {
|
|
13435
13436
|
default: it(() => [
|
|
13436
|
-
ae.value ? (m(),
|
|
13437
|
+
ae.value ? (m(), b("div", Cv, [
|
|
13437
13438
|
W[22] || (W[22] = c("svg", {
|
|
13438
13439
|
width: "16",
|
|
13439
13440
|
height: "16",
|
|
@@ -13449,7 +13450,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
13449
13450
|
}),
|
|
13450
13451
|
Re(Wt, { name: "slide-fade" }, {
|
|
13451
13452
|
default: it(() => [
|
|
13452
|
-
U.value ? (m(),
|
|
13453
|
+
U.value ? (m(), b("div", kv, [
|
|
13453
13454
|
W[23] || (W[23] = c("svg", {
|
|
13454
13455
|
width: "16",
|
|
13455
13456
|
height: "16",
|
|
@@ -13489,7 +13490,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
13489
13490
|
},
|
|
13490
13491
|
emits: ["close", "folder-created"],
|
|
13491
13492
|
setup(e, { emit: t }) {
|
|
13492
|
-
const n = e, i = t, o = Gt(), l = N(n.isOpen), u = N(!1),
|
|
13493
|
+
const n = e, i = t, o = Gt(), l = N(n.isOpen), u = N(!1), p = [
|
|
13493
13494
|
"#EF4444",
|
|
13494
13495
|
"#F97316",
|
|
13495
13496
|
"#EAB308",
|
|
@@ -13498,9 +13499,9 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
13498
13499
|
"#3B82F6",
|
|
13499
13500
|
"#8B5CF6",
|
|
13500
13501
|
"#EC4899"
|
|
13501
|
-
], h = N(""), w = N(null),
|
|
13502
|
+
], h = N(""), w = N(null), y = N(!1), k = N(""), x = C(() => h.value.trim()), M = C(() => new Set(
|
|
13502
13503
|
n.existingFolders.map((j) => j.name.trim().toLowerCase())
|
|
13503
|
-
)), A = C(() => x.value.length === 0), P = C(() => x.value.length > ar), $ = C(() => x.value.length === 0 ? !1 : M.value.has(x.value.toLowerCase())), R = C(() => P.value ? `Folder names can be up to ${ar} characters.` : $.value ? "A folder with this name already exists." : ""), U = C(() => k.value.length > 0 ? k.value : R.value), ae = C(() => U.value.length > 0), ce = C(() => !
|
|
13504
|
+
)), A = C(() => x.value.length === 0), P = C(() => x.value.length > ar), $ = C(() => x.value.length === 0 ? !1 : M.value.has(x.value.toLowerCase())), R = C(() => P.value ? `Folder names can be up to ${ar} characters.` : $.value ? "A folder with this name already exists." : ""), U = C(() => k.value.length > 0 ? k.value : R.value), ae = C(() => U.value.length > 0), ce = C(() => !y.value && !A.value && !ae.value);
|
|
13504
13505
|
function E(j) {
|
|
13505
13506
|
return j.replace("#", "").toUpperCase();
|
|
13506
13507
|
}
|
|
@@ -13510,7 +13511,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
13510
13511
|
};
|
|
13511
13512
|
}
|
|
13512
13513
|
function ee() {
|
|
13513
|
-
h.value = "", w.value = null, k.value = "",
|
|
13514
|
+
h.value = "", w.value = null, k.value = "", y.value = !1;
|
|
13514
13515
|
}
|
|
13515
13516
|
function ne() {
|
|
13516
13517
|
k.value.length !== 0 && (k.value = "");
|
|
@@ -13536,17 +13537,17 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
13536
13537
|
}
|
|
13537
13538
|
async function O() {
|
|
13538
13539
|
if (!ce.value) {
|
|
13539
|
-
|
|
13540
|
+
y.value = !1, A.value && (k.value = "Folder name is required."), R.value.length > 0 && (k.value = R.value);
|
|
13540
13541
|
return;
|
|
13541
13542
|
}
|
|
13542
|
-
|
|
13543
|
+
y.value = !0, k.value = "";
|
|
13543
13544
|
try {
|
|
13544
13545
|
const j = await o.createFolder(de());
|
|
13545
13546
|
i("folder-created", j), B();
|
|
13546
13547
|
} catch (j) {
|
|
13547
13548
|
k.value = pe(j);
|
|
13548
13549
|
} finally {
|
|
13549
|
-
|
|
13550
|
+
y.value = !1;
|
|
13550
13551
|
}
|
|
13551
13552
|
}
|
|
13552
13553
|
return Xe(
|
|
@@ -13599,7 +13600,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
13599
13600
|
id: "text-folder-name-help",
|
|
13600
13601
|
class: "cfm-help"
|
|
13601
13602
|
}, " Up to 60 characters. ", -1)),
|
|
13602
|
-
ae.value ? (m(),
|
|
13603
|
+
ae.value ? (m(), b("p", $v, J(U.value), 1)) : K("", !0)
|
|
13603
13604
|
]),
|
|
13604
13605
|
c("div", Av, [
|
|
13605
13606
|
me[7] || (me[7] = c("p", { class: "cfm-label" }, " Folder Color ", -1)),
|
|
@@ -13613,7 +13614,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
13613
13614
|
"aria-checked": w.value === null,
|
|
13614
13615
|
onClick: me[1] || (me[1] = (ge) => X(null))
|
|
13615
13616
|
}, " None ", 10, Pv),
|
|
13616
|
-
(m(),
|
|
13617
|
+
(m(), b(ze, null, dt(p, (ge) => c("button", {
|
|
13617
13618
|
key: ge,
|
|
13618
13619
|
type: "button",
|
|
13619
13620
|
class: xe(["cfm-color-option", { "cfm-color-option--selected": w.value === ge }]),
|
|
@@ -13642,7 +13643,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
13642
13643
|
"data-testid": "btn-submit-create-folder",
|
|
13643
13644
|
"aria-label": "Create message folder",
|
|
13644
13645
|
disabled: !ce.value
|
|
13645
|
-
}, J(
|
|
13646
|
+
}, J(y.value ? "Creating..." : "Create Folder"), 9, Ov)
|
|
13646
13647
|
])
|
|
13647
13648
|
], 32)
|
|
13648
13649
|
]),
|
|
@@ -13673,10 +13674,10 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
13673
13674
|
},
|
|
13674
13675
|
emits: ["close", "request-create-folder"],
|
|
13675
13676
|
setup(e, { emit: t }) {
|
|
13676
|
-
const n = e, i = t, o = Gt(), l = N(n.isOpen), u = N(null),
|
|
13677
|
+
const n = e, i = t, o = Gt(), l = N(n.isOpen), u = N(null), p = N(""), h = N(""), w = N(null), y = N(null), k = N(null), x = N(!1), M = C(() => [...n.folders].sort((I, v) => I.sort_order !== v.sort_order ? I.sort_order - v.sort_order : I.name.localeCompare(v.name))), A = C(() => {
|
|
13677
13678
|
const I = k.value;
|
|
13678
|
-
return I === null ? null : M.value.find((
|
|
13679
|
-
}), P = C(() =>
|
|
13679
|
+
return I === null ? null : M.value.find((v) => v.id === I) ?? null;
|
|
13680
|
+
}), P = C(() => y.value !== null);
|
|
13680
13681
|
function $(I) {
|
|
13681
13682
|
return {
|
|
13682
13683
|
"--folder-color": I ?? "var(--app-border-subtle)"
|
|
@@ -13689,44 +13690,44 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
13689
13690
|
h.value.length !== 0 && (h.value = "");
|
|
13690
13691
|
}
|
|
13691
13692
|
function ae(I) {
|
|
13692
|
-
u.value = I.id,
|
|
13693
|
+
u.value = I.id, p.value = I.name, h.value = "";
|
|
13693
13694
|
}
|
|
13694
13695
|
function ce() {
|
|
13695
|
-
u.value = null,
|
|
13696
|
+
u.value = null, p.value = "", h.value = "";
|
|
13696
13697
|
}
|
|
13697
13698
|
function E(I) {
|
|
13698
13699
|
return I.trim();
|
|
13699
13700
|
}
|
|
13700
|
-
function L(I,
|
|
13701
|
+
function L(I, v) {
|
|
13701
13702
|
if (I.length === 0)
|
|
13702
13703
|
return "Folder name is required.";
|
|
13703
13704
|
if (I.length > 60)
|
|
13704
13705
|
return "Folder names can be up to 60 characters.";
|
|
13705
13706
|
const f = I.toLowerCase();
|
|
13706
|
-
return M.value.some((ie) => ie.id ===
|
|
13707
|
+
return M.value.some((ie) => ie.id === v ? !1 : ie.name.trim().toLowerCase() === f) ? "A folder with this name already exists." : "";
|
|
13707
13708
|
}
|
|
13708
|
-
function ee(I,
|
|
13709
|
+
function ee(I, v) {
|
|
13709
13710
|
const f = I, T = f.response?.data?.errors?.name;
|
|
13710
13711
|
if (Array.isArray(T) && typeof T[0] == "string" && T[0].length > 0)
|
|
13711
13712
|
return T[0];
|
|
13712
13713
|
const ie = f.response?.data?.message;
|
|
13713
|
-
return typeof ie == "string" && ie.length > 0 ? ie : I instanceof Error && I.message.length > 0 ? I.message :
|
|
13714
|
+
return typeof ie == "string" && ie.length > 0 ? ie : I instanceof Error && I.message.length > 0 ? I.message : v;
|
|
13714
13715
|
}
|
|
13715
|
-
async function ne(I,
|
|
13716
|
-
tt(I,
|
|
13716
|
+
async function ne(I, v) {
|
|
13717
|
+
tt(I, v);
|
|
13717
13718
|
}
|
|
13718
13719
|
async function B() {
|
|
13719
13720
|
const I = u.value;
|
|
13720
13721
|
if (I === null)
|
|
13721
13722
|
return;
|
|
13722
|
-
const
|
|
13723
|
+
const v = E(p.value), f = L(v, I);
|
|
13723
13724
|
if (f.length > 0) {
|
|
13724
13725
|
h.value = f;
|
|
13725
13726
|
return;
|
|
13726
13727
|
}
|
|
13727
13728
|
w.value = I, h.value = "";
|
|
13728
13729
|
try {
|
|
13729
|
-
await o.updateFolder(I, { name:
|
|
13730
|
+
await o.updateFolder(I, { name: v }), ce(), await ne("Folder updated.", "success");
|
|
13730
13731
|
} catch (T) {
|
|
13731
13732
|
h.value = ee(T, "Unable to update folder.");
|
|
13732
13733
|
} finally {
|
|
@@ -13742,13 +13743,13 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
13742
13743
|
async function de() {
|
|
13743
13744
|
const I = A.value;
|
|
13744
13745
|
if (I) {
|
|
13745
|
-
|
|
13746
|
+
y.value = I.id;
|
|
13746
13747
|
try {
|
|
13747
13748
|
await o.deleteFolder(I.id), k.value = null, u.value === I.id && ce(), await ne("Folder deleted.", "success");
|
|
13748
|
-
} catch (
|
|
13749
|
-
await ne(ee(
|
|
13749
|
+
} catch (v) {
|
|
13750
|
+
await ne(ee(v, "Unable to delete folder."), "error");
|
|
13750
13751
|
} finally {
|
|
13751
|
-
|
|
13752
|
+
y.value = null;
|
|
13752
13753
|
}
|
|
13753
13754
|
}
|
|
13754
13755
|
}
|
|
@@ -13758,13 +13759,13 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
13758
13759
|
function j(I) {
|
|
13759
13760
|
return x.value || I >= M.value.length - 1;
|
|
13760
13761
|
}
|
|
13761
|
-
async function me(I,
|
|
13762
|
+
async function me(I, v) {
|
|
13762
13763
|
if (x.value)
|
|
13763
13764
|
return;
|
|
13764
13765
|
const f = M.value.map((we) => we.id), T = f.indexOf(I);
|
|
13765
13766
|
if (T < 0)
|
|
13766
13767
|
return;
|
|
13767
|
-
const ie =
|
|
13768
|
+
const ie = v === "up" ? T - 1 : T + 1;
|
|
13768
13769
|
if (ie < 0 || ie >= f.length)
|
|
13769
13770
|
return;
|
|
13770
13771
|
const Ce = f[T], Se = f[ie];
|
|
@@ -13783,7 +13784,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
13783
13784
|
H(), i("request-create-folder");
|
|
13784
13785
|
}
|
|
13785
13786
|
function V() {
|
|
13786
|
-
ce(), pe(), w.value = null,
|
|
13787
|
+
ce(), pe(), w.value = null, y.value = null, x.value = !1;
|
|
13787
13788
|
}
|
|
13788
13789
|
function H() {
|
|
13789
13790
|
l.value = !1, V(), i("close");
|
|
@@ -13793,7 +13794,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
13793
13794
|
(I) => {
|
|
13794
13795
|
l.value = I, I && V();
|
|
13795
13796
|
}
|
|
13796
|
-
), (I,
|
|
13797
|
+
), (I, v) => (m(), st(hn, {
|
|
13797
13798
|
"model-value": l.value,
|
|
13798
13799
|
title: "Manage Folders",
|
|
13799
13800
|
size: "lg",
|
|
@@ -13801,15 +13802,15 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
13801
13802
|
"show-cancel": !1,
|
|
13802
13803
|
"data-test-id": "modal-manage-folders",
|
|
13803
13804
|
class: "manage-folders-modal",
|
|
13804
|
-
"onUpdate:modelValue":
|
|
13805
|
+
"onUpdate:modelValue": v[1] || (v[1] = (f) => {
|
|
13805
13806
|
f || H();
|
|
13806
13807
|
}),
|
|
13807
13808
|
onClose: H
|
|
13808
13809
|
}, {
|
|
13809
13810
|
body: it(() => [
|
|
13810
13811
|
c("div", Uv, [
|
|
13811
|
-
M.value.length === 0 ? (m(),
|
|
13812
|
-
(m(!0),
|
|
13812
|
+
M.value.length === 0 ? (m(), b("div", Fv, " No folders yet. Create one to organize your conversations. ")) : K("", !0),
|
|
13813
|
+
(m(!0), b(ze, null, dt(M.value, (f, T) => (m(), b("div", {
|
|
13813
13814
|
key: f.id,
|
|
13814
13815
|
class: "mfm-row",
|
|
13815
13816
|
"data-testid": `row-folder-${f.id}`,
|
|
@@ -13823,10 +13824,10 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
13823
13824
|
"aria-hidden": "true"
|
|
13824
13825
|
}, null, 12, jv),
|
|
13825
13826
|
c("div", Bv, [
|
|
13826
|
-
u.value === f.id ? (m(),
|
|
13827
|
+
u.value === f.id ? (m(), b(ze, { key: 0 }, [
|
|
13827
13828
|
un(c("input", {
|
|
13828
13829
|
id: `input-edit-folder-name-${f.id}`,
|
|
13829
|
-
"onUpdate:modelValue":
|
|
13830
|
+
"onUpdate:modelValue": v[0] || (v[0] = (ie) => p.value = ie),
|
|
13830
13831
|
type: "text",
|
|
13831
13832
|
maxlength: "60",
|
|
13832
13833
|
autocomplete: "off",
|
|
@@ -13836,15 +13837,15 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
13836
13837
|
"aria-invalid": h.value.length > 0,
|
|
13837
13838
|
onInput: U
|
|
13838
13839
|
}, null, 40, qv), [
|
|
13839
|
-
[dn,
|
|
13840
|
+
[dn, p.value]
|
|
13840
13841
|
]),
|
|
13841
|
-
h.value.length > 0 ? (m(),
|
|
13842
|
+
h.value.length > 0 ? (m(), b("p", {
|
|
13842
13843
|
key: 0,
|
|
13843
13844
|
class: "mfm-error",
|
|
13844
13845
|
"data-testid": `text-edit-folder-error-${f.id}`,
|
|
13845
13846
|
role: "alert"
|
|
13846
13847
|
}, J(h.value), 9, Hv)) : K("", !0)
|
|
13847
|
-
], 64)) : (m(),
|
|
13848
|
+
], 64)) : (m(), b(ze, { key: 1 }, [
|
|
13848
13849
|
c("p", {
|
|
13849
13850
|
class: "mfm-row__name",
|
|
13850
13851
|
"data-testid": `text-folder-name-${f.id}`
|
|
@@ -13873,7 +13874,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
13873
13874
|
disabled: j(T),
|
|
13874
13875
|
onClick: (ie) => me(f.id, "down")
|
|
13875
13876
|
}, " ↓ ", 8, Kv),
|
|
13876
|
-
u.value === f.id ? (m(),
|
|
13877
|
+
u.value === f.id ? (m(), b(ze, { key: 0 }, [
|
|
13877
13878
|
c("button", {
|
|
13878
13879
|
type: "button",
|
|
13879
13880
|
class: "mfm-control-btn mfm-control-btn--primary",
|
|
@@ -13889,7 +13890,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
13889
13890
|
"aria-label": `Cancel editing folder ${f.name}`,
|
|
13890
13891
|
onClick: ce
|
|
13891
13892
|
}, " Cancel ", 8, Jv)
|
|
13892
|
-
], 64)) : (m(),
|
|
13893
|
+
], 64)) : (m(), b(ze, { key: 1 }, [
|
|
13893
13894
|
c("button", {
|
|
13894
13895
|
type: "button",
|
|
13895
13896
|
class: "mfm-control-btn",
|
|
@@ -13917,9 +13918,9 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
13917
13918
|
onClick: ge
|
|
13918
13919
|
}, " Create New Folder ")
|
|
13919
13920
|
]),
|
|
13920
|
-
A.value !== null ? (m(),
|
|
13921
|
+
A.value !== null ? (m(), b("div", eg, [
|
|
13921
13922
|
c("div", tg, [
|
|
13922
|
-
|
|
13923
|
+
v[2] || (v[2] = c("p", { class: "mfm-confirm-text" }, " Delete folder? Conversations will be moved back to your inbox. ", -1)),
|
|
13923
13924
|
c("div", ng, [
|
|
13924
13925
|
c("button", {
|
|
13925
13926
|
type: "button",
|
|
@@ -13959,20 +13960,20 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
13959
13960
|
},
|
|
13960
13961
|
emits: ["close", "select", "sent"],
|
|
13961
13962
|
setup(e, { emit: t }) {
|
|
13962
|
-
const n = e, i = t, o = Gt(), l = It()(), { term: u } = Vr(),
|
|
13963
|
+
const n = e, i = t, o = Gt(), l = It()(), { term: u } = Vr(), p = N(!1), h = N(!1), w = N(!1), y = N(""), k = N(""), x = N(null), M = N(!1), A = C(() => x.value === null || w.value), P = C(() => {
|
|
13963
13964
|
const V = x.value ?? "none", H = w.value ? "sending" : "idle";
|
|
13964
13965
|
return `share-send-${V}-${H}`;
|
|
13965
13966
|
}), $ = (V) => {
|
|
13966
|
-
if (
|
|
13967
|
+
if (p.value)
|
|
13967
13968
|
return V;
|
|
13968
13969
|
}, R = (V) => {
|
|
13969
|
-
if (
|
|
13970
|
+
if (p.value)
|
|
13970
13971
|
return `item-share-conversation-${V}`;
|
|
13971
13972
|
}, U = C(() => l.user?.id ?? l.currentUser?.id ?? ""), ae = C(() => {
|
|
13972
13973
|
const V = k.value.trim().toLowerCase();
|
|
13973
13974
|
return V.length === 0 ? o.conversations : o.conversations.filter((H) => {
|
|
13974
|
-
const I = E(H).toLowerCase(),
|
|
13975
|
-
return I.includes(V) ||
|
|
13975
|
+
const I = E(H).toLowerCase(), v = L(H).toLowerCase(), f = (H.title ?? "").toLowerCase(), T = (H.last_message?.body ?? "").toLowerCase();
|
|
13976
|
+
return I.includes(V) || v.includes(V) || f.includes(V) || T.includes(V);
|
|
13976
13977
|
});
|
|
13977
13978
|
}), ce = (V) => V.participants.find((H) => H.user_id !== U.value), E = (V) => {
|
|
13978
13979
|
if (V.type === "group") {
|
|
@@ -14001,18 +14002,18 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
14001
14002
|
return "C";
|
|
14002
14003
|
if (I.length === 1)
|
|
14003
14004
|
return I[0]?.slice(0, 2).toUpperCase() ?? "C";
|
|
14004
|
-
const
|
|
14005
|
-
return `${
|
|
14005
|
+
const v = I[0]?.[0] ?? "", f = I[1]?.[0] ?? "";
|
|
14006
|
+
return `${v}${f}`.toUpperCase();
|
|
14006
14007
|
}, B = () => {
|
|
14007
|
-
k.value = "", x.value = null,
|
|
14008
|
+
k.value = "", x.value = null, y.value = "", w.value = !1;
|
|
14008
14009
|
}, X = () => {
|
|
14009
|
-
|
|
14010
|
+
p.value = !1, M.value = !1, i("close");
|
|
14010
14011
|
}, pe = async () => {
|
|
14011
|
-
h.value = !0,
|
|
14012
|
+
h.value = !0, y.value = "";
|
|
14012
14013
|
try {
|
|
14013
14014
|
await o.fetchConversations();
|
|
14014
14015
|
} catch (V) {
|
|
14015
|
-
V instanceof Error && V.message.trim().length > 0 ?
|
|
14016
|
+
V instanceof Error && V.message.trim().length > 0 ? y.value = V.message : y.value = "Failed to load conversations.";
|
|
14016
14017
|
} finally {
|
|
14017
14018
|
h.value = !1;
|
|
14018
14019
|
}
|
|
@@ -14020,7 +14021,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
14020
14021
|
x.value = V, i("select", V);
|
|
14021
14022
|
}, O = async (V) => {
|
|
14022
14023
|
if (!w.value) {
|
|
14023
|
-
w.value = !0,
|
|
14024
|
+
w.value = !0, y.value = "";
|
|
14024
14025
|
try {
|
|
14025
14026
|
await o.sendMessage(
|
|
14026
14027
|
V,
|
|
@@ -14031,10 +14032,10 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
14031
14032
|
n.postId,
|
|
14032
14033
|
n.postPreview ?? void 0
|
|
14033
14034
|
);
|
|
14034
|
-
const H = o.conversations.find((
|
|
14035
|
+
const H = o.conversations.find((v) => v.id === V), I = H ? E(H) : "Conversation";
|
|
14035
14036
|
i("sent", V, I), X();
|
|
14036
14037
|
} catch (H) {
|
|
14037
|
-
H instanceof Error && H.message.trim().length > 0 ?
|
|
14038
|
+
H instanceof Error && H.message.trim().length > 0 ? y.value = H.message : y.value = "Failed to send this post in message.";
|
|
14038
14039
|
} finally {
|
|
14039
14040
|
w.value = !1;
|
|
14040
14041
|
}
|
|
@@ -14048,10 +14049,10 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
14048
14049
|
};
|
|
14049
14050
|
return Xe(() => n.isOpen, (V) => {
|
|
14050
14051
|
V ? (B(), pe(), ct(() => {
|
|
14051
|
-
|
|
14052
|
-
})) :
|
|
14052
|
+
p.value = !0;
|
|
14053
|
+
})) : p.value = !1;
|
|
14053
14054
|
}, { immediate: !0 }), (V, H) => (m(), st(hn, {
|
|
14054
|
-
"model-value":
|
|
14055
|
+
"model-value": p.value,
|
|
14055
14056
|
title: "Send in Message",
|
|
14056
14057
|
size: "md",
|
|
14057
14058
|
"show-confirm": !1,
|
|
@@ -14072,7 +14073,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
14072
14073
|
onClick: X
|
|
14073
14074
|
}, " Close ", 8, og),
|
|
14074
14075
|
H[5] || (H[5] = c("h2", { class: "share-to-message-header__title" }, " Send in Message ", -1)),
|
|
14075
|
-
(m(),
|
|
14076
|
+
(m(), b("button", {
|
|
14076
14077
|
key: P.value,
|
|
14077
14078
|
type: "button",
|
|
14078
14079
|
class: "msg-btn msg-btn--primary",
|
|
@@ -14102,23 +14103,23 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
14102
14103
|
[dn, k.value]
|
|
14103
14104
|
])
|
|
14104
14105
|
]),
|
|
14105
|
-
|
|
14106
|
+
y.value.length > 0 ? (m(), b("p", {
|
|
14106
14107
|
key: 0,
|
|
14107
14108
|
"data-testid": $("text-share-to-message-error"),
|
|
14108
14109
|
class: "share-to-message-error",
|
|
14109
14110
|
role: "alert"
|
|
14110
|
-
}, J(
|
|
14111
|
-
h.value ? (m(),
|
|
14111
|
+
}, J(y.value), 9, hg)) : K("", !0),
|
|
14112
|
+
h.value ? (m(), b("div", {
|
|
14112
14113
|
key: 1,
|
|
14113
14114
|
"data-testid": $("state-share-to-message-loading"),
|
|
14114
14115
|
class: "share-to-message-state"
|
|
14115
|
-
}, " Loading conversations... ", 8, fg)) : ae.value.length > 0 ? (m(),
|
|
14116
|
+
}, " Loading conversations... ", 8, fg)) : ae.value.length > 0 ? (m(), b("div", {
|
|
14116
14117
|
key: 2,
|
|
14117
14118
|
class: "share-to-message-list",
|
|
14118
14119
|
"data-testid": $("list-share-conversations"),
|
|
14119
14120
|
role: "list"
|
|
14120
14121
|
}, [
|
|
14121
|
-
(m(!0),
|
|
14122
|
+
(m(!0), b(ze, null, dt(ae.value, (I) => (m(), b("button", {
|
|
14122
14123
|
key: I.id,
|
|
14123
14124
|
type: "button",
|
|
14124
14125
|
class: xe([
|
|
@@ -14128,7 +14129,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
14128
14129
|
"data-testid": R(I.id),
|
|
14129
14130
|
"aria-label": `Select conversation ${E(I)}`,
|
|
14130
14131
|
role: "listitem",
|
|
14131
|
-
onClick: (
|
|
14132
|
+
onClick: (v) => de(I.id)
|
|
14132
14133
|
}, [
|
|
14133
14134
|
c("div", vg, J(ne(I)), 1),
|
|
14134
14135
|
c("div", gg, [
|
|
@@ -14136,7 +14137,7 @@ const ku = new Cu(), Su = ["data-testid"], Tu = ["data-testid"], Mu = ["data-tes
|
|
|
14136
14137
|
c("p", null, J(ee(I)), 1)
|
|
14137
14138
|
])
|
|
14138
14139
|
], 10, pg))), 128))
|
|
14139
|
-
], 8, mg)) : (m(),
|
|
14140
|
+
], 8, mg)) : (m(), b("div", {
|
|
14140
14141
|
key: 3,
|
|
14141
14142
|
class: "share-to-message-state",
|
|
14142
14143
|
"data-testid": $("state-share-to-message-empty")
|