@mobilon-dev/chotto 0.3.64 → 0.3.66

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.
@@ -1,40 +1,50 @@
1
- import { defineComponent as Se, inject as P, computed as v, unref as s, toRefs as $e, ref as y, watch as ee, createElementBlock as c, openBlock as n, normalizeClass as te, createCommentVNode as f, createElementVNode as l, createVNode as R, withCtx as N, createTextVNode as _, toDisplayString as i, createBlock as k, Fragment as w, withDirectives as j, vShow as ae, vModelText as De, Transition as se, Teleport as Ne, renderList as Ve } from "vue";
2
- import "../../../hooks/useMessageDraft.js";
3
- import "../../../hooks/useSearchModel.js";
4
- import { useTheme as Ae } from "../../../hooks/useTheme.js";
5
- /* empty css */
6
- /* empty css */
7
- import { useMessageActions as Ee } from "../../../hooks/messages/useMessageActions.js";
1
+ import { defineComponent as He, inject as re, computed as m, unref as l, toRefs as Ge, ref as y, watch as ue, createElementBlock as i, openBlock as o, normalizeClass as B, createCommentVNode as p, createElementVNode as r, createVNode as O, withCtx as E, createTextVNode as h, toDisplayString as c, createBlock as L, Fragment as g, withDirectives as Z, vShow as ce, vModelText as Ke, Transition as de, renderList as me, nextTick as Qe } from "vue";
2
+ import { useMessageActions as We } from "../../../hooks/messages/useMessageActions.js";
8
3
  import "../../../node_modules/linkifyjs/dist/linkify.js";
9
4
  import "../../../node_modules/linkify-string/dist/linkify-string.js";
10
5
  import "../../../functions/parseMarkdown.js";
