@bcc-code/vue-bcc-chat-ui 7.1.5 → 7.1.7
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/style.css +1 -1
- package/dist/vue-bcc-chat-ui.js +872 -825
- package/dist/vue-bcc-chat-ui.js.map +1 -1
- package/package.json +1 -1
package/dist/vue-bcc-chat-ui.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
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
|
|
2
|
-
import { BccAvatar as
|
|
3
|
-
import { CometChat 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 ee, useTemplateRef as te, vModelText as M, vShow as N, watch as P, withCtx as F, withDirectives as ne, withModifiers as I } from "vue";
|
|
2
|
+
import { BccAvatar as L, BccButton as R, BccDialog as re, BccImage as z, BccInput as ie, BccInputText as ae, BccMenu as B, 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
4
|
//#region \0rolldown/runtime.js
|
|
5
|
-
var
|
|
5
|
+
var ce = Object.defineProperty, le = (e, t) => {
|
|
6
6
|
let n = {};
|
|
7
|
-
for (var r in e)
|
|
7
|
+
for (var r in e) ce(n, r, {
|
|
8
8
|
get: e[r],
|
|
9
9
|
enumerable: !0
|
|
10
10
|
});
|
|
11
|
-
return t ||
|
|
12
|
-
},
|
|
11
|
+
return t || ce(n, Symbol.toStringTag, { value: "Module" }), n;
|
|
12
|
+
}, ue = {
|
|
13
13
|
prod: {
|
|
14
14
|
region: "eu",
|
|
15
15
|
appId: "2520339d45a9d557",
|
|
@@ -20,62 +20,62 @@ var se = Object.defineProperty, ce = (e, t) => {
|
|
|
20
20
|
appId: "24847302853e129f",
|
|
21
21
|
chatApiBaseUrl: "https://chat.api.sandbox.bcc.no"
|
|
22
22
|
}
|
|
23
|
-
},
|
|
24
|
-
function
|
|
25
|
-
|
|
23
|
+
}, de = null;
|
|
24
|
+
function fe(e) {
|
|
25
|
+
de = e;
|
|
26
26
|
}
|
|
27
|
-
function
|
|
28
|
-
if (!
|
|
29
|
-
return
|
|
27
|
+
function U() {
|
|
28
|
+
if (!de) throw Error("Environment has not been set yet. Call setCurrentEnvironment(...) first.");
|
|
29
|
+
return ue[de];
|
|
30
30
|
}
|
|
31
31
|
//#endregion
|
|
32
32
|
//#region src/chat/accessToken.ts
|
|
33
|
-
var
|
|
34
|
-
function
|
|
35
|
-
return `${
|
|
33
|
+
var pe = ":loginAccessToken", me = ":token", he = void 0;
|
|
34
|
+
function ge(e) {
|
|
35
|
+
return `${U().appId}${e}`;
|
|
36
36
|
}
|
|
37
|
-
function
|
|
38
|
-
return
|
|
37
|
+
function _e() {
|
|
38
|
+
return he === void 0 && (he = localStorage.getItem(ge(pe))), he;
|
|
39
39
|
}
|
|
40
|
-
function
|
|
41
|
-
|
|
42
|
-
let t =
|
|
40
|
+
function ve(e) {
|
|
41
|
+
he = e;
|
|
42
|
+
let t = ge(pe);
|
|
43
43
|
if (e) {
|
|
44
44
|
localStorage.setItem(t, e);
|
|
45
45
|
return;
|
|
46
46
|
}
|
|
47
47
|
localStorage.removeItem(t);
|
|
48
48
|
}
|
|
49
|
-
function
|
|
50
|
-
let e =
|
|
49
|
+
function ye() {
|
|
50
|
+
let e = ge(me), t = localStorage.getItem(e);
|
|
51
51
|
return t ? JSON.parse(t) : null;
|
|
52
52
|
}
|
|
53
|
-
function
|
|
54
|
-
return
|
|
53
|
+
function be() {
|
|
54
|
+
return ye();
|
|
55
55
|
}
|
|
56
|
-
function
|
|
57
|
-
localStorage.setItem(
|
|
56
|
+
function xe(e) {
|
|
57
|
+
localStorage.setItem(ge(me), JSON.stringify(e));
|
|
58
58
|
}
|
|
59
|
-
function
|
|
60
|
-
localStorage.removeItem(
|
|
59
|
+
function Se() {
|
|
60
|
+
localStorage.removeItem(ge(me));
|
|
61
61
|
}
|
|
62
62
|
//#endregion
|
|
63
63
|
//#region src/chat/avatar.ts
|
|
64
|
-
function
|
|
65
|
-
let t =
|
|
64
|
+
function Ce(e) {
|
|
65
|
+
let t = Te(e);
|
|
66
66
|
if (!t) return;
|
|
67
67
|
let n = t.trim();
|
|
68
68
|
if (n) {
|
|
69
69
|
try {
|
|
70
|
-
if (
|
|
70
|
+
if (Ee(new URL(n))) return `${U().chatApiBaseUrl}/file-proxy?uri=${encodeURIComponent(n)}`;
|
|
71
71
|
} catch {}
|
|
72
72
|
return n;
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
-
function Ce(e) {
|
|
76
|
-
return Se(e) ?? e;
|
|
77
|
-
}
|
|
78
75
|
function we(e) {
|
|
76
|
+
return Ce(e) ?? e;
|
|
77
|
+
}
|
|
78
|
+
function Te(e) {
|
|
79
79
|
if (typeof e == "string") return e;
|
|
80
80
|
if (!e || typeof e != "object") return;
|
|
81
81
|
let t = e, n = [
|
|
@@ -93,32 +93,32 @@ function we(e) {
|
|
|
93
93
|
t.avatar,
|
|
94
94
|
t.image
|
|
95
95
|
].find((e) => e && typeof e == "object");
|
|
96
|
-
if (r) return
|
|
96
|
+
if (r) return Te(r);
|
|
97
97
|
}
|
|
98
|
-
function
|
|
99
|
-
let { appId: t, region: n } =
|
|
98
|
+
function Ee(e) {
|
|
99
|
+
let { appId: t, region: n } = U(), r = `data-${n}.cometchat.io`, i = `/${t}/`;
|
|
100
100
|
return e.hostname.toLowerCase() === r.toLowerCase() && e.pathname.startsWith(i);
|
|
101
101
|
}
|
|
102
102
|
//#endregion
|
|
103
103
|
//#region src/chat/cacheScope.ts
|
|
104
|
-
var
|
|
104
|
+
var De = ":chatCacheScope", Oe = ":chatCacheOwner", W, ke;
|
|
105
105
|
function Ae(e) {
|
|
106
|
-
return `${
|
|
106
|
+
return `${U().appId}${e}`;
|
|
107
107
|
}
|
|
108
108
|
function je() {
|
|
109
109
|
return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
110
110
|
}
|
|
111
111
|
function Me() {
|
|
112
|
-
return
|
|
112
|
+
return W === void 0 && (W = localStorage.getItem(Ae(De))), W;
|
|
113
113
|
}
|
|
114
114
|
function Ne() {
|
|
115
|
-
return ke === void 0 && (ke = localStorage.getItem(Ae(
|
|
115
|
+
return ke === void 0 && (ke = localStorage.getItem(Ae(Oe))), ke;
|
|
116
116
|
}
|
|
117
117
|
function Pe(e) {
|
|
118
118
|
let t = Me(), n = Ne();
|
|
119
119
|
if (t && n === e) return t;
|
|
120
120
|
let r = je();
|
|
121
|
-
return
|
|
121
|
+
return W = r, ke = e, localStorage.setItem(Ae(De), r), localStorage.setItem(Ae(Oe), e), r;
|
|
122
122
|
}
|
|
123
123
|
//#endregion
|
|
124
124
|
//#region src/chat/localization.ts
|
|
@@ -731,18 +731,18 @@ function Dn() {
|
|
|
731
731
|
}
|
|
732
732
|
let x, S = "", C = n, w = C.implementation, T = C.createNodeIterator, E = C.createDocumentFragment, D = C.getElementsByTagName, O = r.importNode, k = En();
|
|
733
733
|
t.isSupported = typeof bt == "function" && typeof b == "function" && w && w.createHTMLDocument !== void 0;
|
|
734
|
-
let A = pn, j = mn,
|
|
734
|
+
let A = pn, j = mn, ee = hn, te = gn, M = _n, N = yn, P = bn, F = Sn, ne = vn, I = null, L = X({}, [
|
|
735
735
|
...tn,
|
|
736
736
|
...nn,
|
|
737
737
|
...rn,
|
|
738
738
|
...on,
|
|
739
739
|
...cn
|
|
740
|
-
]),
|
|
740
|
+
]), R = null, re = X({}, [
|
|
741
741
|
...ln,
|
|
742
742
|
...un,
|
|
743
743
|
...dn,
|
|
744
744
|
...fn
|
|
745
|
-
]),
|
|
745
|
+
]), z = Object.seal(Dt(null, {
|
|
746
746
|
tagNameCheck: {
|
|
747
747
|
writable: !0,
|
|
748
748
|
configurable: !1,
|
|
@@ -761,7 +761,7 @@ function Dn() {
|
|
|
761
761
|
enumerable: !0,
|
|
762
762
|
value: !1
|
|
763
763
|
}
|
|
764
|
-
})),
|
|
764
|
+
})), ie = null, ae = null, B = Object.seal(Dt(null, {
|
|
765
765
|
tagCheck: {
|
|
766
766
|
writable: !0,
|
|
767
767
|
configurable: !1,
|
|
@@ -774,7 +774,7 @@ function Dn() {
|
|
|
774
774
|
enumerable: !0,
|
|
775
775
|
value: null
|
|
776
776
|
}
|
|
777
|
-
})),
|
|
777
|
+
})), oe = !0, V = !0, se = !1, H = !0, ce = !1, le = !0, ue = !1, de = !1, fe = !1, U = !1, pe = !1, me = !1, he = !0, ge = !1, _e = "user-content-", ve = !0, ye = !1, be = {}, xe = null, Se = X({}, [
|
|
778
778
|
"annotation-xml",
|
|
779
779
|
"audio",
|
|
780
780
|
"colgroup",
|
|
@@ -800,14 +800,14 @@ function Dn() {
|
|
|
800
800
|
"title",
|
|
801
801
|
"video",
|
|
802
802
|
"xmp"
|
|
803
|
-
]),
|
|
803
|
+
]), Ce = null, we = X({}, [
|
|
804
804
|
"audio",
|
|
805
805
|
"video",
|
|
806
806
|
"img",
|
|
807
807
|
"source",
|
|
808
808
|
"image",
|
|
809
809
|
"track"
|
|
810
|
-
]),
|
|
810
|
+
]), Te = null, Ee = X({}, [
|
|
811
811
|
"alt",
|
|
812
812
|
"class",
|
|
813
813
|
"for",
|
|
@@ -822,10 +822,10 @@ function Dn() {
|
|
|
822
822
|
"value",
|
|
823
823
|
"style",
|
|
824
824
|
"xmlns"
|
|
825
|
-
]),
|
|
826
|
-
Ee,
|
|
825
|
+
]), De = "http://www.w3.org/1998/Math/MathML", Oe = "http://www.w3.org/2000/svg", W = "http://www.w3.org/1999/xhtml", ke = W, Ae = !1, je = null, Me = X({}, [
|
|
827
826
|
De,
|
|
828
|
-
Oe
|
|
827
|
+
Oe,
|
|
828
|
+
W
|
|
829
829
|
], Lt), Ne = X({}, [
|
|
830
830
|
"mi",
|
|
831
831
|
"mo",
|
|
@@ -843,7 +843,7 @@ function Dn() {
|
|
|
843
843
|
}, K = function() {
|
|
844
844
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
845
845
|
if (Re && Re === e) return;
|
|
846
|
-
(!e || typeof e != "object") && (e = {}), e = Zt(e), Ie = Le.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, G = Ie === "application/xhtml+xml" ? Lt : It,
|
|
846
|
+
(!e || typeof e != "object") && (e = {}), e = Zt(e), Ie = Le.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, G = Ie === "application/xhtml+xml" ? Lt : It, I = J(e, "ALLOWED_TAGS") && q(e.ALLOWED_TAGS) ? X({}, e.ALLOWED_TAGS, G) : L, R = J(e, "ALLOWED_ATTR") && q(e.ALLOWED_ATTR) ? X({}, e.ALLOWED_ATTR, G) : re, je = J(e, "ALLOWED_NAMESPACES") && q(e.ALLOWED_NAMESPACES) ? X({}, e.ALLOWED_NAMESPACES, Lt) : Me, Te = J(e, "ADD_URI_SAFE_ATTR") && q(e.ADD_URI_SAFE_ATTR) ? X(Zt(Ee), e.ADD_URI_SAFE_ATTR, G) : Ee, Ce = J(e, "ADD_DATA_URI_TAGS") && q(e.ADD_DATA_URI_TAGS) ? X(Zt(we), e.ADD_DATA_URI_TAGS, G) : we, xe = J(e, "FORBID_CONTENTS") && q(e.FORBID_CONTENTS) ? X({}, e.FORBID_CONTENTS, G) : Se, ie = J(e, "FORBID_TAGS") && q(e.FORBID_TAGS) ? X({}, e.FORBID_TAGS, G) : Zt({}), ae = J(e, "FORBID_ATTR") && q(e.FORBID_ATTR) ? X({}, e.FORBID_ATTR, G) : Zt({}), be = J(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? Zt(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, ue = e.WHOLE_DOCUMENT || !1, U = e.RETURN_DOM || !1, pe = e.RETURN_DOM_FRAGMENT || !1, me = e.RETURN_TRUSTED_TYPE || !1, fe = 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, ne = en(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : vn, ke = typeof e.NAMESPACE == "string" ? e.NAMESPACE : W, Ne = J(e, "MATHML_TEXT_INTEGRATION_POINTS") && e.MATHML_TEXT_INTEGRATION_POINTS && typeof e.MATHML_TEXT_INTEGRATION_POINTS == "object" ? Zt(e.MATHML_TEXT_INTEGRATION_POINTS) : X({}, [
|
|
847
847
|
"mi",
|
|
848
848
|
"mo",
|
|
849
849
|
"mn",
|
|
@@ -851,11 +851,11 @@ function Dn() {
|
|
|
851
851
|
"mtext"
|
|
852
852
|
]), Pe = J(e, "HTML_INTEGRATION_POINTS") && e.HTML_INTEGRATION_POINTS && typeof e.HTML_INTEGRATION_POINTS == "object" ? Zt(e.HTML_INTEGRATION_POINTS) : X({}, ["annotation-xml"]);
|
|
853
853
|
let t = J(e, "CUSTOM_ELEMENT_HANDLING") && e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING == "object" ? Zt(e.CUSTOM_ELEMENT_HANDLING) : Dt(null);
|
|
854
|
-
if (
|
|
854
|
+
if (z = Dt(null), J(t, "tagNameCheck") && Be(t.tagNameCheck) && (z.tagNameCheck = t.tagNameCheck), J(t, "attributeNameCheck") && Be(t.attributeNameCheck) && (z.attributeNameCheck = t.attributeNameCheck), J(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (z.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), ce && (V = !1), pe && (U = !0), be && (I = X({}, cn), R = Dt(null), be.html === !0 && (X(I, tn), X(R, ln)), be.svg === !0 && (X(I, nn), X(R, un), X(R, fn)), be.svgFilters === !0 && (X(I, rn), X(R, un), X(R, fn)), be.mathMl === !0 && (X(I, on), X(R, dn), X(R, fn))), B.tagCheck = null, B.attributeCheck = null, J(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? B.tagCheck = e.ADD_TAGS : q(e.ADD_TAGS) && (I === L && (I = Zt(I)), X(I, e.ADD_TAGS, G))), J(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? B.attributeCheck = e.ADD_ATTR : q(e.ADD_ATTR) && (R === re && (R = Zt(R)), X(R, e.ADD_ATTR, G))), J(e, "ADD_URI_SAFE_ATTR") && q(e.ADD_URI_SAFE_ATTR) && X(Te, e.ADD_URI_SAFE_ATTR, G), J(e, "FORBID_CONTENTS") && q(e.FORBID_CONTENTS) && (xe === Se && (xe = Zt(xe)), X(xe, e.FORBID_CONTENTS, G)), J(e, "ADD_FORBID_CONTENTS") && q(e.ADD_FORBID_CONTENTS) && (xe === Se && (xe = Zt(xe)), X(xe, e.ADD_FORBID_CONTENTS, G)), ve && (I["#text"] = !0), ue && X(I, [
|
|
855
855
|
"html",
|
|
856
856
|
"head",
|
|
857
857
|
"body"
|
|
858
|
-
]),
|
|
858
|
+
]), I.table && (X(I, ["tbody"]), delete ie.tbody), e.TRUSTED_TYPES_POLICY) {
|
|
859
859
|
if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw Jt("TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.");
|
|
860
860
|
if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw Jt("TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.");
|
|
861
861
|
x = e.TRUSTED_TYPES_POLICY, S = x.createHTML("");
|
|
@@ -872,7 +872,7 @@ function Dn() {
|
|
|
872
872
|
tagName: "template"
|
|
873
873
|
});
|
|
874
874
|
let n = It(e.tagName), r = It(t.tagName);
|
|
875
|
-
return je[e.namespaceURI] ? e.namespaceURI ===
|
|
875
|
+
return je[e.namespaceURI] ? e.namespaceURI === Oe ? t.namespaceURI === W ? n === "svg" : t.namespaceURI === De ? n === "svg" && (r === "annotation-xml" || Ne[r]) : !!Ve[n] : e.namespaceURI === De ? t.namespaceURI === W ? n === "math" : t.namespaceURI === Oe ? n === "math" && Pe[r] : !!He[n] : e.namespaceURI === W ? t.namespaceURI === Oe && !Pe[r] || t.namespaceURI === De && !Ne[r] ? !1 : !He[n] && (Fe[n] || !Ve[n]) : !!(Ie === "application/xhtml+xml" && je[e.namespaceURI]) : !1;
|
|
876
876
|
}, We = function(e) {
|
|
877
877
|
Pt(t.removed, { element: e });
|
|
878
878
|
try {
|
|
@@ -892,7 +892,7 @@ function Dn() {
|
|
|
892
892
|
from: n
|
|
893
893
|
});
|
|
894
894
|
}
|
|
895
|
-
if (n.removeAttribute(e), e === "is") if (
|
|
895
|
+
if (n.removeAttribute(e), e === "is") if (U || pe) try {
|
|
896
896
|
We(n);
|
|
897
897
|
} catch {}
|
|
898
898
|
else try {
|
|
@@ -900,14 +900,14 @@ function Dn() {
|
|
|
900
900
|
} catch {}
|
|
901
901
|
}, Ke = function(e) {
|
|
902
902
|
let t = null, r = null;
|
|
903
|
-
if (
|
|
903
|
+
if (fe) e = "<remove></remove>" + e;
|
|
904
904
|
else {
|
|
905
905
|
let t = Rt(e, /^[\r\n\t ]+/);
|
|
906
906
|
r = t && t[0];
|
|
907
907
|
}
|
|
908
|
-
Ie === "application/xhtml+xml" && ke ===
|
|
908
|
+
Ie === "application/xhtml+xml" && ke === W && (e = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + e + "</body></html>");
|
|
909
909
|
let i = x ? x.createHTML(e) : e;
|
|
910
|
-
if (ke ===
|
|
910
|
+
if (ke === W) try {
|
|
911
911
|
t = new p().parseFromString(i, Ie);
|
|
912
912
|
} catch {}
|
|
913
913
|
if (!t || !t.documentElement) {
|
|
@@ -917,7 +917,7 @@ function Dn() {
|
|
|
917
917
|
} catch {}
|
|
918
918
|
}
|
|
919
919
|
let a = t.body || t.documentElement;
|
|
920
|
-
return e && r && a.insertBefore(n.createTextNode(r), a.childNodes[0] || null), ke ===
|
|
920
|
+
return e && r && a.insertBefore(n.createTextNode(r), a.childNodes[0] || null), ke === W ? D.call(t, ue ? "html" : "body")[0] : ue ? t.documentElement : a;
|
|
921
921
|
}, qe = function(e) {
|
|
922
922
|
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
923
|
}, Je = function(e) {
|
|
@@ -936,11 +936,11 @@ function Dn() {
|
|
|
936
936
|
let r = G(e.nodeName);
|
|
937
937
|
if (Xe(k.uponSanitizeElement, e, {
|
|
938
938
|
tagName: r,
|
|
939
|
-
allowedTags:
|
|
940
|
-
}),
|
|
941
|
-
if (
|
|
942
|
-
if (!
|
|
943
|
-
if (
|
|
939
|
+
allowedTags: I
|
|
940
|
+
}), le && e.hasChildNodes() && !Ye(e.firstElementChild) && qt(/<[/\w!]/g, e.innerHTML) && qt(/<[/\w!]/g, e.textContent) || le && e.namespaceURI === W && r === "style" && Ye(e.firstElementChild) || e.nodeType === Cn.progressingInstruction || le && e.nodeType === Cn.comment && qt(/<[/\w]/g, e.data)) return We(e), !0;
|
|
941
|
+
if (ie[r] || !(B.tagCheck instanceof Function && B.tagCheck(r)) && !I[r]) {
|
|
942
|
+
if (!ie[r] && et(r) && (z.tagNameCheck instanceof RegExp && qt(z.tagNameCheck, r) || z.tagNameCheck instanceof Function && z.tagNameCheck(r))) return !1;
|
|
943
|
+
if (ve && !xe[r]) {
|
|
944
944
|
let t = b(e) || e.parentNode, n = y(e) || e.childNodes;
|
|
945
945
|
if (n && t) {
|
|
946
946
|
let r = n.length;
|
|
@@ -952,20 +952,20 @@ function Dn() {
|
|
|
952
952
|
}
|
|
953
953
|
return We(e), !0;
|
|
954
954
|
}
|
|
955
|
-
return e instanceof c && !Ue(e) || (r === "noscript" || r === "noembed" || r === "noframes") && qt(/<\/no(script|embed|frames)/i, e.innerHTML) ? (We(e), !0) : (
|
|
955
|
+
return e instanceof c && !Ue(e) || (r === "noscript" || r === "noembed" || r === "noframes") && qt(/<\/no(script|embed|frames)/i, e.innerHTML) ? (We(e), !0) : (ce && e.nodeType === Cn.text && (n = e.textContent, jt([
|
|
956
956
|
A,
|
|
957
957
|
j,
|
|
958
|
-
|
|
958
|
+
ee
|
|
959
959
|
], (e) => {
|
|
960
960
|
n = zt(n, e, " ");
|
|
961
961
|
}), e.textContent !== n && (Pt(t.removed, { element: e.cloneNode() }), e.textContent = n)), Xe(k.afterSanitizeElements, e, null), !1);
|
|
962
962
|
}, Qe = function(e, t, r) {
|
|
963
|
-
if (
|
|
964
|
-
let i =
|
|
965
|
-
if (!(
|
|
966
|
-
if (!i ||
|
|
967
|
-
if (!(et(e) && (
|
|
968
|
-
} else if (!
|
|
963
|
+
if (ae[t] || he && (t === "id" || t === "name") && (r in n || r in ze)) return !1;
|
|
964
|
+
let i = R[t] || B.attributeCheck instanceof Function && B.attributeCheck(t, e);
|
|
965
|
+
if (!(V && !ae[t] && qt(te, t)) && !(oe && qt(M, t))) {
|
|
966
|
+
if (!i || ae[t]) {
|
|
967
|
+
if (!(et(e) && (z.tagNameCheck instanceof RegExp && qt(z.tagNameCheck, e) || z.tagNameCheck instanceof Function && z.tagNameCheck(e)) && (z.attributeNameCheck instanceof RegExp && qt(z.attributeNameCheck, t) || z.attributeNameCheck instanceof Function && z.attributeNameCheck(t, e)) || t === "is" && z.allowCustomizedBuiltInElements && (z.tagNameCheck instanceof RegExp && qt(z.tagNameCheck, r) || z.tagNameCheck instanceof Function && z.tagNameCheck(r)))) return !1;
|
|
968
|
+
} else if (!Te[t] && !qt(ne, zt(r, P, "")) && !((t === "src" || t === "xlink:href" || t === "href") && e !== "script" && Bt(r, "data:") === 0 && Ce[e]) && !(se && !qt(N, zt(r, P, ""))) && r) return !1;
|
|
969
969
|
}
|
|
970
970
|
return !0;
|
|
971
971
|
}, $e = X({}, [
|
|
@@ -978,7 +978,7 @@ function Dn() {
|
|
|
978
978
|
"font-face-uri",
|
|
979
979
|
"missing-glyph"
|
|
980
980
|
]), et = function(e) {
|
|
981
|
-
return !$e[It(e)] && qt(
|
|
981
|
+
return !$e[It(e)] && qt(F, e);
|
|
982
982
|
}, tt = function(e) {
|
|
983
983
|
Xe(k.beforeSanitizeAttributes, e, null);
|
|
984
984
|
let n = e.attributes;
|
|
@@ -987,12 +987,12 @@ function Dn() {
|
|
|
987
987
|
attrName: "",
|
|
988
988
|
attrValue: "",
|
|
989
989
|
keepAttr: !0,
|
|
990
|
-
allowedAttributes:
|
|
990
|
+
allowedAttributes: R,
|
|
991
991
|
forceKeepAttr: void 0
|
|
992
992
|
}, i = n.length;
|
|
993
993
|
for (; i--;) {
|
|
994
994
|
let a = n[i], o = a.name, s = a.namespaceURI, c = a.value, l = G(o), u = c, d = o === "value" ? u : Vt(u);
|
|
995
|
-
if (r.attrName = l, r.attrValue = d, r.keepAttr = !0, r.forceKeepAttr = void 0, Xe(k.uponSanitizeAttribute, e, r), d = r.attrValue,
|
|
995
|
+
if (r.attrName = l, r.attrValue = d, r.keepAttr = !0, r.forceKeepAttr = void 0, Xe(k.uponSanitizeAttribute, e, r), d = r.attrValue, ge && (l === "id" || l === "name") && Bt(d, _e) !== 0 && (Ge(o, e), d = _e + d), le && qt(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, d)) {
|
|
996
996
|
Ge(o, e);
|
|
997
997
|
continue;
|
|
998
998
|
}
|
|
@@ -1005,14 +1005,14 @@ function Dn() {
|
|
|
1005
1005
|
Ge(o, e);
|
|
1006
1006
|
continue;
|
|
1007
1007
|
}
|
|
1008
|
-
if (!
|
|
1008
|
+
if (!H && qt(/\/>/i, d)) {
|
|
1009
1009
|
Ge(o, e);
|
|
1010
1010
|
continue;
|
|
1011
1011
|
}
|
|
1012
|
-
|
|
1012
|
+
ce && jt([
|
|
1013
1013
|
A,
|
|
1014
1014
|
j,
|
|
1015
|
-
|
|
1015
|
+
ee
|
|
1016
1016
|
], (e) => {
|
|
1017
1017
|
d = zt(d, e, " ");
|
|
1018
1018
|
});
|
|
@@ -1057,50 +1057,50 @@ function Dn() {
|
|
|
1057
1057
|
let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, i = null, o = null, c = null, l = null;
|
|
1058
1058
|
if (Ae = !e, Ae && (e = "<!-->"), typeof e != "string" && !Ye(e) && (e = Qt(e), typeof e != "string")) throw Jt("dirty is not a string, aborting");
|
|
1059
1059
|
if (!t.isSupported) return e;
|
|
1060
|
-
if (
|
|
1060
|
+
if (de || K(n), t.removed = [], typeof e == "string" && (ye = !1), ye) {
|
|
1061
1061
|
let t = e.nodeName;
|
|
1062
1062
|
if (typeof t == "string") {
|
|
1063
1063
|
let e = G(t);
|
|
1064
|
-
if (!
|
|
1064
|
+
if (!I[e] || ie[e]) throw Jt("root node is forbidden and cannot be sanitized in-place");
|
|
1065
1065
|
}
|
|
1066
1066
|
rt(e);
|
|
1067
1067
|
} else if (e instanceof s) i = Ke("<!---->"), o = i.ownerDocument.importNode(e, !0), o.nodeType === Cn.element && o.nodeName === "BODY" || o.nodeName === "HTML" ? i = o : i.appendChild(o), rt(o);
|
|
1068
1068
|
else {
|
|
1069
|
-
if (!
|
|
1070
|
-
if (i = Ke(e), !i) return
|
|
1069
|
+
if (!U && !ce && !ue && e.indexOf("<") === -1) return x && me ? x.createHTML(e) : e;
|
|
1070
|
+
if (i = Ke(e), !i) return U ? null : me ? S : "";
|
|
1071
1071
|
}
|
|
1072
|
-
i &&
|
|
1073
|
-
let u = qe(
|
|
1072
|
+
i && fe && We(i.firstChild);
|
|
1073
|
+
let u = qe(ye ? e : i);
|
|
1074
1074
|
for (; c = u.nextNode();) Ze(c), tt(c), c.content instanceof a && nt(c.content);
|
|
1075
|
-
if (
|
|
1076
|
-
if (
|
|
1077
|
-
if (
|
|
1075
|
+
if (ye) return e;
|
|
1076
|
+
if (U) {
|
|
1077
|
+
if (ce) {
|
|
1078
1078
|
i.normalize();
|
|
1079
1079
|
let e = i.innerHTML;
|
|
1080
1080
|
jt([
|
|
1081
1081
|
A,
|
|
1082
1082
|
j,
|
|
1083
|
-
|
|
1083
|
+
ee
|
|
1084
1084
|
], (t) => {
|
|
1085
1085
|
e = zt(e, t, " ");
|
|
1086
1086
|
}), i.innerHTML = e;
|
|
1087
1087
|
}
|
|
1088
|
-
if (
|
|
1088
|
+
if (pe) for (l = E.call(i.ownerDocument); i.firstChild;) l.appendChild(i.firstChild);
|
|
1089
1089
|
else l = i;
|
|
1090
|
-
return (
|
|
1090
|
+
return (R.shadowroot || R.shadowrootmode) && (l = O.call(r, l, !0)), l;
|
|
1091
1091
|
}
|
|
1092
|
-
let d =
|
|
1093
|
-
return
|
|
1092
|
+
let d = ue ? i.outerHTML : i.innerHTML;
|
|
1093
|
+
return ue && I["!doctype"] && i.ownerDocument && i.ownerDocument.doctype && i.ownerDocument.doctype.name && qt(xn, i.ownerDocument.doctype.name) && (d = "<!DOCTYPE " + i.ownerDocument.doctype.name + ">\n" + d), ce && jt([
|
|
1094
1094
|
A,
|
|
1095
1095
|
j,
|
|
1096
|
-
|
|
1096
|
+
ee
|
|
1097
1097
|
], (e) => {
|
|
1098
1098
|
d = zt(d, e, " ");
|
|
1099
|
-
}), x &&
|
|
1099
|
+
}), x && me ? x.createHTML(d) : d;
|
|
1100
1100
|
}, t.setConfig = function() {
|
|
1101
|
-
K(arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}),
|
|
1101
|
+
K(arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}), de = !0;
|
|
1102
1102
|
}, t.clearConfig = function() {
|
|
1103
|
-
Re = null,
|
|
1103
|
+
Re = null, de = !1;
|
|
1104
1104
|
}, t.isValidAttribute = function(e, t, n) {
|
|
1105
1105
|
return Re || K({}), Qe(G(e), G(t), n);
|
|
1106
1106
|
}, t.addHook = function(e, t) {
|
|
@@ -1316,12 +1316,12 @@ In.prototype.parse = function(e, t) {
|
|
|
1316
1316
|
};
|
|
1317
1317
|
//#endregion
|
|
1318
1318
|
//#region node_modules/mdurl/index.mjs
|
|
1319
|
-
var Jn = /* @__PURE__ */
|
|
1319
|
+
var Jn = /* @__PURE__ */ le({
|
|
1320
1320
|
decode: () => jn,
|
|
1321
1321
|
encode: () => Pn,
|
|
1322
1322
|
format: () => Fn,
|
|
1323
1323
|
parse: () => qn
|
|
1324
|
-
}), Yn = /[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/, Xn = /[\0-\x1F\x7F-\x9F]/, Zn = /[\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]/, Qn = /[!-#%-\*,-\/:;\?@\[-\]_\{\}\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]/, $n = /[\$\+<->\^`\|~\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]/, er = /[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/, tr = /* @__PURE__ */
|
|
1324
|
+
}), Yn = /[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/, Xn = /[\0-\x1F\x7F-\x9F]/, Zn = /[\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]/, Qn = /[!-#%-\*,-\/:;\?@\[-\]_\{\}\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]/, $n = /[\$\+<->\^`\|~\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]/, er = /[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/, tr = /* @__PURE__ */ le({
|
|
1325
1325
|
Any: () => Yn,
|
|
1326
1326
|
Cc: () => Xn,
|
|
1327
1327
|
Cf: () => Zn,
|
|
@@ -1516,7 +1516,7 @@ function br(e, t = hr.Legacy) {
|
|
|
1516
1516
|
}
|
|
1517
1517
|
//#endregion
|
|
1518
1518
|
//#region node_modules/markdown-it/lib/common/utils.mjs
|
|
1519
|
-
var xr = /* @__PURE__ */
|
|
1519
|
+
var xr = /* @__PURE__ */ le({
|
|
1520
1520
|
arrayReplaceAt: () => Dr,
|
|
1521
1521
|
assign: () => Er,
|
|
1522
1522
|
escapeHtml: () => Br,
|
|
@@ -1751,7 +1751,7 @@ function Xr(e, t, n, r) {
|
|
|
1751
1751
|
}
|
|
1752
1752
|
//#endregion
|
|
1753
1753
|
//#region node_modules/markdown-it/lib/helpers/index.mjs
|
|
1754
|
-
var Zr = /* @__PURE__ */
|
|
1754
|
+
var Zr = /* @__PURE__ */ le({
|
|
1755
1755
|
parseLinkDestination: () => Yr,
|
|
1756
1756
|
parseLinkLabel: () => Jr,
|
|
1757
1757
|
parseLinkTitle: () => Xr
|
|
@@ -3873,12 +3873,12 @@ function ps(e) {
|
|
|
3873
3873
|
function ms(e, t = !1, n = !0) {
|
|
3874
3874
|
if (!e) return "";
|
|
3875
3875
|
if (e.getDeletedAt?.() != null) return "(Message removed)";
|
|
3876
|
-
if (e instanceof
|
|
3877
|
-
if (e instanceof
|
|
3876
|
+
if (e instanceof H.TextMessage) return e.getText?.() ?? "";
|
|
3877
|
+
if (e instanceof H.MediaMessage) {
|
|
3878
3878
|
let r = n ? e.getAttachment?.()?.getName?.() ?? "" : "", i = e.getCaption?.()?.trim?.() ?? "", a = e.getType?.();
|
|
3879
3879
|
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"}`;
|
|
3880
3880
|
}
|
|
3881
|
-
if (e instanceof
|
|
3881
|
+
if (e instanceof H.Action) {
|
|
3882
3882
|
let t = (e.getActionFor?.()?.getMetadata?.() ?? e.getReceiver?.()?.getMetadata?.() ?? {}).systemDisplayName, n = (e.getActionBy?.())?.getName?.() ?? "", r = e.getMessage?.() ?? "";
|
|
3883
3883
|
return typeof t == "string" && t.trim() && n ? r.replace(n, t.trim()) : r;
|
|
3884
3884
|
}
|
|
@@ -4158,148 +4158,148 @@ function Es(e) {
|
|
|
4158
4158
|
//#region src/chat/client.ts
|
|
4159
4159
|
var Ds = null, Os = null;
|
|
4160
4160
|
function ks({ environment: e }) {
|
|
4161
|
-
|
|
4161
|
+
fe(e);
|
|
4162
4162
|
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);
|
|
4163
|
-
function
|
|
4163
|
+
function ee(e) {
|
|
4164
4164
|
if (!e.length) return;
|
|
4165
4165
|
let t = { ...A.value };
|
|
4166
4166
|
for (let n of e) n.uid && n.displayName.trim() && (t[n.uid] = n.displayName);
|
|
4167
4167
|
A.value = t;
|
|
4168
4168
|
}
|
|
4169
|
-
function
|
|
4170
|
-
|
|
4169
|
+
function te(e) {
|
|
4170
|
+
ee(Object.entries(lt(e)).map(([e, t]) => ({
|
|
4171
4171
|
uid: e,
|
|
4172
4172
|
displayName: t
|
|
4173
4173
|
})));
|
|
4174
4174
|
}
|
|
4175
|
-
function
|
|
4176
|
-
return
|
|
4175
|
+
function M(e, t) {
|
|
4176
|
+
return te(e), Ns(e, t);
|
|
4177
4177
|
}
|
|
4178
|
-
let
|
|
4179
|
-
async function
|
|
4180
|
-
await As(e), !t.value && (
|
|
4178
|
+
let N = n(() => v.value.find((e) => e.id === T.value) ?? null), P = `bcc-ui-connection-${crypto.randomUUID()}`, F = `bcc-ui-message-${crypto.randomUUID()}`, ne = !1, I = !1, L = null, R = null, re = null, z = null, ie = 0, ae = 0, B = !1, oe = !1, V = null, se = /* @__PURE__ */ new Map(), ce = /* @__PURE__ */ new Set(), le = null, ue = null, de = 0;
|
|
4179
|
+
async function pe() {
|
|
4180
|
+
await As(e), !t.value && (be(), dt(), t.value = !0, await ut(), _.value && (Pe(_.value.uid), ge(), ke(), !m.value && !oe && Oe()));
|
|
4181
4181
|
}
|
|
4182
|
-
async function
|
|
4182
|
+
async function me(e) {
|
|
4183
4183
|
g.value = null, r.value = !0;
|
|
4184
4184
|
try {
|
|
4185
|
-
await
|
|
4186
|
-
let t =
|
|
4187
|
-
await
|
|
4185
|
+
await pe();
|
|
4186
|
+
let t = _e();
|
|
4187
|
+
await H.getLoggedinUser() && t !== e && await H.logout(), ve(e);
|
|
4188
4188
|
let n = await js(e);
|
|
4189
|
-
_.value = Is(await
|
|
4189
|
+
_.value = Is(await H.login(n)), Pe(_.value.uid), h.value = !0, m.value = typeof navigator < "u" ? !navigator.onLine : !1, ge(), ke(), oe || await Oe(), await Fe(), Wt();
|
|
4190
4190
|
} catch (e) {
|
|
4191
4191
|
throw xt(), g.value = Q(e, "Unable to sign in to chat."), e;
|
|
4192
4192
|
} finally {
|
|
4193
4193
|
r.value = !1;
|
|
4194
4194
|
}
|
|
4195
4195
|
}
|
|
4196
|
-
async function
|
|
4196
|
+
async function he() {
|
|
4197
4197
|
g.value = null;
|
|
4198
4198
|
try {
|
|
4199
|
-
|
|
4199
|
+
ve(null), Se(), await H.getLoggedinUser() && await H.logout();
|
|
4200
4200
|
} finally {
|
|
4201
4201
|
xt();
|
|
4202
4202
|
}
|
|
4203
4203
|
}
|
|
4204
|
-
function
|
|
4204
|
+
function ge() {
|
|
4205
4205
|
let e = Me();
|
|
4206
4206
|
if (!e) {
|
|
4207
|
-
|
|
4207
|
+
V = null, k.value = [];
|
|
4208
4208
|
return;
|
|
4209
4209
|
}
|
|
4210
|
-
let t = `bcc-chat:${
|
|
4211
|
-
|
|
4210
|
+
let t = `bcc-chat:${U().appId}:${e}`;
|
|
4211
|
+
ye(t), V = new bs(t), k.value = V.getQueue();
|
|
4212
4212
|
}
|
|
4213
|
-
function
|
|
4213
|
+
function ye(e) {
|
|
4214
4214
|
if (typeof window > "u") return;
|
|
4215
|
-
let t = `bcc-chat:${
|
|
4215
|
+
let t = `bcc-chat:${U().appId}:`, n = [];
|
|
4216
4216
|
for (let r = 0; r < window.localStorage.length; r += 1) {
|
|
4217
4217
|
let i = window.localStorage.key(r);
|
|
4218
4218
|
i && i.startsWith(t) && i !== e && n.push(i);
|
|
4219
4219
|
}
|
|
4220
4220
|
n.forEach((e) => window.localStorage.removeItem(e));
|
|
4221
4221
|
}
|
|
4222
|
-
function ye() {
|
|
4223
|
-
L || typeof window > "u" || (window.addEventListener("online", be), window.addEventListener("offline", Se), L = !0);
|
|
4224
|
-
}
|
|
4225
4222
|
function be() {
|
|
4226
|
-
|
|
4223
|
+
I || typeof window > "u" || (window.addEventListener("online", xe), window.addEventListener("offline", Ce), I = !0);
|
|
4227
4224
|
}
|
|
4228
|
-
function
|
|
4229
|
-
m.value = !
|
|
4225
|
+
function xe() {
|
|
4226
|
+
m.value = !1, B = !0, oe || De(!0);
|
|
4230
4227
|
}
|
|
4231
4228
|
function Ce() {
|
|
4232
|
-
|
|
4229
|
+
m.value = !0, p.value = !1, we();
|
|
4233
4230
|
}
|
|
4234
4231
|
function we() {
|
|
4235
|
-
|
|
4232
|
+
L !== null && (clearTimeout(L), L = null);
|
|
4236
4233
|
}
|
|
4237
4234
|
function Te() {
|
|
4238
|
-
|
|
4235
|
+
ie = Date.now() + 1500;
|
|
4236
|
+
}
|
|
4237
|
+
function Ee() {
|
|
4238
|
+
return Date.now() < ie;
|
|
4239
4239
|
}
|
|
4240
|
-
function
|
|
4241
|
-
if (
|
|
4242
|
-
let t = e ? 0 : Math.min(3e4, 1e3 * 2 ** Math.min(
|
|
4243
|
-
|
|
4244
|
-
|
|
4240
|
+
function De(e = !1) {
|
|
4241
|
+
if (L !== null || R || m.value || !h.value || oe) return;
|
|
4242
|
+
let t = e ? 0 : Math.min(3e4, 1e3 * 2 ** Math.min(ae, 4));
|
|
4243
|
+
L = setTimeout(() => {
|
|
4244
|
+
L = null, Oe();
|
|
4245
4245
|
}, t);
|
|
4246
4246
|
}
|
|
4247
|
-
async function
|
|
4248
|
-
if (!(m.value || !h.value ||
|
|
4249
|
-
|
|
4247
|
+
async function Oe() {
|
|
4248
|
+
if (!(m.value || !h.value || oe)) return R || (R = (async () => {
|
|
4249
|
+
we();
|
|
4250
4250
|
try {
|
|
4251
|
-
let e = await
|
|
4251
|
+
let e = await H.getLoggedinUser();
|
|
4252
4252
|
if (!e) {
|
|
4253
|
-
let t =
|
|
4253
|
+
let t = _e();
|
|
4254
4254
|
if (!t) return;
|
|
4255
4255
|
let n = await js(t);
|
|
4256
|
-
e = await
|
|
4256
|
+
e = await H.login(n);
|
|
4257
4257
|
}
|
|
4258
|
-
_.value = Is(e), h.value = !0,
|
|
4259
|
-
let t =
|
|
4260
|
-
typeof t == "function" && (await t.call(
|
|
4258
|
+
_.value = Is(e), h.value = !0, ge();
|
|
4259
|
+
let t = H.connect;
|
|
4260
|
+
typeof t == "function" && (await t.call(H), p.value = !0), ae = 0, B && await W();
|
|
4261
4261
|
} catch (e) {
|
|
4262
|
-
p.value = !1,
|
|
4262
|
+
p.value = !1, ae += 1, q(e) || (g.value = Q(e, "Unable to reconnect to chat.")), De();
|
|
4263
4263
|
} finally {
|
|
4264
|
-
|
|
4264
|
+
R = null;
|
|
4265
4265
|
}
|
|
4266
|
-
})(),
|
|
4266
|
+
})(), R);
|
|
4267
4267
|
}
|
|
4268
|
-
async function
|
|
4269
|
-
return
|
|
4270
|
-
|
|
4268
|
+
async function W() {
|
|
4269
|
+
return re || m.value || !h.value || oe || (re = (async () => {
|
|
4270
|
+
B = !1, g.value = null;
|
|
4271
4271
|
try {
|
|
4272
4272
|
await Fe(), Wt();
|
|
4273
4273
|
} finally {
|
|
4274
|
-
|
|
4274
|
+
re = null;
|
|
4275
4275
|
}
|
|
4276
|
-
})()),
|
|
4276
|
+
})()), re;
|
|
4277
4277
|
}
|
|
4278
4278
|
function ke() {
|
|
4279
|
-
if (!
|
|
4280
|
-
let e =
|
|
4279
|
+
if (!V || v.value.length > 0) return;
|
|
4280
|
+
let e = V.getConversations();
|
|
4281
4281
|
e.length !== 0 && (v.value = Vs(e), !T.value && v.value.length > 0 && Ae(T.value));
|
|
4282
4282
|
}
|
|
4283
4283
|
function Ae(e) {
|
|
4284
|
-
if (!
|
|
4285
|
-
let t =
|
|
4284
|
+
if (!V || !e) return y.value = [], !1;
|
|
4285
|
+
let t = V.getMessages(e).sort(Hs);
|
|
4286
4286
|
return y.value = t, t.length > 0;
|
|
4287
4287
|
}
|
|
4288
4288
|
async function je() {
|
|
4289
|
-
|
|
4289
|
+
oe = !1, B = !0, await Oe();
|
|
4290
4290
|
}
|
|
4291
4291
|
async function Ne() {
|
|
4292
|
-
|
|
4293
|
-
let e =
|
|
4294
|
-
typeof e == "function" && await e.call(
|
|
4292
|
+
oe = !0, B = !1, we();
|
|
4293
|
+
let e = H.disconnect;
|
|
4294
|
+
typeof e == "function" && await e.call(H), p.value = !1;
|
|
4295
4295
|
}
|
|
4296
4296
|
async function Fe() {
|
|
4297
|
-
if (await
|
|
4298
|
-
v.value = Vs(
|
|
4297
|
+
if (await pe(), i.value = !0, g.value = null, m.value && V) {
|
|
4298
|
+
v.value = Vs(V.getConversations()), N.value && await rt(), i.value = !1;
|
|
4299
4299
|
return;
|
|
4300
4300
|
}
|
|
4301
4301
|
try {
|
|
4302
|
-
let e = new
|
|
4302
|
+
let e = new H.ConversationsRequestBuilder().setLimit(50).withTags(!0).setConversationType(H.RECEIVER_TYPE.GROUP).build(), t = [], n = [];
|
|
4303
4303
|
do
|
|
4304
4304
|
n = await e.fetchNext(), t.push(...n.map((e) => Ms(e, _.value?.uid)));
|
|
4305
4305
|
while (n.length === 50);
|
|
@@ -4308,9 +4308,9 @@ function ks({ environment: e }) {
|
|
|
4308
4308
|
let t = r.get(e.id);
|
|
4309
4309
|
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));
|
|
4310
4310
|
}
|
|
4311
|
-
v.value = Vs(await pt(t)),
|
|
4311
|
+
v.value = Vs(await pt(t)), V?.setConversations(v.value), N.value && await rt();
|
|
4312
4312
|
} catch (e) {
|
|
4313
|
-
let t =
|
|
4313
|
+
let t = V?.getConversations() ?? [];
|
|
4314
4314
|
if (t.length > 0) {
|
|
4315
4315
|
v.value = Vs(t);
|
|
4316
4316
|
return;
|
|
@@ -4321,7 +4321,7 @@ function ks({ environment: e }) {
|
|
|
4321
4321
|
}
|
|
4322
4322
|
}
|
|
4323
4323
|
async function Ie(e) {
|
|
4324
|
-
T.value = e, E.value = null, b.value = [],
|
|
4324
|
+
T.value = e, E.value = null, b.value = [], ue = null, C.value = !1, D.value = null, O.value = null, Ae(e), await rt();
|
|
4325
4325
|
}
|
|
4326
4326
|
function Le(e) {
|
|
4327
4327
|
e && (O.value = null), D.value = e;
|
|
@@ -4330,14 +4330,14 @@ function ks({ environment: e }) {
|
|
|
4330
4330
|
e && (D.value = null), O.value = e;
|
|
4331
4331
|
}
|
|
4332
4332
|
async function Re(e) {
|
|
4333
|
-
E.value = e,
|
|
4333
|
+
E.value = e, ue = null, C.value = !1, D.value = null, O.value = null, await at(e.id);
|
|
4334
4334
|
}
|
|
4335
4335
|
function ze() {
|
|
4336
|
-
E.value = null, b.value = [],
|
|
4336
|
+
E.value = null, b.value = [], ue = null, C.value = !1, D.value = null, O.value = null;
|
|
4337
4337
|
}
|
|
4338
4338
|
async function K(e, t) {
|
|
4339
4339
|
if (u.value) return;
|
|
4340
|
-
let n =
|
|
4340
|
+
let n = N.value;
|
|
4341
4341
|
if (!n) return;
|
|
4342
4342
|
let r = cs(e);
|
|
4343
4343
|
if (!ls(r)) return;
|
|
@@ -4361,10 +4361,10 @@ function ks({ environment: e }) {
|
|
|
4361
4361
|
muid: a,
|
|
4362
4362
|
deliveryState: "sending"
|
|
4363
4363
|
}));
|
|
4364
|
-
let e = new
|
|
4364
|
+
let e = new H.TextMessage(n.targetId, r, Xs(n));
|
|
4365
4365
|
e.setMuid?.(a), Object.keys(o).length > 0 && e.setMetadata?.(o), i && e.setParentMessageId?.(Number(i));
|
|
4366
|
-
let t = await
|
|
4367
|
-
Ct(
|
|
4366
|
+
let t = await H.sendMessage(e);
|
|
4367
|
+
Ct(M(t, _.value?.uid)), ht(t), await vt(t), D.value = null;
|
|
4368
4368
|
} catch (e) {
|
|
4369
4369
|
if (q(e)) {
|
|
4370
4370
|
Ht("queued", a), It(n, r, o, E.value?.id, a), D.value = null;
|
|
@@ -4376,16 +4376,16 @@ function ks({ environment: e }) {
|
|
|
4376
4376
|
}
|
|
4377
4377
|
}
|
|
4378
4378
|
async function Ve(e, t) {
|
|
4379
|
-
let n =
|
|
4379
|
+
let n = N.value;
|
|
4380
4380
|
if (!n || m.value) return;
|
|
4381
4381
|
let r = cs(t);
|
|
4382
4382
|
if (ls(r)) {
|
|
4383
4383
|
u.value = !0, g.value = null;
|
|
4384
4384
|
try {
|
|
4385
4385
|
let t;
|
|
4386
|
-
e.kind === "text" ? t = new
|
|
4387
|
-
let i = await
|
|
4388
|
-
Ct(
|
|
4386
|
+
e.kind === "text" ? t = new H.TextMessage(n.targetId, r, Xs(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, Xs(n)), t.setCaption(r)), t.setId(Number(e.id));
|
|
4387
|
+
let i = await H.editMessage(t);
|
|
4388
|
+
Ct(M(i, _.value?.uid)), ht(i), O.value = null;
|
|
4389
4389
|
} catch (e) {
|
|
4390
4390
|
throw g.value = Q(e, "Unable to edit the message."), e;
|
|
4391
4391
|
} finally {
|
|
@@ -4395,7 +4395,7 @@ function ks({ environment: e }) {
|
|
|
4395
4395
|
}
|
|
4396
4396
|
async function He(e, t) {
|
|
4397
4397
|
if (u.value) return;
|
|
4398
|
-
let n =
|
|
4398
|
+
let n = N.value;
|
|
4399
4399
|
if (!n) return;
|
|
4400
4400
|
let r = E.value?.id, i = crypto.randomUUID(), a = Js(Pt(D.value, t), i), o = ec(e.file);
|
|
4401
4401
|
u.value = !0, g.value = null;
|
|
@@ -4419,10 +4419,10 @@ function ks({ environment: e }) {
|
|
|
4419
4419
|
muid: i,
|
|
4420
4420
|
deliveryState: "sending"
|
|
4421
4421
|
}));
|
|
4422
|
-
let t = new
|
|
4422
|
+
let t = new H.MediaMessage(n.targetId, e.file, o, Xs(n));
|
|
4423
4423
|
t.setMuid?.(i), Object.keys(a).length > 0 && t.setMetadata?.(a), r && t.setParentMessageId?.(Number(r)), e.caption?.trim() && t.setCaption?.(e.caption.trim());
|
|
4424
|
-
let s = await
|
|
4425
|
-
Ct(
|
|
4424
|
+
let s = await H.sendMediaMessage(t);
|
|
4425
|
+
Ct(M(s, _.value?.uid)), ht(s), await vt(s), D.value = null;
|
|
4426
4426
|
} catch (t) {
|
|
4427
4427
|
if (q(t)) {
|
|
4428
4428
|
Ht("queued", i), await zt(n, e, a, r, i), D.value = null;
|
|
@@ -4435,7 +4435,7 @@ function ks({ environment: e }) {
|
|
|
4435
4435
|
}
|
|
4436
4436
|
async function Ue(e, t) {
|
|
4437
4437
|
if (u.value) return;
|
|
4438
|
-
let n =
|
|
4438
|
+
let n = N.value;
|
|
4439
4439
|
if (!n) return;
|
|
4440
4440
|
let r = e.question.trim(), i = e.options.map((e) => e.trim()).filter(Boolean);
|
|
4441
4441
|
if (!r || i.length < 2) return;
|
|
@@ -4466,11 +4466,11 @@ function ks({ environment: e }) {
|
|
|
4466
4466
|
question: r,
|
|
4467
4467
|
options: i,
|
|
4468
4468
|
receiver: n.targetId,
|
|
4469
|
-
receiverType: n.type === "group" ?
|
|
4469
|
+
receiverType: n.type === "group" ? H.RECEIVER_TYPE.GROUP : H.RECEIVER_TYPE.USER
|
|
4470
4470
|
};
|
|
4471
4471
|
a && (e.parentMessageId = Number(a)), Object.keys(s).length > 0 && (e.metadata = s);
|
|
4472
|
-
let t = await
|
|
4473
|
-
c ? (Ut(o), Ct(
|
|
4472
|
+
let t = await H.callExtension("polls", "POST", "v2/create", e), c = t?.message ?? t?.custom_message ?? t?.data?.message ?? null;
|
|
4473
|
+
c ? (Ut(o), Ct(M(c, _.value?.uid)), ht(c), await vt(c)) : (Ut(o), await St()), D.value = null;
|
|
4474
4474
|
} catch (e) {
|
|
4475
4475
|
if (q(e)) {
|
|
4476
4476
|
Ht("queued", o), Lt(n, {
|
|
@@ -4491,7 +4491,7 @@ function ks({ environment: e }) {
|
|
|
4491
4491
|
if (i.poll && !i.poll.options.some((e) => e.id === t && e.voters.includes(r ?? ""))) {
|
|
4492
4492
|
g.value = null, r && Ct(Ge(i, t, r));
|
|
4493
4493
|
try {
|
|
4494
|
-
await
|
|
4494
|
+
await H.callExtension("polls", "POST", "v2/vote", {
|
|
4495
4495
|
id: n,
|
|
4496
4496
|
vote: t
|
|
4497
4497
|
});
|
|
@@ -4525,7 +4525,7 @@ function ks({ environment: e }) {
|
|
|
4525
4525
|
let n = Tt(e.id, e.parentMessageId) ?? e, r = n.reactions.find((e) => e.emoji === t && e.reactedByMe);
|
|
4526
4526
|
Ct(Et(n, t));
|
|
4527
4527
|
try {
|
|
4528
|
-
Ct(
|
|
4528
|
+
Ct(M(r ? await H.removeReaction(Number(e.id), t) : await H.addReaction(Number(e.id), t), _.value?.uid));
|
|
4529
4529
|
} catch (e) {
|
|
4530
4530
|
throw Ct(n), g.value = Q(e, "Unable to update the reaction."), e;
|
|
4531
4531
|
}
|
|
@@ -4536,7 +4536,7 @@ function ks({ environment: e }) {
|
|
|
4536
4536
|
return;
|
|
4537
4537
|
}
|
|
4538
4538
|
if (!m.value) try {
|
|
4539
|
-
let t =
|
|
4539
|
+
let t = M(await H.deleteMessage(String(e.id)), _.value?.uid);
|
|
4540
4540
|
kt(t), At(t);
|
|
4541
4541
|
} catch (e) {
|
|
4542
4542
|
throw g.value = Q(e, "Unable to delete the message."), e;
|
|
@@ -4547,7 +4547,7 @@ function ks({ environment: e }) {
|
|
|
4547
4547
|
if (ls(t)) {
|
|
4548
4548
|
g.value = null;
|
|
4549
4549
|
try {
|
|
4550
|
-
let n = (await
|
|
4550
|
+
let n = (await H.callExtension("message-translation", "POST", "v2/translate", {
|
|
4551
4551
|
msgId: Number(e.id),
|
|
4552
4552
|
text: t,
|
|
4553
4553
|
languages: typeof navigator < "u" ? navigator.languages : ["en"]
|
|
@@ -4567,29 +4567,29 @@ function ks({ environment: e }) {
|
|
|
4567
4567
|
}
|
|
4568
4568
|
}
|
|
4569
4569
|
async function Ye(e) {
|
|
4570
|
-
let t = e ??
|
|
4570
|
+
let t = e ?? N.value?.targetId, n = _.value?.uid, r = ++de;
|
|
4571
4571
|
if (!t || !n) {
|
|
4572
|
-
r ===
|
|
4572
|
+
r === de && (x.value = []);
|
|
4573
4573
|
return;
|
|
4574
4574
|
}
|
|
4575
4575
|
l.value = !0, g.value = null;
|
|
4576
4576
|
try {
|
|
4577
|
-
let e = new
|
|
4577
|
+
let e = new H.MessagesRequestBuilder().setLimit(50).setGUID(n).withTags(!0).setTags([t]).build(), i = [], a = [];
|
|
4578
4578
|
do
|
|
4579
|
-
a = await e.fetchPrevious(), i.push(...a.map((e) =>
|
|
4579
|
+
a = await e.fetchPrevious(), i.push(...a.map((e) => M(e, _.value?.uid)));
|
|
4580
4580
|
while (a.length === 50);
|
|
4581
4581
|
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()));
|
|
4582
|
-
if (r !==
|
|
4582
|
+
if (r !== de) return;
|
|
4583
4583
|
x.value = o;
|
|
4584
4584
|
} catch (e) {
|
|
4585
|
-
if (r !==
|
|
4585
|
+
if (r !== de) return;
|
|
4586
4586
|
throw g.value = Q(e, Be("loadScheduledMessagesError")), e;
|
|
4587
4587
|
} finally {
|
|
4588
|
-
r ===
|
|
4588
|
+
r === de && (l.value = !1);
|
|
4589
4589
|
}
|
|
4590
4590
|
}
|
|
4591
4591
|
async function Xe(e, t) {
|
|
4592
|
-
let n =
|
|
4592
|
+
let n = N.value;
|
|
4593
4593
|
if (n) {
|
|
4594
4594
|
d.value = !0, g.value = null;
|
|
4595
4595
|
try {
|
|
@@ -4605,7 +4605,7 @@ function ks({ environment: e }) {
|
|
|
4605
4605
|
if (g.value = null, !e.scheduled?.muid) return;
|
|
4606
4606
|
let t = e.scheduled.originalChatUid;
|
|
4607
4607
|
try {
|
|
4608
|
-
await
|
|
4608
|
+
await H.deleteMessage(String(e.id)), x.value = x.value.filter((t) => t.id !== e.id), await Ye(t);
|
|
4609
4609
|
} catch (e) {
|
|
4610
4610
|
throw g.value = Q(e, "Unable to remove the scheduled message."), e;
|
|
4611
4611
|
}
|
|
@@ -4615,27 +4615,27 @@ function ks({ environment: e }) {
|
|
|
4615
4615
|
let n = _.value?.uid;
|
|
4616
4616
|
if (!n || !e.scheduled?.muid || e.kind === "poll") return;
|
|
4617
4617
|
let r = ss(t);
|
|
4618
|
-
if (
|
|
4619
|
-
|
|
4620
|
-
|
|
4621
|
-
|
|
4622
|
-
|
|
4623
|
-
|
|
4624
|
-
|
|
4625
|
-
|
|
4626
|
-
|
|
4627
|
-
t.setId?.(Number(e.id)), await U.editMessage(t), await Ye(e.scheduled.originalChatUid);
|
|
4628
|
-
} catch (e) {
|
|
4629
|
-
throw g.value = Q(e, "Unable to edit the scheduled message."), e;
|
|
4630
|
-
} finally {
|
|
4631
|
-
d.value = !1;
|
|
4618
|
+
if (e.kind === "text" && !ls(r)) return;
|
|
4619
|
+
let i = { ...e.metadata ?? {} };
|
|
4620
|
+
!i.scheduleDate && e.scheduled?.scheduleDate && (i.scheduleDate = e.scheduled.scheduleDate.toISOString()), !i.originalChatUid && e.scheduled?.originalChatUid && (i.originalChatUid = e.scheduled.originalChatUid), d.value = !0;
|
|
4621
|
+
try {
|
|
4622
|
+
let t;
|
|
4623
|
+
if (e.kind === "text") t = new H.TextMessage(n, r, H.RECEIVER_TYPE.GROUP);
|
|
4624
|
+
else {
|
|
4625
|
+
let i = e.source?.getAttachment?.()?.getFileUrl?.() ?? e.source?.getAttachment?.()?.getUrl?.() ?? e.attachments[0]?.url ?? "";
|
|
4626
|
+
t = new H.MediaMessage(n, i, e.source?.getType?.() ?? e.type ?? e.kind, H.RECEIVER_TYPE.GROUP), t.setCaption(r);
|
|
4632
4627
|
}
|
|
4628
|
+
Object.keys(i).length > 0 && t.setMetadata(i), t.setId(Number(e.id)), await H.editMessage(t), await Ye(e.scheduled.originalChatUid);
|
|
4629
|
+
} catch (e) {
|
|
4630
|
+
throw g.value = Q(e, "Unable to edit the scheduled message."), e;
|
|
4631
|
+
} finally {
|
|
4632
|
+
d.value = !1;
|
|
4633
4633
|
}
|
|
4634
4634
|
}
|
|
4635
4635
|
async function $e(e) {
|
|
4636
4636
|
d.value = !0, g.value = null;
|
|
4637
4637
|
try {
|
|
4638
|
-
let t = Zs(), n = await fetch(`${
|
|
4638
|
+
let t = Zs(), n = await fetch(`${U().chatApiBaseUrl}/chats/rescheduleMessage`, {
|
|
4639
4639
|
method: "POST",
|
|
4640
4640
|
headers: {
|
|
4641
4641
|
"Content-Type": "application/json",
|
|
@@ -4657,42 +4657,42 @@ function ks({ environment: e }) {
|
|
|
4657
4657
|
}
|
|
4658
4658
|
}
|
|
4659
4659
|
function et(e) {
|
|
4660
|
-
let t = new
|
|
4660
|
+
let t = new H.MessagesRequestBuilder().setLimit(50).hideReplies(!0).hideDeletedMessages(!0);
|
|
4661
4661
|
return e.type === "group" ? t.setGUID(e.targetId) : t.setUID(e.targetId), t.build();
|
|
4662
4662
|
}
|
|
4663
4663
|
function tt(e) {
|
|
4664
|
-
return new
|
|
4664
|
+
return new H.MessagesRequestBuilder().setLimit(50).setParentMessageId(Number(e)).hideDeletedMessages(!0).build();
|
|
4665
4665
|
}
|
|
4666
4666
|
async function nt(e) {
|
|
4667
|
-
let t =
|
|
4667
|
+
let t = N.value;
|
|
4668
4668
|
if (!t) return y.value = [], S.value = !1, !1;
|
|
4669
|
-
if ((e?.reset ||
|
|
4669
|
+
if ((e?.reset || le?.conversationId !== t.id) && (le = {
|
|
4670
4670
|
conversationId: t.id,
|
|
4671
4671
|
request: et(t)
|
|
4672
|
-
}, S.value = !0), !
|
|
4673
|
-
let n = await
|
|
4674
|
-
y.value = e?.reset ? Ws(y.value.filter((e) => e.conversationId === t.id && Gs(e)), r) : Ws(y.value, r), S.value = n.length === 50,
|
|
4672
|
+
}, S.value = !0), !le) return !1;
|
|
4673
|
+
let n = await le.request.fetchPrevious(), r = n.map((e) => M(e, _.value?.uid)).filter(Ks).sort(Hs);
|
|
4674
|
+
y.value = e?.reset ? Ws(y.value.filter((e) => e.conversationId === t.id && Gs(e)), r) : Ws(y.value, r), S.value = n.length === 50, V?.setMessages(t.id, y.value);
|
|
4675
4675
|
let i = n[n.length - 1];
|
|
4676
4676
|
return i && (await yt(i), await vt(i)), n.length > 0;
|
|
4677
4677
|
}
|
|
4678
4678
|
async function rt() {
|
|
4679
|
-
let e =
|
|
4679
|
+
let e = N.value;
|
|
4680
4680
|
if (!e) {
|
|
4681
|
-
y.value = [], S.value = !1,
|
|
4681
|
+
y.value = [], S.value = !1, le = null;
|
|
4682
4682
|
return;
|
|
4683
4683
|
}
|
|
4684
4684
|
let t = Ae(e.id);
|
|
4685
|
-
if (a.value = !0, m.value &&
|
|
4686
|
-
S.value = !1,
|
|
4685
|
+
if (a.value = !0, m.value && V) {
|
|
4686
|
+
S.value = !1, le = null, a.value = !1;
|
|
4687
4687
|
return;
|
|
4688
4688
|
}
|
|
4689
4689
|
try {
|
|
4690
4690
|
await nt({ reset: !0 }), v.value = v.value.map((t) => t.id === e.id ? {
|
|
4691
4691
|
...t,
|
|
4692
4692
|
unreadCount: 0
|
|
4693
|
-
} : t),
|
|
4693
|
+
} : t), V?.setConversations(v.value);
|
|
4694
4694
|
} catch (n) {
|
|
4695
|
-
let r =
|
|
4695
|
+
let r = V?.getMessages(e.id) ?? [];
|
|
4696
4696
|
if (r.length > 0) {
|
|
4697
4697
|
t || (y.value = r.sort(Hs));
|
|
4698
4698
|
return;
|
|
@@ -4705,24 +4705,24 @@ function ks({ environment: e }) {
|
|
|
4705
4705
|
async function it(e) {
|
|
4706
4706
|
let t = E.value?.id;
|
|
4707
4707
|
if (!t) return b.value = [], C.value = !1, !1;
|
|
4708
|
-
if ((e?.reset ||
|
|
4708
|
+
if ((e?.reset || ue?.parentMessageId !== t) && (ue = {
|
|
4709
4709
|
parentMessageId: t,
|
|
4710
4710
|
request: tt(t)
|
|
4711
|
-
}, C.value = !0), !
|
|
4712
|
-
let n = await
|
|
4713
|
-
b.value = e?.reset ? Ws(b.value.filter((e) => e.parentMessageId === t && Gs(e)), r) : Ws(b.value, r), C.value = n.length === 50,
|
|
4711
|
+
}, C.value = !0), !ue) return !1;
|
|
4712
|
+
let n = await ue.request.fetchPrevious(), r = n.map((e) => M(e, _.value?.uid)).filter(Ks).sort(Hs);
|
|
4713
|
+
b.value = e?.reset ? Ws(b.value.filter((e) => e.parentMessageId === t && Gs(e)), r) : Ws(b.value, r), C.value = n.length === 50, V?.setThreadMessages(t, b.value);
|
|
4714
4714
|
let i = n[n.length - 1];
|
|
4715
4715
|
return i && (await yt(i), await vt(i)), n.length > 0;
|
|
4716
4716
|
}
|
|
4717
4717
|
async function at(e) {
|
|
4718
|
-
if (o.value = !0, m.value &&
|
|
4719
|
-
b.value =
|
|
4718
|
+
if (o.value = !0, m.value && V) {
|
|
4719
|
+
b.value = V.getThreadMessages(e).sort(Hs), C.value = !1, ue = null, o.value = !1;
|
|
4720
4720
|
return;
|
|
4721
4721
|
}
|
|
4722
4722
|
try {
|
|
4723
4723
|
await it({ reset: !0 });
|
|
4724
4724
|
} catch (t) {
|
|
4725
|
-
let n =
|
|
4725
|
+
let n = V?.getThreadMessages(e) ?? [];
|
|
4726
4726
|
if (n.length > 0) {
|
|
4727
4727
|
b.value = n.sort(Hs);
|
|
4728
4728
|
return;
|
|
@@ -4766,7 +4766,7 @@ function ks({ environment: e }) {
|
|
|
4766
4766
|
if (n()) return !0;
|
|
4767
4767
|
if (!e) break;
|
|
4768
4768
|
}
|
|
4769
|
-
for (; S.value &&
|
|
4769
|
+
for (; S.value && N.value && r < 100;) {
|
|
4770
4770
|
r += 1;
|
|
4771
4771
|
let e = await ot();
|
|
4772
4772
|
if (n()) return !0;
|
|
@@ -4775,22 +4775,22 @@ function ks({ environment: e }) {
|
|
|
4775
4775
|
return n();
|
|
4776
4776
|
}
|
|
4777
4777
|
async function ut() {
|
|
4778
|
-
let e = await
|
|
4778
|
+
let e = await H.getLoggedinUser();
|
|
4779
4779
|
_.value = e ? Is(e) : null, h.value = !!e;
|
|
4780
4780
|
}
|
|
4781
4781
|
function dt() {
|
|
4782
|
-
|
|
4782
|
+
ne ||= (H.addConnectionListener(P, new H.ConnectionListener({
|
|
4783
4783
|
onConnected: () => {
|
|
4784
|
-
if (p.value = !0,
|
|
4785
|
-
|
|
4784
|
+
if (p.value = !0, ae = 0, we(), B) {
|
|
4785
|
+
W();
|
|
4786
4786
|
return;
|
|
4787
4787
|
}
|
|
4788
4788
|
Wt();
|
|
4789
4789
|
},
|
|
4790
4790
|
onDisconnected: () => {
|
|
4791
|
-
p.value = !1, !m.value && h.value && !
|
|
4791
|
+
p.value = !1, !m.value && h.value && !oe && (B = !0, De(!0));
|
|
4792
4792
|
}
|
|
4793
|
-
})),
|
|
4793
|
+
})), H.addMessageListener(F, new H.MessageListener({
|
|
4794
4794
|
onTextMessageReceived: (e) => {
|
|
4795
4795
|
ft(e);
|
|
4796
4796
|
},
|
|
@@ -4801,17 +4801,17 @@ function ks({ environment: e }) {
|
|
|
4801
4801
|
ft(e);
|
|
4802
4802
|
},
|
|
4803
4803
|
onMessagesDelivered: () => {
|
|
4804
|
-
|
|
4804
|
+
Ee() || St({ includeThread: !1 });
|
|
4805
4805
|
},
|
|
4806
4806
|
onMessagesRead: () => {
|
|
4807
|
-
|
|
4807
|
+
Ee() || St({ includeThread: !1 });
|
|
4808
4808
|
},
|
|
4809
4809
|
onMessageEdited: (e) => {
|
|
4810
|
-
let t =
|
|
4810
|
+
let t = M(e, _.value?.uid);
|
|
4811
4811
|
Ks(t) && (gt(t), ht(e));
|
|
4812
4812
|
},
|
|
4813
4813
|
onMessageDeleted: (e) => {
|
|
4814
|
-
let t =
|
|
4814
|
+
let t = M(e, _.value?.uid);
|
|
4815
4815
|
t.parentMessageId ? kt(t) : (kt(t), At(t)), Ot();
|
|
4816
4816
|
},
|
|
4817
4817
|
onMessageReactionAdded: () => {
|
|
@@ -4821,15 +4821,15 @@ function ks({ environment: e }) {
|
|
|
4821
4821
|
St();
|
|
4822
4822
|
},
|
|
4823
4823
|
onMessagesDeliveredToAll: () => {
|
|
4824
|
-
|
|
4824
|
+
Ee() || St({ includeThread: !1 });
|
|
4825
4825
|
},
|
|
4826
4826
|
onMessagesReadByAll: () => {
|
|
4827
|
-
|
|
4827
|
+
Ee() || St({ includeThread: !1 });
|
|
4828
4828
|
}
|
|
4829
4829
|
})), !0);
|
|
4830
4830
|
}
|
|
4831
4831
|
async function ft(e) {
|
|
4832
|
-
let t =
|
|
4832
|
+
let t = M(e, _.value?.uid);
|
|
4833
4833
|
if (Ks(t)) {
|
|
4834
4834
|
if (ht(e), await yt(e), t.parentMessageId) {
|
|
4835
4835
|
_t(t), Dt(t.parentMessageId), Ot();
|
|
@@ -4848,15 +4848,15 @@ function ks({ environment: e }) {
|
|
|
4848
4848
|
}));
|
|
4849
4849
|
}
|
|
4850
4850
|
async function mt(e) {
|
|
4851
|
-
let t =
|
|
4851
|
+
let t = V?.getParticipantSettings(e), n = t?.lastUpdated ? Date.now() - t.lastUpdated > 1440 * 60 * 1e3 : !0;
|
|
4852
4852
|
if (t && (m.value || !n)) return t.mutedUntil;
|
|
4853
4853
|
if (m.value || !h.value) return t?.mutedUntil ?? null;
|
|
4854
4854
|
try {
|
|
4855
|
-
let n = (await
|
|
4855
|
+
let n = (await H.getLoggedinUser())?.getUid?.();
|
|
4856
4856
|
if (!n || e === n) return t?.mutedUntil ?? null;
|
|
4857
|
-
let r =
|
|
4857
|
+
let r = _e();
|
|
4858
4858
|
if (!r) return t?.mutedUntil ?? null;
|
|
4859
|
-
let i = await fetch(`${
|
|
4859
|
+
let i = await fetch(`${U().chatApiBaseUrl}/chats/${e}/settings/${n}`, {
|
|
4860
4860
|
method: "GET",
|
|
4861
4861
|
headers: {
|
|
4862
4862
|
"Content-Type": "application/json",
|
|
@@ -4865,7 +4865,7 @@ function ks({ environment: e }) {
|
|
|
4865
4865
|
});
|
|
4866
4866
|
if (!i.ok) return t?.mutedUntil ?? null;
|
|
4867
4867
|
let a = await i.json();
|
|
4868
|
-
return
|
|
4868
|
+
return V?.storeParticipantSettings({
|
|
4869
4869
|
chatUid: e,
|
|
4870
4870
|
mutedUntil: a.mutedUntil ?? null,
|
|
4871
4871
|
lastUpdated: Date.now()
|
|
@@ -4875,7 +4875,7 @@ function ks({ environment: e }) {
|
|
|
4875
4875
|
}
|
|
4876
4876
|
}
|
|
4877
4877
|
function ht(e) {
|
|
4878
|
-
let t =
|
|
4878
|
+
let t = M(e, _.value?.uid);
|
|
4879
4879
|
if (!Ks(t) || t.isDeleted) return;
|
|
4880
4880
|
let n = e.getConversationId(), r = v.value.find((e) => e.id === n);
|
|
4881
4881
|
if (!r) {
|
|
@@ -4888,40 +4888,40 @@ function ks({ environment: e }) {
|
|
|
4888
4888
|
lastMessageAt: /* @__PURE__ */ new Date((e.getSentAt?.() ?? 0) * 1e3),
|
|
4889
4889
|
unreadCount: n === T.value ? 0 : r.unreadCount + 1
|
|
4890
4890
|
};
|
|
4891
|
-
v.value = Vs(v.value.map((e) => e.id === n ? i : e)),
|
|
4891
|
+
v.value = Vs(v.value.map((e) => e.id === n ? i : e)), V?.setConversations(v.value);
|
|
4892
4892
|
}
|
|
4893
4893
|
function gt(e) {
|
|
4894
|
-
y.value = Us(y.value, e), T.value &&
|
|
4894
|
+
y.value = Us(y.value, e), T.value && V?.setMessages(T.value, y.value);
|
|
4895
4895
|
}
|
|
4896
4896
|
function _t(e) {
|
|
4897
|
-
e.parentMessageId === E.value?.id && (b.value = Us(b.value, e), e.parentMessageId &&
|
|
4897
|
+
e.parentMessageId === E.value?.id && (b.value = Us(b.value, e), e.parentMessageId && V?.setThreadMessages(e.parentMessageId, b.value));
|
|
4898
4898
|
}
|
|
4899
4899
|
async function vt(e) {
|
|
4900
4900
|
if (m.value) return;
|
|
4901
4901
|
let t = e.getSender?.()?.getUid?.();
|
|
4902
|
-
!t || t === _.value?.uid || e.getReadByMeAt?.() || (
|
|
4902
|
+
!t || t === _.value?.uid || e.getReadByMeAt?.() || (Te(), await H.markAsRead(e));
|
|
4903
4903
|
}
|
|
4904
4904
|
async function yt(e) {
|
|
4905
4905
|
if (m.value) return;
|
|
4906
4906
|
let t = e.getSender?.()?.getUid?.();
|
|
4907
|
-
!t || t === _.value?.uid || e.getDeliveredToMeAt?.() || (
|
|
4907
|
+
!t || t === _.value?.uid || e.getDeliveredToMeAt?.() || (Te(), await H.markAsDelivered(e));
|
|
4908
4908
|
}
|
|
4909
4909
|
async function bt(e) {
|
|
4910
|
-
return m.value ? [] : Ps(await
|
|
4910
|
+
return m.value ? [] : Ps(await H.getMessageReceipts(String(e.id)));
|
|
4911
4911
|
}
|
|
4912
4912
|
function xt() {
|
|
4913
|
-
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,
|
|
4913
|
+
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, we(), ae = 0, B = !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, ue = null, ce.clear();
|
|
4914
4914
|
}
|
|
4915
4915
|
async function St(e) {
|
|
4916
|
-
if (
|
|
4916
|
+
if (z) return z;
|
|
4917
4917
|
let t = e?.includeThread ?? !0;
|
|
4918
|
-
|
|
4919
|
-
|
|
4918
|
+
z = (async () => {
|
|
4919
|
+
N.value && await rt(), t && E.value && await at(E.value.id);
|
|
4920
4920
|
})();
|
|
4921
4921
|
try {
|
|
4922
|
-
await
|
|
4922
|
+
await z;
|
|
4923
4923
|
} finally {
|
|
4924
|
-
|
|
4924
|
+
z = null;
|
|
4925
4925
|
}
|
|
4926
4926
|
}
|
|
4927
4927
|
function Ct(e) {
|
|
@@ -4968,13 +4968,13 @@ function ks({ environment: e }) {
|
|
|
4968
4968
|
y.value = Us(y.value, r), E.value?.id === e && (E.value = r);
|
|
4969
4969
|
}
|
|
4970
4970
|
function Ot() {
|
|
4971
|
-
T.value &&
|
|
4971
|
+
T.value && V?.setMessages(T.value, y.value), E.value && V?.setThreadMessages(E.value.id, b.value);
|
|
4972
4972
|
}
|
|
4973
4973
|
function kt(e) {
|
|
4974
|
-
if (e.parentMessageId ? (b.value = b.value.filter((t) => t.id !== e.id),
|
|
4974
|
+
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) {
|
|
4975
4975
|
k.value = k.value.filter((t) => t.muid !== e.muid);
|
|
4976
|
-
let t =
|
|
4977
|
-
for (let e of t)
|
|
4976
|
+
let t = V?.getQueue().filter((t) => t.muid === e.muid) ?? [];
|
|
4977
|
+
for (let e of t) V?.dequeue(e.id), se.delete(e.id), e.kind === "attachment" && V?.deleteQueuedAttachment(e.id);
|
|
4978
4978
|
}
|
|
4979
4979
|
e.parentMessageId || jt(e.conversationId);
|
|
4980
4980
|
}
|
|
@@ -5000,7 +5000,7 @@ function ks({ environment: e }) {
|
|
|
5000
5000
|
...e,
|
|
5001
5001
|
subtitle: "No messages yet",
|
|
5002
5002
|
lastMessageAt: void 0
|
|
5003
|
-
} : e : e)),
|
|
5003
|
+
} : e : e)), V?.setConversations(v.value);
|
|
5004
5004
|
}
|
|
5005
5005
|
function jt(e, t) {
|
|
5006
5006
|
let n = y.value.length > 0 ? y.value[y.value.length - 1] : null, r = t ?? n;
|
|
@@ -5008,7 +5008,7 @@ function ks({ environment: e }) {
|
|
|
5008
5008
|
...t,
|
|
5009
5009
|
subtitle: r ? Ys(r) : "No messages yet",
|
|
5010
5010
|
lastMessageAt: r?.sentAt
|
|
5011
|
-
} : t)),
|
|
5011
|
+
} : t)), V?.setConversations(v.value);
|
|
5012
5012
|
}
|
|
5013
5013
|
function Mt(e) {
|
|
5014
5014
|
v.value = Vs(v.value.map((t) => t.id === e.conversationId ? {
|
|
@@ -5016,7 +5016,7 @@ function ks({ environment: e }) {
|
|
|
5016
5016
|
subtitle: Ys(e),
|
|
5017
5017
|
lastMessageAt: e.sentAt,
|
|
5018
5018
|
unreadCount: 0
|
|
5019
|
-
} : t)),
|
|
5019
|
+
} : t)), V?.setConversations(v.value);
|
|
5020
5020
|
}
|
|
5021
5021
|
function Nt(e) {
|
|
5022
5022
|
let t = /* @__PURE__ */ new Date(), n = Ft(e.metadata);
|
|
@@ -5167,14 +5167,14 @@ function ks({ environment: e }) {
|
|
|
5167
5167
|
parentMessageId: r,
|
|
5168
5168
|
createdAt: o.sentAt.toISOString()
|
|
5169
5169
|
};
|
|
5170
|
-
|
|
5170
|
+
se.set(s.id, t.file);
|
|
5171
5171
|
try {
|
|
5172
|
-
await
|
|
5172
|
+
await V?.storeQueuedAttachment(s.id, t.file);
|
|
5173
5173
|
} catch {}
|
|
5174
5174
|
Bt(o, s);
|
|
5175
5175
|
}
|
|
5176
5176
|
function Bt(e, t) {
|
|
5177
|
-
k.value = [...k.value, t],
|
|
5177
|
+
k.value = [...k.value, t], V?.enqueue(t), Vt(e);
|
|
5178
5178
|
}
|
|
5179
5179
|
function Vt(e) {
|
|
5180
5180
|
e.parentMessageId ? (E.value?.id === e.parentMessageId && (b.value = Us(b.value, e)), Dt(e.parentMessageId)) : y.value = Us(y.value, e), Mt(e), Ot();
|
|
@@ -5202,14 +5202,14 @@ function ks({ environment: e }) {
|
|
|
5202
5202
|
if (!(f.value || k.value.length === 0 || !h.value || m.value)) {
|
|
5203
5203
|
f.value = !0;
|
|
5204
5204
|
try {
|
|
5205
|
-
let e = [...k.value].filter((e) => !
|
|
5206
|
-
for (let t of e) if (!
|
|
5207
|
-
|
|
5205
|
+
let e = [...k.value].filter((e) => !ce.has(e.id)).sort((e, t) => e.createdAt.localeCompare(t.createdAt));
|
|
5206
|
+
for (let t of e) if (!ce.has(t.id)) {
|
|
5207
|
+
ce.add(t.id);
|
|
5208
5208
|
try {
|
|
5209
5209
|
let e = await Gt(t);
|
|
5210
|
-
k.value = k.value.filter((e) => e.id !== t.id),
|
|
5210
|
+
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), Ut(t.muid), e ? Ct(M(e, _.value?.uid)) : await St();
|
|
5211
5211
|
} finally {
|
|
5212
|
-
|
|
5212
|
+
ce.delete(t.id);
|
|
5213
5213
|
}
|
|
5214
5214
|
}
|
|
5215
5215
|
} catch (e) {
|
|
@@ -5220,7 +5220,7 @@ function ks({ environment: e }) {
|
|
|
5220
5220
|
}
|
|
5221
5221
|
}
|
|
5222
5222
|
async function Gt(e) {
|
|
5223
|
-
let t = e.receiverType === "group" ?
|
|
5223
|
+
let t = e.receiverType === "group" ? H.RECEIVER_TYPE.GROUP : H.RECEIVER_TYPE.USER;
|
|
5224
5224
|
if (e.kind === "poll" && e.poll) {
|
|
5225
5225
|
let n = {
|
|
5226
5226
|
question: e.poll.question,
|
|
@@ -5229,17 +5229,17 @@ function ks({ environment: e }) {
|
|
|
5229
5229
|
receiverType: t
|
|
5230
5230
|
};
|
|
5231
5231
|
e.parentMessageId && (n.parentMessageId = Number(e.parentMessageId)), e.metadata && Object.keys(e.metadata).length > 0 && (n.metadata = e.metadata);
|
|
5232
|
-
let r = await
|
|
5232
|
+
let r = await H.callExtension("polls", "POST", "v2/create", n);
|
|
5233
5233
|
return r?.message ?? r?.custom_message ?? r?.data?.message ?? null;
|
|
5234
5234
|
}
|
|
5235
5235
|
if (e.kind === "attachment" && e.attachment) {
|
|
5236
|
-
let n =
|
|
5236
|
+
let n = se.get(e.id) ?? await V?.getQueuedAttachment(e.id) ?? null;
|
|
5237
5237
|
if (!n) throw Error(`Queued attachment ${e.attachment.name} is no longer available for upload.`);
|
|
5238
|
-
let r = new
|
|
5239
|
-
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),
|
|
5238
|
+
let r = new H.MediaMessage(e.targetId, n, e.attachment.kind, t);
|
|
5239
|
+
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);
|
|
5240
5240
|
}
|
|
5241
|
-
let n = new
|
|
5242
|
-
return n.setMuid?.(e.muid), e.metadata && Object.keys(e.metadata).length > 0 && n.setMetadata?.(e.metadata), e.parentMessageId && n.setParentMessageId?.(Number(e.parentMessageId)),
|
|
5241
|
+
let n = new H.TextMessage(e.targetId, e.text ?? "", t);
|
|
5242
|
+
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);
|
|
5243
5243
|
}
|
|
5244
5244
|
return {
|
|
5245
5245
|
initialized: t,
|
|
@@ -5266,15 +5266,15 @@ function ks({ environment: e }) {
|
|
|
5266
5266
|
hasOlderThreadMessages: C,
|
|
5267
5267
|
pendingQueueCount: j,
|
|
5268
5268
|
activeConversationId: T,
|
|
5269
|
-
activeConversation:
|
|
5269
|
+
activeConversation: N,
|
|
5270
5270
|
activeThreadParentMessage: E,
|
|
5271
5271
|
replyToMessage: D,
|
|
5272
5272
|
editingMessage: O,
|
|
5273
|
-
init:
|
|
5273
|
+
init: pe,
|
|
5274
5274
|
connectRealtime: je,
|
|
5275
5275
|
disconnectRealtime: Ne,
|
|
5276
|
-
login:
|
|
5277
|
-
logout:
|
|
5276
|
+
login: me,
|
|
5277
|
+
logout: he,
|
|
5278
5278
|
fetchConversations: Fe,
|
|
5279
5279
|
selectConversation: Ie,
|
|
5280
5280
|
sendTextMessage: K,
|
|
@@ -5298,34 +5298,34 @@ function ks({ environment: e }) {
|
|
|
5298
5298
|
toggleReaction: Ke,
|
|
5299
5299
|
translateMessage: Je,
|
|
5300
5300
|
mentionDisplayNamesByUid: A,
|
|
5301
|
-
rememberMentionDisplayNames:
|
|
5301
|
+
rememberMentionDisplayNames: ee
|
|
5302
5302
|
};
|
|
5303
5303
|
}
|
|
5304
5304
|
async function As(e) {
|
|
5305
|
-
return
|
|
5306
|
-
let t =
|
|
5307
|
-
await
|
|
5305
|
+
return fe(e), Ds === e && Os || (Os = (async () => {
|
|
5306
|
+
let t = U(), n = new H.AppSettingsBuilder().subscribePresenceForAllUsers().setRegion(t.region).autoEstablishSocketConnection(!0).setStorageMode(H.StorageMode.SESSION).build();
|
|
5307
|
+
await H.init(t.appId, n), Ds = e;
|
|
5308
5308
|
})()), Os;
|
|
5309
5309
|
}
|
|
5310
5310
|
async function js(e) {
|
|
5311
5311
|
let t = JSON.parse(atob(e.split(".")[1]));
|
|
5312
5312
|
if (!t.sub) throw Error("Cannot read JWT subject from access token.");
|
|
5313
|
-
let n =
|
|
5313
|
+
let n = ye();
|
|
5314
5314
|
if (n && n.sub === t.sub && n.token) return n.token;
|
|
5315
|
-
let r = await fetch(`${
|
|
5315
|
+
let r = await fetch(`${U().chatApiBaseUrl}/chats/token`, {
|
|
5316
5316
|
method: "POST",
|
|
5317
5317
|
headers: new Headers([["Authorization", `Bearer ${e}`]])
|
|
5318
5318
|
});
|
|
5319
|
-
if (r.status === 401) throw
|
|
5319
|
+
if (r.status === 401) throw ve(null), Se(), Error("Unauthorized while fetching CometChat token.");
|
|
5320
5320
|
if (!r.ok) throw Error(`Token exchange failed with status ${r.status}.`);
|
|
5321
5321
|
let i = await r.json();
|
|
5322
|
-
return
|
|
5322
|
+
return xe({
|
|
5323
5323
|
sub: t.sub,
|
|
5324
5324
|
token: i.token
|
|
5325
5325
|
}), i.token;
|
|
5326
5326
|
}
|
|
5327
5327
|
function Ms(e, t) {
|
|
5328
|
-
let n = e.getConversationWith(), r = e.getConversationType() ===
|
|
5328
|
+
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;
|
|
5329
5329
|
if (c && e.getConversationId() === c) return {
|
|
5330
5330
|
id: e.getConversationId(),
|
|
5331
5331
|
targetId: o,
|
|
@@ -5343,7 +5343,7 @@ function Ms(e, t) {
|
|
|
5343
5343
|
type: r,
|
|
5344
5344
|
title: n.getName() ?? o,
|
|
5345
5345
|
subtitle: l && Ks(l) && !l.isDeleted ? Ys(l) : "No messages yet",
|
|
5346
|
-
avatar: i ?
|
|
5346
|
+
avatar: i ? Ce(i.getAvatar()) : void 0,
|
|
5347
5347
|
unreadCount: Number.isFinite(u) ? u : 0,
|
|
5348
5348
|
lastMessageAt: s && !l?.isDeleted ? /* @__PURE__ */ new Date((s.getSentAt?.() ?? 0) * 1e3) : void 0,
|
|
5349
5349
|
tags: (e.getTags() ?? []).map((e) => String(e)),
|
|
@@ -5402,7 +5402,7 @@ function Is(e) {
|
|
|
5402
5402
|
return {
|
|
5403
5403
|
uid: e.getUid(),
|
|
5404
5404
|
name: e.getName?.() ?? e.getUid(),
|
|
5405
|
-
avatar:
|
|
5405
|
+
avatar: Ce(e.getAvatar?.()),
|
|
5406
5406
|
status: e.getStatus?.() ?? void 0
|
|
5407
5407
|
};
|
|
5408
5408
|
}
|
|
@@ -5422,7 +5422,7 @@ function zs(e, t) {
|
|
|
5422
5422
|
let n = e.getType?.(), r = e.getCategory?.(), i = xc(e);
|
|
5423
5423
|
if (String(r).toLowerCase() === "action") return uc(e);
|
|
5424
5424
|
if (i) return `Poll: ${i.question}`;
|
|
5425
|
-
if (n ===
|
|
5425
|
+
if (n === H.MESSAGE_TYPE.TEXT || typeof e.getText == "function") {
|
|
5426
5426
|
let t = us(e.getText?.());
|
|
5427
5427
|
if (t) return t;
|
|
5428
5428
|
}
|
|
@@ -5437,7 +5437,7 @@ function Bs(e, t) {
|
|
|
5437
5437
|
let n = e.getType?.(), r = e.getCategory?.(), i = xc(e);
|
|
5438
5438
|
if (String(r).toLowerCase() === "action") return uc(e);
|
|
5439
5439
|
if (i) return `Poll: ${i.question}`;
|
|
5440
|
-
if (n ===
|
|
5440
|
+
if (n === H.MESSAGE_TYPE.TEXT || typeof e.getText == "function") {
|
|
5441
5441
|
let t = ss(e.getText?.());
|
|
5442
5442
|
if (ls(t)) return t;
|
|
5443
5443
|
}
|
|
@@ -5489,17 +5489,17 @@ function Q(e, t) {
|
|
|
5489
5489
|
return e instanceof Error && e.message ? e.message : t;
|
|
5490
5490
|
}
|
|
5491
5491
|
function Xs(e) {
|
|
5492
|
-
return e.type === "group" ?
|
|
5492
|
+
return e.type === "group" ? H.RECEIVER_TYPE.GROUP : H.RECEIVER_TYPE.USER;
|
|
5493
5493
|
}
|
|
5494
5494
|
function Zs() {
|
|
5495
|
-
let e =
|
|
5495
|
+
let e = _e();
|
|
5496
5496
|
if (!e) throw Error("Missing access token.");
|
|
5497
5497
|
return e;
|
|
5498
5498
|
}
|
|
5499
5499
|
async function Qs(e, t, n) {
|
|
5500
5500
|
let r = t.text?.trim();
|
|
5501
5501
|
if (!r) return;
|
|
5502
|
-
let i = Zs(), a = await fetch(`${
|
|
5502
|
+
let i = Zs(), a = await fetch(`${U().chatApiBaseUrl}/chats/scheduledMessages`, {
|
|
5503
5503
|
method: "POST",
|
|
5504
5504
|
headers: {
|
|
5505
5505
|
"Content-Type": "application/json",
|
|
@@ -5519,9 +5519,9 @@ async function Qs(e, t, n) {
|
|
|
5519
5519
|
}
|
|
5520
5520
|
async function $s(e, t, n) {
|
|
5521
5521
|
if (!t.file) return;
|
|
5522
|
-
let r = Zs(), i =
|
|
5522
|
+
let r = Zs(), i = ye()?.token;
|
|
5523
5523
|
if (!i) throw Error("Missing CometChat auth token.");
|
|
5524
|
-
let a = tc(t.file), o = t.caption?.trim() ?? "", s = nc(e, t.file, a, o, t.scheduleDate, n), c = await fetch(`${
|
|
5524
|
+
let a = tc(t.file), o = t.caption?.trim() ?? "", s = nc(e, t.file, a, o, t.scheduleDate, n), c = await fetch(`${U().chatApiBaseUrl}/chats/scheduledMediaMessages`, {
|
|
5525
5525
|
method: "POST",
|
|
5526
5526
|
headers: {
|
|
5527
5527
|
Accept: "multipart/form-data",
|
|
@@ -5542,7 +5542,7 @@ function tc(e) {
|
|
|
5542
5542
|
return t;
|
|
5543
5543
|
}
|
|
5544
5544
|
function nc(e, t, n, r, i, a) {
|
|
5545
|
-
let o = new
|
|
5545
|
+
let o = new H.MediaMessage(e.targetId, t, n, Xs(e));
|
|
5546
5546
|
return o.setSentAt(Math.floor(Date.now() / 1e3)), o.setMuid(globalThis.crypto?.randomUUID?.() ?? `${Date.now()}-${t.name}`), r && o.setCaption(r), o.setMetadata({
|
|
5547
5547
|
scheduleDate: i,
|
|
5548
5548
|
file: t,
|
|
@@ -5575,11 +5575,11 @@ function ac(e, t) {
|
|
|
5575
5575
|
return typeof n == "string" && n.trim() ? n.trim() : e?.getName?.() ?? "System";
|
|
5576
5576
|
}
|
|
5577
5577
|
function oc(e, t) {
|
|
5578
|
-
return
|
|
5578
|
+
return Ce(cc(t)) || (sc(e, "sender") ?? void 0);
|
|
5579
5579
|
}
|
|
5580
5580
|
function sc(e, t) {
|
|
5581
5581
|
let n = Dc(e)?.entities?.[t]?.entity;
|
|
5582
|
-
return
|
|
5582
|
+
return Ce(cc(n));
|
|
5583
5583
|
}
|
|
5584
5584
|
function cc(e) {
|
|
5585
5585
|
if (!e || typeof e != "object") return e;
|
|
@@ -5827,9 +5827,9 @@ function Ac(e, t) {
|
|
|
5827
5827
|
let n = t?.value?.getMetadata?.() ?? {};
|
|
5828
5828
|
if (!e?.getSender?.() || n.isChannel) return "";
|
|
5829
5829
|
let r = e?.getData?.()?.entities?.receiver?.entity?.scope, i = e?.getReceiver?.()?.getMetadata?.() ?? {};
|
|
5830
|
-
e instanceof
|
|
5830
|
+
e instanceof H.Action && (i = e?.getActionFor?.()?.getMetadata?.() ?? {});
|
|
5831
5831
|
let a = i.systemDisplayName;
|
|
5832
|
-
return e?.getData?.()?.metadata?.senderDisplayName && (r == "moderator" || r === void 0) ? e.getData().metadata.senderDisplayName : a && (e instanceof
|
|
5832
|
+
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?.();
|
|
5833
5833
|
}
|
|
5834
5834
|
function jc(e, t = 25, n) {
|
|
5835
5835
|
let r = e.trim();
|
|
@@ -5852,7 +5852,7 @@ function jc(e, t = 25, n) {
|
|
|
5852
5852
|
};
|
|
5853
5853
|
}
|
|
5854
5854
|
async function Mc(e) {
|
|
5855
|
-
let t = new
|
|
5855
|
+
let t = new H.GroupMembersRequestBuilder(e).setLimit(50).build(), n = !0, r = [];
|
|
5856
5856
|
try {
|
|
5857
5857
|
for (; n;) {
|
|
5858
5858
|
let e = await t.fetchNext();
|
|
@@ -5871,7 +5871,7 @@ async function Mc(e) {
|
|
|
5871
5871
|
}
|
|
5872
5872
|
async function Nc(e) {
|
|
5873
5873
|
await Uc("failed to get muted setting. User not logged in");
|
|
5874
|
-
let t = await Wc(`${
|
|
5874
|
+
let t = await Wc(`${U().chatApiBaseUrl}/chats/${e}/settings/${(await H.getLoggedinUser())?.getUid?.()}`, { method: "GET" });
|
|
5875
5875
|
return Bc()?.storeParticipantSettings({
|
|
5876
5876
|
chatUid: e,
|
|
5877
5877
|
mutedUntil: t.mutedUntil,
|
|
@@ -5880,7 +5880,7 @@ async function Nc(e) {
|
|
|
5880
5880
|
}
|
|
5881
5881
|
async function Pc(e, t) {
|
|
5882
5882
|
await Uc("failed to mute chat. User not logged in");
|
|
5883
|
-
let n = await Wc(`${
|
|
5883
|
+
let n = await Wc(`${U().chatApiBaseUrl}/chats/${e}/settings/${(await H.getLoggedinUser())?.getUid?.()}`, {
|
|
5884
5884
|
method: "PATCH",
|
|
5885
5885
|
body: JSON.stringify({ mutedUntil: t })
|
|
5886
5886
|
});
|
|
@@ -5891,10 +5891,10 @@ async function Pc(e, t) {
|
|
|
5891
5891
|
}), n.mutedUntil;
|
|
5892
5892
|
}
|
|
5893
5893
|
async function Fc() {
|
|
5894
|
-
return await Uc("failed to get muted all setting. User not logged in"), Wc(`${
|
|
5894
|
+
return await Uc("failed to get muted all setting. User not logged in"), Wc(`${U().chatApiBaseUrl}/person/settings`, { method: "GET" });
|
|
5895
5895
|
}
|
|
5896
5896
|
async function Ic(e) {
|
|
5897
|
-
return await Uc("failed to update person settings. User not logged in"), Wc(`${
|
|
5897
|
+
return await Uc("failed to update person settings. User not logged in"), Wc(`${U().chatApiBaseUrl}/person/settings`, {
|
|
5898
5898
|
method: "PATCH",
|
|
5899
5899
|
body: JSON.stringify(e)
|
|
5900
5900
|
});
|
|
@@ -5920,18 +5920,18 @@ function Bc() {
|
|
|
5920
5920
|
}
|
|
5921
5921
|
function Vc() {
|
|
5922
5922
|
let e = Me();
|
|
5923
|
-
return e ? `bcc-chat:${
|
|
5923
|
+
return e ? `bcc-chat:${U().appId}:${e}` : null;
|
|
5924
5924
|
}
|
|
5925
5925
|
function Hc() {
|
|
5926
|
-
return
|
|
5926
|
+
return H.__bccCompatLoggedInUser ?? null;
|
|
5927
5927
|
}
|
|
5928
5928
|
async function Uc(e) {
|
|
5929
|
-
let t = await
|
|
5930
|
-
if (
|
|
5929
|
+
let t = await H.getLoggedinUser();
|
|
5930
|
+
if (H.__bccCompatLoggedInUser = t ?? null, !t?.getUid?.()) throw Error(e);
|
|
5931
5931
|
return t;
|
|
5932
5932
|
}
|
|
5933
5933
|
async function Wc(e, t) {
|
|
5934
|
-
let n =
|
|
5934
|
+
let n = _e();
|
|
5935
5935
|
if (!n) throw Error("Missing access token.");
|
|
5936
5936
|
let r = await fetch(e, {
|
|
5937
5937
|
...t,
|
|
@@ -5995,7 +5995,7 @@ function ol(e) {
|
|
|
5995
5995
|
if ($.value && !e && !Zc.value) return $.value;
|
|
5996
5996
|
let t = e ?? Zc.value;
|
|
5997
5997
|
if (!t) throw Error("Environment has not been set yet. Call app.use(chat, { environment: ... }) first.");
|
|
5998
|
-
return (!$.value || Zc.value !== t) && (Zc.value = t,
|
|
5998
|
+
return (!$.value || Zc.value !== t) && (Zc.value = t, fe(t), $.value = ks({ environment: t })), $.value;
|
|
5999
5999
|
}
|
|
6000
6000
|
function sl(e) {
|
|
6001
6001
|
let t = e.source?.getLastMessage?.();
|
|
@@ -6027,15 +6027,15 @@ var cl = n(() => $.value?.connected.value ?? !1), ll = n(() => Xc.value && !cl.v
|
|
|
6027
6027
|
async function pl(e, t) {
|
|
6028
6028
|
tl.value = t.loggerCallback, ze(t.language ?? "en"), al(t.themeMode);
|
|
6029
6029
|
let n = e.config.globalProperties.$primevue;
|
|
6030
|
-
n && (n.config.ripple = !0, n.config.inputVariant = "filled"), e.component("BccChat",
|
|
6030
|
+
n && (n.config.ripple = !0, n.config.inputVariant = "filled"), e.component("BccChat", lh), e.component("BccChatMessageList", lh), e.provide("theme", { theme: qc });
|
|
6031
6031
|
let r = ol(t.environment);
|
|
6032
6032
|
il(Yc.INFO, "Initializing chat", {
|
|
6033
6033
|
environment: t.environment,
|
|
6034
6034
|
language: Ie.value,
|
|
6035
6035
|
themeMode: t.themeMode
|
|
6036
|
-
}), await r.init(), Xc.value = !0, rl?.(), p(t.accessToken) ? rl =
|
|
6036
|
+
}), await r.init(), Xc.value = !0, rl?.(), p(t.accessToken) ? rl = P(t.accessToken, async (e) => {
|
|
6037
6037
|
e ? await ml(e) : await hl();
|
|
6038
|
-
}, { immediate: !0 }) : t.accessToken && await ml(t.accessToken), il(Yc.INFO, "Chat initialized", { environment:
|
|
6038
|
+
}, { immediate: !0 }) : t.accessToken && await ml(t.accessToken), il(Yc.INFO, "Chat initialized", { environment: U().appId });
|
|
6039
6039
|
}
|
|
6040
6040
|
async function ml(e) {
|
|
6041
6041
|
if (!e) return hl();
|
|
@@ -6077,7 +6077,7 @@ function Cl(e) {
|
|
|
6077
6077
|
async function wl(e) {
|
|
6078
6078
|
if (!ul.value) return null;
|
|
6079
6079
|
try {
|
|
6080
|
-
return await
|
|
6080
|
+
return await H.getGroup(e);
|
|
6081
6081
|
} catch (e) {
|
|
6082
6082
|
return e && typeof e == "object" && "code" in e && e.code === "ERR_GUID_NOT_FOUND" ? void 0 : null;
|
|
6083
6083
|
}
|
|
@@ -6092,7 +6092,7 @@ async function El(e) {
|
|
|
6092
6092
|
}
|
|
6093
6093
|
async function Dl(e) {
|
|
6094
6094
|
try {
|
|
6095
|
-
return ul.value && (await
|
|
6095
|
+
return ul.value && (await H.getOnlineGroupMemberCount([e]))[e] || 0;
|
|
6096
6096
|
} catch {
|
|
6097
6097
|
return 0;
|
|
6098
6098
|
}
|
|
@@ -6123,7 +6123,7 @@ var jl = {
|
|
|
6123
6123
|
login: ml,
|
|
6124
6124
|
logout: hl,
|
|
6125
6125
|
setCurrentEnvironment: Cl,
|
|
6126
|
-
getCurrentEnvironment:
|
|
6126
|
+
getCurrentEnvironment: U,
|
|
6127
6127
|
setThemeMode: xl,
|
|
6128
6128
|
setLanguage: bl,
|
|
6129
6129
|
getGroup: wl,
|
|
@@ -6134,7 +6134,7 @@ var jl = {
|
|
|
6134
6134
|
searchChat: (e, t = 25) => jc(e, t, $.value?.currentUser.value?.uid),
|
|
6135
6135
|
getSenderDisplayName: Ac,
|
|
6136
6136
|
getMessageTextPreview: ms,
|
|
6137
|
-
proxyImage:
|
|
6137
|
+
proxyImage: we,
|
|
6138
6138
|
getMutedUntil: kl,
|
|
6139
6139
|
muteChat: Ol,
|
|
6140
6140
|
getMyChatSettings: Fc,
|
|
@@ -6142,7 +6142,7 @@ var jl = {
|
|
|
6142
6142
|
setMuteAll: Lc,
|
|
6143
6143
|
toggleMuteAll: Rc,
|
|
6144
6144
|
toMarkdownHtml: Xo,
|
|
6145
|
-
retrieveCcToken:
|
|
6145
|
+
retrieveCcToken: be,
|
|
6146
6146
|
getChatMessages: $c,
|
|
6147
6147
|
scrollToMessageId: el,
|
|
6148
6148
|
scrollToMessage: Al,
|
|
@@ -6601,10 +6601,10 @@ function pu(e) {
|
|
|
6601
6601
|
return;
|
|
6602
6602
|
}
|
|
6603
6603
|
try {
|
|
6604
|
-
t.value = (await new
|
|
6604
|
+
t.value = (await new H.GroupMembersRequestBuilder(n).setLimit(50).build().fetchNext() ?? []).map((e) => ({
|
|
6605
6605
|
uid: e.getUid(),
|
|
6606
6606
|
displayName: e.getName(),
|
|
6607
|
-
avatar:
|
|
6607
|
+
avatar: Ce(e.getAvatar?.()) ?? "",
|
|
6608
6608
|
role: e.getScope()
|
|
6609
6609
|
})), e.onMembersChanged(t.value);
|
|
6610
6610
|
} catch {
|
|
@@ -6617,8 +6617,8 @@ function pu(e) {
|
|
|
6617
6617
|
let c = {
|
|
6618
6618
|
uid: r.getUid(),
|
|
6619
6619
|
displayName: r.getName(),
|
|
6620
|
-
avatar:
|
|
6621
|
-
role: a ?? r.getScope?.() ??
|
|
6620
|
+
avatar: Ce(r.getAvatar?.()) ?? "",
|
|
6621
|
+
role: a ?? r.getScope?.() ?? H.GROUP_MEMBER_SCOPE.PARTICIPANT
|
|
6622
6622
|
};
|
|
6623
6623
|
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 ? {
|
|
6624
6624
|
...e,
|
|
@@ -6626,7 +6626,7 @@ function pu(e) {
|
|
|
6626
6626
|
} : e), e.onMembersChanged(t.value);
|
|
6627
6627
|
}
|
|
6628
6628
|
return b(() => {
|
|
6629
|
-
|
|
6629
|
+
H.addGroupListener(n, new H.GroupListener({
|
|
6630
6630
|
onGroupMemberScopeChanged: (e, t, n, r, a) => {
|
|
6631
6631
|
i(a, t, "update", n);
|
|
6632
6632
|
},
|
|
@@ -6650,7 +6650,7 @@ function pu(e) {
|
|
|
6650
6650
|
}
|
|
6651
6651
|
}));
|
|
6652
6652
|
}), x(() => {
|
|
6653
|
-
|
|
6653
|
+
H.removeGroupListener(n);
|
|
6654
6654
|
}), {
|
|
6655
6655
|
groupMembers: t,
|
|
6656
6656
|
fetchGroupMembers: r
|
|
@@ -6967,8 +6967,46 @@ function Gu(e, t) {
|
|
|
6967
6967
|
}, [o("path", { d: "M160-160q-33 0-56.5-23.5T80-240v-480q0-33 23.5-56.5T160-800h480q33 0 56.5 23.5T720-720v180l126-126q10-10 22-5t12 19v344q0 14-12 19t-22-5L720-420v180q0 33-23.5 56.5T640-160H160Zm0-80h480v-480H160v480Zm0 0v-480 480Z" })]);
|
|
6968
6968
|
}
|
|
6969
6969
|
//#endregion
|
|
6970
|
+
//#region src/chat/clipboardFiles.ts
|
|
6971
|
+
var Ku = new Set([
|
|
6972
|
+
"",
|
|
6973
|
+
"image.png",
|
|
6974
|
+
"image.jpeg",
|
|
6975
|
+
"image.jpg",
|
|
6976
|
+
"image.gif",
|
|
6977
|
+
"image.webp",
|
|
6978
|
+
"blob"
|
|
6979
|
+
]), qu = {
|
|
6980
|
+
"image/png": "png",
|
|
6981
|
+
"image/jpeg": "jpg",
|
|
6982
|
+
"image/jpg": "jpg",
|
|
6983
|
+
"image/gif": "gif",
|
|
6984
|
+
"image/webp": "webp",
|
|
6985
|
+
"image/bmp": "bmp",
|
|
6986
|
+
"image/svg+xml": "svg"
|
|
6987
|
+
};
|
|
6988
|
+
function Ju(e) {
|
|
6989
|
+
let t = e.name.trim(), n = t.toLowerCase();
|
|
6990
|
+
return Ku.has(n) ? `pasted-image.${qu[e.type] ?? "png"}` : t;
|
|
6991
|
+
}
|
|
6992
|
+
function Yu(e) {
|
|
6993
|
+
let t = e.clipboardData?.items;
|
|
6994
|
+
if (!t) return null;
|
|
6995
|
+
for (let e of t) {
|
|
6996
|
+
if (e.kind !== "file" || !e.type.startsWith("image/")) continue;
|
|
6997
|
+
let t = e.getAsFile();
|
|
6998
|
+
if (!t) continue;
|
|
6999
|
+
let n = Ju(t);
|
|
7000
|
+
return n === t.name ? t : new File([t], n, {
|
|
7001
|
+
type: t.type,
|
|
7002
|
+
lastModified: t.lastModified
|
|
7003
|
+
});
|
|
7004
|
+
}
|
|
7005
|
+
return null;
|
|
7006
|
+
}
|
|
7007
|
+
//#endregion
|
|
6970
7008
|
//#region src/composables/useComposerTriggers.ts
|
|
6971
|
-
function
|
|
7009
|
+
function Xu(e) {
|
|
6972
7010
|
return {
|
|
6973
7011
|
id: "mention",
|
|
6974
7012
|
triggerChar: "@",
|
|
@@ -6985,7 +7023,7 @@ function Ku(e) {
|
|
|
6985
7023
|
}
|
|
6986
7024
|
};
|
|
6987
7025
|
}
|
|
6988
|
-
function
|
|
7026
|
+
function Zu(e) {
|
|
6989
7027
|
let t = w(null), r = w([]), i = w({
|
|
6990
7028
|
x: 0,
|
|
6991
7029
|
y: 0,
|
|
@@ -7018,7 +7056,7 @@ function qu(e) {
|
|
|
7018
7056
|
}
|
|
7019
7057
|
for (let i of e.getTriggers()) {
|
|
7020
7058
|
if (!i.enabled()) continue;
|
|
7021
|
-
let e =
|
|
7059
|
+
let e = Qu(n, i.triggerChar);
|
|
7022
7060
|
if (!e) continue;
|
|
7023
7061
|
let c = i.getCandidates(e.query).slice(0, i.maxSuggestions ?? 8);
|
|
7024
7062
|
if (!c.length) {
|
|
@@ -7063,7 +7101,7 @@ function qu(e) {
|
|
|
7063
7101
|
refreshActiveTrigger: c
|
|
7064
7102
|
};
|
|
7065
7103
|
}
|
|
7066
|
-
function
|
|
7104
|
+
function Qu(e, t) {
|
|
7067
7105
|
let n = window.getSelection();
|
|
7068
7106
|
if (!n || n.rangeCount === 0 || !n.isCollapsed) return null;
|
|
7069
7107
|
let r = n.getRangeAt(0);
|
|
@@ -7074,13 +7112,13 @@ function Ju(e, t) {
|
|
|
7074
7112
|
if (o === -1 || o > 0 && !/\s/.test(a[o - 1] ?? "")) return null;
|
|
7075
7113
|
let s = a.slice(o + 1);
|
|
7076
7114
|
if (/\s/.test(s)) return null;
|
|
7077
|
-
let c =
|
|
7115
|
+
let c = ed(e, o, a.length) ?? $u(r, t);
|
|
7078
7116
|
return c ? {
|
|
7079
7117
|
query: s,
|
|
7080
7118
|
range: c
|
|
7081
7119
|
} : null;
|
|
7082
7120
|
}
|
|
7083
|
-
function
|
|
7121
|
+
function $u(e, t) {
|
|
7084
7122
|
let n = e.endContainer;
|
|
7085
7123
|
n.nodeType !== Node.TEXT_NODE && (n = e.endContainer.childNodes[e.endOffset - 1] ?? e.endContainer.childNodes[0] ?? null);
|
|
7086
7124
|
for (let r = 0; r < 4 && n; r += 1) {
|
|
@@ -7096,7 +7134,7 @@ function Yu(e, t) {
|
|
|
7096
7134
|
}
|
|
7097
7135
|
return null;
|
|
7098
7136
|
}
|
|
7099
|
-
function
|
|
7137
|
+
function ed(e, t, n) {
|
|
7100
7138
|
let r = document.createTreeWalker(e, NodeFilter.SHOW_TEXT), i = 0, a = null, o = 0, s = null, c = 0;
|
|
7101
7139
|
for (let e = r.nextNode(); e; e = r.nextNode()) {
|
|
7102
7140
|
let r = e.textContent?.length ?? 0, l = i + r;
|
|
@@ -7110,7 +7148,7 @@ function Xu(e, t, n) {
|
|
|
7110
7148
|
let l = document.createRange();
|
|
7111
7149
|
return l.setStart(a, o), l.setEnd(s, c), l;
|
|
7112
7150
|
}
|
|
7113
|
-
function
|
|
7151
|
+
function td(e, t) {
|
|
7114
7152
|
e.deleteContents();
|
|
7115
7153
|
let n = document.createElement("span");
|
|
7116
7154
|
n.className = "composer-mention", n.setAttribute("data-mention-uid", t.uid), n.contentEditable = "false", n.textContent = `@${t.displayName}`;
|
|
@@ -7121,32 +7159,32 @@ function Zu(e, t) {
|
|
|
7121
7159
|
}
|
|
7122
7160
|
//#endregion
|
|
7123
7161
|
//#region src/composables/useRichTextComposer.ts
|
|
7124
|
-
function
|
|
7162
|
+
function nd(e, t, r, i) {
|
|
7125
7163
|
let a = w(null), o = w(0), s = w(!1), c = w({
|
|
7126
7164
|
x: 0,
|
|
7127
7165
|
y: 0
|
|
7128
7166
|
}), l = w(qo(i.getModelValue())), u = n(() => {
|
|
7129
7167
|
let e = [...i.extraTriggers ?? []];
|
|
7130
|
-
return i.getMentionCandidates && e.unshift(
|
|
7168
|
+
return i.getMentionCandidates && e.unshift(Xu({
|
|
7131
7169
|
enabled: () => i.mentionsEnabled?.() ?? !0,
|
|
7132
7170
|
getMentionCandidates: () => i.getMentionCandidates?.() ?? [],
|
|
7133
7171
|
insertMention: (e, t) => {
|
|
7134
|
-
|
|
7172
|
+
td(t, e), E(), D();
|
|
7135
7173
|
}
|
|
7136
7174
|
})), e;
|
|
7137
|
-
}), { triggerCandidates: d, triggerMenuPosition: f, highlightedTriggerIndex: p, showTriggerMenu: m, hideTriggerMenu: g, handleInput: _, handleKeydown: v, selectTriggerCandidate: x, refreshActiveTrigger: S } =
|
|
7175
|
+
}), { triggerCandidates: d, triggerMenuPosition: f, highlightedTriggerIndex: p, showTriggerMenu: m, hideTriggerMenu: g, handleInput: _, handleKeydown: v, selectTriggerCandidate: x, refreshActiveTrigger: S } = Zu({
|
|
7138
7176
|
editorRef: t,
|
|
7139
7177
|
getTriggers: () => u.value,
|
|
7140
7178
|
onChange: () => E()
|
|
7141
7179
|
});
|
|
7142
|
-
|
|
7180
|
+
P(() => i.getMentionCandidates?.(), () => {
|
|
7143
7181
|
S();
|
|
7144
7182
|
}, { deep: !0 });
|
|
7145
7183
|
function C(e) {
|
|
7146
7184
|
let t = qo(e);
|
|
7147
7185
|
return t.includes("<@uid:") ? qo(rt(t, i.getMentionNameByUid?.() ?? {})) : t;
|
|
7148
7186
|
}
|
|
7149
|
-
|
|
7187
|
+
P(() => i.getModelValue(), (e) => {
|
|
7150
7188
|
let n = t.value, r = C(e);
|
|
7151
7189
|
if (r !== l.value) {
|
|
7152
7190
|
if (!n) {
|
|
@@ -7184,7 +7222,7 @@ function Qu(e, t, r, i) {
|
|
|
7184
7222
|
function j() {
|
|
7185
7223
|
_(), E();
|
|
7186
7224
|
}
|
|
7187
|
-
function
|
|
7225
|
+
function ee(e) {
|
|
7188
7226
|
if (!v(e)) {
|
|
7189
7227
|
if ((e.ctrlKey || e.metaKey) && !e.shiftKey) {
|
|
7190
7228
|
let t = e.key.toLowerCase();
|
|
@@ -7208,7 +7246,7 @@ function Qu(e, t, r, i) {
|
|
|
7208
7246
|
e.key === "Escape" && (O(), g());
|
|
7209
7247
|
}
|
|
7210
7248
|
}
|
|
7211
|
-
function
|
|
7249
|
+
function te(e) {
|
|
7212
7250
|
e.preventDefault();
|
|
7213
7251
|
let t = e.clipboardData?.getData("text/html") ?? "", n = e.clipboardData?.getData("text/plain") ?? "";
|
|
7214
7252
|
if (document.execCommand("styleWithCSS", !1, "false"), t) {
|
|
@@ -7220,7 +7258,7 @@ function Qu(e, t, r, i) {
|
|
|
7220
7258
|
}
|
|
7221
7259
|
n && (document.execCommand("insertText", !1, n), E());
|
|
7222
7260
|
}
|
|
7223
|
-
function
|
|
7261
|
+
function M(e) {
|
|
7224
7262
|
if (!k()) {
|
|
7225
7263
|
O();
|
|
7226
7264
|
return;
|
|
@@ -7230,50 +7268,50 @@ function Qu(e, t, r, i) {
|
|
|
7230
7268
|
y: e.clientY
|
|
7231
7269
|
}, s.value = !0;
|
|
7232
7270
|
}
|
|
7233
|
-
function
|
|
7271
|
+
function N(t) {
|
|
7234
7272
|
let n = t.target;
|
|
7235
7273
|
n && (a.value?.contains(n) || r.value?.$el.contains(n) || e.value?.contains(n)) || (O(), g());
|
|
7236
7274
|
}
|
|
7237
|
-
function
|
|
7275
|
+
function F(e) {
|
|
7238
7276
|
x(e), D();
|
|
7239
7277
|
}
|
|
7240
|
-
function
|
|
7278
|
+
function ne() {
|
|
7241
7279
|
k() || O();
|
|
7242
7280
|
}
|
|
7243
|
-
function
|
|
7281
|
+
function I() {
|
|
7244
7282
|
o.value += 1, O(), g(), l.value = "", i.updateModelValue("");
|
|
7245
7283
|
}
|
|
7246
7284
|
return b(() => {
|
|
7247
|
-
document.addEventListener("pointerdown",
|
|
7285
|
+
document.addEventListener("pointerdown", N), document.addEventListener("selectionchange", ne), h(() => {
|
|
7248
7286
|
if (t.value) {
|
|
7249
7287
|
let e = C(i.getModelValue());
|
|
7250
7288
|
t.value.innerHTML = e, T(t.value), e ? delete t.value.dataset.empty : t.value.dataset.empty = "true", l.value = e;
|
|
7251
7289
|
}
|
|
7252
7290
|
});
|
|
7253
7291
|
}), y(() => {
|
|
7254
|
-
document.removeEventListener("pointerdown",
|
|
7292
|
+
document.removeEventListener("pointerdown", N), document.removeEventListener("selectionchange", ne);
|
|
7255
7293
|
}), {
|
|
7256
7294
|
applyFormat: A,
|
|
7257
7295
|
editorKey: o,
|
|
7258
7296
|
focusEditor: D,
|
|
7259
7297
|
formatMenuPosition: c,
|
|
7260
|
-
handleContextMenu:
|
|
7298
|
+
handleContextMenu: M,
|
|
7261
7299
|
handleInput: j,
|
|
7262
|
-
handleKeydown:
|
|
7263
|
-
handlePaste:
|
|
7300
|
+
handleKeydown: ee,
|
|
7301
|
+
handlePaste: te,
|
|
7264
7302
|
hideFormatMenu: O,
|
|
7265
|
-
resetEditor:
|
|
7303
|
+
resetEditor: I,
|
|
7266
7304
|
showFormatMenu: s,
|
|
7267
7305
|
triggerCandidates: d,
|
|
7268
7306
|
triggerMenuPosition: f,
|
|
7269
7307
|
highlightedTriggerIndex: p,
|
|
7270
7308
|
showTriggerMenu: m,
|
|
7271
|
-
selectTriggerCandidate:
|
|
7309
|
+
selectTriggerCandidate: F
|
|
7272
7310
|
};
|
|
7273
7311
|
}
|
|
7274
7312
|
//#endregion
|
|
7275
7313
|
//#region src/components/messages/ComposerActionsPopover.vue?vue&type=script&setup=true&lang.ts
|
|
7276
|
-
var
|
|
7314
|
+
var rd = ["data-testid", "onClick"], id = { class: "composer-actions-menu__icon" }, ad = { class: "composer-actions-menu__icon" }, od = /* @__PURE__ */ u({
|
|
7277
7315
|
__name: "ComposerActionsPopover",
|
|
7278
7316
|
emits: ["pickFile", "openPoll"],
|
|
7279
7317
|
setup(t, { expose: n, emit: i }) {
|
|
@@ -7327,7 +7365,7 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
|
|
|
7327
7365
|
}), n({
|
|
7328
7366
|
toggle: p,
|
|
7329
7367
|
hide: m
|
|
7330
|
-
}), (t, n) =>
|
|
7368
|
+
}), (t, n) => ne((S(), a("div", {
|
|
7331
7369
|
ref_key: "menuRef",
|
|
7332
7370
|
ref: l,
|
|
7333
7371
|
class: "composer-actions-menu",
|
|
@@ -7338,18 +7376,18 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
|
|
|
7338
7376
|
class: "composer-actions-menu__item",
|
|
7339
7377
|
"data-testid": e.testId,
|
|
7340
7378
|
onClick: (t) => h(e.kind)
|
|
7341
|
-
}, [o("span",
|
|
7379
|
+
}, [o("span", id, [(S(), r(D(e.icon), { class: "size-5" }))]), o("span", null, k(j(u)(e.label)), 1)], 8, rd)), 64)), o("button", {
|
|
7342
7380
|
type: "button",
|
|
7343
7381
|
class: "composer-actions-menu__item",
|
|
7344
7382
|
"data-testid": "composer-create-poll",
|
|
7345
7383
|
onClick: g
|
|
7346
|
-
}, [o("span",
|
|
7384
|
+
}, [o("span", ad, [(S(), r(D(j(_u)), { class: "size-5" }))]), o("span", null, k(j(u)("createPoll")), 1)])], 512)), [[N, c.value]]);
|
|
7347
7385
|
}
|
|
7348
|
-
}),
|
|
7386
|
+
}), sd = (e, t) => {
|
|
7349
7387
|
let n = e.__vccOpts || e;
|
|
7350
7388
|
for (let [e, r] of t) n[e] = r;
|
|
7351
7389
|
return n;
|
|
7352
|
-
},
|
|
7390
|
+
}, cd = /* @__PURE__ */ sd(od, [["__scopeId", "data-v-28efbfda"]]), ld = { class: "min-w-0" }, ud = { class: "context-banner__kind" }, dd = { class: "context-banner__sender" }, fd = { class: "context-banner__preview" }, pd = /* @__PURE__ */ sd(/* @__PURE__ */ u({
|
|
7353
7391
|
__name: "ComposerContextBanner",
|
|
7354
7392
|
props: {
|
|
7355
7393
|
message: {},
|
|
@@ -7359,11 +7397,11 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
|
|
|
7359
7397
|
emits: ["cancel"],
|
|
7360
7398
|
setup(e, { emit: t }) {
|
|
7361
7399
|
let r = e, i = t, { t: s } = K(), c = Kl(), u = n(() => ds(r.message, s("message"), c.mentionNameByUid.value));
|
|
7362
|
-
return (t, n) => (S(), a("div", { class: g(["context-banner", `context-banner--${e.variant}`]) }, [o("div",
|
|
7363
|
-
o("p",
|
|
7364
|
-
o("p",
|
|
7365
|
-
o("p",
|
|
7366
|
-
]), l(j(
|
|
7400
|
+
return (t, n) => (S(), a("div", { class: g(["context-banner", `context-banner--${e.variant}`]) }, [o("div", ld, [
|
|
7401
|
+
o("p", ud, k(e.variant === "editing" ? j(s)("editingInContext", { context: e.contextLabel }) : j(s)("replyingInContext", { context: e.contextLabel })), 1),
|
|
7402
|
+
o("p", dd, k(e.message.senderName), 1),
|
|
7403
|
+
o("p", fd, k(u.value), 1)
|
|
7404
|
+
]), l(j(R), {
|
|
7367
7405
|
icon: j(bu),
|
|
7368
7406
|
text: "",
|
|
7369
7407
|
rounded: "",
|
|
@@ -7371,7 +7409,7 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
|
|
|
7371
7409
|
onClick: n[0] ||= (e) => i("cancel")
|
|
7372
7410
|
}, null, 8, ["icon"])], 2));
|
|
7373
7411
|
}
|
|
7374
|
-
}), [["__scopeId", "data-v-2aa71a89"]]),
|
|
7412
|
+
}), [["__scopeId", "data-v-2aa71a89"]]), md = /* @__PURE__ */ sd(/* @__PURE__ */ u({
|
|
7375
7413
|
__name: "ComposerFormatMenu",
|
|
7376
7414
|
props: {
|
|
7377
7415
|
visible: { type: Boolean },
|
|
@@ -7391,24 +7429,24 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
|
|
|
7391
7429
|
o("button", {
|
|
7392
7430
|
type: "button",
|
|
7393
7431
|
class: "format-menu__item",
|
|
7394
|
-
onMousedown: s[0] ||=
|
|
7432
|
+
onMousedown: s[0] ||= I(() => {}, ["prevent"]),
|
|
7395
7433
|
onClick: s[1] ||= (e) => n("format", "bold")
|
|
7396
7434
|
}, [s[6] ||= o("span", { class: "format-menu__icon font-bold" }, "B", -1), o("span", null, k(j(r)("bold")), 1)], 32),
|
|
7397
7435
|
o("button", {
|
|
7398
7436
|
type: "button",
|
|
7399
7437
|
class: "format-menu__item",
|
|
7400
|
-
onMousedown: s[2] ||=
|
|
7438
|
+
onMousedown: s[2] ||= I(() => {}, ["prevent"]),
|
|
7401
7439
|
onClick: s[3] ||= (e) => n("format", "italic")
|
|
7402
7440
|
}, [s[7] ||= o("span", { class: "format-menu__icon italic" }, "I", -1), o("span", null, k(j(r)("italic")), 1)], 32),
|
|
7403
7441
|
o("button", {
|
|
7404
7442
|
type: "button",
|
|
7405
7443
|
class: "format-menu__item",
|
|
7406
|
-
onMousedown: s[4] ||=
|
|
7444
|
+
onMousedown: s[4] ||= I(() => {}, ["prevent"]),
|
|
7407
7445
|
onClick: s[5] ||= (e) => n("format", "underline")
|
|
7408
7446
|
}, [s[8] ||= o("span", { class: "format-menu__icon underline" }, "U", -1), o("span", null, k(j(r)("underline")), 1)], 32)
|
|
7409
7447
|
], 4)) : i("", !0);
|
|
7410
7448
|
}
|
|
7411
|
-
}), [["__scopeId", "data-v-c9a1b3d8"]]),
|
|
7449
|
+
}), [["__scopeId", "data-v-c9a1b3d8"]]), hd = { class: "space-y-6" }, gd = { class: "space-y-2" }, _d = { class: "heading-sm text-subtle block font-medium!" }, vd = { class: "space-y-2" }, yd = { class: "heading-sm text-subtle block font-medium!" }, bd = /* @__PURE__ */ u({
|
|
7412
7450
|
__name: "ComposerPollDialog",
|
|
7413
7451
|
props: {
|
|
7414
7452
|
visible: { type: Boolean },
|
|
@@ -7438,7 +7476,7 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
|
|
|
7438
7476
|
function y() {
|
|
7439
7477
|
u("update:visible", !1), _();
|
|
7440
7478
|
}
|
|
7441
|
-
return i({ reset: _ }), (n, i) => (S(), r(j(
|
|
7479
|
+
return i({ reset: _ }), (n, i) => (S(), r(j(re), {
|
|
7442
7480
|
visible: t.visible,
|
|
7443
7481
|
modal: "",
|
|
7444
7482
|
header: j(d)("createPollTitle"),
|
|
@@ -7446,11 +7484,11 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
|
|
|
7446
7484
|
draggable: !1,
|
|
7447
7485
|
"onUpdate:visible": y
|
|
7448
7486
|
}, {
|
|
7449
|
-
footer:
|
|
7487
|
+
footer: F(() => [l(j(R), {
|
|
7450
7488
|
label: j(d)("cancel"),
|
|
7451
7489
|
severity: "secondary",
|
|
7452
7490
|
onClick: y
|
|
7453
|
-
}, null, 8, ["label"]), l(j(
|
|
7491
|
+
}, null, 8, ["label"]), l(j(R), {
|
|
7454
7492
|
label: j(d)("sendPoll"),
|
|
7455
7493
|
icon: j(Vu),
|
|
7456
7494
|
disabled: c.disabled || !m.value,
|
|
@@ -7460,17 +7498,17 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
|
|
|
7460
7498
|
"icon",
|
|
7461
7499
|
"disabled"
|
|
7462
7500
|
])]),
|
|
7463
|
-
default:
|
|
7501
|
+
default: F(() => [o("div", hd, [o("div", gd, [o("label", _d, k(j(d)("question")), 1), l(j(ae), {
|
|
7464
7502
|
modelValue: f.value,
|
|
7465
7503
|
"onUpdate:modelValue": i[0] ||= (e) => f.value = e,
|
|
7466
7504
|
fluid: "",
|
|
7467
7505
|
placeholder: j(d)("pollQuestionPlaceholder")
|
|
7468
|
-
}, null, 8, ["modelValue", "placeholder"])]), o("div",
|
|
7469
|
-
o("label",
|
|
7506
|
+
}, null, 8, ["modelValue", "placeholder"])]), o("div", vd, [
|
|
7507
|
+
o("label", yd, k(j(d)("options")), 1),
|
|
7470
7508
|
(S(!0), a(e, null, T(p.value, (e, t) => (S(), a("div", {
|
|
7471
7509
|
key: t,
|
|
7472
7510
|
class: "center"
|
|
7473
|
-
}, [l(j(
|
|
7511
|
+
}, [l(j(ae), {
|
|
7474
7512
|
"model-value": e,
|
|
7475
7513
|
class: "poll-dialog-input w-full",
|
|
7476
7514
|
placeholder: j(d)("option", { index: t + 1 }),
|
|
@@ -7479,7 +7517,7 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
|
|
|
7479
7517
|
"model-value",
|
|
7480
7518
|
"placeholder",
|
|
7481
7519
|
"onUpdate:modelValue"
|
|
7482
|
-
]), l(j(
|
|
7520
|
+
]), l(j(R), {
|
|
7483
7521
|
icon: j(bu),
|
|
7484
7522
|
text: "",
|
|
7485
7523
|
rounded: "",
|
|
@@ -7491,7 +7529,7 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
|
|
|
7491
7529
|
"disabled",
|
|
7492
7530
|
"onClick"
|
|
7493
7531
|
])]))), 128)),
|
|
7494
|
-
l(j(
|
|
7532
|
+
l(j(R), {
|
|
7495
7533
|
label: j(d)("addOption"),
|
|
7496
7534
|
icon: j(hu),
|
|
7497
7535
|
text: "",
|
|
@@ -7501,7 +7539,7 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
|
|
|
7501
7539
|
_: 1
|
|
7502
7540
|
}, 8, ["visible", "header"]));
|
|
7503
7541
|
}
|
|
7504
|
-
}),
|
|
7542
|
+
}), xd = { class: "w-full space-y-6" }, Sd = { class: "w-full space-y-2" }, Cd = { class: "heading-sm text-subtle block font-medium!" }, wd = { class: "center left w-full gap-2" }, Td = { class: "body-md bg-elevation-surface-sunken-default rounded-lg px-4 py-3" }, Ed = /* @__PURE__ */ u({
|
|
7505
7543
|
__name: "ComposerScheduleDialog",
|
|
7506
7544
|
props: {
|
|
7507
7545
|
visible: { type: Boolean },
|
|
@@ -7537,7 +7575,7 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
|
|
|
7537
7575
|
function b() {
|
|
7538
7576
|
s("update:visible", !1), v();
|
|
7539
7577
|
}
|
|
7540
|
-
return t({ reset: v }), (t, n) => (S(), r(j(
|
|
7578
|
+
return t({ reset: v }), (t, n) => (S(), r(j(re), {
|
|
7541
7579
|
visible: e.visible,
|
|
7542
7580
|
modal: "",
|
|
7543
7581
|
header: j(c)("scheduleMessage"),
|
|
@@ -7545,11 +7583,11 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
|
|
|
7545
7583
|
draggable: !1,
|
|
7546
7584
|
"onUpdate:visible": b
|
|
7547
7585
|
}, {
|
|
7548
|
-
footer:
|
|
7586
|
+
footer: F(() => [l(j(R), {
|
|
7549
7587
|
label: j(c)("cancel"),
|
|
7550
7588
|
severity: "secondary",
|
|
7551
7589
|
onClick: b
|
|
7552
|
-
}, null, 8, ["label"]), l(j(
|
|
7590
|
+
}, null, 8, ["label"]), l(j(R), {
|
|
7553
7591
|
label: j(c)("schedule"),
|
|
7554
7592
|
icon: j(vu),
|
|
7555
7593
|
disabled: a.disabled || !g.value,
|
|
@@ -7559,12 +7597,12 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
|
|
|
7559
7597
|
"icon",
|
|
7560
7598
|
"disabled"
|
|
7561
7599
|
])]),
|
|
7562
|
-
default:
|
|
7600
|
+
default: F(() => [o("div", xd, [o("div", Sd, [o("label", Cd, k(j(c)("sendAt")), 1), o("div", wd, [l(j(ie), {
|
|
7563
7601
|
modelValue: u.value,
|
|
7564
7602
|
"onUpdate:modelValue": n[0] ||= (e) => u.value = e,
|
|
7565
7603
|
class: "w-full flex-1",
|
|
7566
7604
|
type: "date"
|
|
7567
|
-
}, null, 8, ["modelValue"]), l(j(
|
|
7605
|
+
}, null, 8, ["modelValue"]), l(j(ie), {
|
|
7568
7606
|
modelValue: d.value,
|
|
7569
7607
|
"onUpdate:modelValue": n[1] ||= (e) => d.value = e,
|
|
7570
7608
|
type: "time",
|
|
@@ -7573,22 +7611,22 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
|
|
|
7573
7611
|
mask: "##:##",
|
|
7574
7612
|
pattern: "^([01]\\d|2[0-3]):([0-5]\\d)$",
|
|
7575
7613
|
"aria-label": "Time (24-hour)"
|
|
7576
|
-
}, null, 8, ["modelValue"])])]), o("div",
|
|
7614
|
+
}, null, 8, ["modelValue"])])]), o("div", Td, k(e.contentPreview), 1)])]),
|
|
7577
7615
|
_: 1
|
|
7578
7616
|
}, 8, ["visible", "header"]));
|
|
7579
7617
|
}
|
|
7580
|
-
}),
|
|
7618
|
+
}), Dd = [
|
|
7581
7619
|
"aria-selected",
|
|
7582
7620
|
"onMouseover",
|
|
7583
7621
|
"onMousedown"
|
|
7584
|
-
],
|
|
7622
|
+
], Od = {
|
|
7585
7623
|
key: 1,
|
|
7586
7624
|
class: "trigger-menu__avatar-fallback",
|
|
7587
7625
|
"aria-hidden": "true"
|
|
7588
|
-
},
|
|
7626
|
+
}, kd = { class: "min-w-0" }, Ad = { class: "trigger-menu__label" }, jd = {
|
|
7589
7627
|
key: 0,
|
|
7590
7628
|
class: "trigger-menu__subtitle"
|
|
7591
|
-
},
|
|
7629
|
+
}, Md = /* @__PURE__ */ sd(/* @__PURE__ */ u({
|
|
7592
7630
|
__name: "ComposerTriggerMenu",
|
|
7593
7631
|
props: /* @__PURE__ */ m({
|
|
7594
7632
|
visible: { type: Boolean },
|
|
@@ -7600,7 +7638,7 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
|
|
|
7600
7638
|
}),
|
|
7601
7639
|
emits: /* @__PURE__ */ m(["select"], ["update:highlightedIndex"]),
|
|
7602
7640
|
setup(t, { emit: n }) {
|
|
7603
|
-
let s =
|
|
7641
|
+
let s = ee(t, "highlightedIndex"), c = n;
|
|
7604
7642
|
return (n, l) => t.visible && t.candidates.length ? (S(), a("div", {
|
|
7605
7643
|
key: 0,
|
|
7606
7644
|
class: g(["trigger-menu", t.position.placement === "below" ? "trigger-menu--below" : "trigger-menu--above"]),
|
|
@@ -7609,7 +7647,7 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
|
|
|
7609
7647
|
top: `${t.position.y}px`
|
|
7610
7648
|
}),
|
|
7611
7649
|
role: "listbox",
|
|
7612
|
-
onMousedown: l[0] ||=
|
|
7650
|
+
onMousedown: l[0] ||= I(() => {}, ["stop"])
|
|
7613
7651
|
}, [(S(!0), a(e, null, T(t.candidates, (e, t) => (S(), a("button", {
|
|
7614
7652
|
key: e.id,
|
|
7615
7653
|
type: "button",
|
|
@@ -7617,33 +7655,33 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
|
|
|
7617
7655
|
role: "option",
|
|
7618
7656
|
"aria-selected": t === s.value,
|
|
7619
7657
|
onMouseover: (e) => s.value = t,
|
|
7620
|
-
onMousedown:
|
|
7621
|
-
}, [e.avatar ? (S(), r(j(
|
|
7658
|
+
onMousedown: I((t) => c("select", e), ["stop", "prevent"])
|
|
7659
|
+
}, [e.avatar ? (S(), r(j(L), {
|
|
7622
7660
|
key: 0,
|
|
7623
7661
|
src: e.avatar,
|
|
7624
7662
|
name: e.label,
|
|
7625
7663
|
size: "sm"
|
|
7626
|
-
}, null, 8, ["src", "name"])) : (S(), a("span",
|
|
7664
|
+
}, null, 8, ["src", "name"])) : (S(), a("span", Od, k(e.label.charAt(0)), 1)), o("span", kd, [o("span", Ad, k(e.label), 1), e.subtitle ? (S(), a("span", jd, k(e.subtitle), 1)) : i("", !0)])], 42, Dd))), 128))], 38)) : i("", !0);
|
|
7627
7665
|
}
|
|
7628
|
-
}), [["__scopeId", "data-v-3f395457"]]),
|
|
7666
|
+
}), [["__scopeId", "data-v-3f395457"]]), Nd = ["accept", "disabled"], Pd = {
|
|
7629
7667
|
key: 2,
|
|
7630
7668
|
class: "composer-file-preview"
|
|
7631
|
-
},
|
|
7669
|
+
}, Fd = { class: "min-w-0" }, Id = { class: "heading-sm text-default truncate" }, Ld = { class: "body-sm text-subtle" }, Rd = {
|
|
7632
7670
|
class: "composer-button-icon",
|
|
7633
7671
|
"aria-hidden": "true"
|
|
7634
|
-
},
|
|
7672
|
+
}, zd = ["data-placeholder"], Bd = {
|
|
7635
7673
|
key: 0,
|
|
7636
7674
|
class: "body-sm text-subtle flex items-center gap-2 px-0.5"
|
|
7637
|
-
},
|
|
7675
|
+
}, Vd = {
|
|
7638
7676
|
key: 2,
|
|
7639
7677
|
class: "ml-auto"
|
|
7640
|
-
},
|
|
7678
|
+
}, Hd = {
|
|
7641
7679
|
class: "composer-button-icon",
|
|
7642
7680
|
"aria-hidden": "true"
|
|
7643
|
-
},
|
|
7681
|
+
}, Ud = {
|
|
7644
7682
|
class: "composer-button-icon",
|
|
7645
7683
|
"aria-hidden": "true"
|
|
7646
|
-
},
|
|
7684
|
+
}, Wd = 450, Gd = /* @__PURE__ */ sd(/* @__PURE__ */ u({
|
|
7647
7685
|
__name: "MessageComposer",
|
|
7648
7686
|
props: {
|
|
7649
7687
|
modelValue: {},
|
|
@@ -7676,53 +7714,62 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
|
|
|
7676
7714
|
video: "video/*",
|
|
7677
7715
|
audio: "audio/*",
|
|
7678
7716
|
file: "*/*"
|
|
7679
|
-
}, 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), O = w(null), A = w(null), { applyFormat:
|
|
7717
|
+
}, 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), O = w(null), A = w(null), { applyFormat: ee, editorKey: te, formatMenuPosition: M, focusEditor: N, handleContextMenu: ne, handleInput: L, handleKeydown: re, handlePaste: z, hideFormatMenu: ie, resetEditor: ae, showFormatMenu: B, triggerCandidates: oe, triggerMenuPosition: V, highlightedTriggerIndex: H, showTriggerMenu: ce, selectTriggerCandidate: le } = nd(E, O, A, {
|
|
7680
7718
|
getModelValue: () => u.modelValue,
|
|
7681
7719
|
updateModelValue: (e) => d("update:modelValue", e),
|
|
7682
|
-
submit: () =>
|
|
7720
|
+
submit: () => Ce(),
|
|
7683
7721
|
getMentionCandidates: () => u.mentionCandidates ?? [],
|
|
7684
7722
|
getMentionNameByUid: () => u.mentionNameByUid ?? {},
|
|
7685
7723
|
mentionsEnabled: () => u.mentionsEnabled ?? (u.mentionCandidates?.length ?? 0) > 0
|
|
7686
|
-
}),
|
|
7724
|
+
}), ue = n(() => c[v.value]), de = n(() => {
|
|
7687
7725
|
if (!_.value) return null;
|
|
7688
7726
|
let e = _.value.type;
|
|
7689
7727
|
return e.startsWith("image/") ? "image" : e.startsWith("video/") ? "video" : e.startsWith("audio/") ? "audio" : "file";
|
|
7690
|
-
}),
|
|
7691
|
-
switch (
|
|
7728
|
+
}), fe = n(() => {
|
|
7729
|
+
switch (de.value) {
|
|
7692
7730
|
case "image": return C("image");
|
|
7693
7731
|
case "video": return C("video");
|
|
7694
7732
|
case "audio": return C("audio");
|
|
7695
7733
|
case "file": return C("file");
|
|
7696
7734
|
default: return C("attachment");
|
|
7697
7735
|
}
|
|
7698
|
-
}),
|
|
7699
|
-
|
|
7700
|
-
|
|
7736
|
+
}), U = n(() => !u.editingMessage && !u.replyToMessage ? "" : u.compact ? "pt-1" : "pt-1.5"), pe = n(() => ls(u.modelValue) || !!_.value), me = n(() => pe.value && de.value !== "file"), he = n(() => _.value ? C("attachmentSummary", { name: _.value.name }) : us(u.modelValue) || C("currentDraftWillBeScheduled"));
|
|
7737
|
+
P(() => u.resetSignal, () => {
|
|
7738
|
+
ae(), _.value = null, y.value = !1, b.value = !1, f.value && (f.value.value = "");
|
|
7701
7739
|
});
|
|
7702
|
-
async function
|
|
7703
|
-
await h(),
|
|
7740
|
+
async function ge() {
|
|
7741
|
+
await h(), N();
|
|
7704
7742
|
}
|
|
7705
|
-
function
|
|
7743
|
+
function _e() {
|
|
7706
7744
|
m.value?.hide();
|
|
7707
7745
|
}
|
|
7708
7746
|
t({
|
|
7709
|
-
focusEditor:
|
|
7710
|
-
hideComposerActions:
|
|
7747
|
+
focusEditor: ge,
|
|
7748
|
+
hideComposerActions: _e
|
|
7711
7749
|
});
|
|
7712
|
-
async function
|
|
7750
|
+
async function ve(e = "file") {
|
|
7713
7751
|
v.value = e, await h(), f.value?.click();
|
|
7714
7752
|
}
|
|
7715
|
-
function
|
|
7716
|
-
_.value = e.target.files?.[0] ?? null,
|
|
7753
|
+
function ye(e) {
|
|
7754
|
+
_.value = e.target.files?.[0] ?? null, _e();
|
|
7755
|
+
}
|
|
7756
|
+
function be(e) {
|
|
7757
|
+
if (u.disabled) return;
|
|
7758
|
+
let t = Yu(e);
|
|
7759
|
+
if (t) {
|
|
7760
|
+
e.preventDefault(), _.value = t, _e();
|
|
7761
|
+
return;
|
|
7762
|
+
}
|
|
7763
|
+
z(e);
|
|
7717
7764
|
}
|
|
7718
|
-
function
|
|
7765
|
+
function xe() {
|
|
7719
7766
|
_.value = null, f.value && (f.value.value = "");
|
|
7720
7767
|
}
|
|
7721
|
-
function
|
|
7768
|
+
function Se(e) {
|
|
7722
7769
|
m.value?.toggle(e);
|
|
7723
7770
|
}
|
|
7724
|
-
function
|
|
7725
|
-
if (!(u.disabled || !
|
|
7771
|
+
function Ce() {
|
|
7772
|
+
if (!(u.disabled || !pe.value)) {
|
|
7726
7773
|
if (_.value) {
|
|
7727
7774
|
d("sendAttachment", {
|
|
7728
7775
|
file: _.value,
|
|
@@ -7733,10 +7780,10 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
|
|
|
7733
7780
|
d("sendText");
|
|
7734
7781
|
}
|
|
7735
7782
|
}
|
|
7736
|
-
function
|
|
7783
|
+
function we(e) {
|
|
7737
7784
|
d("sendPoll", e);
|
|
7738
7785
|
}
|
|
7739
|
-
function
|
|
7786
|
+
function Te(e) {
|
|
7740
7787
|
d("scheduleMessage", {
|
|
7741
7788
|
...e,
|
|
7742
7789
|
text: _.value ? void 0 : cs(u.modelValue),
|
|
@@ -7744,48 +7791,48 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
|
|
|
7744
7791
|
caption: _.value ? cs(u.modelValue) : void 0
|
|
7745
7792
|
});
|
|
7746
7793
|
}
|
|
7747
|
-
function
|
|
7794
|
+
function Ee() {
|
|
7748
7795
|
d("openScheduled");
|
|
7749
7796
|
}
|
|
7750
|
-
function
|
|
7797
|
+
function De() {
|
|
7751
7798
|
T !== null && (clearTimeout(T), T = null);
|
|
7752
7799
|
}
|
|
7753
|
-
function
|
|
7754
|
-
u.disabled || !
|
|
7800
|
+
function Oe(e) {
|
|
7801
|
+
u.disabled || !me.value || e instanceof MouseEvent && e.button !== 0 || (x.value = !1, De(), T = setTimeout(() => {
|
|
7755
7802
|
T = null, x.value = !0, b.value = !0;
|
|
7756
|
-
},
|
|
7803
|
+
}, Wd));
|
|
7757
7804
|
}
|
|
7758
|
-
function
|
|
7759
|
-
|
|
7805
|
+
function W() {
|
|
7806
|
+
De();
|
|
7760
7807
|
}
|
|
7761
|
-
function
|
|
7762
|
-
if (!(u.disabled || !
|
|
7808
|
+
function ke() {
|
|
7809
|
+
if (!(u.disabled || !pe.value)) {
|
|
7763
7810
|
if (x.value) {
|
|
7764
7811
|
x.value = !1;
|
|
7765
7812
|
return;
|
|
7766
7813
|
}
|
|
7767
|
-
|
|
7814
|
+
Ce();
|
|
7768
7815
|
}
|
|
7769
7816
|
}
|
|
7770
|
-
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",
|
|
7817
|
+
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", U.value]) }, [
|
|
7771
7818
|
o("input", {
|
|
7772
7819
|
ref_key: "fileInputRef",
|
|
7773
7820
|
ref: f,
|
|
7774
7821
|
type: "file",
|
|
7775
7822
|
class: "hidden",
|
|
7776
|
-
accept:
|
|
7823
|
+
accept: ue.value,
|
|
7777
7824
|
disabled: e.disabled,
|
|
7778
|
-
onChange:
|
|
7779
|
-
onCancel:
|
|
7780
|
-
}, null, 40,
|
|
7781
|
-
e.editingMessage ? (S(), r(
|
|
7825
|
+
onChange: ye,
|
|
7826
|
+
onCancel: _e
|
|
7827
|
+
}, null, 40, Nd),
|
|
7828
|
+
e.editingMessage ? (S(), r(pd, {
|
|
7782
7829
|
key: 0,
|
|
7783
7830
|
message: e.editingMessage,
|
|
7784
7831
|
variant: "editing",
|
|
7785
7832
|
"context-label": e.contextLabel,
|
|
7786
7833
|
onCancel: n[0] ||= (e) => d("cancelEdit")
|
|
7787
7834
|
}, null, 8, ["message", "context-label"])) : i("", !0),
|
|
7788
|
-
e.replyToMessage ? (S(), r(
|
|
7835
|
+
e.replyToMessage ? (S(), r(pd, {
|
|
7789
7836
|
key: 1,
|
|
7790
7837
|
message: e.replyToMessage,
|
|
7791
7838
|
variant: "replying",
|
|
@@ -7793,25 +7840,25 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
|
|
|
7793
7840
|
"data-testid": "composer-reply-context",
|
|
7794
7841
|
onCancel: n[1] ||= (e) => d("cancelReply")
|
|
7795
7842
|
}, null, 8, ["message", "context-label"])) : i("", !0),
|
|
7796
|
-
_.value ? (S(), a("div",
|
|
7843
|
+
_.value ? (S(), a("div", Pd, [o("div", Fd, [o("p", Id, k(_.value.name), 1), o("p", Ld, k(_.value.type || fe.value), 1)]), l(j(R), {
|
|
7797
7844
|
icon: j(bu),
|
|
7798
7845
|
text: "",
|
|
7799
7846
|
rounded: "",
|
|
7800
7847
|
severity: "secondary",
|
|
7801
|
-
onClick:
|
|
7848
|
+
onClick: xe
|
|
7802
7849
|
}, null, 8, ["icon"])])) : i("", !0),
|
|
7803
7850
|
o("div", {
|
|
7804
7851
|
ref_key: "composerShellRef",
|
|
7805
7852
|
ref: E,
|
|
7806
7853
|
class: g(["composer-shell w-full", u.compact ? "composer-shell--compact" : "composer-shell--default"])
|
|
7807
7854
|
}, [
|
|
7808
|
-
l(
|
|
7855
|
+
l(cd, {
|
|
7809
7856
|
ref_key: "composerActionsRef",
|
|
7810
7857
|
ref: m,
|
|
7811
|
-
onPickFile:
|
|
7858
|
+
onPickFile: ve,
|
|
7812
7859
|
onOpenPoll: n[2] ||= (e) => y.value = !0
|
|
7813
7860
|
}, null, 512),
|
|
7814
|
-
l(j(
|
|
7861
|
+
l(j(R), {
|
|
7815
7862
|
text: "",
|
|
7816
7863
|
rounded: "",
|
|
7817
7864
|
severity: "secondary",
|
|
@@ -7819,9 +7866,9 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
|
|
|
7819
7866
|
disabled: e.disabled || !!e.editingMessage,
|
|
7820
7867
|
"aria-label": j(C)("addToMessage"),
|
|
7821
7868
|
"data-testid": "composer-actions-button",
|
|
7822
|
-
onClick:
|
|
7869
|
+
onClick: Se
|
|
7823
7870
|
}, {
|
|
7824
|
-
default:
|
|
7871
|
+
default: F(() => [o("span", Rd, [(S(), r(D(j(hu)), { class: "size-7" }))])]),
|
|
7825
7872
|
_: 1
|
|
7826
7873
|
}, 8, [
|
|
7827
7874
|
"class",
|
|
@@ -7829,7 +7876,7 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
|
|
|
7829
7876
|
"aria-label"
|
|
7830
7877
|
]),
|
|
7831
7878
|
(S(), a("div", {
|
|
7832
|
-
key: j(
|
|
7879
|
+
key: j(te),
|
|
7833
7880
|
ref_key: "composerEditorRef",
|
|
7834
7881
|
ref: O,
|
|
7835
7882
|
contenteditable: "true",
|
|
@@ -7837,15 +7884,15 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
|
|
|
7837
7884
|
"aria-multiline": "true",
|
|
7838
7885
|
"data-placeholder": j(C)("writeMessage"),
|
|
7839
7886
|
class: g(["composer-editor", e.disabled ? "pointer-events-none opacity-60" : ""]),
|
|
7840
|
-
onFocus: n[3] ||= (...e) => j(
|
|
7841
|
-
onInput: n[4] ||= (...e) => j(
|
|
7842
|
-
onKeyup: n[5] ||= (...e) => j(
|
|
7843
|
-
onKeydown: n[6] ||= (...e) => j(
|
|
7844
|
-
onPaste:
|
|
7845
|
-
onContextmenu: n[
|
|
7846
|
-
}, null, 42,
|
|
7847
|
-
_.value || e.editingMessage || e.contextLabel || e.offlineMode ? (S(), a("div",
|
|
7848
|
-
e.editingMessage ? (S(), r(j(
|
|
7887
|
+
onFocus: n[3] ||= (...e) => j(ie) && j(ie)(...e),
|
|
7888
|
+
onInput: n[4] ||= (...e) => j(L) && j(L)(...e),
|
|
7889
|
+
onKeyup: n[5] ||= (...e) => j(L) && j(L)(...e),
|
|
7890
|
+
onKeydown: n[6] ||= (...e) => j(re) && j(re)(...e),
|
|
7891
|
+
onPaste: be,
|
|
7892
|
+
onContextmenu: n[7] ||= (...e) => j(ne) && j(ne)(...e)
|
|
7893
|
+
}, null, 42, zd)),
|
|
7894
|
+
_.value || e.editingMessage || e.contextLabel || e.offlineMode ? (S(), a("div", Bd, [
|
|
7895
|
+
e.editingMessage ? (S(), r(j(se), {
|
|
7849
7896
|
key: 0,
|
|
7850
7897
|
text: j(C)("editing"),
|
|
7851
7898
|
context: "info",
|
|
@@ -7853,7 +7900,7 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
|
|
|
7853
7900
|
size: "sm",
|
|
7854
7901
|
class: "composer-meta-tag"
|
|
7855
7902
|
}, null, 8, ["text"])) : i("", !0),
|
|
7856
|
-
e.contextLabel ? (S(), r(j(
|
|
7903
|
+
e.contextLabel ? (S(), r(j(se), {
|
|
7857
7904
|
key: 1,
|
|
7858
7905
|
text: e.contextLabel,
|
|
7859
7906
|
context: "contrast",
|
|
@@ -7861,41 +7908,41 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
|
|
|
7861
7908
|
size: "sm",
|
|
7862
7909
|
class: "composer-meta-tag"
|
|
7863
7910
|
}, null, 8, ["text"])) : i("", !0),
|
|
7864
|
-
e.offlineMode ? (S(), a("p",
|
|
7911
|
+
e.offlineMode ? (S(), a("p", Vd, k(e.pendingQueueCount ? j(C)("offlineQueued", { count: e.pendingQueueCount }) : j(C)("offline")), 1)) : i("", !0)
|
|
7865
7912
|
])) : i("", !0),
|
|
7866
|
-
e.showScheduledButton ? (S(), r(j(
|
|
7913
|
+
e.showScheduledButton ? (S(), r(j(R), {
|
|
7867
7914
|
key: 1,
|
|
7868
7915
|
rounded: "",
|
|
7869
7916
|
text: "",
|
|
7870
7917
|
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"]),
|
|
7871
7918
|
disabled: e.disabled,
|
|
7872
7919
|
"aria-label": j(C)("scheduledMessages"),
|
|
7873
|
-
onClick:
|
|
7920
|
+
onClick: Ee
|
|
7874
7921
|
}, {
|
|
7875
|
-
default:
|
|
7922
|
+
default: F(() => [o("span", Hd, [(S(), r(D(j(Du)), { class: "size-7" }))])]),
|
|
7876
7923
|
_: 1
|
|
7877
7924
|
}, 8, [
|
|
7878
7925
|
"class",
|
|
7879
7926
|
"disabled",
|
|
7880
7927
|
"aria-label"
|
|
7881
7928
|
])) : i("", !0),
|
|
7882
|
-
l(j(
|
|
7929
|
+
l(j(R), {
|
|
7883
7930
|
rounded: "",
|
|
7884
7931
|
severity: "primary",
|
|
7885
7932
|
text: "",
|
|
7886
7933
|
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"]),
|
|
7887
|
-
disabled: e.disabled || !
|
|
7934
|
+
disabled: e.disabled || !pe.value,
|
|
7888
7935
|
"aria-label": e.editingMessage ? j(C)("saveMessage") : _.value ? j(C)("sendAttachment") : j(C)("sendMessage"),
|
|
7889
|
-
onMousedown:
|
|
7890
|
-
onMouseup:
|
|
7891
|
-
onMouseleave:
|
|
7892
|
-
onTouchstart:
|
|
7893
|
-
onTouchend:
|
|
7894
|
-
onTouchcancel:
|
|
7895
|
-
onContextmenu: n[
|
|
7896
|
-
onClick:
|
|
7936
|
+
onMousedown: Oe,
|
|
7937
|
+
onMouseup: W,
|
|
7938
|
+
onMouseleave: W,
|
|
7939
|
+
onTouchstart: Oe,
|
|
7940
|
+
onTouchend: W,
|
|
7941
|
+
onTouchcancel: W,
|
|
7942
|
+
onContextmenu: n[8] ||= I(() => {}, ["prevent"]),
|
|
7943
|
+
onClick: ke
|
|
7897
7944
|
}, {
|
|
7898
|
-
default:
|
|
7945
|
+
default: F(() => [o("span", Ud, [e.editingMessage ? (S(), r(D(j(yu)), {
|
|
7899
7946
|
key: 0,
|
|
7900
7947
|
class: "size-7"
|
|
7901
7948
|
})) : (S(), r(D(j(Vu)), {
|
|
@@ -7909,39 +7956,39 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
|
|
|
7909
7956
|
"aria-label"
|
|
7910
7957
|
])
|
|
7911
7958
|
], 2),
|
|
7912
|
-
l(
|
|
7913
|
-
visible: j(
|
|
7914
|
-
position: j(
|
|
7915
|
-
onFormat: n[
|
|
7959
|
+
l(md, {
|
|
7960
|
+
visible: j(B),
|
|
7961
|
+
position: j(M),
|
|
7962
|
+
onFormat: n[9] ||= (e) => j(ee)(e)
|
|
7916
7963
|
}, null, 8, ["visible", "position"]),
|
|
7917
|
-
l(
|
|
7964
|
+
l(Md, {
|
|
7918
7965
|
ref_key: "triggerMenuRef",
|
|
7919
7966
|
ref: A,
|
|
7920
|
-
"highlighted-index": j(
|
|
7921
|
-
"onUpdate:highlightedIndex": n[
|
|
7922
|
-
visible: j(
|
|
7923
|
-
position: j(
|
|
7924
|
-
candidates: j(
|
|
7925
|
-
onSelect: n[
|
|
7967
|
+
"highlighted-index": j(H),
|
|
7968
|
+
"onUpdate:highlightedIndex": n[10] ||= (e) => p(H) ? H.value = e : null,
|
|
7969
|
+
visible: j(ce),
|
|
7970
|
+
position: j(V),
|
|
7971
|
+
candidates: j(oe),
|
|
7972
|
+
onSelect: n[11] ||= (e) => j(le)(e)
|
|
7926
7973
|
}, null, 8, [
|
|
7927
7974
|
"highlighted-index",
|
|
7928
7975
|
"visible",
|
|
7929
7976
|
"position",
|
|
7930
7977
|
"candidates"
|
|
7931
7978
|
]),
|
|
7932
|
-
l(
|
|
7979
|
+
l(bd, {
|
|
7933
7980
|
visible: y.value,
|
|
7934
|
-
"onUpdate:visible": n[
|
|
7981
|
+
"onUpdate:visible": n[12] ||= (e) => y.value = e,
|
|
7935
7982
|
disabled: e.disabled,
|
|
7936
|
-
onSend:
|
|
7983
|
+
onSend: we
|
|
7937
7984
|
}, null, 8, ["visible", "disabled"]),
|
|
7938
|
-
l(
|
|
7985
|
+
l(Ed, {
|
|
7939
7986
|
visible: b.value,
|
|
7940
|
-
"onUpdate:visible": n[
|
|
7987
|
+
"onUpdate:visible": n[13] ||= (e) => b.value = e,
|
|
7941
7988
|
disabled: e.disabled,
|
|
7942
|
-
"can-schedule":
|
|
7943
|
-
"content-preview":
|
|
7944
|
-
onSchedule:
|
|
7989
|
+
"can-schedule": me.value,
|
|
7990
|
+
"content-preview": he.value,
|
|
7991
|
+
onSchedule: Te
|
|
7945
7992
|
}, null, 8, [
|
|
7946
7993
|
"visible",
|
|
7947
7994
|
"disabled",
|
|
@@ -7950,10 +7997,10 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
|
|
|
7950
7997
|
])
|
|
7951
7998
|
], 2));
|
|
7952
7999
|
}
|
|
7953
|
-
}), [["__scopeId", "data-v-
|
|
8000
|
+
}), [["__scopeId", "data-v-cf9e887c"]]), Kd = {
|
|
7954
8001
|
key: 1,
|
|
7955
8002
|
class: "composer-readonly-notice"
|
|
7956
|
-
},
|
|
8003
|
+
}, qd = /* @__PURE__ */ sd(/* @__PURE__ */ u({
|
|
7957
8004
|
__name: "ConversationComposer",
|
|
7958
8005
|
props: { target: {} },
|
|
7959
8006
|
setup(e, { expose: t }) {
|
|
@@ -7996,17 +8043,17 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
|
|
|
7996
8043
|
function A() {
|
|
7997
8044
|
f.emit("composer:cancelEdit");
|
|
7998
8045
|
}
|
|
7999
|
-
let
|
|
8046
|
+
let ee = w(null);
|
|
8000
8047
|
fu(f, "ui:closeComposerActions", () => {
|
|
8001
|
-
|
|
8048
|
+
ee.value?.hideComposerActions();
|
|
8002
8049
|
});
|
|
8003
|
-
async function
|
|
8004
|
-
await
|
|
8050
|
+
async function te() {
|
|
8051
|
+
await ee.value?.focusEditor();
|
|
8005
8052
|
}
|
|
8006
|
-
return t({ focusEditor:
|
|
8053
|
+
return t({ focusEditor: te }), (e, t) => y.value ? (S(), r(Gd, {
|
|
8007
8054
|
key: 0,
|
|
8008
8055
|
ref_key: "composerRef",
|
|
8009
|
-
ref:
|
|
8056
|
+
ref: ee,
|
|
8010
8057
|
"model-value": m.value,
|
|
8011
8058
|
disabled: v.value,
|
|
8012
8059
|
"reset-signal": h.value,
|
|
@@ -8040,10 +8087,10 @@ var $u = ["data-testid", "onClick"], ed = { class: "composer-actions-menu__icon"
|
|
|
8040
8087
|
"mention-candidates",
|
|
8041
8088
|
"mention-name-by-uid",
|
|
8042
8089
|
"mentions-enabled"
|
|
8043
|
-
])) : b.value ? (S(), a("div",
|
|
8090
|
+
])) : b.value ? (S(), a("div", Kd, k(p.value ? j(s)("repliesDisabledInChannels") : j(s)("readOnlyChannel")), 1)) : i("", !0);
|
|
8044
8091
|
}
|
|
8045
|
-
}), [["__scopeId", "data-v-84a9e2b1"]]),
|
|
8046
|
-
function
|
|
8092
|
+
}), [["__scopeId", "data-v-84a9e2b1"]]), Jd = 1800;
|
|
8093
|
+
function Yd(e) {
|
|
8047
8094
|
let t = e.actionMenuRef, n = w(null), r = w(null), i = typeof window < "u" && window.matchMedia("(hover: hover) and (pointer: fine)").matches, a = null;
|
|
8048
8095
|
function o(e) {
|
|
8049
8096
|
return e.kind === "text" && ls(e.text);
|
|
@@ -8144,7 +8191,7 @@ function Gd(e) {
|
|
|
8144
8191
|
}
|
|
8145
8192
|
r.value = e.id, a && clearTimeout(a), a = setTimeout(() => {
|
|
8146
8193
|
r.value = null;
|
|
8147
|
-
},
|
|
8194
|
+
}, Jd), v();
|
|
8148
8195
|
}
|
|
8149
8196
|
function C(t) {
|
|
8150
8197
|
e.canReply() && (e.emit.reply(t), v());
|
|
@@ -8233,8 +8280,8 @@ function Gd(e) {
|
|
|
8233
8280
|
}
|
|
8234
8281
|
//#endregion
|
|
8235
8282
|
//#region src/composables/useMessageListScroll.ts
|
|
8236
|
-
var
|
|
8237
|
-
function
|
|
8283
|
+
var Xd = 1, Zd = 2, Qd = 80, $d = 1800, ef = 4;
|
|
8284
|
+
function tf(e) {
|
|
8238
8285
|
let t = e.threadRef, n = !0, r = 0, i = null, a = null, o = null, s = null;
|
|
8239
8286
|
function c() {
|
|
8240
8287
|
o != null && (cancelAnimationFrame(o), o = null);
|
|
@@ -8276,7 +8323,7 @@ function Zd(e) {
|
|
|
8276
8323
|
resizeObserver: o,
|
|
8277
8324
|
timeoutId: setTimeout(() => {
|
|
8278
8325
|
f();
|
|
8279
|
-
},
|
|
8326
|
+
}, $d)
|
|
8280
8327
|
}, a(), o.observe(e);
|
|
8281
8328
|
}
|
|
8282
8329
|
function m() {
|
|
@@ -8287,11 +8334,11 @@ function Zd(e) {
|
|
|
8287
8334
|
let a = t.value;
|
|
8288
8335
|
if (!a) return;
|
|
8289
8336
|
let o = a.scrollTop;
|
|
8290
|
-
i?.el === a && Math.abs(o - i.expectedScrollTop) >
|
|
8337
|
+
i?.el === a && Math.abs(o - i.expectedScrollTop) > ef && f();
|
|
8291
8338
|
let s = o < r, c = Math.max(0, a.scrollHeight - o - a.clientHeight);
|
|
8292
|
-
s && c >
|
|
8339
|
+
s && c > Xd ? n = !1 : c <= Zd && (n = !0), r = o, a.scrollTop <= Qd && !e.isLoading() && !e.isLoadingOlder() && e.canLoadOlder() && e.onLoadOlder();
|
|
8293
8340
|
}
|
|
8294
|
-
return
|
|
8341
|
+
return P(() => {
|
|
8295
8342
|
let t = e.getMessages();
|
|
8296
8343
|
return {
|
|
8297
8344
|
conversationId: e.getConversation()?.id ?? null,
|
|
@@ -8317,14 +8364,14 @@ function Zd(e) {
|
|
|
8317
8364
|
}
|
|
8318
8365
|
//#endregion
|
|
8319
8366
|
//#region src/composables/useImageZoom.ts
|
|
8320
|
-
var
|
|
8321
|
-
function
|
|
8367
|
+
var nf = 1, rf = 4;
|
|
8368
|
+
function af(e) {
|
|
8322
8369
|
let t = w(1), n = w(0), r = w(0), i = w(!1), a = /* @__PURE__ */ new Map(), o = null, s = 0, c = 0, l = 0, u = 0, d = 0, f = 1, p = 0, m = 0;
|
|
8323
8370
|
function h(e, t, n) {
|
|
8324
8371
|
return Math.min(Math.max(e, t), n);
|
|
8325
8372
|
}
|
|
8326
8373
|
function g(e) {
|
|
8327
|
-
return h(e,
|
|
8374
|
+
return h(e, nf, rf);
|
|
8328
8375
|
}
|
|
8329
8376
|
function _(n, r, i = t.value) {
|
|
8330
8377
|
let a = e.viewportRef.value?.clientWidth ?? 0, o = e.viewportRef.value?.clientHeight ?? 0, s = e.imageRef.value?.clientWidth ?? a, c = e.imageRef.value?.clientHeight ?? o, l = s * i, u = c * i, d = Math.max(0, (l - a) / 2), f = Math.max(0, (u - o) / 2);
|
|
@@ -8414,10 +8461,10 @@ function ef(e) {
|
|
|
8414
8461
|
}
|
|
8415
8462
|
//#endregion
|
|
8416
8463
|
//#region src/components/overlays/FullscreenDialog.vue?vue&type=script&setup=true&lang.ts
|
|
8417
|
-
var
|
|
8464
|
+
var of = { class: "w-full" }, sf = {
|
|
8418
8465
|
key: 0,
|
|
8419
8466
|
class: "fullscreen-dialog__footer"
|
|
8420
|
-
},
|
|
8467
|
+
}, cf = /* @__PURE__ */ u({
|
|
8421
8468
|
__name: "FullscreenDialog",
|
|
8422
8469
|
props: {
|
|
8423
8470
|
open: { type: Boolean },
|
|
@@ -8432,7 +8479,7 @@ var tf = { class: "w-full" }, nf = {
|
|
|
8432
8479
|
function s() {
|
|
8433
8480
|
n("close");
|
|
8434
8481
|
}
|
|
8435
|
-
return (t, n) => (S(), r(j(
|
|
8482
|
+
return (t, n) => (S(), r(j(re), {
|
|
8436
8483
|
class: "w-5/6 max-w-lg",
|
|
8437
8484
|
visible: e.open,
|
|
8438
8485
|
modal: "",
|
|
@@ -8442,53 +8489,53 @@ var tf = { class: "w-full" }, nf = {
|
|
|
8442
8489
|
closable: !0,
|
|
8443
8490
|
"onUpdate:visible": s
|
|
8444
8491
|
}, {
|
|
8445
|
-
default:
|
|
8492
|
+
default: F(() => [o("div", of, [E(t.$slots, "default")]), t.$slots.footer ? (S(), a("div", sf, [E(t.$slots, "footer")])) : i("", !0)]),
|
|
8446
8493
|
_: 3
|
|
8447
8494
|
}, 8, ["visible", "header"]));
|
|
8448
8495
|
}
|
|
8449
|
-
}),
|
|
8496
|
+
}), lf = ["href"], uf = { class: "media-viewer-shell flex min-h-0 flex-1 items-center justify-center overflow-hidden" }, df = ["src", "alt"], ff = {
|
|
8450
8497
|
key: 1,
|
|
8451
8498
|
class: "media-viewer-stage media-viewer-stage-video flex w-full items-center justify-center"
|
|
8452
|
-
},
|
|
8499
|
+
}, pf = {
|
|
8453
8500
|
class: "max-h-full w-full bg-black",
|
|
8454
8501
|
controls: "",
|
|
8455
8502
|
playsinline: "",
|
|
8456
8503
|
autoplay: ""
|
|
8457
|
-
},
|
|
8504
|
+
}, mf = ["src", "type"], hf = {
|
|
8458
8505
|
key: 2,
|
|
8459
8506
|
class: "media-viewer-stage media-viewer-audio-stage flex w-full items-center justify-center px-5 py-6"
|
|
8460
|
-
},
|
|
8507
|
+
}, gf = {
|
|
8461
8508
|
class: "w-full",
|
|
8462
8509
|
controls: "",
|
|
8463
8510
|
autoplay: ""
|
|
8464
|
-
},
|
|
8511
|
+
}, _f = ["src", "type"], vf = {
|
|
8465
8512
|
key: 0,
|
|
8466
8513
|
class: "media-viewer-footer flex min-w-0 items-center justify-between gap-3 px-4 py-3 max-md:px-3.5 max-md:py-3"
|
|
8467
|
-
},
|
|
8514
|
+
}, yf = { class: "min-w-0 flex-1" }, bf = { class: "heading-sm text-default truncate" }, xf = { class: "body-sm text-subtle" }, Sf = /* @__PURE__ */ sd(/* @__PURE__ */ u({
|
|
8468
8515
|
__name: "MediaViewerDialog",
|
|
8469
8516
|
props: { attachment: {} },
|
|
8470
8517
|
emits: ["close"],
|
|
8471
8518
|
setup(t, { emit: s }) {
|
|
8472
|
-
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:
|
|
8519
|
+
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: ee, handleWheel: te, handleDoubleClick: M } = af({
|
|
8473
8520
|
viewportRef: u,
|
|
8474
8521
|
imageRef: d,
|
|
8475
8522
|
isImage: () => p.value
|
|
8476
8523
|
});
|
|
8477
|
-
|
|
8524
|
+
P(() => c.attachment?.url, () => {
|
|
8478
8525
|
T();
|
|
8479
8526
|
});
|
|
8480
|
-
function
|
|
8527
|
+
function N() {
|
|
8481
8528
|
l("close");
|
|
8482
8529
|
}
|
|
8483
|
-
return (n, s) => (S(), r(
|
|
8530
|
+
return (n, s) => (S(), r(cf, {
|
|
8484
8531
|
open: f.value,
|
|
8485
8532
|
title: t.attachment?.name || j(_)("attachment"),
|
|
8486
8533
|
subtitle: t.attachment?.kind || "",
|
|
8487
8534
|
"close-label": j(_)("close"),
|
|
8488
8535
|
"close-aria-label": j(_)("closeMediaViewer"),
|
|
8489
|
-
onClose:
|
|
8536
|
+
onClose: N
|
|
8490
8537
|
}, {
|
|
8491
|
-
actions:
|
|
8538
|
+
actions: F(() => [t.attachment?.url ? (S(), a("a", {
|
|
8492
8539
|
key: 0,
|
|
8493
8540
|
href: t.attachment.url,
|
|
8494
8541
|
target: "_blank",
|
|
@@ -8497,9 +8544,9 @@ var tf = { class: "w-full" }, nf = {
|
|
|
8497
8544
|
}, [(S(), r(D(j(Lu)), {
|
|
8498
8545
|
class: "size-4",
|
|
8499
8546
|
"aria-hidden": "true"
|
|
8500
|
-
})), o("span", null, k(j(_)("openInNewTab")), 1)], 8,
|
|
8501
|
-
footer:
|
|
8502
|
-
default:
|
|
8547
|
+
})), o("span", null, k(j(_)("openInNewTab")), 1)], 8, lf)) : i("", !0)]),
|
|
8548
|
+
footer: F(() => [t.attachment ? (S(), a("div", vf, [o("div", yf, [o("p", bf, k(t.attachment.name), 1), o("p", xf, k(t.attachment.kind), 1)])])) : i("", !0)]),
|
|
8549
|
+
default: F(() => [o("div", uf, [t.attachment?.url ? (S(), a(e, { key: 0 }, [p.value ? (S(), a("div", {
|
|
8503
8550
|
key: 0,
|
|
8504
8551
|
ref_key: "viewportRef",
|
|
8505
8552
|
ref: u,
|
|
@@ -8507,10 +8554,10 @@ var tf = { class: "w-full" }, nf = {
|
|
|
8507
8554
|
onPointerdown: s[0] ||= (...e) => j(E) && j(E)(...e),
|
|
8508
8555
|
onPointermove: s[1] ||= (...e) => j(O) && j(O)(...e),
|
|
8509
8556
|
onPointerup: s[2] ||= (...e) => j(A) && j(A)(...e),
|
|
8510
|
-
onPointercancel: s[3] ||= (...e) => j(
|
|
8557
|
+
onPointercancel: s[3] ||= (...e) => j(ee) && j(ee)(...e),
|
|
8511
8558
|
onPointerleave: s[4] ||= (...e) => j(A) && j(A)(...e),
|
|
8512
|
-
onWheel: s[5] ||= (...e) => j(
|
|
8513
|
-
onDblclick: s[6] ||= (...e) => j(
|
|
8559
|
+
onWheel: s[5] ||= (...e) => j(te) && j(te)(...e),
|
|
8560
|
+
onDblclick: s[6] ||= (...e) => j(M) && j(M)(...e)
|
|
8514
8561
|
}, [o("img", {
|
|
8515
8562
|
ref_key: "imageRef",
|
|
8516
8563
|
ref: d,
|
|
@@ -8522,13 +8569,13 @@ var tf = { class: "w-full" }, nf = {
|
|
|
8522
8569
|
transform: `translate3d(${j(b)}px, ${j(x)}px, 0) scale(${j(y)})`,
|
|
8523
8570
|
transformOrigin: "center center"
|
|
8524
8571
|
})
|
|
8525
|
-
}, null, 14,
|
|
8572
|
+
}, null, 14, df)], 544)) : m.value ? (S(), a("div", ff, [o("video", pf, [o("source", {
|
|
8526
8573
|
src: t.attachment.url,
|
|
8527
8574
|
type: t.attachment.mimeType || void 0
|
|
8528
|
-
}, null, 8,
|
|
8575
|
+
}, null, 8, mf)])])) : h.value ? (S(), a("div", hf, [o("audio", gf, [o("source", {
|
|
8529
8576
|
src: t.attachment.url,
|
|
8530
8577
|
type: t.attachment.mimeType || void 0
|
|
8531
|
-
}, null, 8,
|
|
8578
|
+
}, null, 8, _f)])])) : i("", !0)], 64)) : i("", !0)])]),
|
|
8532
8579
|
_: 1
|
|
8533
8580
|
}, 8, [
|
|
8534
8581
|
"open",
|
|
@@ -8538,7 +8585,7 @@ var tf = { class: "w-full" }, nf = {
|
|
|
8538
8585
|
"close-aria-label"
|
|
8539
8586
|
]));
|
|
8540
8587
|
}
|
|
8541
|
-
}), [["__scopeId", "data-v-0e82cfd0"]]),
|
|
8588
|
+
}), [["__scopeId", "data-v-0e82cfd0"]]), Cf = { class: "date-separator" }, wf = { class: "date-separator__label" }, Tf = /* @__PURE__ */ sd(/* @__PURE__ */ u({
|
|
8542
8589
|
__name: "MessageDateSeparator",
|
|
8543
8590
|
props: { date: {} },
|
|
8544
8591
|
setup(e) {
|
|
@@ -8552,24 +8599,24 @@ var tf = { class: "w-full" }, nf = {
|
|
|
8552
8599
|
year: "numeric"
|
|
8553
8600
|
}).format(n);
|
|
8554
8601
|
});
|
|
8555
|
-
return (e, t) => (S(), a("div",
|
|
8602
|
+
return (e, t) => (S(), a("div", Cf, [o("span", wf, k(s.value), 1)]));
|
|
8556
8603
|
}
|
|
8557
|
-
}), [["__scopeId", "data-v-49e72d67"]]),
|
|
8604
|
+
}), [["__scopeId", "data-v-49e72d67"]]), Ef = {
|
|
8558
8605
|
"data-testid": "action-message",
|
|
8559
8606
|
class: "message-action-row border-default bg-elevation-surface-default body-sm text-subtle max-w-4/5 rounded-full border px-3 py-1 text-center"
|
|
8560
|
-
},
|
|
8607
|
+
}, Df = { class: "message-action-row__text" }, Of = /* @__PURE__ */ u({
|
|
8561
8608
|
__name: "ActionMessageRow",
|
|
8562
8609
|
props: { text: {} },
|
|
8563
8610
|
setup(e) {
|
|
8564
|
-
return (t, n) => (S(), a("div",
|
|
8611
|
+
return (t, n) => (S(), a("div", Ef, [o("span", Df, k(e.text), 1)]));
|
|
8565
8612
|
}
|
|
8566
|
-
}),
|
|
8613
|
+
}), kf = ["href"], Af = {
|
|
8567
8614
|
key: 0,
|
|
8568
8615
|
class: "bg-elevation-surface-hovered aspect-[1.9/1] w-full overflow-hidden"
|
|
8569
|
-
},
|
|
8616
|
+
}, jf = ["src", "alt"], Mf = { class: "space-y-1.5 px-3 py-3" }, Nf = { class: "body-sm text-subtlest truncate font-semibold uppercase" }, Pf = { class: "heading-sm text-default line-clamp-2" }, Ff = { class: "body-md text-subtle line-clamp-2" }, If = {
|
|
8570
8617
|
key: 0,
|
|
8571
8618
|
class: "body-sm text-subtlest"
|
|
8572
|
-
},
|
|
8619
|
+
}, Lf = /* @__PURE__ */ u({
|
|
8573
8620
|
__name: "LinkPreviewCard",
|
|
8574
8621
|
props: {
|
|
8575
8622
|
url: {},
|
|
@@ -8590,7 +8637,7 @@ var tf = { class: "w-full" }, nf = {
|
|
|
8590
8637
|
return t.url;
|
|
8591
8638
|
}
|
|
8592
8639
|
});
|
|
8593
|
-
|
|
8640
|
+
P(() => t.url, async (e) => {
|
|
8594
8641
|
if (r.value = null, s.value = !1, !(!e || typeof window > "u")) {
|
|
8595
8642
|
if (p(e)) {
|
|
8596
8643
|
r.value = {
|
|
@@ -8636,18 +8683,18 @@ var tf = { class: "w-full" }, nf = {
|
|
|
8636
8683
|
target: "_blank",
|
|
8637
8684
|
rel: "noreferrer",
|
|
8638
8685
|
class: g(["media-surface mt-2 block rounded-xl no-underline transition hover:opacity-95", e.isOwn ? "bg-elevation-surface-default text-default" : "bg-elevation-surface-sunken text-default"])
|
|
8639
|
-
}, [r.value?.imageUrl ? (S(), a("div",
|
|
8686
|
+
}, [r.value?.imageUrl ? (S(), a("div", Af, [o("img", {
|
|
8640
8687
|
src: r.value.imageUrl,
|
|
8641
8688
|
alt: r.value.title || l.value,
|
|
8642
8689
|
class: "h-full w-full object-cover"
|
|
8643
|
-
}, null, 8,
|
|
8644
|
-
o("p",
|
|
8645
|
-
o("p",
|
|
8646
|
-
o("p",
|
|
8647
|
-
s.value && !r.value ? (S(), a("p",
|
|
8648
|
-
])], 10,
|
|
8649
|
-
}
|
|
8650
|
-
}),
|
|
8690
|
+
}, null, 8, jf)])) : i("", !0), o("div", Mf, [
|
|
8691
|
+
o("p", Nf, k(r.value?.siteName || l.value), 1),
|
|
8692
|
+
o("p", Pf, k(r.value?.title || l.value), 1),
|
|
8693
|
+
o("p", Ff, k(r.value?.description || u.value), 1),
|
|
8694
|
+
s.value && !r.value ? (S(), a("p", If, k(j(c)("loadingPreview")), 1)) : i("", !0)
|
|
8695
|
+
])], 10, kf));
|
|
8696
|
+
}
|
|
8697
|
+
}), Rf = { class: "linkified-text" }, zf = ["innerHTML"], Bf = /* @__PURE__ */ sd(/* @__PURE__ */ u({
|
|
8651
8698
|
__name: "LinkifiedText",
|
|
8652
8699
|
props: {
|
|
8653
8700
|
text: {},
|
|
@@ -8666,25 +8713,25 @@ var tf = { class: "w-full" }, nf = {
|
|
|
8666
8713
|
let t = e.target;
|
|
8667
8714
|
t.tagName === "A" && d(e, t);
|
|
8668
8715
|
}
|
|
8669
|
-
return (t, n) => (S(), a("div",
|
|
8716
|
+
return (t, n) => (S(), a("div", Rf, [o("div", {
|
|
8670
8717
|
class: g(["rich-text-content", e.textClass]),
|
|
8671
8718
|
onClick: f,
|
|
8672
8719
|
innerHTML: l.value
|
|
8673
|
-
}, null, 10,
|
|
8720
|
+
}, null, 10, zf), e.showPreview !== !1 && u.value ? (S(), r(Lf, {
|
|
8674
8721
|
key: 0,
|
|
8675
8722
|
url: u.value,
|
|
8676
8723
|
"is-own": e.isOwn
|
|
8677
8724
|
}, null, 8, ["url", "is-own"])) : i("", !0)]));
|
|
8678
8725
|
}
|
|
8679
|
-
}), [["__scopeId", "data-v-656b44e8"]]),
|
|
8726
|
+
}), [["__scopeId", "data-v-656b44e8"]]), Vf = { class: "w-full space-y-1" }, Hf = {
|
|
8680
8727
|
class: "attachment-video",
|
|
8681
8728
|
controls: "",
|
|
8682
8729
|
playsinline: "",
|
|
8683
8730
|
preload: "metadata"
|
|
8684
|
-
},
|
|
8731
|
+
}, Uf = ["src", "type"], Wf = ["onClick"], Gf = { class: "inline-flex items-center gap-2 truncate font-medium" }, Kf = ["href"], qf = { class: "flex min-w-0 items-center gap-2" }, Jf = { class: "bg-elevation-surface-hovered text-default inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full" }, Yf = { class: "text-default truncate font-medium" }, Xf = { class: "body-sm text-subtle shrink-0" }, Zf = {
|
|
8685
8732
|
key: 4,
|
|
8686
8733
|
class: "flex items-center justify-between gap-3 rounded-2xl px-3 py-2 text-sm"
|
|
8687
|
-
},
|
|
8734
|
+
}, Qf = { class: "flex min-w-0 items-center gap-2" }, $f = { class: "bg-elevation-surface-hovered text-default inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full" }, ep = { class: "text-default truncate font-medium" }, tp = { class: "body-sm text-subtle shrink-0" }, np = 4 / 3, rp = 16 / 9, ip = /* @__PURE__ */ sd(/* @__PURE__ */ u({
|
|
8688
8735
|
__name: "MessageAttachmentList",
|
|
8689
8736
|
props: { message: {} },
|
|
8690
8737
|
emits: ["openMedia"],
|
|
@@ -8739,12 +8786,12 @@ var tf = { class: "w-full" }, nf = {
|
|
|
8739
8786
|
return n ? t.localeCompare(n, void 0, { sensitivity: "accent" }) !== 0 : !0;
|
|
8740
8787
|
}
|
|
8741
8788
|
function m(e) {
|
|
8742
|
-
return e.width && e.height && e.width > 0 && e.height > 0 ? e.width / e.height : e.kind === "video" ?
|
|
8789
|
+
return e.width && e.height && e.width > 0 && e.height > 0 ? e.width / e.height : e.kind === "video" ? rp : np;
|
|
8743
8790
|
}
|
|
8744
8791
|
function h(e) {
|
|
8745
8792
|
return { aspectRatio: String(m(e)) };
|
|
8746
8793
|
}
|
|
8747
|
-
return (n, d) => (S(), a("div",
|
|
8794
|
+
return (n, d) => (S(), a("div", Vf, [(S(!0), a(e, null, T(t.message.attachments, (n) => (S(), a(e, { key: `${t.message.id}-${n.name}` }, [n.kind === "image" && n.url ? (S(), r(j(z), {
|
|
8748
8795
|
key: 0,
|
|
8749
8796
|
preview: "",
|
|
8750
8797
|
src: n.url,
|
|
@@ -8754,8 +8801,8 @@ var tf = { class: "w-full" }, nf = {
|
|
|
8754
8801
|
type: e.kind
|
|
8755
8802
|
})),
|
|
8756
8803
|
alt: n.name,
|
|
8757
|
-
"image-class": "bg-elevation-surface-raised-default object-contain rounded-lg max-h-96 max-w-96",
|
|
8758
|
-
class: "mx-auto rounded-lg"
|
|
8804
|
+
"image-class": "w-full bg-elevation-surface-raised-default object-contain rounded-lg max-h-96 max-w-96",
|
|
8805
|
+
class: "attachment-media-bleed mx-auto rounded-lg"
|
|
8759
8806
|
}, null, 8, [
|
|
8760
8807
|
"src",
|
|
8761
8808
|
"imgs",
|
|
@@ -8764,34 +8811,34 @@ var tf = { class: "w-full" }, nf = {
|
|
|
8764
8811
|
key: 1,
|
|
8765
8812
|
class: "attachment-media-bleed media-surface attachment-media-frame group relative rounded-xl",
|
|
8766
8813
|
style: v(h(n))
|
|
8767
|
-
}, [o("video",
|
|
8814
|
+
}, [o("video", Hf, [o("source", {
|
|
8768
8815
|
src: n.url,
|
|
8769
8816
|
type: n.mimeType || void 0
|
|
8770
|
-
}, null, 8,
|
|
8817
|
+
}, null, 8, Uf)])], 4)) : n.kind === "audio" && n.url ? (S(), a("button", {
|
|
8771
8818
|
key: 2,
|
|
8772
8819
|
type: "button",
|
|
8773
8820
|
class: "flex w-full items-center justify-between gap-3 rounded-2xl px-3 py-2 text-left text-sm transition hover:opacity-90",
|
|
8774
8821
|
onClick: (e) => s("openMedia", n)
|
|
8775
|
-
}, [o("span",
|
|
8822
|
+
}, [o("span", Gf, [d[0] ||= o("span", { class: "bg-elevation-surface-hovered text-default inline-flex h-8 w-8 items-center justify-center rounded-full" }, " ♪ ", -1), c(" " + k(j(l)("audioMessage")), 1)])], 8, Wf)) : n.url ? (S(), a("a", {
|
|
8776
8823
|
key: 3,
|
|
8777
8824
|
href: n.url,
|
|
8778
8825
|
target: "_blank",
|
|
8779
8826
|
rel: "noreferrer",
|
|
8780
8827
|
class: "flex items-center justify-between gap-3 rounded-2xl px-3 py-2 text-sm no-underline transition hover:opacity-90"
|
|
8781
|
-
}, [o("span",
|
|
8828
|
+
}, [o("span", qf, [o("span", Jf, [(S(), r(D(f(n)), {
|
|
8782
8829
|
class: "size-5",
|
|
8783
8830
|
"aria-hidden": "true"
|
|
8784
|
-
}))]), o("span",
|
|
8831
|
+
}))]), o("span", Yf, k(n.name), 1)]), o("span", Xf, k(u(n.size)), 1)], 8, Kf)) : (S(), a("div", Zf, [o("span", Qf, [o("span", $f, [(S(), r(D(f(n)), {
|
|
8785
8832
|
class: "size-5",
|
|
8786
8833
|
"aria-hidden": "true"
|
|
8787
|
-
}))]), o("span",
|
|
8834
|
+
}))]), o("span", ep, k(n.name), 1)]), o("span", tp, k(u(n.size) || j(l)("queued")), 1)]))], 64))), 128)), p(t.message) ? (S(), r(Bf, {
|
|
8788
8835
|
key: 0,
|
|
8789
8836
|
text: t.message.text,
|
|
8790
8837
|
"is-own": t.message.isOwn,
|
|
8791
8838
|
"text-class": "whitespace-normal wrap-break-word body-md text-default"
|
|
8792
8839
|
}, null, 8, ["text", "is-own"])) : i("", !0)]));
|
|
8793
8840
|
}
|
|
8794
|
-
}), [["__scopeId", "data-v-
|
|
8841
|
+
}), [["__scopeId", "data-v-648a4774"]]), ap = { class: "message-status" }, op = { key: 0 }, sp = /* @__PURE__ */ sd(/* @__PURE__ */ u({
|
|
8795
8842
|
__name: "MessageDeliveryStatus",
|
|
8796
8843
|
props: { message: {} },
|
|
8797
8844
|
setup(e) {
|
|
@@ -8838,8 +8885,8 @@ var tf = { class: "w-full" }, nf = {
|
|
|
8838
8885
|
};
|
|
8839
8886
|
}
|
|
8840
8887
|
});
|
|
8841
|
-
return (t, n) => (S(), a("div",
|
|
8842
|
-
e.message.isEdited && e.message.kind !== "poll" ? (S(), a("span",
|
|
8888
|
+
return (t, n) => (S(), a("div", ap, [
|
|
8889
|
+
e.message.isEdited && e.message.kind !== "poll" ? (S(), a("span", op, k(j(c)("edited")), 1)) : i("", !0),
|
|
8843
8890
|
o("span", null, k(l(e.message.sentAt)), 1),
|
|
8844
8891
|
u.value ? (S(), r(D(u.value.icon), {
|
|
8845
8892
|
key: 1,
|
|
@@ -8854,7 +8901,7 @@ var tf = { class: "w-full" }, nf = {
|
|
|
8854
8901
|
])) : i("", !0)
|
|
8855
8902
|
]));
|
|
8856
8903
|
}
|
|
8857
|
-
}), [["__scopeId", "data-v-20388b3b"]]),
|
|
8904
|
+
}), [["__scopeId", "data-v-20388b3b"]]), cp = { class: "mb-1 flex items-start justify-between gap-2" }, lp = { class: "body-sm text-subtlest truncate font-medium!" }, up = /* @__PURE__ */ u({
|
|
8858
8905
|
__name: "MessageItemHeader",
|
|
8859
8906
|
props: { message: {} },
|
|
8860
8907
|
setup(e) {
|
|
@@ -8870,7 +8917,7 @@ var tf = { class: "w-full" }, nf = {
|
|
|
8870
8917
|
function l() {
|
|
8871
8918
|
return t.message.senderName?.trim() || (t.message.isOwn ? s("you") : s("system"));
|
|
8872
8919
|
}
|
|
8873
|
-
return (t, n) => (S(), a("div",
|
|
8920
|
+
return (t, n) => (S(), a("div", cp, [o("span", lp, k(l()), 1), e.message.scheduled?.scheduleDate ? (S(), r(j(se), {
|
|
8874
8921
|
key: 0,
|
|
8875
8922
|
text: j(s)("scheduledDateLabel", { date: c(e.message.scheduled.scheduleDate) }),
|
|
8876
8923
|
context: "warn",
|
|
@@ -8879,7 +8926,7 @@ var tf = { class: "w-full" }, nf = {
|
|
|
8879
8926
|
class: "shrink-0"
|
|
8880
8927
|
}, null, 8, ["text"])) : i("", !0)]));
|
|
8881
8928
|
}
|
|
8882
|
-
}),
|
|
8929
|
+
}), dp = ["disabled", "onClick"], fp = /* @__PURE__ */ sd(/* @__PURE__ */ u({
|
|
8883
8930
|
__name: "MessageReactionList",
|
|
8884
8931
|
props: {
|
|
8885
8932
|
message: {},
|
|
@@ -8898,9 +8945,9 @@ var tf = { class: "w-full" }, nf = {
|
|
|
8898
8945
|
class: g(["message-reaction-list__item rounded-full px-2 py-0.75 leading-none transition", e.reactedByMe ? "reaction-chip-selected" : t.message.isOwn ? "reaction-chip-own" : "reaction-chip-other"]),
|
|
8899
8946
|
disabled: t.disabled,
|
|
8900
8947
|
onClick: (t) => r("toggle", e.emoji)
|
|
8901
|
-
}, k(e.emoji) + " " + k(e.count), 11,
|
|
8948
|
+
}, k(e.emoji) + " " + k(e.count), 11, dp))), 128))], 2)) : i("", !0);
|
|
8902
8949
|
}
|
|
8903
|
-
}), [["__scopeId", "data-v-c17c8bfd"]]),
|
|
8950
|
+
}), [["__scopeId", "data-v-c17c8bfd"]]), pp = { class: "message-reactions flex min-w-0 flex-1 flex-wrap items-center gap-1.5" }, mp = ["aria-label", "title"], hp = { class: "message-reactions__thread-count" }, gp = /* @__PURE__ */ u({
|
|
8904
8951
|
__name: "MessageItemReactions",
|
|
8905
8952
|
props: {
|
|
8906
8953
|
message: {},
|
|
@@ -8910,7 +8957,7 @@ var tf = { class: "w-full" }, nf = {
|
|
|
8910
8957
|
emits: ["toggleReaction", "openThread"],
|
|
8911
8958
|
setup(e, { emit: t }) {
|
|
8912
8959
|
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);
|
|
8913
|
-
return (t, n) => (S(), a("div",
|
|
8960
|
+
return (t, n) => (S(), a("div", pp, [l(fp, {
|
|
8914
8961
|
message: e.message,
|
|
8915
8962
|
disabled: e.canReact === !1,
|
|
8916
8963
|
compact: "",
|
|
@@ -8921,16 +8968,16 @@ var tf = { class: "w-full" }, nf = {
|
|
|
8921
8968
|
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",
|
|
8922
8969
|
"aria-label": d.value,
|
|
8923
8970
|
title: d.value,
|
|
8924
|
-
onClick: n[1] ||=
|
|
8971
|
+
onClick: n[1] ||= I((e) => c("openThread"), ["stop"])
|
|
8925
8972
|
}, [(S(), r(D(j(zu)), {
|
|
8926
8973
|
class: "size-4",
|
|
8927
8974
|
"aria-hidden": "true"
|
|
8928
|
-
})), o("span",
|
|
8975
|
+
})), o("span", hp, k(e.message.replyCount), 1)], 8, mp)) : i("", !0)]));
|
|
8929
8976
|
}
|
|
8930
|
-
}),
|
|
8977
|
+
}), _p = {
|
|
8931
8978
|
key: 0,
|
|
8932
8979
|
class: ""
|
|
8933
|
-
},
|
|
8980
|
+
}, vp = { class: "text-heading-sm text-default" }, yp = { class: "body-sm text-subtle" }, bp = { class: "space-y-2 py-3" }, xp = ["disabled", "onClick"], Sp = { class: "body-md flex items-center justify-between gap-3 px-3 py-1.5" }, Cp = { class: "body-sm text-subtle shrink-0" }, wp = { class: "bg-alpha-default h-1.5" }, Tp = /* @__PURE__ */ u({
|
|
8934
8981
|
__name: "MessagePollContent",
|
|
8935
8982
|
props: {
|
|
8936
8983
|
message: {},
|
|
@@ -8949,18 +8996,18 @@ var tf = { class: "w-full" }, nf = {
|
|
|
8949
8996
|
let t = r.currentUserId;
|
|
8950
8997
|
return !!(!t || r.pendingOptionKey === `${r.message.id}:${e}` || r.message.poll.options.some((n) => n.id === e && n.voters.includes(t)));
|
|
8951
8998
|
}
|
|
8952
|
-
return (n, r) => t.message.poll ? (S(), a("div",
|
|
8999
|
+
return (n, r) => t.message.poll ? (S(), a("div", _p, [o("div", null, [o("h4", vp, k(t.message.poll.question), 1), o("p", yp, k(j(c)("voteCount", { count: t.message.poll.totalVotes })), 1)]), o("div", bp, [(S(!0), a(e, null, T(t.message.poll.options, (e) => (S(), a("button", {
|
|
8953
9000
|
key: e.id,
|
|
8954
9001
|
type: "button",
|
|
8955
9002
|
class: "shadow-raised bg-elevation-surface-raised-default block w-full overflow-hidden rounded-lg text-left",
|
|
8956
9003
|
disabled: u(e.id),
|
|
8957
9004
|
onClick: (t) => s("vote", e.id)
|
|
8958
|
-
}, [o("div",
|
|
9005
|
+
}, [o("div", Sp, [o("span", { class: g(["truncate font-medium", l(e.id) ? "text-success" : ""]) }, k(e.text), 3), o("span", Cp, k(j(c)("voteCount", { count: e.voteCount })), 1)]), o("div", wp, [o("div", {
|
|
8959
9006
|
class: g(["h-full transition-all", l(e.id) ? "bg-accent-green-subtle-default" : "bg-accent-teal-subtle-default"]),
|
|
8960
9007
|
style: v({ width: `${t.message.poll.totalVotes ? e.voteCount / t.message.poll.totalVotes * 100 : 0}%` })
|
|
8961
|
-
}, null, 6)])], 8,
|
|
9008
|
+
}, null, 6)])], 8, xp))), 128))])])) : i("", !0);
|
|
8962
9009
|
}
|
|
8963
|
-
}),
|
|
9010
|
+
}), Ep = { class: "reply-quote__sender" }, Dp = { class: "reply-quote__text" }, Op = /* @__PURE__ */ sd(/* @__PURE__ */ u({
|
|
8964
9011
|
__name: "MessageReplyQuote",
|
|
8965
9012
|
props: { message: {} },
|
|
8966
9013
|
emits: ["open"],
|
|
@@ -8970,15 +9017,15 @@ var tf = { class: "w-full" }, nf = {
|
|
|
8970
9017
|
type: "button",
|
|
8971
9018
|
class: g(["reply-quote", e.message.isOwn ? "message-surface-subtle-own" : "message-surface-subtle-other"]),
|
|
8972
9019
|
onClick: n[0] ||= (e) => c("open")
|
|
8973
|
-
}, [o("p",
|
|
9020
|
+
}, [o("p", Ep, k(e.message.replyTo.senderName), 1), o("p", Dp, k(s.value), 1)], 2));
|
|
8974
9021
|
}
|
|
8975
|
-
}), [["__scopeId", "data-v-2a027d02"]]),
|
|
9022
|
+
}), [["__scopeId", "data-v-2a027d02"]]), kp = { class: "space-y-2" }, Ap = /* @__PURE__ */ u({
|
|
8976
9023
|
__name: "MessageTextContent",
|
|
8977
9024
|
props: { message: {} },
|
|
8978
9025
|
emits: ["anchorclick"],
|
|
8979
9026
|
setup(e) {
|
|
8980
9027
|
let t = Kl(), o = n(() => t.mentionNameByUid.value);
|
|
8981
|
-
return (t, n) => (S(), a("div",
|
|
9028
|
+
return (t, n) => (S(), a("div", kp, [e.message.translatedText ? (S(), r(Bf, {
|
|
8982
9029
|
key: 0,
|
|
8983
9030
|
text: e.message.translatedText,
|
|
8984
9031
|
"mention-name-by-uid": o.value,
|
|
@@ -8992,7 +9039,7 @@ var tf = { class: "w-full" }, nf = {
|
|
|
8992
9039
|
"mention-name-by-uid",
|
|
8993
9040
|
"is-own",
|
|
8994
9041
|
"class"
|
|
8995
|
-
])) : i("", !0), l(
|
|
9042
|
+
])) : i("", !0), l(Bf, {
|
|
8996
9043
|
text: e.message.text,
|
|
8997
9044
|
"mention-name-by-uid": o.value,
|
|
8998
9045
|
"is-own": e.message.isOwn,
|
|
@@ -9004,11 +9051,11 @@ var tf = { class: "w-full" }, nf = {
|
|
|
9004
9051
|
"is-own"
|
|
9005
9052
|
])]));
|
|
9006
9053
|
}
|
|
9007
|
-
}),
|
|
9054
|
+
}), jp = [
|
|
9008
9055
|
"id",
|
|
9009
9056
|
"data-message-id",
|
|
9010
9057
|
"data-message-kind"
|
|
9011
|
-
],
|
|
9058
|
+
], Mp = { class: "message-item__footer body-sm text-subtlest mt-0.5 flex items-end justify-between gap-2" }, Np = /* @__PURE__ */ sd(/* @__PURE__ */ u({
|
|
9012
9059
|
__name: "MessageItem",
|
|
9013
9060
|
props: {
|
|
9014
9061
|
message: {},
|
|
@@ -9050,11 +9097,11 @@ var tf = { class: "w-full" }, nf = {
|
|
|
9050
9097
|
"data-message-id": t.message.id,
|
|
9051
9098
|
"data-message-kind": t.message.kind,
|
|
9052
9099
|
class: g(["message-item group", d.value])
|
|
9053
|
-
}, [t.message.kind === "action" ? (S(), r(
|
|
9100
|
+
}, [t.message.kind === "action" ? (S(), r(Of, {
|
|
9054
9101
|
key: 0,
|
|
9055
9102
|
text: t.message.text,
|
|
9056
9103
|
class: g(f.value)
|
|
9057
|
-
}, null, 8, ["text", "class"])) : (S(), a(e, { key: 1 }, [t.canShowSenderAvatar && !t.message.isOwn ? (S(), r(j(
|
|
9104
|
+
}, null, 8, ["text", "class"])) : (S(), a(e, { key: 1 }, [t.canShowSenderAvatar && !t.message.isOwn ? (S(), r(j(L), {
|
|
9058
9105
|
key: 0,
|
|
9059
9106
|
image: t.message.senderAvatar,
|
|
9060
9107
|
label: t.message.senderAvatar ? void 0 : t.message.senderName.slice(0, 1).toUpperCase(),
|
|
@@ -9066,16 +9113,16 @@ var tf = { class: "w-full" }, nf = {
|
|
|
9066
9113
|
onContextmenu: m,
|
|
9067
9114
|
onClick: h
|
|
9068
9115
|
}, [
|
|
9069
|
-
!t.message.isOwn || t.message.scheduled?.scheduleDate ? (S(), r(
|
|
9116
|
+
!t.message.isOwn || t.message.scheduled?.scheduleDate ? (S(), r(up, {
|
|
9070
9117
|
key: 0,
|
|
9071
9118
|
message: t.message
|
|
9072
9119
|
}, null, 8, ["message"])) : i("", !0),
|
|
9073
|
-
t.message.replyTo ? (S(), r(
|
|
9120
|
+
t.message.replyTo ? (S(), r(Op, {
|
|
9074
9121
|
key: 1,
|
|
9075
9122
|
message: t.message,
|
|
9076
9123
|
onOpen: _
|
|
9077
9124
|
}, null, 8, ["message"])) : i("", !0),
|
|
9078
|
-
t.message.kind === "poll" && t.message.poll ? (S(), r(
|
|
9125
|
+
t.message.kind === "poll" && t.message.poll ? (S(), r(Tp, {
|
|
9079
9126
|
key: 2,
|
|
9080
9127
|
message: t.message,
|
|
9081
9128
|
"current-user-id": t.currentUserId,
|
|
@@ -9085,16 +9132,16 @@ var tf = { class: "w-full" }, nf = {
|
|
|
9085
9132
|
"message",
|
|
9086
9133
|
"current-user-id",
|
|
9087
9134
|
"pending-option-key"
|
|
9088
|
-
])) : t.message.attachments?.length ? (S(), r(
|
|
9135
|
+
])) : t.message.attachments?.length ? (S(), r(ip, {
|
|
9089
9136
|
key: 3,
|
|
9090
9137
|
message: t.message,
|
|
9091
9138
|
onOpenMedia: s[1] ||= (e) => u("openMedia", e)
|
|
9092
|
-
}, null, 8, ["message"])) : (S(), r(
|
|
9139
|
+
}, null, 8, ["message"])) : (S(), r(Ap, {
|
|
9093
9140
|
key: 4,
|
|
9094
9141
|
message: t.message,
|
|
9095
9142
|
onAnchorclick: s[2] ||= (e, t) => n.$emit("anchorclick", e, t)
|
|
9096
9143
|
}, null, 8, ["message"])),
|
|
9097
|
-
o("div",
|
|
9144
|
+
o("div", Mp, [l(gp, {
|
|
9098
9145
|
message: t.message,
|
|
9099
9146
|
"can-react": t.canReact,
|
|
9100
9147
|
"can-open-thread": t.canOpenThread,
|
|
@@ -9104,20 +9151,20 @@ var tf = { class: "w-full" }, nf = {
|
|
|
9104
9151
|
"message",
|
|
9105
9152
|
"can-react",
|
|
9106
9153
|
"can-open-thread"
|
|
9107
|
-
]), l(
|
|
9108
|
-
], 34)], 64))], 10,
|
|
9154
|
+
]), l(sp, { message: t.message }, null, 8, ["message"])])
|
|
9155
|
+
], 34)], 64))], 10, jp));
|
|
9109
9156
|
}
|
|
9110
|
-
}), [["__scopeId", "data-v-cb4a4183"]]),
|
|
9157
|
+
}), [["__scopeId", "data-v-cb4a4183"]]), Pp = [
|
|
9111
9158
|
"👍",
|
|
9112
9159
|
"❤️",
|
|
9113
9160
|
"🔥",
|
|
9114
9161
|
"😂",
|
|
9115
9162
|
"🙏",
|
|
9116
9163
|
"🎉"
|
|
9117
|
-
],
|
|
9164
|
+
], Fp = /* @__PURE__ */ "👏.😍.🤯.😮.😢.😡.👀.✅.💯.🙌.🤝.👌.💪.🤔.🫶.😅.🥳.💛.🌟.🚀.💥.🎯.📌.💡.🕊️.☀️.🌈.🍀.🎶.🫡".split("."), Ip = { class: "message-reaction-pill" }, Lp = ["disabled", "onClick"], Rp = ["disabled"], zp = {
|
|
9118
9165
|
key: 0,
|
|
9119
9166
|
class: "message-expanded-reactions"
|
|
9120
|
-
},
|
|
9167
|
+
}, Bp = ["onClick"], Vp = /* @__PURE__ */ sd(/* @__PURE__ */ u({
|
|
9121
9168
|
__name: "MessageItemMenuReactions",
|
|
9122
9169
|
props: {
|
|
9123
9170
|
message: {},
|
|
@@ -9126,23 +9173,23 @@ var tf = { class: "w-full" }, nf = {
|
|
|
9126
9173
|
emits: ["react"],
|
|
9127
9174
|
setup(t, { emit: s }) {
|
|
9128
9175
|
let c = t, l = s, u = w(!1);
|
|
9129
|
-
|
|
9176
|
+
P(() => c.message.id, () => {
|
|
9130
9177
|
u.value = !1;
|
|
9131
9178
|
});
|
|
9132
|
-
let d = n(() =>
|
|
9179
|
+
let d = n(() => Fp);
|
|
9133
9180
|
function f(e) {
|
|
9134
9181
|
return (c.message.reactions ?? []).some((t) => t.emoji === e);
|
|
9135
9182
|
}
|
|
9136
9183
|
function p() {
|
|
9137
9184
|
c.canReact && (u.value = !u.value);
|
|
9138
9185
|
}
|
|
9139
|
-
return (n, s) => (S(), a(e, null, [o("div",
|
|
9186
|
+
return (n, s) => (S(), a(e, null, [o("div", Ip, [(S(!0), a(e, null, T(j(Pp), (e) => (S(), a("button", {
|
|
9140
9187
|
key: `${t.message.id}-${e}-common`,
|
|
9141
9188
|
type: "button",
|
|
9142
9189
|
class: g(["message-reaction-button", f(e) ? "message-reaction-button-active" : "message-reaction-button-idle"]),
|
|
9143
9190
|
disabled: !t.canReact,
|
|
9144
9191
|
onClick: (t) => l("react", e)
|
|
9145
|
-
}, k(e), 11,
|
|
9192
|
+
}, k(e), 11, Lp))), 128)), o("button", {
|
|
9146
9193
|
type: "button",
|
|
9147
9194
|
class: "message-reaction-more",
|
|
9148
9195
|
disabled: !t.canReact,
|
|
@@ -9150,14 +9197,14 @@ var tf = { class: "w-full" }, nf = {
|
|
|
9150
9197
|
}, [(S(), r(D(u.value ? j(Fu) : j(Pu)), {
|
|
9151
9198
|
class: "size-7",
|
|
9152
9199
|
"aria-hidden": "true"
|
|
9153
|
-
}))], 8,
|
|
9200
|
+
}))], 8, Rp)]), u.value && t.canReact ? (S(), a("div", zp, [(S(!0), a(e, null, T(d.value, (e) => (S(), a("button", {
|
|
9154
9201
|
key: `${t.message.id}-${e}-extended`,
|
|
9155
9202
|
type: "button",
|
|
9156
9203
|
class: g(["message-expanded-reaction-button", f(e) ? "message-reaction-button-active" : "message-reaction-button-idle"]),
|
|
9157
9204
|
onClick: (t) => l("react", e)
|
|
9158
|
-
}, k(e), 11,
|
|
9205
|
+
}, k(e), 11, Bp))), 128))])) : i("", !0)], 64));
|
|
9159
9206
|
}
|
|
9160
|
-
}), [["__scopeId", "data-v-696fe834"]]),
|
|
9207
|
+
}), [["__scopeId", "data-v-696fe834"]]), Hp = /* @__PURE__ */ sd(/* @__PURE__ */ u({
|
|
9161
9208
|
__name: "MessageItemMenu",
|
|
9162
9209
|
props: {
|
|
9163
9210
|
message: {},
|
|
@@ -9221,19 +9268,19 @@ var tf = { class: "w-full" }, nf = {
|
|
|
9221
9268
|
top: `${d.value.top}px`
|
|
9222
9269
|
}),
|
|
9223
9270
|
"data-testid": "message-action-popover-shell"
|
|
9224
|
-
}, [l(
|
|
9271
|
+
}, [l(Vp, {
|
|
9225
9272
|
message: e.message,
|
|
9226
9273
|
"can-react": e.canReact,
|
|
9227
9274
|
onReact: o[0] ||= (e) => s("react", e)
|
|
9228
|
-
}, null, 8, ["message", "can-react"]), l(j(
|
|
9275
|
+
}, null, 8, ["message", "can-react"]), l(j(B), { model: e.actionItems }, null, 8, ["model"])], 4)) : i("", !0)]));
|
|
9229
9276
|
}
|
|
9230
|
-
}), [["__scopeId", "data-v-54f6bf5c"]]),
|
|
9277
|
+
}), [["__scopeId", "data-v-54f6bf5c"]]), Up = { 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" }, Wp = {
|
|
9231
9278
|
key: 0,
|
|
9232
9279
|
class: "chat-header__identity flex min-w-0 items-center gap-3"
|
|
9233
|
-
},
|
|
9280
|
+
}, Gp = { class: "chat-header__text min-w-0" }, Kp = { class: "chat-header__title heading-md text-default sm:heading-lg truncate" }, qp = { class: "chat-header__subtitle body-sm text-subtle sm:body-md truncate" }, Jp = { key: 0 }, Yp = { key: 1 }, Xp = { class: "chat-header__actions flex items-center gap-2" }, Zp = {
|
|
9234
9281
|
key: 0,
|
|
9235
9282
|
class: "chat-header__tags hidden flex-wrap gap-2 md:flex"
|
|
9236
|
-
},
|
|
9283
|
+
}, Qp = /* @__PURE__ */ u({
|
|
9237
9284
|
__name: "MessageListHeader",
|
|
9238
9285
|
props: {
|
|
9239
9286
|
conversation: {},
|
|
@@ -9241,28 +9288,28 @@ var tf = { class: "w-full" }, nf = {
|
|
|
9241
9288
|
},
|
|
9242
9289
|
setup(t) {
|
|
9243
9290
|
let { t: n } = K();
|
|
9244
|
-
return (s, c) => (S(), a("header",
|
|
9291
|
+
return (s, c) => (S(), a("header", Up, [t.conversation ? (S(), a("div", Wp, [l(j(L), {
|
|
9245
9292
|
image: t.conversation.avatar,
|
|
9246
9293
|
label: t.conversation.avatar ? void 0 : t.conversation.title.slice(0, 1).toUpperCase(),
|
|
9247
9294
|
shape: "circle",
|
|
9248
9295
|
class: "chat-header__avatar shrink-0"
|
|
9249
|
-
}, null, 8, ["image", "label"]), o("div",
|
|
9296
|
+
}, null, 8, ["image", "label"]), o("div", Gp, [o("p", Kp, k(t.parentMessage ? j(n)("thread") : t.conversation.title), 1), o("p", qp, [t.parentMessage ? (S(), a("span", Jp, k(t.parentMessage.senderName), 1)) : (S(), a("span", Yp, k(t.conversation.memberCount ? j(n)("members", { count: t.conversation.memberCount }) : j(n)("groupChat")), 1))])])])) : i("", !0), o("div", Xp, [t.conversation?.tags?.length ? (S(), a("div", Zp, [(S(!0), a(e, null, T(t.conversation.tags.slice(0, 3), (e) => (S(), r(j(se), {
|
|
9250
9297
|
key: e,
|
|
9251
9298
|
text: e,
|
|
9252
9299
|
context: "secondary",
|
|
9253
9300
|
rounded: ""
|
|
9254
9301
|
}, null, 8, ["text"]))), 128))])) : i("", !0)])]));
|
|
9255
9302
|
}
|
|
9256
|
-
}),
|
|
9303
|
+
}), $p = {
|
|
9257
9304
|
key: 1,
|
|
9258
9305
|
class: "message-list__empty-state"
|
|
9259
|
-
},
|
|
9306
|
+
}, em = { class: "space-y-2" }, tm = {
|
|
9260
9307
|
key: 0,
|
|
9261
9308
|
class: "message-list__thread-root"
|
|
9262
|
-
},
|
|
9309
|
+
}, nm = { class: "body-sm text-subtlest truncate font-semibold uppercase" }, rm = { class: "body-md text-default mt-1 line-clamp-2" }, im = {
|
|
9263
9310
|
key: 1,
|
|
9264
9311
|
class: "surface-default text-subtle rounded-2xl p-5 text-center"
|
|
9265
|
-
},
|
|
9312
|
+
}, am = /* @__PURE__ */ sd(/* @__PURE__ */ u({
|
|
9266
9313
|
__name: "MessageList",
|
|
9267
9314
|
props: {
|
|
9268
9315
|
target: {},
|
|
@@ -9279,7 +9326,7 @@ var tf = { class: "w-full" }, nf = {
|
|
|
9279
9326
|
}), O = n(() => {
|
|
9280
9327
|
let e = u.conversation.value;
|
|
9281
9328
|
return e ? _.value ? _.value.senderName : e.memberCount ? c("members", { count: e.memberCount }) : c("groupChat") : "";
|
|
9282
|
-
}), A = n(() => u.conversation.value?.memberCount ?? 0),
|
|
9329
|
+
}), A = n(() => u.conversation.value?.memberCount ?? 0), ee = w(null), M = w(null), N = n(() => !!_.value), P = n(() => N.value && !y.value), F = n(() => Vl(u.conversation.value)), ne = te("threadRef"), { handleThreadScroll: I } = tf({
|
|
9283
9330
|
getConversation: () => u.conversation.value,
|
|
9284
9331
|
getParentMessage: () => _.value,
|
|
9285
9332
|
getMessages: () => m.value,
|
|
@@ -9287,14 +9334,14 @@ var tf = { class: "w-full" }, nf = {
|
|
|
9287
9334
|
isLoadingOlder: () => x.value,
|
|
9288
9335
|
canLoadOlder: () => b.value,
|
|
9289
9336
|
onLoadOlder: () => f.emit("list:loadOlder", { target: s.target }),
|
|
9290
|
-
threadRef:
|
|
9291
|
-
}),
|
|
9337
|
+
threadRef: ne
|
|
9338
|
+
}), L = te("actionMenuRef"), { activeActionMessage: R, handleMessageContextMenu: re, handleMessageTap: z, resetActionMenuState: ie, reactToMessage: ae, toggleInlineReaction: B, getActionItems: oe } = Yd({
|
|
9292
9339
|
canUseMessageActions: () => u.canUseMessageActions.value,
|
|
9293
9340
|
canReact: () => u.canReact.value,
|
|
9294
9341
|
canReply: () => u.canReply.value,
|
|
9295
9342
|
canOpenThread: () => v.value,
|
|
9296
9343
|
isInThread: () => p.value,
|
|
9297
|
-
actionMenuRef:
|
|
9344
|
+
actionMenuRef: L,
|
|
9298
9345
|
t: c,
|
|
9299
9346
|
emit: {
|
|
9300
9347
|
reply: (e) => f.emit("message:reply", e),
|
|
@@ -9310,21 +9357,21 @@ var tf = { class: "w-full" }, nf = {
|
|
|
9310
9357
|
},
|
|
9311
9358
|
onMenuOpen: () => f.emit("ui:closeComposerActions")
|
|
9312
9359
|
});
|
|
9313
|
-
function
|
|
9360
|
+
function V(e) {
|
|
9314
9361
|
return !!e.url && [
|
|
9315
9362
|
"image",
|
|
9316
9363
|
"video",
|
|
9317
9364
|
"audio"
|
|
9318
9365
|
].includes(e.kind);
|
|
9319
9366
|
}
|
|
9320
|
-
function
|
|
9321
|
-
|
|
9367
|
+
function se(e) {
|
|
9368
|
+
V(e) && (ee.value = e);
|
|
9322
9369
|
}
|
|
9323
|
-
function
|
|
9324
|
-
|
|
9370
|
+
function H() {
|
|
9371
|
+
ee.value = null;
|
|
9325
9372
|
}
|
|
9326
|
-
async function
|
|
9327
|
-
|
|
9373
|
+
async function ce(e, t) {
|
|
9374
|
+
M.value = `${e.id}:${t}`;
|
|
9328
9375
|
try {
|
|
9329
9376
|
f.emit("message:votePoll", {
|
|
9330
9377
|
message: e,
|
|
@@ -9332,22 +9379,22 @@ var tf = { class: "w-full" }, nf = {
|
|
|
9332
9379
|
});
|
|
9333
9380
|
} finally {
|
|
9334
9381
|
window.setTimeout(() => {
|
|
9335
|
-
|
|
9382
|
+
M.value === `${e.id}:${t}` && (M.value = null);
|
|
9336
9383
|
}, 300);
|
|
9337
9384
|
}
|
|
9338
9385
|
}
|
|
9339
|
-
function
|
|
9386
|
+
function le(e) {
|
|
9340
9387
|
v.value && f.emit("message:openThread", e);
|
|
9341
9388
|
}
|
|
9342
|
-
function
|
|
9389
|
+
function ue(e, t) {
|
|
9343
9390
|
return e.getFullYear() !== t.getFullYear() || e.getMonth() !== t.getMonth() || e.getDate() !== t.getDate();
|
|
9344
9391
|
}
|
|
9345
|
-
function
|
|
9392
|
+
function de(e) {
|
|
9346
9393
|
let t = m.value;
|
|
9347
|
-
return e === 0 ? !0 :
|
|
9394
|
+
return e === 0 ? !0 : ue(t[e].sentAt, t[e - 1].sentAt);
|
|
9348
9395
|
}
|
|
9349
9396
|
return (t, n) => (S(), a(e, null, [
|
|
9350
|
-
o("section", { class: g(["message-list-root", [t.$attrs.class,
|
|
9397
|
+
o("section", { class: g(["message-list-root", [t.$attrs.class, P.value ? "message-list--embedded-thread" : N.value ? "message-list--thread" : "message-list--main"]]) }, [y.value ? E(t.$slots, "header", {
|
|
9351
9398
|
key: 0,
|
|
9352
9399
|
conversation: j(u).conversation.value,
|
|
9353
9400
|
parentMessage: _.value,
|
|
@@ -9355,37 +9402,37 @@ var tf = { class: "w-full" }, nf = {
|
|
|
9355
9402
|
title: D.value,
|
|
9356
9403
|
subtitle: O.value,
|
|
9357
9404
|
memberCount: A.value
|
|
9358
|
-
}, () => [l(
|
|
9405
|
+
}, () => [l(Qp, {
|
|
9359
9406
|
conversation: j(u).conversation.value,
|
|
9360
9407
|
"parent-message": _.value
|
|
9361
9408
|
}, null, 8, ["conversation", "parent-message"])], !0) : i("", !0), j(u).conversation.value ? (S(), a("div", {
|
|
9362
9409
|
key: 2,
|
|
9363
|
-
class: g(["message-list__body",
|
|
9410
|
+
class: g(["message-list__body", P.value || N.value ? "bg-elevation-surface-overlay" : ""])
|
|
9364
9411
|
}, [o("div", {
|
|
9365
9412
|
ref_key: "threadRef",
|
|
9366
|
-
ref:
|
|
9367
|
-
class: g(["message-list__scroll min-h-0 flex-1",
|
|
9368
|
-
onScroll: n[2] ||= (...e) => j(
|
|
9369
|
-
}, [o("div",
|
|
9370
|
-
_.value ? (S(), a("div",
|
|
9371
|
-
(S(!0), a(e, null, T(m.value, (o, c) => (S(), a(e, { key: o.id }, [
|
|
9413
|
+
ref: ne,
|
|
9414
|
+
class: g(["message-list__scroll min-h-0 flex-1", P.value ? "p-0" : N.value ? "px-5 py-4" : "px-2 pt-2 pb-3"]),
|
|
9415
|
+
onScroll: n[2] ||= (...e) => j(I) && j(I)(...e)
|
|
9416
|
+
}, [o("div", em, [
|
|
9417
|
+
_.value ? (S(), a("div", tm, [o("p", nm, k(_.value.senderName), 1), o("p", rm, k(j(ds)(_.value, j(c)("message"), j(u).mentionNameByUid.value)), 1)])) : i("", !0),
|
|
9418
|
+
(S(!0), a(e, null, T(m.value, (o, c) => (S(), a(e, { key: o.id }, [de(c) ? (S(), r(Tf, {
|
|
9372
9419
|
key: 0,
|
|
9373
9420
|
date: o.sentAt
|
|
9374
|
-
}, null, 8, ["date"])) : i("", !0), l(
|
|
9421
|
+
}, null, 8, ["date"])) : i("", !0), l(Np, {
|
|
9375
9422
|
message: o,
|
|
9376
9423
|
"current-user-id": j(u).currentUserId.value,
|
|
9377
9424
|
"can-react": j(u).canReact.value,
|
|
9378
9425
|
"can-open-thread": !_.value && v.value,
|
|
9379
|
-
"can-show-sender-avatar":
|
|
9380
|
-
"pending-option-key":
|
|
9426
|
+
"can-show-sender-avatar": F.value,
|
|
9427
|
+
"pending-option-key": M.value,
|
|
9381
9428
|
"action-message-class": s.actionMessageClass,
|
|
9382
9429
|
"action-message-row-class": s.actionMessageRowClass,
|
|
9383
|
-
onContextmenu: (e) => j(
|
|
9384
|
-
onTap: (e) => j(
|
|
9385
|
-
onOpenMedia:
|
|
9386
|
-
onVotePoll: (e) =>
|
|
9387
|
-
onToggleReaction: (e) => j(
|
|
9388
|
-
onOpenThread: (e) =>
|
|
9430
|
+
onContextmenu: (e) => j(re)(o, e),
|
|
9431
|
+
onTap: (e) => j(z)(o, e),
|
|
9432
|
+
onOpenMedia: se,
|
|
9433
|
+
onVotePoll: (e) => ce(o, e),
|
|
9434
|
+
onToggleReaction: (e) => j(B)(o, e),
|
|
9435
|
+
onOpenThread: (e) => le(o),
|
|
9389
9436
|
onOpenReferencedMessage: n[0] ||= (e) => j(f).emit("message:openReference", e),
|
|
9390
9437
|
onAnchorclick: n[1] ||= (e, n) => t.$emit("anchorclick", e, n)
|
|
9391
9438
|
}, null, 8, [
|
|
@@ -9403,20 +9450,20 @@ var tf = { class: "w-full" }, nf = {
|
|
|
9403
9450
|
"onToggleReaction",
|
|
9404
9451
|
"onOpenThread"
|
|
9405
9452
|
])], 64))), 128)),
|
|
9406
|
-
m.value.length === 0 && C.value && !h.value ? (S(), a("div",
|
|
9407
|
-
])], 34), o("footer", { class: g(["message-list__composer flex shrink-0 flex-col",
|
|
9408
|
-
l(
|
|
9409
|
-
attachment:
|
|
9410
|
-
onClose:
|
|
9453
|
+
m.value.length === 0 && C.value && !h.value ? (S(), a("div", im, k(j(c)("noMessagesYetInThisGroup")), 1)) : i("", !0)
|
|
9454
|
+
])], 34), o("footer", { class: g(["message-list__composer flex shrink-0 flex-col", N.value ? P.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", $p, k(j(c)("selectConversationToStart")), 1))], 2),
|
|
9455
|
+
l(Sf, {
|
|
9456
|
+
attachment: ee.value,
|
|
9457
|
+
onClose: H
|
|
9411
9458
|
}, null, 8, ["attachment"]),
|
|
9412
|
-
l(
|
|
9459
|
+
l(Hp, {
|
|
9413
9460
|
ref_key: "actionMenuRef",
|
|
9414
|
-
ref:
|
|
9415
|
-
message: j(
|
|
9461
|
+
ref: L,
|
|
9462
|
+
message: j(R),
|
|
9416
9463
|
"can-react": j(u).canReact.value,
|
|
9417
|
-
"action-items": j(
|
|
9418
|
-
onHide: j(
|
|
9419
|
-
onReact: n[3] ||= (e) => j(
|
|
9464
|
+
"action-items": j(R) ? j(oe)(j(R)) : [],
|
|
9465
|
+
onHide: j(ie),
|
|
9466
|
+
onReact: n[3] ||= (e) => j(ae)(j(R), e)
|
|
9420
9467
|
}, null, 8, [
|
|
9421
9468
|
"message",
|
|
9422
9469
|
"can-react",
|
|
@@ -9425,13 +9472,13 @@ var tf = { class: "w-full" }, nf = {
|
|
|
9425
9472
|
])
|
|
9426
9473
|
], 64));
|
|
9427
9474
|
}
|
|
9428
|
-
}), [["__scopeId", "data-v-bea26e53"]]),
|
|
9475
|
+
}), [["__scopeId", "data-v-bea26e53"]]), om = { class: "receipt-section" }, sm = { class: "receipt-section__header" }, cm = { class: "text-heading-sm text-default" }, lm = { class: "body-sm text-subtlest" }, um = {
|
|
9429
9476
|
key: 0,
|
|
9430
9477
|
class: "space-y-2"
|
|
9431
|
-
},
|
|
9478
|
+
}, dm = { class: "flex min-w-0 items-center gap-3" }, fm = { class: "min-w-0" }, pm = { class: "heading-sm text-default truncate" }, mm = { class: "body-sm text-subtle truncate" }, hm = { class: "body-sm text-subtle shrink-0" }, gm = {
|
|
9432
9479
|
key: 1,
|
|
9433
9480
|
class: "receipt-section__empty"
|
|
9434
|
-
},
|
|
9481
|
+
}, _m = /* @__PURE__ */ sd(/* @__PURE__ */ u({
|
|
9435
9482
|
__name: "ReceiptSection",
|
|
9436
9483
|
props: {
|
|
9437
9484
|
title: {},
|
|
@@ -9440,29 +9487,29 @@ var tf = { class: "w-full" }, nf = {
|
|
|
9440
9487
|
formatDateTime: { type: Function }
|
|
9441
9488
|
},
|
|
9442
9489
|
setup(t) {
|
|
9443
|
-
return (n, r) => (S(), a("section",
|
|
9490
|
+
return (n, r) => (S(), a("section", om, [o("div", sm, [o("p", cm, k(t.title), 1), o("span", lm, k(t.receipts.length), 1)]), t.receipts.length ? (S(), a("div", um, [(S(!0), a(e, null, T(t.receipts, (e) => (S(), a("div", {
|
|
9444
9491
|
key: `${e.kind}-${e.user.uid}`,
|
|
9445
9492
|
class: "receipt-section__row"
|
|
9446
|
-
}, [o("div",
|
|
9493
|
+
}, [o("div", dm, [l(j(L), {
|
|
9447
9494
|
image: e.user.avatar,
|
|
9448
9495
|
label: e.user.avatar ? void 0 : e.user.name.slice(0, 1).toUpperCase(),
|
|
9449
9496
|
shape: "circle",
|
|
9450
9497
|
class: "shrink-0"
|
|
9451
|
-
}, null, 8, ["image", "label"]), o("div",
|
|
9498
|
+
}, null, 8, ["image", "label"]), o("div", fm, [o("p", pm, k(e.user.name), 1), o("p", mm, k(e.user.uid), 1)])]), o("p", hm, k(t.formatDateTime(e.timestamp)), 1)]))), 128))])) : (S(), a("div", gm, k(t.emptyLabel), 1))]));
|
|
9452
9499
|
}
|
|
9453
|
-
}), [["__scopeId", "data-v-6f48d0c4"]]),
|
|
9500
|
+
}), [["__scopeId", "data-v-6f48d0c4"]]), vm = {
|
|
9454
9501
|
key: 0,
|
|
9455
9502
|
class: "message-info-dialog-content space-y-5 overflow-y-auto"
|
|
9456
|
-
},
|
|
9503
|
+
}, ym = { class: "message-info-summary px-4 py-4 sm:px-6 sm:py-5" }, bm = { class: "body-md text-default wrap-break-word whitespace-pre-wrap" }, xm = { class: "mt-4 grid gap-3 sm:grid-cols-3" }, Sm = { class: "message-info-metric px-3 py-3" }, Cm = { class: "body-sm text-subtlest font-semibold uppercase" }, wm = { class: "heading-sm text-default mt-1" }, Tm = { class: "message-info-metric px-3 py-3" }, Em = { class: "flex items-center gap-2" }, Dm = { class: "body-sm text-subtlest font-semibold uppercase" }, Om = { class: "heading-sm text-default mt-1" }, km = { class: "message-info-metric px-3 py-3" }, Am = { class: "flex items-center gap-2" }, jm = { class: "body-sm text-subtlest font-semibold uppercase" }, Mm = { class: "heading-sm text-default mt-1" }, Nm = {
|
|
9457
9504
|
key: 0,
|
|
9458
9505
|
class: "flex items-center justify-center px-4 py-8 sm:px-6"
|
|
9459
|
-
},
|
|
9506
|
+
}, Pm = {
|
|
9460
9507
|
key: 1,
|
|
9461
9508
|
class: "message-info-error body-md mx-4 rounded-xl px-4 py-3 sm:mx-6"
|
|
9462
|
-
},
|
|
9509
|
+
}, Fm = {
|
|
9463
9510
|
key: 2,
|
|
9464
9511
|
class: "space-y-4 pb-4 sm:pb-5"
|
|
9465
|
-
},
|
|
9512
|
+
}, Im = /* @__PURE__ */ sd(/* @__PURE__ */ u({
|
|
9466
9513
|
__name: "MessageInfoDialog",
|
|
9467
9514
|
props: {
|
|
9468
9515
|
open: { type: Boolean },
|
|
@@ -9484,34 +9531,34 @@ var tf = { class: "w-full" }, nf = {
|
|
|
9484
9531
|
function _(e, t) {
|
|
9485
9532
|
return e ? g(e) : d(t > 0 ? "someRecipients" : "notYet");
|
|
9486
9533
|
}
|
|
9487
|
-
return (t, n) => (S(), r(
|
|
9534
|
+
return (t, n) => (S(), r(cf, {
|
|
9488
9535
|
open: e.open,
|
|
9489
9536
|
title: j(d)("messageInfo"),
|
|
9490
9537
|
subtitle: j(d)("deliveryAndReadDetails"),
|
|
9491
9538
|
"close-label": j(d)("close"),
|
|
9492
9539
|
onClose: n[0] ||= (e) => c("close")
|
|
9493
9540
|
}, {
|
|
9494
|
-
default:
|
|
9495
|
-
o("div",
|
|
9496
|
-
o("div",
|
|
9541
|
+
default: F(() => [e.message ? (S(), a("div", vm, [o("div", ym, [o("p", bm, k(j(ds)(e.message, j(d)("message"), j(f).mentionNameByUid.value)), 1), o("div", xm, [
|
|
9542
|
+
o("div", Sm, [o("p", Cm, k(j(d)("sent")), 1), o("p", wm, k(g(e.message.sentAt)), 1)]),
|
|
9543
|
+
o("div", Tm, [o("div", Em, [o("p", Dm, k(j(d)("deliveredToAll")), 1), h.value.length ? (S(), r(j(se), {
|
|
9497
9544
|
key: 0,
|
|
9498
9545
|
text: String(h.value.length),
|
|
9499
9546
|
context: "secondary",
|
|
9500
9547
|
rounded: ""
|
|
9501
|
-
}, null, 8, ["text"])) : i("", !0)]), o("p",
|
|
9502
|
-
o("div",
|
|
9548
|
+
}, null, 8, ["text"])) : i("", !0)]), o("p", Om, k(_(e.message.receipts.deliveredAt, h.value.length)), 1)]),
|
|
9549
|
+
o("div", km, [o("div", Am, [o("p", jm, k(j(d)("readByAll")), 1), m.value.length ? (S(), r(j(se), {
|
|
9503
9550
|
key: 0,
|
|
9504
9551
|
text: String(m.value.length),
|
|
9505
9552
|
context: "success",
|
|
9506
9553
|
rounded: ""
|
|
9507
|
-
}, null, 8, ["text"])) : i("", !0)]), o("p",
|
|
9508
|
-
])]), e.loading ? (S(), a("div",
|
|
9554
|
+
}, null, 8, ["text"])) : i("", !0)]), o("p", Mm, k(_(e.message.receipts.readAt, m.value.length)), 1)])
|
|
9555
|
+
])]), e.loading ? (S(), a("div", Nm, [l(j(V), {
|
|
9509
9556
|
style: {
|
|
9510
9557
|
width: "2.5rem",
|
|
9511
9558
|
height: "2.5rem"
|
|
9512
9559
|
},
|
|
9513
9560
|
"stroke-width": "5"
|
|
9514
|
-
})])) : e.error ? (S(), a("div",
|
|
9561
|
+
})])) : e.error ? (S(), a("div", Pm, k(e.error), 1)) : (S(), a("div", Fm, [l(_m, {
|
|
9515
9562
|
title: j(d)("readBy"),
|
|
9516
9563
|
receipts: m.value,
|
|
9517
9564
|
"empty-label": j(d)("nobodyHasReadThisMessageYet"),
|
|
@@ -9520,7 +9567,7 @@ var tf = { class: "w-full" }, nf = {
|
|
|
9520
9567
|
"title",
|
|
9521
9568
|
"receipts",
|
|
9522
9569
|
"empty-label"
|
|
9523
|
-
]), l(
|
|
9570
|
+
]), l(_m, {
|
|
9524
9571
|
title: j(d)("deliveredNotYetRead"),
|
|
9525
9572
|
receipts: p.value,
|
|
9526
9573
|
"empty-label": j(d)("noRecipientsDeliveredStageYet"),
|
|
@@ -9538,28 +9585,28 @@ var tf = { class: "w-full" }, nf = {
|
|
|
9538
9585
|
"close-label"
|
|
9539
9586
|
]));
|
|
9540
9587
|
}
|
|
9541
|
-
}), [["__scopeId", "data-v-30ce65f1"]]),
|
|
9588
|
+
}), [["__scopeId", "data-v-30ce65f1"]]), Lm = { class: "min-h-0 flex-1 overflow-y-auto py-4 sm:py-5" }, Rm = {
|
|
9542
9589
|
key: 0,
|
|
9543
9590
|
class: "flex h-full min-h-64 items-center justify-center"
|
|
9544
|
-
},
|
|
9591
|
+
}, zm = {
|
|
9545
9592
|
key: 1,
|
|
9546
9593
|
class: "bg-elevation-surface-sunken-default body-md flex h-full min-h-64 items-center justify-center rounded-xl px-6 text-center"
|
|
9547
|
-
},
|
|
9594
|
+
}, Bm = {
|
|
9548
9595
|
key: 2,
|
|
9549
9596
|
class: "space-y-3"
|
|
9550
|
-
},
|
|
9597
|
+
}, Vm = { class: "flex flex-wrap items-start justify-between gap-3" }, Hm = { class: "min-w-0 space-y-2" }, Um = { class: "flex flex-wrap items-center gap-2" }, Wm = { class: "space-y-1" }, Gm = { class: "text-heading-sm text-default" }, Km = {
|
|
9551
9598
|
key: 0,
|
|
9552
9599
|
class: "body-md text-default"
|
|
9553
|
-
},
|
|
9600
|
+
}, qm = {
|
|
9554
9601
|
key: 1,
|
|
9555
9602
|
class: "body-md text-default wrap-break-word whitespace-pre-wrap"
|
|
9556
|
-
},
|
|
9603
|
+
}, Jm = { class: "flex flex-wrap items-center gap-1" }, Ym = {
|
|
9557
9604
|
key: 0,
|
|
9558
9605
|
class: "bg-elevation-surface-sunken-default mt-4 flex flex-col gap-3 rounded-xl p-3 sm:flex-row sm:items-center"
|
|
9559
|
-
},
|
|
9606
|
+
}, Xm = { class: "grid w-full grid-cols-1 gap-2 sm:grid-cols-[1fr_8rem]" }, Zm = { class: "flex items-center gap-2" }, Qm = {
|
|
9560
9607
|
key: 1,
|
|
9561
9608
|
class: "bg-elevation-surface-sunken-default mt-4 flex flex-col gap-3 rounded-xl p-3"
|
|
9562
|
-
},
|
|
9609
|
+
}, $m = ["placeholder"], eh = { class: "flex items-center justify-end gap-2" }, th = /* @__PURE__ */ u({
|
|
9563
9610
|
__name: "ScheduledMessagesDialog",
|
|
9564
9611
|
props: {
|
|
9565
9612
|
open: { type: Boolean },
|
|
@@ -9575,7 +9622,7 @@ var tf = { class: "w-full" }, nf = {
|
|
|
9575
9622
|
],
|
|
9576
9623
|
setup(t, { emit: s }) {
|
|
9577
9624
|
let c = t, u = s, d = w(null), f = w(null), p = w(""), m = w(""), h = w(""), { locale: g, t: _ } = K(), v = n(() => c.messages.filter((e) => !e.isDeleted && !!e.scheduled?.scheduleDate)), y = n(() => /^([01]\d|2[0-3]):([0-5]\d)$/.test(m.value));
|
|
9578
|
-
|
|
9625
|
+
P(() => c.open, (e) => {
|
|
9579
9626
|
e || (d.value = null, f.value = null, p.value = "", m.value = "", h.value = "");
|
|
9580
9627
|
});
|
|
9581
9628
|
function b(e) {
|
|
@@ -9605,7 +9652,7 @@ var tf = { class: "w-full" }, nf = {
|
|
|
9605
9652
|
function A() {
|
|
9606
9653
|
d.value = null, f.value = null, p.value = "", m.value = "", h.value = "";
|
|
9607
9654
|
}
|
|
9608
|
-
function
|
|
9655
|
+
function ee(e) {
|
|
9609
9656
|
if (!e.scheduled?.messageId || !e.scheduled?.muid || !e.scheduled?.originalChatUid || !p.value || !y.value) return;
|
|
9610
9657
|
let [t, n, r] = p.value.split("-").map(Number), [i, a] = m.value.split(":").map(Number), o = new Date(t, n - 1, r, i, a, 0, 0);
|
|
9611
9658
|
u("reschedule", {
|
|
@@ -9615,44 +9662,44 @@ var tf = { class: "w-full" }, nf = {
|
|
|
9615
9662
|
scheduleDate: o.toISOString()
|
|
9616
9663
|
}), A();
|
|
9617
9664
|
}
|
|
9618
|
-
function
|
|
9665
|
+
function te(e) {
|
|
9619
9666
|
let t = h.value.trim();
|
|
9620
9667
|
e.kind === "text" && !t || (u("editText", {
|
|
9621
9668
|
message: e,
|
|
9622
9669
|
nextText: h.value
|
|
9623
9670
|
}), A());
|
|
9624
9671
|
}
|
|
9625
|
-
function
|
|
9672
|
+
function N(e) {
|
|
9626
9673
|
d.value === e.id && A(), u("remove", e);
|
|
9627
9674
|
}
|
|
9628
|
-
return (n, s) => (S(), r(
|
|
9675
|
+
return (n, s) => (S(), r(cf, {
|
|
9629
9676
|
open: t.open,
|
|
9630
9677
|
title: j(_)("scheduledMessages"),
|
|
9631
9678
|
subtitle: t.conversationTitle ? j(_)("queuedForConversation", { title: t.conversationTitle }) : j(_)("queuedOutgoingMessagesForThisChat"),
|
|
9632
9679
|
"close-label": j(_)("close"),
|
|
9633
9680
|
onClose: s[3] ||= (e) => u("close")
|
|
9634
9681
|
}, {
|
|
9635
|
-
default:
|
|
9682
|
+
default: F(() => [o("div", Lm, [t.loading ? (S(), a("div", Rm, [l(j(V), {
|
|
9636
9683
|
style: {
|
|
9637
9684
|
width: "2.75rem",
|
|
9638
9685
|
height: "2.75rem"
|
|
9639
9686
|
},
|
|
9640
9687
|
"stroke-width": "6"
|
|
9641
|
-
})])) : v.value.length === 0 ? (S(), a("div",
|
|
9688
|
+
})])) : v.value.length === 0 ? (S(), a("div", zm, k(j(_)("noScheduledMessagesForConversation")), 1)) : (S(), a("div", Bm, [(S(!0), a(e, null, T(v.value, (e) => (S(), a("article", {
|
|
9642
9689
|
key: e.id,
|
|
9643
9690
|
class: "border-default rounded-lg border px-4 py-3"
|
|
9644
|
-
}, [o("div",
|
|
9691
|
+
}, [o("div", Vm, [o("div", Hm, [o("div", Um, [e.kind === "poll" ? (S(), r(j(se), {
|
|
9645
9692
|
key: 0,
|
|
9646
9693
|
text: j(_)("poll"),
|
|
9647
9694
|
context: "info",
|
|
9648
9695
|
rounded: ""
|
|
9649
|
-
}, null, 8, ["text"])) : e.attachments.length ? (S(), r(j(
|
|
9696
|
+
}, null, 8, ["text"])) : e.attachments.length ? (S(), r(j(se), {
|
|
9650
9697
|
key: 1,
|
|
9651
9698
|
text: E(e.attachments[0].kind),
|
|
9652
9699
|
context: "secondary",
|
|
9653
9700
|
rounded: ""
|
|
9654
|
-
}, null, 8, ["text"])) : i("", !0)]), o("div",
|
|
9655
|
-
e.kind === "poll" ? i("", !0) : (S(), r(j(
|
|
9701
|
+
}, null, 8, ["text"])) : i("", !0)]), o("div", Wm, [o("p", Gm, k(b(e.scheduled?.scheduleDate)), 1), e.kind === "poll" && e.poll ? (S(), a("p", Km, k(e.poll.question), 1)) : (S(), a("p", qm, k(j(ds)(e, j(_)("attachment"))), 1))])]), o("div", Jm, [
|
|
9702
|
+
e.kind === "poll" ? i("", !0) : (S(), r(j(R), {
|
|
9656
9703
|
key: 0,
|
|
9657
9704
|
label: j(_)("edit"),
|
|
9658
9705
|
icon: j(Eu),
|
|
@@ -9664,7 +9711,7 @@ var tf = { class: "w-full" }, nf = {
|
|
|
9664
9711
|
"icon",
|
|
9665
9712
|
"onClick"
|
|
9666
9713
|
])),
|
|
9667
|
-
e.scheduled?.messageId && e.scheduled?.muid && e.scheduled?.originalChatUid ? (S(), r(j(
|
|
9714
|
+
e.scheduled?.messageId && e.scheduled?.muid && e.scheduled?.originalChatUid ? (S(), r(j(R), {
|
|
9668
9715
|
key: 1,
|
|
9669
9716
|
label: j(_)("reschedule"),
|
|
9670
9717
|
icon: j(vu),
|
|
@@ -9676,22 +9723,22 @@ var tf = { class: "w-full" }, nf = {
|
|
|
9676
9723
|
"icon",
|
|
9677
9724
|
"onClick"
|
|
9678
9725
|
])) : i("", !0),
|
|
9679
|
-
l(j(
|
|
9726
|
+
l(j(R), {
|
|
9680
9727
|
label: j(_)("remove"),
|
|
9681
9728
|
icon: j(Cu),
|
|
9682
9729
|
text: "",
|
|
9683
9730
|
size: "small",
|
|
9684
|
-
onClick: (t) =>
|
|
9731
|
+
onClick: (t) => N(e)
|
|
9685
9732
|
}, null, 8, [
|
|
9686
9733
|
"label",
|
|
9687
9734
|
"icon",
|
|
9688
9735
|
"onClick"
|
|
9689
9736
|
])
|
|
9690
|
-
])]), d.value === e.id && f.value === "reschedule" ? (S(), a("div",
|
|
9737
|
+
])]), d.value === e.id && f.value === "reschedule" ? (S(), a("div", Ym, [o("div", Xm, [ne(o("input", {
|
|
9691
9738
|
"onUpdate:modelValue": s[0] ||= (e) => p.value = e,
|
|
9692
9739
|
type: "date",
|
|
9693
9740
|
class: "surface-input body-md w-full rounded-xl p-2 ring-0 outline-none"
|
|
9694
|
-
}, null, 512), [[
|
|
9741
|
+
}, null, 512), [[M, p.value]]), ne(o("input", {
|
|
9695
9742
|
"onUpdate:modelValue": s[1] ||= (e) => m.value = e,
|
|
9696
9743
|
type: "time",
|
|
9697
9744
|
inputmode: "numeric",
|
|
@@ -9699,35 +9746,35 @@ var tf = { class: "w-full" }, nf = {
|
|
|
9699
9746
|
pattern: "^([01]\\d|2[0-3]):([0-5]\\d)$",
|
|
9700
9747
|
"aria-label": "Time (24-hour)",
|
|
9701
9748
|
class: "surface-input body-md w-full rounded-xl p-2 ring-0 outline-none"
|
|
9702
|
-
}, null, 512), [[
|
|
9749
|
+
}, null, 512), [[M, m.value]])]), o("div", Zm, [l(j(R), {
|
|
9703
9750
|
label: j(_)("save"),
|
|
9704
9751
|
size: "small",
|
|
9705
9752
|
disabled: !p.value || !y.value,
|
|
9706
|
-
onClick: (t) =>
|
|
9753
|
+
onClick: (t) => ee(e)
|
|
9707
9754
|
}, null, 8, [
|
|
9708
9755
|
"label",
|
|
9709
9756
|
"disabled",
|
|
9710
9757
|
"onClick"
|
|
9711
|
-
]), l(j(
|
|
9758
|
+
]), l(j(R), {
|
|
9712
9759
|
label: j(_)("cancel"),
|
|
9713
9760
|
size: "small",
|
|
9714
9761
|
text: "",
|
|
9715
9762
|
onClick: A
|
|
9716
|
-
}, null, 8, ["label"])])])) : d.value === e.id && f.value === "text" ? (S(), a("div",
|
|
9763
|
+
}, null, 8, ["label"])])])) : d.value === e.id && f.value === "text" ? (S(), a("div", Qm, [ne(o("textarea", {
|
|
9717
9764
|
"onUpdate:modelValue": s[2] ||= (e) => h.value = e,
|
|
9718
9765
|
rows: "3",
|
|
9719
9766
|
class: "surface-input body-md w-full rounded-xl px-3 py-2 ring-0 outline-none",
|
|
9720
9767
|
placeholder: j(_)("writeMessage")
|
|
9721
|
-
}, null, 8,
|
|
9768
|
+
}, null, 8, $m), [[M, h.value]]), o("div", eh, [l(j(R), {
|
|
9722
9769
|
label: j(_)("cancel"),
|
|
9723
9770
|
size: "small",
|
|
9724
9771
|
text: "",
|
|
9725
9772
|
onClick: A
|
|
9726
|
-
}, null, 8, ["label"]), l(j(
|
|
9773
|
+
}, null, 8, ["label"]), l(j(R), {
|
|
9727
9774
|
label: j(_)("save"),
|
|
9728
9775
|
size: "small",
|
|
9729
9776
|
disabled: e.kind === "text" && !h.value.trim(),
|
|
9730
|
-
onClick: (t) =>
|
|
9777
|
+
onClick: (t) => te(e)
|
|
9731
9778
|
}, null, 8, [
|
|
9732
9779
|
"label",
|
|
9733
9780
|
"disabled",
|
|
@@ -9741,10 +9788,10 @@ var tf = { class: "w-full" }, nf = {
|
|
|
9741
9788
|
"close-label"
|
|
9742
9789
|
]));
|
|
9743
9790
|
}
|
|
9744
|
-
}),
|
|
9791
|
+
}), nh = {
|
|
9745
9792
|
key: 0,
|
|
9746
9793
|
class: "chat-status-overlay"
|
|
9747
|
-
},
|
|
9794
|
+
}, rh = { class: "chat-status-overlay__card" }, ih = { key: 0 }, ah = { key: 1 }, oh = { key: 2 }, sh = { key: 3 }, ch = /* @__PURE__ */ sd(/* @__PURE__ */ u({
|
|
9748
9795
|
__name: "ChatStatusOverlay",
|
|
9749
9796
|
props: {
|
|
9750
9797
|
visible: { type: Boolean },
|
|
@@ -9757,9 +9804,9 @@ var tf = { class: "w-full" }, nf = {
|
|
|
9757
9804
|
messages: {}
|
|
9758
9805
|
},
|
|
9759
9806
|
setup(e) {
|
|
9760
|
-
return (t, n) => e.visible ? (S(), a("div",
|
|
9807
|
+
return (t, n) => e.visible ? (S(), a("div", nh, [o("div", rh, [e.offlineMode ? (S(), a("span", ih, k(e.messages.waitingForNetwork), 1)) : e.connected ? e.loading ? (S(), a("span", oh, k(e.messages.loading), 1)) : e.notFound ? (S(), a("span", sh, k(e.messages.notFound), 1)) : e.isEmpty && e.showEmptySlot ? E(t.$slots, "no-messages", { key: 4 }, () => [o("span", null, k(e.messages.noMessages), 1)], !0) : i("", !0) : (S(), a("span", ah, k(e.messages.connecting), 1))])])) : i("", !0);
|
|
9761
9808
|
}
|
|
9762
|
-
}), [["__scopeId", "data-v-20316f96"]]),
|
|
9809
|
+
}), [["__scopeId", "data-v-20316f96"]]), lh = /* @__PURE__ */ u({
|
|
9763
9810
|
__name: "BccChat",
|
|
9764
9811
|
props: {
|
|
9765
9812
|
client: { default: null },
|
|
@@ -9823,13 +9870,13 @@ var tf = { class: "w-full" }, nf = {
|
|
|
9823
9870
|
if (p.conversation !== void 0) return p.conversation;
|
|
9824
9871
|
let e = T.value;
|
|
9825
9872
|
return e ? p.chatUid ? e.conversations.value.find((e) => e.targetId === p.chatUid || e.id === p.chatUid) ?? null : e.activeConversation.value : null;
|
|
9826
|
-
}), { groupMembers: A, fetchGroupMembers:
|
|
9873
|
+
}), { groupMembers: A, fetchGroupMembers: ee } = pu({
|
|
9827
9874
|
getConversationTargetId: () => O.value?.targetId,
|
|
9828
9875
|
isChannel: () => Nl(O.value),
|
|
9829
9876
|
onMembersChanged: (e) => {
|
|
9830
9877
|
m("chatMembersFetched", e), T.value?.rememberMentionDisplayNames(e);
|
|
9831
9878
|
}
|
|
9832
|
-
}),
|
|
9879
|
+
}), M = Ul({
|
|
9833
9880
|
chatClient: T,
|
|
9834
9881
|
selectedConversation: O,
|
|
9835
9882
|
getPropIsReadOnly: () => p.isReadOnly,
|
|
@@ -9841,8 +9888,8 @@ var tf = { class: "w-full" }, nf = {
|
|
|
9841
9888
|
currentUserId: T.value?.currentUser.value?.uid
|
|
9842
9889
|
})
|
|
9843
9890
|
});
|
|
9844
|
-
Gl(
|
|
9845
|
-
let
|
|
9891
|
+
Gl(M);
|
|
9892
|
+
let N = ql({
|
|
9846
9893
|
chatClient: T,
|
|
9847
9894
|
selectedConversation: O,
|
|
9848
9895
|
usesPublicContract: D,
|
|
@@ -9854,61 +9901,61 @@ var tf = { class: "w-full" }, nf = {
|
|
|
9854
9901
|
getPropShowDefaultEmptyState: () => p.showDefaultEmptyState,
|
|
9855
9902
|
getHideDeletedMessages: () => p.hideDeletedMessages
|
|
9856
9903
|
});
|
|
9857
|
-
Yl(
|
|
9858
|
-
let
|
|
9904
|
+
Yl(N);
|
|
9905
|
+
let ne = n(() => N.messages.value.length > 0), I = n(() => p.showHeader ?? p.showMessageHeader), L = ru({
|
|
9859
9906
|
chatClient: T,
|
|
9860
9907
|
selectedConversation: O,
|
|
9861
9908
|
getInitialScheduledMessagesOpen: () => !!p.initialScheduledMessagesOpen,
|
|
9862
9909
|
fetchErrorFallback: h("loadMessageReceiptsError")
|
|
9863
9910
|
});
|
|
9864
|
-
au(
|
|
9865
|
-
let
|
|
9911
|
+
au(L);
|
|
9912
|
+
let R = te("mainComposerRef"), re = te("threadComposerRef"), z = Ql({
|
|
9866
9913
|
chatClient: T,
|
|
9867
|
-
sendOptions:
|
|
9868
|
-
mentionNameByUid:
|
|
9869
|
-
afterSchedule: () =>
|
|
9870
|
-
mainComposerRef:
|
|
9871
|
-
threadComposerRef:
|
|
9914
|
+
sendOptions: M.sendOptions,
|
|
9915
|
+
mentionNameByUid: M.mentionNameByUid,
|
|
9916
|
+
afterSchedule: () => L.openScheduledMessages(),
|
|
9917
|
+
mainComposerRef: R,
|
|
9918
|
+
threadComposerRef: re
|
|
9872
9919
|
});
|
|
9873
|
-
eu(
|
|
9874
|
-
let
|
|
9875
|
-
uu(
|
|
9876
|
-
conversation:
|
|
9877
|
-
composer:
|
|
9878
|
-
dialogs:
|
|
9879
|
-
bus:
|
|
9920
|
+
eu(z);
|
|
9921
|
+
let ie = lu();
|
|
9922
|
+
uu(ie), su({
|
|
9923
|
+
conversation: M,
|
|
9924
|
+
composer: z,
|
|
9925
|
+
dialogs: L,
|
|
9926
|
+
bus: ie
|
|
9880
9927
|
});
|
|
9881
|
-
let { scrollToRequestedMessage:
|
|
9928
|
+
let { scrollToRequestedMessage: ae } = mu({
|
|
9882
9929
|
chatRootRef: v,
|
|
9883
9930
|
getClient: () => T.value
|
|
9884
9931
|
});
|
|
9885
|
-
|
|
9886
|
-
|
|
9887
|
-
}, { immediate: !0 }),
|
|
9888
|
-
!e || O.value?.type !== "group" || await
|
|
9889
|
-
}, { immediate: !0 }),
|
|
9890
|
-
|
|
9891
|
-
}),
|
|
9932
|
+
P(() => O.value?.targetId ?? null, () => {
|
|
9933
|
+
L.refreshScheduledMessages();
|
|
9934
|
+
}, { immediate: !0 }), P(() => O.value?.targetId ?? null, async (e) => {
|
|
9935
|
+
!e || O.value?.type !== "group" || await ee(e);
|
|
9936
|
+
}, { immediate: !0 }), P(() => O.value?.id, () => {
|
|
9937
|
+
z.resetMainComposer(), z.resetThreadComposer(), L.showScheduledMessages.value = !1, L.closeMessageInfo();
|
|
9938
|
+
}), P(() => p.chatMessageGetter, (e) => {
|
|
9892
9939
|
jl.setGetChatMessagesCallback(e);
|
|
9893
|
-
}, { immediate: !0 }),
|
|
9940
|
+
}, { immediate: !0 }), P(() => p.language, (e) => {
|
|
9894
9941
|
e && ze(e);
|
|
9895
|
-
}, { immediate: !0 }),
|
|
9942
|
+
}, { immediate: !0 }), P(N.isChatEmpty, (e) => {
|
|
9896
9943
|
e && m("chatEmpty");
|
|
9897
|
-
}),
|
|
9944
|
+
}), P([
|
|
9898
9945
|
() => p.chatUid,
|
|
9899
9946
|
() => p.client ? p.client.initialized.value : jl.initialized.value,
|
|
9900
9947
|
() => p.client ? p.client.loggedIn.value : jl.loggedIn.value,
|
|
9901
9948
|
() => T.value?.conversations.value.length ?? 0
|
|
9902
9949
|
], async ([e, t, n]) => {
|
|
9903
|
-
!D.value || !e || !t || !n || !T.value || await
|
|
9904
|
-
}, { immediate: !0 }),
|
|
9905
|
-
() =>
|
|
9906
|
-
() =>
|
|
9950
|
+
!D.value || !e || !t || !n || !T.value || await B();
|
|
9951
|
+
}, { immediate: !0 }), P([
|
|
9952
|
+
() => N.messages.value.length,
|
|
9953
|
+
() => N.threadMessages.value.length,
|
|
9907
9954
|
() => jl.scrollToMessageId.value
|
|
9908
9955
|
], async () => {
|
|
9909
|
-
await
|
|
9956
|
+
await ae();
|
|
9910
9957
|
});
|
|
9911
|
-
async function
|
|
9958
|
+
async function B() {
|
|
9912
9959
|
let e = T.value;
|
|
9913
9960
|
if (e) {
|
|
9914
9961
|
C.value = !0, x.value = !1;
|
|
@@ -9919,60 +9966,60 @@ var tf = { class: "w-full" }, nf = {
|
|
|
9919
9966
|
x.value = !0, m("chatMembersFetched", []);
|
|
9920
9967
|
return;
|
|
9921
9968
|
}
|
|
9922
|
-
e.activeConversationId.value !== t.id && await e.selectConversation(t.id), await
|
|
9969
|
+
e.activeConversationId.value !== t.id && await e.selectConversation(t.id), await ee(t.targetId);
|
|
9923
9970
|
} finally {
|
|
9924
9971
|
C.value = !1;
|
|
9925
9972
|
}
|
|
9926
9973
|
}
|
|
9927
9974
|
}
|
|
9928
|
-
function
|
|
9975
|
+
function V(e, t) {
|
|
9929
9976
|
m("linkClicked", e, t);
|
|
9930
9977
|
}
|
|
9931
|
-
let
|
|
9978
|
+
let se = w(!1);
|
|
9932
9979
|
b(() => {
|
|
9933
9980
|
setTimeout(() => {
|
|
9934
|
-
|
|
9981
|
+
se.value = !0;
|
|
9935
9982
|
}, 200);
|
|
9936
9983
|
}), y(() => {
|
|
9937
9984
|
let e = T.value;
|
|
9938
9985
|
e && e.activeConversation.value === O.value && e.selectConversation(null);
|
|
9939
9986
|
});
|
|
9940
|
-
async function
|
|
9941
|
-
return await new Promise((e) => setTimeout(e, 100)),
|
|
9987
|
+
async function H(e) {
|
|
9988
|
+
return await new Promise((e) => setTimeout(e, 100)), se.value ? ae(e) : (await new Promise((e) => setTimeout(e, 110)), H(e));
|
|
9942
9989
|
}
|
|
9943
|
-
return o({ scrollToMessage:
|
|
9990
|
+
return o({ scrollToMessage: H }), (n, o) => (S(), a("div", {
|
|
9944
9991
|
ref_key: "chatRootRef",
|
|
9945
9992
|
ref: v,
|
|
9946
9993
|
class: "bcc-chat-message-list-wrapper relative h-full min-h-104"
|
|
9947
9994
|
}, [
|
|
9948
|
-
D.value && T.value?.error.value ? (S(), r(j(
|
|
9995
|
+
D.value && T.value?.error.value ? (S(), r(j(oe), {
|
|
9949
9996
|
key: 0,
|
|
9950
9997
|
severity: "error",
|
|
9951
9998
|
closable: !1,
|
|
9952
9999
|
class: "pointer-events-auto absolute inset-x-2 top-2 z-20 shadow-lg"
|
|
9953
10000
|
}, {
|
|
9954
|
-
default:
|
|
10001
|
+
default: F(() => [c(k(T.value.error.value), 1)]),
|
|
9955
10002
|
_: 1
|
|
9956
10003
|
})) : i("", !0),
|
|
9957
10004
|
T.value ? (S(), a(e, { key: 1 }, [
|
|
9958
|
-
l(
|
|
10005
|
+
l(am, {
|
|
9959
10006
|
target: "main",
|
|
9960
10007
|
class: g(["h-full", t.containerClass]),
|
|
9961
10008
|
"hide-group-actions": t.hideGroupActions,
|
|
9962
|
-
"show-header":
|
|
10009
|
+
"show-header": I.value,
|
|
9963
10010
|
"action-message-class": t.actionMessageClass,
|
|
9964
10011
|
"action-message-row-class": t.actionMessageRowClass,
|
|
9965
|
-
onAnchorclick:
|
|
10012
|
+
onAnchorclick: V
|
|
9966
10013
|
}, s({
|
|
9967
|
-
composer:
|
|
10014
|
+
composer: F(() => [l(qd, {
|
|
9968
10015
|
ref_key: "mainComposerRef",
|
|
9969
|
-
ref:
|
|
10016
|
+
ref: R,
|
|
9970
10017
|
target: "main"
|
|
9971
10018
|
}, null, 512)]),
|
|
9972
10019
|
_: 2
|
|
9973
10020
|
}, [n.$slots["message-header"] ? {
|
|
9974
10021
|
name: "header",
|
|
9975
|
-
fn:
|
|
10022
|
+
fn: F((e) => [E(n.$slots, "message-header", _(d(e)))]),
|
|
9976
10023
|
key: "0"
|
|
9977
10024
|
} : void 0]), 1032, [
|
|
9978
10025
|
"hide-group-actions",
|
|
@@ -9981,23 +10028,23 @@ var tf = { class: "w-full" }, nf = {
|
|
|
9981
10028
|
"action-message-class",
|
|
9982
10029
|
"action-message-row-class"
|
|
9983
10030
|
]),
|
|
9984
|
-
l(
|
|
9985
|
-
open: !!j(
|
|
9986
|
-
title: j(h)("threadWithCount", { count: j(
|
|
10031
|
+
l(cf, {
|
|
10032
|
+
open: !!j(N).activeThreadParentMessage.value,
|
|
10033
|
+
title: j(h)("threadWithCount", { count: j(N).activeThreadParentMessage.value?.replyCount ?? 0 }),
|
|
9987
10034
|
subtitle: O.value?.title ?? "",
|
|
9988
10035
|
"close-label": j(h)("close"),
|
|
9989
10036
|
"close-aria-label": j(h)("closeThread"),
|
|
9990
|
-
onClose: o[0] ||= (e) => j(
|
|
10037
|
+
onClose: o[0] ||= (e) => j(ie).emit("ui:closeThread")
|
|
9991
10038
|
}, {
|
|
9992
|
-
default:
|
|
10039
|
+
default: F(() => [l(am, {
|
|
9993
10040
|
target: "thread",
|
|
9994
10041
|
class: "min-h-0 flex-1",
|
|
9995
10042
|
"action-message-class": t.actionMessageClass,
|
|
9996
10043
|
"action-message-row-class": t.actionMessageRowClass
|
|
9997
10044
|
}, {
|
|
9998
|
-
composer:
|
|
10045
|
+
composer: F(() => [l(qd, {
|
|
9999
10046
|
ref_key: "threadComposerRef",
|
|
10000
|
-
ref:
|
|
10047
|
+
ref: re,
|
|
10001
10048
|
target: "thread"
|
|
10002
10049
|
}, null, 512)]),
|
|
10003
10050
|
_: 1
|
|
@@ -10010,28 +10057,28 @@ var tf = { class: "w-full" }, nf = {
|
|
|
10010
10057
|
"close-label",
|
|
10011
10058
|
"close-aria-label"
|
|
10012
10059
|
]),
|
|
10013
|
-
l(
|
|
10014
|
-
open: j(
|
|
10015
|
-
loading: j(
|
|
10016
|
-
messages: j(
|
|
10060
|
+
l(th, {
|
|
10061
|
+
open: j(L).showScheduledMessages.value,
|
|
10062
|
+
loading: j(L).loadingScheduledMessages.value,
|
|
10063
|
+
messages: j(L).scheduledMessages.value,
|
|
10017
10064
|
"conversation-title": O.value?.title,
|
|
10018
|
-
onClose: o[1] ||= (e) => j(
|
|
10019
|
-
onReschedule: o[2] ||= (e) => j(
|
|
10020
|
-
onRemove: o[3] ||= (e) => j(
|
|
10021
|
-
onEditText: o[4] ||= (e) => j(
|
|
10065
|
+
onClose: o[1] ||= (e) => j(L).showScheduledMessages.value = !1,
|
|
10066
|
+
onReschedule: o[2] ||= (e) => j(ie).emit("ui:reschedule", e),
|
|
10067
|
+
onRemove: o[3] ||= (e) => j(ie).emit("ui:removeScheduled", e),
|
|
10068
|
+
onEditText: o[4] ||= (e) => j(ie).emit("ui:editScheduledText", e)
|
|
10022
10069
|
}, null, 8, [
|
|
10023
10070
|
"open",
|
|
10024
10071
|
"loading",
|
|
10025
10072
|
"messages",
|
|
10026
10073
|
"conversation-title"
|
|
10027
10074
|
]),
|
|
10028
|
-
l(
|
|
10029
|
-
open: !!j(
|
|
10030
|
-
message: j(
|
|
10031
|
-
receipts: j(
|
|
10032
|
-
loading: j(
|
|
10033
|
-
error: j(
|
|
10034
|
-
onClose: o[5] ||= (e) => j(
|
|
10075
|
+
l(Im, {
|
|
10076
|
+
open: !!j(L).infoMessage.value,
|
|
10077
|
+
message: j(L).infoMessage.value,
|
|
10078
|
+
receipts: j(L).infoMessageReceipts.value,
|
|
10079
|
+
loading: j(L).loadingMessageReceipts.value,
|
|
10080
|
+
error: j(L).messageReceiptsError.value,
|
|
10081
|
+
onClose: o[5] ||= (e) => j(L).closeMessageInfo()
|
|
10035
10082
|
}, null, 8, [
|
|
10036
10083
|
"open",
|
|
10037
10084
|
"message",
|
|
@@ -10040,13 +10087,13 @@ var tf = { class: "w-full" }, nf = {
|
|
|
10040
10087
|
"error"
|
|
10041
10088
|
])
|
|
10042
10089
|
], 64)) : i("", !0),
|
|
10043
|
-
l(
|
|
10044
|
-
visible: D.value && (T.value?.offlineMode.value || !T.value?.connected.value || C.value && !
|
|
10090
|
+
l(ch, {
|
|
10091
|
+
visible: D.value && (T.value?.offlineMode.value || !T.value?.connected.value || C.value && !ne.value || x.value || t.displayNoMessagesText && j(N).isChatEmpty.value),
|
|
10045
10092
|
"offline-mode": !!(T.value?.offlineMode.value && !O.value),
|
|
10046
10093
|
connected: !!(T.value?.connected.value || O.value),
|
|
10047
10094
|
loading: C.value,
|
|
10048
10095
|
"not-found": x.value,
|
|
10049
|
-
"is-empty": j(
|
|
10096
|
+
"is-empty": j(N).isChatEmpty.value,
|
|
10050
10097
|
"show-empty-slot": t.displayNoMessagesText,
|
|
10051
10098
|
messages: {
|
|
10052
10099
|
waitingForNetwork: j(h)("waitingForNetwork"),
|
|
@@ -10056,7 +10103,7 @@ var tf = { class: "w-full" }, nf = {
|
|
|
10056
10103
|
noMessages: j(h)("noMessagesHaveBeenSentYet")
|
|
10057
10104
|
}
|
|
10058
10105
|
}, {
|
|
10059
|
-
"no-messages":
|
|
10106
|
+
"no-messages": F(() => [E(n.$slots, "no-messages")]),
|
|
10060
10107
|
_: 3
|
|
10061
10108
|
}, 8, [
|
|
10062
10109
|
"visible",
|
|
@@ -10072,6 +10119,6 @@ var tf = { class: "w-full" }, nf = {
|
|
|
10072
10119
|
}
|
|
10073
10120
|
});
|
|
10074
10121
|
//#endregion
|
|
10075
|
-
export {
|
|
10122
|
+
export { lh as BccChat, lh as BccChatMessageList, Yc as LogSeverity, jl as chat, jl as default, ks as createChatClient };
|
|
10076
10123
|
|
|
10077
10124
|
//# sourceMappingURL=vue-bcc-chat-ui.js.map
|