@bcc-code/vue-bcc-chat-ui 7.1.30 → 7.1.31
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/vue-bcc-chat-ui.js +223 -215
- package/dist/vue-bcc-chat-ui.js.map +1 -1
- package/package.json +1 -1
package/dist/vue-bcc-chat-ui.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Fragment as e, Teleport as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createSlots as s, createTextVNode as c, createVNode as l, defineComponent as u, guardReactiveProps as d, inject as f, isRef as p, mergeModels as m, nextTick as h, normalizeClass as g, normalizeProps as _, normalizeStyle as v, onBeforeUnmount as y, onMounted as b, onUnmounted as x, openBlock as S, provide as C, ref as w, renderList as T, renderSlot as E, resolveDynamicComponent as D, shallowRef as O, toDisplayString as k, toValue as A, unref as j, useModel as M, useTemplateRef as
|
|
2
|
-
import { BccAvatar as R, BccButton as z, BccDialog as ne, BccImage as B, BccInput as re, BccInputText as ie, BccMenu as ae, BccMessage as oe, BccProgressSpinner as
|
|
1
|
+
import { Fragment as e, Teleport as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createSlots as s, createTextVNode as c, createVNode as l, defineComponent as u, guardReactiveProps as d, inject as f, isRef as p, mergeModels as m, nextTick as h, normalizeClass as g, normalizeProps as _, normalizeStyle as v, onBeforeUnmount as y, onMounted as b, onUnmounted as x, openBlock as S, provide as C, ref as w, renderList as T, renderSlot as E, resolveDynamicComponent as D, shallowRef as O, toDisplayString as k, toValue as A, unref as j, useModel as M, useTemplateRef as N, vModelText as ee, vShow as P, watch as F, withCtx as I, withDirectives as te, withModifiers as L } from "vue";
|
|
2
|
+
import { BccAvatar as R, BccButton as z, BccDialog as ne, BccImage as B, BccInput as re, BccInputText as ie, BccMenu as ae, BccMessage as oe, BccProgressSpinner as se, BccTag as V } from "@bcc-code/component-library-vue";
|
|
3
3
|
import { CometChat as H } from "@cometchat/chat-sdk-javascript";
|
|
4
|
-
import { AddIcon as
|
|
4
|
+
import { AddIcon as U, AttachFileIcon as ce, BarChartIcon as le, CalendarAddOnIcon as ue, CheckIcon as de, CloseIcon as fe, CodeBlocksIcon as pe, ContentCopyIcon as me, DeleteIcon as he, DescriptionIcon as ge, DoneAllIcon as _e, EditCalendarIcon as ve, EditIcon as ye, ErrorIcon as be, FilePresentIcon as xe, FolderZipIcon as Se, ForumIcon as Ce, ImageIcon as we, InfoIcon as Te, KeyboardArrowDownIcon as Ee, KeyboardArrowUpIcon as De, MicIcon as Oe, OpenInNewIcon as ke, PendingIcon as Ae, PictureAsPdfIcon as je, ReplyIcon as Me, ScheduleIcon as Ne, SendIcon as Pe, TableChartIcon as Fe, TextSnippetIcon as Ie, TranslateIcon as Le, VideocamIcon as Re } from "@bcc-code/icons-vue";
|
|
5
5
|
//#region \0rolldown/runtime.js
|
|
6
6
|
var W = Object.defineProperty, ze = (e, t) => {
|
|
7
7
|
let n = {};
|
|
@@ -734,7 +734,7 @@ function or() {
|
|
|
734
734
|
}
|
|
735
735
|
let x, S = "", C = n, w = C.implementation, T = C.createNodeIterator, E = C.createDocumentFragment, D = C.getElementsByTagName, O = r.importNode, k = ar();
|
|
736
736
|
t.isSupported = typeof Qt == "function" && typeof b == "function" && w && w.createHTMLDocument !== void 0;
|
|
737
|
-
let A = Kn, j = qn, M = Jn,
|
|
737
|
+
let A = Kn, j = qn, M = Jn, N = Yn, ee = Xn, P = Qn, F = $n, I = tr, te = Zn, L = null, R = Y({}, [
|
|
738
738
|
...Fn,
|
|
739
739
|
...In,
|
|
740
740
|
...Ln,
|
|
@@ -777,7 +777,7 @@ function or() {
|
|
|
777
777
|
enumerable: !0,
|
|
778
778
|
value: null
|
|
779
779
|
}
|
|
780
|
-
})), oe = !0,
|
|
780
|
+
})), oe = !0, se = !0, V = !1, H = !0, U = !1, ce = !0, le = !1, ue = !1, de = !1, fe = !1, pe = !1, me = !1, he = !0, ge = !1, _e = "user-content-", ve = !0, ye = !1, be = {}, xe = null, Se = Y({}, [
|
|
781
781
|
"annotation-xml",
|
|
782
782
|
"audio",
|
|
783
783
|
"colgroup",
|
|
@@ -846,7 +846,7 @@ function or() {
|
|
|
846
846
|
}, He = function() {
|
|
847
847
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
848
848
|
if (ze && ze === e) return;
|
|
849
|
-
(!e || typeof e != "object") && (e = {}), e = jn(e), Le = Re.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, W = Le === "application/xhtml+xml" ? _n : gn, L = q(e, "ALLOWED_TAGS") && hn(e.ALLOWED_TAGS) ? Y({}, e.ALLOWED_TAGS, W) : R, z = q(e, "ALLOWED_ATTR") && hn(e.ALLOWED_ATTR) ? Y({}, e.ALLOWED_ATTR, W) : ne, Me = q(e, "ALLOWED_NAMESPACES") && hn(e.ALLOWED_NAMESPACES) ? Y({}, e.ALLOWED_NAMESPACES, _n) : Ne, Te = q(e, "ADD_URI_SAFE_ATTR") && hn(e.ADD_URI_SAFE_ATTR) ? Y(jn(Ee), e.ADD_URI_SAFE_ATTR, W) : Ee, Ce = q(e, "ADD_DATA_URI_TAGS") && hn(e.ADD_DATA_URI_TAGS) ? Y(jn(we), e.ADD_DATA_URI_TAGS, W) : we, xe = q(e, "FORBID_CONTENTS") && hn(e.FORBID_CONTENTS) ? Y({}, e.FORBID_CONTENTS, W) : Se, re = q(e, "FORBID_TAGS") && hn(e.FORBID_TAGS) ? Y({}, e.FORBID_TAGS, W) : jn({}), ie = q(e, "FORBID_ATTR") && hn(e.FORBID_ATTR) ? Y({}, e.FORBID_ATTR, W) : jn({}), be = q(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? jn(e.USE_PROFILES) : e.USE_PROFILES : !1, oe = e.ALLOW_ARIA_ATTR !== !1,
|
|
849
|
+
(!e || typeof e != "object") && (e = {}), e = jn(e), Le = Re.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, W = Le === "application/xhtml+xml" ? _n : gn, L = q(e, "ALLOWED_TAGS") && hn(e.ALLOWED_TAGS) ? Y({}, e.ALLOWED_TAGS, W) : R, z = q(e, "ALLOWED_ATTR") && hn(e.ALLOWED_ATTR) ? Y({}, e.ALLOWED_ATTR, W) : ne, Me = q(e, "ALLOWED_NAMESPACES") && hn(e.ALLOWED_NAMESPACES) ? Y({}, e.ALLOWED_NAMESPACES, _n) : Ne, Te = q(e, "ADD_URI_SAFE_ATTR") && hn(e.ADD_URI_SAFE_ATTR) ? Y(jn(Ee), e.ADD_URI_SAFE_ATTR, W) : Ee, Ce = q(e, "ADD_DATA_URI_TAGS") && hn(e.ADD_DATA_URI_TAGS) ? Y(jn(we), e.ADD_DATA_URI_TAGS, W) : we, xe = q(e, "FORBID_CONTENTS") && hn(e.FORBID_CONTENTS) ? Y({}, e.FORBID_CONTENTS, W) : Se, re = q(e, "FORBID_TAGS") && hn(e.FORBID_TAGS) ? Y({}, e.FORBID_TAGS, W) : jn({}), ie = q(e, "FORBID_ATTR") && hn(e.FORBID_ATTR) ? Y({}, e.FORBID_ATTR, W) : jn({}), be = q(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? jn(e.USE_PROFILES) : e.USE_PROFILES : !1, oe = e.ALLOW_ARIA_ATTR !== !1, se = e.ALLOW_DATA_ATTR !== !1, V = e.ALLOW_UNKNOWN_PROTOCOLS || !1, H = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, U = e.SAFE_FOR_TEMPLATES || !1, ce = e.SAFE_FOR_XML !== !1, le = e.WHOLE_DOCUMENT || !1, fe = e.RETURN_DOM || !1, pe = e.RETURN_DOM_FRAGMENT || !1, me = e.RETURN_TRUSTED_TYPE || !1, de = e.FORCE_BODY || !1, he = e.SANITIZE_DOM !== !1, ge = e.SANITIZE_NAMED_PROPS || !1, ve = e.KEEP_CONTENT !== !1, ye = e.IN_PLACE || !1, te = Pn(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : Zn, Ae = typeof e.NAMESPACE == "string" ? e.NAMESPACE : ke, Pe = q(e, "MATHML_TEXT_INTEGRATION_POINTS") && e.MATHML_TEXT_INTEGRATION_POINTS && typeof e.MATHML_TEXT_INTEGRATION_POINTS == "object" ? jn(e.MATHML_TEXT_INTEGRATION_POINTS) : Y({}, [
|
|
850
850
|
"mi",
|
|
851
851
|
"mo",
|
|
852
852
|
"mn",
|
|
@@ -854,7 +854,7 @@ function or() {
|
|
|
854
854
|
"mtext"
|
|
855
855
|
]), Fe = q(e, "HTML_INTEGRATION_POINTS") && e.HTML_INTEGRATION_POINTS && typeof e.HTML_INTEGRATION_POINTS == "object" ? jn(e.HTML_INTEGRATION_POINTS) : Y({}, ["annotation-xml"]);
|
|
856
856
|
let t = q(e, "CUSTOM_ELEMENT_HANDLING") && e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING == "object" ? jn(e.CUSTOM_ELEMENT_HANDLING) : on(null);
|
|
857
|
-
if (B = on(null), q(t, "tagNameCheck") && Ve(t.tagNameCheck) && (B.tagNameCheck = t.tagNameCheck), q(t, "attributeNameCheck") && Ve(t.attributeNameCheck) && (B.attributeNameCheck = t.attributeNameCheck), q(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (B.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements),
|
|
857
|
+
if (B = on(null), q(t, "tagNameCheck") && Ve(t.tagNameCheck) && (B.tagNameCheck = t.tagNameCheck), q(t, "attributeNameCheck") && Ve(t.attributeNameCheck) && (B.attributeNameCheck = t.attributeNameCheck), q(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (B.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), U && (se = !1), pe && (fe = !0), be && (L = Y({}, Vn), z = on(null), be.html === !0 && (Y(L, Fn), Y(z, Hn)), be.svg === !0 && (Y(L, In), Y(z, Un), Y(z, Gn)), be.svgFilters === !0 && (Y(L, Ln), Y(z, Un), Y(z, Gn)), be.mathMl === !0 && (Y(L, zn), Y(z, Wn), Y(z, Gn))), ae.tagCheck = null, ae.attributeCheck = null, q(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? ae.tagCheck = e.ADD_TAGS : hn(e.ADD_TAGS) && (L === R && (L = jn(L)), Y(L, e.ADD_TAGS, W))), q(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? ae.attributeCheck = e.ADD_ATTR : hn(e.ADD_ATTR) && (z === ne && (z = jn(z)), Y(z, e.ADD_ATTR, W))), q(e, "ADD_URI_SAFE_ATTR") && hn(e.ADD_URI_SAFE_ATTR) && Y(Te, e.ADD_URI_SAFE_ATTR, W), q(e, "FORBID_CONTENTS") && hn(e.FORBID_CONTENTS) && (xe === Se && (xe = jn(xe)), Y(xe, e.FORBID_CONTENTS, W)), q(e, "ADD_FORBID_CONTENTS") && hn(e.ADD_FORBID_CONTENTS) && (xe === Se && (xe = jn(xe)), Y(xe, e.ADD_FORBID_CONTENTS, W)), ve && (L["#text"] = !0), le && Y(L, [
|
|
858
858
|
"html",
|
|
859
859
|
"head",
|
|
860
860
|
"body"
|
|
@@ -920,7 +920,7 @@ function or() {
|
|
|
920
920
|
} catch {}
|
|
921
921
|
}
|
|
922
922
|
let a = t.body || t.documentElement;
|
|
923
|
-
return e && r && a.insertBefore(n.createTextNode(r), a.childNodes[0] || null), Ae === ke ? D.call(t,
|
|
923
|
+
return e && r && a.insertBefore(n.createTextNode(r), a.childNodes[0] || null), Ae === ke ? D.call(t, le ? "html" : "body")[0] : le ? t.documentElement : a;
|
|
924
924
|
}, Je = function(e) {
|
|
925
925
|
return T.call(e.ownerDocument || e, e, l.SHOW_ELEMENT | l.SHOW_COMMENT | l.SHOW_TEXT | l.SHOW_PROCESSING_INSTRUCTION | l.SHOW_CDATA_SECTION, null);
|
|
926
926
|
}, Ye = function(e) {
|
|
@@ -940,7 +940,7 @@ function or() {
|
|
|
940
940
|
if (Ze(k.uponSanitizeElement, e, {
|
|
941
941
|
tagName: r,
|
|
942
942
|
allowedTags: L
|
|
943
|
-
}),
|
|
943
|
+
}), ce && e.hasChildNodes() && !Xe(e.firstElementChild) && Dn(/<[/\w!]/g, e.innerHTML) && Dn(/<[/\w!]/g, e.textContent) || ce && e.namespaceURI === ke && r === "style" && Xe(e.firstElementChild) || e.nodeType === nr.progressingInstruction || ce && e.nodeType === nr.comment && Dn(/<[/\w]/g, e.data)) return Ge(e), !0;
|
|
944
944
|
if (re[r] || !(ae.tagCheck instanceof Function && ae.tagCheck(r)) && !L[r]) {
|
|
945
945
|
if (!re[r] && tt(r) && (B.tagNameCheck instanceof RegExp && Dn(B.tagNameCheck, r) || B.tagNameCheck instanceof Function && B.tagNameCheck(r))) return !1;
|
|
946
946
|
if (ve && !xe[r]) {
|
|
@@ -955,7 +955,7 @@ function or() {
|
|
|
955
955
|
}
|
|
956
956
|
return Ge(e), !0;
|
|
957
957
|
}
|
|
958
|
-
return e instanceof c && !We(e) || (r === "noscript" || r === "noembed" || r === "noframes") && Dn(/<\/no(script|embed|frames)/i, e.innerHTML) ? (Ge(e), !0) : (
|
|
958
|
+
return e instanceof c && !We(e) || (r === "noscript" || r === "noembed" || r === "noframes") && Dn(/<\/no(script|embed|frames)/i, e.innerHTML) ? (Ge(e), !0) : (U && e.nodeType === nr.text && (n = e.textContent, un([
|
|
959
959
|
A,
|
|
960
960
|
j,
|
|
961
961
|
M
|
|
@@ -965,10 +965,10 @@ function or() {
|
|
|
965
965
|
}, $e = function(e, t, r) {
|
|
966
966
|
if (ie[t] || he && (t === "id" || t === "name") && (r in n || r in Be)) return !1;
|
|
967
967
|
let i = z[t] || ae.attributeCheck instanceof Function && ae.attributeCheck(t, e);
|
|
968
|
-
if (!(
|
|
968
|
+
if (!(se && !ie[t] && Dn(N, t)) && !(oe && Dn(ee, t))) {
|
|
969
969
|
if (!i || ie[t]) {
|
|
970
970
|
if (!(tt(e) && (B.tagNameCheck instanceof RegExp && Dn(B.tagNameCheck, e) || B.tagNameCheck instanceof Function && B.tagNameCheck(e)) && (B.attributeNameCheck instanceof RegExp && Dn(B.attributeNameCheck, t) || B.attributeNameCheck instanceof Function && B.attributeNameCheck(t, e)) || t === "is" && B.allowCustomizedBuiltInElements && (B.tagNameCheck instanceof RegExp && Dn(B.tagNameCheck, r) || B.tagNameCheck instanceof Function && B.tagNameCheck(r)))) return !1;
|
|
971
|
-
} else if (!Te[t] && !Dn(te, yn(r, F, "")) && !((t === "src" || t === "xlink:href" || t === "href") && e !== "script" && bn(r, "data:") === 0 && Ce[e]) && !(
|
|
971
|
+
} else if (!Te[t] && !Dn(te, yn(r, F, "")) && !((t === "src" || t === "xlink:href" || t === "href") && e !== "script" && bn(r, "data:") === 0 && Ce[e]) && !(V && !Dn(P, yn(r, F, ""))) && r) return !1;
|
|
972
972
|
}
|
|
973
973
|
return !0;
|
|
974
974
|
}, et = Y({}, [
|
|
@@ -995,7 +995,7 @@ function or() {
|
|
|
995
995
|
}, i = n.length;
|
|
996
996
|
for (; i--;) {
|
|
997
997
|
let a = n[i], o = a.name, s = a.namespaceURI, c = a.value, l = W(o), u = c, d = o === "value" ? u : xn(u);
|
|
998
|
-
if (r.attrName = l, r.attrValue = d, r.keepAttr = !0, r.forceKeepAttr = void 0, Ze(k.uponSanitizeAttribute, e, r), d = r.attrValue, ge && (l === "id" || l === "name") && bn(d, _e) !== 0 && (Ke(o, e), d = _e + d),
|
|
998
|
+
if (r.attrName = l, r.attrValue = d, r.keepAttr = !0, r.forceKeepAttr = void 0, Ze(k.uponSanitizeAttribute, e, r), d = r.attrValue, ge && (l === "id" || l === "name") && bn(d, _e) !== 0 && (Ke(o, e), d = _e + d), ce && Dn(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, d)) {
|
|
999
999
|
Ke(o, e);
|
|
1000
1000
|
continue;
|
|
1001
1001
|
}
|
|
@@ -1012,7 +1012,7 @@ function or() {
|
|
|
1012
1012
|
Ke(o, e);
|
|
1013
1013
|
continue;
|
|
1014
1014
|
}
|
|
1015
|
-
|
|
1015
|
+
U && un([
|
|
1016
1016
|
A,
|
|
1017
1017
|
j,
|
|
1018
1018
|
M
|
|
@@ -1069,7 +1069,7 @@ function or() {
|
|
|
1069
1069
|
it(e);
|
|
1070
1070
|
} else if (e instanceof s) i = qe("<!---->"), o = i.ownerDocument.importNode(e, !0), o.nodeType === nr.element && o.nodeName === "BODY" || o.nodeName === "HTML" ? i = o : i.appendChild(o), it(o);
|
|
1071
1071
|
else {
|
|
1072
|
-
if (!fe && !
|
|
1072
|
+
if (!fe && !U && !le && e.indexOf("<") === -1) return x && me ? x.createHTML(e) : e;
|
|
1073
1073
|
if (i = qe(e), !i) return fe ? null : me ? S : "";
|
|
1074
1074
|
}
|
|
1075
1075
|
i && de && Ge(i.firstChild);
|
|
@@ -1077,7 +1077,7 @@ function or() {
|
|
|
1077
1077
|
for (; c = u.nextNode();) Qe(c), nt(c), c.content instanceof a && rt(c.content);
|
|
1078
1078
|
if (ye) return e;
|
|
1079
1079
|
if (fe) {
|
|
1080
|
-
if (
|
|
1080
|
+
if (U) {
|
|
1081
1081
|
i.normalize();
|
|
1082
1082
|
let e = i.innerHTML;
|
|
1083
1083
|
un([
|
|
@@ -1092,8 +1092,8 @@ function or() {
|
|
|
1092
1092
|
else l = i;
|
|
1093
1093
|
return (z.shadowroot || z.shadowrootmode) && (l = O.call(r, l, !0)), l;
|
|
1094
1094
|
}
|
|
1095
|
-
let d =
|
|
1096
|
-
return
|
|
1095
|
+
let d = le ? i.outerHTML : i.innerHTML;
|
|
1096
|
+
return le && L["!doctype"] && i.ownerDocument && i.ownerDocument.doctype && i.ownerDocument.doctype.name && Dn(er, i.ownerDocument.doctype.name) && (d = "<!DOCTYPE " + i.ownerDocument.doctype.name + ">\n" + d), U && un([
|
|
1097
1097
|
A,
|
|
1098
1098
|
j,
|
|
1099
1099
|
M
|
|
@@ -4163,40 +4163,53 @@ var oc = null, sc = null;
|
|
|
4163
4163
|
function cc({ environment: e }) {
|
|
4164
4164
|
He(e);
|
|
4165
4165
|
let t = w(!1), r = w(!1), i = w(!1), a = w(!1), o = w(!1), s = w(!1), c = w(!1), l = w(!1), u = w(!1), d = w(!1), f = w(!1), p = w(!1), m = w(typeof navigator < "u" ? !navigator.onLine : !1), h = w(!1), g = w(null), _ = w(null), v = w([]), y = w([]), b = w([]), x = w([]), S = w(!1), C = w(!1), T = w(null), E = w(null), D = w(null), O = w(null), k = w([]), A = w({}), j = n(() => k.value.length);
|
|
4166
|
-
function M(
|
|
4166
|
+
function M() {
|
|
4167
|
+
return typeof navigator < "u" ? !navigator.onLine : !1;
|
|
4168
|
+
}
|
|
4169
|
+
function N() {
|
|
4170
|
+
let e = M();
|
|
4171
|
+
if (e !== m.value) {
|
|
4172
|
+
if (m.value = e, e) {
|
|
4173
|
+
p.value = !1, ye();
|
|
4174
|
+
return;
|
|
4175
|
+
}
|
|
4176
|
+
se = !0, V || Se(!0);
|
|
4177
|
+
}
|
|
4178
|
+
}
|
|
4179
|
+
function ee(e) {
|
|
4167
4180
|
if (!e.length) return;
|
|
4168
4181
|
let t = { ...A.value };
|
|
4169
4182
|
for (let n of e) n.uid && n.displayName.trim() && (t[n.uid] = n.displayName);
|
|
4170
4183
|
A.value = t;
|
|
4171
4184
|
}
|
|
4172
|
-
function
|
|
4173
|
-
|
|
4185
|
+
function P(e) {
|
|
4186
|
+
ee(Object.entries(Vt(e)).map(([e, t]) => ({
|
|
4174
4187
|
uid: e,
|
|
4175
4188
|
displayName: t
|
|
4176
4189
|
})));
|
|
4177
4190
|
}
|
|
4178
|
-
function
|
|
4179
|
-
return
|
|
4191
|
+
function F(e, t) {
|
|
4192
|
+
return P(e), fc(e, t);
|
|
4180
4193
|
}
|
|
4181
|
-
let
|
|
4182
|
-
async function
|
|
4183
|
-
await lc(e), !t.value && (
|
|
4194
|
+
let I = n(() => v.value.find((e) => e.id === T.value) ?? null), te = `bcc-ui-connection-${crypto.randomUUID()}`, L = `bcc-ui-message-${crypto.randomUUID()}`, R = !1, z = !1, ne = null, B = null, re = null, ie = null, ae = 0, oe = 0, se = !1, V = !1, U = null, ce = /* @__PURE__ */ new Map(), le = /* @__PURE__ */ new Set(), ue = null, de = null, fe = 0;
|
|
4195
|
+
async function pe() {
|
|
4196
|
+
await lc(e), !t.value && (ve(), ft(), t.value = !0, await ut(), _.value && (dt(_.value.uid), ge(), Te(), !m.value && !V && Ce()));
|
|
4184
4197
|
}
|
|
4185
|
-
async function
|
|
4198
|
+
async function me(e) {
|
|
4186
4199
|
g.value = null, r.value = !0;
|
|
4187
4200
|
try {
|
|
4188
|
-
await
|
|
4201
|
+
await pe();
|
|
4189
4202
|
let t = qe();
|
|
4190
4203
|
await H.getLoggedinUser() && t !== e && await H.logout(), Je(e);
|
|
4191
4204
|
let n = await uc(e);
|
|
4192
|
-
_.value = hc(await H.login(n)), dt(_.value.uid), h.value = !0, m.value = typeof navigator < "u" ? !navigator.onLine : !1,
|
|
4205
|
+
_.value = hc(await H.login(n)), dt(_.value.uid), h.value = !0, m.value = typeof navigator < "u" ? !navigator.onLine : !1, ge(), Te(), V || await Ce(), await ke(), qt();
|
|
4193
4206
|
} catch (e) {
|
|
4194
4207
|
throw St(), g.value = Z(e, "Unable to sign in to chat."), e;
|
|
4195
4208
|
} finally {
|
|
4196
4209
|
r.value = !1;
|
|
4197
4210
|
}
|
|
4198
4211
|
}
|
|
4199
|
-
async function
|
|
4212
|
+
async function he() {
|
|
4200
4213
|
g.value = null;
|
|
4201
4214
|
try {
|
|
4202
4215
|
Je(null), Qe(), await H.getLoggedinUser() && await H.logout();
|
|
@@ -4204,16 +4217,16 @@ function cc({ environment: e }) {
|
|
|
4204
4217
|
St();
|
|
4205
4218
|
}
|
|
4206
4219
|
}
|
|
4207
|
-
function
|
|
4220
|
+
function ge() {
|
|
4208
4221
|
let e = lt();
|
|
4209
4222
|
if (!e) {
|
|
4210
|
-
|
|
4223
|
+
U = null, k.value = [];
|
|
4211
4224
|
return;
|
|
4212
4225
|
}
|
|
4213
4226
|
let t = `bcc-chat:${G().appId}:${e}`;
|
|
4214
|
-
|
|
4227
|
+
_e(t), U = new $s(t), k.value = U.getQueue();
|
|
4215
4228
|
}
|
|
4216
|
-
function
|
|
4229
|
+
function _e(e) {
|
|
4217
4230
|
if (typeof window > "u") return;
|
|
4218
4231
|
let t = `bcc-chat:${G().appId}:`, n = [];
|
|
4219
4232
|
for (let r = 0; r < window.localStorage.length; r += 1) {
|
|
@@ -4222,33 +4235,27 @@ function cc({ environment: e }) {
|
|
|
4222
4235
|
}
|
|
4223
4236
|
n.forEach((e) => window.localStorage.removeItem(e));
|
|
4224
4237
|
}
|
|
4225
|
-
function ge() {
|
|
4226
|
-
L || typeof window > "u" || (window.addEventListener("online", _e), window.addEventListener("offline", ve), L = !0);
|
|
4227
|
-
}
|
|
4228
|
-
function _e() {
|
|
4229
|
-
m.value = !1, ae = !0, oe || Se(!0);
|
|
4230
|
-
}
|
|
4231
4238
|
function ve() {
|
|
4232
|
-
|
|
4239
|
+
z || typeof window > "u" || (window.addEventListener("online", N), window.addEventListener("offline", N), window.addEventListener("focus", N), document.addEventListener("visibilitychange", N), z = !0, N());
|
|
4233
4240
|
}
|
|
4234
4241
|
function ye() {
|
|
4235
|
-
|
|
4242
|
+
ne !== null && (clearTimeout(ne), ne = null);
|
|
4236
4243
|
}
|
|
4237
4244
|
function be() {
|
|
4238
|
-
|
|
4245
|
+
ae = Date.now() + 1500;
|
|
4239
4246
|
}
|
|
4240
4247
|
function xe() {
|
|
4241
|
-
return Date.now() <
|
|
4248
|
+
return Date.now() < ae;
|
|
4242
4249
|
}
|
|
4243
4250
|
function Se(e = !1) {
|
|
4244
|
-
if (
|
|
4245
|
-
let t = e ? 0 : Math.min(3e4, 1e3 * 2 ** Math.min(
|
|
4246
|
-
|
|
4247
|
-
|
|
4251
|
+
if (ne !== null || B || m.value || !h.value || V) return;
|
|
4252
|
+
let t = e ? 0 : Math.min(3e4, 1e3 * 2 ** Math.min(oe, 4));
|
|
4253
|
+
ne = setTimeout(() => {
|
|
4254
|
+
ne = null, Ce();
|
|
4248
4255
|
}, t);
|
|
4249
4256
|
}
|
|
4250
4257
|
async function Ce() {
|
|
4251
|
-
if (!(m.value || !h.value ||
|
|
4258
|
+
if (N(), !(m.value || !h.value || V)) return B || (B = (async () => {
|
|
4252
4259
|
ye();
|
|
4253
4260
|
try {
|
|
4254
4261
|
let e = await H.getLoggedinUser();
|
|
@@ -4258,47 +4265,47 @@ function cc({ environment: e }) {
|
|
|
4258
4265
|
let n = await uc(t);
|
|
4259
4266
|
e = await H.login(n);
|
|
4260
4267
|
}
|
|
4261
|
-
_.value = hc(e), h.value = !0,
|
|
4268
|
+
_.value = hc(e), h.value = !0, ge();
|
|
4262
4269
|
let t = H.connect;
|
|
4263
|
-
typeof t == "function" && (await t.call(H), p.value = !0),
|
|
4270
|
+
typeof t == "function" && (await t.call(H), p.value = !0), oe = 0, se && await we();
|
|
4264
4271
|
} catch (e) {
|
|
4265
|
-
p.value = !1,
|
|
4272
|
+
p.value = !1, oe += 1, Lt(e) || (g.value = Z(e, "Unable to reconnect to chat.")), Se();
|
|
4266
4273
|
} finally {
|
|
4267
|
-
|
|
4274
|
+
B = null;
|
|
4268
4275
|
}
|
|
4269
|
-
})(),
|
|
4276
|
+
})(), B);
|
|
4270
4277
|
}
|
|
4271
4278
|
async function we() {
|
|
4272
|
-
return
|
|
4273
|
-
|
|
4279
|
+
return re || m.value || !h.value || V || (re = (async () => {
|
|
4280
|
+
se = !1, g.value = null;
|
|
4274
4281
|
try {
|
|
4275
4282
|
await ke(), qt();
|
|
4276
4283
|
} finally {
|
|
4277
|
-
|
|
4284
|
+
re = null;
|
|
4278
4285
|
}
|
|
4279
|
-
})()),
|
|
4286
|
+
})()), re;
|
|
4280
4287
|
}
|
|
4281
4288
|
function Te() {
|
|
4282
|
-
if (!
|
|
4283
|
-
let e =
|
|
4289
|
+
if (!U || v.value.length > 0) return;
|
|
4290
|
+
let e = U.getConversations();
|
|
4284
4291
|
e.length !== 0 && (v.value = bc(e), !T.value && v.value.length > 0 && Ee(T.value));
|
|
4285
4292
|
}
|
|
4286
4293
|
function Ee(e) {
|
|
4287
|
-
if (!
|
|
4288
|
-
let t =
|
|
4294
|
+
if (!U || !e) return y.value = [], !1;
|
|
4295
|
+
let t = U.getMessages(e).sort(xc);
|
|
4289
4296
|
return y.value = t, t.length > 0;
|
|
4290
4297
|
}
|
|
4291
4298
|
async function De() {
|
|
4292
|
-
|
|
4299
|
+
V = !1, se = !0, await Ce();
|
|
4293
4300
|
}
|
|
4294
4301
|
async function Oe() {
|
|
4295
|
-
|
|
4302
|
+
V = !0, se = !1, ye();
|
|
4296
4303
|
let e = H.disconnect;
|
|
4297
4304
|
typeof e == "function" && await e.call(H), p.value = !1;
|
|
4298
4305
|
}
|
|
4299
4306
|
async function ke() {
|
|
4300
|
-
if (await
|
|
4301
|
-
v.value = bc(
|
|
4307
|
+
if (await pe(), N(), i.value = !0, g.value = null, m.value) {
|
|
4308
|
+
v.value = bc(U?.getConversations() ?? []), I.value && await rt(), i.value = !1;
|
|
4302
4309
|
return;
|
|
4303
4310
|
}
|
|
4304
4311
|
try {
|
|
@@ -4311,9 +4318,9 @@ function cc({ environment: e }) {
|
|
|
4311
4318
|
let t = r.get(e.id);
|
|
4312
4319
|
t && (e.subtitle === "No messages yet" && t.subtitle && t.subtitle !== "No messages yet" && (e.subtitle = t.subtitle), !e.lastMessageAt && t.lastMessageAt && (e.lastMessageAt = t.lastMessageAt), !e.lastMessage && t.lastMessage && (e.lastMessage = t.lastMessage));
|
|
4313
4320
|
}
|
|
4314
|
-
v.value = bc(await mt(t)),
|
|
4321
|
+
v.value = bc(await mt(t)), U?.setConversations(v.value), I.value && await rt();
|
|
4315
4322
|
} catch (e) {
|
|
4316
|
-
let t =
|
|
4323
|
+
let t = U?.getConversations() ?? [];
|
|
4317
4324
|
if (t.length > 0) {
|
|
4318
4325
|
v.value = bc(t);
|
|
4319
4326
|
return;
|
|
@@ -4324,7 +4331,7 @@ function cc({ environment: e }) {
|
|
|
4324
4331
|
}
|
|
4325
4332
|
}
|
|
4326
4333
|
async function Ae(e) {
|
|
4327
|
-
T.value = e, E.value = null, b.value = [],
|
|
4334
|
+
T.value = e, E.value = null, b.value = [], de = null, C.value = !1, D.value = null, O.value = null, Ee(e), await rt();
|
|
4328
4335
|
}
|
|
4329
4336
|
function je(e) {
|
|
4330
4337
|
e && (O.value = null), D.value = e;
|
|
@@ -4333,14 +4340,14 @@ function cc({ environment: e }) {
|
|
|
4333
4340
|
e && (D.value = null), O.value = e;
|
|
4334
4341
|
}
|
|
4335
4342
|
async function Ne(e) {
|
|
4336
|
-
E.value = e,
|
|
4343
|
+
E.value = e, de = null, C.value = !1, D.value = null, O.value = null, await at(e.id);
|
|
4337
4344
|
}
|
|
4338
4345
|
function Pe() {
|
|
4339
|
-
E.value = null, b.value = [],
|
|
4346
|
+
E.value = null, b.value = [], de = null, C.value = !1, D.value = null, O.value = null;
|
|
4340
4347
|
}
|
|
4341
4348
|
async function Fe(e, t) {
|
|
4342
4349
|
if (u.value) return;
|
|
4343
|
-
let n =
|
|
4350
|
+
let n = I.value;
|
|
4344
4351
|
if (!n) return;
|
|
4345
4352
|
let r = Vs(e);
|
|
4346
4353
|
if (!Hs(r)) return;
|
|
@@ -4367,7 +4374,7 @@ function cc({ environment: e }) {
|
|
|
4367
4374
|
let e = new H.TextMessage(n.targetId, r, kc(n));
|
|
4368
4375
|
e.setMuid?.(a), Object.keys(o).length > 0 && e.setMetadata?.(o), i && e.setParentMessageId?.(Number(i));
|
|
4369
4376
|
let t = await H.sendMessage(e);
|
|
4370
|
-
wt(
|
|
4377
|
+
wt(F(t, _.value?.uid)), gt(t), await yt(t), D.value = null;
|
|
4371
4378
|
} catch (e) {
|
|
4372
4379
|
if (Lt(e)) {
|
|
4373
4380
|
Gt("queued", a), Rt(n, r, o, E.value?.id, a), D.value = null;
|
|
@@ -4379,7 +4386,7 @@ function cc({ environment: e }) {
|
|
|
4379
4386
|
}
|
|
4380
4387
|
}
|
|
4381
4388
|
async function Ie(e, t) {
|
|
4382
|
-
let n =
|
|
4389
|
+
let n = I.value;
|
|
4383
4390
|
if (!n || m.value) return;
|
|
4384
4391
|
let r = Vs(t);
|
|
4385
4392
|
if (Hs(r)) {
|
|
@@ -4388,7 +4395,7 @@ function cc({ environment: e }) {
|
|
|
4388
4395
|
let t;
|
|
4389
4396
|
e.kind === "text" ? t = new H.TextMessage(n.targetId, r, kc(n)) : (t = new H.MediaMessage(n.targetId, e.source?.getAttachment?.()?.getFileUrl?.() ?? e.source?.getAttachment?.()?.getUrl?.() ?? e.attachments[0]?.url ?? "", e.source?.getType?.() ?? e.type ?? e.kind, kc(n)), t.setCaption(r)), t.setId(Number(e.id));
|
|
4390
4397
|
let i = await H.editMessage(t);
|
|
4391
|
-
wt(
|
|
4398
|
+
wt(F(i, _.value?.uid)), gt(i), O.value = null;
|
|
4392
4399
|
} catch (e) {
|
|
4393
4400
|
throw g.value = Z(e, "Unable to edit the message."), e;
|
|
4394
4401
|
} finally {
|
|
@@ -4398,7 +4405,7 @@ function cc({ environment: e }) {
|
|
|
4398
4405
|
}
|
|
4399
4406
|
async function Le(e, t) {
|
|
4400
4407
|
if (u.value) return;
|
|
4401
|
-
let n =
|
|
4408
|
+
let n = I.value;
|
|
4402
4409
|
if (!n) return;
|
|
4403
4410
|
let r = E.value?.id, i = crypto.randomUUID(), a = Dc(Ft(D.value, t), i), o = Nc(e.file);
|
|
4404
4411
|
u.value = !0, g.value = null;
|
|
@@ -4425,7 +4432,7 @@ function cc({ environment: e }) {
|
|
|
4425
4432
|
let t = new H.MediaMessage(n.targetId, e.file, o, kc(n));
|
|
4426
4433
|
t.setMuid?.(i), Object.keys(a).length > 0 && t.setMetadata?.(a), r && t.setParentMessageId?.(Number(r)), e.caption?.trim() && t.setCaption?.(e.caption.trim());
|
|
4427
4434
|
let s = await H.sendMediaMessage(t);
|
|
4428
|
-
wt(
|
|
4435
|
+
wt(F(s, _.value?.uid)), gt(s), await yt(s), D.value = null;
|
|
4429
4436
|
} catch (t) {
|
|
4430
4437
|
if (Lt(t)) {
|
|
4431
4438
|
Gt("queued", i), await Ht(n, e, a, r, i), D.value = null;
|
|
@@ -4438,7 +4445,7 @@ function cc({ environment: e }) {
|
|
|
4438
4445
|
}
|
|
4439
4446
|
async function Re(e, t) {
|
|
4440
4447
|
if (u.value) return;
|
|
4441
|
-
let n =
|
|
4448
|
+
let n = I.value;
|
|
4442
4449
|
if (!n) return;
|
|
4443
4450
|
let r = e.question.trim(), i = e.options.map((e) => e.trim()).filter(Boolean);
|
|
4444
4451
|
if (!r || i.length < 2) return;
|
|
@@ -4473,7 +4480,7 @@ function cc({ environment: e }) {
|
|
|
4473
4480
|
};
|
|
4474
4481
|
a && (e.parentMessageId = Number(a)), Object.keys(s).length > 0 && (e.metadata = s);
|
|
4475
4482
|
let t = await H.callExtension("polls", "POST", "v2/create", e), c = t?.message ?? t?.custom_message ?? t?.data?.message ?? null;
|
|
4476
|
-
c ? (Kt(o), wt(
|
|
4483
|
+
c ? (Kt(o), wt(F(c, _.value?.uid)), gt(c), await yt(c)) : (Kt(o), await Ct()), D.value = null;
|
|
4477
4484
|
} catch (e) {
|
|
4478
4485
|
if (Lt(e)) {
|
|
4479
4486
|
Gt("queued", o), zt(n, {
|
|
@@ -4528,7 +4535,7 @@ function cc({ environment: e }) {
|
|
|
4528
4535
|
let n = Et(e.id, e.parentMessageId) ?? e, r = n.reactions.find((e) => e.emoji === t && e.reactedByMe);
|
|
4529
4536
|
wt(Dt(n, t));
|
|
4530
4537
|
try {
|
|
4531
|
-
wt(
|
|
4538
|
+
wt(F(r ? await H.removeReaction(Number(e.id), t) : await H.addReaction(Number(e.id), t), _.value?.uid));
|
|
4532
4539
|
} catch (e) {
|
|
4533
4540
|
throw wt(n), g.value = Z(e, "Unable to update the reaction."), e;
|
|
4534
4541
|
}
|
|
@@ -4539,7 +4546,7 @@ function cc({ environment: e }) {
|
|
|
4539
4546
|
return;
|
|
4540
4547
|
}
|
|
4541
4548
|
if (!m.value) try {
|
|
4542
|
-
let t =
|
|
4549
|
+
let t = F(await H.deleteMessage(String(e.id)), _.value?.uid);
|
|
4543
4550
|
At(t), jt(t);
|
|
4544
4551
|
} catch (e) {
|
|
4545
4552
|
throw g.value = Z(e, "Unable to delete the message."), e;
|
|
@@ -4570,29 +4577,29 @@ function cc({ environment: e }) {
|
|
|
4570
4577
|
}
|
|
4571
4578
|
}
|
|
4572
4579
|
async function We(e) {
|
|
4573
|
-
let t = e ??
|
|
4580
|
+
let t = e ?? I.value?.targetId, n = _.value?.uid, r = ++fe;
|
|
4574
4581
|
if (!t || !n) {
|
|
4575
|
-
r ===
|
|
4582
|
+
r === fe && (x.value = []);
|
|
4576
4583
|
return;
|
|
4577
4584
|
}
|
|
4578
4585
|
l.value = !0, g.value = null;
|
|
4579
4586
|
try {
|
|
4580
4587
|
let e = new H.MessagesRequestBuilder().setLimit(50).setGUID(n).withTags(!0).setTags([t]).build(), i = [], a = [];
|
|
4581
4588
|
do
|
|
4582
|
-
a = await e.fetchPrevious(), i.push(...a.map((e) =>
|
|
4589
|
+
a = await e.fetchPrevious(), i.push(...a.map((e) => F(e, _.value?.uid)));
|
|
4583
4590
|
while (a.length === 50);
|
|
4584
4591
|
let o = i.filter((e) => !(e.isDeleted || !e.scheduled?.scheduleDate || t && e.scheduled.originalChatUid && e.scheduled.originalChatUid !== t)).sort((e, t) => (e.scheduled?.scheduleDate?.getTime() ?? e.sentAt.getTime()) - (t.scheduled?.scheduleDate?.getTime() ?? t.sentAt.getTime()));
|
|
4585
|
-
if (r !==
|
|
4592
|
+
if (r !== fe) return;
|
|
4586
4593
|
x.value = o;
|
|
4587
4594
|
} catch (e) {
|
|
4588
|
-
if (r !==
|
|
4595
|
+
if (r !== fe) return;
|
|
4589
4596
|
throw g.value = Z(e, vt("loadScheduledMessagesError")), e;
|
|
4590
4597
|
} finally {
|
|
4591
|
-
r ===
|
|
4598
|
+
r === fe && (l.value = !1);
|
|
4592
4599
|
}
|
|
4593
4600
|
}
|
|
4594
4601
|
async function Ge(e, t) {
|
|
4595
|
-
let n =
|
|
4602
|
+
let n = I.value;
|
|
4596
4603
|
if (n) {
|
|
4597
4604
|
d.value = !0, g.value = null;
|
|
4598
4605
|
try {
|
|
@@ -4695,26 +4702,27 @@ function cc({ environment: e }) {
|
|
|
4695
4702
|
}
|
|
4696
4703
|
}
|
|
4697
4704
|
async function nt(e) {
|
|
4698
|
-
let t =
|
|
4699
|
-
if (!t) return y.value = [], S.value = !1, !1;
|
|
4700
|
-
if ((e?.reset ||
|
|
4705
|
+
let t = I.value;
|
|
4706
|
+
if (!t || m.value) return y.value = [], S.value = !1, !1;
|
|
4707
|
+
if ((e?.reset || ue?.conversationId !== t.id) && (ue = {
|
|
4701
4708
|
conversationId: t.id,
|
|
4702
4709
|
request: Ze(t)
|
|
4703
|
-
}, S.value = !0), !
|
|
4704
|
-
let n = await tt(
|
|
4705
|
-
y.value = e?.reset ? Cc(y.value.filter((e) => e.conversationId === t.id && wc(e)), r) : Cc(y.value, r), S.value = n.length === 50,
|
|
4710
|
+
}, S.value = !0), !ue) return !1;
|
|
4711
|
+
let n = await tt(ue.request), r = await Promise.all(n.map((e) => F(e, _.value?.uid)).filter(Tc).sort(xc).map(et));
|
|
4712
|
+
y.value = e?.reset ? Cc(y.value.filter((e) => e.conversationId === t.id && wc(e)), r) : Cc(y.value, r), S.value = n.length === 50, U?.setMessages(t.id, y.value);
|
|
4706
4713
|
let i = n[n.length - 1];
|
|
4707
4714
|
return i && (await bt(i), await yt(i)), n.length > 0;
|
|
4708
4715
|
}
|
|
4709
4716
|
async function rt() {
|
|
4710
|
-
|
|
4717
|
+
N();
|
|
4718
|
+
let e = I.value;
|
|
4711
4719
|
if (!e) {
|
|
4712
|
-
y.value = [], S.value = !1,
|
|
4720
|
+
y.value = [], S.value = !1, ue = null;
|
|
4713
4721
|
return;
|
|
4714
4722
|
}
|
|
4715
4723
|
let t = Ee(e.id);
|
|
4716
|
-
if (a.value = !0, m.value
|
|
4717
|
-
S.value = !1,
|
|
4724
|
+
if (a.value = !0, m.value) {
|
|
4725
|
+
S.value = !1, ue = null, a.value = !1;
|
|
4718
4726
|
return;
|
|
4719
4727
|
}
|
|
4720
4728
|
try {
|
|
@@ -4722,9 +4730,9 @@ function cc({ environment: e }) {
|
|
|
4722
4730
|
...t,
|
|
4723
4731
|
lastMessage: y.value.at(-1) ?? null,
|
|
4724
4732
|
unreadCount: 0
|
|
4725
|
-
} : t),
|
|
4733
|
+
} : t), U?.setConversations(v.value);
|
|
4726
4734
|
} catch (n) {
|
|
4727
|
-
let r =
|
|
4735
|
+
let r = U?.getMessages(e.id) ?? [];
|
|
4728
4736
|
if (r.length > 0) {
|
|
4729
4737
|
t || (y.value = r.sort(xc));
|
|
4730
4738
|
return;
|
|
@@ -4737,24 +4745,24 @@ function cc({ environment: e }) {
|
|
|
4737
4745
|
async function it(e) {
|
|
4738
4746
|
let t = E.value?.id;
|
|
4739
4747
|
if (!t) return b.value = [], C.value = !1, !1;
|
|
4740
|
-
if ((e?.reset ||
|
|
4748
|
+
if ((e?.reset || de?.parentMessageId !== t) && (de = {
|
|
4741
4749
|
parentMessageId: t,
|
|
4742
4750
|
request: $e(t)
|
|
4743
|
-
}, C.value = !0), !
|
|
4744
|
-
let n = await
|
|
4745
|
-
b.value = e?.reset ? Cc(b.value.filter((e) => e.parentMessageId === t && wc(e)), r) : Cc(b.value, r), C.value = n.length === 50,
|
|
4751
|
+
}, C.value = !0), !de) return !1;
|
|
4752
|
+
let n = await de.request.fetchPrevious(), r = await Promise.all(n.map((e) => F(e, _.value?.uid)).filter(Tc).sort(xc).map(et));
|
|
4753
|
+
b.value = e?.reset ? Cc(b.value.filter((e) => e.parentMessageId === t && wc(e)), r) : Cc(b.value, r), C.value = n.length === 50, U?.setThreadMessages(t, b.value);
|
|
4746
4754
|
let i = n[n.length - 1];
|
|
4747
4755
|
return i && (await bt(i), await yt(i)), n.length > 0;
|
|
4748
4756
|
}
|
|
4749
4757
|
async function at(e) {
|
|
4750
|
-
if (o.value = !0, m.value
|
|
4751
|
-
b.value =
|
|
4758
|
+
if (o.value = !0, m.value) {
|
|
4759
|
+
b.value = (U?.getThreadMessages(e) ?? []).sort(xc), C.value = !1, de = null, o.value = !1;
|
|
4752
4760
|
return;
|
|
4753
4761
|
}
|
|
4754
4762
|
try {
|
|
4755
4763
|
await it({ reset: !0 });
|
|
4756
4764
|
} catch (t) {
|
|
4757
|
-
let n =
|
|
4765
|
+
let n = U?.getThreadMessages(e) ?? [];
|
|
4758
4766
|
if (n.length > 0) {
|
|
4759
4767
|
b.value = n.sort(xc);
|
|
4760
4768
|
return;
|
|
@@ -4798,7 +4806,7 @@ function cc({ environment: e }) {
|
|
|
4798
4806
|
if (n()) return !0;
|
|
4799
4807
|
if (!e) break;
|
|
4800
4808
|
}
|
|
4801
|
-
for (; S.value &&
|
|
4809
|
+
for (; S.value && I.value && r < 100;) {
|
|
4802
4810
|
r += 1;
|
|
4803
4811
|
let e = await ot();
|
|
4804
4812
|
if (n()) return !0;
|
|
@@ -4811,18 +4819,18 @@ function cc({ environment: e }) {
|
|
|
4811
4819
|
_.value = e ? hc(e) : null, h.value = !!e;
|
|
4812
4820
|
}
|
|
4813
4821
|
function ft() {
|
|
4814
|
-
|
|
4822
|
+
R ||= (H.addConnectionListener(te, new H.ConnectionListener({
|
|
4815
4823
|
onConnected: () => {
|
|
4816
|
-
if (p.value = !0,
|
|
4824
|
+
if (p.value = !0, oe = 0, ye(), se) {
|
|
4817
4825
|
we();
|
|
4818
4826
|
return;
|
|
4819
4827
|
}
|
|
4820
4828
|
qt();
|
|
4821
4829
|
},
|
|
4822
4830
|
onDisconnected: () => {
|
|
4823
|
-
p.value = !1, !m.value && h.value && !
|
|
4831
|
+
p.value = !1, !m.value && h.value && !V && (se = !0, Se(!0));
|
|
4824
4832
|
}
|
|
4825
|
-
})), H.addMessageListener(
|
|
4833
|
+
})), H.addMessageListener(L, new H.MessageListener({
|
|
4826
4834
|
onTextMessageReceived: (e) => {
|
|
4827
4835
|
pt(e);
|
|
4828
4836
|
},
|
|
@@ -4839,11 +4847,11 @@ function cc({ environment: e }) {
|
|
|
4839
4847
|
xe() || Ct({ includeThread: !1 });
|
|
4840
4848
|
},
|
|
4841
4849
|
onMessageEdited: (e) => {
|
|
4842
|
-
let t =
|
|
4850
|
+
let t = F(e, _.value?.uid);
|
|
4843
4851
|
Tc(t) && (_t(t), gt(e));
|
|
4844
4852
|
},
|
|
4845
4853
|
onMessageDeleted: (e) => {
|
|
4846
|
-
let t =
|
|
4854
|
+
let t = F(e, _.value?.uid);
|
|
4847
4855
|
t.parentMessageId ? At(t) : (At(t), jt(t)), kt();
|
|
4848
4856
|
},
|
|
4849
4857
|
onMessageReactionAdded: () => {
|
|
@@ -4861,7 +4869,7 @@ function cc({ environment: e }) {
|
|
|
4861
4869
|
})), !0);
|
|
4862
4870
|
}
|
|
4863
4871
|
async function pt(e) {
|
|
4864
|
-
let t =
|
|
4872
|
+
let t = F(e, _.value?.uid);
|
|
4865
4873
|
if (Tc(t)) {
|
|
4866
4874
|
if (gt(e), await bt(e), t.parentMessageId) {
|
|
4867
4875
|
K(t), Ot(t.parentMessageId), kt();
|
|
@@ -4880,7 +4888,7 @@ function cc({ environment: e }) {
|
|
|
4880
4888
|
}));
|
|
4881
4889
|
}
|
|
4882
4890
|
async function ht(e) {
|
|
4883
|
-
let t =
|
|
4891
|
+
let t = U?.getParticipantSettings(e), n = t?.lastUpdated ? Date.now() - t.lastUpdated > 1440 * 60 * 1e3 : !0;
|
|
4884
4892
|
if (t && (m.value || !n)) return t.mutedUntil;
|
|
4885
4893
|
if (m.value || !h.value) return t?.mutedUntil ?? null;
|
|
4886
4894
|
try {
|
|
@@ -4897,7 +4905,7 @@ function cc({ environment: e }) {
|
|
|
4897
4905
|
});
|
|
4898
4906
|
if (!i.ok) return t?.mutedUntil ?? null;
|
|
4899
4907
|
let a = await i.json();
|
|
4900
|
-
return
|
|
4908
|
+
return U?.storeParticipantSettings({
|
|
4901
4909
|
chatUid: e,
|
|
4902
4910
|
mutedUntil: a.mutedUntil ?? null,
|
|
4903
4911
|
lastUpdated: Date.now()
|
|
@@ -4907,7 +4915,7 @@ function cc({ environment: e }) {
|
|
|
4907
4915
|
}
|
|
4908
4916
|
}
|
|
4909
4917
|
function gt(e) {
|
|
4910
|
-
let t =
|
|
4918
|
+
let t = F(e, _.value?.uid);
|
|
4911
4919
|
if (!Tc(t) || t.isDeleted) return;
|
|
4912
4920
|
let n = e.getConversationId(), r = v.value.find((e) => e.id === n);
|
|
4913
4921
|
if (!r) {
|
|
@@ -4921,13 +4929,13 @@ function cc({ environment: e }) {
|
|
|
4921
4929
|
unreadCount: n === T.value ? 0 : r.unreadCount + 1,
|
|
4922
4930
|
lastMessage: t
|
|
4923
4931
|
};
|
|
4924
|
-
v.value = bc(v.value.map((e) => e.id === n ? i : e)),
|
|
4932
|
+
v.value = bc(v.value.map((e) => e.id === n ? i : e)), U?.setConversations(v.value);
|
|
4925
4933
|
}
|
|
4926
4934
|
function _t(e) {
|
|
4927
|
-
y.value = Sc(y.value, e), T.value &&
|
|
4935
|
+
y.value = Sc(y.value, e), T.value && U?.setMessages(T.value, y.value);
|
|
4928
4936
|
}
|
|
4929
4937
|
function K(e) {
|
|
4930
|
-
e.parentMessageId === E.value?.id && (b.value = Sc(b.value, e), e.parentMessageId &&
|
|
4938
|
+
e.parentMessageId === E.value?.id && (b.value = Sc(b.value, e), e.parentMessageId && U?.setThreadMessages(e.parentMessageId, b.value));
|
|
4931
4939
|
}
|
|
4932
4940
|
async function yt(e) {
|
|
4933
4941
|
if (m.value) return;
|
|
@@ -4943,18 +4951,18 @@ function cc({ environment: e }) {
|
|
|
4943
4951
|
return m.value ? [] : pc(await H.getMessageReceipts(String(e.id)));
|
|
4944
4952
|
}
|
|
4945
4953
|
function St() {
|
|
4946
|
-
r.value = !1, i.value = !1, a.value = !1, o.value = !1, s.value = !1, c.value = !1, l.value = !1, u.value = !1, d.value = !1, f.value = !1, p.value = !1, ye(),
|
|
4954
|
+
r.value = !1, i.value = !1, a.value = !1, o.value = !1, s.value = !1, c.value = !1, l.value = !1, u.value = !1, d.value = !1, f.value = !1, p.value = !1, ye(), oe = 0, se = !1, V = !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, ue = null, de = null, le.clear();
|
|
4947
4955
|
}
|
|
4948
4956
|
async function Ct(e) {
|
|
4949
|
-
if (
|
|
4957
|
+
if (ie) return ie;
|
|
4950
4958
|
let t = e?.includeThread ?? !0;
|
|
4951
|
-
|
|
4952
|
-
|
|
4959
|
+
ie = (async () => {
|
|
4960
|
+
I.value && await rt(), t && E.value && await at(E.value.id);
|
|
4953
4961
|
})();
|
|
4954
4962
|
try {
|
|
4955
|
-
await
|
|
4963
|
+
await ie;
|
|
4956
4964
|
} finally {
|
|
4957
|
-
|
|
4965
|
+
ie = null;
|
|
4958
4966
|
}
|
|
4959
4967
|
}
|
|
4960
4968
|
function wt(e) {
|
|
@@ -5001,13 +5009,13 @@ function cc({ environment: e }) {
|
|
|
5001
5009
|
y.value = Sc(y.value, r), E.value?.id === e && (E.value = r);
|
|
5002
5010
|
}
|
|
5003
5011
|
function kt() {
|
|
5004
|
-
T.value &&
|
|
5012
|
+
T.value && U?.setMessages(T.value, y.value), E.value && U?.setThreadMessages(E.value.id, b.value);
|
|
5005
5013
|
}
|
|
5006
5014
|
function At(e) {
|
|
5007
|
-
if (e.parentMessageId ? (b.value = b.value.filter((t) => t.id !== e.id),
|
|
5015
|
+
if (e.parentMessageId ? (b.value = b.value.filter((t) => t.id !== e.id), U?.setThreadMessages(e.parentMessageId, b.value)) : (y.value = y.value.filter((t) => t.id !== e.id), T.value && U?.setMessages(T.value, y.value)), e.muid) {
|
|
5008
5016
|
k.value = k.value.filter((t) => t.muid !== e.muid);
|
|
5009
|
-
let t =
|
|
5010
|
-
for (let e of t)
|
|
5017
|
+
let t = U?.getQueue().filter((t) => t.muid === e.muid) ?? [];
|
|
5018
|
+
for (let e of t) U?.dequeue(e.id), ce.delete(e.id), e.kind === "attachment" && U?.deleteQueuedAttachment(e.id);
|
|
5011
5019
|
}
|
|
5012
5020
|
e.parentMessageId || Mt(e.conversationId);
|
|
5013
5021
|
}
|
|
@@ -5034,7 +5042,7 @@ function cc({ environment: e }) {
|
|
|
5034
5042
|
...e,
|
|
5035
5043
|
subtitle: "No messages yet",
|
|
5036
5044
|
lastMessageAt: void 0
|
|
5037
|
-
} : e : e)),
|
|
5045
|
+
} : e : e)), U?.setConversations(v.value);
|
|
5038
5046
|
}
|
|
5039
5047
|
function Mt(e, t) {
|
|
5040
5048
|
let n = y.value.length > 0 ? y.value[y.value.length - 1] : null, r = t ?? n;
|
|
@@ -5043,7 +5051,7 @@ function cc({ environment: e }) {
|
|
|
5043
5051
|
subtitle: r ? Oc(r) : "No messages yet",
|
|
5044
5052
|
lastMessageAt: r?.sentAt,
|
|
5045
5053
|
lastMessage: r
|
|
5046
|
-
} : t)),
|
|
5054
|
+
} : t)), U?.setConversations(v.value);
|
|
5047
5055
|
}
|
|
5048
5056
|
function Nt(e) {
|
|
5049
5057
|
v.value = bc(v.value.map((t) => t.id === e.conversationId ? {
|
|
@@ -5052,7 +5060,7 @@ function cc({ environment: e }) {
|
|
|
5052
5060
|
lastMessageAt: e.sentAt,
|
|
5053
5061
|
lastMessage: e,
|
|
5054
5062
|
unreadCount: 0
|
|
5055
|
-
} : t)),
|
|
5063
|
+
} : t)), U?.setConversations(v.value);
|
|
5056
5064
|
}
|
|
5057
5065
|
function Pt(e) {
|
|
5058
5066
|
let t = /* @__PURE__ */ new Date(), n = It(e.metadata);
|
|
@@ -5110,7 +5118,7 @@ function cc({ environment: e }) {
|
|
|
5110
5118
|
};
|
|
5111
5119
|
}
|
|
5112
5120
|
function Lt(e) {
|
|
5113
|
-
if (
|
|
5121
|
+
if (M() || m.value) return !0;
|
|
5114
5122
|
let t = Z(e, "").toLowerCase();
|
|
5115
5123
|
return t.includes("network") || t.includes("failed to fetch") || t.includes("socket") || t.includes("offline");
|
|
5116
5124
|
}
|
|
@@ -5203,14 +5211,14 @@ function cc({ environment: e }) {
|
|
|
5203
5211
|
parentMessageId: r,
|
|
5204
5212
|
createdAt: o.sentAt.toISOString()
|
|
5205
5213
|
};
|
|
5206
|
-
|
|
5214
|
+
ce.set(s.id, t.file);
|
|
5207
5215
|
try {
|
|
5208
|
-
await
|
|
5216
|
+
await U?.storeQueuedAttachment(s.id, t.file);
|
|
5209
5217
|
} catch {}
|
|
5210
5218
|
Ut(o, s);
|
|
5211
5219
|
}
|
|
5212
5220
|
function Ut(e, t) {
|
|
5213
|
-
k.value = [...k.value, t],
|
|
5221
|
+
k.value = [...k.value, t], U?.enqueue(t), Wt(e);
|
|
5214
5222
|
}
|
|
5215
5223
|
function Wt(e) {
|
|
5216
5224
|
e.parentMessageId ? (E.value?.id === e.parentMessageId && (b.value = Sc(b.value, e)), Ot(e.parentMessageId)) : y.value = Sc(y.value, e), Nt(e), kt();
|
|
@@ -5238,14 +5246,14 @@ function cc({ environment: e }) {
|
|
|
5238
5246
|
if (!(f.value || k.value.length === 0 || !h.value || m.value)) {
|
|
5239
5247
|
f.value = !0;
|
|
5240
5248
|
try {
|
|
5241
|
-
let e = [...k.value].filter((e) => !
|
|
5242
|
-
for (let t of e) if (!
|
|
5243
|
-
|
|
5249
|
+
let e = [...k.value].filter((e) => !le.has(e.id)).sort((e, t) => e.createdAt.localeCompare(t.createdAt));
|
|
5250
|
+
for (let t of e) if (!le.has(t.id)) {
|
|
5251
|
+
le.add(t.id);
|
|
5244
5252
|
try {
|
|
5245
5253
|
let e = await Jt(t);
|
|
5246
|
-
k.value = k.value.filter((e) => e.id !== t.id),
|
|
5254
|
+
k.value = k.value.filter((e) => e.id !== t.id), U?.dequeue(t.id), ce.delete(t.id), t.kind === "attachment" && await U?.deleteQueuedAttachment(t.id), Kt(t.muid), e ? wt(F(e, _.value?.uid)) : await Ct();
|
|
5247
5255
|
} finally {
|
|
5248
|
-
|
|
5256
|
+
le.delete(t.id);
|
|
5249
5257
|
}
|
|
5250
5258
|
}
|
|
5251
5259
|
} catch (e) {
|
|
@@ -5269,7 +5277,7 @@ function cc({ environment: e }) {
|
|
|
5269
5277
|
return r?.message ?? r?.custom_message ?? r?.data?.message ?? null;
|
|
5270
5278
|
}
|
|
5271
5279
|
if (e.kind === "attachment" && e.attachment) {
|
|
5272
|
-
let n =
|
|
5280
|
+
let n = ce.get(e.id) ?? await U?.getQueuedAttachment(e.id) ?? null;
|
|
5273
5281
|
if (!n) throw Error(`Queued attachment ${e.attachment.name} is no longer available for upload.`);
|
|
5274
5282
|
let r = new H.MediaMessage(e.targetId, n, e.attachment.kind, t);
|
|
5275
5283
|
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);
|
|
@@ -5302,15 +5310,15 @@ function cc({ environment: e }) {
|
|
|
5302
5310
|
hasOlderThreadMessages: C,
|
|
5303
5311
|
pendingQueueCount: j,
|
|
5304
5312
|
activeConversationId: T,
|
|
5305
|
-
activeConversation:
|
|
5313
|
+
activeConversation: I,
|
|
5306
5314
|
activeThreadParentMessage: E,
|
|
5307
5315
|
replyToMessage: D,
|
|
5308
5316
|
editingMessage: O,
|
|
5309
|
-
init:
|
|
5317
|
+
init: pe,
|
|
5310
5318
|
connectRealtime: De,
|
|
5311
5319
|
disconnectRealtime: Oe,
|
|
5312
|
-
login:
|
|
5313
|
-
logout:
|
|
5320
|
+
login: me,
|
|
5321
|
+
logout: he,
|
|
5314
5322
|
fetchConversations: ke,
|
|
5315
5323
|
selectConversation: Ae,
|
|
5316
5324
|
sendTextMessage: Fe,
|
|
@@ -5335,7 +5343,7 @@ function cc({ environment: e }) {
|
|
|
5335
5343
|
toggleReaction: Be,
|
|
5336
5344
|
translateMessage: Ue,
|
|
5337
5345
|
mentionDisplayNamesByUid: A,
|
|
5338
|
-
rememberMentionDisplayNames:
|
|
5346
|
+
rememberMentionDisplayNames: ee
|
|
5339
5347
|
};
|
|
5340
5348
|
}
|
|
5341
5349
|
async function lc(e) {
|
|
@@ -7057,7 +7065,7 @@ function ud(e, t, r, i) {
|
|
|
7057
7065
|
e.key === "Escape" && (O(), g());
|
|
7058
7066
|
}
|
|
7059
7067
|
}
|
|
7060
|
-
function
|
|
7068
|
+
function N(e) {
|
|
7061
7069
|
e.preventDefault();
|
|
7062
7070
|
let t = e.clipboardData?.getData("text/html") ?? "", n = e.clipboardData?.getData("text/plain") ?? "";
|
|
7063
7071
|
if (document.execCommand("styleWithCSS", !1, "false"), t) {
|
|
@@ -7069,7 +7077,7 @@ function ud(e, t, r, i) {
|
|
|
7069
7077
|
}
|
|
7070
7078
|
n && (document.execCommand("insertText", !1, n), E());
|
|
7071
7079
|
}
|
|
7072
|
-
function
|
|
7080
|
+
function ee(e) {
|
|
7073
7081
|
if (!k()) {
|
|
7074
7082
|
O();
|
|
7075
7083
|
return;
|
|
@@ -7106,10 +7114,10 @@ function ud(e, t, r, i) {
|
|
|
7106
7114
|
editorKey: o,
|
|
7107
7115
|
focusEditor: D,
|
|
7108
7116
|
formatMenuPosition: c,
|
|
7109
|
-
handleContextMenu:
|
|
7117
|
+
handleContextMenu: ee,
|
|
7110
7118
|
handleInput: j,
|
|
7111
7119
|
handleKeydown: M,
|
|
7112
|
-
handlePaste:
|
|
7120
|
+
handlePaste: N,
|
|
7113
7121
|
hideFormatMenu: O,
|
|
7114
7122
|
resetEditor: L,
|
|
7115
7123
|
showFormatMenu: s,
|
|
@@ -7148,7 +7156,7 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
|
|
|
7148
7156
|
{
|
|
7149
7157
|
kind: "file",
|
|
7150
7158
|
label: "attachFile",
|
|
7151
|
-
icon:
|
|
7159
|
+
icon: ce,
|
|
7152
7160
|
testId: "composer-attach-file"
|
|
7153
7161
|
}
|
|
7154
7162
|
];
|
|
@@ -7192,7 +7200,7 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
|
|
|
7192
7200
|
class: "composer-actions-menu__item",
|
|
7193
7201
|
"data-testid": "composer-create-poll",
|
|
7194
7202
|
onClick: g
|
|
7195
|
-
}, [o("span", pd, [(S(), r(D(j(
|
|
7203
|
+
}, [o("span", pd, [(S(), r(D(j(le)), { class: "size-5" }))]), o("span", null, k(j(u)("createPoll")), 1)])], 512)), [[P, c.value]]);
|
|
7196
7204
|
}
|
|
7197
7205
|
}), $ = (e, t) => {
|
|
7198
7206
|
let n = e.__vccOpts || e;
|
|
@@ -7342,7 +7350,7 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
|
|
|
7342
7350
|
])]))), 128)),
|
|
7343
7351
|
l(j(z), {
|
|
7344
7352
|
label: j(d)("addOption"),
|
|
7345
|
-
icon: j(
|
|
7353
|
+
icon: j(U),
|
|
7346
7354
|
text: "",
|
|
7347
7355
|
onClick: h
|
|
7348
7356
|
}, null, 8, ["label", "icon"])
|
|
@@ -7516,31 +7524,31 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
|
|
|
7516
7524
|
video: "video/*",
|
|
7517
7525
|
audio: "audio/*",
|
|
7518
7526
|
file: "*/*"
|
|
7519
|
-
}, u = e, d = s, f = w(null), m = w(null), _ = w(null), v = w("file"), y = w(!1), b = w(!1), x = w(!1), { t: C } = K(), T = null, E = w(null), D = w(null), O = w(null), { applyFormat: A, editorKey: M, formatMenuPosition:
|
|
7527
|
+
}, u = e, d = s, f = w(null), m = w(null), _ = w(null), v = w("file"), y = w(!1), b = w(!1), x = w(!1), { t: C } = K(), T = null, E = w(null), D = w(null), O = w(null), { applyFormat: A, editorKey: M, formatMenuPosition: N, focusEditor: ee, handleContextMenu: P, handleInput: I, handleKeydown: te, handlePaste: R, hideFormatMenu: ne, resetEditor: B, showFormatMenu: re, triggerCandidates: ie, triggerMenuPosition: ae, highlightedTriggerIndex: oe, showTriggerMenu: se, selectTriggerCandidate: H } = ud(E, D, O, {
|
|
7520
7528
|
getModelValue: () => u.modelValue,
|
|
7521
7529
|
updateModelValue: (e) => d("update:modelValue", e),
|
|
7522
7530
|
submit: () => Te(),
|
|
7523
7531
|
getMentionCandidates: () => u.mentionCandidates ?? [],
|
|
7524
7532
|
getMentionNameByUid: () => u.mentionNameByUid ?? {},
|
|
7525
7533
|
mentionsEnabled: () => u.mentionsEnabled ?? (u.mentionCandidates?.length ?? 0) > 0
|
|
7526
|
-
}),
|
|
7534
|
+
}), ce = n(() => c[v.value]), le = n(() => {
|
|
7527
7535
|
if (!_.value) return null;
|
|
7528
7536
|
let e = _.value.type;
|
|
7529
7537
|
return e.startsWith("image/") ? "image" : e.startsWith("video/") ? "video" : e.startsWith("audio/") ? "audio" : "file";
|
|
7530
7538
|
}), ue = n(() => {
|
|
7531
|
-
switch (
|
|
7539
|
+
switch (le.value) {
|
|
7532
7540
|
case "image": return C("image");
|
|
7533
7541
|
case "video": return C("video");
|
|
7534
7542
|
case "audio": return C("audio");
|
|
7535
7543
|
case "file": return C("file");
|
|
7536
7544
|
default: return C("attachment");
|
|
7537
7545
|
}
|
|
7538
|
-
}), pe = n(() => !u.editingMessage && !u.replyToMessage ? "" : u.compact ? "pt-1" : "pt-1.5"), me = n(() => Hs(u.modelValue) || !!_.value), he = n(() => me.value &&
|
|
7546
|
+
}), pe = n(() => !u.editingMessage && !u.replyToMessage ? "" : u.compact ? "pt-1" : "pt-1.5"), me = n(() => Hs(u.modelValue) || !!_.value), he = n(() => me.value && le.value !== "file"), ge = n(() => _.value ? C("attachmentSummary", { name: _.value.name }) : Us(u.modelValue) || C("currentDraftWillBeScheduled"));
|
|
7539
7547
|
F(() => u.resetSignal, () => {
|
|
7540
7548
|
B(), _.value = null, y.value = !1, b.value = !1, f.value && (f.value.value = "");
|
|
7541
7549
|
});
|
|
7542
7550
|
async function _e() {
|
|
7543
|
-
await h(),
|
|
7551
|
+
await h(), ee();
|
|
7544
7552
|
}
|
|
7545
7553
|
function ye() {
|
|
7546
7554
|
m.value?.hide();
|
|
@@ -7622,7 +7630,7 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
|
|
|
7622
7630
|
ref: f,
|
|
7623
7631
|
type: "file",
|
|
7624
7632
|
class: "hidden",
|
|
7625
|
-
accept:
|
|
7633
|
+
accept: ce.value,
|
|
7626
7634
|
disabled: e.disabled,
|
|
7627
7635
|
onChange: xe,
|
|
7628
7636
|
onCancel: ye
|
|
@@ -7668,7 +7676,7 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
|
|
|
7668
7676
|
disabled: e.disabled || !!e.editingMessage,
|
|
7669
7677
|
"aria-label": j(C)("addToMessage"),
|
|
7670
7678
|
"data-testid": "composer-actions-button",
|
|
7671
|
-
icon: j(
|
|
7679
|
+
icon: j(U),
|
|
7672
7680
|
onClick: we
|
|
7673
7681
|
}, null, 8, [
|
|
7674
7682
|
"class",
|
|
@@ -7693,7 +7701,7 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
|
|
|
7693
7701
|
onContextmenu: n[7] ||= (...e) => j(P) && j(P)(...e)
|
|
7694
7702
|
}, null, 42, Gd)),
|
|
7695
7703
|
_.value || e.editingMessage || e.contextLabel || e.offlineMode ? (S(), a("div", Kd, [
|
|
7696
|
-
e.editingMessage ? (S(), r(j(
|
|
7704
|
+
e.editingMessage ? (S(), r(j(V), {
|
|
7697
7705
|
key: 0,
|
|
7698
7706
|
text: j(C)("editing"),
|
|
7699
7707
|
context: "info",
|
|
@@ -7701,7 +7709,7 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
|
|
|
7701
7709
|
size: "sm",
|
|
7702
7710
|
class: "composer-meta-tag"
|
|
7703
7711
|
}, null, 8, ["text"])) : i("", !0),
|
|
7704
|
-
e.contextLabel ? (S(), r(j(
|
|
7712
|
+
e.contextLabel ? (S(), r(j(V), {
|
|
7705
7713
|
key: 1,
|
|
7706
7714
|
text: e.contextLabel,
|
|
7707
7715
|
context: "contrast",
|
|
@@ -7751,7 +7759,7 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
|
|
|
7751
7759
|
], 2),
|
|
7752
7760
|
l(xd, {
|
|
7753
7761
|
visible: j(re),
|
|
7754
|
-
position: j(
|
|
7762
|
+
position: j(N),
|
|
7755
7763
|
onFormat: n[9] ||= (e) => j(A)(e)
|
|
7756
7764
|
}, null, 8, ["visible", "position"]),
|
|
7757
7765
|
l(zd, {
|
|
@@ -7759,7 +7767,7 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
|
|
|
7759
7767
|
ref: O,
|
|
7760
7768
|
"highlighted-index": j(oe),
|
|
7761
7769
|
"onUpdate:highlightedIndex": n[10] ||= (e) => p(oe) ? oe.value = e : null,
|
|
7762
|
-
visible: j(
|
|
7770
|
+
visible: j(se),
|
|
7763
7771
|
position: j(ae),
|
|
7764
7772
|
candidates: j(ie),
|
|
7765
7773
|
onSelect: n[11] ||= (e) => j(H)(e)
|
|
@@ -7840,10 +7848,10 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
|
|
|
7840
7848
|
Zu(f, "ui:closeComposerActions", () => {
|
|
7841
7849
|
M.value?.hideComposerActions();
|
|
7842
7850
|
});
|
|
7843
|
-
async function
|
|
7851
|
+
async function N() {
|
|
7844
7852
|
await M.value?.focusEditor();
|
|
7845
7853
|
}
|
|
7846
|
-
return t({ focusEditor:
|
|
7854
|
+
return t({ focusEditor: N }), (e, t) => y.value ? (S(), r(Yd, {
|
|
7847
7855
|
key: 0,
|
|
7848
7856
|
ref_key: "composerRef",
|
|
7849
7857
|
ref: M,
|
|
@@ -8309,7 +8317,7 @@ var uf = { class: "w-full" }, df = {
|
|
|
8309
8317
|
props: { attachment: {} },
|
|
8310
8318
|
emits: ["close"],
|
|
8311
8319
|
setup(t, { emit: s }) {
|
|
8312
|
-
let c = t, l = s, u = w(null), d = w(null), f = n(() => !!c.attachment?.url), p = n(() => c.attachment?.kind === "image"), m = n(() => c.attachment?.kind === "video"), h = n(() => c.attachment?.kind === "audio"), { t: _ } = K(), { scale: y, translateX: b, translateY: x, isDragging: C, resetTransform: T, handlePointerDown: E, handlePointerMove: O, handlePointerUp: A, handlePointerCancel: M, handleWheel:
|
|
8320
|
+
let c = t, l = s, u = w(null), d = w(null), f = n(() => !!c.attachment?.url), p = n(() => c.attachment?.kind === "image"), m = n(() => c.attachment?.kind === "video"), h = n(() => c.attachment?.kind === "audio"), { t: _ } = K(), { scale: y, translateX: b, translateY: x, isDragging: C, resetTransform: T, handlePointerDown: E, handlePointerMove: O, handlePointerUp: A, handlePointerCancel: M, handleWheel: N, handleDoubleClick: ee } = lf({
|
|
8313
8321
|
viewportRef: u,
|
|
8314
8322
|
imageRef: d,
|
|
8315
8323
|
isImage: () => p.value
|
|
@@ -8349,8 +8357,8 @@ var uf = { class: "w-full" }, df = {
|
|
|
8349
8357
|
onPointerup: s[2] ||= (...e) => j(A) && j(A)(...e),
|
|
8350
8358
|
onPointercancel: s[3] ||= (...e) => j(M) && j(M)(...e),
|
|
8351
8359
|
onPointerleave: s[4] ||= (...e) => j(A) && j(A)(...e),
|
|
8352
|
-
onWheel: s[5] ||= (...e) => j(
|
|
8353
|
-
onDblclick: s[6] ||= (...e) => j(
|
|
8360
|
+
onWheel: s[5] ||= (...e) => j(N) && j(N)(...e),
|
|
8361
|
+
onDblclick: s[6] ||= (...e) => j(ee) && j(ee)(...e)
|
|
8354
8362
|
}, [o("img", {
|
|
8355
8363
|
ref_key: "imageRef",
|
|
8356
8364
|
ref: d,
|
|
@@ -8712,7 +8720,7 @@ var uf = { class: "w-full" }, df = {
|
|
|
8712
8720
|
function l() {
|
|
8713
8721
|
return t.message.senderName?.trim() || (t.message.isOwn ? s("you") : s("system"));
|
|
8714
8722
|
}
|
|
8715
|
-
return (t, n) => (S(), a("div", fp, [o("span", pp, k(l()), 1), e.message.scheduled?.scheduleDate ? (S(), r(j(
|
|
8723
|
+
return (t, n) => (S(), a("div", fp, [o("span", pp, k(l()), 1), e.message.scheduled?.scheduleDate ? (S(), r(j(V), {
|
|
8716
8724
|
key: 0,
|
|
8717
8725
|
text: j(s)("scheduledDateLabel", { date: c(e.message.scheduled.scheduleDate) }),
|
|
8718
8726
|
context: "warn",
|
|
@@ -9089,7 +9097,7 @@ var uf = { class: "w-full" }, df = {
|
|
|
9089
9097
|
label: t.conversation.avatar ? void 0 : t.conversation.title.slice(0, 1).toUpperCase(),
|
|
9090
9098
|
shape: "circle",
|
|
9091
9099
|
class: "chat-header__avatar shrink-0"
|
|
9092
|
-
}, null, 8, ["image", "label"]), o("div", Yp, [o("p", Xp, k(t.parentMessage ? j(n)("thread") : t.conversation.title), 1), o("p", Zp, [t.parentMessage ? (S(), a("span", Qp, k(t.parentMessage.senderName), 1)) : (S(), a("span", $p, k(t.conversation.memberCount ? j(n)("members", { count: t.conversation.memberCount }) : j(n)("groupChat")), 1))])])])) : i("", !0), o("div", em, [t.conversation?.tags?.length ? (S(), a("div", tm, [(S(!0), a(e, null, T(t.conversation.tags.slice(0, 3), (e) => (S(), r(j(
|
|
9100
|
+
}, null, 8, ["image", "label"]), o("div", Yp, [o("p", Xp, k(t.parentMessage ? j(n)("thread") : t.conversation.title), 1), o("p", Zp, [t.parentMessage ? (S(), a("span", Qp, k(t.parentMessage.senderName), 1)) : (S(), a("span", $p, k(t.conversation.memberCount ? j(n)("members", { count: t.conversation.memberCount }) : j(n)("groupChat")), 1))])])])) : i("", !0), o("div", em, [t.conversation?.tags?.length ? (S(), a("div", tm, [(S(!0), a(e, null, T(t.conversation.tags.slice(0, 3), (e) => (S(), r(j(V), {
|
|
9093
9101
|
key: e,
|
|
9094
9102
|
text: e,
|
|
9095
9103
|
context: "secondary",
|
|
@@ -9122,7 +9130,7 @@ var uf = { class: "w-full" }, df = {
|
|
|
9122
9130
|
}), O = n(() => {
|
|
9123
9131
|
let e = u.conversation.value;
|
|
9124
9132
|
return e ? _.value ? _.value.senderName : e.memberCount ? c("members", { count: e.memberCount }) : c("groupChat") : "";
|
|
9125
|
-
}), A = n(() => u.conversation.value?.memberCount ?? 0), M = w(null),
|
|
9133
|
+
}), A = n(() => u.conversation.value?.memberCount ?? 0), M = w(null), ee = w(null), P = n(() => !!_.value), F = n(() => P.value && !y.value), I = n(() => Eu(u.conversation.value)), te = N("threadRef"), { handleThreadScroll: L } = of({
|
|
9126
9134
|
getConversation: () => u.conversation.value,
|
|
9127
9135
|
getParentMessage: () => _.value,
|
|
9128
9136
|
getMessages: () => m.value,
|
|
@@ -9131,7 +9139,7 @@ var uf = { class: "w-full" }, df = {
|
|
|
9131
9139
|
canLoadOlder: () => b.value,
|
|
9132
9140
|
onLoadOlder: () => f.emit("list:loadOlder", { target: s.target }),
|
|
9133
9141
|
threadRef: te
|
|
9134
|
-
}), R =
|
|
9142
|
+
}), R = N("actionMenuRef"), { activeActionMessage: z, handleMessageContextMenu: ne, handleMessageTap: B, resetActionMenuState: re, reactToMessage: ie, toggleInlineReaction: ae, getActionItems: oe } = $d({
|
|
9135
9143
|
canUseMessageActions: () => u.canUseMessageActions.value,
|
|
9136
9144
|
canReact: () => u.canReact.value,
|
|
9137
9145
|
canReply: () => u.canReply.value,
|
|
@@ -9153,21 +9161,21 @@ var uf = { class: "w-full" }, df = {
|
|
|
9153
9161
|
},
|
|
9154
9162
|
onMenuOpen: () => f.emit("ui:closeComposerActions")
|
|
9155
9163
|
});
|
|
9156
|
-
function
|
|
9164
|
+
function se(e) {
|
|
9157
9165
|
return !!e.url && [
|
|
9158
9166
|
"image",
|
|
9159
9167
|
"video",
|
|
9160
9168
|
"audio"
|
|
9161
9169
|
].includes(e.kind);
|
|
9162
9170
|
}
|
|
9163
|
-
function
|
|
9164
|
-
|
|
9171
|
+
function V(e) {
|
|
9172
|
+
se(e) && (M.value = e);
|
|
9165
9173
|
}
|
|
9166
9174
|
function H() {
|
|
9167
9175
|
M.value = null;
|
|
9168
9176
|
}
|
|
9169
|
-
async function
|
|
9170
|
-
|
|
9177
|
+
async function U(e, t) {
|
|
9178
|
+
ee.value = `${e.id}:${t}`;
|
|
9171
9179
|
try {
|
|
9172
9180
|
f.emit("message:votePoll", {
|
|
9173
9181
|
message: e,
|
|
@@ -9175,19 +9183,19 @@ var uf = { class: "w-full" }, df = {
|
|
|
9175
9183
|
});
|
|
9176
9184
|
} finally {
|
|
9177
9185
|
window.setTimeout(() => {
|
|
9178
|
-
|
|
9186
|
+
ee.value === `${e.id}:${t}` && (ee.value = null);
|
|
9179
9187
|
}, 300);
|
|
9180
9188
|
}
|
|
9181
9189
|
}
|
|
9182
|
-
function
|
|
9190
|
+
function ce(e) {
|
|
9183
9191
|
v.value && f.emit("message:openThread", e);
|
|
9184
9192
|
}
|
|
9185
|
-
function
|
|
9193
|
+
function le(e, t) {
|
|
9186
9194
|
return e.getFullYear() !== t.getFullYear() || e.getMonth() !== t.getMonth() || e.getDate() !== t.getDate();
|
|
9187
9195
|
}
|
|
9188
9196
|
function ue(e) {
|
|
9189
9197
|
let t = m.value;
|
|
9190
|
-
return e === 0 ? !0 :
|
|
9198
|
+
return e === 0 ? !0 : le(t[e].sentAt, t[e - 1].sentAt);
|
|
9191
9199
|
}
|
|
9192
9200
|
return (t, n) => (S(), a(e, null, [
|
|
9193
9201
|
o("section", { class: g(["message-list-root", [t.$attrs.class, F.value ? "message-list--embedded-thread" : P.value ? "message-list--thread" : "message-list--main"]]) }, [y.value ? E(t.$slots, "header", {
|
|
@@ -9220,15 +9228,15 @@ var uf = { class: "w-full" }, df = {
|
|
|
9220
9228
|
"can-react": j(u).canReact.value,
|
|
9221
9229
|
"can-open-thread": !_.value && v.value,
|
|
9222
9230
|
"can-show-sender-avatar": I.value,
|
|
9223
|
-
"pending-option-key":
|
|
9231
|
+
"pending-option-key": ee.value,
|
|
9224
9232
|
"action-message-class": s.actionMessageClass,
|
|
9225
9233
|
"action-message-row-class": s.actionMessageRowClass,
|
|
9226
9234
|
onContextmenu: (e) => j(ne)(o, e),
|
|
9227
9235
|
onTap: (e) => j(B)(o, e),
|
|
9228
|
-
onOpenMedia:
|
|
9229
|
-
onVotePoll: (e) =>
|
|
9236
|
+
onOpenMedia: V,
|
|
9237
|
+
onVotePoll: (e) => U(o, e),
|
|
9230
9238
|
onToggleReaction: (e) => j(ae)(o, e),
|
|
9231
|
-
onOpenThread: (e) =>
|
|
9239
|
+
onOpenThread: (e) => ce(o),
|
|
9232
9240
|
onOpenReferencedMessage: n[0] ||= (e) => j(f).emit("message:openReference", e),
|
|
9233
9241
|
onAnchorclick: n[1] ||= (e, n) => t.$emit("anchorclick", e, n)
|
|
9234
9242
|
}, null, 8, [
|
|
@@ -9336,19 +9344,19 @@ var uf = { class: "w-full" }, df = {
|
|
|
9336
9344
|
}, {
|
|
9337
9345
|
default: I(() => [e.message ? (S(), a("div", Sm, [o("div", Cm, [o("p", wm, k(j(Ws)(e.message, j(d)("message"), j(f).mentionNameByUid.value)), 1), o("div", Tm, [
|
|
9338
9346
|
o("div", Em, [o("p", Dm, k(j(d)("sent")), 1), o("p", Om, k(g(e.message.sentAt)), 1)]),
|
|
9339
|
-
o("div", km, [o("div", Am, [o("p", jm, k(j(d)("deliveredToAll")), 1), h.value.length ? (S(), r(j(
|
|
9347
|
+
o("div", km, [o("div", Am, [o("p", jm, k(j(d)("deliveredToAll")), 1), h.value.length ? (S(), r(j(V), {
|
|
9340
9348
|
key: 0,
|
|
9341
9349
|
text: String(h.value.length),
|
|
9342
9350
|
context: "secondary",
|
|
9343
9351
|
rounded: ""
|
|
9344
9352
|
}, null, 8, ["text"])) : i("", !0)]), o("p", Mm, k(_(e.message.receipts.deliveredAt, h.value.length)), 1)]),
|
|
9345
|
-
o("div", Nm, [o("div", Pm, [o("p", Fm, k(j(d)("readByAll")), 1), m.value.length ? (S(), r(j(
|
|
9353
|
+
o("div", Nm, [o("div", Pm, [o("p", Fm, k(j(d)("readByAll")), 1), m.value.length ? (S(), r(j(V), {
|
|
9346
9354
|
key: 0,
|
|
9347
9355
|
text: String(m.value.length),
|
|
9348
9356
|
context: "success",
|
|
9349
9357
|
rounded: ""
|
|
9350
9358
|
}, null, 8, ["text"])) : i("", !0)]), o("p", Im, k(_(e.message.receipts.readAt, m.value.length)), 1)])
|
|
9351
|
-
])]), e.loading ? (S(), a("div", Lm, [l(j(
|
|
9359
|
+
])]), e.loading ? (S(), a("div", Lm, [l(j(se), {
|
|
9352
9360
|
style: {
|
|
9353
9361
|
width: "2.5rem",
|
|
9354
9362
|
height: "2.5rem"
|
|
@@ -9454,7 +9462,7 @@ var uf = { class: "w-full" }, df = {
|
|
|
9454
9462
|
function M() {
|
|
9455
9463
|
d.value = null, f.value = null, p.value = !1, m.value = "", h.value = "", g.value = "";
|
|
9456
9464
|
}
|
|
9457
|
-
function
|
|
9465
|
+
function N(e) {
|
|
9458
9466
|
return {
|
|
9459
9467
|
...e,
|
|
9460
9468
|
text: ""
|
|
@@ -9497,7 +9505,7 @@ var uf = { class: "w-full" }, df = {
|
|
|
9497
9505
|
"close-label": j(v)("close"),
|
|
9498
9506
|
onClose: s[3] ||= (e) => u("close")
|
|
9499
9507
|
}, {
|
|
9500
|
-
default: I(() => [o("div", Vm, [t.loading ? (S(), a("div", Hm, [l(j(
|
|
9508
|
+
default: I(() => [o("div", Vm, [t.loading ? (S(), a("div", Hm, [l(j(se), {
|
|
9501
9509
|
style: {
|
|
9502
9510
|
width: "2.75rem",
|
|
9503
9511
|
height: "2.75rem"
|
|
@@ -9507,17 +9515,17 @@ var uf = { class: "w-full" }, df = {
|
|
|
9507
9515
|
key: e.id,
|
|
9508
9516
|
class: "border-default rounded-lg border px-4 py-3"
|
|
9509
9517
|
}, [o("div", Gm, [o("div", Km, [
|
|
9510
|
-
o("div", qm, [o("div", Jm, [e.kind === "poll" ? (S(), r(j(
|
|
9518
|
+
o("div", qm, [o("div", Jm, [e.kind === "poll" ? (S(), r(j(V), {
|
|
9511
9519
|
key: 0,
|
|
9512
9520
|
text: j(v)("poll"),
|
|
9513
9521
|
context: "info",
|
|
9514
9522
|
rounded: ""
|
|
9515
|
-
}, null, 8, ["text"])) : e.attachments.length ? (S(), r(j(
|
|
9523
|
+
}, null, 8, ["text"])) : e.attachments.length ? (S(), r(j(V), {
|
|
9516
9524
|
key: 1,
|
|
9517
9525
|
text: D(e.attachments[0].kind),
|
|
9518
9526
|
context: "info",
|
|
9519
9527
|
rounded: ""
|
|
9520
|
-
}, null, 8, ["text"])) : (S(), r(j(
|
|
9528
|
+
}, null, 8, ["text"])) : (S(), r(j(V), {
|
|
9521
9529
|
key: 2,
|
|
9522
9530
|
text: j(v)("message"),
|
|
9523
9531
|
context: "info",
|
|
@@ -9529,7 +9537,7 @@ var uf = { class: "w-full" }, df = {
|
|
|
9529
9537
|
onClick: (t) => B(e)
|
|
9530
9538
|
}, null, 8, ["icon", "onClick"])]),
|
|
9531
9539
|
o("div", Ym, [o("p", Xm, k(x(e.scheduled?.scheduleDate)), 1), e.kind === "poll" && e.poll ? (S(), a("p", Zm, k(e.poll.question), 1)) : (S(), a("p", Qm, k(j(Ws)(e, j(v)("attachment"))), 1))]),
|
|
9532
|
-
L(e) && !(d.value === e.id && f.value === "text") ? (S(), a("div", $m, [l(cp, { message:
|
|
9540
|
+
L(e) && !(d.value === e.id && f.value === "text") ? (S(), a("div", $m, [l(cp, { message: N(e) }, null, 8, ["message"])])) : i("", !0)
|
|
9533
9541
|
]), o("div", eh, [e.kind === "poll" ? i("", !0) : (S(), r(j(z), {
|
|
9534
9542
|
key: 0,
|
|
9535
9543
|
label: j(v)("edit"),
|
|
@@ -9556,7 +9564,7 @@ var uf = { class: "w-full" }, df = {
|
|
|
9556
9564
|
"onUpdate:modelValue": s[0] ||= (e) => m.value = e,
|
|
9557
9565
|
type: "date",
|
|
9558
9566
|
class: "surface-input body-md w-full rounded-xl p-2 ring-0 outline-none"
|
|
9559
|
-
}, null, 512), [[
|
|
9567
|
+
}, null, 512), [[ee, m.value]]), te(o("input", {
|
|
9560
9568
|
"onUpdate:modelValue": s[1] ||= (e) => h.value = e,
|
|
9561
9569
|
type: "time",
|
|
9562
9570
|
inputmode: "numeric",
|
|
@@ -9564,7 +9572,7 @@ var uf = { class: "w-full" }, df = {
|
|
|
9564
9572
|
pattern: "^([01]\\d|2[0-3]):([0-5]\\d)$",
|
|
9565
9573
|
"aria-label": "Time (24-hour)",
|
|
9566
9574
|
class: "surface-input body-md w-full rounded-xl p-2 ring-0 outline-none"
|
|
9567
|
-
}, null, 512), [[
|
|
9575
|
+
}, null, 512), [[ee, h.value]])]), o("div", rh, [l(j(z), {
|
|
9568
9576
|
label: j(v)("save"),
|
|
9569
9577
|
size: "small",
|
|
9570
9578
|
disabled: !m.value || !b.value,
|
|
@@ -9579,7 +9587,7 @@ var uf = { class: "w-full" }, df = {
|
|
|
9579
9587
|
text: "",
|
|
9580
9588
|
onClick: M
|
|
9581
9589
|
}, null, 8, ["label"])])])) : d.value === e.id && f.value === "text" ? (S(), a("div", ih, [
|
|
9582
|
-
L(e) ? (S(), a("div", ah, [l(cp, { message:
|
|
9590
|
+
L(e) ? (S(), a("div", ah, [l(cp, { message: N(e) }, null, 8, ["message"]), o("div", oh, [l(j(z), {
|
|
9583
9591
|
icon: j(fe),
|
|
9584
9592
|
"aria-label": j(v)("remove"),
|
|
9585
9593
|
text: "",
|
|
@@ -9593,7 +9601,7 @@ var uf = { class: "w-full" }, df = {
|
|
|
9593
9601
|
rows: "3",
|
|
9594
9602
|
class: "surface-input body-md w-full rounded-xl px-3 py-2 ring-0 outline-none",
|
|
9595
9603
|
placeholder: j(v)("writeMessage")
|
|
9596
|
-
}, null, 8, sh), [[
|
|
9604
|
+
}, null, 8, sh), [[ee, g.value]]),
|
|
9597
9605
|
o("div", ch, [l(j(z), {
|
|
9598
9606
|
label: j(v)("cancel"),
|
|
9599
9607
|
size: "small",
|
|
@@ -9711,7 +9719,7 @@ var uf = { class: "w-full" }, df = {
|
|
|
9711
9719
|
onMembersChanged: (e) => {
|
|
9712
9720
|
p("chatMembersFetched", e), T.value?.rememberMentionDisplayNames(e);
|
|
9713
9721
|
}
|
|
9714
|
-
}),
|
|
9722
|
+
}), ee = Ou({
|
|
9715
9723
|
chatClient: T,
|
|
9716
9724
|
selectedConversation: O,
|
|
9717
9725
|
getPropIsReadOnly: () => f.isReadOnly,
|
|
@@ -9723,7 +9731,7 @@ var uf = { class: "w-full" }, df = {
|
|
|
9723
9731
|
currentUserId: T.value?.currentUser.value?.uid
|
|
9724
9732
|
})
|
|
9725
9733
|
});
|
|
9726
|
-
Au(
|
|
9734
|
+
Au(ee);
|
|
9727
9735
|
let P = Mu({
|
|
9728
9736
|
chatClient: T,
|
|
9729
9737
|
selectedConversation: O,
|
|
@@ -9744,10 +9752,10 @@ var uf = { class: "w-full" }, df = {
|
|
|
9744
9752
|
fetchErrorFallback: m("loadMessageReceiptsError")
|
|
9745
9753
|
});
|
|
9746
9754
|
Wu(R);
|
|
9747
|
-
let z =
|
|
9755
|
+
let z = N("mainComposerRef"), ne = N("threadComposerRef"), B = Lu({
|
|
9748
9756
|
chatClient: T,
|
|
9749
|
-
sendOptions:
|
|
9750
|
-
mentionNameByUid:
|
|
9757
|
+
sendOptions: ee.sendOptions,
|
|
9758
|
+
mentionNameByUid: ee.mentionNameByUid,
|
|
9751
9759
|
afterSchedule: () => R.openScheduledMessages(),
|
|
9752
9760
|
mainComposerRef: z,
|
|
9753
9761
|
threadComposerRef: ne
|
|
@@ -9755,7 +9763,7 @@ var uf = { class: "w-full" }, df = {
|
|
|
9755
9763
|
zu(B);
|
|
9756
9764
|
let re = Ju();
|
|
9757
9765
|
Yu(re), Ku({
|
|
9758
|
-
conversation:
|
|
9766
|
+
conversation: ee,
|
|
9759
9767
|
composer: B,
|
|
9760
9768
|
dialogs: R,
|
|
9761
9769
|
bus: re
|
|
@@ -9798,7 +9806,7 @@ var uf = { class: "w-full" }, df = {
|
|
|
9798
9806
|
e.conversations.value.length === 0 && await e.fetchConversations();
|
|
9799
9807
|
let t = e.conversations.value.find((e) => e.targetId === f.chatUid || e.id === f.chatUid) ?? null;
|
|
9800
9808
|
if (!t) try {
|
|
9801
|
-
t = await
|
|
9809
|
+
t = await se(f.chatUid, e);
|
|
9802
9810
|
} catch (e) {
|
|
9803
9811
|
if (e && typeof e == "object" && "code" in e && e.code === "ERR_NOT_A_MEMBER") {
|
|
9804
9812
|
v.value = !1, C.value = !0, p("chatMembersFetched", []);
|
|
@@ -9815,7 +9823,7 @@ var uf = { class: "w-full" }, df = {
|
|
|
9815
9823
|
}
|
|
9816
9824
|
}
|
|
9817
9825
|
}
|
|
9818
|
-
async function
|
|
9826
|
+
async function se(e, t) {
|
|
9819
9827
|
let n = await gu.getGroup(e, !0);
|
|
9820
9828
|
if (!n || typeof n != "object") return null;
|
|
9821
9829
|
let r = String(n.getGuid());
|
|
@@ -9834,7 +9842,7 @@ var uf = { class: "w-full" }, df = {
|
|
|
9834
9842
|
};
|
|
9835
9843
|
return t.conversations.value = [i, ...t.conversations.value.filter((e) => e.id !== i.id && e.targetId !== r)], i;
|
|
9836
9844
|
}
|
|
9837
|
-
function
|
|
9845
|
+
function V(e, t) {
|
|
9838
9846
|
p("linkClicked", e, t);
|
|
9839
9847
|
}
|
|
9840
9848
|
let H = w(!1);
|
|
@@ -9846,11 +9854,11 @@ var uf = { class: "w-full" }, df = {
|
|
|
9846
9854
|
let e = T.value;
|
|
9847
9855
|
e && e.activeConversation.value === O.value && e.selectConversation(null);
|
|
9848
9856
|
});
|
|
9849
|
-
async function
|
|
9850
|
-
return await new Promise((e) => setTimeout(e, 100)), H.value ? ie(e) : (await new Promise((e) => setTimeout(e, 110)),
|
|
9857
|
+
async function U(e) {
|
|
9858
|
+
return await new Promise((e) => setTimeout(e, 100)), H.value ? ie(e) : (await new Promise((e) => setTimeout(e, 110)), U(e));
|
|
9851
9859
|
}
|
|
9852
9860
|
return r({
|
|
9853
|
-
scrollToMessage:
|
|
9861
|
+
scrollToMessage: U,
|
|
9854
9862
|
groupMembers: n(() => A.value)
|
|
9855
9863
|
}), (n, r) => (S(), a("div", {
|
|
9856
9864
|
ref_key: "chatRootRef",
|
|
@@ -9876,7 +9884,7 @@ var uf = { class: "w-full" }, df = {
|
|
|
9876
9884
|
"show-header": L.value,
|
|
9877
9885
|
"action-message-class": t.actionMessageClass,
|
|
9878
9886
|
"action-message-row-class": t.actionMessageRowClass,
|
|
9879
|
-
onAnchorclick:
|
|
9887
|
+
onAnchorclick: V
|
|
9880
9888
|
}, s({
|
|
9881
9889
|
composer: I(() => [l(Zd, {
|
|
9882
9890
|
ref_key: "mainComposerRef",
|