@mobilon-dev/chotto 0.3.71 → 0.3.73

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