@mobilon-dev/chotto 0.3.90 → 0.3.92

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.
Files changed (62) hide show
  1. package/dist/chotto.css +1 -1
  2. package/dist/components/2_chatinput_elements/ButtonEmojiPicker/ButtonEmojiPicker.vue.js +1 -1
  3. package/dist/components/2_chatinput_elements/ButtonEmojiPicker/ButtonEmojiPicker.vue2.js +23 -23
  4. package/dist/components/2_chatinput_elements/FileUploader/FileUploader.vue.js +3 -3
  5. package/dist/components/2_chatinput_elements/FileUploader/FileUploader.vue2.js +87 -103
  6. package/dist/components/2_chatlist_elements/ChatItem/ChatItem.vue.js +2 -2
  7. package/dist/components/2_chatlist_elements/ChatItem/ChatItem.vue2.js +218 -182
  8. package/dist/components/2_elements/AudioRecorder/AudioRecorder.vue.js +2 -2
  9. package/dist/components/2_elements/AudioRecorder/AudioRecorder.vue2.js +52 -79
  10. package/dist/components/2_elements/VideoRecorder/VideoRecorder.vue.js +2 -2
  11. package/dist/components/2_elements/VideoRecorder/VideoRecorder.vue2.js +35 -64
  12. package/dist/components/2_feed_elements/AudioMessage/AudioMessage.vue.js +2 -2
  13. package/dist/components/2_feed_elements/AudioMessage/AudioMessage.vue2.js +4 -0
  14. package/dist/components/2_feed_elements/CallMessage/CallMessage.vue.js +3 -3
  15. package/dist/components/2_feed_elements/CallMessage/CallMessage.vue2.js +4 -0
  16. package/dist/components/2_feed_elements/FileMessage/FileMessage.vue.js +3 -3
  17. package/dist/components/2_feed_elements/FileMessage/FileMessage.vue2.js +33 -29
  18. package/dist/components/2_feed_elements/ImageMessage/ImageMessage.vue.js +2 -2
  19. package/dist/components/2_feed_elements/ImageMessage/ImageMessage.vue2.js +62 -58
  20. package/dist/components/2_feed_elements/MissedCallMessage/MissedCallMessage.vue.js +1 -1
  21. package/dist/components/2_feed_elements/MissedCallMessage/MissedCallMessage.vue2.js +27 -23
  22. package/dist/components/2_feed_elements/TextMessage/TextMessage.vue.js +2 -2
  23. package/dist/components/2_feed_elements/TextMessage/TextMessage.vue2.js +49 -41
  24. package/dist/components/2_feed_elements/VideoMessage/VideoMessage.vue.js +1 -1
  25. package/dist/components/2_feed_elements/VideoMessage/VideoMessage.vue2.js +105 -101
  26. package/dist/components/3_compounds/ChatInput/ChatInput.vue.js +2 -2
  27. package/dist/components/3_compounds/ChatInput/ChatInput.vue2.js +224 -138
  28. package/dist/components/3_compounds/ChatList/composables/useChatListFilter.js +18 -13
  29. package/dist/functions/renderAppleEmojis.js +127 -70
  30. package/dist/hooks/uploadFile/generatePreview.js +23 -11
  31. package/dist/hooks/useMessageDraft.js +73 -39
  32. package/dist/index.js +116 -114
  33. package/dist/locale/en.js +1 -0
  34. package/dist/locale/ru.js +1 -0
  35. package/dist/node_modules/vue3-emoji-picker-ru/dist/emoji-picker.es.js +106 -106
  36. package/dist/themes/dark.css +1 -1
  37. package/dist/themes/default.css +1 -1
  38. package/dist/themes/glass.css +1 -1
  39. package/dist/themes/green.css +1 -1
  40. package/dist/themes/mobilon1.css +1 -1
  41. package/dist/types/apps/data/messages.d.ts +52 -0
  42. package/dist/types/components/2_blocks/CommunicationPanel/CommunicationPanel.vue.d.ts +2 -2
  43. package/dist/types/components/2_blocks/CommunicationPanel/stories/CommunicationPanel.stories.d.ts +2 -2
  44. package/dist/types/components/2_chatlist_elements/ChatItem/styles/types.d.ts +6 -0
  45. package/dist/types/components/2_feed_elements/AudioMessage/styles/types.d.ts +34 -0
  46. package/dist/types/components/2_feed_elements/CallMessage/styles/types.d.ts +26 -0
  47. package/dist/types/components/2_feed_elements/FileMessage/styles/types.d.ts +30 -0
  48. package/dist/types/components/2_feed_elements/ImageMessage/styles/types.d.ts +34 -0
  49. package/dist/types/components/2_feed_elements/StickerMessage/styles/types.d.ts +4 -0
  50. package/dist/types/components/2_feed_elements/TextMessage/styles/types.d.ts +38 -2
  51. package/dist/types/components/2_feed_elements/TypingMessage/styles/types.d.ts +2 -0
  52. package/dist/types/components/2_feed_elements/VideoMessage/styles/types.d.ts +34 -0
  53. package/dist/types/components/3_compounds/ChatInput/ChatInput.vue.d.ts +3 -3
  54. package/dist/types/components/3_compounds/ChatInput/styles/types.d.ts +2 -0
  55. package/dist/types/components/3_compounds/Feed/composables/useFeedReply.d.ts +1 -27
  56. package/dist/types/functions/renderAppleEmojis.d.ts +17 -2
  57. package/dist/types/hooks/uploadFile/generatePreview.d.ts +2 -0
  58. package/dist/types/hooks/uploadFile/uploadFile.d.ts +9 -17
  59. package/dist/types/hooks/useMessageDraft.d.ts +30 -29
  60. package/dist/types/locale/en.d.ts +1 -0
  61. package/dist/types/locale/ru.d.ts +1 -0
  62. package/package.json +2 -2
