@bcc-code/vue-bcc-chat-ui 7.1.28 → 7.1.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +5 -3
- package/dist/vue-bcc-chat-ui.js +1012 -999
- package/dist/vue-bcc-chat-ui.js.map +1 -1
- package/package.json +1 -1
package/dist/vue-bcc-chat-ui.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { Fragment as e, Teleport as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createSlots as s, createTextVNode as c, createVNode as l, defineComponent as u, guardReactiveProps as d, inject as f, isRef as p, mergeModels as m, nextTick as h, normalizeClass as g, normalizeProps as _, normalizeStyle as v, onBeforeUnmount as y, onMounted as b, onUnmounted as x, openBlock as S, provide as C, ref as w, renderList as T, renderSlot as E, resolveDynamicComponent as D, shallowRef as O, toDisplayString as k, toValue as A, unref as j, useModel as M, useTemplateRef as ee, vModelText as N, vShow as P, watch as F, withCtx as I, withDirectives as
|
|
2
|
-
import { BccAvatar as
|
|
3
|
-
import { CometChat as
|
|
4
|
-
import { AddIcon as
|
|
1
|
+
import { Fragment as e, Teleport as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createSlots as s, createTextVNode as c, createVNode as l, defineComponent as u, guardReactiveProps as d, inject as f, isRef as p, mergeModels as m, nextTick as h, normalizeClass as g, normalizeProps as _, normalizeStyle as v, onBeforeUnmount as y, onMounted as b, onUnmounted as x, openBlock as S, provide as C, ref as w, renderList as T, renderSlot as E, resolveDynamicComponent as D, shallowRef as O, toDisplayString as k, toValue as A, unref as j, useModel as M, useTemplateRef as ee, vModelText as N, vShow as P, watch as F, withCtx as I, withDirectives as te, withModifiers as L } from "vue";
|
|
2
|
+
import { BccAvatar as R, BccButton as z, BccDialog as ne, BccImage as B, BccInput as re, BccInputText as ie, BccMenu as ae, BccMessage as oe, BccProgressSpinner as V, BccTag as se } from "@bcc-code/component-library-vue";
|
|
3
|
+
import { CometChat as H } from "@cometchat/chat-sdk-javascript";
|
|
4
|
+
import { AddIcon as ce, AttachFileIcon as le, BarChartIcon as U, CalendarAddOnIcon as ue, CheckIcon as de, CloseIcon as fe, CodeBlocksIcon as pe, ContentCopyIcon as me, DeleteIcon as he, DescriptionIcon as ge, DoneAllIcon as _e, EditCalendarIcon as ve, EditIcon as ye, ErrorIcon as be, FilePresentIcon as xe, FolderZipIcon as Se, ForumIcon as Ce, ImageIcon as we, InfoIcon as Te, KeyboardArrowDownIcon as Ee, KeyboardArrowUpIcon as De, MicIcon as Oe, OpenInNewIcon as ke, PendingIcon as Ae, PictureAsPdfIcon as je, ReplyIcon as Me, ScheduleIcon as Ne, SendIcon as Pe, TableChartIcon as Fe, TextSnippetIcon as Ie, TranslateIcon as Le, VideocamIcon as Re } from "@bcc-code/icons-vue";
|
|
5
5
|
//#region \0rolldown/runtime.js
|
|
6
|
-
var
|
|
6
|
+
var W = Object.defineProperty, ze = (e, t) => {
|
|
7
7
|
let n = {};
|
|
8
|
-
for (var r in e)
|
|
8
|
+
for (var r in e) W(n, r, {
|
|
9
9
|
get: e[r],
|
|
10
10
|
enumerable: !0
|
|
11
11
|
});
|
|
12
|
-
return t ||
|
|
13
|
-
},
|
|
12
|
+
return t || W(n, Symbol.toStringTag, { value: "Module" }), n;
|
|
13
|
+
}, Be = {
|
|
14
14
|
prod: {
|
|
15
15
|
region: "eu",
|
|
16
16
|
appId: "2520339d45a9d557",
|
|
@@ -21,62 +21,62 @@ var G = Object.defineProperty, Re = (e, t) => {
|
|
|
21
21
|
appId: "24847302853e129f",
|
|
22
22
|
chatApiBaseUrl: "https://chat.api.sandbox.bcc.no"
|
|
23
23
|
}
|
|
24
|
-
},
|
|
25
|
-
function
|
|
26
|
-
|
|
24
|
+
}, Ve = null;
|
|
25
|
+
function He(e) {
|
|
26
|
+
Ve = e;
|
|
27
27
|
}
|
|
28
|
-
function
|
|
29
|
-
if (!
|
|
30
|
-
return
|
|
28
|
+
function G() {
|
|
29
|
+
if (!Ve) throw Error("Environment has not been set yet. Call setCurrentEnvironment(...) first.");
|
|
30
|
+
return Be[Ve];
|
|
31
31
|
}
|
|
32
32
|
//#endregion
|
|
33
33
|
//#region src/chat/accessToken.ts
|
|
34
|
-
var
|
|
35
|
-
function
|
|
36
|
-
return `${
|
|
34
|
+
var Ue = ":loginAccessToken", We = ":token", Ge = void 0;
|
|
35
|
+
function Ke(e) {
|
|
36
|
+
return `${G().appId}${e}`;
|
|
37
37
|
}
|
|
38
|
-
function
|
|
39
|
-
return
|
|
38
|
+
function qe() {
|
|
39
|
+
return Ge === void 0 && (Ge = localStorage.getItem(Ke(Ue))), Ge;
|
|
40
40
|
}
|
|
41
|
-
function
|
|
42
|
-
|
|
43
|
-
let t =
|
|
41
|
+
function Je(e) {
|
|
42
|
+
Ge = e;
|
|
43
|
+
let t = Ke(Ue);
|
|
44
44
|
if (e) {
|
|
45
45
|
localStorage.setItem(t, e);
|
|
46
46
|
return;
|
|
47
47
|
}
|
|
48
48
|
localStorage.removeItem(t);
|
|
49
49
|
}
|
|
50
|
-
function
|
|
51
|
-
let e =
|
|
50
|
+
function Ye() {
|
|
51
|
+
let e = Ke(We), t = localStorage.getItem(e);
|
|
52
52
|
return t ? JSON.parse(t) : null;
|
|
53
53
|
}
|
|
54
|
-
function
|
|
55
|
-
return
|
|
54
|
+
function Xe() {
|
|
55
|
+
return Ye();
|
|
56
56
|
}
|
|
57
|
-
function
|
|
58
|
-
localStorage.setItem(
|
|
57
|
+
function Ze(e) {
|
|
58
|
+
localStorage.setItem(Ke(We), JSON.stringify(e));
|
|
59
59
|
}
|
|
60
|
-
function
|
|
61
|
-
localStorage.removeItem(
|
|
60
|
+
function Qe() {
|
|
61
|
+
localStorage.removeItem(Ke(We));
|
|
62
62
|
}
|
|
63
63
|
//#endregion
|
|
64
64
|
//#region src/chat/avatar.ts
|
|
65
|
-
function
|
|
66
|
-
let t =
|
|
65
|
+
function $e(e) {
|
|
66
|
+
let t = tt(e);
|
|
67
67
|
if (!t) return;
|
|
68
68
|
let n = t.trim();
|
|
69
69
|
if (n) {
|
|
70
70
|
try {
|
|
71
|
-
if (
|
|
71
|
+
if (nt(new URL(n))) return `${G().chatApiBaseUrl}/file-proxy?uri=${encodeURIComponent(n)}`;
|
|
72
72
|
} catch {}
|
|
73
73
|
return n;
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
|
-
function $e(e) {
|
|
77
|
-
return Qe(e) ?? e;
|
|
78
|
-
}
|
|
79
76
|
function et(e) {
|
|
77
|
+
return $e(e) ?? e;
|
|
78
|
+
}
|
|
79
|
+
function tt(e) {
|
|
80
80
|
if (typeof e == "string") return e;
|
|
81
81
|
if (!e || typeof e != "object") return;
|
|
82
82
|
let t = e, n = [
|
|
@@ -94,36 +94,36 @@ function et(e) {
|
|
|
94
94
|
t.avatar,
|
|
95
95
|
t.image
|
|
96
96
|
].find((e) => e && typeof e == "object");
|
|
97
|
-
if (r) return
|
|
97
|
+
if (r) return tt(r);
|
|
98
98
|
}
|
|
99
|
-
function
|
|
100
|
-
let { appId: t, region: n } =
|
|
99
|
+
function nt(e) {
|
|
100
|
+
let { appId: t, region: n } = G(), r = `data-${n}.cometchat.io`, i = `/${t}/`;
|
|
101
101
|
return e.hostname.toLowerCase() === r.toLowerCase() && e.pathname.startsWith(i);
|
|
102
102
|
}
|
|
103
103
|
//#endregion
|
|
104
104
|
//#region src/chat/cacheScope.ts
|
|
105
|
-
var
|
|
106
|
-
function
|
|
107
|
-
return `${
|
|
108
|
-
}
|
|
109
|
-
function st() {
|
|
110
|
-
return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
105
|
+
var rt = ":chatCacheScope", it = ":chatCacheOwner", at, ot;
|
|
106
|
+
function st(e) {
|
|
107
|
+
return `${G().appId}${e}`;
|
|
111
108
|
}
|
|
112
109
|
function ct() {
|
|
113
|
-
return
|
|
110
|
+
return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
114
111
|
}
|
|
115
112
|
function lt() {
|
|
116
|
-
return at === void 0 && (at = localStorage.getItem(
|
|
113
|
+
return at === void 0 && (at = localStorage.getItem(st(rt))), at;
|
|
114
|
+
}
|
|
115
|
+
function ut() {
|
|
116
|
+
return ot === void 0 && (ot = localStorage.getItem(st(it))), ot;
|
|
117
117
|
}
|
|
118
|
-
function
|
|
119
|
-
let t =
|
|
118
|
+
function dt(e) {
|
|
119
|
+
let t = lt(), n = ut();
|
|
120
120
|
if (t && n === e) return t;
|
|
121
|
-
let r =
|
|
122
|
-
return
|
|
121
|
+
let r = ct();
|
|
122
|
+
return at = r, ot = e, localStorage.setItem(st(rt), r), localStorage.setItem(st(it), e), r;
|
|
123
123
|
}
|
|
124
124
|
//#endregion
|
|
125
125
|
//#region src/chat/localization.ts
|
|
126
|
-
var
|
|
126
|
+
var ft = {
|
|
127
127
|
en: {
|
|
128
128
|
addOption: "Add option",
|
|
129
129
|
addToMessage: "Add to message",
|
|
@@ -364,102 +364,102 @@ var dt = {
|
|
|
364
364
|
you: "Du",
|
|
365
365
|
youSentAMessage: "Du sendte en melding"
|
|
366
366
|
}
|
|
367
|
-
},
|
|
368
|
-
function
|
|
367
|
+
}, pt = w("en");
|
|
368
|
+
function mt(e) {
|
|
369
369
|
return e === "nb" || e === "no" ? "nb" : "en";
|
|
370
370
|
}
|
|
371
|
-
function
|
|
372
|
-
return
|
|
371
|
+
function ht(e) {
|
|
372
|
+
return mt(e) === "nb" ? "nb-NO" : "en-US";
|
|
373
373
|
}
|
|
374
|
-
function
|
|
374
|
+
function gt() {
|
|
375
375
|
return "h23";
|
|
376
376
|
}
|
|
377
|
-
function
|
|
378
|
-
|
|
377
|
+
function _t(e) {
|
|
378
|
+
pt.value = e;
|
|
379
379
|
}
|
|
380
|
-
function
|
|
381
|
-
let r =
|
|
380
|
+
function vt(e, t, n) {
|
|
381
|
+
let r = ft[mt(n ?? pt.value)][e] ?? ft.en[e];
|
|
382
382
|
return typeof r == "function" ? r(t ?? {}) : r;
|
|
383
383
|
}
|
|
384
|
-
function
|
|
385
|
-
let t = n(() => A(e) ??
|
|
384
|
+
function K(e) {
|
|
385
|
+
let t = n(() => A(e) ?? pt.value);
|
|
386
386
|
return {
|
|
387
|
-
locale: n(() =>
|
|
388
|
-
t: (e, n) =>
|
|
387
|
+
locale: n(() => ht(t.value)),
|
|
388
|
+
t: (e, n) => vt(e, n, t.value)
|
|
389
389
|
};
|
|
390
390
|
}
|
|
391
391
|
//#endregion
|
|
392
392
|
//#region src/chat/mentions.ts
|
|
393
|
-
var
|
|
394
|
-
function
|
|
393
|
+
var yt = /<@uid:([^>]+)>/g, bt = /<@uid:([^&]+)>/g, xt = "mention:", St = "", Ct = "data-mention-uid", wt = "composer-mention", Tt = "message-mention";
|
|
394
|
+
function Et(e) {
|
|
395
395
|
return {
|
|
396
396
|
uid: e.uid,
|
|
397
397
|
displayName: e.displayName,
|
|
398
398
|
avatar: e.avatar
|
|
399
399
|
};
|
|
400
400
|
}
|
|
401
|
-
function
|
|
401
|
+
function Dt(e) {
|
|
402
402
|
let t = {};
|
|
403
403
|
for (let n of e) t[n.uid] = n.displayName;
|
|
404
404
|
return t;
|
|
405
405
|
}
|
|
406
|
-
function
|
|
406
|
+
function Ot(e, t, n = 8) {
|
|
407
407
|
let r = t.trim().toLowerCase(), i = e.filter((e) => e.displayName.trim().length > 0);
|
|
408
408
|
return r ? i.filter((e) => {
|
|
409
409
|
let t = e.displayName.toLowerCase(), n = e.uid.toLowerCase();
|
|
410
410
|
return t.includes(r) || n.includes(r);
|
|
411
411
|
}).slice(0, n) : i.slice(0, n);
|
|
412
412
|
}
|
|
413
|
-
function Ot(e) {
|
|
414
|
-
return `<@uid:${e}>`;
|
|
415
|
-
}
|
|
416
413
|
function kt(e) {
|
|
417
|
-
return e
|
|
414
|
+
return `<@uid:${e}>`;
|
|
418
415
|
}
|
|
419
416
|
function At(e) {
|
|
420
|
-
return
|
|
417
|
+
return e.replace(bt, (e, t) => kt(t));
|
|
421
418
|
}
|
|
422
419
|
function jt(e) {
|
|
420
|
+
return yt.lastIndex = 0, bt.lastIndex = 0, yt.test(e) || bt.test(e);
|
|
421
|
+
}
|
|
422
|
+
function Mt(e) {
|
|
423
423
|
let t = [];
|
|
424
424
|
return {
|
|
425
|
-
shielded:
|
|
425
|
+
shielded: At(e).replace(yt, (e) => `${xt}${t.push(e) - 1}${St}`),
|
|
426
426
|
tokens: t
|
|
427
427
|
};
|
|
428
428
|
}
|
|
429
|
-
function
|
|
430
|
-
let n = RegExp(`${
|
|
429
|
+
function Nt(e, t) {
|
|
430
|
+
let n = RegExp(`${xt.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}(\\d+)${St.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}`, "g");
|
|
431
431
|
return e.replace(n, (e, n) => t[Number(n)] ?? "");
|
|
432
432
|
}
|
|
433
|
-
function
|
|
434
|
-
return e.replace(
|
|
433
|
+
function Pt(e, t, n = Tt) {
|
|
434
|
+
return e.replace(yt, (e, r) => {
|
|
435
435
|
let i = t(r).trim() || r;
|
|
436
|
-
return `<span class="${n}" ${
|
|
436
|
+
return `<span class="${n}" ${Ct}="${Wt(r)}">@${Gt(i)}</span>`;
|
|
437
437
|
});
|
|
438
438
|
}
|
|
439
|
-
function Pt(e, t = {}) {
|
|
440
|
-
return Nt(e, (e) => t[e] ?? e, Ct);
|
|
441
|
-
}
|
|
442
439
|
function Ft(e, t = {}) {
|
|
443
|
-
return
|
|
440
|
+
return Pt(e, (e) => t[e] ?? e, wt);
|
|
441
|
+
}
|
|
442
|
+
function It(e, t = {}) {
|
|
443
|
+
return Pt(e, (e) => t[e] ?? e, Tt);
|
|
444
444
|
}
|
|
445
|
-
function
|
|
445
|
+
function Lt(e) {
|
|
446
446
|
if (!e) return "";
|
|
447
447
|
let t = new DOMParser().parseFromString(`<div>${e}</div>`, "text/html"), n = t.body.firstElementChild;
|
|
448
448
|
if (!n) return e;
|
|
449
|
-
for (let e of [...n.querySelectorAll(`span[${
|
|
450
|
-
let n = e.getAttribute(
|
|
451
|
-
n && e.replaceWith(t.createTextNode(
|
|
449
|
+
for (let e of [...n.querySelectorAll(`span[${Ct}]`)]) {
|
|
450
|
+
let n = e.getAttribute(Ct);
|
|
451
|
+
n && e.replaceWith(t.createTextNode(kt(n)));
|
|
452
452
|
}
|
|
453
|
-
return
|
|
453
|
+
return Rt(n.innerHTML);
|
|
454
454
|
}
|
|
455
|
-
function
|
|
455
|
+
function Rt(e) {
|
|
456
456
|
return e.replace(/<@uid:([^&]+)>/g, "<@uid:$1>");
|
|
457
457
|
}
|
|
458
|
-
var
|
|
459
|
-
function
|
|
458
|
+
var zt = /@([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})/gi;
|
|
459
|
+
function Bt(e, t, n = "member") {
|
|
460
460
|
return t[e]?.trim() || n;
|
|
461
461
|
}
|
|
462
|
-
function
|
|
462
|
+
function Vt(e) {
|
|
463
463
|
let t = {};
|
|
464
464
|
for (let n of e?.getMentionedUsers?.() ?? []) {
|
|
465
465
|
let e = n.getUid?.(), r = n.getName?.()?.trim();
|
|
@@ -467,31 +467,31 @@ function Bt(e) {
|
|
|
467
467
|
}
|
|
468
468
|
return t;
|
|
469
469
|
}
|
|
470
|
-
function
|
|
470
|
+
function Ht(...e) {
|
|
471
471
|
let t = {};
|
|
472
472
|
for (let n of e) Object.assign(t, n);
|
|
473
473
|
return t;
|
|
474
474
|
}
|
|
475
|
-
function
|
|
476
|
-
return
|
|
475
|
+
function Ut(e, t = {}) {
|
|
476
|
+
return At(e).replace(yt, (e, n) => `@${Bt(n, t)}`).replace(zt, (e, n) => `@${Bt(n, t)}`);
|
|
477
477
|
}
|
|
478
|
-
function
|
|
478
|
+
function Wt(e) {
|
|
479
479
|
return e.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<");
|
|
480
480
|
}
|
|
481
|
-
function
|
|
481
|
+
function Gt(e) {
|
|
482
482
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
483
483
|
}
|
|
484
484
|
//#endregion
|
|
485
485
|
//#region node_modules/dompurify/dist/purify.es.mjs
|
|
486
|
-
function
|
|
486
|
+
function Kt(e, t) {
|
|
487
487
|
(t == null || t > e.length) && (t = e.length);
|
|
488
488
|
for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
|
|
489
489
|
return r;
|
|
490
490
|
}
|
|
491
|
-
function
|
|
491
|
+
function qt(e) {
|
|
492
492
|
if (Array.isArray(e)) return e;
|
|
493
493
|
}
|
|
494
|
-
function
|
|
494
|
+
function Jt(e, t) {
|
|
495
495
|
var n = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
|
|
496
496
|
if (n != null) {
|
|
497
497
|
var r, i, a, o, s = [], c = !0, l = !1;
|
|
@@ -509,99 +509,99 @@ function qt(e, t) {
|
|
|
509
509
|
return s;
|
|
510
510
|
}
|
|
511
511
|
}
|
|
512
|
-
function
|
|
512
|
+
function Yt() {
|
|
513
513
|
throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
514
514
|
}
|
|
515
|
-
function Yt(e, t) {
|
|
516
|
-
return Kt(e) || qt(e, t) || Xt(e, t) || Jt();
|
|
517
|
-
}
|
|
518
515
|
function Xt(e, t) {
|
|
516
|
+
return qt(e) || Jt(e, t) || Zt(e, t) || Yt();
|
|
517
|
+
}
|
|
518
|
+
function Zt(e, t) {
|
|
519
519
|
if (e) {
|
|
520
|
-
if (typeof e == "string") return
|
|
520
|
+
if (typeof e == "string") return Kt(e, t);
|
|
521
521
|
var n = {}.toString.call(e).slice(8, -1);
|
|
522
|
-
return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ?
|
|
522
|
+
return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? Kt(e, t) : void 0;
|
|
523
523
|
}
|
|
524
524
|
}
|
|
525
|
-
var
|
|
526
|
-
|
|
525
|
+
var Qt = Object.entries, $t = Object.setPrototypeOf, en = Object.isFrozen, tn = Object.getPrototypeOf, nn = Object.getOwnPropertyDescriptor, rn = Object.freeze, an = Object.seal, on = Object.create, sn = typeof Reflect < "u" && Reflect, cn = sn.apply, ln = sn.construct;
|
|
526
|
+
rn ||= function(e) {
|
|
527
527
|
return e;
|
|
528
|
-
},
|
|
528
|
+
}, an ||= function(e) {
|
|
529
529
|
return e;
|
|
530
|
-
},
|
|
530
|
+
}, cn ||= function(e, t) {
|
|
531
531
|
var n = [...arguments].slice(2);
|
|
532
532
|
return e.apply(t, n);
|
|
533
|
-
},
|
|
533
|
+
}, ln ||= function(e) {
|
|
534
534
|
return new e(...[...arguments].slice(1));
|
|
535
535
|
};
|
|
536
|
-
var
|
|
537
|
-
function
|
|
536
|
+
var un = J(Array.prototype.forEach), dn = J(Array.prototype.lastIndexOf), fn = J(Array.prototype.pop), pn = J(Array.prototype.push), mn = J(Array.prototype.splice), hn = Array.isArray, gn = J(String.prototype.toLowerCase), _n = J(String.prototype.toString), vn = J(String.prototype.match), yn = J(String.prototype.replace), bn = J(String.prototype.indexOf), xn = J(String.prototype.trim), Sn = J(Number.prototype.toString), Cn = J(Boolean.prototype.toString), wn = typeof BigInt > "u" ? null : J(BigInt.prototype.toString), Tn = typeof Symbol > "u" ? null : J(Symbol.prototype.toString), q = J(Object.prototype.hasOwnProperty), En = J(Object.prototype.toString), Dn = J(RegExp.prototype.test), On = kn(TypeError);
|
|
537
|
+
function J(e) {
|
|
538
538
|
return function(t) {
|
|
539
539
|
t instanceof RegExp && (t.lastIndex = 0);
|
|
540
540
|
var n = [...arguments].slice(1);
|
|
541
|
-
return
|
|
541
|
+
return cn(e, t, n);
|
|
542
542
|
};
|
|
543
543
|
}
|
|
544
544
|
function kn(e) {
|
|
545
545
|
return function() {
|
|
546
|
-
return
|
|
546
|
+
return ln(e, [...arguments]);
|
|
547
547
|
};
|
|
548
548
|
}
|
|
549
549
|
function Y(e, t) {
|
|
550
|
-
let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] :
|
|
551
|
-
if (
|
|
550
|
+
let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : gn;
|
|
551
|
+
if ($t && $t(e, null), !hn(t)) return e;
|
|
552
552
|
let r = t.length;
|
|
553
553
|
for (; r--;) {
|
|
554
554
|
let i = t[r];
|
|
555
555
|
if (typeof i == "string") {
|
|
556
556
|
let e = n(i);
|
|
557
|
-
e !== i && (
|
|
557
|
+
e !== i && (en(t) || (t[r] = e), i = e);
|
|
558
558
|
}
|
|
559
559
|
e[i] = !0;
|
|
560
560
|
}
|
|
561
561
|
return e;
|
|
562
562
|
}
|
|
563
563
|
function An(e) {
|
|
564
|
-
for (let t = 0; t < e.length; t++)
|
|
564
|
+
for (let t = 0; t < e.length; t++) q(e, t) || (e[t] = null);
|
|
565
565
|
return e;
|
|
566
566
|
}
|
|
567
567
|
function jn(e) {
|
|
568
|
-
let t =
|
|
569
|
-
for (let r of
|
|
570
|
-
var n =
|
|
568
|
+
let t = on(null);
|
|
569
|
+
for (let r of Qt(e)) {
|
|
570
|
+
var n = Xt(r, 2);
|
|
571
571
|
let i = n[0], a = n[1];
|
|
572
|
-
|
|
572
|
+
q(e, i) && (hn(a) ? t[i] = An(a) : a && typeof a == "object" && a.constructor === Object ? t[i] = jn(a) : t[i] = a);
|
|
573
573
|
}
|
|
574
574
|
return t;
|
|
575
575
|
}
|
|
576
576
|
function Mn(e) {
|
|
577
577
|
switch (typeof e) {
|
|
578
578
|
case "string": return e;
|
|
579
|
-
case "number": return
|
|
580
|
-
case "boolean": return
|
|
581
|
-
case "bigint": return
|
|
582
|
-
case "symbol": return
|
|
583
|
-
case "undefined": return
|
|
579
|
+
case "number": return Sn(e);
|
|
580
|
+
case "boolean": return Cn(e);
|
|
581
|
+
case "bigint": return wn ? wn(e) : "0";
|
|
582
|
+
case "symbol": return Tn ? Tn(e) : "Symbol()";
|
|
583
|
+
case "undefined": return En(e);
|
|
584
584
|
case "function":
|
|
585
585
|
case "object": {
|
|
586
|
-
if (e === null) return
|
|
586
|
+
if (e === null) return En(e);
|
|
587
587
|
let t = e, n = Nn(t, "toString");
|
|
588
588
|
if (typeof n == "function") {
|
|
589
589
|
let e = n(t);
|
|
590
|
-
return typeof e == "string" ? e :
|
|
590
|
+
return typeof e == "string" ? e : En(e);
|
|
591
591
|
}
|
|
592
|
-
return
|
|
592
|
+
return En(e);
|
|
593
593
|
}
|
|
594
|
-
default: return
|
|
594
|
+
default: return En(e);
|
|
595
595
|
}
|
|
596
596
|
}
|
|
597
597
|
function Nn(e, t) {
|
|
598
598
|
for (; e !== null;) {
|
|
599
|
-
let n =
|
|
599
|
+
let n = nn(e, t);
|
|
600
600
|
if (n) {
|
|
601
|
-
if (n.get) return
|
|
602
|
-
if (typeof n.value == "function") return
|
|
601
|
+
if (n.get) return J(n.get);
|
|
602
|
+
if (typeof n.value == "function") return J(n.value);
|
|
603
603
|
}
|
|
604
|
-
e =
|
|
604
|
+
e = tn(e);
|
|
605
605
|
}
|
|
606
606
|
function n() {
|
|
607
607
|
return null;
|
|
@@ -610,12 +610,12 @@ function Nn(e, t) {
|
|
|
610
610
|
}
|
|
611
611
|
function Pn(e) {
|
|
612
612
|
try {
|
|
613
|
-
return
|
|
613
|
+
return Dn(e, ""), !0;
|
|
614
614
|
} catch {
|
|
615
615
|
return !1;
|
|
616
616
|
}
|
|
617
617
|
}
|
|
618
|
-
var Fn =
|
|
618
|
+
var Fn = rn(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr".split(".")), In = rn(/* @__PURE__ */ "svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern".split(".")), Ln = rn([
|
|
619
619
|
"feBlend",
|
|
620
620
|
"feColorMatrix",
|
|
621
621
|
"feComponentTransfer",
|
|
@@ -641,7 +641,7 @@ var Fn = nn(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.b
|
|
|
641
641
|
"feSpotLight",
|
|
642
642
|
"feTile",
|
|
643
643
|
"feTurbulence"
|
|
644
|
-
]), Rn =
|
|
644
|
+
]), Rn = rn([
|
|
645
645
|
"animate",
|
|
646
646
|
"color-profile",
|
|
647
647
|
"cursor",
|
|
@@ -664,7 +664,7 @@ var Fn = nn(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.b
|
|
|
664
664
|
"solidcolor",
|
|
665
665
|
"unknown",
|
|
666
666
|
"use"
|
|
667
|
-
]), zn =
|
|
667
|
+
]), zn = rn(/* @__PURE__ */ "math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts".split(".")), Bn = rn([
|
|
668
668
|
"maction",
|
|
669
669
|
"maligngroup",
|
|
670
670
|
"malignmark",
|
|
@@ -680,13 +680,13 @@ var Fn = nn(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.b
|
|
|
680
680
|
"annotation-xml",
|
|
681
681
|
"mprescripts",
|
|
682
682
|
"none"
|
|
683
|
-
]), Vn =
|
|
683
|
+
]), Vn = rn(["#text"]), Hn = rn(/* @__PURE__ */ "accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns".split(".")), Un = rn(/* @__PURE__ */ "accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-rendering.textlength.type.u1.u2.unicode.values.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan".split(".")), Wn = rn(/* @__PURE__ */ "accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns".split(".")), Gn = rn([
|
|
684
684
|
"xlink:href",
|
|
685
685
|
"xml:id",
|
|
686
686
|
"xlink:title",
|
|
687
687
|
"xml:space",
|
|
688
688
|
"xmlns:xlink"
|
|
689
|
-
]), Kn =
|
|
689
|
+
]), Kn = an(/{{[\w\W]*|^[\w\W]*}}/g), qn = an(/<%[\w\W]*|^[\w\W]*%>/g), Jn = an(/\${[\w\W]*/g), Yn = an(/^data-[\-\w.\u00B7-\uFFFF]+$/), Xn = an(/^aria-[\-\w]+$/), Zn = an(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), Qn = an(/^(?:\w+script|data):/i), $n = an(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), er = an(/^html$/i), tr = an(/^[a-z][.\w]*(-[.\w]+)+$/i), nr = {
|
|
690
690
|
element: 1,
|
|
691
691
|
text: 3,
|
|
692
692
|
progressingInstruction: 7,
|
|
@@ -733,8 +733,8 @@ function or() {
|
|
|
733
733
|
e.content && e.content.ownerDocument && (n = e.content.ownerDocument);
|
|
734
734
|
}
|
|
735
735
|
let x, S = "", C = n, w = C.implementation, T = C.createNodeIterator, E = C.createDocumentFragment, D = C.getElementsByTagName, O = r.importNode, k = ar();
|
|
736
|
-
t.isSupported = typeof
|
|
737
|
-
let A = Kn, j = qn, M = Jn, ee = Yn, N = Xn, P = Qn, F = $n, I = tr,
|
|
736
|
+
t.isSupported = typeof Qt == "function" && typeof b == "function" && w && w.createHTMLDocument !== void 0;
|
|
737
|
+
let A = Kn, j = qn, M = Jn, ee = Yn, N = Xn, P = Qn, F = $n, I = tr, te = Zn, L = null, R = Y({}, [
|
|
738
738
|
...Fn,
|
|
739
739
|
...In,
|
|
740
740
|
...Ln,
|
|
@@ -745,7 +745,7 @@ function or() {
|
|
|
745
745
|
...Un,
|
|
746
746
|
...Wn,
|
|
747
747
|
...Gn
|
|
748
|
-
]), B = Object.seal(
|
|
748
|
+
]), B = Object.seal(on(null, {
|
|
749
749
|
tagNameCheck: {
|
|
750
750
|
writable: !0,
|
|
751
751
|
configurable: !1,
|
|
@@ -764,7 +764,7 @@ function or() {
|
|
|
764
764
|
enumerable: !0,
|
|
765
765
|
value: !1
|
|
766
766
|
}
|
|
767
|
-
})), re = null, ie = null,
|
|
767
|
+
})), re = null, ie = null, ae = Object.seal(on(null, {
|
|
768
768
|
tagCheck: {
|
|
769
769
|
writable: !0,
|
|
770
770
|
configurable: !1,
|
|
@@ -777,7 +777,7 @@ function or() {
|
|
|
777
777
|
enumerable: !0,
|
|
778
778
|
value: null
|
|
779
779
|
}
|
|
780
|
-
})),
|
|
780
|
+
})), oe = !0, V = !0, se = !1, H = !0, ce = !1, le = !0, U = !1, ue = !1, de = !1, fe = !1, pe = !1, me = !1, he = !0, ge = !1, _e = "user-content-", ve = !0, ye = !1, be = {}, xe = null, Se = Y({}, [
|
|
781
781
|
"annotation-xml",
|
|
782
782
|
"audio",
|
|
783
783
|
"colgroup",
|
|
@@ -803,14 +803,14 @@ function or() {
|
|
|
803
803
|
"title",
|
|
804
804
|
"video",
|
|
805
805
|
"xmp"
|
|
806
|
-
]),
|
|
806
|
+
]), Ce = null, we = Y({}, [
|
|
807
807
|
"audio",
|
|
808
808
|
"video",
|
|
809
809
|
"img",
|
|
810
810
|
"source",
|
|
811
811
|
"image",
|
|
812
812
|
"track"
|
|
813
|
-
]),
|
|
813
|
+
]), Te = null, Ee = Y({}, [
|
|
814
814
|
"alt",
|
|
815
815
|
"class",
|
|
816
816
|
"for",
|
|
@@ -825,125 +825,125 @@ function or() {
|
|
|
825
825
|
"value",
|
|
826
826
|
"style",
|
|
827
827
|
"xmlns"
|
|
828
|
-
]),
|
|
829
|
-
Ee,
|
|
828
|
+
]), De = "http://www.w3.org/1998/Math/MathML", Oe = "http://www.w3.org/2000/svg", ke = "http://www.w3.org/1999/xhtml", Ae = ke, je = !1, Me = null, Ne = Y({}, [
|
|
830
829
|
De,
|
|
831
|
-
Oe
|
|
832
|
-
|
|
830
|
+
Oe,
|
|
831
|
+
ke
|
|
832
|
+
], _n), Pe = Y({}, [
|
|
833
833
|
"mi",
|
|
834
834
|
"mo",
|
|
835
835
|
"mn",
|
|
836
836
|
"ms",
|
|
837
837
|
"mtext"
|
|
838
|
-
]),
|
|
838
|
+
]), Fe = Y({}, ["annotation-xml"]), Ie = Y({}, [
|
|
839
839
|
"title",
|
|
840
840
|
"style",
|
|
841
841
|
"font",
|
|
842
842
|
"a",
|
|
843
843
|
"script"
|
|
844
|
-
]),
|
|
844
|
+
]), Le = null, Re = ["application/xhtml+xml", "text/html"], W = null, ze = null, Be = n.createElement("form"), Ve = function(e) {
|
|
845
845
|
return e instanceof RegExp || e instanceof Function;
|
|
846
|
-
},
|
|
846
|
+
}, He = function() {
|
|
847
847
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
848
|
-
if (
|
|
849
|
-
(!e || typeof e != "object") && (e = {}), e = jn(e),
|
|
848
|
+
if (ze && ze === e) return;
|
|
849
|
+
(!e || typeof e != "object") && (e = {}), e = jn(e), Le = Re.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, W = Le === "application/xhtml+xml" ? _n : gn, L = q(e, "ALLOWED_TAGS") && hn(e.ALLOWED_TAGS) ? Y({}, e.ALLOWED_TAGS, W) : R, z = q(e, "ALLOWED_ATTR") && hn(e.ALLOWED_ATTR) ? Y({}, e.ALLOWED_ATTR, W) : ne, Me = q(e, "ALLOWED_NAMESPACES") && hn(e.ALLOWED_NAMESPACES) ? Y({}, e.ALLOWED_NAMESPACES, _n) : Ne, Te = q(e, "ADD_URI_SAFE_ATTR") && hn(e.ADD_URI_SAFE_ATTR) ? Y(jn(Ee), e.ADD_URI_SAFE_ATTR, W) : Ee, Ce = q(e, "ADD_DATA_URI_TAGS") && hn(e.ADD_DATA_URI_TAGS) ? Y(jn(we), e.ADD_DATA_URI_TAGS, W) : we, xe = q(e, "FORBID_CONTENTS") && hn(e.FORBID_CONTENTS) ? Y({}, e.FORBID_CONTENTS, W) : Se, re = q(e, "FORBID_TAGS") && hn(e.FORBID_TAGS) ? Y({}, e.FORBID_TAGS, W) : jn({}), ie = q(e, "FORBID_ATTR") && hn(e.FORBID_ATTR) ? Y({}, e.FORBID_ATTR, W) : jn({}), be = q(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? jn(e.USE_PROFILES) : e.USE_PROFILES : !1, oe = e.ALLOW_ARIA_ATTR !== !1, V = e.ALLOW_DATA_ATTR !== !1, se = e.ALLOW_UNKNOWN_PROTOCOLS || !1, H = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, ce = e.SAFE_FOR_TEMPLATES || !1, le = e.SAFE_FOR_XML !== !1, U = e.WHOLE_DOCUMENT || !1, fe = e.RETURN_DOM || !1, pe = e.RETURN_DOM_FRAGMENT || !1, me = e.RETURN_TRUSTED_TYPE || !1, de = e.FORCE_BODY || !1, he = e.SANITIZE_DOM !== !1, ge = e.SANITIZE_NAMED_PROPS || !1, ve = e.KEEP_CONTENT !== !1, ye = e.IN_PLACE || !1, te = Pn(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : Zn, Ae = typeof e.NAMESPACE == "string" ? e.NAMESPACE : ke, Pe = q(e, "MATHML_TEXT_INTEGRATION_POINTS") && e.MATHML_TEXT_INTEGRATION_POINTS && typeof e.MATHML_TEXT_INTEGRATION_POINTS == "object" ? jn(e.MATHML_TEXT_INTEGRATION_POINTS) : Y({}, [
|
|
850
850
|
"mi",
|
|
851
851
|
"mo",
|
|
852
852
|
"mn",
|
|
853
853
|
"ms",
|
|
854
854
|
"mtext"
|
|
855
|
-
]),
|
|
856
|
-
let t =
|
|
857
|
-
if (B =
|
|
855
|
+
]), Fe = q(e, "HTML_INTEGRATION_POINTS") && e.HTML_INTEGRATION_POINTS && typeof e.HTML_INTEGRATION_POINTS == "object" ? jn(e.HTML_INTEGRATION_POINTS) : Y({}, ["annotation-xml"]);
|
|
856
|
+
let t = q(e, "CUSTOM_ELEMENT_HANDLING") && e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING == "object" ? jn(e.CUSTOM_ELEMENT_HANDLING) : on(null);
|
|
857
|
+
if (B = on(null), q(t, "tagNameCheck") && Ve(t.tagNameCheck) && (B.tagNameCheck = t.tagNameCheck), q(t, "attributeNameCheck") && Ve(t.attributeNameCheck) && (B.attributeNameCheck = t.attributeNameCheck), q(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (B.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), ce && (V = !1), pe && (fe = !0), be && (L = Y({}, Vn), z = on(null), be.html === !0 && (Y(L, Fn), Y(z, Hn)), be.svg === !0 && (Y(L, In), Y(z, Un), Y(z, Gn)), be.svgFilters === !0 && (Y(L, Ln), Y(z, Un), Y(z, Gn)), be.mathMl === !0 && (Y(L, zn), Y(z, Wn), Y(z, Gn))), ae.tagCheck = null, ae.attributeCheck = null, q(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? ae.tagCheck = e.ADD_TAGS : hn(e.ADD_TAGS) && (L === R && (L = jn(L)), Y(L, e.ADD_TAGS, W))), q(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? ae.attributeCheck = e.ADD_ATTR : hn(e.ADD_ATTR) && (z === ne && (z = jn(z)), Y(z, e.ADD_ATTR, W))), q(e, "ADD_URI_SAFE_ATTR") && hn(e.ADD_URI_SAFE_ATTR) && Y(Te, e.ADD_URI_SAFE_ATTR, W), q(e, "FORBID_CONTENTS") && hn(e.FORBID_CONTENTS) && (xe === Se && (xe = jn(xe)), Y(xe, e.FORBID_CONTENTS, W)), q(e, "ADD_FORBID_CONTENTS") && hn(e.ADD_FORBID_CONTENTS) && (xe === Se && (xe = jn(xe)), Y(xe, e.ADD_FORBID_CONTENTS, W)), ve && (L["#text"] = !0), U && Y(L, [
|
|
858
858
|
"html",
|
|
859
859
|
"head",
|
|
860
860
|
"body"
|
|
861
|
-
]),
|
|
862
|
-
if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw
|
|
863
|
-
if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw
|
|
861
|
+
]), L.table && (Y(L, ["tbody"]), delete re.tbody), e.TRUSTED_TYPES_POLICY) {
|
|
862
|
+
if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw On("TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.");
|
|
863
|
+
if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw On("TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.");
|
|
864
864
|
x = e.TRUSTED_TYPES_POLICY, S = x.createHTML("");
|
|
865
865
|
} else x === void 0 && (x = ir(m, i)), x !== null && typeof S == "string" && (S = x.createHTML(""));
|
|
866
|
-
|
|
867
|
-
},
|
|
866
|
+
rn && rn(e), ze = e;
|
|
867
|
+
}, G = Y({}, [
|
|
868
868
|
...In,
|
|
869
869
|
...Ln,
|
|
870
870
|
...Rn
|
|
871
|
-
]),
|
|
871
|
+
]), Ue = Y({}, [...zn, ...Bn]), We = function(e) {
|
|
872
872
|
let t = b(e);
|
|
873
873
|
(!t || !t.tagName) && (t = {
|
|
874
|
-
namespaceURI:
|
|
874
|
+
namespaceURI: Ae,
|
|
875
875
|
tagName: "template"
|
|
876
876
|
});
|
|
877
|
-
let n =
|
|
878
|
-
return
|
|
879
|
-
},
|
|
880
|
-
|
|
877
|
+
let n = gn(e.tagName), r = gn(t.tagName);
|
|
878
|
+
return Me[e.namespaceURI] ? e.namespaceURI === Oe ? t.namespaceURI === ke ? n === "svg" : t.namespaceURI === De ? n === "svg" && (r === "annotation-xml" || Pe[r]) : !!G[n] : e.namespaceURI === De ? t.namespaceURI === ke ? n === "math" : t.namespaceURI === Oe ? n === "math" && Fe[r] : !!Ue[n] : e.namespaceURI === ke ? t.namespaceURI === Oe && !Fe[r] || t.namespaceURI === De && !Pe[r] ? !1 : !Ue[n] && (Ie[n] || !G[n]) : !!(Le === "application/xhtml+xml" && Me[e.namespaceURI]) : !1;
|
|
879
|
+
}, Ge = function(e) {
|
|
880
|
+
pn(t.removed, { element: e });
|
|
881
881
|
try {
|
|
882
882
|
b(e).removeChild(e);
|
|
883
883
|
} catch {
|
|
884
884
|
_(e);
|
|
885
885
|
}
|
|
886
|
-
},
|
|
886
|
+
}, Ke = function(e, n) {
|
|
887
887
|
try {
|
|
888
|
-
|
|
888
|
+
pn(t.removed, {
|
|
889
889
|
attribute: n.getAttributeNode(e),
|
|
890
890
|
from: n
|
|
891
891
|
});
|
|
892
892
|
} catch {
|
|
893
|
-
|
|
893
|
+
pn(t.removed, {
|
|
894
894
|
attribute: null,
|
|
895
895
|
from: n
|
|
896
896
|
});
|
|
897
897
|
}
|
|
898
|
-
if (n.removeAttribute(e), e === "is") if (
|
|
899
|
-
|
|
898
|
+
if (n.removeAttribute(e), e === "is") if (fe || pe) try {
|
|
899
|
+
Ge(n);
|
|
900
900
|
} catch {}
|
|
901
901
|
else try {
|
|
902
902
|
n.setAttribute(e, "");
|
|
903
903
|
} catch {}
|
|
904
|
-
},
|
|
904
|
+
}, qe = function(e) {
|
|
905
905
|
let t = null, r = null;
|
|
906
|
-
if (
|
|
906
|
+
if (de) e = "<remove></remove>" + e;
|
|
907
907
|
else {
|
|
908
|
-
let t =
|
|
908
|
+
let t = vn(e, /^[\r\n\t ]+/);
|
|
909
909
|
r = t && t[0];
|
|
910
910
|
}
|
|
911
|
-
|
|
911
|
+
Le === "application/xhtml+xml" && Ae === ke && (e = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + e + "</body></html>");
|
|
912
912
|
let i = x ? x.createHTML(e) : e;
|
|
913
|
-
if (
|
|
914
|
-
t = new p().parseFromString(i,
|
|
913
|
+
if (Ae === ke) try {
|
|
914
|
+
t = new p().parseFromString(i, Le);
|
|
915
915
|
} catch {}
|
|
916
916
|
if (!t || !t.documentElement) {
|
|
917
|
-
t = w.createDocument(
|
|
917
|
+
t = w.createDocument(Ae, "template", null);
|
|
918
918
|
try {
|
|
919
|
-
t.documentElement.innerHTML =
|
|
919
|
+
t.documentElement.innerHTML = je ? S : i;
|
|
920
920
|
} catch {}
|
|
921
921
|
}
|
|
922
922
|
let a = t.body || t.documentElement;
|
|
923
|
-
return e && r && a.insertBefore(n.createTextNode(r), a.childNodes[0] || null),
|
|
924
|
-
}, qe = function(e) {
|
|
925
|
-
return T.call(e.ownerDocument || e, e, l.SHOW_ELEMENT | l.SHOW_COMMENT | l.SHOW_TEXT | l.SHOW_PROCESSING_INSTRUCTION | l.SHOW_CDATA_SECTION, null);
|
|
923
|
+
return e && r && a.insertBefore(n.createTextNode(r), a.childNodes[0] || null), Ae === ke ? D.call(t, U ? "html" : "body")[0] : U ? t.documentElement : a;
|
|
926
924
|
}, Je = function(e) {
|
|
927
|
-
return
|
|
925
|
+
return T.call(e.ownerDocument || e, e, l.SHOW_ELEMENT | l.SHOW_COMMENT | l.SHOW_TEXT | l.SHOW_PROCESSING_INSTRUCTION | l.SHOW_CDATA_SECTION, null);
|
|
928
926
|
}, Ye = function(e) {
|
|
927
|
+
return e instanceof f && (typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || !(e.attributes instanceof d) || typeof e.removeAttribute != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function");
|
|
928
|
+
}, Xe = function(e) {
|
|
929
929
|
return typeof s == "function" && e instanceof s;
|
|
930
930
|
};
|
|
931
|
-
function
|
|
932
|
-
|
|
933
|
-
e.call(t, n, r,
|
|
931
|
+
function Ze(e, n, r) {
|
|
932
|
+
un(e, (e) => {
|
|
933
|
+
e.call(t, n, r, ze);
|
|
934
934
|
});
|
|
935
935
|
}
|
|
936
|
-
let
|
|
936
|
+
let Qe = function(e) {
|
|
937
937
|
let n = null;
|
|
938
|
-
if (
|
|
939
|
-
let r =
|
|
940
|
-
if (
|
|
938
|
+
if (Ze(k.beforeSanitizeElements, e, null), Ye(e)) return Ge(e), !0;
|
|
939
|
+
let r = W(e.nodeName);
|
|
940
|
+
if (Ze(k.uponSanitizeElement, e, {
|
|
941
941
|
tagName: r,
|
|
942
|
-
allowedTags:
|
|
943
|
-
}),
|
|
944
|
-
if (re[r] || !(
|
|
945
|
-
if (!re[r] &&
|
|
946
|
-
if (
|
|
942
|
+
allowedTags: L
|
|
943
|
+
}), le && e.hasChildNodes() && !Xe(e.firstElementChild) && Dn(/<[/\w!]/g, e.innerHTML) && Dn(/<[/\w!]/g, e.textContent) || le && e.namespaceURI === ke && r === "style" && Xe(e.firstElementChild) || e.nodeType === nr.progressingInstruction || le && e.nodeType === nr.comment && Dn(/<[/\w]/g, e.data)) return Ge(e), !0;
|
|
944
|
+
if (re[r] || !(ae.tagCheck instanceof Function && ae.tagCheck(r)) && !L[r]) {
|
|
945
|
+
if (!re[r] && tt(r) && (B.tagNameCheck instanceof RegExp && Dn(B.tagNameCheck, r) || B.tagNameCheck instanceof Function && B.tagNameCheck(r))) return !1;
|
|
946
|
+
if (ve && !xe[r]) {
|
|
947
947
|
let t = b(e) || e.parentNode, n = y(e) || e.childNodes;
|
|
948
948
|
if (n && t) {
|
|
949
949
|
let r = n.length;
|
|
@@ -953,25 +953,25 @@ function or() {
|
|
|
953
953
|
}
|
|
954
954
|
}
|
|
955
955
|
}
|
|
956
|
-
return
|
|
956
|
+
return Ge(e), !0;
|
|
957
957
|
}
|
|
958
|
-
return e instanceof c && !
|
|
958
|
+
return e instanceof c && !We(e) || (r === "noscript" || r === "noembed" || r === "noframes") && Dn(/<\/no(script|embed|frames)/i, e.innerHTML) ? (Ge(e), !0) : (ce && e.nodeType === nr.text && (n = e.textContent, un([
|
|
959
959
|
A,
|
|
960
960
|
j,
|
|
961
961
|
M
|
|
962
962
|
], (e) => {
|
|
963
|
-
n =
|
|
964
|
-
}), e.textContent !== n && (
|
|
965
|
-
},
|
|
966
|
-
if (ie[t] ||
|
|
967
|
-
let i = z[t] ||
|
|
968
|
-
if (!(
|
|
963
|
+
n = yn(n, e, " ");
|
|
964
|
+
}), e.textContent !== n && (pn(t.removed, { element: e.cloneNode() }), e.textContent = n)), Ze(k.afterSanitizeElements, e, null), !1);
|
|
965
|
+
}, $e = function(e, t, r) {
|
|
966
|
+
if (ie[t] || he && (t === "id" || t === "name") && (r in n || r in Be)) return !1;
|
|
967
|
+
let i = z[t] || ae.attributeCheck instanceof Function && ae.attributeCheck(t, e);
|
|
968
|
+
if (!(V && !ie[t] && Dn(ee, t)) && !(oe && Dn(N, t))) {
|
|
969
969
|
if (!i || ie[t]) {
|
|
970
|
-
if (!(
|
|
971
|
-
} else if (!
|
|
970
|
+
if (!(tt(e) && (B.tagNameCheck instanceof RegExp && Dn(B.tagNameCheck, e) || B.tagNameCheck instanceof Function && B.tagNameCheck(e)) && (B.attributeNameCheck instanceof RegExp && Dn(B.attributeNameCheck, t) || B.attributeNameCheck instanceof Function && B.attributeNameCheck(t, e)) || t === "is" && B.allowCustomizedBuiltInElements && (B.tagNameCheck instanceof RegExp && Dn(B.tagNameCheck, r) || B.tagNameCheck instanceof Function && B.tagNameCheck(r)))) return !1;
|
|
971
|
+
} else if (!Te[t] && !Dn(te, yn(r, F, "")) && !((t === "src" || t === "xlink:href" || t === "href") && e !== "script" && bn(r, "data:") === 0 && Ce[e]) && !(se && !Dn(P, yn(r, F, ""))) && r) return !1;
|
|
972
972
|
}
|
|
973
973
|
return !0;
|
|
974
|
-
},
|
|
974
|
+
}, et = Y({}, [
|
|
975
975
|
"annotation-xml",
|
|
976
976
|
"color-profile",
|
|
977
977
|
"font-face",
|
|
@@ -980,12 +980,12 @@ function or() {
|
|
|
980
980
|
"font-face-src",
|
|
981
981
|
"font-face-uri",
|
|
982
982
|
"missing-glyph"
|
|
983
|
-
]),
|
|
984
|
-
return
|
|
985
|
-
},
|
|
986
|
-
|
|
983
|
+
]), tt = function(e) {
|
|
984
|
+
return !et[gn(e)] && Dn(I, e);
|
|
985
|
+
}, nt = function(e) {
|
|
986
|
+
Ze(k.beforeSanitizeAttributes, e, null);
|
|
987
987
|
let n = e.attributes;
|
|
988
|
-
if (!n ||
|
|
988
|
+
if (!n || Ye(e)) return;
|
|
989
989
|
let r = {
|
|
990
990
|
attrName: "",
|
|
991
991
|
attrValue: "",
|
|
@@ -994,34 +994,34 @@ function or() {
|
|
|
994
994
|
forceKeepAttr: void 0
|
|
995
995
|
}, i = n.length;
|
|
996
996
|
for (; i--;) {
|
|
997
|
-
let a = n[i], o = a.name, s = a.namespaceURI, c = a.value, l =
|
|
998
|
-
if (r.attrName = l, r.attrValue = d, r.keepAttr = !0, r.forceKeepAttr = void 0,
|
|
999
|
-
|
|
997
|
+
let a = n[i], o = a.name, s = a.namespaceURI, c = a.value, l = W(o), u = c, d = o === "value" ? u : xn(u);
|
|
998
|
+
if (r.attrName = l, r.attrValue = d, r.keepAttr = !0, r.forceKeepAttr = void 0, Ze(k.uponSanitizeAttribute, e, r), d = r.attrValue, ge && (l === "id" || l === "name") && bn(d, _e) !== 0 && (Ke(o, e), d = _e + d), le && Dn(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, d)) {
|
|
999
|
+
Ke(o, e);
|
|
1000
1000
|
continue;
|
|
1001
1001
|
}
|
|
1002
|
-
if (l === "attributename" &&
|
|
1003
|
-
|
|
1002
|
+
if (l === "attributename" && vn(d, "href")) {
|
|
1003
|
+
Ke(o, e);
|
|
1004
1004
|
continue;
|
|
1005
1005
|
}
|
|
1006
1006
|
if (r.forceKeepAttr) continue;
|
|
1007
1007
|
if (!r.keepAttr) {
|
|
1008
|
-
|
|
1008
|
+
Ke(o, e);
|
|
1009
1009
|
continue;
|
|
1010
1010
|
}
|
|
1011
|
-
if (!
|
|
1012
|
-
|
|
1011
|
+
if (!H && Dn(/\/>/i, d)) {
|
|
1012
|
+
Ke(o, e);
|
|
1013
1013
|
continue;
|
|
1014
1014
|
}
|
|
1015
|
-
|
|
1015
|
+
ce && un([
|
|
1016
1016
|
A,
|
|
1017
1017
|
j,
|
|
1018
1018
|
M
|
|
1019
1019
|
], (e) => {
|
|
1020
|
-
d =
|
|
1020
|
+
d = yn(d, e, " ");
|
|
1021
1021
|
});
|
|
1022
|
-
let f =
|
|
1023
|
-
if (
|
|
1024
|
-
|
|
1022
|
+
let f = W(e.nodeName);
|
|
1023
|
+
if (!$e(f, l, d)) {
|
|
1024
|
+
Ke(o, e);
|
|
1025
1025
|
continue;
|
|
1026
1026
|
}
|
|
1027
1027
|
if (x && typeof m == "object" && typeof m.getAttributeType == "function" && !s) switch (m.getAttributeType(f, l)) {
|
|
@@ -1033,87 +1033,87 @@ function or() {
|
|
|
1033
1033
|
break;
|
|
1034
1034
|
}
|
|
1035
1035
|
if (d !== u) try {
|
|
1036
|
-
s ? e.setAttributeNS(s, o, d) : e.setAttribute(o, d),
|
|
1036
|
+
s ? e.setAttributeNS(s, o, d) : e.setAttribute(o, d), Ye(e) ? Ge(e) : fn(t.removed);
|
|
1037
1037
|
} catch {
|
|
1038
|
-
|
|
1038
|
+
Ke(o, e);
|
|
1039
1039
|
}
|
|
1040
1040
|
}
|
|
1041
|
-
|
|
1042
|
-
}, nt = function(e) {
|
|
1043
|
-
let t = null, n = qe(e);
|
|
1044
|
-
for (Xe(k.beforeSanitizeShadowDOM, e, null); t = n.nextNode();) Xe(k.uponSanitizeShadowNode, t, null), Ze(t), tt(t), t.content instanceof a && nt(t.content);
|
|
1045
|
-
Xe(k.afterSanitizeShadowDOM, e, null);
|
|
1041
|
+
Ze(k.afterSanitizeAttributes, e, null);
|
|
1046
1042
|
}, rt = function(e) {
|
|
1043
|
+
let t = null, n = Je(e);
|
|
1044
|
+
for (Ze(k.beforeSanitizeShadowDOM, e, null); t = n.nextNode();) Ze(k.uponSanitizeShadowNode, t, null), Qe(t), nt(t), t.content instanceof a && rt(t.content);
|
|
1045
|
+
Ze(k.afterSanitizeShadowDOM, e, null);
|
|
1046
|
+
}, it = function(e) {
|
|
1047
1047
|
if (e.nodeType === nr.element && e.shadowRoot instanceof a) {
|
|
1048
1048
|
let t = e.shadowRoot;
|
|
1049
|
-
|
|
1049
|
+
it(t), rt(t);
|
|
1050
1050
|
}
|
|
1051
1051
|
let t = e.childNodes;
|
|
1052
1052
|
if (!t) return;
|
|
1053
1053
|
let n = [];
|
|
1054
|
-
|
|
1055
|
-
|
|
1054
|
+
un(t, (e) => {
|
|
1055
|
+
pn(n, e);
|
|
1056
1056
|
});
|
|
1057
|
-
for (let e of n)
|
|
1057
|
+
for (let e of n) it(e);
|
|
1058
1058
|
};
|
|
1059
1059
|
return t.sanitize = function(e) {
|
|
1060
1060
|
let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, i = null, o = null, c = null, l = null;
|
|
1061
|
-
if (
|
|
1061
|
+
if (je = !e, je && (e = "<!-->"), typeof e != "string" && !Xe(e) && (e = Mn(e), typeof e != "string")) throw On("dirty is not a string, aborting");
|
|
1062
1062
|
if (!t.isSupported) return e;
|
|
1063
|
-
if (
|
|
1063
|
+
if (ue || He(n), t.removed = [], typeof e == "string" && (ye = !1), ye) {
|
|
1064
1064
|
let t = e.nodeName;
|
|
1065
1065
|
if (typeof t == "string") {
|
|
1066
|
-
let e =
|
|
1067
|
-
if (!
|
|
1066
|
+
let e = W(t);
|
|
1067
|
+
if (!L[e] || re[e]) throw On("root node is forbidden and cannot be sanitized in-place");
|
|
1068
1068
|
}
|
|
1069
|
-
|
|
1070
|
-
} else if (e instanceof s) i =
|
|
1069
|
+
it(e);
|
|
1070
|
+
} else if (e instanceof s) i = qe("<!---->"), o = i.ownerDocument.importNode(e, !0), o.nodeType === nr.element && o.nodeName === "BODY" || o.nodeName === "HTML" ? i = o : i.appendChild(o), it(o);
|
|
1071
1071
|
else {
|
|
1072
|
-
if (!
|
|
1073
|
-
if (i =
|
|
1074
|
-
}
|
|
1075
|
-
i &&
|
|
1076
|
-
let u =
|
|
1077
|
-
for (; c = u.nextNode();)
|
|
1078
|
-
if (
|
|
1079
|
-
if (
|
|
1080
|
-
if (
|
|
1072
|
+
if (!fe && !ce && !U && e.indexOf("<") === -1) return x && me ? x.createHTML(e) : e;
|
|
1073
|
+
if (i = qe(e), !i) return fe ? null : me ? S : "";
|
|
1074
|
+
}
|
|
1075
|
+
i && de && Ge(i.firstChild);
|
|
1076
|
+
let u = Je(ye ? e : i);
|
|
1077
|
+
for (; c = u.nextNode();) Qe(c), nt(c), c.content instanceof a && rt(c.content);
|
|
1078
|
+
if (ye) return e;
|
|
1079
|
+
if (fe) {
|
|
1080
|
+
if (ce) {
|
|
1081
1081
|
i.normalize();
|
|
1082
1082
|
let e = i.innerHTML;
|
|
1083
|
-
|
|
1083
|
+
un([
|
|
1084
1084
|
A,
|
|
1085
1085
|
j,
|
|
1086
1086
|
M
|
|
1087
1087
|
], (t) => {
|
|
1088
|
-
e =
|
|
1088
|
+
e = yn(e, t, " ");
|
|
1089
1089
|
}), i.innerHTML = e;
|
|
1090
1090
|
}
|
|
1091
|
-
if (
|
|
1091
|
+
if (pe) for (l = E.call(i.ownerDocument); i.firstChild;) l.appendChild(i.firstChild);
|
|
1092
1092
|
else l = i;
|
|
1093
1093
|
return (z.shadowroot || z.shadowrootmode) && (l = O.call(r, l, !0)), l;
|
|
1094
1094
|
}
|
|
1095
|
-
let d =
|
|
1096
|
-
return
|
|
1095
|
+
let d = U ? i.outerHTML : i.innerHTML;
|
|
1096
|
+
return U && L["!doctype"] && i.ownerDocument && i.ownerDocument.doctype && i.ownerDocument.doctype.name && Dn(er, i.ownerDocument.doctype.name) && (d = "<!DOCTYPE " + i.ownerDocument.doctype.name + ">\n" + d), ce && un([
|
|
1097
1097
|
A,
|
|
1098
1098
|
j,
|
|
1099
1099
|
M
|
|
1100
1100
|
], (e) => {
|
|
1101
|
-
d =
|
|
1102
|
-
}), x &&
|
|
1101
|
+
d = yn(d, e, " ");
|
|
1102
|
+
}), x && me ? x.createHTML(d) : d;
|
|
1103
1103
|
}, t.setConfig = function() {
|
|
1104
|
-
|
|
1104
|
+
He(arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}), ue = !0;
|
|
1105
1105
|
}, t.clearConfig = function() {
|
|
1106
|
-
|
|
1106
|
+
ze = null, ue = !1;
|
|
1107
1107
|
}, t.isValidAttribute = function(e, t, n) {
|
|
1108
|
-
return
|
|
1108
|
+
return ze || He({}), $e(W(e), W(t), n);
|
|
1109
1109
|
}, t.addHook = function(e, t) {
|
|
1110
|
-
typeof t == "function" &&
|
|
1110
|
+
typeof t == "function" && pn(k[e], t);
|
|
1111
1111
|
}, t.removeHook = function(e, t) {
|
|
1112
1112
|
if (t !== void 0) {
|
|
1113
|
-
let n =
|
|
1114
|
-
return n === -1 ? void 0 :
|
|
1113
|
+
let n = dn(k[e], t);
|
|
1114
|
+
return n === -1 ? void 0 : mn(k[e], n, 1)[0];
|
|
1115
1115
|
}
|
|
1116
|
-
return
|
|
1116
|
+
return fn(k[e]);
|
|
1117
1117
|
}, t.removeHooks = function(e) {
|
|
1118
1118
|
k[e] = [];
|
|
1119
1119
|
}, t.removeAllHooks = function() {
|
|
@@ -1319,12 +1319,12 @@ hr.prototype.parse = function(e, t) {
|
|
|
1319
1319
|
};
|
|
1320
1320
|
//#endregion
|
|
1321
1321
|
//#region node_modules/mdurl/index.mjs
|
|
1322
|
-
var Dr = /* @__PURE__ */
|
|
1322
|
+
var Dr = /* @__PURE__ */ ze({
|
|
1323
1323
|
decode: () => ur,
|
|
1324
1324
|
encode: () => pr,
|
|
1325
1325
|
format: () => mr,
|
|
1326
1326
|
parse: () => Er
|
|
1327
|
-
}), Or = /[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/, kr = /[\0-\x1F\x7F-\x9F]/, Ar = /[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/, jr = /[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/, Mr = /[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/, Nr = /[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/, Pr = /* @__PURE__ */
|
|
1327
|
+
}), Or = /[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/, kr = /[\0-\x1F\x7F-\x9F]/, Ar = /[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/, jr = /[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/, Mr = /[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/, Nr = /[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/, Pr = /* @__PURE__ */ ze({
|
|
1328
1328
|
Any: () => Or,
|
|
1329
1329
|
Cc: () => kr,
|
|
1330
1330
|
Cf: () => Ar,
|
|
@@ -1519,7 +1519,7 @@ function $r(e, t = Jr.Legacy) {
|
|
|
1519
1519
|
}
|
|
1520
1520
|
//#endregion
|
|
1521
1521
|
//#region node_modules/markdown-it/lib/common/utils.mjs
|
|
1522
|
-
var ei = /* @__PURE__ */
|
|
1522
|
+
var ei = /* @__PURE__ */ ze({
|
|
1523
1523
|
arrayReplaceAt: () => oi,
|
|
1524
1524
|
assign: () => ai,
|
|
1525
1525
|
escapeHtml: () => yi,
|
|
@@ -1754,7 +1754,7 @@ function ki(e, t, n, r) {
|
|
|
1754
1754
|
}
|
|
1755
1755
|
//#endregion
|
|
1756
1756
|
//#region node_modules/markdown-it/lib/helpers/index.mjs
|
|
1757
|
-
var Ai = /* @__PURE__ */
|
|
1757
|
+
var Ai = /* @__PURE__ */ ze({
|
|
1758
1758
|
parseLinkDestination: () => Oi,
|
|
1759
1759
|
parseLinkLabel: () => Di,
|
|
1760
1760
|
parseLinkTitle: () => ki
|
|
@@ -3735,7 +3735,7 @@ var hs = new ms({
|
|
|
3735
3735
|
"href",
|
|
3736
3736
|
"target",
|
|
3737
3737
|
"rel",
|
|
3738
|
-
|
|
3738
|
+
Ct,
|
|
3739
3739
|
"class"
|
|
3740
3740
|
], vs = [
|
|
3741
3741
|
"br",
|
|
@@ -3749,8 +3749,8 @@ var hs = new ms({
|
|
|
3749
3749
|
], ys = /<(?:\/)?(?:div|p|li|h[1-6]|blockquote|pre)[^>]*>/gi, bs = /<\/(?:div|p|li|h[1-6]|blockquote|pre)>/gi, xs = /<(?:div|p|li|h[1-6]|blockquote|pre)[^>]*>/gi, Ss = / /gi, Cs = /https?:\/\/[^\s<>()]+[^\s<>().,!?;:]/i, ws = /(^|[\s([{"'`])((?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,}(?:\/[^\s<]*)?)/gi, Ts = /[),.!?;:]+$/;
|
|
3750
3750
|
function Es(e) {
|
|
3751
3751
|
if (!e) return "";
|
|
3752
|
-
let { shielded: t, tokens: n } =
|
|
3753
|
-
return
|
|
3752
|
+
let { shielded: t, tokens: n } = Mt(e), r = t.replace(/\r\n?/g, "\n").replace(xs, "<br>").replace(bs, "").replace(Ss, " ");
|
|
3753
|
+
return Nt(sr.sanitize(r, {
|
|
3754
3754
|
ALLOWED_TAGS: vs,
|
|
3755
3755
|
ALLOWED_ATTR: _s,
|
|
3756
3756
|
ALLOW_DATA_ATTR: !1
|
|
@@ -3758,12 +3758,12 @@ function Es(e) {
|
|
|
3758
3758
|
}
|
|
3759
3759
|
function Ds(e, t) {
|
|
3760
3760
|
if (!e) return "";
|
|
3761
|
-
let n =
|
|
3761
|
+
let n = Ut(At(e), t ?? {}).replace(/<br\s*\/?>/gi, "\n").replace(ys, (e) => e.startsWith("</") ? "\n" : "");
|
|
3762
3762
|
return (new DOMParser().parseFromString(`<div>${n}</div>`, "text/html").body.textContent ?? "").replace(/\u00a0/g, " ").replace(/\n{3,}/g, "\n\n").trim();
|
|
3763
3763
|
}
|
|
3764
3764
|
function Os(e, t) {
|
|
3765
3765
|
if (!e) return "";
|
|
3766
|
-
let n =
|
|
3766
|
+
let n = At(e), r = Es(jt(n) ? It(n, t?.mentionNameByUid ?? {}) : n);
|
|
3767
3767
|
if (!r) return "";
|
|
3768
3768
|
let i = hs.render(Ps(r));
|
|
3769
3769
|
return sr.sanitize(i, {
|
|
@@ -3788,7 +3788,7 @@ function Ms(e) {
|
|
|
3788
3788
|
return e.replace(/\n{2,}/g, (e) => "\n" + "<br>".repeat(e.length - 1));
|
|
3789
3789
|
}
|
|
3790
3790
|
function Ns(e, t) {
|
|
3791
|
-
return e.replace(
|
|
3791
|
+
return e.replace(yt, (e, n) => `<span class="${Tt}">@${(t ?? []).find((e) => e.getUid?.() === n)?.getName?.() ?? n}</span>`);
|
|
3792
3792
|
}
|
|
3793
3793
|
function Ps(e) {
|
|
3794
3794
|
let t = new DOMParser().parseFromString(`<div>${e}</div>`, "text/html"), n = t.body.firstElementChild;
|
|
@@ -3838,23 +3838,23 @@ function Ls(e) {
|
|
|
3838
3838
|
function Rs(e, t) {
|
|
3839
3839
|
if (!e) return t;
|
|
3840
3840
|
switch (e.kind) {
|
|
3841
|
-
case "image": return
|
|
3842
|
-
case "video": return
|
|
3843
|
-
case "audio": return
|
|
3841
|
+
case "image": return vt("photo");
|
|
3842
|
+
case "video": return vt("video");
|
|
3843
|
+
case "audio": return vt("audio");
|
|
3844
3844
|
case "file": return e.name || t;
|
|
3845
3845
|
default: return t;
|
|
3846
3846
|
}
|
|
3847
3847
|
}
|
|
3848
|
-
function zs(e, t =
|
|
3848
|
+
function zs(e, t = vt("attachment")) {
|
|
3849
3849
|
return Rs(e[0], t);
|
|
3850
3850
|
}
|
|
3851
3851
|
function Bs(e, t) {
|
|
3852
|
-
let n =
|
|
3853
|
-
return n ?
|
|
3852
|
+
let n = At(e ?? "");
|
|
3853
|
+
return n ? jt(n) && t ? Es(Ft(n, t)) : Es(n) : "";
|
|
3854
3854
|
}
|
|
3855
3855
|
function Vs(e) {
|
|
3856
3856
|
let t = Es(e);
|
|
3857
|
-
return t ?
|
|
3857
|
+
return t ? Lt(t) : "";
|
|
3858
3858
|
}
|
|
3859
3859
|
function Hs(e) {
|
|
3860
3860
|
return Ds(e).length > 0;
|
|
@@ -3862,26 +3862,26 @@ function Hs(e) {
|
|
|
3862
3862
|
function Us(e, t) {
|
|
3863
3863
|
return Ds(e, t);
|
|
3864
3864
|
}
|
|
3865
|
-
function Ws(e, t =
|
|
3865
|
+
function Ws(e, t = vt("message"), n) {
|
|
3866
3866
|
if (e.kind === "poll" && e.poll) return e.poll.question;
|
|
3867
3867
|
let r = Us(e.text, n);
|
|
3868
3868
|
return e.attachments.length > 0 ? r || zs(e.attachments, t) : r || t;
|
|
3869
3869
|
}
|
|
3870
3870
|
function Gs(e, t = {}) {
|
|
3871
|
-
return
|
|
3871
|
+
return Ut(e, t);
|
|
3872
3872
|
}
|
|
3873
3873
|
function Ks(e) {
|
|
3874
|
-
return e.source?.getText?.() ||
|
|
3874
|
+
return e.source?.getText?.() || At(e.text);
|
|
3875
3875
|
}
|
|
3876
3876
|
function qs(e, t = !1, n = !0) {
|
|
3877
3877
|
if (!e) return "";
|
|
3878
3878
|
if (e.getDeletedAt?.() != null) return "(Message removed)";
|
|
3879
|
-
if (e instanceof
|
|
3880
|
-
if (e instanceof
|
|
3879
|
+
if (e instanceof H.TextMessage) return e.getText?.() ?? "";
|
|
3880
|
+
if (e instanceof H.MediaMessage) {
|
|
3881
3881
|
let r = n ? e.getAttachment?.()?.getName?.() ?? "" : "", i = e.getCaption?.()?.trim?.() ?? "", a = e.getType?.();
|
|
3882
3882
|
return a === "image" ? `${t ? "🖼️ " : ""}${i || "Photo"}` : a === "video" ? `${t ? "🎥 " : ""}${i || r || "Video"}` : a === "audio" ? `${t ? "🎤 " : ""}${r || "Audio message"}` : a === "file" ? `${t ? "📄 " : ""}${i || r || "File"}` : `${t ? "🖼️ " : ""}${i || r || "Media message"}`;
|
|
3883
3883
|
}
|
|
3884
|
-
if (e instanceof
|
|
3884
|
+
if (e instanceof H.Action) {
|
|
3885
3885
|
let t = (e.getActionFor?.()?.getMetadata?.() ?? e.getReceiver?.()?.getMetadata?.() ?? {}).systemDisplayName, n = (e.getActionBy?.())?.getName?.() ?? "", r = e.getMessage?.() ?? "";
|
|
3886
3886
|
return typeof t == "string" && t.trim() && n ? r.replace(n, t.trim()) : r;
|
|
3887
3887
|
}
|
|
@@ -3911,9 +3911,9 @@ function Xs(e) {
|
|
|
3911
3911
|
return Ys(e).join("\n").trim();
|
|
3912
3912
|
}
|
|
3913
3913
|
function Zs(e) {
|
|
3914
|
-
if (e.kind === "poll" && e.poll) return
|
|
3915
|
-
let t =
|
|
3916
|
-
return Ws(e, e.attachments.length > 0 ?
|
|
3914
|
+
if (e.kind === "poll" && e.poll) return vt("pollPrefix", { question: e.poll.question });
|
|
3915
|
+
let t = Vt(e.source);
|
|
3916
|
+
return Ws(e, e.attachments.length > 0 ? vt("sentAnAttachment") : vt("youSentAMessage"), t);
|
|
3917
3917
|
}
|
|
3918
3918
|
//#endregion
|
|
3919
3919
|
//#region src/chat/offlineStore.ts
|
|
@@ -4161,7 +4161,7 @@ function ac(e) {
|
|
|
4161
4161
|
//#region src/chat/client.ts
|
|
4162
4162
|
var oc = null, sc = null;
|
|
4163
4163
|
function cc({ environment: e }) {
|
|
4164
|
-
|
|
4164
|
+
He(e);
|
|
4165
4165
|
let t = w(!1), r = w(!1), i = w(!1), a = w(!1), o = w(!1), s = w(!1), c = w(!1), l = w(!1), u = w(!1), d = w(!1), f = w(!1), p = w(!1), m = w(typeof navigator < "u" ? !navigator.onLine : !1), h = w(!1), g = w(null), _ = w(null), v = w([]), y = w([]), b = w([]), x = w([]), S = w(!1), C = w(!1), T = w(null), E = w(null), D = w(null), O = w(null), k = w([]), A = w({}), j = n(() => k.value.length);
|
|
4166
4166
|
function M(e) {
|
|
4167
4167
|
if (!e.length) return;
|
|
@@ -4170,7 +4170,7 @@ function cc({ environment: e }) {
|
|
|
4170
4170
|
A.value = t;
|
|
4171
4171
|
}
|
|
4172
4172
|
function ee(e) {
|
|
4173
|
-
M(Object.entries(
|
|
4173
|
+
M(Object.entries(Vt(e)).map(([e, t]) => ({
|
|
4174
4174
|
uid: e,
|
|
4175
4175
|
displayName: t
|
|
4176
4176
|
})));
|
|
@@ -4178,131 +4178,131 @@ function cc({ environment: e }) {
|
|
|
4178
4178
|
function N(e, t) {
|
|
4179
4179
|
return ee(e), fc(e, t);
|
|
4180
4180
|
}
|
|
4181
|
-
let P = n(() => v.value.find((e) => e.id === T.value) ?? null), F = `bcc-ui-connection-${crypto.randomUUID()}`, I = `bcc-ui-message-${crypto.randomUUID()}`,
|
|
4182
|
-
async function
|
|
4183
|
-
await lc(e), !t.value && (
|
|
4181
|
+
let P = n(() => v.value.find((e) => e.id === T.value) ?? null), F = `bcc-ui-connection-${crypto.randomUUID()}`, I = `bcc-ui-message-${crypto.randomUUID()}`, te = !1, L = !1, R = null, z = null, ne = null, B = null, re = 0, ie = 0, ae = !1, oe = !1, V = null, se = /* @__PURE__ */ new Map(), ce = /* @__PURE__ */ new Set(), le = null, U = null, ue = 0;
|
|
4182
|
+
async function de() {
|
|
4183
|
+
await lc(e), !t.value && (ge(), ft(), t.value = !0, await ut(), _.value && (dt(_.value.uid), me(), Te(), !m.value && !oe && Ce()));
|
|
4184
4184
|
}
|
|
4185
|
-
async function
|
|
4185
|
+
async function fe(e) {
|
|
4186
4186
|
g.value = null, r.value = !0;
|
|
4187
4187
|
try {
|
|
4188
|
-
await
|
|
4189
|
-
let t =
|
|
4190
|
-
await
|
|
4188
|
+
await de();
|
|
4189
|
+
let t = qe();
|
|
4190
|
+
await H.getLoggedinUser() && t !== e && await H.logout(), Je(e);
|
|
4191
4191
|
let n = await uc(e);
|
|
4192
|
-
_.value = hc(await
|
|
4192
|
+
_.value = hc(await H.login(n)), dt(_.value.uid), h.value = !0, m.value = typeof navigator < "u" ? !navigator.onLine : !1, me(), Te(), oe || await Ce(), await ke(), qt();
|
|
4193
4193
|
} catch (e) {
|
|
4194
|
-
throw
|
|
4194
|
+
throw St(), g.value = Z(e, "Unable to sign in to chat."), e;
|
|
4195
4195
|
} finally {
|
|
4196
4196
|
r.value = !1;
|
|
4197
4197
|
}
|
|
4198
4198
|
}
|
|
4199
|
-
async function
|
|
4199
|
+
async function pe() {
|
|
4200
4200
|
g.value = null;
|
|
4201
4201
|
try {
|
|
4202
|
-
|
|
4202
|
+
Je(null), Qe(), await H.getLoggedinUser() && await H.logout();
|
|
4203
4203
|
} finally {
|
|
4204
|
-
|
|
4204
|
+
St();
|
|
4205
4205
|
}
|
|
4206
4206
|
}
|
|
4207
|
-
function
|
|
4208
|
-
let e =
|
|
4207
|
+
function me() {
|
|
4208
|
+
let e = lt();
|
|
4209
4209
|
if (!e) {
|
|
4210
|
-
|
|
4210
|
+
V = null, k.value = [];
|
|
4211
4211
|
return;
|
|
4212
4212
|
}
|
|
4213
|
-
let t = `bcc-chat:${
|
|
4214
|
-
|
|
4213
|
+
let t = `bcc-chat:${G().appId}:${e}`;
|
|
4214
|
+
he(t), V = new $s(t), k.value = V.getQueue();
|
|
4215
4215
|
}
|
|
4216
|
-
function
|
|
4216
|
+
function he(e) {
|
|
4217
4217
|
if (typeof window > "u") return;
|
|
4218
|
-
let t = `bcc-chat:${
|
|
4218
|
+
let t = `bcc-chat:${G().appId}:`, n = [];
|
|
4219
4219
|
for (let r = 0; r < window.localStorage.length; r += 1) {
|
|
4220
4220
|
let i = window.localStorage.key(r);
|
|
4221
4221
|
i && i.startsWith(t) && i !== e && n.push(i);
|
|
4222
4222
|
}
|
|
4223
4223
|
n.forEach((e) => window.localStorage.removeItem(e));
|
|
4224
4224
|
}
|
|
4225
|
-
function he() {
|
|
4226
|
-
R || typeof window > "u" || (window.addEventListener("online", ge), window.addEventListener("offline", _e), R = !0);
|
|
4227
|
-
}
|
|
4228
4225
|
function ge() {
|
|
4229
|
-
|
|
4226
|
+
L || typeof window > "u" || (window.addEventListener("online", _e), window.addEventListener("offline", ve), L = !0);
|
|
4230
4227
|
}
|
|
4231
4228
|
function _e() {
|
|
4232
|
-
m.value = !
|
|
4229
|
+
m.value = !1, ae = !0, oe || Se(!0);
|
|
4233
4230
|
}
|
|
4234
4231
|
function ve() {
|
|
4235
|
-
|
|
4232
|
+
m.value = !0, p.value = !1, ye();
|
|
4236
4233
|
}
|
|
4237
4234
|
function ye() {
|
|
4238
|
-
|
|
4235
|
+
R !== null && (clearTimeout(R), R = null);
|
|
4239
4236
|
}
|
|
4240
4237
|
function be() {
|
|
4238
|
+
re = Date.now() + 1500;
|
|
4239
|
+
}
|
|
4240
|
+
function xe() {
|
|
4241
4241
|
return Date.now() < re;
|
|
4242
4242
|
}
|
|
4243
|
-
function
|
|
4244
|
-
if (
|
|
4243
|
+
function Se(e = !1) {
|
|
4244
|
+
if (R !== null || z || m.value || !h.value || oe) return;
|
|
4245
4245
|
let t = e ? 0 : Math.min(3e4, 1e3 * 2 ** Math.min(ie, 4));
|
|
4246
|
-
|
|
4247
|
-
|
|
4246
|
+
R = setTimeout(() => {
|
|
4247
|
+
R = null, Ce();
|
|
4248
4248
|
}, t);
|
|
4249
4249
|
}
|
|
4250
|
-
async function
|
|
4251
|
-
if (!(m.value || !h.value ||
|
|
4252
|
-
|
|
4250
|
+
async function Ce() {
|
|
4251
|
+
if (!(m.value || !h.value || oe)) return z || (z = (async () => {
|
|
4252
|
+
ye();
|
|
4253
4253
|
try {
|
|
4254
|
-
let e = await
|
|
4254
|
+
let e = await H.getLoggedinUser();
|
|
4255
4255
|
if (!e) {
|
|
4256
|
-
let t =
|
|
4256
|
+
let t = qe();
|
|
4257
4257
|
if (!t) return;
|
|
4258
4258
|
let n = await uc(t);
|
|
4259
|
-
e = await
|
|
4259
|
+
e = await H.login(n);
|
|
4260
4260
|
}
|
|
4261
|
-
_.value = hc(e), h.value = !0,
|
|
4262
|
-
let t =
|
|
4263
|
-
typeof t == "function" && (await t.call(
|
|
4261
|
+
_.value = hc(e), h.value = !0, me();
|
|
4262
|
+
let t = H.connect;
|
|
4263
|
+
typeof t == "function" && (await t.call(H), p.value = !0), ie = 0, ae && await we();
|
|
4264
4264
|
} catch (e) {
|
|
4265
|
-
p.value = !1, ie += 1,
|
|
4265
|
+
p.value = !1, ie += 1, Lt(e) || (g.value = Z(e, "Unable to reconnect to chat.")), Se();
|
|
4266
4266
|
} finally {
|
|
4267
4267
|
z = null;
|
|
4268
4268
|
}
|
|
4269
4269
|
})(), z);
|
|
4270
4270
|
}
|
|
4271
|
-
async function
|
|
4272
|
-
return ne || m.value || !h.value ||
|
|
4273
|
-
|
|
4271
|
+
async function we() {
|
|
4272
|
+
return ne || m.value || !h.value || oe || (ne = (async () => {
|
|
4273
|
+
ae = !1, g.value = null;
|
|
4274
4274
|
try {
|
|
4275
|
-
await
|
|
4275
|
+
await ke(), qt();
|
|
4276
4276
|
} finally {
|
|
4277
4277
|
ne = null;
|
|
4278
4278
|
}
|
|
4279
4279
|
})()), ne;
|
|
4280
4280
|
}
|
|
4281
|
-
function
|
|
4282
|
-
if (!
|
|
4283
|
-
let e =
|
|
4284
|
-
e.length !== 0 && (v.value = bc(e), !T.value && v.value.length > 0 &&
|
|
4281
|
+
function Te() {
|
|
4282
|
+
if (!V || v.value.length > 0) return;
|
|
4283
|
+
let e = V.getConversations();
|
|
4284
|
+
e.length !== 0 && (v.value = bc(e), !T.value && v.value.length > 0 && Ee(T.value));
|
|
4285
4285
|
}
|
|
4286
|
-
function
|
|
4287
|
-
if (!
|
|
4288
|
-
let t =
|
|
4286
|
+
function Ee(e) {
|
|
4287
|
+
if (!V || !e) return y.value = [], !1;
|
|
4288
|
+
let t = V.getMessages(e).sort(xc);
|
|
4289
4289
|
return y.value = t, t.length > 0;
|
|
4290
4290
|
}
|
|
4291
|
-
async function Ee() {
|
|
4292
|
-
ae = !1, V = !0, await Se();
|
|
4293
|
-
}
|
|
4294
4291
|
async function De() {
|
|
4295
|
-
|
|
4296
|
-
let e = U.disconnect;
|
|
4297
|
-
typeof e == "function" && await e.call(U), p.value = !1;
|
|
4292
|
+
oe = !1, ae = !0, await Ce();
|
|
4298
4293
|
}
|
|
4299
4294
|
async function Oe() {
|
|
4300
|
-
|
|
4301
|
-
|
|
4295
|
+
oe = !0, ae = !1, ye();
|
|
4296
|
+
let e = H.disconnect;
|
|
4297
|
+
typeof e == "function" && await e.call(H), p.value = !1;
|
|
4298
|
+
}
|
|
4299
|
+
async function ke() {
|
|
4300
|
+
if (await de(), i.value = !0, g.value = null, m.value && V) {
|
|
4301
|
+
v.value = bc(V.getConversations()), P.value && await rt(), i.value = !1;
|
|
4302
4302
|
return;
|
|
4303
4303
|
}
|
|
4304
4304
|
try {
|
|
4305
|
-
let e = new
|
|
4305
|
+
let e = new H.ConversationsRequestBuilder().setLimit(50).withTags(!0).setConversationType(H.RECEIVER_TYPE.GROUP).build(), t = [], n = [];
|
|
4306
4306
|
do
|
|
4307
4307
|
n = await e.fetchNext(), t.push(...n.map((e) => dc(e, _.value?.uid)));
|
|
4308
4308
|
while (n.length === 50);
|
|
@@ -4311,9 +4311,9 @@ function cc({ environment: e }) {
|
|
|
4311
4311
|
let t = r.get(e.id);
|
|
4312
4312
|
t && (e.subtitle === "No messages yet" && t.subtitle && t.subtitle !== "No messages yet" && (e.subtitle = t.subtitle), !e.lastMessageAt && t.lastMessageAt && (e.lastMessageAt = t.lastMessageAt), !e.lastMessage && t.lastMessage && (e.lastMessage = t.lastMessage));
|
|
4313
4313
|
}
|
|
4314
|
-
v.value = bc(await
|
|
4314
|
+
v.value = bc(await mt(t)), V?.setConversations(v.value), P.value && await rt();
|
|
4315
4315
|
} catch (e) {
|
|
4316
|
-
let t =
|
|
4316
|
+
let t = V?.getConversations() ?? [];
|
|
4317
4317
|
if (t.length > 0) {
|
|
4318
4318
|
v.value = bc(t);
|
|
4319
4319
|
return;
|
|
@@ -4323,39 +4323,39 @@ function cc({ environment: e }) {
|
|
|
4323
4323
|
i.value = !1;
|
|
4324
4324
|
}
|
|
4325
4325
|
}
|
|
4326
|
-
async function
|
|
4327
|
-
T.value = e, E.value = null, b.value = [],
|
|
4326
|
+
async function Ae(e) {
|
|
4327
|
+
T.value = e, E.value = null, b.value = [], U = null, C.value = !1, D.value = null, O.value = null, Ee(e), await rt();
|
|
4328
4328
|
}
|
|
4329
|
-
function
|
|
4329
|
+
function je(e) {
|
|
4330
4330
|
e && (O.value = null), D.value = e;
|
|
4331
4331
|
}
|
|
4332
|
-
function
|
|
4332
|
+
function Me(e) {
|
|
4333
4333
|
e && (D.value = null), O.value = e;
|
|
4334
4334
|
}
|
|
4335
|
-
async function
|
|
4336
|
-
E.value = e,
|
|
4335
|
+
async function Ne(e) {
|
|
4336
|
+
E.value = e, U = null, C.value = !1, D.value = null, O.value = null, await at(e.id);
|
|
4337
4337
|
}
|
|
4338
|
-
function
|
|
4339
|
-
E.value = null, b.value = [],
|
|
4338
|
+
function Pe() {
|
|
4339
|
+
E.value = null, b.value = [], U = null, C.value = !1, D.value = null, O.value = null;
|
|
4340
4340
|
}
|
|
4341
|
-
async function
|
|
4341
|
+
async function Fe(e, t) {
|
|
4342
4342
|
if (u.value) return;
|
|
4343
4343
|
let n = P.value;
|
|
4344
4344
|
if (!n) return;
|
|
4345
4345
|
let r = Vs(e);
|
|
4346
4346
|
if (!Hs(r)) return;
|
|
4347
4347
|
if (O.value) {
|
|
4348
|
-
await
|
|
4348
|
+
await Ie(O.value, r);
|
|
4349
4349
|
return;
|
|
4350
4350
|
}
|
|
4351
|
-
let i = E.value?.id, a = crypto.randomUUID(), o = Dc(
|
|
4351
|
+
let i = E.value?.id, a = crypto.randomUUID(), o = Dc(Ft(D.value, t), a);
|
|
4352
4352
|
u.value = !0, g.value = null;
|
|
4353
4353
|
try {
|
|
4354
4354
|
if (m.value) {
|
|
4355
|
-
|
|
4355
|
+
Rt(n, r, o, i, a), D.value = null;
|
|
4356
4356
|
return;
|
|
4357
4357
|
}
|
|
4358
|
-
|
|
4358
|
+
Wt(Pt({
|
|
4359
4359
|
conversation: n,
|
|
4360
4360
|
kind: "text",
|
|
4361
4361
|
text: r,
|
|
@@ -4364,21 +4364,21 @@ function cc({ environment: e }) {
|
|
|
4364
4364
|
muid: a,
|
|
4365
4365
|
deliveryState: "sending"
|
|
4366
4366
|
}));
|
|
4367
|
-
let e = new
|
|
4367
|
+
let e = new H.TextMessage(n.targetId, r, kc(n));
|
|
4368
4368
|
e.setMuid?.(a), Object.keys(o).length > 0 && e.setMetadata?.(o), i && e.setParentMessageId?.(Number(i));
|
|
4369
|
-
let t = await
|
|
4370
|
-
|
|
4369
|
+
let t = await H.sendMessage(e);
|
|
4370
|
+
wt(N(t, _.value?.uid)), gt(t), await yt(t), D.value = null;
|
|
4371
4371
|
} catch (e) {
|
|
4372
|
-
if (
|
|
4373
|
-
|
|
4372
|
+
if (Lt(e)) {
|
|
4373
|
+
Gt("queued", a), Rt(n, r, o, E.value?.id, a), D.value = null;
|
|
4374
4374
|
return;
|
|
4375
4375
|
}
|
|
4376
|
-
throw
|
|
4376
|
+
throw Gt("failed", a), g.value = Z(e, "Unable to send the message."), e;
|
|
4377
4377
|
} finally {
|
|
4378
4378
|
u.value = !1;
|
|
4379
4379
|
}
|
|
4380
4380
|
}
|
|
4381
|
-
async function
|
|
4381
|
+
async function Ie(e, t) {
|
|
4382
4382
|
let n = P.value;
|
|
4383
4383
|
if (!n || m.value) return;
|
|
4384
4384
|
let r = Vs(t);
|
|
@@ -4386,9 +4386,9 @@ function cc({ environment: e }) {
|
|
|
4386
4386
|
u.value = !0, g.value = null;
|
|
4387
4387
|
try {
|
|
4388
4388
|
let t;
|
|
4389
|
-
e.kind === "text" ? t = new
|
|
4390
|
-
let i = await
|
|
4391
|
-
|
|
4389
|
+
e.kind === "text" ? t = new H.TextMessage(n.targetId, r, kc(n)) : (t = new H.MediaMessage(n.targetId, e.source?.getAttachment?.()?.getFileUrl?.() ?? e.source?.getAttachment?.()?.getUrl?.() ?? e.attachments[0]?.url ?? "", e.source?.getType?.() ?? e.type ?? e.kind, kc(n)), t.setCaption(r)), t.setId(Number(e.id));
|
|
4390
|
+
let i = await H.editMessage(t);
|
|
4391
|
+
wt(N(i, _.value?.uid)), gt(i), O.value = null;
|
|
4392
4392
|
} catch (e) {
|
|
4393
4393
|
throw g.value = Z(e, "Unable to edit the message."), e;
|
|
4394
4394
|
} finally {
|
|
@@ -4396,18 +4396,18 @@ function cc({ environment: e }) {
|
|
|
4396
4396
|
}
|
|
4397
4397
|
}
|
|
4398
4398
|
}
|
|
4399
|
-
async function
|
|
4399
|
+
async function Le(e, t) {
|
|
4400
4400
|
if (u.value) return;
|
|
4401
4401
|
let n = P.value;
|
|
4402
4402
|
if (!n) return;
|
|
4403
|
-
let r = E.value?.id, i = crypto.randomUUID(), a = Dc(
|
|
4403
|
+
let r = E.value?.id, i = crypto.randomUUID(), a = Dc(Ft(D.value, t), i), o = Nc(e.file);
|
|
4404
4404
|
u.value = !0, g.value = null;
|
|
4405
4405
|
try {
|
|
4406
4406
|
if (m.value) {
|
|
4407
|
-
await
|
|
4407
|
+
await Ht(n, e, a, r, i), D.value = null;
|
|
4408
4408
|
return;
|
|
4409
4409
|
}
|
|
4410
|
-
|
|
4410
|
+
Wt(Pt({
|
|
4411
4411
|
conversation: n,
|
|
4412
4412
|
kind: o,
|
|
4413
4413
|
text: e.caption?.trim() ?? "",
|
|
@@ -4422,37 +4422,37 @@ function cc({ environment: e }) {
|
|
|
4422
4422
|
muid: i,
|
|
4423
4423
|
deliveryState: "sending"
|
|
4424
4424
|
}));
|
|
4425
|
-
let t = new
|
|
4425
|
+
let t = new H.MediaMessage(n.targetId, e.file, o, kc(n));
|
|
4426
4426
|
t.setMuid?.(i), Object.keys(a).length > 0 && t.setMetadata?.(a), r && t.setParentMessageId?.(Number(r)), e.caption?.trim() && t.setCaption?.(e.caption.trim());
|
|
4427
|
-
let s = await
|
|
4428
|
-
|
|
4427
|
+
let s = await H.sendMediaMessage(t);
|
|
4428
|
+
wt(N(s, _.value?.uid)), gt(s), await yt(s), D.value = null;
|
|
4429
4429
|
} catch (t) {
|
|
4430
|
-
if (
|
|
4431
|
-
|
|
4430
|
+
if (Lt(t)) {
|
|
4431
|
+
Gt("queued", i), await Ht(n, e, a, r, i), D.value = null;
|
|
4432
4432
|
return;
|
|
4433
4433
|
}
|
|
4434
|
-
throw
|
|
4434
|
+
throw Gt("failed", i), g.value = Z(t, "Unable to send the attachment."), t;
|
|
4435
4435
|
} finally {
|
|
4436
4436
|
u.value = !1;
|
|
4437
4437
|
}
|
|
4438
4438
|
}
|
|
4439
|
-
async function
|
|
4439
|
+
async function Re(e, t) {
|
|
4440
4440
|
if (u.value) return;
|
|
4441
4441
|
let n = P.value;
|
|
4442
4442
|
if (!n) return;
|
|
4443
4443
|
let r = e.question.trim(), i = e.options.map((e) => e.trim()).filter(Boolean);
|
|
4444
4444
|
if (!r || i.length < 2) return;
|
|
4445
|
-
let a = E.value?.id, o = crypto.randomUUID(), s = Dc(
|
|
4445
|
+
let a = E.value?.id, o = crypto.randomUUID(), s = Dc(Ft(D.value, t), o);
|
|
4446
4446
|
u.value = !0, g.value = null;
|
|
4447
4447
|
try {
|
|
4448
4448
|
if (m.value) {
|
|
4449
|
-
|
|
4449
|
+
zt(n, {
|
|
4450
4450
|
question: r,
|
|
4451
4451
|
options: i
|
|
4452
4452
|
}, s, a, o), D.value = null;
|
|
4453
4453
|
return;
|
|
4454
4454
|
}
|
|
4455
|
-
|
|
4455
|
+
Wt(Pt({
|
|
4456
4456
|
conversation: n,
|
|
4457
4457
|
kind: "poll",
|
|
4458
4458
|
text: `Poll: ${r}`,
|
|
@@ -4469,41 +4469,41 @@ function cc({ environment: e }) {
|
|
|
4469
4469
|
question: r,
|
|
4470
4470
|
options: i,
|
|
4471
4471
|
receiver: n.targetId,
|
|
4472
|
-
receiverType: n.type === "group" ?
|
|
4472
|
+
receiverType: n.type === "group" ? H.RECEIVER_TYPE.GROUP : H.RECEIVER_TYPE.USER
|
|
4473
4473
|
};
|
|
4474
4474
|
a && (e.parentMessageId = Number(a)), Object.keys(s).length > 0 && (e.metadata = s);
|
|
4475
|
-
let t = await
|
|
4476
|
-
c ? (
|
|
4475
|
+
let t = await H.callExtension("polls", "POST", "v2/create", e), c = t?.message ?? t?.custom_message ?? t?.data?.message ?? null;
|
|
4476
|
+
c ? (Kt(o), wt(N(c, _.value?.uid)), gt(c), await yt(c)) : (Kt(o), await Ct()), D.value = null;
|
|
4477
4477
|
} catch (e) {
|
|
4478
|
-
if (
|
|
4479
|
-
|
|
4478
|
+
if (Lt(e)) {
|
|
4479
|
+
Gt("queued", o), zt(n, {
|
|
4480
4480
|
question: r,
|
|
4481
4481
|
options: i
|
|
4482
4482
|
}, s, a, o), D.value = null;
|
|
4483
4483
|
return;
|
|
4484
4484
|
}
|
|
4485
|
-
throw
|
|
4485
|
+
throw Gt("failed", o), g.value = Z(e, "Unable to send the poll."), e;
|
|
4486
4486
|
} finally {
|
|
4487
4487
|
u.value = !1;
|
|
4488
4488
|
}
|
|
4489
4489
|
}
|
|
4490
|
-
async function
|
|
4490
|
+
async function W(e, t) {
|
|
4491
4491
|
let n = e.poll?.id ?? e.id, r = _.value?.uid;
|
|
4492
4492
|
if (!n || !t || m.value) return;
|
|
4493
|
-
let i =
|
|
4493
|
+
let i = Et(e.id, e.parentMessageId) ?? e;
|
|
4494
4494
|
if (i.poll && !i.poll.options.some((e) => e.id === t && e.voters.includes(r ?? ""))) {
|
|
4495
|
-
g.value = null, r &&
|
|
4495
|
+
g.value = null, r && wt(ze(i, t, r));
|
|
4496
4496
|
try {
|
|
4497
|
-
await
|
|
4497
|
+
await H.callExtension("polls", "POST", "v2/vote", {
|
|
4498
4498
|
id: n,
|
|
4499
4499
|
vote: t
|
|
4500
4500
|
});
|
|
4501
4501
|
} catch (e) {
|
|
4502
|
-
throw
|
|
4502
|
+
throw wt(i), g.value = Z(e, "Unable to cast the vote."), e;
|
|
4503
4503
|
}
|
|
4504
4504
|
}
|
|
4505
4505
|
}
|
|
4506
|
-
function
|
|
4506
|
+
function ze(e, t, n) {
|
|
4507
4507
|
if (!e.poll) return e;
|
|
4508
4508
|
let r = e.poll, i = r.allowsMultipleAnswers, a = r.options.filter((e) => e.voters.includes(n)).map((e) => e.id), o = !i && a.length > 0, s = r.options.map((e) => o && e.voters.includes(n) && e.id !== t ? {
|
|
4509
4509
|
...e,
|
|
@@ -4523,80 +4523,80 @@ function cc({ environment: e }) {
|
|
|
4523
4523
|
}
|
|
4524
4524
|
};
|
|
4525
4525
|
}
|
|
4526
|
-
async function
|
|
4526
|
+
async function Be(e, t) {
|
|
4527
4527
|
g.value = null;
|
|
4528
|
-
let n =
|
|
4529
|
-
|
|
4528
|
+
let n = Et(e.id, e.parentMessageId) ?? e, r = n.reactions.find((e) => e.emoji === t && e.reactedByMe);
|
|
4529
|
+
wt(Dt(n, t));
|
|
4530
4530
|
try {
|
|
4531
|
-
|
|
4531
|
+
wt(N(r ? await H.removeReaction(Number(e.id), t) : await H.addReaction(Number(e.id), t), _.value?.uid));
|
|
4532
4532
|
} catch (e) {
|
|
4533
|
-
throw
|
|
4533
|
+
throw wt(n), g.value = Z(e, "Unable to update the reaction."), e;
|
|
4534
4534
|
}
|
|
4535
4535
|
}
|
|
4536
|
-
async function
|
|
4536
|
+
async function Ve(e) {
|
|
4537
4537
|
if (g.value = null, e.deliveryState === "queued" || e.deliveryState === "failed") {
|
|
4538
|
-
|
|
4538
|
+
At(e);
|
|
4539
4539
|
return;
|
|
4540
4540
|
}
|
|
4541
4541
|
if (!m.value) try {
|
|
4542
|
-
let t = N(await
|
|
4543
|
-
|
|
4542
|
+
let t = N(await H.deleteMessage(String(e.id)), _.value?.uid);
|
|
4543
|
+
At(t), jt(t);
|
|
4544
4544
|
} catch (e) {
|
|
4545
4545
|
throw g.value = Z(e, "Unable to delete the message."), e;
|
|
4546
4546
|
}
|
|
4547
4547
|
}
|
|
4548
|
-
async function
|
|
4548
|
+
async function Ue(e) {
|
|
4549
4549
|
let t = e.source?.getText?.() ?? e.text;
|
|
4550
4550
|
if (Hs(t)) {
|
|
4551
4551
|
g.value = null;
|
|
4552
4552
|
try {
|
|
4553
|
-
let n = (await
|
|
4553
|
+
let n = (await H.callExtension("message-translation", "POST", "v2/translate", {
|
|
4554
4554
|
msgId: Number(e.id),
|
|
4555
4555
|
text: t,
|
|
4556
4556
|
languages: typeof navigator < "u" ? navigator.languages : ["en"]
|
|
4557
4557
|
})).translations?.[0]?.message_translated?.trim();
|
|
4558
4558
|
if (!n) return;
|
|
4559
|
-
|
|
4559
|
+
Tt({
|
|
4560
4560
|
...e,
|
|
4561
4561
|
translatedText: n,
|
|
4562
4562
|
metadata: {
|
|
4563
4563
|
...e.metadata ?? {},
|
|
4564
4564
|
translated_message: n
|
|
4565
4565
|
}
|
|
4566
|
-
}),
|
|
4566
|
+
}), kt();
|
|
4567
4567
|
} catch (e) {
|
|
4568
4568
|
throw g.value = Z(e, "Unable to translate the message."), e;
|
|
4569
4569
|
}
|
|
4570
4570
|
}
|
|
4571
4571
|
}
|
|
4572
|
-
async function
|
|
4573
|
-
let t = e ?? P.value?.targetId, n = _.value?.uid, r = ++
|
|
4572
|
+
async function We(e) {
|
|
4573
|
+
let t = e ?? P.value?.targetId, n = _.value?.uid, r = ++ue;
|
|
4574
4574
|
if (!t || !n) {
|
|
4575
|
-
r ===
|
|
4575
|
+
r === ue && (x.value = []);
|
|
4576
4576
|
return;
|
|
4577
4577
|
}
|
|
4578
4578
|
l.value = !0, g.value = null;
|
|
4579
4579
|
try {
|
|
4580
|
-
let e = new
|
|
4580
|
+
let e = new H.MessagesRequestBuilder().setLimit(50).setGUID(n).withTags(!0).setTags([t]).build(), i = [], a = [];
|
|
4581
4581
|
do
|
|
4582
4582
|
a = await e.fetchPrevious(), i.push(...a.map((e) => N(e, _.value?.uid)));
|
|
4583
4583
|
while (a.length === 50);
|
|
4584
4584
|
let o = i.filter((e) => !(e.isDeleted || !e.scheduled?.scheduleDate || t && e.scheduled.originalChatUid && e.scheduled.originalChatUid !== t)).sort((e, t) => (e.scheduled?.scheduleDate?.getTime() ?? e.sentAt.getTime()) - (t.scheduled?.scheduleDate?.getTime() ?? t.sentAt.getTime()));
|
|
4585
|
-
if (r !==
|
|
4585
|
+
if (r !== ue) return;
|
|
4586
4586
|
x.value = o;
|
|
4587
4587
|
} catch (e) {
|
|
4588
|
-
if (r !==
|
|
4589
|
-
throw g.value = Z(e,
|
|
4588
|
+
if (r !== ue) return;
|
|
4589
|
+
throw g.value = Z(e, vt("loadScheduledMessagesError")), e;
|
|
4590
4590
|
} finally {
|
|
4591
|
-
r ===
|
|
4591
|
+
r === ue && (l.value = !1);
|
|
4592
4592
|
}
|
|
4593
4593
|
}
|
|
4594
|
-
async function
|
|
4594
|
+
async function Ge(e, t) {
|
|
4595
4595
|
let n = P.value;
|
|
4596
4596
|
if (n) {
|
|
4597
4597
|
d.value = !0, g.value = null;
|
|
4598
4598
|
try {
|
|
4599
|
-
e.file ? await Mc(n, e, t) : await jc(n, e, t), await
|
|
4599
|
+
e.file ? await Mc(n, e, t) : await jc(n, e, t), await We(n.targetId);
|
|
4600
4600
|
} catch (e) {
|
|
4601
4601
|
throw g.value = Z(e, "Unable to schedule the message."), e;
|
|
4602
4602
|
} finally {
|
|
@@ -4604,16 +4604,16 @@ function cc({ environment: e }) {
|
|
|
4604
4604
|
}
|
|
4605
4605
|
}
|
|
4606
4606
|
}
|
|
4607
|
-
async function
|
|
4607
|
+
async function Ke(e) {
|
|
4608
4608
|
if (g.value = null, !e.scheduled) return;
|
|
4609
4609
|
let t = e.scheduled.originalChatUid;
|
|
4610
4610
|
try {
|
|
4611
|
-
await
|
|
4611
|
+
await H.deleteMessage(String(e.id)), x.value = x.value.filter((t) => t.id !== e.id), await We(t);
|
|
4612
4612
|
} catch (e) {
|
|
4613
4613
|
throw g.value = Z(e, "Unable to remove the scheduled message."), e;
|
|
4614
4614
|
}
|
|
4615
4615
|
}
|
|
4616
|
-
async function
|
|
4616
|
+
async function Ye(e, t) {
|
|
4617
4617
|
g.value = null;
|
|
4618
4618
|
let n = _.value?.uid;
|
|
4619
4619
|
if (!n || !e.scheduled?.muid || e.kind === "poll") return;
|
|
@@ -4623,22 +4623,22 @@ function cc({ environment: e }) {
|
|
|
4623
4623
|
!i.scheduleDate && e.scheduled?.scheduleDate && (i.scheduleDate = e.scheduled.scheduleDate.toISOString()), !i.originalChatUid && e.scheduled?.originalChatUid && (i.originalChatUid = e.scheduled.originalChatUid), d.value = !0;
|
|
4624
4624
|
try {
|
|
4625
4625
|
let t;
|
|
4626
|
-
if (e.kind === "text") t = new
|
|
4626
|
+
if (e.kind === "text") t = new H.TextMessage(n, r, H.RECEIVER_TYPE.GROUP);
|
|
4627
4627
|
else {
|
|
4628
4628
|
let i = e.source?.getAttachment?.()?.getFileUrl?.() ?? e.source?.getAttachment?.()?.getUrl?.() ?? e.attachments[0]?.url ?? "";
|
|
4629
|
-
t = new
|
|
4629
|
+
t = new H.MediaMessage(n, i, e.source?.getType?.() ?? e.type ?? e.kind, H.RECEIVER_TYPE.GROUP), t.setCaption(r);
|
|
4630
4630
|
}
|
|
4631
|
-
Object.keys(i).length > 0 && t.setMetadata(i), t.setId(Number(e.id)), await
|
|
4631
|
+
Object.keys(i).length > 0 && t.setMetadata(i), t.setId(Number(e.id)), await H.editMessage(t), await We(e.scheduled.originalChatUid);
|
|
4632
4632
|
} catch (e) {
|
|
4633
4633
|
throw g.value = Z(e, "Unable to edit the scheduled message."), e;
|
|
4634
4634
|
} finally {
|
|
4635
4635
|
d.value = !1;
|
|
4636
4636
|
}
|
|
4637
4637
|
}
|
|
4638
|
-
async function
|
|
4638
|
+
async function Xe(e) {
|
|
4639
4639
|
d.value = !0, g.value = null;
|
|
4640
4640
|
try {
|
|
4641
|
-
let t = Ac(), n = await fetch(`${
|
|
4641
|
+
let t = Ac(), n = await fetch(`${G().chatApiBaseUrl}/chats/rescheduleMessage`, {
|
|
4642
4642
|
method: "POST",
|
|
4643
4643
|
headers: {
|
|
4644
4644
|
"Content-Type": "application/json",
|
|
@@ -4652,23 +4652,23 @@ function cc({ environment: e }) {
|
|
|
4652
4652
|
})
|
|
4653
4653
|
});
|
|
4654
4654
|
if (!n.ok) throw Error(`Reschedule failed with status ${n.status}.`);
|
|
4655
|
-
await
|
|
4655
|
+
await We(e.originalChatUid);
|
|
4656
4656
|
} catch (e) {
|
|
4657
4657
|
throw g.value = Z(e, "Unable to reschedule the message."), e;
|
|
4658
4658
|
} finally {
|
|
4659
4659
|
d.value = !1;
|
|
4660
4660
|
}
|
|
4661
4661
|
}
|
|
4662
|
-
function
|
|
4663
|
-
let t = new
|
|
4662
|
+
function Ze(e) {
|
|
4663
|
+
let t = new H.MessagesRequestBuilder().setLimit(50).hideReplies(!0).hideDeletedMessages(!0);
|
|
4664
4664
|
return e.type === "group" ? t.setGUID(e.targetId) : t.setUID(e.targetId), t.build();
|
|
4665
4665
|
}
|
|
4666
|
-
function
|
|
4667
|
-
return new
|
|
4666
|
+
function $e(e) {
|
|
4667
|
+
return new H.MessagesRequestBuilder().setLimit(50).setParentMessageId(Number(e)).hideDeletedMessages(!0).build();
|
|
4668
4668
|
}
|
|
4669
|
-
async function
|
|
4669
|
+
async function et(e) {
|
|
4670
4670
|
if (!e.isOwn || e.receipts.readAt) return e;
|
|
4671
|
-
let t = `bcc-chat:${
|
|
4671
|
+
let t = `bcc-chat:${G().appId}:message_${e.id}_receiptStatus`;
|
|
4672
4672
|
try {
|
|
4673
4673
|
let n = localStorage.getItem(t);
|
|
4674
4674
|
if (n) {
|
|
@@ -4676,7 +4676,7 @@ function cc({ environment: e }) {
|
|
|
4676
4676
|
if (!Number.isNaN(r.getTime()) && !Number.isNaN(i.getTime())) return e.receipts.readAt = r, e.receipts.deliveredAt = i, e;
|
|
4677
4677
|
}
|
|
4678
4678
|
} catch {}
|
|
4679
|
-
let n = await
|
|
4679
|
+
let n = await xt(e);
|
|
4680
4680
|
for (let t of n) t.kind === "read" && t.timestamp && (!e.receipts.readAt || t.timestamp > e.receipts.readAt) && (e.receipts.readAt = t.timestamp), t.kind === "delivered" && t.timestamp && (!e.receipts.deliveredAt || t.timestamp > e.receipts.deliveredAt) && (e.receipts.deliveredAt = t.timestamp);
|
|
4681
4681
|
if (e.receipts.readAt) try {
|
|
4682
4682
|
localStorage.setItem(t, JSON.stringify({
|
|
@@ -4686,37 +4686,45 @@ function cc({ environment: e }) {
|
|
|
4686
4686
|
} catch {}
|
|
4687
4687
|
return e;
|
|
4688
4688
|
}
|
|
4689
|
-
async function
|
|
4689
|
+
async function tt(e) {
|
|
4690
|
+
try {
|
|
4691
|
+
return await e.fetchPrevious();
|
|
4692
|
+
} catch (e) {
|
|
4693
|
+
if (e && typeof e == "object" && "code" in e && e.code === "ERR_GROUP_NOT_JOINED") return [];
|
|
4694
|
+
throw e;
|
|
4695
|
+
}
|
|
4696
|
+
}
|
|
4697
|
+
async function nt(e) {
|
|
4690
4698
|
let t = P.value;
|
|
4691
4699
|
if (!t) return y.value = [], S.value = !1, !1;
|
|
4692
|
-
if ((e?.reset ||
|
|
4700
|
+
if ((e?.reset || le?.conversationId !== t.id) && (le = {
|
|
4693
4701
|
conversationId: t.id,
|
|
4694
|
-
request:
|
|
4695
|
-
}, S.value = !0), !
|
|
4696
|
-
let n = await
|
|
4697
|
-
y.value = e?.reset ? Cc(y.value.filter((e) => e.conversationId === t.id && wc(e)), r) : Cc(y.value, r), S.value = n.length === 50,
|
|
4702
|
+
request: Ze(t)
|
|
4703
|
+
}, S.value = !0), !le) return !1;
|
|
4704
|
+
let n = await tt(le.request), r = await Promise.all(n.map((e) => N(e, _.value?.uid)).filter(Tc).sort(xc).map(et));
|
|
4705
|
+
y.value = e?.reset ? Cc(y.value.filter((e) => e.conversationId === t.id && wc(e)), r) : Cc(y.value, r), S.value = n.length === 50, V?.setMessages(t.id, y.value);
|
|
4698
4706
|
let i = n[n.length - 1];
|
|
4699
|
-
return i && (await
|
|
4707
|
+
return i && (await bt(i), await yt(i)), n.length > 0;
|
|
4700
4708
|
}
|
|
4701
|
-
async function
|
|
4709
|
+
async function rt() {
|
|
4702
4710
|
let e = P.value;
|
|
4703
4711
|
if (!e) {
|
|
4704
|
-
y.value = [], S.value = !1,
|
|
4712
|
+
y.value = [], S.value = !1, le = null;
|
|
4705
4713
|
return;
|
|
4706
4714
|
}
|
|
4707
|
-
let t =
|
|
4708
|
-
if (a.value = !0, m.value &&
|
|
4709
|
-
S.value = !1,
|
|
4715
|
+
let t = Ee(e.id);
|
|
4716
|
+
if (a.value = !0, m.value && V) {
|
|
4717
|
+
S.value = !1, le = null, a.value = !1;
|
|
4710
4718
|
return;
|
|
4711
4719
|
}
|
|
4712
4720
|
try {
|
|
4713
|
-
await
|
|
4721
|
+
await nt({ reset: !0 }), v.value = v.value.map((t) => t.id === e.id ? {
|
|
4714
4722
|
...t,
|
|
4715
4723
|
lastMessage: y.value.at(-1) ?? null,
|
|
4716
4724
|
unreadCount: 0
|
|
4717
|
-
} : t),
|
|
4725
|
+
} : t), V?.setConversations(v.value);
|
|
4718
4726
|
} catch (n) {
|
|
4719
|
-
let r =
|
|
4727
|
+
let r = V?.getMessages(e.id) ?? [];
|
|
4720
4728
|
if (r.length > 0) {
|
|
4721
4729
|
t || (y.value = r.sort(xc));
|
|
4722
4730
|
return;
|
|
@@ -4726,27 +4734,27 @@ function cc({ environment: e }) {
|
|
|
4726
4734
|
a.value = !1;
|
|
4727
4735
|
}
|
|
4728
4736
|
}
|
|
4729
|
-
async function
|
|
4737
|
+
async function it(e) {
|
|
4730
4738
|
let t = E.value?.id;
|
|
4731
4739
|
if (!t) return b.value = [], C.value = !1, !1;
|
|
4732
|
-
if ((e?.reset ||
|
|
4740
|
+
if ((e?.reset || U?.parentMessageId !== t) && (U = {
|
|
4733
4741
|
parentMessageId: t,
|
|
4734
|
-
request:
|
|
4735
|
-
}, C.value = !0), !
|
|
4736
|
-
let n = await
|
|
4737
|
-
b.value = e?.reset ? Cc(b.value.filter((e) => e.parentMessageId === t && wc(e)), r) : Cc(b.value, r), C.value = n.length === 50,
|
|
4742
|
+
request: $e(t)
|
|
4743
|
+
}, C.value = !0), !U) return !1;
|
|
4744
|
+
let n = await U.request.fetchPrevious(), r = await Promise.all(n.map((e) => N(e, _.value?.uid)).filter(Tc).sort(xc).map(et));
|
|
4745
|
+
b.value = e?.reset ? Cc(b.value.filter((e) => e.parentMessageId === t && wc(e)), r) : Cc(b.value, r), C.value = n.length === 50, V?.setThreadMessages(t, b.value);
|
|
4738
4746
|
let i = n[n.length - 1];
|
|
4739
|
-
return i && (await
|
|
4747
|
+
return i && (await bt(i), await yt(i)), n.length > 0;
|
|
4740
4748
|
}
|
|
4741
|
-
async function
|
|
4742
|
-
if (o.value = !0, m.value &&
|
|
4743
|
-
b.value =
|
|
4749
|
+
async function at(e) {
|
|
4750
|
+
if (o.value = !0, m.value && V) {
|
|
4751
|
+
b.value = V.getThreadMessages(e).sort(xc), C.value = !1, U = null, o.value = !1;
|
|
4744
4752
|
return;
|
|
4745
4753
|
}
|
|
4746
4754
|
try {
|
|
4747
|
-
await
|
|
4755
|
+
await it({ reset: !0 });
|
|
4748
4756
|
} catch (t) {
|
|
4749
|
-
let n =
|
|
4757
|
+
let n = V?.getThreadMessages(e) ?? [];
|
|
4750
4758
|
if (n.length > 0) {
|
|
4751
4759
|
b.value = n.sort(xc);
|
|
4752
4760
|
return;
|
|
@@ -4756,29 +4764,29 @@ function cc({ environment: e }) {
|
|
|
4756
4764
|
o.value = !1;
|
|
4757
4765
|
}
|
|
4758
4766
|
}
|
|
4759
|
-
async function
|
|
4767
|
+
async function ot() {
|
|
4760
4768
|
if (a.value || s.value || !S.value) return !1;
|
|
4761
4769
|
s.value = !0, g.value = null;
|
|
4762
4770
|
try {
|
|
4763
|
-
return await
|
|
4771
|
+
return await nt();
|
|
4764
4772
|
} catch (e) {
|
|
4765
4773
|
throw g.value = Z(e, "Unable to load messages."), e;
|
|
4766
4774
|
} finally {
|
|
4767
4775
|
s.value = !1;
|
|
4768
4776
|
}
|
|
4769
4777
|
}
|
|
4770
|
-
async function
|
|
4778
|
+
async function st() {
|
|
4771
4779
|
if (o.value || c.value || !C.value) return !1;
|
|
4772
4780
|
c.value = !0, g.value = null;
|
|
4773
4781
|
try {
|
|
4774
|
-
return await
|
|
4782
|
+
return await it();
|
|
4775
4783
|
} catch (e) {
|
|
4776
4784
|
throw g.value = Z(e, "Unable to load thread."), e;
|
|
4777
4785
|
} finally {
|
|
4778
4786
|
c.value = !1;
|
|
4779
4787
|
}
|
|
4780
4788
|
}
|
|
4781
|
-
async function
|
|
4789
|
+
async function ct(e) {
|
|
4782
4790
|
let t = e.trim();
|
|
4783
4791
|
if (!t) return !1;
|
|
4784
4792
|
let n = () => y.value.some((e) => e.id === t) || b.value.some((e) => e.id === t) || E.value?.id === t;
|
|
@@ -4786,101 +4794,101 @@ function cc({ environment: e }) {
|
|
|
4786
4794
|
let r = 0;
|
|
4787
4795
|
for (; C.value && E.value && r < 100;) {
|
|
4788
4796
|
r += 1;
|
|
4789
|
-
let e = await
|
|
4797
|
+
let e = await st();
|
|
4790
4798
|
if (n()) return !0;
|
|
4791
4799
|
if (!e) break;
|
|
4792
4800
|
}
|
|
4793
4801
|
for (; S.value && P.value && r < 100;) {
|
|
4794
4802
|
r += 1;
|
|
4795
|
-
let e = await
|
|
4803
|
+
let e = await ot();
|
|
4796
4804
|
if (n()) return !0;
|
|
4797
4805
|
if (!e) break;
|
|
4798
4806
|
}
|
|
4799
4807
|
return n();
|
|
4800
4808
|
}
|
|
4801
|
-
async function
|
|
4802
|
-
let e = await
|
|
4809
|
+
async function ut() {
|
|
4810
|
+
let e = await H.getLoggedinUser();
|
|
4803
4811
|
_.value = e ? hc(e) : null, h.value = !!e;
|
|
4804
4812
|
}
|
|
4805
|
-
function
|
|
4806
|
-
|
|
4813
|
+
function ft() {
|
|
4814
|
+
te ||= (H.addConnectionListener(F, new H.ConnectionListener({
|
|
4807
4815
|
onConnected: () => {
|
|
4808
|
-
if (p.value = !0, ie = 0,
|
|
4809
|
-
|
|
4816
|
+
if (p.value = !0, ie = 0, ye(), ae) {
|
|
4817
|
+
we();
|
|
4810
4818
|
return;
|
|
4811
4819
|
}
|
|
4812
|
-
|
|
4820
|
+
qt();
|
|
4813
4821
|
},
|
|
4814
4822
|
onDisconnected: () => {
|
|
4815
|
-
p.value = !1, !m.value && h.value && !
|
|
4823
|
+
p.value = !1, !m.value && h.value && !oe && (ae = !0, Se(!0));
|
|
4816
4824
|
}
|
|
4817
|
-
})),
|
|
4825
|
+
})), H.addMessageListener(I, new H.MessageListener({
|
|
4818
4826
|
onTextMessageReceived: (e) => {
|
|
4819
|
-
|
|
4827
|
+
pt(e);
|
|
4820
4828
|
},
|
|
4821
4829
|
onMediaMessageReceived: (e) => {
|
|
4822
|
-
|
|
4830
|
+
pt(e);
|
|
4823
4831
|
},
|
|
4824
4832
|
onCustomMessageReceived: (e) => {
|
|
4825
|
-
|
|
4833
|
+
pt(e);
|
|
4826
4834
|
},
|
|
4827
4835
|
onMessagesDelivered: () => {
|
|
4828
|
-
|
|
4836
|
+
xe() || Ct({ includeThread: !1 });
|
|
4829
4837
|
},
|
|
4830
4838
|
onMessagesRead: () => {
|
|
4831
|
-
|
|
4839
|
+
xe() || Ct({ includeThread: !1 });
|
|
4832
4840
|
},
|
|
4833
4841
|
onMessageEdited: (e) => {
|
|
4834
4842
|
let t = N(e, _.value?.uid);
|
|
4835
|
-
Tc(t) && (
|
|
4843
|
+
Tc(t) && (_t(t), gt(e));
|
|
4836
4844
|
},
|
|
4837
4845
|
onMessageDeleted: (e) => {
|
|
4838
4846
|
let t = N(e, _.value?.uid);
|
|
4839
|
-
t.parentMessageId ?
|
|
4847
|
+
t.parentMessageId ? At(t) : (At(t), jt(t)), kt();
|
|
4840
4848
|
},
|
|
4841
4849
|
onMessageReactionAdded: () => {
|
|
4842
|
-
|
|
4850
|
+
Ct();
|
|
4843
4851
|
},
|
|
4844
4852
|
onMessageReactionRemoved: () => {
|
|
4845
|
-
|
|
4853
|
+
Ct();
|
|
4846
4854
|
},
|
|
4847
4855
|
onMessagesDeliveredToAll: () => {
|
|
4848
|
-
|
|
4856
|
+
xe() || Ct({ includeThread: !1 });
|
|
4849
4857
|
},
|
|
4850
4858
|
onMessagesReadByAll: () => {
|
|
4851
|
-
|
|
4859
|
+
xe() || Ct({ includeThread: !1 });
|
|
4852
4860
|
}
|
|
4853
4861
|
})), !0);
|
|
4854
4862
|
}
|
|
4855
|
-
async function
|
|
4863
|
+
async function pt(e) {
|
|
4856
4864
|
let t = N(e, _.value?.uid);
|
|
4857
4865
|
if (Tc(t)) {
|
|
4858
|
-
if (
|
|
4859
|
-
|
|
4866
|
+
if (gt(e), await bt(e), t.parentMessageId) {
|
|
4867
|
+
K(t), Ot(t.parentMessageId), kt();
|
|
4860
4868
|
return;
|
|
4861
4869
|
}
|
|
4862
|
-
t.conversationId === T.value && (
|
|
4870
|
+
t.conversationId === T.value && (_t(t), kt(), await yt(e));
|
|
4863
4871
|
}
|
|
4864
4872
|
}
|
|
4865
|
-
async function
|
|
4873
|
+
async function mt(e) {
|
|
4866
4874
|
return await Promise.all(e.map(async (e) => {
|
|
4867
|
-
let t = await
|
|
4875
|
+
let t = await ht(e.targetId);
|
|
4868
4876
|
return {
|
|
4869
4877
|
...e,
|
|
4870
4878
|
muteSettings: t ? new Date(t) : null
|
|
4871
4879
|
};
|
|
4872
4880
|
}));
|
|
4873
4881
|
}
|
|
4874
|
-
async function
|
|
4875
|
-
let t =
|
|
4882
|
+
async function ht(e) {
|
|
4883
|
+
let t = V?.getParticipantSettings(e), n = t?.lastUpdated ? Date.now() - t.lastUpdated > 1440 * 60 * 1e3 : !0;
|
|
4876
4884
|
if (t && (m.value || !n)) return t.mutedUntil;
|
|
4877
4885
|
if (m.value || !h.value) return t?.mutedUntil ?? null;
|
|
4878
4886
|
try {
|
|
4879
|
-
let n = (await
|
|
4887
|
+
let n = (await H.getLoggedinUser())?.getUid?.();
|
|
4880
4888
|
if (!n || e === n) return t?.mutedUntil ?? null;
|
|
4881
|
-
let r =
|
|
4889
|
+
let r = qe();
|
|
4882
4890
|
if (!r) return t?.mutedUntil ?? null;
|
|
4883
|
-
let i = await fetch(`${
|
|
4891
|
+
let i = await fetch(`${G().chatApiBaseUrl}/chats/${e}/settings/${n}`, {
|
|
4884
4892
|
method: "GET",
|
|
4885
4893
|
headers: {
|
|
4886
4894
|
"Content-Type": "application/json",
|
|
@@ -4889,7 +4897,7 @@ function cc({ environment: e }) {
|
|
|
4889
4897
|
});
|
|
4890
4898
|
if (!i.ok) return t?.mutedUntil ?? null;
|
|
4891
4899
|
let a = await i.json();
|
|
4892
|
-
return
|
|
4900
|
+
return V?.storeParticipantSettings({
|
|
4893
4901
|
chatUid: e,
|
|
4894
4902
|
mutedUntil: a.mutedUntil ?? null,
|
|
4895
4903
|
lastUpdated: Date.now()
|
|
@@ -4898,12 +4906,12 @@ function cc({ environment: e }) {
|
|
|
4898
4906
|
return t?.mutedUntil ?? null;
|
|
4899
4907
|
}
|
|
4900
4908
|
}
|
|
4901
|
-
function
|
|
4909
|
+
function gt(e) {
|
|
4902
4910
|
let t = N(e, _.value?.uid);
|
|
4903
4911
|
if (!Tc(t) || t.isDeleted) return;
|
|
4904
4912
|
let n = e.getConversationId(), r = v.value.find((e) => e.id === n);
|
|
4905
4913
|
if (!r) {
|
|
4906
|
-
|
|
4914
|
+
ke();
|
|
4907
4915
|
return;
|
|
4908
4916
|
}
|
|
4909
4917
|
let i = {
|
|
@@ -4913,35 +4921,35 @@ function cc({ environment: e }) {
|
|
|
4913
4921
|
unreadCount: n === T.value ? 0 : r.unreadCount + 1,
|
|
4914
4922
|
lastMessage: t
|
|
4915
4923
|
};
|
|
4916
|
-
v.value = bc(v.value.map((e) => e.id === n ? i : e)),
|
|
4924
|
+
v.value = bc(v.value.map((e) => e.id === n ? i : e)), V?.setConversations(v.value);
|
|
4917
4925
|
}
|
|
4918
|
-
function
|
|
4919
|
-
y.value = Sc(y.value, e), T.value &&
|
|
4926
|
+
function _t(e) {
|
|
4927
|
+
y.value = Sc(y.value, e), T.value && V?.setMessages(T.value, y.value);
|
|
4920
4928
|
}
|
|
4921
|
-
function
|
|
4922
|
-
e.parentMessageId === E.value?.id && (b.value = Sc(b.value, e), e.parentMessageId &&
|
|
4929
|
+
function K(e) {
|
|
4930
|
+
e.parentMessageId === E.value?.id && (b.value = Sc(b.value, e), e.parentMessageId && V?.setThreadMessages(e.parentMessageId, b.value));
|
|
4923
4931
|
}
|
|
4924
|
-
async function
|
|
4932
|
+
async function yt(e) {
|
|
4925
4933
|
if (m.value) return;
|
|
4926
4934
|
let t = e.getSender?.()?.getUid?.();
|
|
4927
|
-
!t || t === _.value?.uid || e.getReadByMeAt?.() || (
|
|
4935
|
+
!t || t === _.value?.uid || e.getReadByMeAt?.() || (be(), await H.markAsRead(e));
|
|
4928
4936
|
}
|
|
4929
|
-
async function
|
|
4937
|
+
async function bt(e) {
|
|
4930
4938
|
if (m.value) return;
|
|
4931
4939
|
let t = e.getSender?.()?.getUid?.();
|
|
4932
|
-
!t || t === _.value?.uid || e.getDeliveredToMeAt?.() || (
|
|
4940
|
+
!t || t === _.value?.uid || e.getDeliveredToMeAt?.() || (be(), await H.markAsDelivered(e));
|
|
4933
4941
|
}
|
|
4934
|
-
async function
|
|
4935
|
-
return m.value ? [] : pc(await
|
|
4942
|
+
async function xt(e) {
|
|
4943
|
+
return m.value ? [] : pc(await H.getMessageReceipts(String(e.id)));
|
|
4936
4944
|
}
|
|
4937
|
-
function
|
|
4938
|
-
r.value = !1, i.value = !1, a.value = !1, o.value = !1, s.value = !1, c.value = !1, l.value = !1, u.value = !1, d.value = !1, f.value = !1, p.value = !1,
|
|
4945
|
+
function St() {
|
|
4946
|
+
r.value = !1, i.value = !1, a.value = !1, o.value = !1, s.value = !1, c.value = !1, l.value = !1, u.value = !1, d.value = !1, f.value = !1, p.value = !1, ye(), ie = 0, ae = !1, oe = !1, h.value = !1, _.value = null, v.value = [], y.value = [], b.value = [], x.value = [], E.value = null, D.value = null, O.value = null, k.value = [], T.value = null, S.value = !1, C.value = !1, le = null, U = null, ce.clear();
|
|
4939
4947
|
}
|
|
4940
|
-
async function
|
|
4948
|
+
async function Ct(e) {
|
|
4941
4949
|
if (B) return B;
|
|
4942
4950
|
let t = e?.includeThread ?? !0;
|
|
4943
4951
|
B = (async () => {
|
|
4944
|
-
P.value && await
|
|
4952
|
+
P.value && await rt(), t && E.value && await at(E.value.id);
|
|
4945
4953
|
})();
|
|
4946
4954
|
try {
|
|
4947
4955
|
await B;
|
|
@@ -4949,20 +4957,20 @@ function cc({ environment: e }) {
|
|
|
4949
4957
|
B = null;
|
|
4950
4958
|
}
|
|
4951
4959
|
}
|
|
4952
|
-
function
|
|
4953
|
-
|
|
4960
|
+
function wt(e) {
|
|
4961
|
+
Tt(e), e.parentMessageId && Ot(e.parentMessageId, e.replyCount), kt();
|
|
4954
4962
|
}
|
|
4955
|
-
function
|
|
4963
|
+
function Tt(e) {
|
|
4956
4964
|
if (e.parentMessageId) {
|
|
4957
4965
|
E.value?.id === e.parentMessageId && (b.value = Sc(b.value, e));
|
|
4958
4966
|
return;
|
|
4959
4967
|
}
|
|
4960
4968
|
y.value = Sc(y.value, e), E.value?.id === e.id && (E.value = e);
|
|
4961
4969
|
}
|
|
4962
|
-
function
|
|
4970
|
+
function Et(e, t) {
|
|
4963
4971
|
return t ? b.value.find((t) => t.id === e) ?? null : E.value?.id === e ? E.value : y.value.find((t) => t.id === e) ?? null;
|
|
4964
4972
|
}
|
|
4965
|
-
function
|
|
4973
|
+
function Dt(e, t) {
|
|
4966
4974
|
let n = e.reactions.find((e) => e.emoji === t);
|
|
4967
4975
|
return n ? n.reactedByMe && n.count === 1 ? {
|
|
4968
4976
|
...e,
|
|
@@ -4983,7 +4991,7 @@ function cc({ environment: e }) {
|
|
|
4983
4991
|
}]
|
|
4984
4992
|
};
|
|
4985
4993
|
}
|
|
4986
|
-
function
|
|
4994
|
+
function Ot(e, t) {
|
|
4987
4995
|
let n = y.value.find((t) => t.id === e);
|
|
4988
4996
|
if (!n) return;
|
|
4989
4997
|
let r = {
|
|
@@ -4992,18 +5000,18 @@ function cc({ environment: e }) {
|
|
|
4992
5000
|
};
|
|
4993
5001
|
y.value = Sc(y.value, r), E.value?.id === e && (E.value = r);
|
|
4994
5002
|
}
|
|
4995
|
-
function
|
|
4996
|
-
T.value &&
|
|
5003
|
+
function kt() {
|
|
5004
|
+
T.value && V?.setMessages(T.value, y.value), E.value && V?.setThreadMessages(E.value.id, b.value);
|
|
4997
5005
|
}
|
|
4998
|
-
function
|
|
4999
|
-
if (e.parentMessageId ? (b.value = b.value.filter((t) => t.id !== e.id),
|
|
5006
|
+
function At(e) {
|
|
5007
|
+
if (e.parentMessageId ? (b.value = b.value.filter((t) => t.id !== e.id), V?.setThreadMessages(e.parentMessageId, b.value)) : (y.value = y.value.filter((t) => t.id !== e.id), T.value && V?.setMessages(T.value, y.value)), e.muid) {
|
|
5000
5008
|
k.value = k.value.filter((t) => t.muid !== e.muid);
|
|
5001
|
-
let t =
|
|
5002
|
-
for (let e of t)
|
|
5009
|
+
let t = V?.getQueue().filter((t) => t.muid === e.muid) ?? [];
|
|
5010
|
+
for (let e of t) V?.dequeue(e.id), se.delete(e.id), e.kind === "attachment" && V?.deleteQueuedAttachment(e.id);
|
|
5003
5011
|
}
|
|
5004
|
-
e.parentMessageId ||
|
|
5012
|
+
e.parentMessageId || Mt(e.conversationId);
|
|
5005
5013
|
}
|
|
5006
|
-
function
|
|
5014
|
+
function jt(e) {
|
|
5007
5015
|
if (e.parentMessageId) return;
|
|
5008
5016
|
let t = e.conversationId, n = v.value.find((e) => e.id === t);
|
|
5009
5017
|
if (!n) return;
|
|
@@ -5026,28 +5034,28 @@ function cc({ environment: e }) {
|
|
|
5026
5034
|
...e,
|
|
5027
5035
|
subtitle: "No messages yet",
|
|
5028
5036
|
lastMessageAt: void 0
|
|
5029
|
-
} : e : e)),
|
|
5037
|
+
} : e : e)), V?.setConversations(v.value);
|
|
5030
5038
|
}
|
|
5031
|
-
function
|
|
5039
|
+
function Mt(e, t) {
|
|
5032
5040
|
let n = y.value.length > 0 ? y.value[y.value.length - 1] : null, r = t ?? n;
|
|
5033
5041
|
v.value = bc(v.value.map((t) => t.id === e ? {
|
|
5034
5042
|
...t,
|
|
5035
5043
|
subtitle: r ? Oc(r) : "No messages yet",
|
|
5036
5044
|
lastMessageAt: r?.sentAt,
|
|
5037
5045
|
lastMessage: r
|
|
5038
|
-
} : t)),
|
|
5046
|
+
} : t)), V?.setConversations(v.value);
|
|
5039
5047
|
}
|
|
5040
|
-
function
|
|
5048
|
+
function Nt(e) {
|
|
5041
5049
|
v.value = bc(v.value.map((t) => t.id === e.conversationId ? {
|
|
5042
5050
|
...t,
|
|
5043
5051
|
subtitle: Oc(e),
|
|
5044
5052
|
lastMessageAt: e.sentAt,
|
|
5045
5053
|
lastMessage: e,
|
|
5046
5054
|
unreadCount: 0
|
|
5047
|
-
} : t)),
|
|
5055
|
+
} : t)), V?.setConversations(v.value);
|
|
5048
5056
|
}
|
|
5049
|
-
function
|
|
5050
|
-
let t = /* @__PURE__ */ new Date(), n =
|
|
5057
|
+
function Pt(e) {
|
|
5058
|
+
let t = /* @__PURE__ */ new Date(), n = It(e.metadata);
|
|
5051
5059
|
return {
|
|
5052
5060
|
id: `local-${e.muid}`,
|
|
5053
5061
|
muid: e.muid,
|
|
@@ -5086,11 +5094,11 @@ function cc({ environment: e }) {
|
|
|
5086
5094
|
source: null
|
|
5087
5095
|
};
|
|
5088
5096
|
}
|
|
5089
|
-
function
|
|
5097
|
+
function Ft(e, t) {
|
|
5090
5098
|
let n = {};
|
|
5091
5099
|
return t?.senderDisplayName?.trim() && (n.senderDisplayName = t.senderDisplayName.trim()), e ? (n.replyToMessageId = e.id, n.replyPreview = Js(e), n) : n;
|
|
5092
5100
|
}
|
|
5093
|
-
function
|
|
5101
|
+
function It(e) {
|
|
5094
5102
|
let t = e.replyPreview;
|
|
5095
5103
|
if (!t || typeof t != "object") return;
|
|
5096
5104
|
let n = t;
|
|
@@ -5101,13 +5109,13 @@ function cc({ environment: e }) {
|
|
|
5101
5109
|
kind: n.kind ?? "text"
|
|
5102
5110
|
};
|
|
5103
5111
|
}
|
|
5104
|
-
function
|
|
5112
|
+
function Lt(e) {
|
|
5105
5113
|
if (typeof navigator < "u" && !navigator.onLine) return !0;
|
|
5106
5114
|
let t = Z(e, "").toLowerCase();
|
|
5107
5115
|
return t.includes("network") || t.includes("failed to fetch") || t.includes("socket") || t.includes("offline");
|
|
5108
5116
|
}
|
|
5109
|
-
function
|
|
5110
|
-
let a =
|
|
5117
|
+
function Rt(e, t, n, r, i) {
|
|
5118
|
+
let a = Pt({
|
|
5111
5119
|
conversation: e,
|
|
5112
5120
|
kind: "text",
|
|
5113
5121
|
text: t,
|
|
@@ -5116,7 +5124,7 @@ function cc({ environment: e }) {
|
|
|
5116
5124
|
muid: i,
|
|
5117
5125
|
deliveryState: "queued"
|
|
5118
5126
|
});
|
|
5119
|
-
|
|
5127
|
+
Ut(a, {
|
|
5120
5128
|
id: a.id,
|
|
5121
5129
|
muid: i,
|
|
5122
5130
|
conversationId: e.id,
|
|
@@ -5129,9 +5137,9 @@ function cc({ environment: e }) {
|
|
|
5129
5137
|
createdAt: a.sentAt.toISOString()
|
|
5130
5138
|
});
|
|
5131
5139
|
}
|
|
5132
|
-
function
|
|
5133
|
-
if (
|
|
5134
|
-
let a =
|
|
5140
|
+
function zt(e, t, n, r, i) {
|
|
5141
|
+
if (Bt(e, t, r)) return;
|
|
5142
|
+
let a = Pt({
|
|
5135
5143
|
conversation: e,
|
|
5136
5144
|
kind: "poll",
|
|
5137
5145
|
text: `Poll: ${t.question}`,
|
|
@@ -5141,7 +5149,7 @@ function cc({ environment: e }) {
|
|
|
5141
5149
|
muid: i,
|
|
5142
5150
|
deliveryState: "queued"
|
|
5143
5151
|
});
|
|
5144
|
-
|
|
5152
|
+
Ut(a, {
|
|
5145
5153
|
id: a.id,
|
|
5146
5154
|
muid: i,
|
|
5147
5155
|
conversationId: e.id,
|
|
@@ -5154,7 +5162,7 @@ function cc({ environment: e }) {
|
|
|
5154
5162
|
createdAt: a.sentAt.toISOString()
|
|
5155
5163
|
});
|
|
5156
5164
|
}
|
|
5157
|
-
function
|
|
5165
|
+
function Bt(e, t, n) {
|
|
5158
5166
|
let r = Date.now(), i = (e) => e.trim().toLowerCase(), a = (e) => e.map((e) => i(e)).filter(Boolean).join("\0"), o = i(t.question), s = a(t.options);
|
|
5159
5167
|
return k.value.some((t) => {
|
|
5160
5168
|
if (t.kind !== "poll" || !t.poll || t.conversationId !== e.id || t.targetId !== e.targetId || t.parentMessageId !== n) return !1;
|
|
@@ -5162,8 +5170,8 @@ function cc({ environment: e }) {
|
|
|
5162
5170
|
return Number.isNaN(c) || r - c > 5e3 ? !1 : i(t.poll.question) === o && a(t.poll.options) === s;
|
|
5163
5171
|
});
|
|
5164
5172
|
}
|
|
5165
|
-
async function
|
|
5166
|
-
let a = Nc(t.file), o =
|
|
5173
|
+
async function Ht(e, t, n, r, i) {
|
|
5174
|
+
let a = Nc(t.file), o = Pt({
|
|
5167
5175
|
conversation: e,
|
|
5168
5176
|
kind: a,
|
|
5169
5177
|
text: t.caption?.trim() ?? "",
|
|
@@ -5195,19 +5203,19 @@ function cc({ environment: e }) {
|
|
|
5195
5203
|
parentMessageId: r,
|
|
5196
5204
|
createdAt: o.sentAt.toISOString()
|
|
5197
5205
|
};
|
|
5198
|
-
|
|
5206
|
+
se.set(s.id, t.file);
|
|
5199
5207
|
try {
|
|
5200
|
-
await
|
|
5208
|
+
await V?.storeQueuedAttachment(s.id, t.file);
|
|
5201
5209
|
} catch {}
|
|
5202
|
-
|
|
5210
|
+
Ut(o, s);
|
|
5203
5211
|
}
|
|
5204
|
-
function
|
|
5205
|
-
k.value = [...k.value, t],
|
|
5212
|
+
function Ut(e, t) {
|
|
5213
|
+
k.value = [...k.value, t], V?.enqueue(t), Wt(e);
|
|
5206
5214
|
}
|
|
5207
|
-
function
|
|
5208
|
-
e.parentMessageId ? (E.value?.id === e.parentMessageId && (b.value = Sc(b.value, e)),
|
|
5215
|
+
function Wt(e) {
|
|
5216
|
+
e.parentMessageId ? (E.value?.id === e.parentMessageId && (b.value = Sc(b.value, e)), Ot(e.parentMessageId)) : y.value = Sc(y.value, e), Nt(e), kt();
|
|
5209
5217
|
}
|
|
5210
|
-
function
|
|
5218
|
+
function Gt(e, t) {
|
|
5211
5219
|
let n = (n) => n.map((n) => {
|
|
5212
5220
|
let r = Ec(n);
|
|
5213
5221
|
return n.muid !== t && r !== t ? n : {
|
|
@@ -5215,40 +5223,40 @@ function cc({ environment: e }) {
|
|
|
5215
5223
|
deliveryState: e
|
|
5216
5224
|
};
|
|
5217
5225
|
});
|
|
5218
|
-
y.value = n(y.value), b.value = n(b.value),
|
|
5226
|
+
y.value = n(y.value), b.value = n(b.value), kt();
|
|
5219
5227
|
}
|
|
5220
|
-
function
|
|
5228
|
+
function Kt(e) {
|
|
5221
5229
|
if (!e) return;
|
|
5222
5230
|
let t = [...y.value, ...b.value].filter((t) => {
|
|
5223
5231
|
if (!t.id.startsWith("local-")) return !1;
|
|
5224
5232
|
let n = Ec(t);
|
|
5225
5233
|
return t.muid === e || n === e;
|
|
5226
5234
|
});
|
|
5227
|
-
for (let e of t)
|
|
5235
|
+
for (let e of t) At(e);
|
|
5228
5236
|
}
|
|
5229
|
-
async function
|
|
5237
|
+
async function qt() {
|
|
5230
5238
|
if (!(f.value || k.value.length === 0 || !h.value || m.value)) {
|
|
5231
5239
|
f.value = !0;
|
|
5232
5240
|
try {
|
|
5233
|
-
let e = [...k.value].filter((e) => !
|
|
5234
|
-
for (let t of e) if (!
|
|
5235
|
-
|
|
5241
|
+
let e = [...k.value].filter((e) => !ce.has(e.id)).sort((e, t) => e.createdAt.localeCompare(t.createdAt));
|
|
5242
|
+
for (let t of e) if (!ce.has(t.id)) {
|
|
5243
|
+
ce.add(t.id);
|
|
5236
5244
|
try {
|
|
5237
|
-
let e = await
|
|
5238
|
-
k.value = k.value.filter((e) => e.id !== t.id),
|
|
5245
|
+
let e = await Jt(t);
|
|
5246
|
+
k.value = k.value.filter((e) => e.id !== t.id), V?.dequeue(t.id), se.delete(t.id), t.kind === "attachment" && await V?.deleteQueuedAttachment(t.id), Kt(t.muid), e ? wt(N(e, _.value?.uid)) : await Ct();
|
|
5239
5247
|
} finally {
|
|
5240
|
-
|
|
5248
|
+
ce.delete(t.id);
|
|
5241
5249
|
}
|
|
5242
5250
|
}
|
|
5243
5251
|
} catch (e) {
|
|
5244
|
-
|
|
5252
|
+
Lt(e) || (g.value = Z(e, "Unable to sync queued messages."));
|
|
5245
5253
|
} finally {
|
|
5246
5254
|
f.value = !1;
|
|
5247
5255
|
}
|
|
5248
5256
|
}
|
|
5249
5257
|
}
|
|
5250
|
-
async function
|
|
5251
|
-
let t = e.receiverType === "group" ?
|
|
5258
|
+
async function Jt(e) {
|
|
5259
|
+
let t = e.receiverType === "group" ? H.RECEIVER_TYPE.GROUP : H.RECEIVER_TYPE.USER;
|
|
5252
5260
|
if (e.kind === "poll" && e.poll) {
|
|
5253
5261
|
let n = {
|
|
5254
5262
|
question: e.poll.question,
|
|
@@ -5257,17 +5265,17 @@ function cc({ environment: e }) {
|
|
|
5257
5265
|
receiverType: t
|
|
5258
5266
|
};
|
|
5259
5267
|
e.parentMessageId && (n.parentMessageId = Number(e.parentMessageId)), e.metadata && Object.keys(e.metadata).length > 0 && (n.metadata = e.metadata);
|
|
5260
|
-
let r = await
|
|
5268
|
+
let r = await H.callExtension("polls", "POST", "v2/create", n);
|
|
5261
5269
|
return r?.message ?? r?.custom_message ?? r?.data?.message ?? null;
|
|
5262
5270
|
}
|
|
5263
5271
|
if (e.kind === "attachment" && e.attachment) {
|
|
5264
|
-
let n =
|
|
5272
|
+
let n = se.get(e.id) ?? await V?.getQueuedAttachment(e.id) ?? null;
|
|
5265
5273
|
if (!n) throw Error(`Queued attachment ${e.attachment.name} is no longer available for upload.`);
|
|
5266
|
-
let r = new
|
|
5267
|
-
return r.setMuid?.(e.muid), e.metadata && Object.keys(e.metadata).length > 0 && r.setMetadata?.(e.metadata), e.parentMessageId && r.setParentMessageId?.(Number(e.parentMessageId)), e.attachment.caption && r.setCaption?.(e.attachment.caption),
|
|
5274
|
+
let r = new H.MediaMessage(e.targetId, n, e.attachment.kind, t);
|
|
5275
|
+
return r.setMuid?.(e.muid), e.metadata && Object.keys(e.metadata).length > 0 && r.setMetadata?.(e.metadata), e.parentMessageId && r.setParentMessageId?.(Number(e.parentMessageId)), e.attachment.caption && r.setCaption?.(e.attachment.caption), H.sendMediaMessage(r);
|
|
5268
5276
|
}
|
|
5269
|
-
let n = new
|
|
5270
|
-
return n.setMuid?.(e.muid), e.metadata && Object.keys(e.metadata).length > 0 && n.setMetadata?.(e.metadata), e.parentMessageId && n.setParentMessageId?.(Number(e.parentMessageId)),
|
|
5277
|
+
let n = new H.TextMessage(e.targetId, e.text ?? "", t);
|
|
5278
|
+
return n.setMuid?.(e.muid), e.metadata && Object.keys(e.metadata).length > 0 && n.setMetadata?.(e.metadata), e.parentMessageId && n.setParentMessageId?.(Number(e.parentMessageId)), H.sendMessage(n);
|
|
5271
5279
|
}
|
|
5272
5280
|
return {
|
|
5273
5281
|
initialized: t,
|
|
@@ -5298,69 +5306,69 @@ function cc({ environment: e }) {
|
|
|
5298
5306
|
activeThreadParentMessage: E,
|
|
5299
5307
|
replyToMessage: D,
|
|
5300
5308
|
editingMessage: O,
|
|
5301
|
-
init:
|
|
5302
|
-
connectRealtime:
|
|
5303
|
-
disconnectRealtime:
|
|
5304
|
-
login:
|
|
5305
|
-
logout:
|
|
5306
|
-
fetchConversations:
|
|
5307
|
-
selectConversation:
|
|
5308
|
-
sendTextMessage:
|
|
5309
|
-
sendAttachmentMessage:
|
|
5310
|
-
sendPollMessage:
|
|
5311
|
-
fetchScheduledMessages:
|
|
5312
|
-
loadOlderMessages:
|
|
5313
|
-
loadOlderThreadMessages:
|
|
5314
|
-
ensureMessageLoaded:
|
|
5315
|
-
scheduleMessage:
|
|
5316
|
-
rescheduleMessage:
|
|
5317
|
-
removeScheduledMessage:
|
|
5318
|
-
editScheduledMessage:
|
|
5319
|
-
setReplyToMessage:
|
|
5320
|
-
setEditingMessage:
|
|
5321
|
-
openThread:
|
|
5322
|
-
closeThread:
|
|
5323
|
-
refreshVisibleMessages:
|
|
5324
|
-
fetchMessageReceipts:
|
|
5325
|
-
deleteMessage:
|
|
5326
|
-
votePoll:
|
|
5327
|
-
toggleReaction:
|
|
5328
|
-
translateMessage:
|
|
5309
|
+
init: de,
|
|
5310
|
+
connectRealtime: De,
|
|
5311
|
+
disconnectRealtime: Oe,
|
|
5312
|
+
login: fe,
|
|
5313
|
+
logout: pe,
|
|
5314
|
+
fetchConversations: ke,
|
|
5315
|
+
selectConversation: Ae,
|
|
5316
|
+
sendTextMessage: Fe,
|
|
5317
|
+
sendAttachmentMessage: Le,
|
|
5318
|
+
sendPollMessage: Re,
|
|
5319
|
+
fetchScheduledMessages: We,
|
|
5320
|
+
loadOlderMessages: ot,
|
|
5321
|
+
loadOlderThreadMessages: st,
|
|
5322
|
+
ensureMessageLoaded: ct,
|
|
5323
|
+
scheduleMessage: Ge,
|
|
5324
|
+
rescheduleMessage: Xe,
|
|
5325
|
+
removeScheduledMessage: Ke,
|
|
5326
|
+
editScheduledMessage: Ye,
|
|
5327
|
+
setReplyToMessage: je,
|
|
5328
|
+
setEditingMessage: Me,
|
|
5329
|
+
openThread: Ne,
|
|
5330
|
+
closeThread: Pe,
|
|
5331
|
+
refreshVisibleMessages: Ct,
|
|
5332
|
+
fetchMessageReceipts: xt,
|
|
5333
|
+
deleteMessage: Ve,
|
|
5334
|
+
votePoll: W,
|
|
5335
|
+
toggleReaction: Be,
|
|
5336
|
+
translateMessage: Ue,
|
|
5329
5337
|
mentionDisplayNamesByUid: A,
|
|
5330
5338
|
rememberMentionDisplayNames: M
|
|
5331
5339
|
};
|
|
5332
5340
|
}
|
|
5333
5341
|
async function lc(e) {
|
|
5334
|
-
return
|
|
5335
|
-
let t =
|
|
5336
|
-
await
|
|
5342
|
+
return He(e), oc === e && sc || (sc = (async () => {
|
|
5343
|
+
let t = G(), n = new H.AppSettingsBuilder().subscribePresenceForAllUsers().setRegion(t.region).autoEstablishSocketConnection(!0).setStorageMode(H.StorageMode.SESSION).build();
|
|
5344
|
+
await H.init(t.appId, n), oc = e;
|
|
5337
5345
|
})()), sc;
|
|
5338
5346
|
}
|
|
5339
5347
|
async function uc(e) {
|
|
5340
5348
|
let t = JSON.parse(atob(e.split(".")[1]));
|
|
5341
5349
|
if (!t.sub) throw Error("Cannot read JWT subject from access token.");
|
|
5342
|
-
let n =
|
|
5350
|
+
let n = Ye();
|
|
5343
5351
|
if (n && n.sub === t.sub && n.token) return n.token;
|
|
5344
|
-
let r = await fetch(`${
|
|
5352
|
+
let r = await fetch(`${G().chatApiBaseUrl}/chats/token`, {
|
|
5345
5353
|
method: "POST",
|
|
5346
5354
|
headers: new Headers([["Authorization", `Bearer ${e}`]])
|
|
5347
5355
|
});
|
|
5348
|
-
if (r.status === 401) throw
|
|
5356
|
+
if (r.status === 401) throw Je(null), Qe(), Error("Unauthorized while fetching CometChat token.");
|
|
5349
5357
|
if (!r.ok) throw Error(`Token exchange failed with status ${r.status}.`);
|
|
5350
5358
|
let i = await r.json();
|
|
5351
|
-
return
|
|
5359
|
+
return Ze({
|
|
5352
5360
|
sub: t.sub,
|
|
5353
5361
|
token: i.token
|
|
5354
5362
|
}), i.token;
|
|
5355
5363
|
}
|
|
5356
5364
|
function dc(e, t) {
|
|
5357
|
-
let n = e.getConversationWith(), r = e.getConversationType() ===
|
|
5365
|
+
let n = e.getConversationWith(), r = e.getConversationType() === H.RECEIVER_TYPE.GROUP ? "group" : "user", i = r === "user" ? n : null, a = r === "group" ? n : null, o = r === "group" ? a.getGuid() : i.getUid(), s = e.getLastMessage(), c = t ? `group_${t}` : null;
|
|
5358
5366
|
if (c && e.getConversationId() === c) return {
|
|
5359
5367
|
id: e.getConversationId(),
|
|
5360
5368
|
targetId: o,
|
|
5361
5369
|
type: r,
|
|
5362
|
-
title:
|
|
5363
|
-
subtitle:
|
|
5370
|
+
title: vt("scheduledMessages"),
|
|
5371
|
+
subtitle: vt("hiddenHelperConversation"),
|
|
5364
5372
|
hasJoined: !0,
|
|
5365
5373
|
unreadCount: 0,
|
|
5366
5374
|
tags: [],
|
|
@@ -5373,7 +5381,7 @@ function dc(e, t) {
|
|
|
5373
5381
|
type: r,
|
|
5374
5382
|
title: n.getName() ?? o,
|
|
5375
5383
|
subtitle: l && Tc(l) && !l.isDeleted ? Oc(l) : "No messages yet",
|
|
5376
|
-
avatar: i ?
|
|
5384
|
+
avatar: i ? $e(i.getAvatar()) : void 0,
|
|
5377
5385
|
unreadCount: Number.isFinite(u) ? u : 0,
|
|
5378
5386
|
hasJoined: a?.getHasJoined() ?? !0,
|
|
5379
5387
|
lastMessageAt: s && !l?.isDeleted ? /* @__PURE__ */ new Date((s.getSentAt?.() ?? 0) * 1e3) : void 0,
|
|
@@ -5433,7 +5441,7 @@ function hc(e) {
|
|
|
5433
5441
|
return {
|
|
5434
5442
|
uid: e.getUid(),
|
|
5435
5443
|
name: e.getName?.() ?? e.getUid(),
|
|
5436
|
-
avatar:
|
|
5444
|
+
avatar: $e(e.getAvatar?.()),
|
|
5437
5445
|
status: e.getStatus?.() ?? void 0
|
|
5438
5446
|
};
|
|
5439
5447
|
}
|
|
@@ -5453,7 +5461,7 @@ function vc(e, t) {
|
|
|
5453
5461
|
let n = e.getType?.(), r = e.getCategory?.(), i = el(e);
|
|
5454
5462
|
if (String(r).toLowerCase() === "action") return Uc(e);
|
|
5455
5463
|
if (i) return `Poll: ${i.question}`;
|
|
5456
|
-
if (n ===
|
|
5464
|
+
if (n === H.MESSAGE_TYPE.TEXT || typeof e.getText == "function") {
|
|
5457
5465
|
let t = Us(e.getText());
|
|
5458
5466
|
if (t) return t;
|
|
5459
5467
|
}
|
|
@@ -5461,14 +5469,14 @@ function vc(e, t) {
|
|
|
5461
5469
|
let t = Yc(e, Kc(e))[0];
|
|
5462
5470
|
return e.getCaption?.()?.trim?.() || zs(t ? [t] : [], "Sent an attachment");
|
|
5463
5471
|
}
|
|
5464
|
-
return e.getSender?.()?.getUid?.() === t ?
|
|
5472
|
+
return e.getSender?.()?.getUid?.() === t ? vt("youSentAMessage") : vt("unsupportedMessageType");
|
|
5465
5473
|
}
|
|
5466
5474
|
function yc(e, t) {
|
|
5467
5475
|
if (e.getDeletedAt?.()) return "Message removed";
|
|
5468
5476
|
let n = e.getType?.(), r = e.getCategory?.(), i = el(e);
|
|
5469
5477
|
if (String(r).toLowerCase() === "action") return Uc(e);
|
|
5470
5478
|
if (i) return `Poll: ${i.question}`;
|
|
5471
|
-
if (n ===
|
|
5479
|
+
if (n === H.MESSAGE_TYPE.TEXT || typeof e.getText == "function") {
|
|
5472
5480
|
let t = Bs(e.getText?.());
|
|
5473
5481
|
if (Hs(t)) return t;
|
|
5474
5482
|
}
|
|
@@ -5478,10 +5486,10 @@ function yc(e, t) {
|
|
|
5478
5486
|
let n = Yc(e, Kc(e))[0];
|
|
5479
5487
|
return zs(n ? [n] : [], "Sent an attachment");
|
|
5480
5488
|
}
|
|
5481
|
-
return e.getSender?.()?.getUid?.() === t ?
|
|
5489
|
+
return e.getSender?.()?.getUid?.() === t ? vt("youSentAMessage") : vt("unsupportedMessageType");
|
|
5482
5490
|
}
|
|
5483
5491
|
function bc(e) {
|
|
5484
|
-
return [...e].filter((e) => e.title !==
|
|
5492
|
+
return [...e].filter((e) => e.title !== vt("scheduledMessages")).sort((e, t) => {
|
|
5485
5493
|
let n = e.lastMessageAt?.getTime() ?? 0;
|
|
5486
5494
|
return (t.lastMessageAt?.getTime() ?? 0) - n;
|
|
5487
5495
|
});
|
|
@@ -5517,20 +5525,23 @@ function Oc(e) {
|
|
|
5517
5525
|
return Zs(e);
|
|
5518
5526
|
}
|
|
5519
5527
|
function Z(e, t) {
|
|
5520
|
-
return
|
|
5528
|
+
return console.warn("BCC Chat: an error occurred", {
|
|
5529
|
+
error: e,
|
|
5530
|
+
fallbackMessage: t
|
|
5531
|
+
}), e instanceof Error && e.message ? e.message : t;
|
|
5521
5532
|
}
|
|
5522
5533
|
function kc(e) {
|
|
5523
|
-
return e.type === "group" ?
|
|
5534
|
+
return e.type === "group" ? H.RECEIVER_TYPE.GROUP : H.RECEIVER_TYPE.USER;
|
|
5524
5535
|
}
|
|
5525
5536
|
function Ac() {
|
|
5526
|
-
let e =
|
|
5537
|
+
let e = qe();
|
|
5527
5538
|
if (!e) throw Error("Missing access token.");
|
|
5528
5539
|
return e;
|
|
5529
5540
|
}
|
|
5530
5541
|
async function jc(e, t, n) {
|
|
5531
5542
|
let r = t.text?.trim();
|
|
5532
5543
|
if (!r) return;
|
|
5533
|
-
let i = Ac(), a = await fetch(`${
|
|
5544
|
+
let i = Ac(), a = await fetch(`${G().chatApiBaseUrl}/chats/scheduledMessages`, {
|
|
5534
5545
|
method: "POST",
|
|
5535
5546
|
headers: {
|
|
5536
5547
|
"Content-Type": "application/json",
|
|
@@ -5550,9 +5561,9 @@ async function jc(e, t, n) {
|
|
|
5550
5561
|
}
|
|
5551
5562
|
async function Mc(e, t, n) {
|
|
5552
5563
|
if (!t.file) return;
|
|
5553
|
-
let r = Ac(), i =
|
|
5564
|
+
let r = Ac(), i = Ye()?.token;
|
|
5554
5565
|
if (!i) throw Error("Missing CometChat auth token.");
|
|
5555
|
-
let a = Pc(t.file), o = t.caption?.trim() ?? "", s = Fc(e, t.file, a, o, t.scheduleDate, n), c = await fetch(`${
|
|
5566
|
+
let a = Pc(t.file), o = t.caption?.trim() ?? "", s = Fc(e, t.file, a, o, t.scheduleDate, n), c = await fetch(`${G().chatApiBaseUrl}/chats/scheduledMediaMessages`, {
|
|
5556
5567
|
method: "POST",
|
|
5557
5568
|
headers: {
|
|
5558
5569
|
Accept: "multipart/form-data",
|
|
@@ -5573,7 +5584,7 @@ function Pc(e) {
|
|
|
5573
5584
|
return t;
|
|
5574
5585
|
}
|
|
5575
5586
|
function Fc(e, t, n, r, i, a) {
|
|
5576
|
-
let o = new
|
|
5587
|
+
let o = new H.MediaMessage(e.targetId, t, n, kc(e));
|
|
5577
5588
|
return o.setSentAt(Math.floor(Date.now() / 1e3)), o.setMuid(globalThis.crypto?.randomUUID?.() ?? `${Date.now()}-${t.name}`), r && o.setCaption(r), o.setMetadata({
|
|
5578
5589
|
scheduleDate: i,
|
|
5579
5590
|
file: t,
|
|
@@ -5606,11 +5617,11 @@ function Rc(e, t) {
|
|
|
5606
5617
|
return typeof n == "string" && n.trim() ? n.trim() : e?.getName?.() ?? "System";
|
|
5607
5618
|
}
|
|
5608
5619
|
function zc(e, t) {
|
|
5609
|
-
return
|
|
5620
|
+
return $e(Vc(t)) || (Bc(e, "sender") ?? void 0);
|
|
5610
5621
|
}
|
|
5611
5622
|
function Bc(e, t) {
|
|
5612
5623
|
let n = ol(e)?.entities?.[t]?.entity;
|
|
5613
|
-
return
|
|
5624
|
+
return $e(Vc(n));
|
|
5614
5625
|
}
|
|
5615
5626
|
function Vc(e) {
|
|
5616
5627
|
if (!e || typeof e != "object") return e;
|
|
@@ -5858,9 +5869,9 @@ function ll(e, t) {
|
|
|
5858
5869
|
let n = t?.value?.getMetadata?.() ?? {};
|
|
5859
5870
|
if (!e?.getSender?.() || n.isChannel) return "";
|
|
5860
5871
|
let r = e?.getData?.()?.entities?.receiver?.entity?.scope, i = e?.getReceiver?.()?.getMetadata?.() ?? {};
|
|
5861
|
-
e instanceof
|
|
5872
|
+
e instanceof H.Action && (i = e?.getActionFor?.()?.getMetadata?.() ?? {});
|
|
5862
5873
|
let a = i.systemDisplayName;
|
|
5863
|
-
return e?.getData?.()?.metadata?.senderDisplayName && (r == "moderator" || r === void 0) ? e.getData().metadata.senderDisplayName : a && (e instanceof
|
|
5874
|
+
return e?.getData?.()?.metadata?.senderDisplayName && (r == "moderator" || r === void 0) ? e.getData().metadata.senderDisplayName : a && (e instanceof H.Action || r == "admin") ? a : e?.getSender?.()?.getName?.();
|
|
5864
5875
|
}
|
|
5865
5876
|
function ul(e, t = 25, n) {
|
|
5866
5877
|
let r = e.trim();
|
|
@@ -5883,7 +5894,7 @@ function ul(e, t = 25, n) {
|
|
|
5883
5894
|
};
|
|
5884
5895
|
}
|
|
5885
5896
|
async function dl(e) {
|
|
5886
|
-
let t = new
|
|
5897
|
+
let t = new H.GroupMembersRequestBuilder(e).setLimit(50).build(), n = !0, r = [];
|
|
5887
5898
|
try {
|
|
5888
5899
|
for (; n;) {
|
|
5889
5900
|
let e = await t.fetchNext();
|
|
@@ -5902,7 +5913,7 @@ async function dl(e) {
|
|
|
5902
5913
|
}
|
|
5903
5914
|
async function fl(e) {
|
|
5904
5915
|
await Sl("failed to get muted setting. User not logged in");
|
|
5905
|
-
let t = await Cl(`${
|
|
5916
|
+
let t = await Cl(`${G().chatApiBaseUrl}/chats/${e}/settings/${(await H.getLoggedinUser())?.getUid?.()}`, { method: "GET" });
|
|
5906
5917
|
return yl()?.storeParticipantSettings({
|
|
5907
5918
|
chatUid: e,
|
|
5908
5919
|
mutedUntil: t.mutedUntil,
|
|
@@ -5911,7 +5922,7 @@ async function fl(e) {
|
|
|
5911
5922
|
}
|
|
5912
5923
|
async function pl(e, t) {
|
|
5913
5924
|
await Sl("failed to mute chat. User not logged in");
|
|
5914
|
-
let n = await Cl(`${
|
|
5925
|
+
let n = await Cl(`${G().chatApiBaseUrl}/chats/${e}/settings/${(await H.getLoggedinUser())?.getUid?.()}`, {
|
|
5915
5926
|
method: "PATCH",
|
|
5916
5927
|
body: JSON.stringify({ mutedUntil: t })
|
|
5917
5928
|
});
|
|
@@ -5922,10 +5933,10 @@ async function pl(e, t) {
|
|
|
5922
5933
|
}), n.mutedUntil;
|
|
5923
5934
|
}
|
|
5924
5935
|
async function ml() {
|
|
5925
|
-
return await Sl("failed to get muted all setting. User not logged in"), Cl(`${
|
|
5936
|
+
return await Sl("failed to get muted all setting. User not logged in"), Cl(`${G().chatApiBaseUrl}/person/settings`, { method: "GET" });
|
|
5926
5937
|
}
|
|
5927
5938
|
async function hl(e) {
|
|
5928
|
-
return await Sl("failed to update person settings. User not logged in"), Cl(`${
|
|
5939
|
+
return await Sl("failed to update person settings. User not logged in"), Cl(`${G().chatApiBaseUrl}/person/settings`, {
|
|
5929
5940
|
method: "PATCH",
|
|
5930
5941
|
body: JSON.stringify(e)
|
|
5931
5942
|
});
|
|
@@ -5950,19 +5961,19 @@ function yl() {
|
|
|
5950
5961
|
return e ? new $s(e) : null;
|
|
5951
5962
|
}
|
|
5952
5963
|
function bl() {
|
|
5953
|
-
let e =
|
|
5954
|
-
return e ? `bcc-chat:${
|
|
5964
|
+
let e = lt();
|
|
5965
|
+
return e ? `bcc-chat:${G().appId}:${e}` : null;
|
|
5955
5966
|
}
|
|
5956
5967
|
function xl() {
|
|
5957
|
-
return
|
|
5968
|
+
return H.__bccCompatLoggedInUser ?? null;
|
|
5958
5969
|
}
|
|
5959
5970
|
async function Sl(e) {
|
|
5960
|
-
let t = await
|
|
5961
|
-
if (
|
|
5971
|
+
let t = await H.getLoggedinUser();
|
|
5972
|
+
if (H.__bccCompatLoggedInUser = t ?? null, !t?.getUid?.()) throw Error(e);
|
|
5962
5973
|
return t;
|
|
5963
5974
|
}
|
|
5964
5975
|
async function Cl(e, t) {
|
|
5965
|
-
let n =
|
|
5976
|
+
let n = qe();
|
|
5966
5977
|
if (!n) throw Error("Missing access token.");
|
|
5967
5978
|
let r = await fetch(e, {
|
|
5968
5979
|
...t,
|
|
@@ -6026,7 +6037,7 @@ function Vl(e) {
|
|
|
6026
6037
|
if (Q.value && !e && !Al.value) return Q.value;
|
|
6027
6038
|
let t = e ?? Al.value;
|
|
6028
6039
|
if (!t) throw Error("Environment has not been set yet. Call app.use(chat, { environment: ... }) first.");
|
|
6029
|
-
return (!Q.value || Al.value !== t) && (Al.value = t,
|
|
6040
|
+
return (!Q.value || Al.value !== t) && (Al.value = t, He(t), Q.value = cc({ environment: t })), Q.value;
|
|
6030
6041
|
}
|
|
6031
6042
|
var Hl = n(() => Q.value?.currentUser.value?.uid);
|
|
6032
6043
|
function Ul(e) {
|
|
@@ -6041,7 +6052,7 @@ async function Wl(e) {
|
|
|
6041
6052
|
if (!Ll.has(e)) {
|
|
6042
6053
|
Ll.add(e);
|
|
6043
6054
|
try {
|
|
6044
|
-
let t = await
|
|
6055
|
+
let t = await H.getMessageReceipts(e);
|
|
6045
6056
|
Il.value = {
|
|
6046
6057
|
...Il.value,
|
|
6047
6058
|
[e]: Ul(t)
|
|
@@ -6100,17 +6111,17 @@ F([() => Q.value?.conversations.value, () => Hl.value], async () => {
|
|
|
6100
6111
|
Il.value = {}, Ll.clear();
|
|
6101
6112
|
});
|
|
6102
6113
|
async function Ql(e, t) {
|
|
6103
|
-
Pl.value = t.loggerCallback,
|
|
6114
|
+
Pl.value = t.loggerCallback, _t(t.language ?? "en"), Bl(t.themeMode);
|
|
6104
6115
|
let n = e.config.globalProperties.$primevue;
|
|
6105
6116
|
n && (n.config.ripple = !0, n.config.inputVariant = "filled"), e.component("BccChat", vh), e.component("BccChatMessageList", vh), e.provide("theme", { theme: El });
|
|
6106
6117
|
let r = Vl(t.environment);
|
|
6107
6118
|
zl(Ol.INFO, "Initializing chat", {
|
|
6108
6119
|
environment: t.environment,
|
|
6109
|
-
language:
|
|
6120
|
+
language: pt.value,
|
|
6110
6121
|
themeMode: t.themeMode
|
|
6111
6122
|
}), await r.init(), kl.value = !0, Rl?.(), p(t.accessToken) ? Rl = F(t.accessToken, async (e) => {
|
|
6112
6123
|
e ? await $l(e) : await eu();
|
|
6113
|
-
}, { immediate: !0 }) : t.accessToken && await $l(t.accessToken), zl(Ol.INFO, "Chat initialized", { environment:
|
|
6124
|
+
}, { immediate: !0 }) : t.accessToken && await $l(t.accessToken), zl(Ol.INFO, "Chat initialized", { environment: G().appId });
|
|
6114
6125
|
}
|
|
6115
6126
|
async function $l(e) {
|
|
6116
6127
|
if (!e) return eu();
|
|
@@ -6138,7 +6149,7 @@ function iu(e) {
|
|
|
6138
6149
|
Ml.value = e;
|
|
6139
6150
|
}
|
|
6140
6151
|
function au(e) {
|
|
6141
|
-
|
|
6152
|
+
_t(e);
|
|
6142
6153
|
}
|
|
6143
6154
|
function ou(e) {
|
|
6144
6155
|
Bl(e);
|
|
@@ -6152,7 +6163,7 @@ function cu(e) {
|
|
|
6152
6163
|
async function lu(e, t = !1) {
|
|
6153
6164
|
if (!Jl.value) return null;
|
|
6154
6165
|
try {
|
|
6155
|
-
return await
|
|
6166
|
+
return await H.getGroup(e);
|
|
6156
6167
|
} catch (e) {
|
|
6157
6168
|
if (e && typeof e == "object" && "code" in e && e.code === "ERR_GUID_NOT_FOUND") return;
|
|
6158
6169
|
if (t) throw e;
|
|
@@ -6169,7 +6180,7 @@ async function du(e) {
|
|
|
6169
6180
|
}
|
|
6170
6181
|
async function fu(e) {
|
|
6171
6182
|
try {
|
|
6172
|
-
return Jl.value && (await
|
|
6183
|
+
return Jl.value && (await H.getOnlineGroupMemberCount([e]))[e] || 0;
|
|
6173
6184
|
} catch {
|
|
6174
6185
|
return 0;
|
|
6175
6186
|
}
|
|
@@ -6201,7 +6212,7 @@ var gu = {
|
|
|
6201
6212
|
login: $l,
|
|
6202
6213
|
logout: eu,
|
|
6203
6214
|
setCurrentEnvironment: cu,
|
|
6204
|
-
getCurrentEnvironment:
|
|
6215
|
+
getCurrentEnvironment: G,
|
|
6205
6216
|
setThemeMode: ou,
|
|
6206
6217
|
setLanguage: au,
|
|
6207
6218
|
getGroup: lu,
|
|
@@ -6213,7 +6224,7 @@ var gu = {
|
|
|
6213
6224
|
searchChat: (e, t = 25) => ul(e, t, Q.value?.currentUser.value?.uid),
|
|
6214
6225
|
getSenderDisplayName: ll,
|
|
6215
6226
|
getMessageTextPreview: qs,
|
|
6216
|
-
proxyImage:
|
|
6227
|
+
proxyImage: et,
|
|
6217
6228
|
getMutedUntil: mu,
|
|
6218
6229
|
muteChat: pu,
|
|
6219
6230
|
getMyChatSettings: ml,
|
|
@@ -6221,7 +6232,7 @@ var gu = {
|
|
|
6221
6232
|
setMuteAll: gl,
|
|
6222
6233
|
toggleMuteAll: _l,
|
|
6223
6234
|
toMarkdownHtml: ks,
|
|
6224
|
-
retrieveCcToken:
|
|
6235
|
+
retrieveCcToken: Xe,
|
|
6225
6236
|
getChatMessages: Ml,
|
|
6226
6237
|
scrollToMessageId: Nl,
|
|
6227
6238
|
scrollToMessage: hu,
|
|
@@ -6230,7 +6241,7 @@ var gu = {
|
|
|
6230
6241
|
onlineStatus: Yl.onlineStatus,
|
|
6231
6242
|
theme: El,
|
|
6232
6243
|
themeMode: jl,
|
|
6233
|
-
language:
|
|
6244
|
+
language: pt
|
|
6234
6245
|
};
|
|
6235
6246
|
//#endregion
|
|
6236
6247
|
//#region src/chat/conversationState.ts
|
|
@@ -6281,7 +6292,7 @@ function Ou(e) {
|
|
|
6281
6292
|
uid: t.targetId,
|
|
6282
6293
|
displayName: t.title,
|
|
6283
6294
|
avatar: t.avatar
|
|
6284
|
-
}] : a.filter((e) => e.uid !== n).map(
|
|
6295
|
+
}] : a.filter((e) => e.uid !== n).map(Et) : [];
|
|
6285
6296
|
});
|
|
6286
6297
|
return {
|
|
6287
6298
|
client: t,
|
|
@@ -6295,7 +6306,7 @@ function Ou(e) {
|
|
|
6295
6306
|
isChannel: u,
|
|
6296
6307
|
sendOptions: d,
|
|
6297
6308
|
mentionCandidates: f,
|
|
6298
|
-
mentionNameByUid: n(() =>
|
|
6309
|
+
mentionNameByUid: n(() => Ht(Dt(f.value), t.value?.mentionDisplayNamesByUid.value ?? {}))
|
|
6299
6310
|
};
|
|
6300
6311
|
}
|
|
6301
6312
|
var ku = Symbol("conversationCtx");
|
|
@@ -6680,10 +6691,10 @@ function Qu(e) {
|
|
|
6680
6691
|
return;
|
|
6681
6692
|
}
|
|
6682
6693
|
try {
|
|
6683
|
-
t.value = (await new
|
|
6694
|
+
t.value = (await new H.GroupMembersRequestBuilder(n).setLimit(50).build().fetchNext() ?? []).map((e) => ({
|
|
6684
6695
|
uid: e.getUid(),
|
|
6685
6696
|
displayName: e.getName(),
|
|
6686
|
-
avatar:
|
|
6697
|
+
avatar: $e(e.getAvatar?.()) ?? "",
|
|
6687
6698
|
role: e.getScope()
|
|
6688
6699
|
})), e.onMembersChanged(t.value);
|
|
6689
6700
|
} catch {
|
|
@@ -6696,8 +6707,8 @@ function Qu(e) {
|
|
|
6696
6707
|
let c = {
|
|
6697
6708
|
uid: r.getUid(),
|
|
6698
6709
|
displayName: r.getName(),
|
|
6699
|
-
avatar:
|
|
6700
|
-
role: a ?? r.getScope?.() ??
|
|
6710
|
+
avatar: $e(r.getAvatar?.()) ?? "",
|
|
6711
|
+
role: a ?? r.getScope?.() ?? H.GROUP_MEMBER_SCOPE.PARTICIPANT
|
|
6701
6712
|
};
|
|
6702
6713
|
i === "add" ? t.value.some((e) => e.uid === c.uid) || (t.value = [...t.value, c]) : i === "remove" ? t.value = t.value.filter((e) => e.uid !== c.uid) : t.value = t.value.map((e) => e.uid === c.uid ? {
|
|
6703
6714
|
...e,
|
|
@@ -6705,7 +6716,7 @@ function Qu(e) {
|
|
|
6705
6716
|
} : e), e.onMembersChanged(t.value);
|
|
6706
6717
|
}
|
|
6707
6718
|
return b(() => {
|
|
6708
|
-
|
|
6719
|
+
H.addGroupListener(n, new H.GroupListener({
|
|
6709
6720
|
onGroupMemberScopeChanged: (e, t, n, r, a) => {
|
|
6710
6721
|
i(a, t, "update", n);
|
|
6711
6722
|
},
|
|
@@ -6729,7 +6740,7 @@ function Qu(e) {
|
|
|
6729
6740
|
}
|
|
6730
6741
|
}));
|
|
6731
6742
|
}), x(() => {
|
|
6732
|
-
|
|
6743
|
+
H.removeGroupListener(n);
|
|
6733
6744
|
}), {
|
|
6734
6745
|
groupMembers: t,
|
|
6735
6746
|
fetchGroupMembers: r
|
|
@@ -6812,7 +6823,7 @@ function id(e) {
|
|
|
6812
6823
|
triggerChar: "@",
|
|
6813
6824
|
enabled: e.enabled,
|
|
6814
6825
|
maxSuggestions: e.maxSuggestions ?? 8,
|
|
6815
|
-
getCandidates: (t) =>
|
|
6826
|
+
getCandidates: (t) => Ot(e.getMentionCandidates(), t, e.maxSuggestions ?? 8).map((e) => ({
|
|
6816
6827
|
id: e.uid,
|
|
6817
6828
|
label: e.displayName,
|
|
6818
6829
|
avatar: e.avatar
|
|
@@ -6982,7 +6993,7 @@ function ud(e, t, r, i) {
|
|
|
6982
6993
|
}, { deep: !0 });
|
|
6983
6994
|
function C(e) {
|
|
6984
6995
|
let t = Es(e);
|
|
6985
|
-
return t.includes("<@uid:") ? Es(
|
|
6996
|
+
return t.includes("<@uid:") ? Es(Ft(t, i.getMentionNameByUid?.() ?? {})) : t;
|
|
6986
6997
|
}
|
|
6987
6998
|
F(() => i.getModelValue(), (e) => {
|
|
6988
6999
|
let n = t.value, r = C(e);
|
|
@@ -7075,21 +7086,21 @@ function ud(e, t, r, i) {
|
|
|
7075
7086
|
function I(e) {
|
|
7076
7087
|
x(e), D();
|
|
7077
7088
|
}
|
|
7078
|
-
function
|
|
7089
|
+
function te() {
|
|
7079
7090
|
k() || O();
|
|
7080
7091
|
}
|
|
7081
|
-
function
|
|
7092
|
+
function L() {
|
|
7082
7093
|
o.value += 1, O(), g(), l.value = "", i.updateModelValue("");
|
|
7083
7094
|
}
|
|
7084
7095
|
return b(() => {
|
|
7085
|
-
document.addEventListener("pointerdown", P), document.addEventListener("selectionchange",
|
|
7096
|
+
document.addEventListener("pointerdown", P), document.addEventListener("selectionchange", te), h(() => {
|
|
7086
7097
|
if (t.value) {
|
|
7087
7098
|
let e = C(i.getModelValue());
|
|
7088
7099
|
t.value.innerHTML = e, T(t.value), e ? delete t.value.dataset.empty : t.value.dataset.empty = "true", l.value = e;
|
|
7089
7100
|
}
|
|
7090
7101
|
});
|
|
7091
7102
|
}), y(() => {
|
|
7092
|
-
document.removeEventListener("pointerdown", P), document.removeEventListener("selectionchange",
|
|
7103
|
+
document.removeEventListener("pointerdown", P), document.removeEventListener("selectionchange", te);
|
|
7093
7104
|
}), {
|
|
7094
7105
|
applyFormat: A,
|
|
7095
7106
|
editorKey: o,
|
|
@@ -7100,7 +7111,7 @@ function ud(e, t, r, i) {
|
|
|
7100
7111
|
handleKeydown: M,
|
|
7101
7112
|
handlePaste: ee,
|
|
7102
7113
|
hideFormatMenu: O,
|
|
7103
|
-
resetEditor:
|
|
7114
|
+
resetEditor: L,
|
|
7104
7115
|
showFormatMenu: s,
|
|
7105
7116
|
triggerCandidates: d,
|
|
7106
7117
|
triggerMenuPosition: f,
|
|
@@ -7115,29 +7126,29 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
|
|
|
7115
7126
|
__name: "ComposerActionsPopover",
|
|
7116
7127
|
emits: ["pickFile", "openPoll"],
|
|
7117
7128
|
setup(t, { expose: n, emit: i }) {
|
|
7118
|
-
let s = i, c = w(!1), l = w(null), { t: u } =
|
|
7129
|
+
let s = i, c = w(!1), l = w(null), { t: u } = K(), d = typeof navigator < "u" && (/iPad|iPhone|iPod/.test(navigator.userAgent) || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1), f = [
|
|
7119
7130
|
{
|
|
7120
7131
|
kind: "image",
|
|
7121
7132
|
label: "attachImage",
|
|
7122
|
-
icon:
|
|
7133
|
+
icon: we,
|
|
7123
7134
|
testId: "composer-attach-image"
|
|
7124
7135
|
},
|
|
7125
7136
|
{
|
|
7126
7137
|
kind: "video",
|
|
7127
7138
|
label: "attachVideo",
|
|
7128
|
-
icon:
|
|
7139
|
+
icon: Re,
|
|
7129
7140
|
testId: "composer-attach-video"
|
|
7130
7141
|
},
|
|
7131
7142
|
{
|
|
7132
7143
|
kind: "audio",
|
|
7133
7144
|
label: "attachAudio",
|
|
7134
|
-
icon:
|
|
7145
|
+
icon: Oe,
|
|
7135
7146
|
testId: "composer-attach-audio"
|
|
7136
7147
|
},
|
|
7137
7148
|
{
|
|
7138
7149
|
kind: "file",
|
|
7139
7150
|
label: "attachFile",
|
|
7140
|
-
icon:
|
|
7151
|
+
icon: le,
|
|
7141
7152
|
testId: "composer-attach-file"
|
|
7142
7153
|
}
|
|
7143
7154
|
];
|
|
@@ -7165,7 +7176,7 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
|
|
|
7165
7176
|
}), n({
|
|
7166
7177
|
toggle: p,
|
|
7167
7178
|
hide: m
|
|
7168
|
-
}), (t, n) =>
|
|
7179
|
+
}), (t, n) => te((S(), a("div", {
|
|
7169
7180
|
ref_key: "menuRef",
|
|
7170
7181
|
ref: l,
|
|
7171
7182
|
class: "composer-actions-menu",
|
|
@@ -7181,7 +7192,7 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
|
|
|
7181
7192
|
class: "composer-actions-menu__item",
|
|
7182
7193
|
"data-testid": "composer-create-poll",
|
|
7183
7194
|
onClick: g
|
|
7184
|
-
}, [o("span", pd, [(S(), r(D(j(
|
|
7195
|
+
}, [o("span", pd, [(S(), r(D(j(U)), { class: "size-5" }))]), o("span", null, k(j(u)("createPoll")), 1)])], 512)), [[P, c.value]]);
|
|
7185
7196
|
}
|
|
7186
7197
|
}), $ = (e, t) => {
|
|
7187
7198
|
let n = e.__vccOpts || e;
|
|
@@ -7196,13 +7207,13 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
|
|
|
7196
7207
|
},
|
|
7197
7208
|
emits: ["cancel"],
|
|
7198
7209
|
setup(e, { emit: t }) {
|
|
7199
|
-
let r = e, i = t, { t: s } =
|
|
7210
|
+
let r = e, i = t, { t: s } = K(), c = ju(), u = n(() => Ws(r.message, s("message"), c.mentionNameByUid.value));
|
|
7200
7211
|
return (t, n) => (S(), a("div", { class: g(["context-banner", `context-banner--${e.variant}`]) }, [o("div", gd, [
|
|
7201
7212
|
o("p", _d, k(e.variant === "editing" ? j(s)("editingInContext", { context: e.contextLabel }) : j(s)("replyingInContext", { context: e.contextLabel })), 1),
|
|
7202
7213
|
o("p", vd, k(e.message.senderName), 1),
|
|
7203
7214
|
o("p", yd, k(u.value), 1)
|
|
7204
7215
|
]), l(j(z), {
|
|
7205
|
-
icon: j(
|
|
7216
|
+
icon: j(fe),
|
|
7206
7217
|
text: "",
|
|
7207
7218
|
rounded: "",
|
|
7208
7219
|
severity: "secondary",
|
|
@@ -7217,7 +7228,7 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
|
|
|
7217
7228
|
},
|
|
7218
7229
|
emits: ["format"],
|
|
7219
7230
|
setup(e, { emit: t }) {
|
|
7220
|
-
let n = t, { t: r } =
|
|
7231
|
+
let n = t, { t: r } = K();
|
|
7221
7232
|
return (t, s) => e.visible ? (S(), a("div", {
|
|
7222
7233
|
key: 0,
|
|
7223
7234
|
class: "format-menu",
|
|
@@ -7229,19 +7240,19 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
|
|
|
7229
7240
|
o("button", {
|
|
7230
7241
|
type: "button",
|
|
7231
7242
|
class: "format-menu__item",
|
|
7232
|
-
onMousedown: s[0] ||=
|
|
7243
|
+
onMousedown: s[0] ||= L(() => {}, ["prevent"]),
|
|
7233
7244
|
onClick: s[1] ||= (e) => n("format", "bold")
|
|
7234
7245
|
}, [s[6] ||= o("span", { class: "format-menu__icon font-bold" }, "B", -1), o("span", null, k(j(r)("bold")), 1)], 32),
|
|
7235
7246
|
o("button", {
|
|
7236
7247
|
type: "button",
|
|
7237
7248
|
class: "format-menu__item",
|
|
7238
|
-
onMousedown: s[2] ||=
|
|
7249
|
+
onMousedown: s[2] ||= L(() => {}, ["prevent"]),
|
|
7239
7250
|
onClick: s[3] ||= (e) => n("format", "italic")
|
|
7240
7251
|
}, [s[7] ||= o("span", { class: "format-menu__icon italic" }, "I", -1), o("span", null, k(j(r)("italic")), 1)], 32),
|
|
7241
7252
|
o("button", {
|
|
7242
7253
|
type: "button",
|
|
7243
7254
|
class: "format-menu__item",
|
|
7244
|
-
onMousedown: s[4] ||=
|
|
7255
|
+
onMousedown: s[4] ||= L(() => {}, ["prevent"]),
|
|
7245
7256
|
onClick: s[5] ||= (e) => n("format", "underline")
|
|
7246
7257
|
}, [s[8] ||= o("span", { class: "format-menu__icon underline" }, "U", -1), o("span", null, k(j(r)("underline")), 1)], 32)
|
|
7247
7258
|
], 4)) : i("", !0);
|
|
@@ -7254,7 +7265,7 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
|
|
|
7254
7265
|
},
|
|
7255
7266
|
emits: ["update:visible", "send"],
|
|
7256
7267
|
setup(t, { expose: i, emit: s }) {
|
|
7257
|
-
let c = t, u = s, { t: d } =
|
|
7268
|
+
let c = t, u = s, { t: d } = K(), f = w(""), p = w(["", ""]), m = n(() => {
|
|
7258
7269
|
let e = f.value.trim(), t = p.value.map((e) => e.trim()).filter(Boolean);
|
|
7259
7270
|
return !!e && t.length >= 2;
|
|
7260
7271
|
});
|
|
@@ -7290,7 +7301,7 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
|
|
|
7290
7301
|
onClick: y
|
|
7291
7302
|
}, null, 8, ["label"]), l(j(z), {
|
|
7292
7303
|
label: j(d)("sendPoll"),
|
|
7293
|
-
icon: j(
|
|
7304
|
+
icon: j(Pe),
|
|
7294
7305
|
disabled: c.disabled || !m.value,
|
|
7295
7306
|
onClick: v
|
|
7296
7307
|
}, null, 8, [
|
|
@@ -7318,7 +7329,7 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
|
|
|
7318
7329
|
"placeholder",
|
|
7319
7330
|
"onUpdate:modelValue"
|
|
7320
7331
|
]), l(j(z), {
|
|
7321
|
-
icon: j(
|
|
7332
|
+
icon: j(fe),
|
|
7322
7333
|
text: "",
|
|
7323
7334
|
rounded: "",
|
|
7324
7335
|
severity: "secondary",
|
|
@@ -7331,7 +7342,7 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
|
|
|
7331
7342
|
])]))), 128)),
|
|
7332
7343
|
l(j(z), {
|
|
7333
7344
|
label: j(d)("addOption"),
|
|
7334
|
-
icon: j(
|
|
7345
|
+
icon: j(ce),
|
|
7335
7346
|
text: "",
|
|
7336
7347
|
onClick: h
|
|
7337
7348
|
}, null, 8, ["label", "icon"])
|
|
@@ -7349,7 +7360,7 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
|
|
|
7349
7360
|
},
|
|
7350
7361
|
emits: ["update:visible", "schedule"],
|
|
7351
7362
|
setup(e, { expose: t, emit: i }) {
|
|
7352
|
-
let a = e, s = i, { t: c } =
|
|
7363
|
+
let a = e, s = i, { t: c } = K(), u = w(p()), d = w(m());
|
|
7353
7364
|
function f() {
|
|
7354
7365
|
return new Date(Date.now() + 3600 * 1e3);
|
|
7355
7366
|
}
|
|
@@ -7389,7 +7400,7 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
|
|
|
7389
7400
|
onClick: b
|
|
7390
7401
|
}, null, 8, ["label"]), l(j(z), {
|
|
7391
7402
|
label: j(c)("schedule"),
|
|
7392
|
-
icon: j(
|
|
7403
|
+
icon: j(ue),
|
|
7393
7404
|
disabled: a.disabled || !g.value,
|
|
7394
7405
|
onClick: y
|
|
7395
7406
|
}, null, 8, [
|
|
@@ -7447,7 +7458,7 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
|
|
|
7447
7458
|
top: `${t.position.y}px`
|
|
7448
7459
|
}),
|
|
7449
7460
|
role: "listbox",
|
|
7450
|
-
onMousedown: l[0] ||=
|
|
7461
|
+
onMousedown: l[0] ||= L(() => {}, ["stop"])
|
|
7451
7462
|
}, [(S(!0), a(e, null, T(t.candidates, (e, t) => (S(), a("button", {
|
|
7452
7463
|
key: e.id,
|
|
7453
7464
|
type: "button",
|
|
@@ -7455,8 +7466,8 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
|
|
|
7455
7466
|
role: "option",
|
|
7456
7467
|
"aria-selected": t === s.value,
|
|
7457
7468
|
onMouseover: (e) => s.value = t,
|
|
7458
|
-
onMousedown:
|
|
7459
|
-
}, [e.avatar ? (S(), r(j(
|
|
7469
|
+
onMousedown: L((t) => c("select", e), ["stop", "prevent"])
|
|
7470
|
+
}, [e.avatar ? (S(), r(j(R), {
|
|
7460
7471
|
key: 0,
|
|
7461
7472
|
src: e.avatar,
|
|
7462
7473
|
name: e.label,
|
|
@@ -7505,62 +7516,62 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
|
|
|
7505
7516
|
video: "video/*",
|
|
7506
7517
|
audio: "audio/*",
|
|
7507
7518
|
file: "*/*"
|
|
7508
|
-
}, u = e, d = s, f = w(null), m = w(null), _ = w(null), v = w("file"), y = w(!1), b = w(!1), x = w(!1), { t: C } =
|
|
7519
|
+
}, u = e, d = s, f = w(null), m = w(null), _ = w(null), v = w("file"), y = w(!1), b = w(!1), x = w(!1), { t: C } = K(), T = null, E = w(null), D = w(null), O = w(null), { applyFormat: A, editorKey: M, formatMenuPosition: ee, focusEditor: N, handleContextMenu: P, handleInput: I, handleKeydown: te, handlePaste: R, hideFormatMenu: ne, resetEditor: B, showFormatMenu: re, triggerCandidates: ie, triggerMenuPosition: ae, highlightedTriggerIndex: oe, showTriggerMenu: V, selectTriggerCandidate: H } = ud(E, D, O, {
|
|
7509
7520
|
getModelValue: () => u.modelValue,
|
|
7510
7521
|
updateModelValue: (e) => d("update:modelValue", e),
|
|
7511
|
-
submit: () =>
|
|
7522
|
+
submit: () => Te(),
|
|
7512
7523
|
getMentionCandidates: () => u.mentionCandidates ?? [],
|
|
7513
7524
|
getMentionNameByUid: () => u.mentionNameByUid ?? {},
|
|
7514
7525
|
mentionsEnabled: () => u.mentionsEnabled ?? (u.mentionCandidates?.length ?? 0) > 0
|
|
7515
|
-
}),
|
|
7526
|
+
}), le = n(() => c[v.value]), U = n(() => {
|
|
7516
7527
|
if (!_.value) return null;
|
|
7517
7528
|
let e = _.value.type;
|
|
7518
7529
|
return e.startsWith("image/") ? "image" : e.startsWith("video/") ? "video" : e.startsWith("audio/") ? "audio" : "file";
|
|
7519
|
-
}),
|
|
7520
|
-
switch (
|
|
7530
|
+
}), ue = n(() => {
|
|
7531
|
+
switch (U.value) {
|
|
7521
7532
|
case "image": return C("image");
|
|
7522
7533
|
case "video": return C("video");
|
|
7523
7534
|
case "audio": return C("audio");
|
|
7524
7535
|
case "file": return C("file");
|
|
7525
7536
|
default: return C("attachment");
|
|
7526
7537
|
}
|
|
7527
|
-
}),
|
|
7538
|
+
}), pe = n(() => !u.editingMessage && !u.replyToMessage ? "" : u.compact ? "pt-1" : "pt-1.5"), me = n(() => Hs(u.modelValue) || !!_.value), he = n(() => me.value && U.value !== "file"), ge = n(() => _.value ? C("attachmentSummary", { name: _.value.name }) : Us(u.modelValue) || C("currentDraftWillBeScheduled"));
|
|
7528
7539
|
F(() => u.resetSignal, () => {
|
|
7529
7540
|
B(), _.value = null, y.value = !1, b.value = !1, f.value && (f.value.value = "");
|
|
7530
7541
|
});
|
|
7531
|
-
async function
|
|
7542
|
+
async function _e() {
|
|
7532
7543
|
await h(), N();
|
|
7533
7544
|
}
|
|
7534
|
-
function
|
|
7545
|
+
function ye() {
|
|
7535
7546
|
m.value?.hide();
|
|
7536
7547
|
}
|
|
7537
7548
|
t({
|
|
7538
|
-
focusEditor:
|
|
7539
|
-
hideComposerActions:
|
|
7549
|
+
focusEditor: _e,
|
|
7550
|
+
hideComposerActions: ye
|
|
7540
7551
|
});
|
|
7541
|
-
async function
|
|
7552
|
+
async function be(e = "file") {
|
|
7542
7553
|
v.value = e, await h(), f.value?.click();
|
|
7543
7554
|
}
|
|
7544
|
-
function be(e) {
|
|
7545
|
-
_.value = e.target.files?.[0] ?? null, ve();
|
|
7546
|
-
}
|
|
7547
7555
|
function xe(e) {
|
|
7556
|
+
_.value = e.target.files?.[0] ?? null, ye();
|
|
7557
|
+
}
|
|
7558
|
+
function Se(e) {
|
|
7548
7559
|
if (u.disabled) return;
|
|
7549
7560
|
let t = rd(e);
|
|
7550
7561
|
if (t) {
|
|
7551
|
-
e.preventDefault(), _.value = t,
|
|
7562
|
+
e.preventDefault(), _.value = t, ye();
|
|
7552
7563
|
return;
|
|
7553
7564
|
}
|
|
7554
|
-
|
|
7565
|
+
R(e);
|
|
7555
7566
|
}
|
|
7556
|
-
function
|
|
7567
|
+
function Ce() {
|
|
7557
7568
|
_.value = null, f.value && (f.value.value = "");
|
|
7558
7569
|
}
|
|
7559
|
-
function
|
|
7570
|
+
function we(e) {
|
|
7560
7571
|
m.value?.toggle(e);
|
|
7561
7572
|
}
|
|
7562
|
-
function
|
|
7563
|
-
if (!(u.disabled || !
|
|
7573
|
+
function Te() {
|
|
7574
|
+
if (!(u.disabled || !me.value)) {
|
|
7564
7575
|
if (_.value) {
|
|
7565
7576
|
d("sendAttachment", {
|
|
7566
7577
|
file: _.value,
|
|
@@ -7571,10 +7582,10 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
|
|
|
7571
7582
|
d("sendText");
|
|
7572
7583
|
}
|
|
7573
7584
|
}
|
|
7574
|
-
function
|
|
7585
|
+
function Ee(e) {
|
|
7575
7586
|
d("sendPoll", e);
|
|
7576
7587
|
}
|
|
7577
|
-
function
|
|
7588
|
+
function De(e) {
|
|
7578
7589
|
d("scheduleMessage", {
|
|
7579
7590
|
...e,
|
|
7580
7591
|
text: _.value ? void 0 : Vs(u.modelValue),
|
|
@@ -7582,39 +7593,39 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
|
|
|
7582
7593
|
caption: _.value ? Vs(u.modelValue) : void 0
|
|
7583
7594
|
});
|
|
7584
7595
|
}
|
|
7585
|
-
function
|
|
7596
|
+
function Oe() {
|
|
7586
7597
|
d("openScheduled");
|
|
7587
7598
|
}
|
|
7588
|
-
function
|
|
7599
|
+
function ke() {
|
|
7589
7600
|
T !== null && (clearTimeout(T), T = null);
|
|
7590
7601
|
}
|
|
7591
|
-
function
|
|
7592
|
-
u.disabled || !
|
|
7602
|
+
function Ae(e) {
|
|
7603
|
+
u.disabled || !he.value || e instanceof MouseEvent && e.button !== 0 || (x.value = !1, ke(), T = setTimeout(() => {
|
|
7593
7604
|
T = null, x.value = !0, b.value = !0;
|
|
7594
7605
|
}, Jd));
|
|
7595
7606
|
}
|
|
7596
|
-
function Ae() {
|
|
7597
|
-
Oe();
|
|
7598
|
-
}
|
|
7599
7607
|
function je() {
|
|
7600
|
-
|
|
7608
|
+
ke();
|
|
7609
|
+
}
|
|
7610
|
+
function Me() {
|
|
7611
|
+
if (!(u.disabled || !me.value)) {
|
|
7601
7612
|
if (x.value) {
|
|
7602
7613
|
x.value = !1;
|
|
7603
7614
|
return;
|
|
7604
7615
|
}
|
|
7605
|
-
|
|
7616
|
+
Te();
|
|
7606
7617
|
}
|
|
7607
7618
|
}
|
|
7608
|
-
return (t, n) => (S(), a("div", { class: g([u.compact ? "space-y-1 px-1 pb-1.5" : "space-y-1.5 px-1 pb-1.5",
|
|
7619
|
+
return (t, n) => (S(), a("div", { class: g([u.compact ? "space-y-1 px-1 pb-1.5" : "space-y-1.5 px-1 pb-1.5", pe.value]) }, [
|
|
7609
7620
|
o("input", {
|
|
7610
7621
|
ref_key: "fileInputRef",
|
|
7611
7622
|
ref: f,
|
|
7612
7623
|
type: "file",
|
|
7613
7624
|
class: "hidden",
|
|
7614
|
-
accept:
|
|
7625
|
+
accept: le.value,
|
|
7615
7626
|
disabled: e.disabled,
|
|
7616
|
-
onChange:
|
|
7617
|
-
onCancel:
|
|
7627
|
+
onChange: xe,
|
|
7628
|
+
onCancel: ye
|
|
7618
7629
|
}, null, 40, Bd),
|
|
7619
7630
|
e.editingMessage ? (S(), r(bd, {
|
|
7620
7631
|
key: 0,
|
|
@@ -7631,12 +7642,12 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
|
|
|
7631
7642
|
"data-testid": "composer-reply-context",
|
|
7632
7643
|
onCancel: n[1] ||= (e) => d("cancelReply")
|
|
7633
7644
|
}, null, 8, ["message", "context-label"])) : i("", !0),
|
|
7634
|
-
_.value ? (S(), a("div", Vd, [o("div", Hd, [o("p", Ud, k(_.value.name), 1), o("p", Wd, k(_.value.type ||
|
|
7635
|
-
icon: j(
|
|
7645
|
+
_.value ? (S(), a("div", Vd, [o("div", Hd, [o("p", Ud, k(_.value.name), 1), o("p", Wd, k(_.value.type || ue.value), 1)]), l(j(z), {
|
|
7646
|
+
icon: j(fe),
|
|
7636
7647
|
text: "",
|
|
7637
7648
|
rounded: "",
|
|
7638
7649
|
severity: "secondary",
|
|
7639
|
-
onClick:
|
|
7650
|
+
onClick: Ce
|
|
7640
7651
|
}, null, 8, ["icon"])])) : i("", !0),
|
|
7641
7652
|
o("div", {
|
|
7642
7653
|
ref_key: "composerShellRef",
|
|
@@ -7646,7 +7657,7 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
|
|
|
7646
7657
|
l(hd, {
|
|
7647
7658
|
ref_key: "composerActionsRef",
|
|
7648
7659
|
ref: m,
|
|
7649
|
-
onPickFile:
|
|
7660
|
+
onPickFile: be,
|
|
7650
7661
|
onOpenPoll: n[2] ||= (e) => y.value = !0
|
|
7651
7662
|
}, null, 512),
|
|
7652
7663
|
l(j(z), {
|
|
@@ -7657,8 +7668,8 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
|
|
|
7657
7668
|
disabled: e.disabled || !!e.editingMessage,
|
|
7658
7669
|
"aria-label": j(C)("addToMessage"),
|
|
7659
7670
|
"data-testid": "composer-actions-button",
|
|
7660
|
-
icon: j(
|
|
7661
|
-
onClick:
|
|
7671
|
+
icon: j(ce),
|
|
7672
|
+
onClick: we
|
|
7662
7673
|
}, null, 8, [
|
|
7663
7674
|
"class",
|
|
7664
7675
|
"disabled",
|
|
@@ -7677,12 +7688,12 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
|
|
|
7677
7688
|
onFocus: n[3] ||= (...e) => j(ne) && j(ne)(...e),
|
|
7678
7689
|
onInput: n[4] ||= (...e) => j(I) && j(I)(...e),
|
|
7679
7690
|
onKeyup: n[5] ||= (...e) => j(I) && j(I)(...e),
|
|
7680
|
-
onKeydown: n[6] ||= (...e) => j(
|
|
7681
|
-
onPaste:
|
|
7691
|
+
onKeydown: n[6] ||= (...e) => j(te) && j(te)(...e),
|
|
7692
|
+
onPaste: Se,
|
|
7682
7693
|
onContextmenu: n[7] ||= (...e) => j(P) && j(P)(...e)
|
|
7683
7694
|
}, null, 42, Gd)),
|
|
7684
7695
|
_.value || e.editingMessage || e.contextLabel || e.offlineMode ? (S(), a("div", Kd, [
|
|
7685
|
-
e.editingMessage ? (S(), r(j(
|
|
7696
|
+
e.editingMessage ? (S(), r(j(se), {
|
|
7686
7697
|
key: 0,
|
|
7687
7698
|
text: j(C)("editing"),
|
|
7688
7699
|
context: "info",
|
|
@@ -7690,7 +7701,7 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
|
|
|
7690
7701
|
size: "sm",
|
|
7691
7702
|
class: "composer-meta-tag"
|
|
7692
7703
|
}, null, 8, ["text"])) : i("", !0),
|
|
7693
|
-
e.contextLabel ? (S(), r(j(
|
|
7704
|
+
e.contextLabel ? (S(), r(j(se), {
|
|
7694
7705
|
key: 1,
|
|
7695
7706
|
text: e.contextLabel,
|
|
7696
7707
|
context: "contrast",
|
|
@@ -7707,8 +7718,8 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
|
|
|
7707
7718
|
class: g(["composer-schedule-button shrink-0 self-end", u.compact ? "h-9 w-9" : "h-10 w-10 max-md:h-9 max-md:w-9"]),
|
|
7708
7719
|
disabled: e.disabled,
|
|
7709
7720
|
"aria-label": j(C)("scheduledMessages"),
|
|
7710
|
-
icon: j(
|
|
7711
|
-
onClick:
|
|
7721
|
+
icon: j(ve),
|
|
7722
|
+
onClick: Oe
|
|
7712
7723
|
}, null, 8, [
|
|
7713
7724
|
"class",
|
|
7714
7725
|
"disabled",
|
|
@@ -7720,17 +7731,17 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
|
|
|
7720
7731
|
severity: "primary",
|
|
7721
7732
|
text: "",
|
|
7722
7733
|
class: g(["composer-send-button shrink-0 self-end", u.compact ? "h-9 w-9" : "h-10 w-10 max-md:h-9 max-md:w-9"]),
|
|
7723
|
-
disabled: e.disabled || !
|
|
7734
|
+
disabled: e.disabled || !me.value,
|
|
7724
7735
|
"aria-label": e.editingMessage ? j(C)("saveMessage") : _.value ? j(C)("sendAttachment") : j(C)("sendMessage"),
|
|
7725
|
-
icon: e.editingMessage ? j(
|
|
7726
|
-
onMousedown:
|
|
7727
|
-
onMouseup:
|
|
7728
|
-
onMouseleave:
|
|
7729
|
-
onTouchstart:
|
|
7730
|
-
onTouchend:
|
|
7731
|
-
onTouchcancel:
|
|
7732
|
-
onContextmenu: n[8] ||=
|
|
7733
|
-
onClick:
|
|
7736
|
+
icon: e.editingMessage ? j(de) : j(Pe),
|
|
7737
|
+
onMousedown: Ae,
|
|
7738
|
+
onMouseup: je,
|
|
7739
|
+
onMouseleave: je,
|
|
7740
|
+
onTouchstart: Ae,
|
|
7741
|
+
onTouchend: je,
|
|
7742
|
+
onTouchcancel: je,
|
|
7743
|
+
onContextmenu: n[8] ||= L(() => {}, ["prevent"]),
|
|
7744
|
+
onClick: Me
|
|
7734
7745
|
}, null, 8, [
|
|
7735
7746
|
"class",
|
|
7736
7747
|
"disabled",
|
|
@@ -7746,12 +7757,12 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
|
|
|
7746
7757
|
l(zd, {
|
|
7747
7758
|
ref_key: "triggerMenuRef",
|
|
7748
7759
|
ref: O,
|
|
7749
|
-
"highlighted-index": j(
|
|
7750
|
-
"onUpdate:highlightedIndex": n[10] ||= (e) => p(
|
|
7751
|
-
visible: j(
|
|
7752
|
-
position: j(
|
|
7760
|
+
"highlighted-index": j(oe),
|
|
7761
|
+
"onUpdate:highlightedIndex": n[10] ||= (e) => p(oe) ? oe.value = e : null,
|
|
7762
|
+
visible: j(V),
|
|
7763
|
+
position: j(ae),
|
|
7753
7764
|
candidates: j(ie),
|
|
7754
|
-
onSelect: n[11] ||= (e) => j(
|
|
7765
|
+
onSelect: n[11] ||= (e) => j(H)(e)
|
|
7755
7766
|
}, null, 8, [
|
|
7756
7767
|
"highlighted-index",
|
|
7757
7768
|
"visible",
|
|
@@ -7762,15 +7773,15 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
|
|
|
7762
7773
|
visible: y.value,
|
|
7763
7774
|
"onUpdate:visible": n[12] ||= (e) => y.value = e,
|
|
7764
7775
|
disabled: e.disabled,
|
|
7765
|
-
onSend:
|
|
7776
|
+
onSend: Ee
|
|
7766
7777
|
}, null, 8, ["visible", "disabled"]),
|
|
7767
7778
|
l(Nd, {
|
|
7768
7779
|
visible: b.value,
|
|
7769
7780
|
"onUpdate:visible": n[13] ||= (e) => b.value = e,
|
|
7770
7781
|
disabled: e.disabled,
|
|
7771
|
-
"can-schedule":
|
|
7772
|
-
"content-preview":
|
|
7773
|
-
onSchedule:
|
|
7782
|
+
"can-schedule": he.value,
|
|
7783
|
+
"content-preview": ge.value,
|
|
7784
|
+
onSchedule: De
|
|
7774
7785
|
}, null, 8, [
|
|
7775
7786
|
"visible",
|
|
7776
7787
|
"disabled",
|
|
@@ -7786,7 +7797,7 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
|
|
|
7786
7797
|
__name: "ConversationComposer",
|
|
7787
7798
|
props: { target: {} },
|
|
7788
7799
|
setup(e, { expose: t }) {
|
|
7789
|
-
let o = e, { t: s } =
|
|
7800
|
+
let o = e, { t: s } = K(), c = ju(), l = Fu(), u = Bu(), d = Gu(), f = Xu(), p = n(() => o.target === "thread"), m = n({
|
|
7790
7801
|
get: () => p.value ? u.threadDraft.value : u.draft.value,
|
|
7791
7802
|
set: (e) => {
|
|
7792
7803
|
p.value ? u.threadDraft.value = e : u.draft.value = e;
|
|
@@ -7998,49 +8009,49 @@ function $d(e) {
|
|
|
7998
8009
|
{
|
|
7999
8010
|
key: "reply",
|
|
8000
8011
|
label: e.t("reply"),
|
|
8001
|
-
icon:
|
|
8012
|
+
icon: Me,
|
|
8002
8013
|
visible: e.canReply(),
|
|
8003
8014
|
command: () => C(t)
|
|
8004
8015
|
},
|
|
8005
8016
|
{
|
|
8006
8017
|
key: "edit",
|
|
8007
8018
|
label: e.t("edit"),
|
|
8008
|
-
icon:
|
|
8019
|
+
icon: ye,
|
|
8009
8020
|
visible: s(t),
|
|
8010
8021
|
command: () => T(t)
|
|
8011
8022
|
},
|
|
8012
8023
|
{
|
|
8013
8024
|
key: "copy",
|
|
8014
8025
|
label: r.value === t.id ? e.t("copied") : e.t("copyText"),
|
|
8015
|
-
icon: r.value === t.id ?
|
|
8026
|
+
icon: r.value === t.id ? de : me,
|
|
8016
8027
|
visible: !0,
|
|
8017
8028
|
command: () => S(t)
|
|
8018
8029
|
},
|
|
8019
8030
|
{
|
|
8020
8031
|
key: "info",
|
|
8021
8032
|
label: e.t("info"),
|
|
8022
|
-
icon:
|
|
8033
|
+
icon: Te,
|
|
8023
8034
|
visible: c(t),
|
|
8024
8035
|
command: () => O(t)
|
|
8025
8036
|
},
|
|
8026
8037
|
{
|
|
8027
8038
|
key: "thread",
|
|
8028
8039
|
label: e.t("threadWithCount", { count: t.replyCount }),
|
|
8029
|
-
icon:
|
|
8040
|
+
icon: Ce,
|
|
8030
8041
|
visible: !e.isInThread() && e.canOpenThread(),
|
|
8031
8042
|
command: () => E(t)
|
|
8032
8043
|
},
|
|
8033
8044
|
{
|
|
8034
8045
|
key: "delete",
|
|
8035
8046
|
label: e.t("delete"),
|
|
8036
|
-
icon:
|
|
8047
|
+
icon: he,
|
|
8037
8048
|
visible: l(t),
|
|
8038
8049
|
command: () => k(t)
|
|
8039
8050
|
},
|
|
8040
8051
|
{
|
|
8041
8052
|
key: "translate",
|
|
8042
8053
|
label: e.t("translate"),
|
|
8043
|
-
icon:
|
|
8054
|
+
icon: Le,
|
|
8044
8055
|
visible: o(t),
|
|
8045
8056
|
command: () => D(t)
|
|
8046
8057
|
}
|
|
@@ -8298,7 +8309,7 @@ var uf = { class: "w-full" }, df = {
|
|
|
8298
8309
|
props: { attachment: {} },
|
|
8299
8310
|
emits: ["close"],
|
|
8300
8311
|
setup(t, { emit: s }) {
|
|
8301
|
-
let c = t, l = s, u = w(null), d = w(null), f = n(() => !!c.attachment?.url), p = n(() => c.attachment?.kind === "image"), m = n(() => c.attachment?.kind === "video"), h = n(() => c.attachment?.kind === "audio"), { t: _ } =
|
|
8312
|
+
let c = t, l = s, u = w(null), d = w(null), f = n(() => !!c.attachment?.url), p = n(() => c.attachment?.kind === "image"), m = n(() => c.attachment?.kind === "video"), h = n(() => c.attachment?.kind === "audio"), { t: _ } = K(), { scale: y, translateX: b, translateY: x, isDragging: C, resetTransform: T, handlePointerDown: E, handlePointerMove: O, handlePointerUp: A, handlePointerCancel: M, handleWheel: ee, handleDoubleClick: N } = lf({
|
|
8302
8313
|
viewportRef: u,
|
|
8303
8314
|
imageRef: d,
|
|
8304
8315
|
isImage: () => p.value
|
|
@@ -8323,7 +8334,7 @@ var uf = { class: "w-full" }, df = {
|
|
|
8323
8334
|
target: "_blank",
|
|
8324
8335
|
rel: "noreferrer",
|
|
8325
8336
|
class: "media-viewer-link-action"
|
|
8326
|
-
}, [(S(), r(D(j(
|
|
8337
|
+
}, [(S(), r(D(j(ke)), {
|
|
8327
8338
|
class: "size-4",
|
|
8328
8339
|
"aria-hidden": "true"
|
|
8329
8340
|
})), o("span", null, k(j(_)("openInNewTab")), 1)], 8, pf)) : i("", !0)]),
|
|
@@ -8371,7 +8382,7 @@ var uf = { class: "w-full" }, df = {
|
|
|
8371
8382
|
__name: "MessageDateSeparator",
|
|
8372
8383
|
props: { date: {} },
|
|
8373
8384
|
setup(e) {
|
|
8374
|
-
let t = e, { locale: r, t: i } =
|
|
8385
|
+
let t = e, { locale: r, t: i } = K(), s = n(() => {
|
|
8375
8386
|
let e = /* @__PURE__ */ new Date(), n = t.date, a = new Date(e.getFullYear(), e.getMonth(), e.getDate()), o = new Date(a);
|
|
8376
8387
|
o.setDate(o.getDate() - 1);
|
|
8377
8388
|
let s = new Date(a);
|
|
@@ -8405,7 +8416,7 @@ var uf = { class: "w-full" }, df = {
|
|
|
8405
8416
|
isOwn: { type: Boolean }
|
|
8406
8417
|
},
|
|
8407
8418
|
setup(e) {
|
|
8408
|
-
let t = e, r = w(null), s = w(!1), { t: c } =
|
|
8419
|
+
let t = e, r = w(null), s = w(!1), { t: c } = K(), l = n(() => {
|
|
8409
8420
|
try {
|
|
8410
8421
|
return new URL(t.url).hostname.replace(/^www\./, "");
|
|
8411
8422
|
} catch {
|
|
@@ -8518,7 +8529,7 @@ var uf = { class: "w-full" }, df = {
|
|
|
8518
8529
|
props: { message: {} },
|
|
8519
8530
|
emits: ["openMedia"],
|
|
8520
8531
|
setup(t, { emit: n }) {
|
|
8521
|
-
let s = n, { t: l } =
|
|
8532
|
+
let s = n, { t: l } = K();
|
|
8522
8533
|
function u(e) {
|
|
8523
8534
|
return !e || Number.isNaN(e) ? "" : e < 1024 * 1024 ? `${Math.round(e / 1024)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
|
|
8524
8535
|
}
|
|
@@ -8527,21 +8538,21 @@ var uf = { class: "w-full" }, df = {
|
|
|
8527
8538
|
}
|
|
8528
8539
|
function f(e) {
|
|
8529
8540
|
let t = d(e), n = e.mimeType?.toLowerCase() || "";
|
|
8530
|
-
return n === "application/pdf" || t === "pdf" ?
|
|
8541
|
+
return n === "application/pdf" || t === "pdf" ? je : [
|
|
8531
8542
|
"doc",
|
|
8532
8543
|
"docx",
|
|
8533
8544
|
"odt",
|
|
8534
8545
|
"rtf"
|
|
8535
|
-
].includes(t) ?
|
|
8546
|
+
].includes(t) ? ge : [
|
|
8536
8547
|
"xls",
|
|
8537
8548
|
"xlsx",
|
|
8538
8549
|
"csv",
|
|
8539
8550
|
"ods"
|
|
8540
|
-
].includes(t) ?
|
|
8551
|
+
].includes(t) ? Fe : [
|
|
8541
8552
|
"ppt",
|
|
8542
8553
|
"pptx",
|
|
8543
8554
|
"odp"
|
|
8544
|
-
].includes(t) ?
|
|
8555
|
+
].includes(t) ? xe : [
|
|
8545
8556
|
"txt",
|
|
8546
8557
|
"md",
|
|
8547
8558
|
"json",
|
|
@@ -8552,13 +8563,13 @@ var uf = { class: "w-full" }, df = {
|
|
|
8552
8563
|
"ts",
|
|
8553
8564
|
"html",
|
|
8554
8565
|
"css"
|
|
8555
|
-
].includes(t) || n.startsWith("text/") ? n.startsWith("text/") ?
|
|
8566
|
+
].includes(t) || n.startsWith("text/") ? n.startsWith("text/") ? Ie : pe : [
|
|
8556
8567
|
"zip",
|
|
8557
8568
|
"rar",
|
|
8558
8569
|
"7z",
|
|
8559
8570
|
"tar",
|
|
8560
8571
|
"gz"
|
|
8561
|
-
].includes(t) ?
|
|
8572
|
+
].includes(t) ? Se : ge;
|
|
8562
8573
|
}
|
|
8563
8574
|
function p(e) {
|
|
8564
8575
|
let t = Us(e.text).trim();
|
|
@@ -8624,11 +8635,11 @@ var uf = { class: "w-full" }, df = {
|
|
|
8624
8635
|
__name: "MessageDeliveryStatus",
|
|
8625
8636
|
props: { message: {} },
|
|
8626
8637
|
setup(e) {
|
|
8627
|
-
let t = e, { locale: s, t: c } =
|
|
8638
|
+
let t = e, { locale: s, t: c } = K();
|
|
8628
8639
|
function l(e) {
|
|
8629
8640
|
return new Intl.DateTimeFormat(s.value, {
|
|
8630
8641
|
timeStyle: "short",
|
|
8631
|
-
hourCycle:
|
|
8642
|
+
hourCycle: gt()
|
|
8632
8643
|
}).format(e);
|
|
8633
8644
|
}
|
|
8634
8645
|
let u = n(() => {
|
|
@@ -8638,34 +8649,34 @@ var uf = { class: "w-full" }, df = {
|
|
|
8638
8649
|
case "read": return {
|
|
8639
8650
|
state: "read",
|
|
8640
8651
|
label: c("read"),
|
|
8641
|
-
icon:
|
|
8652
|
+
icon: _e,
|
|
8642
8653
|
class: "text-success"
|
|
8643
8654
|
};
|
|
8644
8655
|
case "delivered": return {
|
|
8645
8656
|
state: "delivered",
|
|
8646
8657
|
label: c("delivered"),
|
|
8647
|
-
icon:
|
|
8658
|
+
icon: de
|
|
8648
8659
|
};
|
|
8649
8660
|
case "queued": return {
|
|
8650
8661
|
state: "queued",
|
|
8651
8662
|
label: c("queued"),
|
|
8652
|
-
icon:
|
|
8663
|
+
icon: Ne
|
|
8653
8664
|
};
|
|
8654
8665
|
case "sending": return {
|
|
8655
8666
|
state: "sending",
|
|
8656
8667
|
label: c("sending"),
|
|
8657
|
-
icon:
|
|
8668
|
+
icon: Pe
|
|
8658
8669
|
};
|
|
8659
8670
|
case "failed": return {
|
|
8660
8671
|
state: "failed",
|
|
8661
8672
|
label: c("failed"),
|
|
8662
|
-
icon:
|
|
8673
|
+
icon: be,
|
|
8663
8674
|
class: "text-danger"
|
|
8664
8675
|
};
|
|
8665
8676
|
default: return {
|
|
8666
8677
|
state: "sent",
|
|
8667
8678
|
label: c("sent"),
|
|
8668
|
-
icon:
|
|
8679
|
+
icon: Ae
|
|
8669
8680
|
};
|
|
8670
8681
|
}
|
|
8671
8682
|
});
|
|
@@ -8689,7 +8700,7 @@ var uf = { class: "w-full" }, df = {
|
|
|
8689
8700
|
__name: "MessageItemHeader",
|
|
8690
8701
|
props: { message: {} },
|
|
8691
8702
|
setup(e) {
|
|
8692
|
-
let t = e, { locale: n, t: s } =
|
|
8703
|
+
let t = e, { locale: n, t: s } = K();
|
|
8693
8704
|
function c(e) {
|
|
8694
8705
|
return e ? new Intl.DateTimeFormat(n.value, {
|
|
8695
8706
|
month: "short",
|
|
@@ -8701,7 +8712,7 @@ var uf = { class: "w-full" }, df = {
|
|
|
8701
8712
|
function l() {
|
|
8702
8713
|
return t.message.senderName?.trim() || (t.message.isOwn ? s("you") : s("system"));
|
|
8703
8714
|
}
|
|
8704
|
-
return (t, n) => (S(), a("div", fp, [o("span", pp, k(l()), 1), e.message.scheduled?.scheduleDate ? (S(), r(j(
|
|
8715
|
+
return (t, n) => (S(), a("div", fp, [o("span", pp, k(l()), 1), e.message.scheduled?.scheduleDate ? (S(), r(j(se), {
|
|
8705
8716
|
key: 0,
|
|
8706
8717
|
text: j(s)("scheduledDateLabel", { date: c(e.message.scheduled.scheduleDate) }),
|
|
8707
8718
|
context: "warn",
|
|
@@ -8740,7 +8751,7 @@ var uf = { class: "w-full" }, df = {
|
|
|
8740
8751
|
},
|
|
8741
8752
|
emits: ["toggleReaction", "openThread"],
|
|
8742
8753
|
setup(e, { emit: t }) {
|
|
8743
|
-
let s = e, c = t, { t: u } =
|
|
8754
|
+
let s = e, c = t, { t: u } = K(), d = n(() => u("threadReplies", { count: s.message.replyCount })), f = n(() => s.canOpenThread !== !1 && s.message.replyCount > 0);
|
|
8744
8755
|
return (t, n) => (S(), a("div", _p, [l(gp, {
|
|
8745
8756
|
message: e.message,
|
|
8746
8757
|
disabled: e.canReact === !1,
|
|
@@ -8752,8 +8763,8 @@ var uf = { class: "w-full" }, df = {
|
|
|
8752
8763
|
class: "message-reactions__thread-button text-subtle hover:text-default inline-flex items-center gap-1 rounded-full px-1 py-0 font-medium transition",
|
|
8753
8764
|
"aria-label": d.value,
|
|
8754
8765
|
title: d.value,
|
|
8755
|
-
onClick: n[1] ||=
|
|
8756
|
-
}, [(S(), r(D(j(
|
|
8766
|
+
onClick: n[1] ||= L((e) => c("openThread"), ["stop"])
|
|
8767
|
+
}, [(S(), r(D(j(Me)), {
|
|
8757
8768
|
class: "size-4",
|
|
8758
8769
|
"aria-hidden": "true"
|
|
8759
8770
|
})), o("span", yp, k(e.message.replyCount), 1)], 8, vp)) : i("", !0)]));
|
|
@@ -8770,7 +8781,7 @@ var uf = { class: "w-full" }, df = {
|
|
|
8770
8781
|
},
|
|
8771
8782
|
emits: ["vote"],
|
|
8772
8783
|
setup(t, { emit: n }) {
|
|
8773
|
-
let r = t, s = n, { t: c } =
|
|
8784
|
+
let r = t, s = n, { t: c } = K();
|
|
8774
8785
|
function l(e) {
|
|
8775
8786
|
let t = r.currentUserId;
|
|
8776
8787
|
return !t || !r.message.poll ? !1 : r.message.poll.options.some((n) => n.id === e && n.voters.includes(t));
|
|
@@ -8886,7 +8897,7 @@ var uf = { class: "w-full" }, df = {
|
|
|
8886
8897
|
key: 0,
|
|
8887
8898
|
text: t.message.text,
|
|
8888
8899
|
class: g(f.value)
|
|
8889
|
-
}, null, 8, ["text", "class"])) : (S(), a(e, { key: 1 }, [t.canShowSenderAvatar && !t.message.isOwn ? (S(), r(j(
|
|
8900
|
+
}, null, 8, ["text", "class"])) : (S(), a(e, { key: 1 }, [t.canShowSenderAvatar && !t.message.isOwn ? (S(), r(j(R), {
|
|
8890
8901
|
key: 0,
|
|
8891
8902
|
image: t.message.senderAvatar,
|
|
8892
8903
|
label: t.message.senderAvatar ? void 0 : t.message.senderName.slice(0, 1).toUpperCase(),
|
|
@@ -8979,7 +8990,7 @@ var uf = { class: "w-full" }, df = {
|
|
|
8979
8990
|
class: "message-reaction-more",
|
|
8980
8991
|
disabled: !t.canReact,
|
|
8981
8992
|
onClick: p
|
|
8982
|
-
}, [(S(), r(D(u.value ? j(
|
|
8993
|
+
}, [(S(), r(D(u.value ? j(De) : j(Ee)), {
|
|
8983
8994
|
class: "size-7",
|
|
8984
8995
|
"aria-hidden": "true"
|
|
8985
8996
|
}))], 8, Hp)]), u.value && t.canReact ? (S(), a("div", Up, [(S(!0), a(e, null, T(d.value, (e) => (S(), a("button", {
|
|
@@ -9057,7 +9068,7 @@ var uf = { class: "w-full" }, df = {
|
|
|
9057
9068
|
message: e.message,
|
|
9058
9069
|
"can-react": e.canReact,
|
|
9059
9070
|
onReact: o[0] ||= (e) => s("react", e)
|
|
9060
|
-
}, null, 8, ["message", "can-react"]), l(j(
|
|
9071
|
+
}, null, 8, ["message", "can-react"]), l(j(ae), { model: e.actionItems }, null, 8, ["model"])], 4)) : i("", !0)]));
|
|
9061
9072
|
}
|
|
9062
9073
|
}), [["__scopeId", "data-v-54f6bf5c"]]), qp = { class: "chat-header border-default bg-elevation-surface-default sticky top-0 z-10 flex items-center justify-between gap-3 border-b px-4 py-3 max-md:px-4 max-md:pb-3 sm:px-5 sm:py-3.5" }, Jp = {
|
|
9063
9074
|
key: 0,
|
|
@@ -9072,13 +9083,13 @@ var uf = { class: "w-full" }, df = {
|
|
|
9072
9083
|
parentMessage: {}
|
|
9073
9084
|
},
|
|
9074
9085
|
setup(t) {
|
|
9075
|
-
let { t: n } =
|
|
9076
|
-
return (s, c) => (S(), a("header", qp, [t.conversation ? (S(), a("div", Jp, [l(j(
|
|
9086
|
+
let { t: n } = K();
|
|
9087
|
+
return (s, c) => (S(), a("header", qp, [t.conversation ? (S(), a("div", Jp, [l(j(R), {
|
|
9077
9088
|
image: t.conversation.avatar,
|
|
9078
9089
|
label: t.conversation.avatar ? void 0 : t.conversation.title.slice(0, 1).toUpperCase(),
|
|
9079
9090
|
shape: "circle",
|
|
9080
9091
|
class: "chat-header__avatar shrink-0"
|
|
9081
|
-
}, null, 8, ["image", "label"]), o("div", Yp, [o("p", Xp, k(t.parentMessage ? j(n)("thread") : t.conversation.title), 1), o("p", Zp, [t.parentMessage ? (S(), a("span", Qp, k(t.parentMessage.senderName), 1)) : (S(), a("span", $p, k(t.conversation.memberCount ? j(n)("members", { count: t.conversation.memberCount }) : j(n)("groupChat")), 1))])])])) : i("", !0), o("div", em, [t.conversation?.tags?.length ? (S(), a("div", tm, [(S(!0), a(e, null, T(t.conversation.tags.slice(0, 3), (e) => (S(), r(j(
|
|
9092
|
+
}, null, 8, ["image", "label"]), o("div", Yp, [o("p", Xp, k(t.parentMessage ? j(n)("thread") : t.conversation.title), 1), o("p", Zp, [t.parentMessage ? (S(), a("span", Qp, k(t.parentMessage.senderName), 1)) : (S(), a("span", $p, k(t.conversation.memberCount ? j(n)("members", { count: t.conversation.memberCount }) : j(n)("groupChat")), 1))])])])) : i("", !0), o("div", em, [t.conversation?.tags?.length ? (S(), a("div", tm, [(S(!0), a(e, null, T(t.conversation.tags.slice(0, 3), (e) => (S(), r(j(se), {
|
|
9082
9093
|
key: e,
|
|
9083
9094
|
text: e,
|
|
9084
9095
|
context: "secondary",
|
|
@@ -9105,13 +9116,13 @@ var uf = { class: "w-full" }, df = {
|
|
|
9105
9116
|
},
|
|
9106
9117
|
emits: ["anchorclick"],
|
|
9107
9118
|
setup(t) {
|
|
9108
|
-
let s = t, { t: c } =
|
|
9119
|
+
let s = t, { t: c } = K(), u = ju(), d = Fu(), f = Xu(), p = n(() => s.target === "thread"), m = n(() => p.value ? d.threadMessages.value : s.hideGroupActions ? d.messages.value.filter((e) => e.kind !== "action") : d.messages.value), h = n(() => p.value ? d.loadingThreadMessages.value : d.loadingMessages.value), _ = n(() => p.value ? d.activeThreadParentMessage.value : null), v = n(() => p.value ? !1 : u.canOpenThread.value), y = n(() => s.showHeader ?? !p.value), b = n(() => p.value ? d.hasOlderThreadMessages.value : d.hasOlderMessages.value), x = n(() => p.value ? d.loadingOlderThreadMessages.value : d.loadingOlderMessages.value), C = n(() => p.value ? !0 : d.showDefaultEmptyState.value), D = n(() => {
|
|
9109
9120
|
let e = u.conversation.value;
|
|
9110
9121
|
return e ? _.value ? c("thread") : e.title : "";
|
|
9111
9122
|
}), O = n(() => {
|
|
9112
9123
|
let e = u.conversation.value;
|
|
9113
9124
|
return e ? _.value ? _.value.senderName : e.memberCount ? c("members", { count: e.memberCount }) : c("groupChat") : "";
|
|
9114
|
-
}), A = n(() => u.conversation.value?.memberCount ?? 0), M = w(null), N = w(null), P = n(() => !!_.value), F = n(() => P.value && !y.value), I = n(() => Eu(u.conversation.value)),
|
|
9125
|
+
}), A = n(() => u.conversation.value?.memberCount ?? 0), M = w(null), N = w(null), P = n(() => !!_.value), F = n(() => P.value && !y.value), I = n(() => Eu(u.conversation.value)), te = ee("threadRef"), { handleThreadScroll: L } = of({
|
|
9115
9126
|
getConversation: () => u.conversation.value,
|
|
9116
9127
|
getParentMessage: () => _.value,
|
|
9117
9128
|
getMessages: () => m.value,
|
|
@@ -9119,14 +9130,14 @@ var uf = { class: "w-full" }, df = {
|
|
|
9119
9130
|
isLoadingOlder: () => x.value,
|
|
9120
9131
|
canLoadOlder: () => b.value,
|
|
9121
9132
|
onLoadOlder: () => f.emit("list:loadOlder", { target: s.target }),
|
|
9122
|
-
threadRef:
|
|
9123
|
-
}),
|
|
9133
|
+
threadRef: te
|
|
9134
|
+
}), R = ee("actionMenuRef"), { activeActionMessage: z, handleMessageContextMenu: ne, handleMessageTap: B, resetActionMenuState: re, reactToMessage: ie, toggleInlineReaction: ae, getActionItems: oe } = $d({
|
|
9124
9135
|
canUseMessageActions: () => u.canUseMessageActions.value,
|
|
9125
9136
|
canReact: () => u.canReact.value,
|
|
9126
9137
|
canReply: () => u.canReply.value,
|
|
9127
9138
|
canOpenThread: () => v.value,
|
|
9128
9139
|
isInThread: () => p.value,
|
|
9129
|
-
actionMenuRef:
|
|
9140
|
+
actionMenuRef: R,
|
|
9130
9141
|
t: c,
|
|
9131
9142
|
emit: {
|
|
9132
9143
|
reply: (e) => f.emit("message:reply", e),
|
|
@@ -9142,20 +9153,20 @@ var uf = { class: "w-full" }, df = {
|
|
|
9142
9153
|
},
|
|
9143
9154
|
onMenuOpen: () => f.emit("ui:closeComposerActions")
|
|
9144
9155
|
});
|
|
9145
|
-
function
|
|
9156
|
+
function V(e) {
|
|
9146
9157
|
return !!e.url && [
|
|
9147
9158
|
"image",
|
|
9148
9159
|
"video",
|
|
9149
9160
|
"audio"
|
|
9150
9161
|
].includes(e.kind);
|
|
9151
9162
|
}
|
|
9152
|
-
function
|
|
9153
|
-
|
|
9163
|
+
function se(e) {
|
|
9164
|
+
V(e) && (M.value = e);
|
|
9154
9165
|
}
|
|
9155
|
-
function
|
|
9166
|
+
function H() {
|
|
9156
9167
|
M.value = null;
|
|
9157
9168
|
}
|
|
9158
|
-
async function
|
|
9169
|
+
async function ce(e, t) {
|
|
9159
9170
|
N.value = `${e.id}:${t}`;
|
|
9160
9171
|
try {
|
|
9161
9172
|
f.emit("message:votePoll", {
|
|
@@ -9168,15 +9179,15 @@ var uf = { class: "w-full" }, df = {
|
|
|
9168
9179
|
}, 300);
|
|
9169
9180
|
}
|
|
9170
9181
|
}
|
|
9171
|
-
function
|
|
9182
|
+
function le(e) {
|
|
9172
9183
|
v.value && f.emit("message:openThread", e);
|
|
9173
9184
|
}
|
|
9174
|
-
function
|
|
9185
|
+
function U(e, t) {
|
|
9175
9186
|
return e.getFullYear() !== t.getFullYear() || e.getMonth() !== t.getMonth() || e.getDate() !== t.getDate();
|
|
9176
9187
|
}
|
|
9177
|
-
function
|
|
9188
|
+
function ue(e) {
|
|
9178
9189
|
let t = m.value;
|
|
9179
|
-
return e === 0 ? !0 :
|
|
9190
|
+
return e === 0 ? !0 : U(t[e].sentAt, t[e - 1].sentAt);
|
|
9180
9191
|
}
|
|
9181
9192
|
return (t, n) => (S(), a(e, null, [
|
|
9182
9193
|
o("section", { class: g(["message-list-root", [t.$attrs.class, F.value ? "message-list--embedded-thread" : P.value ? "message-list--thread" : "message-list--main"]]) }, [y.value ? E(t.$slots, "header", {
|
|
@@ -9195,12 +9206,12 @@ var uf = { class: "w-full" }, df = {
|
|
|
9195
9206
|
class: g(["message-list__body", F.value || P.value ? "bg-elevation-surface-overlay" : ""])
|
|
9196
9207
|
}, [o("div", {
|
|
9197
9208
|
ref_key: "threadRef",
|
|
9198
|
-
ref:
|
|
9209
|
+
ref: te,
|
|
9199
9210
|
class: g(["message-list__scroll min-h-0 flex-1", F.value ? "p-0" : P.value ? "px-5 py-4" : "px-2 pt-2 pb-3"]),
|
|
9200
|
-
onScroll: n[2] ||= (...e) => j(
|
|
9211
|
+
onScroll: n[2] ||= (...e) => j(L) && j(L)(...e)
|
|
9201
9212
|
}, [o("div", im, [
|
|
9202
9213
|
_.value ? (S(), a("div", am, [o("p", om, k(_.value.senderName), 1), o("p", sm, k(j(Ws)(_.value, j(c)("message"), j(u).mentionNameByUid.value)), 1)])) : i("", !0),
|
|
9203
|
-
(S(!0), a(e, null, T(m.value, (o, c) => (S(), a(e, { key: o.id }, [
|
|
9214
|
+
(S(!0), a(e, null, T(m.value, (o, c) => (S(), a(e, { key: o.id }, [ue(c) ? (S(), r(kf, {
|
|
9204
9215
|
key: 0,
|
|
9205
9216
|
date: o.sentAt
|
|
9206
9217
|
}, null, 8, ["date"])) : i("", !0), l(Lp, {
|
|
@@ -9214,10 +9225,10 @@ var uf = { class: "w-full" }, df = {
|
|
|
9214
9225
|
"action-message-row-class": s.actionMessageRowClass,
|
|
9215
9226
|
onContextmenu: (e) => j(ne)(o, e),
|
|
9216
9227
|
onTap: (e) => j(B)(o, e),
|
|
9217
|
-
onOpenMedia:
|
|
9218
|
-
onVotePoll: (e) =>
|
|
9219
|
-
onToggleReaction: (e) => j(
|
|
9220
|
-
onOpenThread: (e) =>
|
|
9228
|
+
onOpenMedia: se,
|
|
9229
|
+
onVotePoll: (e) => ce(o, e),
|
|
9230
|
+
onToggleReaction: (e) => j(ae)(o, e),
|
|
9231
|
+
onOpenThread: (e) => le(o),
|
|
9221
9232
|
onOpenReferencedMessage: n[0] ||= (e) => j(f).emit("message:openReference", e),
|
|
9222
9233
|
onAnchorclick: n[1] ||= (e, n) => t.$emit("anchorclick", e, n)
|
|
9223
9234
|
}, null, 8, [
|
|
@@ -9239,14 +9250,14 @@ var uf = { class: "w-full" }, df = {
|
|
|
9239
9250
|
])], 34), o("footer", { class: g(["message-list__composer flex shrink-0 flex-col", P.value ? F.value ? "bg-transparent p-0" : "message-list__composer--thread" : "bg-transparent p-0"]) }, [E(t.$slots, "composer", {}, void 0, !0)], 2)], 2)) : (S(), a("div", rm, k(j(c)("selectConversationToStart")), 1))], 2),
|
|
9240
9251
|
l(Ef, {
|
|
9241
9252
|
attachment: M.value,
|
|
9242
|
-
onClose:
|
|
9253
|
+
onClose: H
|
|
9243
9254
|
}, null, 8, ["attachment"]),
|
|
9244
9255
|
l(Kp, {
|
|
9245
9256
|
ref_key: "actionMenuRef",
|
|
9246
|
-
ref:
|
|
9257
|
+
ref: R,
|
|
9247
9258
|
message: j(z),
|
|
9248
9259
|
"can-react": j(u).canReact.value,
|
|
9249
|
-
"action-items": j(z) ? j(
|
|
9260
|
+
"action-items": j(z) ? j(oe)(j(z)) : [],
|
|
9250
9261
|
onHide: j(re),
|
|
9251
9262
|
onReact: n[3] ||= (e) => j(ie)(j(z), e)
|
|
9252
9263
|
}, null, 8, [
|
|
@@ -9275,7 +9286,7 @@ var uf = { class: "w-full" }, df = {
|
|
|
9275
9286
|
return (n, r) => (S(), a("section", um, [o("div", dm, [o("p", fm, k(t.title), 1), o("span", pm, k(t.receipts.length), 1)]), t.receipts.length ? (S(), a("div", mm, [(S(!0), a(e, null, T(t.receipts, (e) => (S(), a("div", {
|
|
9276
9287
|
key: `${e.kind}-${e.user.uid}`,
|
|
9277
9288
|
class: "receipt-section__row"
|
|
9278
|
-
}, [o("div", hm, [l(j(
|
|
9289
|
+
}, [o("div", hm, [l(j(R), {
|
|
9279
9290
|
image: e.user.avatar,
|
|
9280
9291
|
label: e.user.avatar ? void 0 : e.user.name.slice(0, 1).toUpperCase(),
|
|
9281
9292
|
shape: "circle",
|
|
@@ -9305,12 +9316,12 @@ var uf = { class: "w-full" }, df = {
|
|
|
9305
9316
|
},
|
|
9306
9317
|
emits: ["close"],
|
|
9307
9318
|
setup(e, { emit: t }) {
|
|
9308
|
-
let s = e, c = t, { locale: u, t: d } =
|
|
9319
|
+
let s = e, c = t, { locale: u, t: d } = K(), f = ju(), p = n(() => s.receipts.filter((e) => e.kind === "delivered")), m = n(() => s.receipts.filter((e) => e.kind === "read")), h = n(() => s.receipts.filter((e) => e.kind === "delivered" || e.kind === "read"));
|
|
9309
9320
|
function g(e) {
|
|
9310
9321
|
return e ? new Intl.DateTimeFormat(u.value, {
|
|
9311
9322
|
dateStyle: "medium",
|
|
9312
9323
|
timeStyle: "short",
|
|
9313
|
-
hourCycle:
|
|
9324
|
+
hourCycle: gt()
|
|
9314
9325
|
}).format(e) : d("notYet");
|
|
9315
9326
|
}
|
|
9316
9327
|
function _(e, t) {
|
|
@@ -9325,19 +9336,19 @@ var uf = { class: "w-full" }, df = {
|
|
|
9325
9336
|
}, {
|
|
9326
9337
|
default: I(() => [e.message ? (S(), a("div", Sm, [o("div", Cm, [o("p", wm, k(j(Ws)(e.message, j(d)("message"), j(f).mentionNameByUid.value)), 1), o("div", Tm, [
|
|
9327
9338
|
o("div", Em, [o("p", Dm, k(j(d)("sent")), 1), o("p", Om, k(g(e.message.sentAt)), 1)]),
|
|
9328
|
-
o("div", km, [o("div", Am, [o("p", jm, k(j(d)("deliveredToAll")), 1), h.value.length ? (S(), r(j(
|
|
9339
|
+
o("div", km, [o("div", Am, [o("p", jm, k(j(d)("deliveredToAll")), 1), h.value.length ? (S(), r(j(se), {
|
|
9329
9340
|
key: 0,
|
|
9330
9341
|
text: String(h.value.length),
|
|
9331
9342
|
context: "secondary",
|
|
9332
9343
|
rounded: ""
|
|
9333
9344
|
}, null, 8, ["text"])) : i("", !0)]), o("p", Mm, k(_(e.message.receipts.deliveredAt, h.value.length)), 1)]),
|
|
9334
|
-
o("div", Nm, [o("div", Pm, [o("p", Fm, k(j(d)("readByAll")), 1), m.value.length ? (S(), r(j(
|
|
9345
|
+
o("div", Nm, [o("div", Pm, [o("p", Fm, k(j(d)("readByAll")), 1), m.value.length ? (S(), r(j(se), {
|
|
9335
9346
|
key: 0,
|
|
9336
9347
|
text: String(m.value.length),
|
|
9337
9348
|
context: "success",
|
|
9338
9349
|
rounded: ""
|
|
9339
9350
|
}, null, 8, ["text"])) : i("", !0)]), o("p", Im, k(_(e.message.receipts.readAt, m.value.length)), 1)])
|
|
9340
|
-
])]), e.loading ? (S(), a("div", Lm, [l(j(
|
|
9351
|
+
])]), e.loading ? (S(), a("div", Lm, [l(j(V), {
|
|
9341
9352
|
style: {
|
|
9342
9353
|
width: "2.5rem",
|
|
9343
9354
|
height: "2.5rem"
|
|
@@ -9412,7 +9423,7 @@ var uf = { class: "w-full" }, df = {
|
|
|
9412
9423
|
"editText"
|
|
9413
9424
|
],
|
|
9414
9425
|
setup(t, { emit: s }) {
|
|
9415
|
-
let c = t, u = s, d = w(null), f = w(null), p = w(!1), m = w(""), h = w(""), g = w(""), { locale: _, t: v } =
|
|
9426
|
+
let c = t, u = s, d = w(null), f = w(null), p = w(!1), m = w(""), h = w(""), g = w(""), { locale: _, t: v } = K(), y = n(() => c.messages.filter((e) => !e.isDeleted && !!e.scheduled?.scheduleDate)), b = n(() => /^([01]\d|2[0-3]):([0-5]\d)$/.test(h.value));
|
|
9416
9427
|
F(() => c.open, (e) => {
|
|
9417
9428
|
e || (d.value = null, f.value = null, p.value = !1, m.value = "", h.value = "", g.value = "");
|
|
9418
9429
|
});
|
|
@@ -9420,7 +9431,7 @@ var uf = { class: "w-full" }, df = {
|
|
|
9420
9431
|
return e ? new Intl.DateTimeFormat(_.value, {
|
|
9421
9432
|
dateStyle: "medium",
|
|
9422
9433
|
timeStyle: "short",
|
|
9423
|
-
hourCycle:
|
|
9434
|
+
hourCycle: gt()
|
|
9424
9435
|
}).format(e) : v("unscheduled");
|
|
9425
9436
|
}
|
|
9426
9437
|
function C(e) {
|
|
@@ -9452,10 +9463,10 @@ var uf = { class: "w-full" }, df = {
|
|
|
9452
9463
|
function P() {
|
|
9453
9464
|
p.value = !0;
|
|
9454
9465
|
}
|
|
9455
|
-
function
|
|
9466
|
+
function L(e) {
|
|
9456
9467
|
return e.attachments.length ? !(d.value === e.id && p.value) : !1;
|
|
9457
9468
|
}
|
|
9458
|
-
function
|
|
9469
|
+
function R(e) {
|
|
9459
9470
|
if (!e.scheduled?.messageId || !e.scheduled?.muid || !e.scheduled?.originalChatUid || !m.value || !b.value) return;
|
|
9460
9471
|
let [t, n, r] = m.value.split("-").map(Number), [i, a] = h.value.split(":").map(Number), o = new Date(t, n - 1, r, i, a, 0, 0);
|
|
9461
9472
|
u("reschedule", {
|
|
@@ -9486,7 +9497,7 @@ var uf = { class: "w-full" }, df = {
|
|
|
9486
9497
|
"close-label": j(v)("close"),
|
|
9487
9498
|
onClose: s[3] ||= (e) => u("close")
|
|
9488
9499
|
}, {
|
|
9489
|
-
default: I(() => [o("div", Vm, [t.loading ? (S(), a("div", Hm, [l(j(
|
|
9500
|
+
default: I(() => [o("div", Vm, [t.loading ? (S(), a("div", Hm, [l(j(V), {
|
|
9490
9501
|
style: {
|
|
9491
9502
|
width: "2.75rem",
|
|
9492
9503
|
height: "2.75rem"
|
|
@@ -9496,33 +9507,33 @@ var uf = { class: "w-full" }, df = {
|
|
|
9496
9507
|
key: e.id,
|
|
9497
9508
|
class: "border-default rounded-lg border px-4 py-3"
|
|
9498
9509
|
}, [o("div", Gm, [o("div", Km, [
|
|
9499
|
-
o("div", qm, [o("div", Jm, [e.kind === "poll" ? (S(), r(j(
|
|
9510
|
+
o("div", qm, [o("div", Jm, [e.kind === "poll" ? (S(), r(j(se), {
|
|
9500
9511
|
key: 0,
|
|
9501
9512
|
text: j(v)("poll"),
|
|
9502
9513
|
context: "info",
|
|
9503
9514
|
rounded: ""
|
|
9504
|
-
}, null, 8, ["text"])) : e.attachments.length ? (S(), r(j(
|
|
9515
|
+
}, null, 8, ["text"])) : e.attachments.length ? (S(), r(j(se), {
|
|
9505
9516
|
key: 1,
|
|
9506
9517
|
text: D(e.attachments[0].kind),
|
|
9507
9518
|
context: "info",
|
|
9508
9519
|
rounded: ""
|
|
9509
|
-
}, null, 8, ["text"])) : (S(), r(j(
|
|
9520
|
+
}, null, 8, ["text"])) : (S(), r(j(se), {
|
|
9510
9521
|
key: 2,
|
|
9511
9522
|
text: j(v)("message"),
|
|
9512
9523
|
context: "info",
|
|
9513
9524
|
rounded: ""
|
|
9514
9525
|
}, null, 8, ["text"]))]), l(j(z), {
|
|
9515
|
-
icon: j(
|
|
9526
|
+
icon: j(he),
|
|
9516
9527
|
text: "",
|
|
9517
9528
|
size: "small",
|
|
9518
9529
|
onClick: (t) => B(e)
|
|
9519
9530
|
}, null, 8, ["icon", "onClick"])]),
|
|
9520
9531
|
o("div", Ym, [o("p", Xm, k(x(e.scheduled?.scheduleDate)), 1), e.kind === "poll" && e.poll ? (S(), a("p", Zm, k(e.poll.question), 1)) : (S(), a("p", Qm, k(j(Ws)(e, j(v)("attachment"))), 1))]),
|
|
9521
|
-
|
|
9532
|
+
L(e) && !(d.value === e.id && f.value === "text") ? (S(), a("div", $m, [l(cp, { message: ee(e) }, null, 8, ["message"])])) : i("", !0)
|
|
9522
9533
|
]), o("div", eh, [e.kind === "poll" ? i("", !0) : (S(), r(j(z), {
|
|
9523
9534
|
key: 0,
|
|
9524
9535
|
label: j(v)("edit"),
|
|
9525
|
-
icon: j(
|
|
9536
|
+
icon: j(ye),
|
|
9526
9537
|
severity: "secondary",
|
|
9527
9538
|
size: "small",
|
|
9528
9539
|
onClick: (t) => A(e)
|
|
@@ -9533,7 +9544,7 @@ var uf = { class: "w-full" }, df = {
|
|
|
9533
9544
|
])), e.scheduled?.messageId && e.scheduled?.muid && e.scheduled?.originalChatUid ? (S(), r(j(z), {
|
|
9534
9545
|
key: 1,
|
|
9535
9546
|
label: j(v)("reschedule"),
|
|
9536
|
-
icon: j(
|
|
9547
|
+
icon: j(ue),
|
|
9537
9548
|
severity: "secondary",
|
|
9538
9549
|
size: "small",
|
|
9539
9550
|
onClick: (t) => O(e)
|
|
@@ -9541,11 +9552,11 @@ var uf = { class: "w-full" }, df = {
|
|
|
9541
9552
|
"label",
|
|
9542
9553
|
"icon",
|
|
9543
9554
|
"onClick"
|
|
9544
|
-
])) : i("", !0)])]), d.value === e.id && f.value === "reschedule" ? (S(), a("div", th, [o("div", nh, [
|
|
9555
|
+
])) : i("", !0)])]), d.value === e.id && f.value === "reschedule" ? (S(), a("div", th, [o("div", nh, [te(o("input", {
|
|
9545
9556
|
"onUpdate:modelValue": s[0] ||= (e) => m.value = e,
|
|
9546
9557
|
type: "date",
|
|
9547
9558
|
class: "surface-input body-md w-full rounded-xl p-2 ring-0 outline-none"
|
|
9548
|
-
}, null, 512), [[N, m.value]]),
|
|
9559
|
+
}, null, 512), [[N, m.value]]), te(o("input", {
|
|
9549
9560
|
"onUpdate:modelValue": s[1] ||= (e) => h.value = e,
|
|
9550
9561
|
type: "time",
|
|
9551
9562
|
inputmode: "numeric",
|
|
@@ -9557,7 +9568,7 @@ var uf = { class: "w-full" }, df = {
|
|
|
9557
9568
|
label: j(v)("save"),
|
|
9558
9569
|
size: "small",
|
|
9559
9570
|
disabled: !m.value || !b.value,
|
|
9560
|
-
onClick: (t) =>
|
|
9571
|
+
onClick: (t) => R(e)
|
|
9561
9572
|
}, null, 8, [
|
|
9562
9573
|
"label",
|
|
9563
9574
|
"disabled",
|
|
@@ -9568,8 +9579,8 @@ var uf = { class: "w-full" }, df = {
|
|
|
9568
9579
|
text: "",
|
|
9569
9580
|
onClick: M
|
|
9570
9581
|
}, null, 8, ["label"])])])) : d.value === e.id && f.value === "text" ? (S(), a("div", ih, [
|
|
9571
|
-
|
|
9572
|
-
icon: j(
|
|
9582
|
+
L(e) ? (S(), a("div", ah, [l(cp, { message: ee(e) }, null, 8, ["message"]), o("div", oh, [l(j(z), {
|
|
9583
|
+
icon: j(fe),
|
|
9573
9584
|
"aria-label": j(v)("remove"),
|
|
9574
9585
|
text: "",
|
|
9575
9586
|
rounded: "",
|
|
@@ -9577,7 +9588,7 @@ var uf = { class: "w-full" }, df = {
|
|
|
9577
9588
|
size: "small",
|
|
9578
9589
|
onClick: P
|
|
9579
9590
|
}, null, 8, ["icon", "aria-label"])])])) : i("", !0),
|
|
9580
|
-
|
|
9591
|
+
te(o("textarea", {
|
|
9581
9592
|
"onUpdate:modelValue": s[2] ||= (e) => g.value = e,
|
|
9582
9593
|
rows: "3",
|
|
9583
9594
|
class: "surface-input body-md w-full rounded-xl px-3 py-2 ring-0 outline-none",
|
|
@@ -9676,8 +9687,8 @@ var uf = { class: "w-full" }, df = {
|
|
|
9676
9687
|
"linkClicked",
|
|
9677
9688
|
"chatNotAMember"
|
|
9678
9689
|
],
|
|
9679
|
-
setup(t, { expose:
|
|
9680
|
-
function
|
|
9690
|
+
setup(t, { expose: r, emit: o }) {
|
|
9691
|
+
function u(e) {
|
|
9681
9692
|
let t = /* @__PURE__ */ new Set(), n = [], r = (r) => {
|
|
9682
9693
|
!r.uid || r.uid === e.currentUserId || t.has(r.uid) || (t.add(r.uid), n.push(r));
|
|
9683
9694
|
};
|
|
@@ -9690,121 +9701,121 @@ var uf = { class: "w-full" }, df = {
|
|
|
9690
9701
|
});
|
|
9691
9702
|
return n;
|
|
9692
9703
|
}
|
|
9693
|
-
let
|
|
9694
|
-
if (
|
|
9695
|
-
let e =
|
|
9696
|
-
return e ?
|
|
9697
|
-
}), { groupMembers:
|
|
9698
|
-
getConversationTargetId: () =>
|
|
9699
|
-
isChannel: () => vu(
|
|
9704
|
+
let f = t, p = o, { t: m } = K(() => f.language), h = w(null), v = w(!1), x = w(!1), C = w(!1), T = n(() => f.client ?? Q.value ?? null), D = n(() => !!f.chatUid), O = n(() => {
|
|
9705
|
+
if (f.conversation !== void 0) return f.conversation;
|
|
9706
|
+
let e = T.value;
|
|
9707
|
+
return e ? f.chatUid ? e.conversations.value.find((e) => e.targetId === f.chatUid || e.id === f.chatUid) ?? null : e.activeConversation.value : null;
|
|
9708
|
+
}), { groupMembers: A, fetchGroupMembers: M } = Qu({
|
|
9709
|
+
getConversationTargetId: () => O.value?.targetId,
|
|
9710
|
+
isChannel: () => vu(O.value),
|
|
9700
9711
|
onMembersChanged: (e) => {
|
|
9701
|
-
|
|
9712
|
+
p("chatMembersFetched", e), T.value?.rememberMentionDisplayNames(e);
|
|
9702
9713
|
}
|
|
9703
|
-
}),
|
|
9704
|
-
chatClient:
|
|
9705
|
-
selectedConversation:
|
|
9706
|
-
getPropIsReadOnly: () =>
|
|
9707
|
-
getPropSendOptions: () =>
|
|
9708
|
-
getSenderDisplayName: () =>
|
|
9709
|
-
getMentionCandidates: () =>
|
|
9710
|
-
groupMembers:
|
|
9711
|
-
messages:
|
|
9712
|
-
currentUserId:
|
|
9714
|
+
}), N = Ou({
|
|
9715
|
+
chatClient: T,
|
|
9716
|
+
selectedConversation: O,
|
|
9717
|
+
getPropIsReadOnly: () => f.isReadOnly,
|
|
9718
|
+
getPropSendOptions: () => f.sendOptions,
|
|
9719
|
+
getSenderDisplayName: () => f.senderDisplayName,
|
|
9720
|
+
getMentionCandidates: () => u({
|
|
9721
|
+
groupMembers: A.value,
|
|
9722
|
+
messages: f.messages ?? T.value?.messages.value ?? [],
|
|
9723
|
+
currentUserId: T.value?.currentUser.value?.uid
|
|
9713
9724
|
})
|
|
9714
9725
|
});
|
|
9715
|
-
Au(
|
|
9716
|
-
let
|
|
9717
|
-
chatClient:
|
|
9718
|
-
selectedConversation:
|
|
9719
|
-
usesPublicContract:
|
|
9720
|
-
loadingChat:
|
|
9721
|
-
getPropMessages: () =>
|
|
9722
|
-
getPropThreadMessages: () =>
|
|
9723
|
-
getPropLoadingMessages: () =>
|
|
9724
|
-
getPropLoadingThreadMessages: () =>
|
|
9725
|
-
getPropShowDefaultEmptyState: () =>
|
|
9726
|
-
getHideDeletedMessages: () =>
|
|
9726
|
+
Au(N);
|
|
9727
|
+
let P = Mu({
|
|
9728
|
+
chatClient: T,
|
|
9729
|
+
selectedConversation: O,
|
|
9730
|
+
usesPublicContract: D,
|
|
9731
|
+
loadingChat: x,
|
|
9732
|
+
getPropMessages: () => f.messages,
|
|
9733
|
+
getPropThreadMessages: () => f.threadMessages,
|
|
9734
|
+
getPropLoadingMessages: () => f.loadingMessages,
|
|
9735
|
+
getPropLoadingThreadMessages: () => f.loadingThreadMessages,
|
|
9736
|
+
getPropShowDefaultEmptyState: () => f.showDefaultEmptyState,
|
|
9737
|
+
getHideDeletedMessages: () => f.hideDeletedMessages
|
|
9727
9738
|
});
|
|
9728
|
-
Pu(
|
|
9729
|
-
let
|
|
9730
|
-
chatClient:
|
|
9731
|
-
selectedConversation:
|
|
9732
|
-
getInitialScheduledMessagesOpen: () => !!
|
|
9733
|
-
fetchErrorFallback:
|
|
9739
|
+
Pu(P);
|
|
9740
|
+
let te = n(() => P.messages.value.length > 0), L = n(() => f.showHeader ?? f.showMessageHeader), R = Hu({
|
|
9741
|
+
chatClient: T,
|
|
9742
|
+
selectedConversation: O,
|
|
9743
|
+
getInitialScheduledMessagesOpen: () => !!f.initialScheduledMessagesOpen,
|
|
9744
|
+
fetchErrorFallback: m("loadMessageReceiptsError")
|
|
9734
9745
|
});
|
|
9735
|
-
Wu(
|
|
9736
|
-
let
|
|
9737
|
-
chatClient:
|
|
9738
|
-
sendOptions:
|
|
9739
|
-
mentionNameByUid:
|
|
9740
|
-
afterSchedule: () =>
|
|
9741
|
-
mainComposerRef:
|
|
9742
|
-
threadComposerRef:
|
|
9746
|
+
Wu(R);
|
|
9747
|
+
let z = ee("mainComposerRef"), ne = ee("threadComposerRef"), B = Lu({
|
|
9748
|
+
chatClient: T,
|
|
9749
|
+
sendOptions: N.sendOptions,
|
|
9750
|
+
mentionNameByUid: N.mentionNameByUid,
|
|
9751
|
+
afterSchedule: () => R.openScheduledMessages(),
|
|
9752
|
+
mainComposerRef: z,
|
|
9753
|
+
threadComposerRef: ne
|
|
9743
9754
|
});
|
|
9744
|
-
zu(
|
|
9745
|
-
let
|
|
9746
|
-
Yu(
|
|
9747
|
-
conversation:
|
|
9748
|
-
composer:
|
|
9749
|
-
dialogs:
|
|
9750
|
-
bus:
|
|
9755
|
+
zu(B);
|
|
9756
|
+
let re = Ju();
|
|
9757
|
+
Yu(re), Ku({
|
|
9758
|
+
conversation: N,
|
|
9759
|
+
composer: B,
|
|
9760
|
+
dialogs: R,
|
|
9761
|
+
bus: re
|
|
9751
9762
|
});
|
|
9752
|
-
let { scrollToRequestedMessage:
|
|
9753
|
-
chatRootRef:
|
|
9754
|
-
getClient: () =>
|
|
9763
|
+
let { scrollToRequestedMessage: ie } = $u({
|
|
9764
|
+
chatRootRef: h,
|
|
9765
|
+
getClient: () => T.value
|
|
9755
9766
|
});
|
|
9756
|
-
F(() =>
|
|
9757
|
-
|
|
9758
|
-
}, { immediate: !0 }), F(() =>
|
|
9759
|
-
!e ||
|
|
9760
|
-
}, { immediate: !0 }), F(() =>
|
|
9761
|
-
|
|
9762
|
-
}), F(() =>
|
|
9767
|
+
F(() => O.value?.targetId ?? null, () => {
|
|
9768
|
+
R.refreshScheduledMessages();
|
|
9769
|
+
}, { immediate: !0 }), F(() => O.value?.targetId ?? null, async (e) => {
|
|
9770
|
+
!e || O.value?.type !== "group" || await M(e);
|
|
9771
|
+
}, { immediate: !0 }), F(() => O.value?.id, () => {
|
|
9772
|
+
B.resetMainComposer(), B.resetThreadComposer(), R.showScheduledMessages.value = !1, R.closeMessageInfo();
|
|
9773
|
+
}), F(() => f.chatMessageGetter, (e) => {
|
|
9763
9774
|
gu.setGetChatMessagesCallback(e);
|
|
9764
|
-
}, { immediate: !0 }), F(() =>
|
|
9765
|
-
e &&
|
|
9766
|
-
}, { immediate: !0 }), F(
|
|
9767
|
-
e &&
|
|
9775
|
+
}, { immediate: !0 }), F(() => f.language, (e) => {
|
|
9776
|
+
e && _t(e);
|
|
9777
|
+
}, { immediate: !0 }), F(P.isChatEmpty, (e) => {
|
|
9778
|
+
e && p("chatEmpty");
|
|
9768
9779
|
}), F([
|
|
9769
|
-
() =>
|
|
9770
|
-
() =>
|
|
9771
|
-
() =>
|
|
9772
|
-
() =>
|
|
9780
|
+
() => f.chatUid,
|
|
9781
|
+
() => f.client ? f.client.initialized.value : gu.initialized.value,
|
|
9782
|
+
() => f.client ? f.client.loggedIn.value : gu.loggedIn.value,
|
|
9783
|
+
() => T.value?.conversations.value.length ?? 0
|
|
9773
9784
|
], async ([e, t, n]) => {
|
|
9774
|
-
!
|
|
9785
|
+
!D.value || !e || !t || !n || !T.value || await ae();
|
|
9775
9786
|
}, { immediate: !0 }), F([
|
|
9776
|
-
() =>
|
|
9777
|
-
() =>
|
|
9787
|
+
() => P.messages.value.length,
|
|
9788
|
+
() => P.threadMessages.value.length,
|
|
9778
9789
|
() => gu.scrollToMessageId.value
|
|
9779
9790
|
], async () => {
|
|
9780
|
-
await
|
|
9791
|
+
await ie();
|
|
9781
9792
|
});
|
|
9782
|
-
async function
|
|
9783
|
-
let e =
|
|
9793
|
+
async function ae() {
|
|
9794
|
+
let e = T.value;
|
|
9784
9795
|
if (e) {
|
|
9785
|
-
|
|
9796
|
+
x.value = !0, v.value = !1, C.value = !1;
|
|
9786
9797
|
try {
|
|
9787
9798
|
e.conversations.value.length === 0 && await e.fetchConversations();
|
|
9788
|
-
let t = e.conversations.value.find((e) => e.targetId ===
|
|
9799
|
+
let t = e.conversations.value.find((e) => e.targetId === f.chatUid || e.id === f.chatUid) ?? null;
|
|
9789
9800
|
if (!t) try {
|
|
9790
|
-
t = await
|
|
9801
|
+
t = await V(f.chatUid, e);
|
|
9791
9802
|
} catch (e) {
|
|
9792
9803
|
if (e && typeof e == "object" && "code" in e && e.code === "ERR_NOT_A_MEMBER") {
|
|
9793
|
-
|
|
9804
|
+
v.value = !1, C.value = !0, p("chatMembersFetched", []);
|
|
9794
9805
|
return;
|
|
9795
9806
|
}
|
|
9796
9807
|
}
|
|
9797
9808
|
if (!t) {
|
|
9798
|
-
|
|
9809
|
+
v.value = !0, C.value = !1, p("chatMembersFetched", []);
|
|
9799
9810
|
return;
|
|
9800
9811
|
}
|
|
9801
|
-
e.activeConversationId.value !== t.id && await e.selectConversation(t.id), await
|
|
9812
|
+
e.activeConversationId.value !== t.id && await e.selectConversation(t.id), await M(t.targetId);
|
|
9802
9813
|
} finally {
|
|
9803
|
-
|
|
9814
|
+
x.value = !1;
|
|
9804
9815
|
}
|
|
9805
9816
|
}
|
|
9806
9817
|
}
|
|
9807
|
-
async function
|
|
9818
|
+
async function V(e, t) {
|
|
9808
9819
|
let n = await gu.getGroup(e, !0);
|
|
9809
9820
|
if (!n || typeof n != "object") return null;
|
|
9810
9821
|
let r = String(n.getGuid());
|
|
@@ -9823,51 +9834,53 @@ var uf = { class: "w-full" }, df = {
|
|
|
9823
9834
|
};
|
|
9824
9835
|
return t.conversations.value = [i, ...t.conversations.value.filter((e) => e.id !== i.id && e.targetId !== r)], i;
|
|
9825
9836
|
}
|
|
9826
|
-
function
|
|
9827
|
-
|
|
9837
|
+
function se(e, t) {
|
|
9838
|
+
p("linkClicked", e, t);
|
|
9828
9839
|
}
|
|
9829
|
-
let
|
|
9840
|
+
let H = w(!1);
|
|
9830
9841
|
b(() => {
|
|
9831
9842
|
setTimeout(() => {
|
|
9832
|
-
|
|
9843
|
+
H.value = !0;
|
|
9833
9844
|
}, 200);
|
|
9834
9845
|
}), y(() => {
|
|
9835
|
-
let e =
|
|
9836
|
-
e && e.activeConversation.value ===
|
|
9846
|
+
let e = T.value;
|
|
9847
|
+
e && e.activeConversation.value === O.value && e.selectConversation(null);
|
|
9837
9848
|
});
|
|
9838
9849
|
async function ce(e) {
|
|
9839
|
-
return await new Promise((e) => setTimeout(e, 100)),
|
|
9850
|
+
return await new Promise((e) => setTimeout(e, 100)), H.value ? ie(e) : (await new Promise((e) => setTimeout(e, 110)), ce(e));
|
|
9840
9851
|
}
|
|
9841
|
-
return
|
|
9852
|
+
return r({
|
|
9842
9853
|
scrollToMessage: ce,
|
|
9843
|
-
groupMembers: n(() =>
|
|
9844
|
-
}), (n,
|
|
9854
|
+
groupMembers: n(() => A.value)
|
|
9855
|
+
}), (n, r) => (S(), a("div", {
|
|
9845
9856
|
ref_key: "chatRootRef",
|
|
9846
|
-
ref:
|
|
9857
|
+
ref: h,
|
|
9847
9858
|
class: "text-default relative h-full min-h-104"
|
|
9848
9859
|
}, [
|
|
9849
|
-
|
|
9860
|
+
D.value && T.value?.error.value ? E(n.$slots, "error-message", {
|
|
9850
9861
|
key: 0,
|
|
9862
|
+
message: T.value.error.value
|
|
9863
|
+
}, () => [l(j(oe), {
|
|
9851
9864
|
severity: "error",
|
|
9852
9865
|
closable: !1,
|
|
9853
9866
|
class: "pointer-events-auto absolute inset-x-2 top-2 z-20 shadow-lg"
|
|
9854
9867
|
}, {
|
|
9855
|
-
default: I(() => [c(k(
|
|
9868
|
+
default: I(() => [c(k(T.value.error.value), 1)]),
|
|
9856
9869
|
_: 1
|
|
9857
|
-
})) : i("", !0),
|
|
9858
|
-
|
|
9870
|
+
})]) : i("", !0),
|
|
9871
|
+
T.value ? (S(), a(e, { key: 1 }, [
|
|
9859
9872
|
l(lm, {
|
|
9860
9873
|
target: "main",
|
|
9861
9874
|
class: g(["h-full", t.containerClass]),
|
|
9862
9875
|
"hide-group-actions": t.hideGroupActions,
|
|
9863
|
-
"show-header":
|
|
9876
|
+
"show-header": L.value,
|
|
9864
9877
|
"action-message-class": t.actionMessageClass,
|
|
9865
9878
|
"action-message-row-class": t.actionMessageRowClass,
|
|
9866
|
-
onAnchorclick:
|
|
9879
|
+
onAnchorclick: se
|
|
9867
9880
|
}, s({
|
|
9868
9881
|
composer: I(() => [l(Zd, {
|
|
9869
9882
|
ref_key: "mainComposerRef",
|
|
9870
|
-
ref:
|
|
9883
|
+
ref: z,
|
|
9871
9884
|
target: "main"
|
|
9872
9885
|
}, null, 512)]),
|
|
9873
9886
|
_: 2
|
|
@@ -9883,12 +9896,12 @@ var uf = { class: "w-full" }, df = {
|
|
|
9883
9896
|
"action-message-row-class"
|
|
9884
9897
|
]),
|
|
9885
9898
|
l(ff, {
|
|
9886
|
-
open: !!j(
|
|
9887
|
-
title: j(
|
|
9888
|
-
subtitle:
|
|
9889
|
-
"close-label": j(
|
|
9890
|
-
"close-aria-label": j(
|
|
9891
|
-
onClose:
|
|
9899
|
+
open: !!j(P).activeThreadParentMessage.value,
|
|
9900
|
+
title: j(m)("threadWithCount", { count: j(P).activeThreadParentMessage.value?.replyCount ?? 0 }),
|
|
9901
|
+
subtitle: O.value?.title ?? "",
|
|
9902
|
+
"close-label": j(m)("close"),
|
|
9903
|
+
"close-aria-label": j(m)("closeThread"),
|
|
9904
|
+
onClose: r[0] ||= (e) => j(re).emit("ui:closeThread")
|
|
9892
9905
|
}, {
|
|
9893
9906
|
default: I(() => [l(lm, {
|
|
9894
9907
|
target: "thread",
|
|
@@ -9898,7 +9911,7 @@ var uf = { class: "w-full" }, df = {
|
|
|
9898
9911
|
}, {
|
|
9899
9912
|
composer: I(() => [l(Zd, {
|
|
9900
9913
|
ref_key: "threadComposerRef",
|
|
9901
|
-
ref:
|
|
9914
|
+
ref: ne,
|
|
9902
9915
|
target: "thread"
|
|
9903
9916
|
}, null, 512)]),
|
|
9904
9917
|
_: 1
|
|
@@ -9912,14 +9925,14 @@ var uf = { class: "w-full" }, df = {
|
|
|
9912
9925
|
"close-aria-label"
|
|
9913
9926
|
]),
|
|
9914
9927
|
l(lh, {
|
|
9915
|
-
open: j(
|
|
9916
|
-
loading: j(
|
|
9917
|
-
messages: j(
|
|
9918
|
-
"conversation-title":
|
|
9919
|
-
onClose:
|
|
9920
|
-
onReschedule:
|
|
9921
|
-
onRemove:
|
|
9922
|
-
onEditText:
|
|
9928
|
+
open: j(R).showScheduledMessages.value,
|
|
9929
|
+
loading: j(R).loadingScheduledMessages.value,
|
|
9930
|
+
messages: j(R).scheduledMessages.value,
|
|
9931
|
+
"conversation-title": O.value?.title,
|
|
9932
|
+
onClose: r[1] ||= (e) => j(R).showScheduledMessages.value = !1,
|
|
9933
|
+
onReschedule: r[2] ||= (e) => j(re).emit("ui:reschedule", e),
|
|
9934
|
+
onRemove: r[3] ||= (e) => j(re).emit("ui:removeScheduled", e),
|
|
9935
|
+
onEditText: r[4] ||= (e) => j(re).emit("ui:editScheduledText", e)
|
|
9923
9936
|
}, null, 8, [
|
|
9924
9937
|
"open",
|
|
9925
9938
|
"loading",
|
|
@@ -9927,12 +9940,12 @@ var uf = { class: "w-full" }, df = {
|
|
|
9927
9940
|
"conversation-title"
|
|
9928
9941
|
]),
|
|
9929
9942
|
l(Bm, {
|
|
9930
|
-
open: !!j(
|
|
9931
|
-
message: j(
|
|
9932
|
-
receipts: j(
|
|
9933
|
-
loading: j(
|
|
9934
|
-
error: j(
|
|
9935
|
-
onClose:
|
|
9943
|
+
open: !!j(R).infoMessage.value,
|
|
9944
|
+
message: j(R).infoMessage.value,
|
|
9945
|
+
receipts: j(R).infoMessageReceipts.value,
|
|
9946
|
+
loading: j(R).loadingMessageReceipts.value,
|
|
9947
|
+
error: j(R).messageReceiptsError.value,
|
|
9948
|
+
onClose: r[5] ||= (e) => j(R).closeMessageInfo()
|
|
9936
9949
|
}, null, 8, [
|
|
9937
9950
|
"open",
|
|
9938
9951
|
"message",
|
|
@@ -9942,21 +9955,21 @@ var uf = { class: "w-full" }, df = {
|
|
|
9942
9955
|
])
|
|
9943
9956
|
], 64)) : i("", !0),
|
|
9944
9957
|
l(_h, {
|
|
9945
|
-
visible:
|
|
9946
|
-
"offline-mode": !!(
|
|
9947
|
-
connected: !!(
|
|
9948
|
-
loading:
|
|
9949
|
-
"not-found":
|
|
9950
|
-
"not-a-member":
|
|
9951
|
-
"is-empty": j(
|
|
9958
|
+
visible: D.value && (T.value?.offlineMode.value || !T.value?.connected.value || x.value && !te.value || v.value || C.value || t.displayNoMessagesText && j(P).isChatEmpty.value),
|
|
9959
|
+
"offline-mode": !!(T.value?.offlineMode.value && !O.value),
|
|
9960
|
+
connected: !!(T.value?.connected.value || O.value),
|
|
9961
|
+
loading: x.value,
|
|
9962
|
+
"not-found": v.value,
|
|
9963
|
+
"not-a-member": C.value,
|
|
9964
|
+
"is-empty": j(P).isChatEmpty.value,
|
|
9952
9965
|
"show-empty-slot": t.displayNoMessagesText,
|
|
9953
9966
|
messages: {
|
|
9954
|
-
waitingForNetwork: j(
|
|
9955
|
-
connecting: j(
|
|
9956
|
-
loading: j(
|
|
9957
|
-
notFound: j(
|
|
9958
|
-
noMessages: j(
|
|
9959
|
-
notAMember: j(
|
|
9967
|
+
waitingForNetwork: j(m)("waitingForNetwork"),
|
|
9968
|
+
connecting: j(m)("connecting"),
|
|
9969
|
+
loading: j(m)("loadingChat"),
|
|
9970
|
+
notFound: j(m)("chatNotFound"),
|
|
9971
|
+
noMessages: j(m)("noMessagesHaveBeenSentYet"),
|
|
9972
|
+
notAMember: j(m)("chatNotAMember")
|
|
9960
9973
|
}
|
|
9961
9974
|
}, s({ _: 2 }, [n.$slots["no-messages"] ? {
|
|
9962
9975
|
name: "no-messages",
|