11
- import { useSubtextTooltip as Le } from "../../../hooks/messages/useSubtextTooltip.js";
12
- import Pe from "../../1_atoms/ContextMenu/ContextMenu.vue.js";
13
- import le from "../../1_atoms/Tooltip/Tooltip.vue.js";
14
- import Re from "./icons/IncomingCallIcon.vue.js";
15
- import je from "./icons/OutgoingCallIcon.vue.js";
16
- const Be = ["messageId"], Ue = ["src"], Oe = {
6
+ import { useSubtextTooltip as Xe } from "../../../hooks/messages/useSubtextTooltip.js";
7
+ import Ye from "../../1_atoms/ContextMenu/ContextMenu.vue.js";
8
+ import ve from "../../1_atoms/Tooltip/Tooltip.vue.js";
9
+ import et from "./icons/IncomingCallIcon.vue.js";
10
+ import tt from "./icons/OutgoingCallIcon.vue.js";
11
+ const at = ["messageId"], st = ["src"], lt = {
17
12
  key: 1,
18
13
  class: "call-message__subtext"
19
- }, Ze = { class: "call-message__content" }, qe = { class: "call-message__header-container" }, ze = { class: "call-message__title-wrapper" }, He = {
14
+ }, nt = { class: "call-message__content" }, ot = { class: "call-message__header-container" }, it = { class: "call-message__title-wrapper" }, rt = {
20
15
  key: 0,
21
16
  class: "call-message__title"
22
- }, Ge = { class: "call-message__call-participant" }, Je = {
17
+ }, ut = {
23
18
  key: 1,
24
19
  class: "call-message__title call-message__title--missed"
25
- }, Ke = { class: "call-message__call-participant" }, Qe = {
20
+ }, ct = {
26
21
  key: 0,
27
22
  class: "call-message__title"
28
- }, Xe = { class: "call-message__call-participant" }, Ye = {
23
+ }, dt = {
29
24
  key: 1,
30
25
  class: "call-message__title call-message__title--missed"
31
- }, We = { class: "call-message__call-participant" }, et = {
26
+ }, mt = {
32
27
  key: 0,
33
28
  class: "call-message__missed-info"
34
- }, tt = {
29
+ }, vt = {
35
30
  key: 1,
36
31
  class: "call-message__audio-wrapper"
37
- }, at = ["src"], st = { class: "call-message__audio-progress" }, lt = { class: "call-message__audio-progress-bar" }, ot = ["max"], nt = { class: "call-message__audio-time" }, it = { class: "call-message__info-container" }, ut = { class: "call-message__time" }, ct = ["data-theme"], rt = { class: "call-message__modal" }, Ft = /* @__PURE__ */ Se({
32
+ }, pt = ["src"], ft = { class: "call-message__audio-progress" }, gt = { class: "call-message__audio-progress-bar" }, _t = ["max"], yt = { class: "call-message__audio-time" }, ht = { class: "call-message__info-container" }, Ct = { class: "call-message__actions" }, xt = { class: "call-message__time" }, bt = {
33
+ key: 0,
34
+ class: "call-message__expand-panel"
35
+ }, kt = { class: "call-message__expand-inner" }, wt = {
36
+ key: 0,
37
+ class: "call-message__expand-placeholder"
38
+ }, Tt = {
39
+ key: 0,
40
+ class: "call-message__expand-plain"
41
+ }, Mt = {
42
+ key: 1,
43
+ class: "call-message__expand-plain"
44
+ }, St = {
45
+ key: 0,
46
+ class: "call-message__expand-placeholder"
47
+ }, Ft = { class: "call-message__expand-close-wrap" }, pe = "Распознаем звонок, пожалуйста подождите...", Ut = /* @__PURE__ */ He({
38
48
  __name: "CallMessage",
39
49
  props: {
40
50
  message: {
@@ -52,20 +62,99 @@ const Be = ["messageId"], Ue = ["src"], Oe = {
52
62
  }
53
63
  },
54
64
  emits: ["action", "reply"],
55
- setup(oe, { emit: ne }) {
56
- const ie = P("chatAppId"), { getTheme: B } = Ae(ie), U = P("channels", void 0), O = P("selectedChat", void 0), ue = v(() => {
57
- if (U)
58
- return s(U);
59
- }), ce = v(() => {
60
- if (O)
61
- return s(O);
62
- }), re = ne, T = oe, { message: a, applyStyle: de } = $e(T), {
63
- isOpenMenu: V,
64
- buttonMenuVisible: me,
65
- showMenu: Z,
66
- hideMenu: A,
67
- clickAction: pe
68
- } = Ee(T.message, re), M = y(!1), o = y(null), m = y(!1), C = y(0), p = y(0), h = y(!1), F = y(0), E = [
65
+ setup(fe, { emit: ge }) {
66
+ function q(e) {
67
+ if (e == null) return null;
68
+ if (typeof e == "object") return e;
69
+ if (typeof e != "string") return null;
70
+ const t = e.trim();
71
+ if (!t) return null;
72
+ try {
73
+ return JSON.parse(t);
74
+ } catch {
75
+ return null;
76
+ }
77
+ }
78
+ function _e(e) {
79
+ if (!Number.isFinite(e) || e < 0) return "0:00";
80
+ const t = Math.floor(e), a = Math.floor(t / 60), u = t % 60;
81
+ return `${a}:${u.toString().padStart(2, "0")}`;
82
+ }
83
+ function ye(e) {
84
+ return e === "2" ? "right" : "left";
85
+ }
86
+ function z(e) {
87
+ const t = e.transcript;
88
+ return t && typeof t == "object" && "replies" in t ? t : typeof t == "string" && t.trim() ? q(t) : null;
89
+ }
90
+ function he(e) {
91
+ return e != null && e.length ? e.map((t) => {
92
+ const a = typeof t.timecode == "number" ? t.timecode : Number(t.timecode);
93
+ return {
94
+ time: _e(a),
95
+ text: t.text ?? "",
96
+ position: ye(String(t.user ?? ""))
97
+ };
98
+ }) : [];
99
+ }
100
+ function Ce(e) {
101
+ var a;
102
+ if (e == null) return null;
103
+ const t = String(e).trim();
104
+ if (!t) return null;
105
+ if (t.startsWith("{")) {
106
+ const u = q(t);
107
+ return ((a = u == null ? void 0 : u.summary) == null ? void 0 : a.trim()) || null;
108
+ }
109
+ return t;
110
+ }
111
+ function xe(e) {
112
+ const t = e.callSummary;
113
+ return t == null ? null : typeof t == "object" && t !== null && "summary" in t ? String(t.summary ?? "").trim() || null : typeof t == "string" ? Ce(t) : null;
114
+ }
115
+ const J = re("channels", void 0), H = re("selectedChat", void 0), be = m(() => {
116
+ if (J)
117
+ return l(J);
118
+ }), ke = m(() => {
119
+ if (H)
120
+ return l(H);
121
+ }), D = ge, T = fe, { message: s, applyStyle: we } = Ge(T), M = m(() => {
122
+ const e = s.value;
123
+ return e.url ? e.url : typeof e.recordUrl == "string" ? e.recordUrl : void 0;
124
+ }), {
125
+ isOpenMenu: R,
126
+ buttonMenuVisible: Te,
127
+ showMenu: G,
128
+ hideMenu: V,
129
+ clickAction: Me
130
+ } = We(T.message, D), _ = y(null), S = m(() => {
131
+ var u;
132
+ const e = s.value, t = e.transcript;
133
+ if (t && typeof t == "object" && "dialog" in t && ((u = t.dialog) != null && u.length))
134
+ return t.dialog;
135
+ const a = z(e);
136
+ return he(a == null ? void 0 : a.replies);
137
+ }), K = m(() => {
138
+ var u;
139
+ if (S.value.length) return "";
140
+ const e = s.value, t = e.transcript;
141
+ if (t && typeof t == "object" && "text" in t && t.text)
142
+ return t.text;
143
+ const a = z(e);
144
+ return (u = a == null ? void 0 : a.replies) != null && u.length ? a.replies.map((d) => d.text).filter(Boolean).join(`
145
+ `) : "Текст недоступен";
146
+ }), Q = m(() => S.value.length ? [] : K.value.split(/\r?\n+/g).map((e) => e.trim()).filter(Boolean)), W = m(() => {
147
+ var t, a;
148
+ const e = (t = s.value) == null ? void 0 : t.transcript;
149
+ return e ? typeof e == "string" ? e.trim().length > 0 : !!(typeof e == "object" && ("dialog" in e && Array.isArray(e.dialog) && e.dialog.length || "text" in e && typeof e.text == "string" && e.text.trim() || "replies" in e && Array.isArray(e.replies) && ((a = e.replies) != null && a.length))) : !1;
150
+ }), X = m(() => {
151
+ var t;
152
+ const e = (t = s.value) == null ? void 0 : t.callSummary;
153
+ return e ? typeof e == "string" ? e.trim().length > 0 : typeof e == "object" && e !== null && "summary" in e ? String(e.summary ?? "").trim().length > 0 : !1 : !1;
154
+ }), F = y({
155
+ text: !1,
156
+ summary: !1
157
+ }), Se = m(() => xe(s.value) ?? "Резюме недоступно"), n = y(null), b = y(void 0), v = y(!1), C = y(0), f = y(0), x = y(!1), N = y(0), P = [
69
158
  {
70
159
  text: "1.0x",
71
160
  speed: 1
@@ -82,61 +171,69 @@ const Be = ["messageId"], Ue = ["src"], Oe = {
82
171
  text: "2.0x",
83
172
  speed: 2
84
173
  }
85
- ], L = v(() => E[F.value] ?? E[0]), ve = () => {
86
- m.value = !1, p.value = 0, C.value = 0, h.value = !1, F.value = 0;
174
+ ], U = m(() => P[N.value] ?? P[0]), Fe = (e) => {
175
+ if (!e) return;
176
+ const a = e.trim().match(/^(\d+):([0-5]\d)$/);
177
+ if (!a) return;
178
+ const u = Number(a[1]), d = Number(a[2]);
179
+ if (!(Number.isNaN(u) || Number.isNaN(d)))
180
+ return u * 60 + d;
181
+ }, Y = () => {
182
+ var e;
183
+ v.value = !1, f.value = 0, C.value = Fe((e = s.value) == null ? void 0 : e.callDuration) ?? 0, x.value = !1, N.value = 0;
87
184
  };
88
- ee(
89
- () => {
90
- var t;
91
- return (t = a.value) == null ? void 0 : t.url;
92
- },
93
- (t, e) => {
94
- t !== e && (ve(), o.value && (o.value.pause(), o.value.currentTime = 0, o.value.load()));
185
+ Y(), ue(
186
+ M,
187
+ (e, t) => {
188
+ e !== t && (Y(), b.value = void 0, n.value && (n.value.pause(), n.value.currentTime = 0, n.value.removeAttribute("src"), n.value.load()));
95
189
  }
96
190
  );
97
- const q = (t) => {
98
- const e = Math.floor(t / 60), r = Math.floor(t % 60);
99
- return `${e.toString().padStart(2, "0")}:${r.toString().padStart(2, "0")}`;
100
- }, ge = v(() => q(p.value)), _e = v(() => q(C.value)), z = async () => {
101
- if (o.value)
102
- if (m.value)
103
- o.value.pause(), m.value = !1;
191
+ const ee = (e) => {
192
+ const t = Math.floor(e / 60), a = Math.floor(e % 60);
193
+ return `${t.toString().padStart(2, "0")}:${a.toString().padStart(2, "0")}`;
194
+ }, Ne = m(() => ee(f.value)), Ie = m(() => ee(C.value)), te = async () => {
195
+ const e = M.value;
196
+ if (!(!n.value || !e))
197
+ if (v.value)
198
+ n.value.pause(), v.value = !1;
104
199
  else
105
200
  try {
106
- await o.value.play(), m.value = !0;
201
+ b.value || (b.value = e, await Qe(), n.value.load()), await n.value.play(), v.value = !0;
107
202
  } catch (t) {
108
- console.error("Не удалось воспроизвести запись звонка", t), m.value = !1;
203
+ console.error("Не удалось воспроизвести запись звонка", t), v.value = !1;
109
204
  }
110
- }, fe = () => {
111
- F.value = (F.value + 1) % E.length, o.value && (o.value.playbackRate = L.value.speed);
205
+ }, Ae = () => {
206
+ N.value = (N.value + 1) % P.length, n.value && (n.value.playbackRate = U.value.speed);
112
207
  };
113
- ee(
114
- () => p.value,
208
+ ue(
209
+ () => f.value,
115
210
  () => {
116
- o.value && h.value && (o.value.duration !== 1 / 0 && !Number.isNaN(o.value.duration) && (o.value.currentTime = p.value), Math.abs(p.value - C.value) < 0.1 && (m.value = !1));
211
+ n.value && x.value && (n.value.duration !== 1 / 0 && !Number.isNaN(n.value.duration) && (n.value.currentTime = f.value), Math.abs(f.value - C.value) < 0.1 && (v.value = !1));
117
212
  }
118
213
  );
119
- const H = () => {
120
- o.value && h.value && o.value.duration !== 1 / 0 && !Number.isNaN(o.value.duration) && (o.value.currentTime = p.value), h.value = !1;
121
- }, Ce = () => {
122
- if (!o.value) return;
123
- const t = o.value;
124
- if (C.value = 0, p.value = t.currentTime || 0, t.duration === 1 / 0 || Number.isNaN(t.duration)) {
125
- t.currentTime = 1e101;
126
- const e = () => {
127
- o.value && (C.value = o.value.duration || 0, p.value = 0, o.value.currentTime = 0);
214
+ const ae = () => {
215
+ n.value && x.value && n.value.duration !== 1 / 0 && !Number.isNaN(n.value.duration) && (n.value.currentTime = f.value), x.value = !1;
216
+ }, $e = () => {
217
+ if (!n.value) return;
218
+ const e = n.value;
219
+ if (C.value = 0, f.value = e.currentTime || 0, e.duration === 1 / 0 || Number.isNaN(e.duration)) {
220
+ e.currentTime = 1e101;
221
+ const t = () => {
222
+ n.value && (C.value = n.value.duration || 0, f.value = 0, n.value.currentTime = 0);
128
223
  };
129
- t.addEventListener("timeupdate", e, { once: !0 });
224
+ e.addEventListener("timeupdate", t, { once: !0 });
130
225
  } else
131
- C.value = t.duration || 0;
132
- t.playbackRate = L.value.speed;
133
- }, he = () => {
134
- o.value && (h.value || (p.value = o.value.currentTime), o.value.ended && m.value && (m.value = !1));
135
- }, ye = () => {
136
- m.value = !1;
137
- }, I = v(() => {
138
- var t;
139
- switch ((t = a.value) == null ? void 0 : t.direction) {
226
+ C.value = e.duration || 0;
227
+ e.playbackRate = U.value.speed;
228
+ }, je = () => {
229
+ n.value && (x.value || (f.value = n.value.currentTime), n.value.ended && v.value && (v.value = !1));
230
+ }, Ee = () => {
231
+ v.value = !1;
232
+ }, Le = () => {
233
+ console.error("Не удалось загрузить запись звонка"), v.value = !1, b.value = void 0, n.value && (n.value.pause(), n.value.currentTime = 0, n.value.removeAttribute("src"), n.value.load());
234
+ }, I = m(() => {
235
+ var e;
236
+ switch ((e = s.value) == null ? void 0 : e.direction) {
140
237
  case "incoming":
141
238
  return "Входящий";
142
239
  case "outgoing":
@@ -144,69 +241,63 @@ const Be = ["messageId"], Ue = ["src"], Oe = {
144
241
  default:
145
242
  return "Звонок";
146
243
  }
147
- }), S = v(() => {
148
- var t;
149
- switch ((t = a.value) == null ? void 0 : t.direction) {
244
+ }), se = m(() => {
245
+ var t, a;
246
+ const e = (t = s.value) == null ? void 0 : t.isMissedCall;
247
+ switch ((a = s.value) == null ? void 0 : a.direction) {
150
248
  case "incoming":
151
- return "к";
249
+ return e ? "#F84932" : "#00AC47";
152
250
  case "outgoing":
153
- return "на";
251
+ return e ? "#5F5F5F" : "#118ABF";
154
252
  default:
155
- return "к";
253
+ return e ? "#5F5F5F" : "#00AC47";
156
254
  }
157
- }), G = v(() => {
158
- var e, r;
159
- const t = (e = a.value) == null ? void 0 : e.isMissedCall;
160
- switch ((r = a.value) == null ? void 0 : r.direction) {
161
- case "incoming":
162
- return t ? "#F84932" : "#00AC47";
163
- case "outgoing":
164
- return t ? "#5F5F5F" : "#118ABF";
165
- default:
166
- return t ? "#5F5F5F" : "#00AC47";
167
- }
168
- }), we = v(() => {
169
- var t;
170
- return ((t = a.value) == null ? void 0 : t.direction) === "outgoing" ? "Без ответа" : "Пропущенный";
171
- }), J = v(() => {
172
- var g;
173
- const t = a.value, e = ue.value, r = ce.value;
174
- if (!(t != null && t.dialogId) || !e || !r)
255
+ }), De = m(() => {
256
+ var e;
257
+ return ((e = s.value) == null ? void 0 : e.direction) === "outgoing" ? "Без ответа" : "Пропущенный";
258
+ }), le = m(() => {
259
+ var A;
260
+ const e = s.value, t = be.value, a = ke.value;
261
+ if (!(e != null && e.dialogId) || !t || !a)
175
262
  return null;
176
- const u = (g = r.dialogs) == null ? void 0 : g.find((x) => x.dialogId === t.dialogId);
263
+ const u = (A = a.dialogs) == null ? void 0 : A.find((k) => k.dialogId === e.dialogId);
177
264
  if (!(u != null && u.channelId))
178
265
  return null;
179
- const d = e.find((x) => x.channelId === u.channelId);
266
+ const d = t.find((k) => k.channelId === u.channelId);
180
267
  return (d == null ? void 0 : d.title) || null;
181
- }), xe = Le(() => T.message, () => T.subtextTooltipData), K = {
182
- textDialog: "textDialog",
268
+ }), Re = Xe(() => T.message, () => T.subtextTooltipData), Ve = {
183
269
  message: "message"
184
270
  };
185
- function Q(t, e) {
186
- const r = t.position;
187
- switch (e) {
188
- case "textDialog":
189
- return r === "left" ? "call-message__text-dialog-left" : "call-message__text-dialog-right";
271
+ function Pe(e, t) {
272
+ const a = e.position;
273
+ switch (t) {
190
274
  case "message":
191
- return r === "left" ? "call-message__left" : "call-message__right";
275
+ return a === "left" ? "call-message__left" : "call-message__right";
192
276
  default:
193
277
  return "";
194
278
  }
195
279
  }
196
- const be = () => {
280
+ const Ue = () => {
197
281
  alert("Перезвонить");
198
- }, ke = async () => {
199
- var t, e, r, u, d;
200
- if ((t = a.value) != null && t.url)
282
+ }, Be = () => {
283
+ const e = _.value === "text" ? null : "text";
284
+ _.value = e, e === "text" && !W.value && !F.value.text && (F.value.text = !0, D("action", { action: "fetchTranscript", messageId: s.value.messageId }));
285
+ }, Oe = () => {
286
+ const e = _.value === "summary" ? null : "summary";
287
+ _.value = e, e === "summary" && !X.value && !F.value.summary && (F.value.summary = !0, D("action", { action: "fetchCallSummary", messageId: s.value.messageId }));
288
+ }, Ze = async () => {
289
+ var t, a, u;
290
+ const e = M.value;
291
+ if (e)
201
292
  try {
202
- const g = await fetch(a.value.url, {
293
+ const d = await fetch(e, {
203
294
  headers: {
204
295
  Accept: "audio/*"
205
296
  }
206
297
  });
207
- if (!g.ok)
208
- throw new Error(`HTTP error! status: ${g.status}`);
209
- const x = g.headers.get("content-type") || "", Me = await g.blob(), $ = ((r = (e = a.value.url.split(".").pop()) == null ? void 0 : e.split("?")[0]) == null ? void 0 : r.toLowerCase()) || "", Fe = {
298
+ if (!d.ok)
299
+ throw new Error(`HTTP error! status: ${d.status}`);
300
+ const A = d.headers.get("content-type") || "", k = await d.blob(), $ = ((a = (t = e.split(".").pop()) == null ? void 0 : t.split("?")[0]) == null ? void 0 : a.toLowerCase()) || "", ze = {
210
301
  "audio/mpeg": "mp3",
211
302
  "audio/mp3": "mp3",
212
303
  "audio/wav": "wav",
@@ -218,260 +309,264 @@ const Be = ["messageId"], Ue = ["src"], Oe = {
218
309
  "audio/m4a": "m4a",
219
310
  "audio/x-m4a": "m4a",
220
311
  "application/octet-stream": $ || "mp3"
221
- }, X = $ && ["mp3", "wav", "ogg", "webm", "aac", "flac", "m4a"].includes($) ? $ : Fe[x] || "mp3", Y = a.value.url.split("/"), D = decodeURIComponent(((u = Y[Y.length - 1]) == null ? void 0 : u.split("?")[0]) || ""), Ie = D ? D.includes(".") ? D : `${D}.${X}` : `call-${a.value.messageId}.${X}`, W = window.URL.createObjectURL(Me), b = document.createElement("a");
222
- b.href = W, b.download = Ie, document.body.appendChild(b), b.click(), document.body.removeChild(b), window.URL.revokeObjectURL(W);
223
- } catch (g) {
224
- console.error("Ошибка при скачивании аудио звонка:", g), (d = a.value) != null && d.url && window.open(a.value.url, "_blank");
312
+ }, ne = $ && ["mp3", "wav", "ogg", "webm", "aac", "flac", "m4a"].includes($) ? $ : ze[A] || "mp3", oe = e.split("/"), j = decodeURIComponent(((u = oe[oe.length - 1]) == null ? void 0 : u.split("?")[0]) || ""), Je = j ? j.includes(".") ? j : `${j}.${ne}` : `call-${s.value.messageId}.${ne}`, ie = window.URL.createObjectURL(k), w = document.createElement("a");
313
+ w.href = ie, w.download = Je, document.body.appendChild(w), w.click(), document.body.removeChild(w), window.URL.revokeObjectURL(ie);
314
+ } catch (d) {
315
+ console.error("Ошибка при скачивании аудио звонка:", d), e && window.open(e, "_blank");
225
316
  }
226
- }, Te = (t) => {
227
- t.action === "download" ? (ke(), A()) : pe(t);
317
+ }, qe = (e) => {
318
+ e.action === "download" ? (Ze(), V()) : Me(e);
228
319
  };
229
- return (t, e) => {
230
- var r;
231
- return n(), c("div", {
232
- class: te([
233
- Q(s(a), K.message),
234
- s(de)(s(a))
235
- ]),
236
- messageId: s(a).messageId,
237
- onMouseenter: e[6] || (e[6] = //@ts-ignore
238
- (...u) => s(Z) && s(Z)(...u)),
239
- onMouseleave: e[7] || (e[7] = //@ts-ignore
240
- (...u) => s(A) && s(A)(...u))
241
- }, [
242
- s(a).avatar ? (n(), c("img", {
243
- key: 0,
244
- class: "call-message__avatar",
245
- src: s(a).avatar,
246
- height: "32",
247
- width: "32"
248
- }, null, 8, Ue)) : f("", !0),
249
- s(a).subText ? (n(), c("p", Oe, [
250
- R(le, {
251
- text: s(xe),
252
- position: s(a).position === "left" ? "right" : "left",
253
- offset: 8
254
- }, {
255
- default: N(() => [
256
- _(i(s(a).subText), 1)
257
- ]),
258
- _: 1
259
- }, 8, ["text", "position"])
260
- ])) : f("", !0),
261
- l("div", Ze, [
262
- l("div", qe, [
263
- l("div", ze, [
264
- s(a).direction === "incoming" || !s(a).direction ? (n(), k(Re, {
265
- key: 0,
266
- class: "call-message__direction-icon",
267
- color: G.value
268
- }, null, 8, ["color"])) : (n(), k(je, {
269
- key: 1,
270
- class: "call-message__direction-icon",
271
- color: G.value
272
- }, null, 8, ["color"])),
273
- J.value ? (n(), k(le, {
274
- key: 2,
275
- text: J.value,
276
- position: "top",
277
- offset: 8
278
- }, {
279
- default: N(() => [
280
- s(a).isMissedCall ? (n(), c("span", Je, [
281
- _(i(I.value) + " ", 1),
282
- s(a).direction !== "incoming" ? (n(), c(w, { key: 0 }, [
283
- e[8] || (e[8] = _(" звонок ", -1)),
284
- l("span", Ke, i(S.value) + " " + i(s(a).callParticipant), 1)
285
- ], 64)) : (n(), c(w, { key: 1 }, [
286
- _(" звонок ")
287
- ], 64))
288
- ])) : (n(), c("span", He, [
289
- _(i(I.value) + " звонок ", 1),
290
- l("span", Ge, i(S.value) + " " + i(s(a).callParticipant), 1)
291
- ]))
292
- ]),
293
- _: 1
294
- }, 8, ["text"])) : (n(), c(w, { key: 3 }, [
295
- s(a).isMissedCall ? (n(), c("span", Ye, [
296
- _(i(I.value) + " ", 1),
297
- s(a).direction !== "incoming" ? (n(), c(w, { key: 0 }, [
298
- e[9] || (e[9] = _(" звонок ", -1)),
299
- l("span", We, i(S.value) + " " + i(s(a).callParticipant), 1)
300
- ], 64)) : (n(), c(w, { key: 1 }, [
301
- _(" звонок ")
320
+ return (e, t) => (o(), i("div", {
321
+ class: B([
322
+ Pe(l(s), Ve.message),
323
+ l(we)(l(s))
324
+ ]),
325
+ messageId: l(s).messageId,
326
+ onMouseenter: t[5] || (t[5] = //@ts-ignore
327
+ (...a) => l(G) && l(G)(...a)),
328
+ onMouseleave: t[6] || (t[6] = //@ts-ignore
329
+ (...a) => l(V) && l(V)(...a))
330
+ }, [
331
+ l(s).avatar ? (o(), i("img", {
332
+ key: 0,
333
+ class: "call-message__avatar",
334
+ src: l(s).avatar,
335
+ height: "32",
336
+ width: "32"
337
+ }, null, 8, st)) : p("", !0),
338
+ l(s).subText ? (o(), i("p", lt, [
339
+ O(ve, {
340
+ text: l(Re),
341
+ position: l(s).position === "left" ? "right" : "left",
342
+ offset: 8
343
+ }, {
344
+ default: E(() => [
345
+ h(c(l(s).subText), 1)
346
+ ]),
347
+ _: 1
348
+ }, 8, ["text", "position"])
349
+ ])) : p("", !0),
350
+ r("div", nt, [
351
+ r("div", ot, [
352
+ r("div", it, [
353
+ l(s).direction === "incoming" || !l(s).direction ? (o(), L(et, {
354
+ key: 0,
355
+ class: "call-message__direction-icon",
356
+ color: se.value
357
+ }, null, 8, ["color"])) : (o(), L(tt, {
358
+ key: 1,
359
+ class: "call-message__direction-icon",
360
+ color: se.value
361
+ }, null, 8, ["color"])),
362
+ le.value ? (o(), L(ve, {
363
+ key: 2,
364
+ text: le.value,
365
+ position: "top",
366
+ offset: 8
367
+ }, {
368
+ default: E(() => [
369
+ l(s).isMissedCall ? (o(), i("span", ut, [
370
+ h(c(I.value) + " ", 1),
371
+ l(s).direction !== "incoming" ? (o(), i(g, { key: 0 }, [
372
+ h(" звонок ")
373
+ ], 64)) : (o(), i(g, { key: 1 }, [
374
+ h(" звонок ")
302
375
  ], 64))
303
- ])) : (n(), c("span", Qe, [
304
- _(i(I.value) + " звонок ", 1),
305
- l("span", Xe, i(S.value) + " " + i(s(a).callParticipant), 1)
306
- ]))
307
- ], 64))
308
- ]),
309
- s(a).isMissedCall ? (n(), c("p", et, i(we.value) + ": " + i(s(a).callAttemptDuration), 1)) : f("", !0),
310
- s(a).url && !s(a).isMissedCall ? (n(), c("div", tt, [
311
- l("audio", {
312
- ref_key: "player",
313
- ref: o,
314
- src: s(a).url,
315
- type: "audio/webm",
316
- onLoadedmetadata: Ce,
317
- onTimeupdate: he,
318
- onEnded: ye
319
- }, null, 40, at),
320
- j(l("button", {
321
- class: "call-message__audio-play",
322
- type: "button",
323
- onClick: z
324
- }, [...e[10] || (e[10] = [
325
- l("div", { class: "call-message__audio-play-icon" }, [
326
- l("svg", {
327
- width: "20",
328
- height: "23",
329
- viewBox: "0 0 20 23",
330
- fill: "none",
331
- xmlns: "http://www.w3.org/2000/svg"
332
- }, [
333
- l("path", {
334
- d: "M18.99 12.9934L3.0825 22.2234C1.7325 23.0059 0 22.0584 0 20.4809V2.02087C0 0.44587 1.73 -0.50413 3.0825 0.28087L18.99 9.51087C19.2971 9.68618 19.5524 9.93959 19.7299 10.2454C19.9075 10.5512 20.001 10.8985 20.001 11.2521C20.001 11.6057 19.9075 11.953 19.7299 12.2589C19.5524 12.5647 19.2971 12.8181 18.99 12.9934Z",
335
- fill: "#5F5F5F"
336
- })
337
- ])
338
- ], -1)
339
- ])], 512), [
340
- [ae, !m.value]
376
+ ])) : (o(), i("span", rt, c(I.value) + " звонок ", 1))
341
377
  ]),
342
- j(l("button", {
343
- class: "call-message__audio-pause",
344
- type: "button",
345
- onClick: z
346
- }, [...e[11] || (e[11] = [
347
- l("div", { class: "call-message__audio-pause-icon" }, [
348
- l("svg", {
349
- width: "20",
350
- height: "23",
351
- viewBox: "0 0 20 23",
352
- fill: "none",
353
- xmlns: "http://www.w3.org/2000/svg"
354
- }, [
355
- l("path", {
356
- d: "M3.75 0C4.74456 0 5.69839 0.395088 6.40165 1.09835C7.10491 1.80161 7.5 2.75544 7.5 3.75V18.75C7.5 19.7446 7.10491 20.6984 6.40165 21.4017C5.69839 22.1049 4.74456 22.5 3.75 22.5C2.75544 22.5 1.80161 22.1049 1.09835 21.4017C0.395088 20.6984 0 19.7446 0 18.75V3.75C0 2.75544 0.395088 1.80161 1.09835 1.09835C1.80161 0.395088 2.75544 0 3.75 0ZM16.25 0C17.2446 0 18.1984 0.395088 18.9017 1.09835C19.6049 1.80161 20 2.75544 20 3.75V18.75C20 19.7446 19.6049 20.6984 18.9017 21.4017C18.1984 22.1049 17.2446 22.5 16.25 22.5C15.2554 22.5 14.3016 22.1049 13.5983 21.4017C12.8951 20.6984 12.5 19.7446 12.5 18.75V3.75C12.5 2.75544 12.8951 1.80161 13.5983 1.09835C14.3016 0.395088 15.2554 0 16.25 0Z",
357
- fill: "#5F5F5F"
358
- })
359
- ])
360
- ], -1)
361
- ])], 512), [
362
- [ae, m.value]
363
- ]),
364
- l("div", st, [
365
- l("div", lt, [
366
- j(l("input", {
367
- "onUpdate:modelValue": e[0] || (e[0] = (u) => p.value = u),
368
- class: "call-message__audio-slider",
369
- type: "range",
370
- min: 0,
371
- max: C.value,
372
- step: "0.1",
373
- onMousedown: e[1] || (e[1] = (u) => h.value = !0),
374
- onMouseup: H,
375
- onTouchstartPassive: e[2] || (e[2] = (u) => h.value = !0),
376
- onTouchendPassive: H
377
- }, null, 40, ot), [
378
- [De, p.value]
379
- ]),
380
- l("button", {
381
- type: "button",
382
- class: "call-message__audio-speed-btn",
383
- onClick: fe
384
- }, i(L.value.text), 1)
385
- ]),
386
- l("div", nt, [
387
- l("span", null, i(ge.value), 1),
388
- l("span", null, i(_e.value), 1)
378
+ _: 1
379
+ }, 8, ["text"])) : (o(), i(g, { key: 3 }, [
380
+ l(s).isMissedCall ? (o(), i("span", dt, [
381
+ h(c(I.value) + " ", 1),
382
+ l(s).direction !== "incoming" ? (o(), i(g, { key: 0 }, [
383
+ h(" звонок ")
384
+ ], 64)) : (o(), i(g, { key: 1 }, [
385
+ h(" звонок ")
386
+ ], 64))
387
+ ])) : (o(), i("span", ct, c(I.value) + " звонок ", 1))
388
+ ], 64))
389
+ ]),
390
+ l(s).isMissedCall ? (o(), i("p", mt, c(De.value) + ": " + c(l(s).callAttemptDuration), 1)) : p("", !0),
391
+ M.value && !l(s).isMissedCall ? (o(), i("div", vt, [
392
+ r("audio", {
393
+ ref_key: "player",
394
+ ref: n,
395
+ src: b.value,
396
+ type: "audio/webm",
397
+ onLoadedmetadata: $e,
398
+ onTimeupdate: je,
399
+ onEnded: Ee,
400
+ onError: Le
401
+ }, null, 40, pt),
402
+ Z(r("button", {
403
+ class: "call-message__audio-play",
404
+ type: "button",
405
+ onClick: te
406
+ }, [...t[7] || (t[7] = [
407
+ r("div", { class: "call-message__audio-play-icon" }, [
408
+ r("svg", {
409
+ width: "20",
410
+ height: "23",
411
+ viewBox: "0 0 20 23",
412
+ fill: "none",
413
+ xmlns: "http://www.w3.org/2000/svg"
414
+ }, [
415
+ r("path", {
416
+ d: "M18.99 12.9934L3.0825 22.2234C1.7325 23.0059 0 22.0584 0 20.4809V2.02087C0 0.44587 1.73 -0.50413 3.0825 0.28087L18.99 9.51087C19.2971 9.68618 19.5524 9.93959 19.7299 10.2454C19.9075 10.5512 20.001 10.8985 20.001 11.2521C20.001 11.6057 19.9075 11.953 19.7299 12.2589C19.5524 12.5647 19.2971 12.8181 18.99 12.9934Z",
417
+ fill: "#5F5F5F"
418
+ })
389
419
  ])
420
+ ], -1)
421
+ ])], 512), [
422
+ [ce, !v.value]
423
+ ]),
424
+ Z(r("button", {
425
+ class: "call-message__audio-pause",
426
+ type: "button",
427
+ onClick: te
428
+ }, [...t[8] || (t[8] = [
429
+ r("div", { class: "call-message__audio-pause-icon" }, [
430
+ r("svg", {
431
+ width: "20",
432
+ height: "23",
433
+ viewBox: "0 0 20 23",
434
+ fill: "none",
435
+ xmlns: "http://www.w3.org/2000/svg"
436
+ }, [
437
+ r("path", {
438
+ d: "M3.75 0C4.74456 0 5.69839 0.395088 6.40165 1.09835C7.10491 1.80161 7.5 2.75544 7.5 3.75V18.75C7.5 19.7446 7.10491 20.6984 6.40165 21.4017C5.69839 22.1049 4.74456 22.5 3.75 22.5C2.75544 22.5 1.80161 22.1049 1.09835 21.4017C0.395088 20.6984 0 19.7446 0 18.75V3.75C0 2.75544 0.395088 1.80161 1.09835 1.09835C1.80161 0.395088 2.75544 0 3.75 0ZM16.25 0C17.2446 0 18.1984 0.395088 18.9017 1.09835C19.6049 1.80161 20 2.75544 20 3.75V18.75C20 19.7446 19.6049 20.6984 18.9017 21.4017C18.1984 22.1049 17.2446 22.5 16.25 22.5C15.2554 22.5 14.3016 22.1049 13.5983 21.4017C12.8951 20.6984 12.5 19.7446 12.5 18.75V3.75C12.5 2.75544 12.8951 1.80161 13.5983 1.09835C14.3016 0.395088 15.2554 0 16.25 0Z",
439
+ fill: "#5F5F5F"
440
+ })
441
+ ])
442
+ ], -1)
443
+ ])], 512), [
444
+ [ce, v.value]
445
+ ]),
446
+ r("div", ft, [
447
+ r("div", gt, [
448
+ Z(r("input", {
449
+ "onUpdate:modelValue": t[0] || (t[0] = (a) => f.value = a),
450
+ class: "call-message__audio-slider",
451
+ type: "range",
452
+ min: 0,
453
+ max: C.value,
454
+ step: "0.1",
455
+ onMousedown: t[1] || (t[1] = (a) => x.value = !0),
456
+ onMouseup: ae,
457
+ onTouchstartPassive: t[2] || (t[2] = (a) => x.value = !0),
458
+ onTouchendPassive: ae
459
+ }, null, 40, _t), [
460
+ [Ke, f.value]
461
+ ]),
462
+ r("button", {
463
+ type: "button",
464
+ class: "call-message__audio-speed-btn",
465
+ onClick: Ae
466
+ }, c(U.value.text), 1)
467
+ ]),
468
+ r("div", yt, [
469
+ r("span", null, c(Ne.value), 1),
470
+ r("span", null, c(Ie.value), 1)
390
471
  ])
391
- ])) : f("", !0)
392
- ]),
393
- l("div", it, [
394
- l("button", {
472
+ ])
473
+ ])) : p("", !0)
474
+ ]),
475
+ r("div", ht, [
476
+ r("div", Ct, [
477
+ l(s).isMissedCall ? p("", !0) : (o(), i("button", {
478
+ key: 0,
479
+ class: B([
480
+ "call-message__call-button",
481
+ { "call-message__call-button--active": _.value === "text" }
482
+ ]),
483
+ type: "button",
484
+ onClick: Be
485
+ }, " Текст ", 2)),
486
+ l(s).isMissedCall ? p("", !0) : (o(), i("button", {
487
+ key: 1,
488
+ class: B([
489
+ "call-message__call-button",
490
+ { "call-message__call-button--active": _.value === "summary" }
491
+ ]),
492
+ type: "button",
493
+ onClick: Oe
494
+ }, " Резюме ", 2)),
495
+ r("button", {
395
496
  class: "call-message__call-button",
396
497
  type: "button",
397
- onClick: be
398
- }, " Нажмите, чтобы перезвонить "),
399
- l("span", ut, i(s(a).time), 1)
498
+ onClick: Ue
499
+ }, " Перезвонить ")
400
500
  ]),
401
- (r = s(a).transcript) != null && r.dialog ? (n(), c("button", {
402
- key: 0,
403
- class: "call-message__download-button",
404
- onClick: e[3] || (e[3] = (u) => M.value = !M.value)
405
- }, [...e[12] || (e[12] = [
406
- l("span", { class: "pi pi-arrow-up-right" }, null, -1)
407
- ])])) : f("", !0),
408
- s(me) && s(a).actions ? (n(), c("button", {
409
- key: 1,
410
- class: "call-message__menu-button",
411
- onClick: e[4] || (e[4] = (u) => V.value = !s(V))
412
- }, [...e[13] || (e[13] = [
413
- l("svg", {
414
- width: "4",
415
- height: "17",
416
- viewBox: "0 0 4 17",
417
- fill: "none",
418
- xmlns: "http://www.w3.org/2000/svg"
419
- }, [
420
- l("path", {
421
- d: "M3.75 14.375C3.75 14.8723 3.55246 15.3492 3.20083 15.7008C2.84919 16.0525 2.37228 16.25 1.875 16.25C1.37772 16.25 0.900805 16.0525 0.549175 15.7008C0.197544 15.3492 0 14.8723 0 14.375C0 13.8777 0.197544 13.4008 0.549175 13.0492C0.900805 12.6975 1.37772 12.5 1.875 12.5C2.37228 12.5 2.84919 12.6975 3.20083 13.0492C3.55246 13.4008 3.75 13.8777 3.75 14.375ZM3.75 8.125C3.75 8.62228 3.55246 9.09919 3.20083 9.45083C2.84919 9.80246 2.37228 10 1.875 10C1.37772 10 0.900805 9.80246 0.549175 9.45083C0.197544 9.09919 0 8.62228 0 8.125C0 7.62772 0.197544 7.15081 0.549175 6.79917C0.900805 6.44754 1.37772 6.25 1.875 6.25C2.37228 6.25 2.84919 6.44754 3.20083 6.79917C3.55246 7.15081 3.75 7.62772 3.75 8.125ZM3.75 1.875C3.75 2.37228 3.55246 2.84919 3.20083 3.20083C2.84919 3.55246 2.37228 3.75 1.875 3.75C1.37772 3.75 0.900805 3.55246 0.549175 3.20083C0.197544 2.84919 0 2.37228 0 1.875C0 1.37772 0.197544 0.900806 0.549175 0.549175C0.900805 0.197544 1.37772 0 1.875 0C2.37228 0 2.84919 0.197544 3.20083 0.549175C3.55246 0.900806 3.75 1.37772 3.75 1.875Z",
422
- fill: "#5F5F5F"
423
- })
424
- ], -1)
425
- ])])) : f("", !0),
426
- R(se, null, {
427
- default: N(() => [
428
- s(V) && s(a).actions ? (n(), k(Pe, {
429
- key: 0,
430
- class: "call-message__context-menu",
431
- actions: s(a).actions,
432
- onClick: Te
433
- }, null, 8, ["actions"])) : f("", !0)
434
- ]),
435
- _: 1
436
- }),
437
- (n(), k(Ne, { to: "body" }, [
438
- R(se, { name: "modal-fade" }, {
439
- default: N(() => {
440
- var u;
441
- return [
442
- M.value ? (n(), c("div", {
443
- key: 0,
444
- class: "call-message__modal-overlay",
445
- "data-theme": s(B)().theme ? s(B)().theme : "light"
446
- }, [
447
- l("div", rt, [
448
- l("button", {
449
- class: "call-message__modal-close-button",
450
- onClick: e[5] || (e[5] = (d) => M.value = !1)
451
- }, [...e[14] || (e[14] = [
452
- l("span", null, [
453
- l("i", { class: "pi pi-times" })
454
- ], -1)
455
- ])]),
456
- (n(!0), c(w, null, Ve((u = s(a).transcript) == null ? void 0 : u.dialog, (d) => (n(), c("div", {
457
- key: d.time,
458
- class: te(Q(d, K.textDialog))
459
- }, [
460
- l("p", null, i(d.text), 1),
461
- l("span", null, i(d.time), 1)
462
- ], 2))), 128))
463
- ])
464
- ], 8, ct)) : f("", !0)
465
- ];
466
- }),
467
- _: 1
501
+ r("span", xt, c(l(s).time), 1)
502
+ ]),
503
+ O(de, { name: "call-message-expand" }, {
504
+ default: E(() => [
505
+ _.value ? (o(), i("div", bt, [
506
+ r("div", kt, [
507
+ _.value === "text" ? (o(), i(g, { key: 0 }, [
508
+ W.value ? p("", !0) : (o(), i("p", wt, c(pe))),
509
+ (o(!0), i(g, null, me(S.value, (a, u) => (o(), i("p", {
510
+ key: `tr-${u}`,
511
+ class: "call-message__expand-line"
512
+ }, c(a.text), 1))), 128)),
513
+ S.value.length ? p("", !0) : (o(), i(g, { key: 1 }, [
514
+ (o(!0), i(g, null, me(Q.value, (a, u) => (o(), i("p", {
515
+ key: `tr-fallback-${u}`,
516
+ class: "call-message__expand-line"
517
+ }, c(a), 1))), 128)),
518
+ Q.value.length ? p("", !0) : (o(), i("p", Tt, c(K.value), 1))
519
+ ], 64))
520
+ ], 64)) : (o(), i("p", Mt, [
521
+ X.value ? (o(), i(g, { key: 1 }, [
522
+ h(c(Se.value), 1)
523
+ ], 64)) : (o(), i("span", St, c(pe)))
524
+ ]))
525
+ ]),
526
+ r("div", Ft, [
527
+ r("button", {
528
+ type: "button",
529
+ class: "call-message__expand-close",
530
+ onClick: t[3] || (t[3] = (a) => _.value = null)
531
+ }, " Закрыть ")
532
+ ])
533
+ ])) : p("", !0)
534
+ ]),
535
+ _: 1
536
+ }),
537
+ l(Te) && l(s).actions ? (o(), i("button", {
538
+ key: 0,
539
+ class: "call-message__menu-button",
540
+ onClick: t[4] || (t[4] = (a) => R.value = !l(R))
541
+ }, [...t[9] || (t[9] = [
542
+ r("svg", {
543
+ width: "4",
544
+ height: "17",
545
+ viewBox: "0 0 4 17",
546
+ fill: "none",
547
+ xmlns: "http://www.w3.org/2000/svg"
548
+ }, [
549
+ r("path", {
550
+ d: "M3.75 14.375C3.75 14.8723 3.55246 15.3492 3.20083 15.7008C2.84919 16.0525 2.37228 16.25 1.875 16.25C1.37772 16.25 0.900805 16.0525 0.549175 15.7008C0.197544 15.3492 0 14.8723 0 14.375C0 13.8777 0.197544 13.4008 0.549175 13.0492C0.900805 12.6975 1.37772 12.5 1.875 12.5C2.37228 12.5 2.84919 12.6975 3.20083 13.0492C3.55246 13.4008 3.75 13.8777 3.75 14.375ZM3.75 8.125C3.75 8.62228 3.55246 9.09919 3.20083 9.45083C2.84919 9.80246 2.37228 10 1.875 10C1.37772 10 0.900805 9.80246 0.549175 9.45083C0.197544 9.09919 0 8.62228 0 8.125C0 7.62772 0.197544 7.15081 0.549175 6.79917C0.900805 6.44754 1.37772 6.25 1.875 6.25C2.37228 6.25 2.84919 6.44754 3.20083 6.79917C3.55246 7.15081 3.75 7.62772 3.75 8.125ZM3.75 1.875C3.75 2.37228 3.55246 2.84919 3.20083 3.20083C2.84919 3.55246 2.37228 3.75 1.875 3.75C1.37772 3.75 0.900805 3.55246 0.549175 3.20083C0.197544 2.84919 0 2.37228 0 1.875C0 1.37772 0.197544 0.900806 0.549175 0.549175C0.900805 0.197544 1.37772 0 1.875 0C2.37228 0 2.84919 0.197544 3.20083 0.549175C3.55246 0.900806 3.75 1.37772 3.75 1.875Z",
551
+ fill: "#5F5F5F"
468
552
  })
469
- ]))
470
- ])
471
- ], 42, Be);
472
- };
553
+ ], -1)
554
+ ])])) : p("", !0),
555
+ O(de, null, {
556
+ default: E(() => [
557
+ l(R) && l(s).actions ? (o(), L(Ye, {
558
+ key: 0,
559
+ class: "call-message__context-menu",
560
+ actions: l(s).actions,
561
+ onClick: qe
562
+ }, null, 8, ["actions"])) : p("", !0)
563
+ ]),
564
+ _: 1
565
+ })
566
+ ])
567
+ ], 42, at));
473
568
  }
474
569
  });
475
570
  export {
476
- Ft as default
571
+ Ut as default
477
572
  };