@@ -1,65 +1,78 @@
1
- import { defineComponent as ht, inject as ft, useId as gt, ref as I, computed as p, watch as yt, onMounted as vt, nextTick as B, onUnmounted as pt, createElementBlock as s, openBlock as o, createElementVNode as r, createCommentVNode as l, withModifiers as kt, normalizeClass as b, normalizeStyle as W, createVNode as A, withCtx as V, toDisplayString as f, createBlock as m, resolveDynamicComponent as xt, Teleport as _t, unref as d, Fragment as Ct, renderList as wt } from "vue";
2
- import { getStatus as It, statuses as Tt } from "../../../functions/getStatusMessage.js";
1
+ import { defineComponent as wt, inject as It, useId as Tt, ref as T, computed as u, watch as Mt, onMounted as Et, nextTick as V, onUnmounted as St, createElementBlock as a, openBlock as n, createElementVNode as l, createCommentVNode as r, withModifiers as bt, normalizeClass as H, normalizeStyle as G, createVNode as N, withCtx as U, toDisplayString as f, createBlock as g, resolveDynamicComponent as Lt, unref as m, Teleport as At, Fragment as Bt, renderList as Vt } from "vue";
2
+ import { getStatus as Ht, statuses as Nt } from "../../../functions/getStatusMessage.js";
3
3
  import "../../../functions/parseMarkdown.js";
4
- import { t as U } from "../../../locale/useLocale.js";
5
- import "../../../hooks/useMessageDraft.js";
4
+ import { t as S } from "../../../locale/useLocale.js";
5
+ import { getChatDraft as Ut } from "../../../hooks/useMessageDraft.js";
6
6
  import "../../../hooks/useSearchModel.js";
7
- import { useTheme as Mt } from "../../../hooks/useTheme.js";
8
- import "../../../hooks/useEmojiNative.js";
7
+ import { useTheme as Dt } from "../../../hooks/useTheme.js";
8
+ import { useEmojiNative as Rt } from "../../../hooks/useEmojiNative.js";
9
9
  /* empty css */
10
10
  /* empty css */
11
11
  /* empty css */
12
12
  import "../../../node_modules/linkifyjs/dist/linkify.js";
13
13
  import "../../../node_modules/linkify-string/dist/linkify-string.js";
14
- import $ from "../../1_atoms/Tooltip/Tooltip.vue.js";
15
- import Et from "../../1_atoms/ButtonContextMenu/ButtonContextMenu.vue.js";
16
- import St from "../../1_atoms/ContextMenu/ContextMenu.vue.js";
17
- import Bt from "../../1_icons/AvatarIcon.vue.js";
18
- import bt from "../../1_icons/MessageStatus/ErrorStatusIcon.vue.js";
19
- import At from "../../1_icons/MessageStatus/PendingStatusIcon.vue.js";
20
- import Vt from "../../1_icons/MessageStatus/ReadStatusIcon.vue.js";
21
- import Ut from "../../1_icons/MessageStatus/ReceivedStatusIcon.vue.js";
22
- import Lt from "../../1_icons/MessageStatus/SentStatusIcon.vue.js";
23
- import Dt from "./icons/AudioIcon.vue.js";
24
- import Nt from "./icons/FileIcon.vue.js";
25
- import Rt from "./icons/ImageIcon.vue.js";
26
- import Xt from "./icons/MissedCallIcon.vue.js";
27
- import z from "./icons/StickerIcon.vue.js";
28
- import Yt from "./icons/VideoIcon.vue.js";
29
- import Ft from "./icons/VoiceIcon.vue.js";
30
- const Ht = { class: "chat-item__avatar-container" }, Wt = ["src"], $t = {
14
+ import { textToAppleEmojiHtml as D, textContainsEmoji as J } from "../../../functions/renderAppleEmojis.js";
15
+ import K from "../../1_atoms/Tooltip/Tooltip.vue.js";
16
+ import Xt from "../../1_atoms/ButtonContextMenu/ButtonContextMenu.vue.js";
17
+ import Yt from "../../1_atoms/ContextMenu/ContextMenu.vue.js";
18
+ import $t from "../../1_icons/AvatarIcon.vue.js";
19
+ import jt from "../../1_icons/MessageStatus/ErrorStatusIcon.vue.js";
20
+ import Ft from "../../1_icons/MessageStatus/PendingStatusIcon.vue.js";
21
+ import Wt from "../../1_icons/MessageStatus/ReadStatusIcon.vue.js";
22
+ import zt from "../../1_icons/MessageStatus/ReceivedStatusIcon.vue.js";
23
+ import Ot from "../../1_icons/MessageStatus/SentStatusIcon.vue.js";
24
+ import Pt from "./icons/AudioIcon.vue.js";
25
+ import qt from "./icons/FileIcon.vue.js";
26
+ import Gt from "./icons/ImageIcon.vue.js";
27
+ import Jt from "./icons/MissedCallIcon.vue.js";
28
+ import Q from "./icons/StickerIcon.vue.js";
29
+ import Kt from "./icons/VideoIcon.vue.js";
30
+ import Qt from "./icons/VoiceIcon.vue.js";
31
+ const Zt = { class: "chat-item__avatar-container" }, te = ["src"], ee = {
31
32
  key: 1,
32
33
  class: "chat-item__avatar-placeholder"
33
- }, zt = { class: "chat-item__info-container" }, Ot = { class: "chat-item__name" }, qt = {
34
+ }, ne = { class: "chat-item__info-container" }, ie = ["innerHTML"], oe = {
35
+ key: 1,
36
+ class: "chat-item__name"
37
+ }, ce = {
34
38
  key: 0,
35
39
  class: "chat-item__last-message"
36
- }, Pt = { class: "chat-item__last-message-text" }, Gt = { class: "chat-item__details-container" }, Jt = {
40
+ }, ae = {
41
+ key: 1,
42
+ class: "chat-item__last-message-text"
43
+ }, se = { class: "chat-item__draft-label" }, re = ["innerHTML"], le = {
44
+ key: 1,
45
+ class: "chat-item__draft-text"
46
+ }, ue = ["innerHTML"], me = {
47
+ key: 3,
48
+ class: "chat-item__last-message-text"
49
+ }, de = { class: "chat-item__details-container" }, he = {
37
50
  key: 0,
38
51
  class: "chat-item__time"
39
- }, Kt = { class: "chat-item__status-unread-container" }, Qt = {
52
+ }, fe = { class: "chat-item__status-unread-container" }, ge = {
40
53
  key: 1,
41
54
  class: "chat-item__unread"
42
- }, Zt = {
55
+ }, ve = {
43
56
  key: 2,
44
57
  class: "chat-item__status-chat-container"
45
- }, jt = {
58
+ }, ye = {
46
59
  key: 0,
47
60
  class: "chat-item__fixed pi pi-thumbtack"
48
- }, te = {
61
+ }, pe = {
49
62
  key: 0,
50
63
  id: "noSelectButton",
51
64
  class: "chat-item__menu-button"
52
- }, ee = {
65
+ }, _e = {
53
66
  key: 1,
54
67
  id: "noSelectButton",
55
68
  class: "chat-item__menu-button"
56
- }, ne = {
69
+ }, ke = {
57
70
  key: 0,
58
71
  class: "dialog__container"
59
- }, ie = ["onClick"], oe = ["src"], ce = {
72
+ }, xe = ["onClick"], Ce = ["src"], we = {
60
73
  key: 1,
61
74
  class: "dialog__icon pi pi-user"
62
- }, se = { class: "dialog__text-container" }, ae = { class: "dialog__name" }, re = { class: "dialog__time" }, Xe = /* @__PURE__ */ ht({
75
+ }, Ie = { class: "dialog__text-container" }, Te = { class: "dialog__name" }, Me = { class: "dialog__time" }, on = /* @__PURE__ */ wt({
63
76
  __name: "ChatItem",
64
77
  props: {
65
78
  chat: {},
@@ -67,247 +80,270 @@ const Ht = { class: "chat-item__avatar-container" }, Wt = ["src"], $t = {
67
80
  contextMenuTrigger: { default: "hover" }
68
81
  },
69
82
  emits: ["select", "action", "expand"],
70
- setup(c, { emit: O }) {
71
- const q = ft("chatAppId"), { getTheme: L } = Mt(q), e = c, T = O, g = gt(), y = I(!1), k = I(!1), E = I(!1), P = I(null), G = () => {
72
- E.value = !0;
73
- }, J = (t) => {
74
- E.value || t.target instanceof HTMLElement && t.target.id != "noSelectButton" && T("select", { chat: e.chat, dialog: null }), E.value = !1;
75
- }, K = (t) => {
76
- T("select", { chat: e.chat, dialog: t });
77
- }, Q = () => e.chat.isSelected ? "chat-item__selected" : "", Z = (t) => t.isSelected ? "dialog__selected" : "", D = (t) => {
78
- e.contextMenuTrigger === "rightClick" && S(), T("action", { chat: e.chat, ...t });
79
- }, S = () => {
80
- const t = document.getElementById("context-menu-rightclick-" + g);
83
+ setup(c, { emit: Z }) {
84
+ const b = It("chatAppId"), { getTheme: R } = Dt(b), { isNative: X } = Rt(b), e = c, M = Z, y = Tt(), p = T(!1), k = T(!1), L = T(!1), tt = T(null), et = () => {
85
+ L.value = !0;
86
+ }, nt = (t) => {
87
+ L.value || t.target instanceof HTMLElement && t.target.id != "noSelectButton" && M("select", { chat: e.chat, dialog: null }), L.value = !1;
88
+ }, it = (t) => {
89
+ M("select", { chat: e.chat, dialog: t });
90
+ }, ot = () => e.chat.isSelected ? "chat-item__selected" : "", ct = (t) => t.isSelected ? "dialog__selected" : "", Y = (t) => {
91
+ e.contextMenuTrigger === "rightClick" && A(), M("action", { chat: e.chat, ...t });
92
+ }, A = () => {
93
+ const t = document.getElementById("context-menu-rightclick-" + y);
81
94
  t && (t.style.top = "0", t.style.left = "0", t.style.opacity = "0", t.style.display = "none"), k.value = !1;
82
- }, j = () => {
83
- document.querySelectorAll('[id^="context-menu-rightclick-"]').forEach((n) => {
84
- const i = n;
85
- i.id !== "context-menu-rightclick-" + g && (i.style.top = "0", i.style.left = "0", i.style.opacity = "0", i.style.display = "none");
95
+ }, at = () => {
96
+ document.querySelectorAll('[id^="context-menu-rightclick-"]').forEach((i) => {
97
+ const o = i;
98
+ o.id !== "context-menu-rightclick-" + y && (o.style.top = "0", o.style.left = "0", o.style.opacity = "0", o.style.display = "none");
86
99
  });
87
- }, tt = () => e.chat.dialogs ? [...e.chat.dialogs].sort((t, n) => Number(t["lastActivity.timestamp"]) > Number(n["lastActivity.timestamp"]) ? -1 : Number(t["lastActivity.timestamp"]) < Number(n["lastActivity.timestamp"]) ? 1 : (Number(t["lastActivity.timestamp"]) == Number(n["lastActivity.timestamp"]), 0)) : [], et = p(() => It(e.chat["lastMessage.status"])), nt = p(() => e.chat.showEmptyIndicator || e.chat.countUnread > 0), it = p(() => e.chat.countUnread > 0 ? e.chat.countUnread > 99 ? "99+" : e.chat.countUnread : e.chat.showEmptyIndicator ? "" : void 0);
88
- let M;
89
- const v = I(0), N = [U("component.ChatItem.typing") + ".", U("component.ChatItem.typing") + "..", U("component.ChatItem.typing") + "..."], R = (t) => {
90
- var u, a, h;
100
+ }, st = () => e.chat.dialogs ? [...e.chat.dialogs].sort((t, i) => Number(t["lastActivity.timestamp"]) > Number(i["lastActivity.timestamp"]) ? -1 : Number(t["lastActivity.timestamp"]) < Number(i["lastActivity.timestamp"]) ? 1 : (Number(t["lastActivity.timestamp"]) == Number(i["lastActivity.timestamp"]), 0)) : [], rt = u(() => Ht(e.chat["lastMessage.status"])), lt = u(() => e.chat.showEmptyIndicator || e.chat.countUnread > 0), ut = u(() => e.chat.countUnread > 0 ? e.chat.countUnread > 99 ? "99+" : e.chat.countUnread : e.chat.showEmptyIndicator ? "" : void 0);
101
+ let E;
102
+ const _ = T(0), $ = [S("component.ChatItem.typing") + ".", S("component.ChatItem.typing") + "..", S("component.ChatItem.typing") + "..."], j = (t) => {
103
+ var h, s, v;
91
104
  if (typeof t == "string")
92
105
  return t;
93
106
  if ((t == null ? void 0 : t.type) === "message.sticker")
94
107
  return "Стикер";
95
108
  if ((t == null ? void 0 : t.type) === "message.audio")
96
- return (t.isVoiceMessage || ((u = t == null ? void 0 : t.data) == null ? void 0 : u.isVoiceMessage)) === !0 ? "Голосовое сообщение" : "Аудиофайл";
109
+ return (t.isVoiceMessage || ((h = t == null ? void 0 : t.data) == null ? void 0 : h.isVoiceMessage)) === !0 ? "Голосовое сообщение" : "Аудиофайл";
97
110
  if ((t == null ? void 0 : t.type) === "message.missedCall")
98
111
  return "Пропущенный звонок";
99
- const n = (a = t == null ? void 0 : t.data) == null ? void 0 : a.text;
100
- if (n)
101
- return n;
102
- const i = (h = t == null ? void 0 : t.data) == null ? void 0 : h.filename;
103
- return i || "";
104
- }, ot = (t) => typeof t == "string" ? null : (t == null ? void 0 : t.type) || null, X = p(() => {
105
- var n, i, u;
106
- if (e.chat.typing)
112
+ const i = (s = t == null ? void 0 : t.data) == null ? void 0 : s.text;
113
+ if (i)
114
+ return i;
115
+ const o = (v = t == null ? void 0 : t.data) == null ? void 0 : v.filename;
116
+ return o || "";
117
+ }, mt = (t) => typeof t == "string" ? null : (t == null ? void 0 : t.type) || null, F = S("component.ChatItem.draft"), d = u(() => {
118
+ if (e.chat.isSelected) return "";
119
+ const t = Ut(String(b ?? ""), e.chat.chatId);
120
+ return !t || t.edit ? "" : (t.text || "").replace(/\s+/g, " ").trim();
121
+ }), dt = u(() => D(d.value || "")), W = u(() => {
122
+ var i, o, h;
123
+ if (e.chat.typing || d.value)
107
124
  return null;
108
- const t = ot(e.chat.lastMessage);
125
+ const t = mt(e.chat.lastMessage);
109
126
  if (!t)
110
127
  return null;
111
128
  if (t === "message.sticker")
112
- return z;
129
+ return Q;
113
130
  if (t === "message.image")
114
- return Rt;
131
+ return Gt;
115
132
  if (t === "message.video")
116
- return Yt;
133
+ return Kt;
117
134
  if (t === "message.audio") {
118
- const a = e.chat.lastMessage;
119
- return (a.isVoiceMessage || ((n = a == null ? void 0 : a.data) == null ? void 0 : n.isVoiceMessage)) === !0 ? Ft : Dt;
135
+ const s = e.chat.lastMessage;
136
+ return (s.isVoiceMessage || ((i = s == null ? void 0 : s.data) == null ? void 0 : i.isVoiceMessage)) === !0 ? Qt : Pt;
120
137
  }
121
138
  if (t === "message.missedCall")
122
- return Xt;
139
+ return Jt;
123
140
  if (t === "message.file") {
124
- const a = e.chat.lastMessage, h = ((u = (i = a == null ? void 0 : a.data) == null ? void 0 : i.filename) == null ? void 0 : u.toLowerCase()) || "";
125
- return h.endsWith(".tgs") || h.endsWith(".webp") ? z : Nt;
141
+ const s = e.chat.lastMessage, v = ((h = (o = s == null ? void 0 : s.data) == null ? void 0 : o.filename) == null ? void 0 : h.toLowerCase()) || "";
142
+ return v.endsWith(".tgs") || v.endsWith(".webp") ? Q : qt;
126
143
  }
127
144
  return null;
128
- }), ct = p(() => e.chat.typing ? N[v.value] : R(e.chat.lastMessage)), st = p(() => e.chat.typing ? N[v.value] : R(e.chat.lastMessage));
129
- yt(
145
+ }), ht = u(() => e.chat.typing ? $[_.value] : d.value ? `${F} ${d.value}` : j(e.chat.lastMessage)), B = u(() => e.chat.typing ? $[_.value] : j(e.chat.lastMessage)), z = u(
146
+ () => !X.value && J(d.value || B.value || "")
147
+ ), ft = u(
148
+ () => !X.value && J(e.chat.name || "")
149
+ ), gt = u(() => D(B.value || "")), vt = u(() => D(e.chat.name || ""));
150
+ Mt(
130
151
  () => e.chat.typing,
131
152
  () => {
132
- e.chat.typing ? M = setInterval(() => {
133
- v.value < 2 ? v.value += 1 : v.value = 0;
134
- }, 1e3) : (v.value = 0, M && (clearInterval(M), M = void 0));
153
+ e.chat.typing ? E = setInterval(() => {
154
+ _.value < 2 ? _.value += 1 : _.value = 0;
155
+ }, 1e3) : (_.value = 0, E && (clearInterval(E), E = void 0));
135
156
  },
136
157
  { immediate: !0 }
137
158
  );
138
- const at = () => {
139
- e.contextMenuTrigger === "hover" && (y.value = !0);
140
- }, rt = (t) => {
141
- e.contextMenuTrigger === "hover" && (t.relatedTarget instanceof HTMLElement && t.relatedTarget.className == "context-menu__list" ? y.value = !0 : y.value = !1);
142
- }, lt = (t) => {
143
- e.contextMenuTrigger === "rightClick" && e.chat.actions && ut(t);
144
- }, ut = (t) => {
145
- j(), k.value = !0, B(() => {
146
- const n = document.getElementById("context-menu-rightclick-" + g);
147
- if (n) {
148
- const i = t.clientX, u = t.clientY;
149
- n.style.display = "inherit";
150
- const a = n.getBoundingClientRect();
151
- n.style.display = "none", B(() => {
152
- const h = window.innerWidth, H = window.innerHeight, x = window.scrollX || window.pageXOffset, _ = window.scrollY || window.pageYOffset;
153
- let C = i + x, w = u + _;
154
- C + a.width > h + x && (C = i + x - a.width), w + a.height > H + _ && (w = u + _ - a.height), C < x && (C = x), w < _ && (w = _), n.style.top = w + "px", n.style.left = C + "px", n.style.opacity = "1", n.style.display = "inherit";
159
+ const yt = () => {
160
+ e.contextMenuTrigger === "hover" && (p.value = !0);
161
+ }, pt = (t) => {
162
+ e.contextMenuTrigger === "hover" && (t.relatedTarget instanceof HTMLElement && t.relatedTarget.className == "context-menu__list" ? p.value = !0 : p.value = !1);
163
+ }, _t = (t) => {
164
+ e.contextMenuTrigger === "rightClick" && e.chat.actions && kt(t);
165
+ }, kt = (t) => {
166
+ at(), k.value = !0, V(() => {
167
+ const i = document.getElementById("context-menu-rightclick-" + y);
168
+ if (i) {
169
+ const o = t.clientX, h = t.clientY;
170
+ i.style.display = "inherit";
171
+ const s = i.getBoundingClientRect();
172
+ i.style.display = "none", V(() => {
173
+ const v = window.innerWidth, q = window.innerHeight, x = window.scrollX || window.pageXOffset, C = window.scrollY || window.pageYOffset;
174
+ let w = o + x, I = h + C;
175
+ w + s.width > v + x && (w = o + x - s.width), I + s.height > q + C && (I = h + C - s.height), w < x && (w = x), I < C && (I = C), i.style.top = I + "px", i.style.left = w + "px", i.style.opacity = "1", i.style.display = "inherit";
155
176
  });
156
177
  }
157
178
  });
158
- }, mt = () => {
159
- }, dt = () => {
160
- }, Y = (t) => {
179
+ }, xt = () => {
180
+ }, Ct = () => {
181
+ }, O = (t) => {
161
182
  if (e.contextMenuTrigger === "rightClick" && k.value) {
162
- const n = t.target, i = document.getElementById("context-menu-rightclick-" + g);
163
- (!i || !i.contains(n)) && S();
183
+ const i = t.target, o = document.getElementById("context-menu-rightclick-" + y);
184
+ (!o || !o.contains(i)) && A();
164
185
  }
165
- }, F = () => {
166
- e.contextMenuTrigger === "rightClick" && k.value && S();
186
+ }, P = () => {
187
+ e.contextMenuTrigger === "rightClick" && k.value && A();
167
188
  };
168
- return vt(() => {
169
- e.contextMenuTrigger === "rightClick" && (document.addEventListener("click", Y), window.addEventListener("scroll", F, !0), B(() => {
170
- const t = document.getElementById("context-menu-rightclick-" + g);
189
+ return Et(() => {
190
+ e.contextMenuTrigger === "rightClick" && (document.addEventListener("click", O), window.addEventListener("scroll", P, !0), V(() => {
191
+ const t = document.getElementById("context-menu-rightclick-" + y);
171
192
  t && (t.style.display = "none", t.style.opacity = "0");
172
193
  }));
173
- }), pt(() => {
174
- document.removeEventListener("click", Y), window.removeEventListener("scroll", F, !0);
175
- }), (t, n) => (o(), s("div", null, [
176
- r("div", {
194
+ }), St(() => {
195
+ document.removeEventListener("click", O), window.removeEventListener("scroll", P, !0);
196
+ }), (t, i) => (n(), a("div", null, [
197
+ l("div", {
177
198
  ref_key: "containerRef",
178
- ref: P,
179
- class: b(["chat-item__container", Q()]),
180
- onMouseenter: at,
181
- onMouseleave: rt,
182
- onClick: J,
183
- onContextmenu: kt(lt, ["prevent"])
199
+ ref: tt,
200
+ class: H(["chat-item__container", ot()]),
201
+ onMouseenter: yt,
202
+ onMouseleave: pt,
203
+ onClick: nt,
204
+ onContextmenu: bt(_t, ["prevent"])
184
205
  }, [
185
- r("div", Ht, [
186
- r("span", {
206
+ l("div", Zt, [
207
+ l("span", {
187
208
  class: "chat-item__status-user",
188
- style: W({ backgroundColor: e.chat.status })
209
+ style: G({ backgroundColor: e.chat.status })
189
210
  }, null, 4),
190
- e.chat.avatar ? (o(), s("img", {
211
+ e.chat.avatar ? (n(), a("img", {
191
212
  key: 0,
192
213
  src: e.chat.avatar,
193
214
  height: "48",
194
215
  width: "48"
195
- }, null, 8, Wt)) : (o(), s("div", $t, [
196
- A(Bt)
216
+ }, null, 8, te)) : (n(), a("div", ee, [
217
+ N($t)
197
218
  ]))
198
219
  ]),
199
- r("div", zt, [
200
- A($, {
220
+ l("div", ne, [
221
+ N(K, {
201
222
  text: c.chat.name,
202
223
  position: "bottom"
203
224
  }, {
204
- default: V(() => [
205
- r("div", Ot, f(c.chat.name), 1)
225
+ default: U(() => [
226
+ ft.value ? (n(), a("div", {
227
+ key: 0,
228
+ class: "chat-item__name",
229
+ innerHTML: vt.value
230
+ }, null, 8, ie)) : (n(), a("div", oe, f(c.chat.name), 1))
206
231
  ]),
207
232
  _: 1
208
233
  }, 8, ["text"]),
209
- A($, {
210
- text: ct.value,
234
+ N(K, {
235
+ text: ht.value,
211
236
  position: "bottom"
212
237
  }, {
213
- default: V(() => [
214
- c.chat.lastMessage || c.chat.typing ? (o(), s("div", qt, [
215
- X.value ? (o(), m(xt(X.value), {
238
+ default: U(() => [
239
+ c.chat.lastMessage || c.chat.typing || d.value ? (n(), a("div", ce, [
240
+ W.value && !d.value ? (n(), g(Lt(W.value), {
216
241
  key: 0,
217
242
  class: "chat-item__message-icon"
218
- })) : l("", !0),
219
- r("span", Pt, f(st.value), 1)
220
- ])) : l("", !0)
243
+ })) : r("", !0),
244
+ d.value ? (n(), a("span", ae, [
245
+ l("span", se, f(m(F)), 1),
246
+ z.value ? (n(), a("span", {
247
+ key: 0,
248
+ class: "chat-item__draft-text",
249
+ innerHTML: dt.value
250
+ }, null, 8, re)) : (n(), a("span", le, f(d.value), 1))
251
+ ])) : z.value ? (n(), a("span", {
252
+ key: 2,
253
+ class: "chat-item__last-message-text",
254
+ innerHTML: gt.value
255
+ }, null, 8, ue)) : (n(), a("span", me, f(B.value), 1))
256
+ ])) : r("", !0)
221
257
  ]),
222
258
  _: 1
223
259
  }, 8, ["text"])
224
260
  ]),
225
- r("div", Gt, [
226
- c.chat["lastActivity.time"] && (!c.chat.actions || !y.value) ? (o(), s("div", Jt, f(c.chat["lastActivity.time"]), 1)) : l("", !0),
227
- y.value && c.chat.actions && c.contextMenuTrigger === "hover" ? (o(), m(Et, {
261
+ l("div", de, [
262
+ c.chat["lastActivity.time"] && (!c.chat.actions || !p.value) ? (n(), a("div", he, f(c.chat["lastActivity.time"]), 1)) : r("", !0),
263
+ p.value && c.chat.actions && c.contextMenuTrigger === "hover" ? (n(), g(Xt, {
228
264
  key: 1,
229
265
  mode: "click",
230
266
  "menu-side": "bottom-right",
231
267
  actions: c.chat.actions,
232
- onClick: D,
233
- onButtonClick: G,
234
- onMenuMouseLeave: n[0] || (n[0] = (i) => y.value = !1)
268
+ onClick: Y,
269
+ onButtonClick: et,
270
+ onMenuMouseLeave: i[0] || (i[0] = (o) => p.value = !1)
235
271
  }, {
236
- default: V(() => [...n[2] || (n[2] = [
237
- r("span", { class: "pi pi-ellipsis-h chat-item__actions-trigger" }, null, -1)
272
+ default: U(() => [...i[2] || (i[2] = [
273
+ l("span", { class: "pi pi-ellipsis-h chat-item__actions-trigger" }, null, -1)
238
274
  ])]),
239
275
  _: 1
240
- }, 8, ["actions"])) : l("", !0),
241
- (o(), m(_t, { to: "body" }, [
242
- c.contextMenuTrigger === "rightClick" && c.chat.actions && k.value ? (o(), m(St, {
276
+ }, 8, ["actions"])) : r("", !0),
277
+ (n(), g(At, { to: "body" }, [
278
+ c.contextMenuTrigger === "rightClick" && c.chat.actions && k.value ? (n(), g(Yt, {
243
279
  key: 0,
244
- id: "context-menu-rightclick-" + d(g),
280
+ id: "context-menu-rightclick-" + m(y),
245
281
  actions: c.chat.actions,
246
- "data-theme": d(L)().theme ? d(L)().theme : "light",
247
- onClick: D,
248
- onMouseenter: mt,
249
- onMouseleave: dt
250
- }, null, 8, ["id", "actions", "data-theme"])) : l("", !0)
282
+ "data-theme": m(R)().theme ? m(R)().theme : "light",
283
+ onClick: Y,
284
+ onMouseenter: xt,
285
+ onMouseleave: Ct
286
+ }, null, 8, ["id", "actions", "data-theme"])) : r("", !0)
251
287
  ])),
252
- r("div", Kt, [
253
- d(Tt).includes(c.chat["lastMessage.status"]) ? (o(), s("div", {
288
+ l("div", fe, [
289
+ m(Nt).includes(c.chat["lastMessage.status"]) ? (n(), a("div", {
254
290
  key: 0,
255
- class: b(["chat-item__status-message", et.value])
291
+ class: H(["chat-item__status-message", rt.value])
256
292
  }, [
257
- c.chat["lastMessage.status"] === "pending" ? (o(), m(d(At), { key: 0 })) : c.chat["lastMessage.status"] === "error" ? (o(), m(d(bt), { key: 1 })) : c.chat["lastMessage.status"] === "read" ? (o(), m(d(Vt), { key: 2 })) : c.chat["lastMessage.status"] === "received" ? (o(), m(d(Ut), { key: 3 })) : (o(), m(d(Lt), { key: 4 }))
258
- ], 2)) : l("", !0),
259
- nt.value ? (o(), s("div", Qt, f(it.value), 1)) : l("", !0)
293
+ c.chat["lastMessage.status"] === "pending" ? (n(), g(m(Ft), { key: 0 })) : c.chat["lastMessage.status"] === "error" ? (n(), g(m(jt), { key: 1 })) : c.chat["lastMessage.status"] === "read" ? (n(), g(m(Wt), { key: 2 })) : c.chat["lastMessage.status"] === "received" ? (n(), g(m(zt), { key: 3 })) : (n(), g(m(Ot), { key: 4 }))
294
+ ], 2)) : r("", !0),
295
+ lt.value ? (n(), a("div", ge, f(ut.value), 1)) : r("", !0)
260
296
  ]),
261
- c.chat.countUnread < 1 ? (o(), s("div", Zt, [
262
- c.chat.isFixedTop || c.chat.isFixedBottom ? (o(), s("span", jt)) : l("", !0)
263
- ])) : l("", !0)
297
+ c.chat.countUnread < 1 ? (n(), a("div", ve, [
298
+ c.chat.isFixedTop || c.chat.isFixedBottom ? (n(), a("span", ye)) : r("", !0)
299
+ ])) : r("", !0)
264
300
  ]),
265
- e.showDialogs && c.chat.dialogs ? (o(), s("div", {
301
+ e.showDialogs && c.chat.dialogs ? (n(), a("div", {
266
302
  key: 0,
267
303
  class: "chat-item__dialog-buttons",
268
- onClick: n[1] || (n[1] = (i) => T("expand", e.chat))
304
+ onClick: i[1] || (i[1] = (o) => M("expand", e.chat))
269
305
  }, [
270
- e.showDialogs && !c.chat.dialogsExpanded ? (o(), s("button", te, [...n[3] || (n[3] = [
271
- r("span", {
306
+ e.showDialogs && !c.chat.dialogsExpanded ? (n(), a("button", pe, [...i[3] || (i[3] = [
307
+ l("span", {
272
308
  id: "noSelectButton",
273
309
  class: "pi pi-angle-down"
274
310
  }, null, -1)
275
- ])])) : l("", !0),
276
- e.showDialogs && c.chat.dialogsExpanded ? (o(), s("button", ee, [...n[4] || (n[4] = [
277
- r("span", {
311
+ ])])) : r("", !0),
312
+ e.showDialogs && c.chat.dialogsExpanded ? (n(), a("button", _e, [...i[4] || (i[4] = [
313
+ l("span", {
278
314
  id: "noSelectButton",
279
315
  class: "pi pi-angle-up"
280
316
  }, null, -1)
281
- ])])) : l("", !0)
282
- ])) : l("", !0)
317
+ ])])) : r("", !0)
318
+ ])) : r("", !0)
283
319
  ], 34),
284
- e.showDialogs && c.chat.dialogsExpanded ? (o(), s("div", ne, [
285
- (o(!0), s(Ct, null, wt(tt(), (i) => (o(), s("div", {
286
- key: i.dialogId,
287
- class: b(["dialog__item", Z(i)]),
288
- onClick: (u) => K(i)
320
+ e.showDialogs && c.chat.dialogsExpanded ? (n(), a("div", ke, [
321
+ (n(!0), a(Bt, null, Vt(st(), (o) => (n(), a("div", {
322
+ key: o.dialogId,
323
+ class: H(["dialog__item", ct(o)]),
324
+ onClick: (h) => it(o)
289
325
  }, [
290
- i.icon ? (o(), s("img", {
326
+ o.icon ? (n(), a("img", {
291
327
  key: 0,
292
328
  class: "dialog__icon",
293
- src: i.icon,
329
+ src: o.icon,
294
330
  height: "16",
295
331
  width: "16"
296
- }, null, 8, oe)) : (o(), s("span", ce)),
297
- r("div", se, [
298
- r("div", ae, f(i.name), 1),
299
- r("div", re, f(i["lastActivity.time"]), 1)
332
+ }, null, 8, Ce)) : (n(), a("span", we)),
333
+ l("div", Ie, [
334
+ l("div", Te, f(o.name), 1),
335
+ l("div", Me, f(o["lastActivity.time"]), 1)
300
336
  ]),
301
- i.countUnread > 0 ? (o(), s("div", {
337
+ o.countUnread > 0 ? (n(), a("div", {
302
338
  key: 2,
303
339
  class: "chat-item__unread",
304
- style: W(i.colorUnread ? { backgroundColor: i.colorUnread } : {})
305
- }, f(i.countUnread > 99 ? "99+" : i.countUnread), 5)) : l("", !0)
306
- ], 10, ie))), 128))
307
- ])) : l("", !0)
340
+ style: G(o.colorUnread ? { backgroundColor: o.colorUnread } : {})
341
+ }, f(o.countUnread > 99 ? "99+" : o.countUnread), 5)) : r("", !0)
342
+ ], 10, xe))), 128))
343
+ ])) : r("", !0)
308
344
  ]));
309
345
  }
310
346
  });
311
347
  export {
312
- Xe as default
348
+ on as default
313
349
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./AudioRecorder.vue2.js";
2
2
  /* empty css */
3
3
  import r from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const e = /* @__PURE__ */ r(o, [["__scopeId", "data-v-8d9aa63f"]]);
4
+ const p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-b3be7b0b"]]);
5
5
  export {
6
- e as default
6
+ p as default
7
7
  };