@bcc-code/vue-bcc-chat-ui 7.1.29 → 7.1.30

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,16 +1,16 @@
1
- import { Fragment as e, Teleport as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createSlots as s, createTextVNode as c, createVNode as l, defineComponent as u, guardReactiveProps as d, inject as f, isRef as p, mergeModels as m, nextTick as h, normalizeClass as g, normalizeProps as _, normalizeStyle as v, onBeforeUnmount as y, onMounted as b, onUnmounted as x, openBlock as S, provide as C, ref as w, renderList as T, renderSlot as E, resolveDynamicComponent as D, shallowRef as O, toDisplayString as k, toValue as A, unref as j, useModel as M, useTemplateRef as ee, vModelText as N, vShow as P, watch as F, withCtx as I, withDirectives as L, withModifiers as R } from "vue";
2
- import { BccAvatar as te, BccButton as z, BccDialog as ne, BccImage as B, BccInput as re, BccInputText as ie, BccMenu as V, BccMessage as ae, BccProgressSpinner as H, BccTag as oe } from "@bcc-code/component-library-vue";
3
- import { CometChat as U } from "@cometchat/chat-sdk-javascript";
4
- import { AddIcon as se, AttachFileIcon as ce, BarChartIcon as W, CalendarAddOnIcon as le, CheckIcon as ue, CloseIcon as de, CodeBlocksIcon as fe, ContentCopyIcon as pe, DeleteIcon as me, DescriptionIcon as he, DoneAllIcon as ge, EditCalendarIcon as _e, EditIcon as ve, ErrorIcon as ye, FilePresentIcon as be, FolderZipIcon as xe, ForumIcon as Se, ImageIcon as Ce, InfoIcon as we, KeyboardArrowDownIcon as Te, KeyboardArrowUpIcon as Ee, MicIcon as De, OpenInNewIcon as Oe, PendingIcon as ke, PictureAsPdfIcon as Ae, ReplyIcon as je, ScheduleIcon as Me, SendIcon as Ne, TableChartIcon as Pe, TextSnippetIcon as Fe, TranslateIcon as Ie, VideocamIcon as Le } from "@bcc-code/icons-vue";
1
+ import { Fragment as e, Teleport as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createSlots as s, createTextVNode as c, createVNode as l, defineComponent as u, guardReactiveProps as d, inject as f, isRef as p, mergeModels as m, nextTick as h, normalizeClass as g, normalizeProps as _, normalizeStyle as v, onBeforeUnmount as y, onMounted as b, onUnmounted as x, openBlock as S, provide as C, ref as w, renderList as T, renderSlot as E, resolveDynamicComponent as D, shallowRef as O, toDisplayString as k, toValue as A, unref as j, useModel as M, useTemplateRef as ee, vModelText as N, vShow as P, watch as F, withCtx as I, withDirectives as te, withModifiers as L } from "vue";
2
+ import { BccAvatar as R, BccButton as z, BccDialog as ne, BccImage as B, BccInput as re, BccInputText as ie, BccMenu as ae, BccMessage as oe, BccProgressSpinner as V, BccTag as se } from "@bcc-code/component-library-vue";
3
+ import { CometChat as H } from "@cometchat/chat-sdk-javascript";
4
+ import { AddIcon as ce, AttachFileIcon as le, BarChartIcon as U, CalendarAddOnIcon as ue, CheckIcon as de, CloseIcon as fe, CodeBlocksIcon as pe, ContentCopyIcon as me, DeleteIcon as he, DescriptionIcon as ge, DoneAllIcon as _e, EditCalendarIcon as ve, EditIcon as ye, ErrorIcon as be, FilePresentIcon as xe, FolderZipIcon as Se, ForumIcon as Ce, ImageIcon as we, InfoIcon as Te, KeyboardArrowDownIcon as Ee, KeyboardArrowUpIcon as De, MicIcon as Oe, OpenInNewIcon as ke, PendingIcon as Ae, PictureAsPdfIcon as je, ReplyIcon as Me, ScheduleIcon as Ne, SendIcon as Pe, TableChartIcon as Fe, TextSnippetIcon as Ie, TranslateIcon as Le, VideocamIcon as Re } from "@bcc-code/icons-vue";
5
5
  //#region \0rolldown/runtime.js
6
- var G = Object.defineProperty, Re = (e, t) => {
6
+ var W = Object.defineProperty, ze = (e, t) => {
7
7
  let n = {};
8
- for (var r in e) G(n, r, {
8
+ for (var r in e) W(n, r, {
9
9
  get: e[r],
10
10
  enumerable: !0
11
11
  });
12
- return t || G(n, Symbol.toStringTag, { value: "Module" }), n;
13
- }, ze = {
12
+ return t || W(n, Symbol.toStringTag, { value: "Module" }), n;
13
+ }, Be = {
14
14
  prod: {
15
15
  region: "eu",
16
16
  appId: "2520339d45a9d557",
@@ -21,62 +21,62 @@ var G = Object.defineProperty, Re = (e, t) => {
21
21
  appId: "24847302853e129f",
22
22
  chatApiBaseUrl: "https://chat.api.sandbox.bcc.no"
23
23
  }
24
- }, Be = null;
25
- function Ve(e) {
26
- Be = e;
24
+ }, Ve = null;
25
+ function He(e) {
26
+ Ve = e;
27
27
  }
28
- function K() {
29
- if (!Be) throw Error("Environment has not been set yet. Call setCurrentEnvironment(...) first.");
30
- return ze[Be];
28
+ function G() {
29
+ if (!Ve) throw Error("Environment has not been set yet. Call setCurrentEnvironment(...) first.");
30
+ return Be[Ve];
31
31
  }
32
32
  //#endregion
33
33
  //#region src/chat/accessToken.ts
34
- var He = ":loginAccessToken", Ue = ":token", We = void 0;
35
- function Ge(e) {
36
- return `${K().appId}${e}`;
34
+ var Ue = ":loginAccessToken", We = ":token", Ge = void 0;
35
+ function Ke(e) {
36
+ return `${G().appId}${e}`;
37
37
  }
38
- function Ke() {
39
- return We === void 0 && (We = localStorage.getItem(Ge(He))), We;
38
+ function qe() {
39
+ return Ge === void 0 && (Ge = localStorage.getItem(Ke(Ue))), Ge;
40
40
  }
41
- function qe(e) {
42
- We = e;
43
- let t = Ge(He);
41
+ function Je(e) {
42
+ Ge = e;
43
+ let t = Ke(Ue);
44
44
  if (e) {
45
45
  localStorage.setItem(t, e);
46
46
  return;
47
47
  }
48
48
  localStorage.removeItem(t);
49
49
  }
50
- function Je() {
51
- let e = Ge(Ue), t = localStorage.getItem(e);
50
+ function Ye() {
51
+ let e = Ke(We), t = localStorage.getItem(e);
52
52
  return t ? JSON.parse(t) : null;
53
53
  }
54
- function Ye() {
55
- return Je();
54
+ function Xe() {
55
+ return Ye();
56
56
  }
57
- function Xe(e) {
58
- localStorage.setItem(Ge(Ue), JSON.stringify(e));
57
+ function Ze(e) {
58
+ localStorage.setItem(Ke(We), JSON.stringify(e));
59
59
  }
60
- function Ze() {
61
- localStorage.removeItem(Ge(Ue));
60
+ function Qe() {
61
+ localStorage.removeItem(Ke(We));
62
62
  }
63
63
  //#endregion
64
64
  //#region src/chat/avatar.ts
65
- function Qe(e) {
66
- let t = et(e);
65
+ function $e(e) {
66
+ let t = tt(e);
67
67
  if (!t) return;
68
68
  let n = t.trim();
69
69
  if (n) {
70
70
  try {
71
- if (tt(new URL(n))) return `${K().chatApiBaseUrl}/file-proxy?uri=${encodeURIComponent(n)}`;
71
+ if (nt(new URL(n))) return `${G().chatApiBaseUrl}/file-proxy?uri=${encodeURIComponent(n)}`;
72
72
  } catch {}
73
73
  return n;
74
74
  }
75
75
  }
76
- function $e(e) {
77
- return Qe(e) ?? e;
78
- }
79
76
  function et(e) {
77
+ return $e(e) ?? e;
78
+ }
79
+ function tt(e) {
80
80
  if (typeof e == "string") return e;
81
81
  if (!e || typeof e != "object") return;
82
82
  let t = e, n = [
@@ -94,36 +94,36 @@ function et(e) {
94
94
  t.avatar,
95
95
  t.image
96
96
  ].find((e) => e && typeof e == "object");
97
- if (r) return et(r);
97
+ if (r) return tt(r);
98
98
  }
99
- function tt(e) {
100
- let { appId: t, region: n } = K(), r = `data-${n}.cometchat.io`, i = `/${t}/`;
99
+ function nt(e) {
100
+ let { appId: t, region: n } = G(), r = `data-${n}.cometchat.io`, i = `/${t}/`;
101
101
  return e.hostname.toLowerCase() === r.toLowerCase() && e.pathname.startsWith(i);
102
102
  }
103
103
  //#endregion
104
104
  //#region src/chat/cacheScope.ts
105
- var nt = ":chatCacheScope", rt = ":chatCacheOwner", it, at;
106
- function ot(e) {
107
- return `${K().appId}${e}`;
108
- }
109
- function st() {
110
- return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `${Date.now()}-${Math.random().toString(36).slice(2)}`;
105
+ var rt = ":chatCacheScope", it = ":chatCacheOwner", at, ot;
106
+ function st(e) {
107
+ return `${G().appId}${e}`;
111
108
  }
112
109
  function ct() {
113
- return it === void 0 && (it = localStorage.getItem(ot(nt))), it;
110
+ return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `${Date.now()}-${Math.random().toString(36).slice(2)}`;
114
111
  }
115
112
  function lt() {
116
- return at === void 0 && (at = localStorage.getItem(ot(rt))), at;
113
+ return at === void 0 && (at = localStorage.getItem(st(rt))), at;
114
+ }
115
+ function ut() {
116
+ return ot === void 0 && (ot = localStorage.getItem(st(it))), ot;
117
117
  }
118
- function ut(e) {
119
- let t = ct(), n = lt();
118
+ function dt(e) {
119
+ let t = lt(), n = ut();
120
120
  if (t && n === e) return t;
121
- let r = st();
122
- return it = r, at = e, localStorage.setItem(ot(nt), r), localStorage.setItem(ot(rt), e), r;
121
+ let r = ct();
122
+ return at = r, ot = e, localStorage.setItem(st(rt), r), localStorage.setItem(st(it), e), r;
123
123
  }
124
124
  //#endregion
125
125
  //#region src/chat/localization.ts
126
- var dt = {
126
+ var ft = {
127
127
  en: {
128
128
  addOption: "Add option",
129
129
  addToMessage: "Add to message",
@@ -364,102 +364,102 @@ var dt = {
364
364
  you: "Du",
365
365
  youSentAMessage: "Du sendte en melding"
366
366
  }
367
- }, ft = w("en");
368
- function pt(e) {
367
+ }, pt = w("en");
368
+ function mt(e) {
369
369
  return e === "nb" || e === "no" ? "nb" : "en";
370
370
  }
371
- function mt(e) {
372
- return pt(e) === "nb" ? "nb-NO" : "en-US";
371
+ function ht(e) {
372
+ return mt(e) === "nb" ? "nb-NO" : "en-US";
373
373
  }
374
- function ht() {
374
+ function gt() {
375
375
  return "h23";
376
376
  }
377
- function gt(e) {
378
- ft.value = e;
377
+ function _t(e) {
378
+ pt.value = e;
379
379
  }
380
- function _t(e, t, n) {
381
- let r = dt[pt(n ?? ft.value)][e] ?? dt.en[e];
380
+ function vt(e, t, n) {
381
+ let r = ft[mt(n ?? pt.value)][e] ?? ft.en[e];
382
382
  return typeof r == "function" ? r(t ?? {}) : r;
383
383
  }
384
- function q(e) {
385
- let t = n(() => A(e) ?? ft.value);
384
+ function K(e) {
385
+ let t = n(() => A(e) ?? pt.value);
386
386
  return {
387
- locale: n(() => mt(t.value)),
388
- t: (e, n) => _t(e, n, t.value)
387
+ locale: n(() => ht(t.value)),
388
+ t: (e, n) => vt(e, n, t.value)
389
389
  };
390
390
  }
391
391
  //#endregion
392
392
  //#region src/chat/mentions.ts
393
- var vt = /<@uid:([^>]+)>/g, yt = /&lt;@uid:([^&]+)&gt;/g, bt = "mention:", xt = "", St = "data-mention-uid", Ct = "composer-mention", wt = "message-mention";
394
- function Tt(e) {
393
+ var yt = /<@uid:([^>]+)>/g, bt = /&lt;@uid:([^&]+)&gt;/g, xt = "mention:", St = "", Ct = "data-mention-uid", wt = "composer-mention", Tt = "message-mention";
394
+ function Et(e) {
395
395
  return {
396
396
  uid: e.uid,
397
397
  displayName: e.displayName,
398
398
  avatar: e.avatar
399
399
  };
400
400
  }
401
- function Et(e) {
401
+ function Dt(e) {
402
402
  let t = {};
403
403
  for (let n of e) t[n.uid] = n.displayName;
404
404
  return t;
405
405
  }
406
- function Dt(e, t, n = 8) {
406
+ function Ot(e, t, n = 8) {
407
407
  let r = t.trim().toLowerCase(), i = e.filter((e) => e.displayName.trim().length > 0);
408
408
  return r ? i.filter((e) => {
409
409
  let t = e.displayName.toLowerCase(), n = e.uid.toLowerCase();
410
410
  return t.includes(r) || n.includes(r);
411
411
  }).slice(0, n) : i.slice(0, n);
412
412
  }
413
- function Ot(e) {
414
- return `<@uid:${e}>`;
415
- }
416
413
  function kt(e) {
417
- return e.replace(yt, (e, t) => Ot(t));
414
+ return `<@uid:${e}>`;
418
415
  }
419
416
  function At(e) {
420
- return vt.lastIndex = 0, yt.lastIndex = 0, vt.test(e) || yt.test(e);
417
+ return e.replace(bt, (e, t) => kt(t));
421
418
  }
422
419
  function jt(e) {
420
+ return yt.lastIndex = 0, bt.lastIndex = 0, yt.test(e) || bt.test(e);
421
+ }
422
+ function Mt(e) {
423
423
  let t = [];
424
424
  return {
425
- shielded: kt(e).replace(vt, (e) => `${bt}${t.push(e) - 1}${xt}`),
425
+ shielded: At(e).replace(yt, (e) => `${xt}${t.push(e) - 1}${St}`),
426
426
  tokens: t
427
427
  };
428
428
  }
429
- function Mt(e, t) {
430
- let n = RegExp(`${bt.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}(\\d+)${xt.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}`, "g");
429
+ function Nt(e, t) {
430
+ let n = RegExp(`${xt.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}(\\d+)${St.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}`, "g");
431
431
  return e.replace(n, (e, n) => t[Number(n)] ?? "");
432
432
  }
433
- function Nt(e, t, n = wt) {
434
- return e.replace(vt, (e, r) => {
433
+ function Pt(e, t, n = Tt) {
434
+ return e.replace(yt, (e, r) => {
435
435
  let i = t(r).trim() || r;
436
- return `<span class="${n}" ${St}="${Ut(r)}">@${Wt(i)}</span>`;
436
+ return `<span class="${n}" ${Ct}="${Wt(r)}">@${Gt(i)}</span>`;
437
437
  });
438
438
  }
439
- function Pt(e, t = {}) {
440
- return Nt(e, (e) => t[e] ?? e, Ct);
441
- }
442
439
  function Ft(e, t = {}) {
443
- return Nt(e, (e) => t[e] ?? e, wt);
440
+ return Pt(e, (e) => t[e] ?? e, wt);
444
441
  }
445
- function It(e) {
442
+ function It(e, t = {}) {
443
+ return Pt(e, (e) => t[e] ?? e, Tt);
444
+ }
445
+ function Lt(e) {
446
446
  if (!e) return "";
447
447
  let t = new DOMParser().parseFromString(`<div>${e}</div>`, "text/html"), n = t.body.firstElementChild;
448
448
  if (!n) return e;
449
- for (let e of [...n.querySelectorAll(`span[${St}]`)]) {
450
- let n = e.getAttribute(St);
451
- n && e.replaceWith(t.createTextNode(Ot(n)));
449
+ for (let e of [...n.querySelectorAll(`span[${Ct}]`)]) {
450
+ let n = e.getAttribute(Ct);
451
+ n && e.replaceWith(t.createTextNode(kt(n)));
452
452
  }
453
- return Lt(n.innerHTML);
453
+ return Rt(n.innerHTML);
454
454
  }
455
- function Lt(e) {
455
+ function Rt(e) {
456
456
  return e.replace(/&lt;@uid:([^&]+)&gt;/g, "<@uid:$1>");
457
457
  }
458
- var Rt = /@([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})/gi;
459
- function zt(e, t, n = "member") {
458
+ var zt = /@([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})/gi;
459
+ function Bt(e, t, n = "member") {
460
460
  return t[e]?.trim() || n;
461
461
  }
462
- function Bt(e) {
462
+ function Vt(e) {
463
463
  let t = {};
464
464
  for (let n of e?.getMentionedUsers?.() ?? []) {
465
465
  let e = n.getUid?.(), r = n.getName?.()?.trim();
@@ -467,31 +467,31 @@ function Bt(e) {
467
467
  }
468
468
  return t;
469
469
  }
470
- function Vt(...e) {
470
+ function Ht(...e) {
471
471
  let t = {};
472
472
  for (let n of e) Object.assign(t, n);
473
473
  return t;
474
474
  }
475
- function Ht(e, t = {}) {
476
- return kt(e).replace(vt, (e, n) => `@${zt(n, t)}`).replace(Rt, (e, n) => `@${zt(n, t)}`);
475
+ function Ut(e, t = {}) {
476
+ return At(e).replace(yt, (e, n) => `@${Bt(n, t)}`).replace(zt, (e, n) => `@${Bt(n, t)}`);
477
477
  }
478
- function Ut(e) {
478
+ function Wt(e) {
479
479
  return e.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;");
480
480
  }
481
- function Wt(e) {
481
+ function Gt(e) {
482
482
  return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
483
483
  }
484
484
  //#endregion
485
485
  //#region node_modules/dompurify/dist/purify.es.mjs
486
- function Gt(e, t) {
486
+ function Kt(e, t) {
487
487
  (t == null || t > e.length) && (t = e.length);
488
488
  for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
489
489
  return r;
490
490
  }
491
- function Kt(e) {
491
+ function qt(e) {
492
492
  if (Array.isArray(e)) return e;
493
493
  }
494
- function qt(e, t) {
494
+ function Jt(e, t) {
495
495
  var n = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
496
496
  if (n != null) {
497
497
  var r, i, a, o, s = [], c = !0, l = !1;
@@ -509,99 +509,99 @@ function qt(e, t) {
509
509
  return s;
510
510
  }
511
511
  }
512
- function Jt() {
512
+ function Yt() {
513
513
  throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
514
514
  }
515
- function Yt(e, t) {
516
- return Kt(e) || qt(e, t) || Xt(e, t) || Jt();
517
- }
518
515
  function Xt(e, t) {
516
+ return qt(e) || Jt(e, t) || Zt(e, t) || Yt();
517
+ }
518
+ function Zt(e, t) {
519
519
  if (e) {
520
- if (typeof e == "string") return Gt(e, t);
520
+ if (typeof e == "string") return Kt(e, t);
521
521
  var n = {}.toString.call(e).slice(8, -1);
522
- return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? Gt(e, t) : void 0;
522
+ return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? Kt(e, t) : void 0;
523
523
  }
524
524
  }
525
- var Zt = Object.entries, Qt = Object.setPrototypeOf, $t = Object.isFrozen, en = Object.getPrototypeOf, tn = Object.getOwnPropertyDescriptor, nn = Object.freeze, rn = Object.seal, an = Object.create, on = typeof Reflect < "u" && Reflect, sn = on.apply, cn = on.construct;
526
- nn ||= function(e) {
525
+ var Qt = Object.entries, $t = Object.setPrototypeOf, en = Object.isFrozen, tn = Object.getPrototypeOf, nn = Object.getOwnPropertyDescriptor, rn = Object.freeze, an = Object.seal, on = Object.create, sn = typeof Reflect < "u" && Reflect, cn = sn.apply, ln = sn.construct;
526
+ rn ||= function(e) {
527
527
  return e;
528
- }, rn ||= function(e) {
528
+ }, an ||= function(e) {
529
529
  return e;
530
- }, sn ||= function(e, t) {
530
+ }, cn ||= function(e, t) {
531
531
  var n = [...arguments].slice(2);
532
532
  return e.apply(t, n);
533
- }, cn ||= function(e) {
533
+ }, ln ||= function(e) {
534
534
  return new e(...[...arguments].slice(1));
535
535
  };
536
- var ln = On(Array.prototype.forEach), un = On(Array.prototype.lastIndexOf), dn = On(Array.prototype.pop), fn = On(Array.prototype.push), pn = On(Array.prototype.splice), mn = Array.isArray, hn = On(String.prototype.toLowerCase), gn = On(String.prototype.toString), _n = On(String.prototype.match), vn = On(String.prototype.replace), yn = On(String.prototype.indexOf), bn = On(String.prototype.trim), xn = On(Number.prototype.toString), Sn = On(Boolean.prototype.toString), Cn = typeof BigInt > "u" ? null : On(BigInt.prototype.toString), wn = typeof Symbol > "u" ? null : On(Symbol.prototype.toString), J = On(Object.prototype.hasOwnProperty), Tn = On(Object.prototype.toString), En = On(RegExp.prototype.test), Dn = kn(TypeError);
537
- function On(e) {
536
+ var un = J(Array.prototype.forEach), dn = J(Array.prototype.lastIndexOf), fn = J(Array.prototype.pop), pn = J(Array.prototype.push), mn = J(Array.prototype.splice), hn = Array.isArray, gn = J(String.prototype.toLowerCase), _n = J(String.prototype.toString), vn = J(String.prototype.match), yn = J(String.prototype.replace), bn = J(String.prototype.indexOf), xn = J(String.prototype.trim), Sn = J(Number.prototype.toString), Cn = J(Boolean.prototype.toString), wn = typeof BigInt > "u" ? null : J(BigInt.prototype.toString), Tn = typeof Symbol > "u" ? null : J(Symbol.prototype.toString), q = J(Object.prototype.hasOwnProperty), En = J(Object.prototype.toString), Dn = J(RegExp.prototype.test), On = kn(TypeError);
537
+ function J(e) {
538
538
  return function(t) {
539
539
  t instanceof RegExp && (t.lastIndex = 0);
540
540
  var n = [...arguments].slice(1);
541
- return sn(e, t, n);
541
+ return cn(e, t, n);
542
542
  };
543
543
  }
544
544
  function kn(e) {
545
545
  return function() {
546
- return cn(e, [...arguments]);
546
+ return ln(e, [...arguments]);
547
547
  };
548
548
  }
549
549
  function Y(e, t) {
550
- let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : hn;
551
- if (Qt && Qt(e, null), !mn(t)) return e;
550
+ let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : gn;
551
+ if ($t && $t(e, null), !hn(t)) return e;
552
552
  let r = t.length;
553
553
  for (; r--;) {
554
554
  let i = t[r];
555
555
  if (typeof i == "string") {
556
556
  let e = n(i);
557
- e !== i && ($t(t) || (t[r] = e), i = e);
557
+ e !== i && (en(t) || (t[r] = e), i = e);
558
558
  }
559
559
  e[i] = !0;
560
560
  }
561
561
  return e;
562
562
  }
563
563
  function An(e) {
564
- for (let t = 0; t < e.length; t++) J(e, t) || (e[t] = null);
564
+ for (let t = 0; t < e.length; t++) q(e, t) || (e[t] = null);
565
565
  return e;
566
566
  }
567
567
  function jn(e) {
568
- let t = an(null);
569
- for (let r of Zt(e)) {
570
- var n = Yt(r, 2);
568
+ let t = on(null);
569
+ for (let r of Qt(e)) {
570
+ var n = Xt(r, 2);
571
571
  let i = n[0], a = n[1];
572
- J(e, i) && (mn(a) ? t[i] = An(a) : a && typeof a == "object" && a.constructor === Object ? t[i] = jn(a) : t[i] = a);
572
+ q(e, i) && (hn(a) ? t[i] = An(a) : a && typeof a == "object" && a.constructor === Object ? t[i] = jn(a) : t[i] = a);
573
573
  }
574
574
  return t;
575
575
  }
576
576
  function Mn(e) {
577
577
  switch (typeof e) {
578
578
  case "string": return e;
579
- case "number": return xn(e);
580
- case "boolean": return Sn(e);
581
- case "bigint": return Cn ? Cn(e) : "0";
582
- case "symbol": return wn ? wn(e) : "Symbol()";
583
- case "undefined": return Tn(e);
579
+ case "number": return Sn(e);
580
+ case "boolean": return Cn(e);
581
+ case "bigint": return wn ? wn(e) : "0";
582
+ case "symbol": return Tn ? Tn(e) : "Symbol()";
583
+ case "undefined": return En(e);
584
584
  case "function":
585
585
  case "object": {
586
- if (e === null) return Tn(e);
586
+ if (e === null) return En(e);
587
587
  let t = e, n = Nn(t, "toString");
588
588
  if (typeof n == "function") {
589
589
  let e = n(t);
590
- return typeof e == "string" ? e : Tn(e);
590
+ return typeof e == "string" ? e : En(e);
591
591
  }
592
- return Tn(e);
592
+ return En(e);
593
593
  }
594
- default: return Tn(e);
594
+ default: return En(e);
595
595
  }
596
596
  }
597
597
  function Nn(e, t) {
598
598
  for (; e !== null;) {
599
- let n = tn(e, t);
599
+ let n = nn(e, t);
600
600
  if (n) {
601
- if (n.get) return On(n.get);
602
- if (typeof n.value == "function") return On(n.value);
601
+ if (n.get) return J(n.get);
602
+ if (typeof n.value == "function") return J(n.value);
603
603
  }
604
- e = en(e);
604
+ e = tn(e);
605
605
  }
606
606
  function n() {
607
607
  return null;
@@ -610,12 +610,12 @@ function Nn(e, t) {
610
610
  }
611
611
  function Pn(e) {
612
612
  try {
613
- return En(e, ""), !0;
613
+ return Dn(e, ""), !0;
614
614
  } catch {
615
615
  return !1;
616
616
  }
617
617
  }
618
- var Fn = nn(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr".split(".")), In = nn(/* @__PURE__ */ "svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern".split(".")), Ln = nn([
618
+ var Fn = rn(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr".split(".")), In = rn(/* @__PURE__ */ "svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern".split(".")), Ln = rn([
619
619
  "feBlend",
620
620
  "feColorMatrix",
621
621
  "feComponentTransfer",
@@ -641,7 +641,7 @@ var Fn = nn(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.b
641
641
  "feSpotLight",
642
642
  "feTile",
643
643
  "feTurbulence"
644
- ]), Rn = nn([
644
+ ]), Rn = rn([
645
645
  "animate",
646
646
  "color-profile",
647
647
  "cursor",
@@ -664,7 +664,7 @@ var Fn = nn(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.b
664
664
  "solidcolor",
665
665
  "unknown",
666
666
  "use"
667
- ]), zn = nn(/* @__PURE__ */ "math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts".split(".")), Bn = nn([
667
+ ]), zn = rn(/* @__PURE__ */ "math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts".split(".")), Bn = rn([
668
668
  "maction",
669
669
  "maligngroup",
670
670
  "malignmark",
@@ -680,13 +680,13 @@ var Fn = nn(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.b
680
680
  "annotation-xml",
681
681
  "mprescripts",
682
682
  "none"
683
- ]), Vn = nn(["#text"]), Hn = nn(/* @__PURE__ */ "accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns".split(".")), Un = nn(/* @__PURE__ */ "accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-rendering.textlength.type.u1.u2.unicode.values.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan".split(".")), Wn = nn(/* @__PURE__ */ "accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns".split(".")), Gn = nn([
683
+ ]), Vn = rn(["#text"]), Hn = rn(/* @__PURE__ */ "accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns".split(".")), Un = rn(/* @__PURE__ */ "accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-rendering.textlength.type.u1.u2.unicode.values.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan".split(".")), Wn = rn(/* @__PURE__ */ "accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns".split(".")), Gn = rn([
684
684
  "xlink:href",
685
685
  "xml:id",
686
686
  "xlink:title",
687
687
  "xml:space",
688
688
  "xmlns:xlink"
689
- ]), Kn = rn(/{{[\w\W]*|^[\w\W]*}}/g), qn = rn(/<%[\w\W]*|^[\w\W]*%>/g), Jn = rn(/\${[\w\W]*/g), Yn = rn(/^data-[\-\w.\u00B7-\uFFFF]+$/), Xn = rn(/^aria-[\-\w]+$/), Zn = rn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), Qn = rn(/^(?:\w+script|data):/i), $n = rn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), er = rn(/^html$/i), tr = rn(/^[a-z][.\w]*(-[.\w]+)+$/i), nr = {
689
+ ]), Kn = an(/{{[\w\W]*|^[\w\W]*}}/g), qn = an(/<%[\w\W]*|^[\w\W]*%>/g), Jn = an(/\${[\w\W]*/g), Yn = an(/^data-[\-\w.\u00B7-\uFFFF]+$/), Xn = an(/^aria-[\-\w]+$/), Zn = an(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), Qn = an(/^(?:\w+script|data):/i), $n = an(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), er = an(/^html$/i), tr = an(/^[a-z][.\w]*(-[.\w]+)+$/i), nr = {
690
690
  element: 1,
691
691
  text: 3,
692
692
  progressingInstruction: 7,
@@ -733,8 +733,8 @@ function or() {
733
733
  e.content && e.content.ownerDocument && (n = e.content.ownerDocument);
734
734
  }
735
735
  let x, S = "", C = n, w = C.implementation, T = C.createNodeIterator, E = C.createDocumentFragment, D = C.getElementsByTagName, O = r.importNode, k = ar();
736
- t.isSupported = typeof Zt == "function" && typeof b == "function" && w && w.createHTMLDocument !== void 0;
737
- let A = Kn, j = qn, M = Jn, ee = Yn, N = Xn, P = Qn, F = $n, I = tr, L = Zn, R = null, te = Y({}, [
736
+ t.isSupported = typeof Qt == "function" && typeof b == "function" && w && w.createHTMLDocument !== void 0;
737
+ let A = Kn, j = qn, M = Jn, ee = Yn, N = Xn, P = Qn, F = $n, I = tr, te = Zn, L = null, R = Y({}, [
738
738
  ...Fn,
739
739
  ...In,
740
740
  ...Ln,
@@ -745,7 +745,7 @@ function or() {
745
745
  ...Un,
746
746
  ...Wn,
747
747
  ...Gn
748
- ]), B = Object.seal(an(null, {
748
+ ]), B = Object.seal(on(null, {
749
749
  tagNameCheck: {
750
750
  writable: !0,
751
751
  configurable: !1,
@@ -764,7 +764,7 @@ function or() {
764
764
  enumerable: !0,
765
765
  value: !1
766
766
  }
767
- })), re = null, ie = null, V = Object.seal(an(null, {
767
+ })), re = null, ie = null, ae = Object.seal(on(null, {
768
768
  tagCheck: {
769
769
  writable: !0,
770
770
  configurable: !1,
@@ -777,7 +777,7 @@ function or() {
777
777
  enumerable: !0,
778
778
  value: null
779
779
  }
780
- })), ae = !0, H = !0, oe = !1, U = !0, se = !1, ce = !0, W = !1, le = !1, ue = !1, de = !1, fe = !1, pe = !1, me = !0, he = !1, ge = "user-content-", _e = !0, ve = !1, ye = {}, be = null, xe = Y({}, [
780
+ })), oe = !0, V = !0, se = !1, H = !0, ce = !1, le = !0, U = !1, ue = !1, de = !1, fe = !1, pe = !1, me = !1, he = !0, ge = !1, _e = "user-content-", ve = !0, ye = !1, be = {}, xe = null, Se = Y({}, [
781
781
  "annotation-xml",
782
782
  "audio",
783
783
  "colgroup",
@@ -803,14 +803,14 @@ function or() {
803
803
  "title",
804
804
  "video",
805
805
  "xmp"
806
- ]), Se = null, Ce = Y({}, [
806
+ ]), Ce = null, we = Y({}, [
807
807
  "audio",
808
808
  "video",
809
809
  "img",
810
810
  "source",
811
811
  "image",
812
812
  "track"
813
- ]), we = null, Te = Y({}, [
813
+ ]), Te = null, Ee = Y({}, [
814
814
  "alt",
815
815
  "class",
816
816
  "for",
@@ -825,125 +825,125 @@ function or() {
825
825
  "value",
826
826
  "style",
827
827
  "xmlns"
828
- ]), Ee = "http://www.w3.org/1998/Math/MathML", De = "http://www.w3.org/2000/svg", Oe = "http://www.w3.org/1999/xhtml", ke = Oe, Ae = !1, je = null, Me = Y({}, [
829
- Ee,
828
+ ]), De = "http://www.w3.org/1998/Math/MathML", Oe = "http://www.w3.org/2000/svg", ke = "http://www.w3.org/1999/xhtml", Ae = ke, je = !1, Me = null, Ne = Y({}, [
830
829
  De,
831
- Oe
832
- ], gn), Ne = Y({}, [
830
+ Oe,
831
+ ke
832
+ ], _n), Pe = Y({}, [
833
833
  "mi",
834
834
  "mo",
835
835
  "mn",
836
836
  "ms",
837
837
  "mtext"
838
- ]), Pe = Y({}, ["annotation-xml"]), Fe = Y({}, [
838
+ ]), Fe = Y({}, ["annotation-xml"]), Ie = Y({}, [
839
839
  "title",
840
840
  "style",
841
841
  "font",
842
842
  "a",
843
843
  "script"
844
- ]), Ie = null, Le = ["application/xhtml+xml", "text/html"], G = null, Re = null, ze = n.createElement("form"), Be = function(e) {
844
+ ]), Le = null, Re = ["application/xhtml+xml", "text/html"], W = null, ze = null, Be = n.createElement("form"), Ve = function(e) {
845
845
  return e instanceof RegExp || e instanceof Function;
846
- }, Ve = function() {
846
+ }, He = function() {
847
847
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
848
- if (Re && Re === e) return;
849
- (!e || typeof e != "object") && (e = {}), e = jn(e), Ie = Le.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, G = Ie === "application/xhtml+xml" ? gn : hn, R = J(e, "ALLOWED_TAGS") && mn(e.ALLOWED_TAGS) ? Y({}, e.ALLOWED_TAGS, G) : te, z = J(e, "ALLOWED_ATTR") && mn(e.ALLOWED_ATTR) ? Y({}, e.ALLOWED_ATTR, G) : ne, je = J(e, "ALLOWED_NAMESPACES") && mn(e.ALLOWED_NAMESPACES) ? Y({}, e.ALLOWED_NAMESPACES, gn) : Me, we = J(e, "ADD_URI_SAFE_ATTR") && mn(e.ADD_URI_SAFE_ATTR) ? Y(jn(Te), e.ADD_URI_SAFE_ATTR, G) : Te, Se = J(e, "ADD_DATA_URI_TAGS") && mn(e.ADD_DATA_URI_TAGS) ? Y(jn(Ce), e.ADD_DATA_URI_TAGS, G) : Ce, be = J(e, "FORBID_CONTENTS") && mn(e.FORBID_CONTENTS) ? Y({}, e.FORBID_CONTENTS, G) : xe, re = J(e, "FORBID_TAGS") && mn(e.FORBID_TAGS) ? Y({}, e.FORBID_TAGS, G) : jn({}), ie = J(e, "FORBID_ATTR") && mn(e.FORBID_ATTR) ? Y({}, e.FORBID_ATTR, G) : jn({}), ye = J(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? jn(e.USE_PROFILES) : e.USE_PROFILES : !1, ae = e.ALLOW_ARIA_ATTR !== !1, H = e.ALLOW_DATA_ATTR !== !1, oe = e.ALLOW_UNKNOWN_PROTOCOLS || !1, U = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, se = e.SAFE_FOR_TEMPLATES || !1, ce = e.SAFE_FOR_XML !== !1, W = e.WHOLE_DOCUMENT || !1, de = e.RETURN_DOM || !1, fe = e.RETURN_DOM_FRAGMENT || !1, pe = e.RETURN_TRUSTED_TYPE || !1, ue = e.FORCE_BODY || !1, me = e.SANITIZE_DOM !== !1, he = e.SANITIZE_NAMED_PROPS || !1, _e = e.KEEP_CONTENT !== !1, ve = e.IN_PLACE || !1, L = Pn(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : Zn, ke = typeof e.NAMESPACE == "string" ? e.NAMESPACE : Oe, Ne = J(e, "MATHML_TEXT_INTEGRATION_POINTS") && e.MATHML_TEXT_INTEGRATION_POINTS && typeof e.MATHML_TEXT_INTEGRATION_POINTS == "object" ? jn(e.MATHML_TEXT_INTEGRATION_POINTS) : Y({}, [
848
+ if (ze && ze === e) return;
849
+ (!e || typeof e != "object") && (e = {}), e = jn(e), Le = Re.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, W = Le === "application/xhtml+xml" ? _n : gn, L = q(e, "ALLOWED_TAGS") && hn(e.ALLOWED_TAGS) ? Y({}, e.ALLOWED_TAGS, W) : R, z = q(e, "ALLOWED_ATTR") && hn(e.ALLOWED_ATTR) ? Y({}, e.ALLOWED_ATTR, W) : ne, Me = q(e, "ALLOWED_NAMESPACES") && hn(e.ALLOWED_NAMESPACES) ? Y({}, e.ALLOWED_NAMESPACES, _n) : Ne, Te = q(e, "ADD_URI_SAFE_ATTR") && hn(e.ADD_URI_SAFE_ATTR) ? Y(jn(Ee), e.ADD_URI_SAFE_ATTR, W) : Ee, Ce = q(e, "ADD_DATA_URI_TAGS") && hn(e.ADD_DATA_URI_TAGS) ? Y(jn(we), e.ADD_DATA_URI_TAGS, W) : we, xe = q(e, "FORBID_CONTENTS") && hn(e.FORBID_CONTENTS) ? Y({}, e.FORBID_CONTENTS, W) : Se, re = q(e, "FORBID_TAGS") && hn(e.FORBID_TAGS) ? Y({}, e.FORBID_TAGS, W) : jn({}), ie = q(e, "FORBID_ATTR") && hn(e.FORBID_ATTR) ? Y({}, e.FORBID_ATTR, W) : jn({}), be = q(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? jn(e.USE_PROFILES) : e.USE_PROFILES : !1, oe = e.ALLOW_ARIA_ATTR !== !1, V = e.ALLOW_DATA_ATTR !== !1, se = e.ALLOW_UNKNOWN_PROTOCOLS || !1, H = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, ce = e.SAFE_FOR_TEMPLATES || !1, le = e.SAFE_FOR_XML !== !1, U = e.WHOLE_DOCUMENT || !1, fe = e.RETURN_DOM || !1, pe = e.RETURN_DOM_FRAGMENT || !1, me = e.RETURN_TRUSTED_TYPE || !1, de = e.FORCE_BODY || !1, he = e.SANITIZE_DOM !== !1, ge = e.SANITIZE_NAMED_PROPS || !1, ve = e.KEEP_CONTENT !== !1, ye = e.IN_PLACE || !1, te = Pn(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : Zn, Ae = typeof e.NAMESPACE == "string" ? e.NAMESPACE : ke, Pe = q(e, "MATHML_TEXT_INTEGRATION_POINTS") && e.MATHML_TEXT_INTEGRATION_POINTS && typeof e.MATHML_TEXT_INTEGRATION_POINTS == "object" ? jn(e.MATHML_TEXT_INTEGRATION_POINTS) : Y({}, [
850
850
  "mi",
851
851
  "mo",
852
852
  "mn",
853
853
  "ms",
854
854
  "mtext"
855
- ]), Pe = J(e, "HTML_INTEGRATION_POINTS") && e.HTML_INTEGRATION_POINTS && typeof e.HTML_INTEGRATION_POINTS == "object" ? jn(e.HTML_INTEGRATION_POINTS) : Y({}, ["annotation-xml"]);
856
- let t = J(e, "CUSTOM_ELEMENT_HANDLING") && e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING == "object" ? jn(e.CUSTOM_ELEMENT_HANDLING) : an(null);
857
- if (B = an(null), J(t, "tagNameCheck") && Be(t.tagNameCheck) && (B.tagNameCheck = t.tagNameCheck), J(t, "attributeNameCheck") && Be(t.attributeNameCheck) && (B.attributeNameCheck = t.attributeNameCheck), J(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (B.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), se && (H = !1), fe && (de = !0), ye && (R = Y({}, Vn), z = an(null), ye.html === !0 && (Y(R, Fn), Y(z, Hn)), ye.svg === !0 && (Y(R, In), Y(z, Un), Y(z, Gn)), ye.svgFilters === !0 && (Y(R, Ln), Y(z, Un), Y(z, Gn)), ye.mathMl === !0 && (Y(R, zn), Y(z, Wn), Y(z, Gn))), V.tagCheck = null, V.attributeCheck = null, J(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? V.tagCheck = e.ADD_TAGS : mn(e.ADD_TAGS) && (R === te && (R = jn(R)), Y(R, e.ADD_TAGS, G))), J(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? V.attributeCheck = e.ADD_ATTR : mn(e.ADD_ATTR) && (z === ne && (z = jn(z)), Y(z, e.ADD_ATTR, G))), J(e, "ADD_URI_SAFE_ATTR") && mn(e.ADD_URI_SAFE_ATTR) && Y(we, e.ADD_URI_SAFE_ATTR, G), J(e, "FORBID_CONTENTS") && mn(e.FORBID_CONTENTS) && (be === xe && (be = jn(be)), Y(be, e.FORBID_CONTENTS, G)), J(e, "ADD_FORBID_CONTENTS") && mn(e.ADD_FORBID_CONTENTS) && (be === xe && (be = jn(be)), Y(be, e.ADD_FORBID_CONTENTS, G)), _e && (R["#text"] = !0), W && Y(R, [
855
+ ]), Fe = q(e, "HTML_INTEGRATION_POINTS") && e.HTML_INTEGRATION_POINTS && typeof e.HTML_INTEGRATION_POINTS == "object" ? jn(e.HTML_INTEGRATION_POINTS) : Y({}, ["annotation-xml"]);
856
+ let t = q(e, "CUSTOM_ELEMENT_HANDLING") && e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING == "object" ? jn(e.CUSTOM_ELEMENT_HANDLING) : on(null);
857
+ if (B = on(null), q(t, "tagNameCheck") && Ve(t.tagNameCheck) && (B.tagNameCheck = t.tagNameCheck), q(t, "attributeNameCheck") && Ve(t.attributeNameCheck) && (B.attributeNameCheck = t.attributeNameCheck), q(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (B.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), ce && (V = !1), pe && (fe = !0), be && (L = Y({}, Vn), z = on(null), be.html === !0 && (Y(L, Fn), Y(z, Hn)), be.svg === !0 && (Y(L, In), Y(z, Un), Y(z, Gn)), be.svgFilters === !0 && (Y(L, Ln), Y(z, Un), Y(z, Gn)), be.mathMl === !0 && (Y(L, zn), Y(z, Wn), Y(z, Gn))), ae.tagCheck = null, ae.attributeCheck = null, q(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? ae.tagCheck = e.ADD_TAGS : hn(e.ADD_TAGS) && (L === R && (L = jn(L)), Y(L, e.ADD_TAGS, W))), q(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? ae.attributeCheck = e.ADD_ATTR : hn(e.ADD_ATTR) && (z === ne && (z = jn(z)), Y(z, e.ADD_ATTR, W))), q(e, "ADD_URI_SAFE_ATTR") && hn(e.ADD_URI_SAFE_ATTR) && Y(Te, e.ADD_URI_SAFE_ATTR, W), q(e, "FORBID_CONTENTS") && hn(e.FORBID_CONTENTS) && (xe === Se && (xe = jn(xe)), Y(xe, e.FORBID_CONTENTS, W)), q(e, "ADD_FORBID_CONTENTS") && hn(e.ADD_FORBID_CONTENTS) && (xe === Se && (xe = jn(xe)), Y(xe, e.ADD_FORBID_CONTENTS, W)), ve && (L["#text"] = !0), U && Y(L, [
858
858
  "html",
859
859
  "head",
860
860
  "body"
861
- ]), R.table && (Y(R, ["tbody"]), delete re.tbody), e.TRUSTED_TYPES_POLICY) {
862
- if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw Dn("TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.");
863
- if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw Dn("TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.");
861
+ ]), L.table && (Y(L, ["tbody"]), delete re.tbody), e.TRUSTED_TYPES_POLICY) {
862
+ if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw On("TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.");
863
+ if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw On("TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.");
864
864
  x = e.TRUSTED_TYPES_POLICY, S = x.createHTML("");
865
865
  } else x === void 0 && (x = ir(m, i)), x !== null && typeof S == "string" && (S = x.createHTML(""));
866
- nn && nn(e), Re = e;
867
- }, K = Y({}, [
866
+ rn && rn(e), ze = e;
867
+ }, G = Y({}, [
868
868
  ...In,
869
869
  ...Ln,
870
870
  ...Rn
871
- ]), He = Y({}, [...zn, ...Bn]), Ue = function(e) {
871
+ ]), Ue = Y({}, [...zn, ...Bn]), We = function(e) {
872
872
  let t = b(e);
873
873
  (!t || !t.tagName) && (t = {
874
- namespaceURI: ke,
874
+ namespaceURI: Ae,
875
875
  tagName: "template"
876
876
  });
877
- let n = hn(e.tagName), r = hn(t.tagName);
878
- return je[e.namespaceURI] ? e.namespaceURI === De ? t.namespaceURI === Oe ? n === "svg" : t.namespaceURI === Ee ? n === "svg" && (r === "annotation-xml" || Ne[r]) : !!K[n] : e.namespaceURI === Ee ? t.namespaceURI === Oe ? n === "math" : t.namespaceURI === De ? n === "math" && Pe[r] : !!He[n] : e.namespaceURI === Oe ? t.namespaceURI === De && !Pe[r] || t.namespaceURI === Ee && !Ne[r] ? !1 : !He[n] && (Fe[n] || !K[n]) : !!(Ie === "application/xhtml+xml" && je[e.namespaceURI]) : !1;
879
- }, We = function(e) {
880
- fn(t.removed, { element: e });
877
+ let n = gn(e.tagName), r = gn(t.tagName);
878
+ return Me[e.namespaceURI] ? e.namespaceURI === Oe ? t.namespaceURI === ke ? n === "svg" : t.namespaceURI === De ? n === "svg" && (r === "annotation-xml" || Pe[r]) : !!G[n] : e.namespaceURI === De ? t.namespaceURI === ke ? n === "math" : t.namespaceURI === Oe ? n === "math" && Fe[r] : !!Ue[n] : e.namespaceURI === ke ? t.namespaceURI === Oe && !Fe[r] || t.namespaceURI === De && !Pe[r] ? !1 : !Ue[n] && (Ie[n] || !G[n]) : !!(Le === "application/xhtml+xml" && Me[e.namespaceURI]) : !1;
879
+ }, Ge = function(e) {
880
+ pn(t.removed, { element: e });
881
881
  try {
882
882
  b(e).removeChild(e);
883
883
  } catch {
884
884
  _(e);
885
885
  }
886
- }, Ge = function(e, n) {
886
+ }, Ke = function(e, n) {
887
887
  try {
888
- fn(t.removed, {
888
+ pn(t.removed, {
889
889
  attribute: n.getAttributeNode(e),
890
890
  from: n
891
891
  });
892
892
  } catch {
893
- fn(t.removed, {
893
+ pn(t.removed, {
894
894
  attribute: null,
895
895
  from: n
896
896
  });
897
897
  }
898
- if (n.removeAttribute(e), e === "is") if (de || fe) try {
899
- We(n);
898
+ if (n.removeAttribute(e), e === "is") if (fe || pe) try {
899
+ Ge(n);
900
900
  } catch {}
901
901
  else try {
902
902
  n.setAttribute(e, "");
903
903
  } catch {}
904
- }, Ke = function(e) {
904
+ }, qe = function(e) {
905
905
  let t = null, r = null;
906
- if (ue) e = "<remove></remove>" + e;
906
+ if (de) e = "<remove></remove>" + e;
907
907
  else {
908
- let t = _n(e, /^[\r\n\t ]+/);
908
+ let t = vn(e, /^[\r\n\t ]+/);
909
909
  r = t && t[0];
910
910
  }
911
- Ie === "application/xhtml+xml" && ke === Oe && (e = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + e + "</body></html>");
911
+ Le === "application/xhtml+xml" && Ae === ke && (e = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + e + "</body></html>");
912
912
  let i = x ? x.createHTML(e) : e;
913
- if (ke === Oe) try {
914
- t = new p().parseFromString(i, Ie);
913
+ if (Ae === ke) try {
914
+ t = new p().parseFromString(i, Le);
915
915
  } catch {}
916
916
  if (!t || !t.documentElement) {
917
- t = w.createDocument(ke, "template", null);
917
+ t = w.createDocument(Ae, "template", null);
918
918
  try {
919
- t.documentElement.innerHTML = Ae ? S : i;
919
+ t.documentElement.innerHTML = je ? S : i;
920
920
  } catch {}
921
921
  }
922
922
  let a = t.body || t.documentElement;
923
- return e && r && a.insertBefore(n.createTextNode(r), a.childNodes[0] || null), ke === Oe ? D.call(t, W ? "html" : "body")[0] : W ? t.documentElement : a;
924
- }, qe = function(e) {
925
- return T.call(e.ownerDocument || e, e, l.SHOW_ELEMENT | l.SHOW_COMMENT | l.SHOW_TEXT | l.SHOW_PROCESSING_INSTRUCTION | l.SHOW_CDATA_SECTION, null);
923
+ return e && r && a.insertBefore(n.createTextNode(r), a.childNodes[0] || null), Ae === ke ? D.call(t, U ? "html" : "body")[0] : U ? t.documentElement : a;
926
924
  }, Je = function(e) {
927
- return e instanceof f && (typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || !(e.attributes instanceof d) || typeof e.removeAttribute != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function");
925
+ return T.call(e.ownerDocument || e, e, l.SHOW_ELEMENT | l.SHOW_COMMENT | l.SHOW_TEXT | l.SHOW_PROCESSING_INSTRUCTION | l.SHOW_CDATA_SECTION, null);
928
926
  }, Ye = function(e) {
927
+ return e instanceof f && (typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || !(e.attributes instanceof d) || typeof e.removeAttribute != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function");
928
+ }, Xe = function(e) {
929
929
  return typeof s == "function" && e instanceof s;
930
930
  };
931
- function Xe(e, n, r) {
932
- ln(e, (e) => {
933
- e.call(t, n, r, Re);
931
+ function Ze(e, n, r) {
932
+ un(e, (e) => {
933
+ e.call(t, n, r, ze);
934
934
  });
935
935
  }
936
- let Ze = function(e) {
936
+ let Qe = function(e) {
937
937
  let n = null;
938
- if (Xe(k.beforeSanitizeElements, e, null), Je(e)) return We(e), !0;
939
- let r = G(e.nodeName);
940
- if (Xe(k.uponSanitizeElement, e, {
938
+ if (Ze(k.beforeSanitizeElements, e, null), Ye(e)) return Ge(e), !0;
939
+ let r = W(e.nodeName);
940
+ if (Ze(k.uponSanitizeElement, e, {
941
941
  tagName: r,
942
- allowedTags: R
943
- }), ce && e.hasChildNodes() && !Ye(e.firstElementChild) && En(/<[/\w!]/g, e.innerHTML) && En(/<[/\w!]/g, e.textContent) || ce && e.namespaceURI === Oe && r === "style" && Ye(e.firstElementChild) || e.nodeType === nr.progressingInstruction || ce && e.nodeType === nr.comment && En(/<[/\w]/g, e.data)) return We(e), !0;
944
- if (re[r] || !(V.tagCheck instanceof Function && V.tagCheck(r)) && !R[r]) {
945
- if (!re[r] && et(r) && (B.tagNameCheck instanceof RegExp && En(B.tagNameCheck, r) || B.tagNameCheck instanceof Function && B.tagNameCheck(r))) return !1;
946
- if (_e && !be[r]) {
942
+ allowedTags: L
943
+ }), le && e.hasChildNodes() && !Xe(e.firstElementChild) && Dn(/<[/\w!]/g, e.innerHTML) && Dn(/<[/\w!]/g, e.textContent) || le && e.namespaceURI === ke && r === "style" && Xe(e.firstElementChild) || e.nodeType === nr.progressingInstruction || le && e.nodeType === nr.comment && Dn(/<[/\w]/g, e.data)) return Ge(e), !0;
944
+ if (re[r] || !(ae.tagCheck instanceof Function && ae.tagCheck(r)) && !L[r]) {
945
+ if (!re[r] && tt(r) && (B.tagNameCheck instanceof RegExp && Dn(B.tagNameCheck, r) || B.tagNameCheck instanceof Function && B.tagNameCheck(r))) return !1;
946
+ if (ve && !xe[r]) {
947
947
  let t = b(e) || e.parentNode, n = y(e) || e.childNodes;
948
948
  if (n && t) {
949
949
  let r = n.length;
@@ -953,25 +953,25 @@ function or() {
953
953
  }
954
954
  }
955
955
  }
956
- return We(e), !0;
956
+ return Ge(e), !0;
957
957
  }
958
- return e instanceof c && !Ue(e) || (r === "noscript" || r === "noembed" || r === "noframes") && En(/<\/no(script|embed|frames)/i, e.innerHTML) ? (We(e), !0) : (se && e.nodeType === nr.text && (n = e.textContent, ln([
958
+ return e instanceof c && !We(e) || (r === "noscript" || r === "noembed" || r === "noframes") && Dn(/<\/no(script|embed|frames)/i, e.innerHTML) ? (Ge(e), !0) : (ce && e.nodeType === nr.text && (n = e.textContent, un([
959
959
  A,
960
960
  j,
961
961
  M
962
962
  ], (e) => {
963
- n = vn(n, e, " ");
964
- }), e.textContent !== n && (fn(t.removed, { element: e.cloneNode() }), e.textContent = n)), Xe(k.afterSanitizeElements, e, null), !1);
965
- }, Qe = function(e, t, r) {
966
- if (ie[t] || me && (t === "id" || t === "name") && (r in n || r in ze)) return !1;
967
- let i = z[t] || V.attributeCheck instanceof Function && V.attributeCheck(t, e);
968
- if (!(H && !ie[t] && En(ee, t)) && !(ae && En(N, t))) {
963
+ n = yn(n, e, " ");
964
+ }), e.textContent !== n && (pn(t.removed, { element: e.cloneNode() }), e.textContent = n)), Ze(k.afterSanitizeElements, e, null), !1);
965
+ }, $e = function(e, t, r) {
966
+ if (ie[t] || he && (t === "id" || t === "name") && (r in n || r in Be)) return !1;
967
+ let i = z[t] || ae.attributeCheck instanceof Function && ae.attributeCheck(t, e);
968
+ if (!(V && !ie[t] && Dn(ee, t)) && !(oe && Dn(N, t))) {
969
969
  if (!i || ie[t]) {
970
- if (!(et(e) && (B.tagNameCheck instanceof RegExp && En(B.tagNameCheck, e) || B.tagNameCheck instanceof Function && B.tagNameCheck(e)) && (B.attributeNameCheck instanceof RegExp && En(B.attributeNameCheck, t) || B.attributeNameCheck instanceof Function && B.attributeNameCheck(t, e)) || t === "is" && B.allowCustomizedBuiltInElements && (B.tagNameCheck instanceof RegExp && En(B.tagNameCheck, r) || B.tagNameCheck instanceof Function && B.tagNameCheck(r)))) return !1;
971
- } else if (!we[t] && !En(L, vn(r, F, "")) && !((t === "src" || t === "xlink:href" || t === "href") && e !== "script" && yn(r, "data:") === 0 && Se[e]) && !(oe && !En(P, vn(r, F, ""))) && r) return !1;
970
+ if (!(tt(e) && (B.tagNameCheck instanceof RegExp && Dn(B.tagNameCheck, e) || B.tagNameCheck instanceof Function && B.tagNameCheck(e)) && (B.attributeNameCheck instanceof RegExp && Dn(B.attributeNameCheck, t) || B.attributeNameCheck instanceof Function && B.attributeNameCheck(t, e)) || t === "is" && B.allowCustomizedBuiltInElements && (B.tagNameCheck instanceof RegExp && Dn(B.tagNameCheck, r) || B.tagNameCheck instanceof Function && B.tagNameCheck(r)))) return !1;
971
+ } else if (!Te[t] && !Dn(te, yn(r, F, "")) && !((t === "src" || t === "xlink:href" || t === "href") && e !== "script" && bn(r, "data:") === 0 && Ce[e]) && !(se && !Dn(P, yn(r, F, ""))) && r) return !1;
972
972
  }
973
973
  return !0;
974
- }, $e = Y({}, [
974
+ }, et = Y({}, [
975
975
  "annotation-xml",
976
976
  "color-profile",
977
977
  "font-face",
@@ -980,12 +980,12 @@ function or() {
980
980
  "font-face-src",
981
981
  "font-face-uri",
982
982
  "missing-glyph"
983
- ]), et = function(e) {
984
- return !$e[hn(e)] && En(I, e);
985
- }, tt = function(e) {
986
- Xe(k.beforeSanitizeAttributes, e, null);
983
+ ]), tt = function(e) {
984
+ return !et[gn(e)] && Dn(I, e);
985
+ }, nt = function(e) {
986
+ Ze(k.beforeSanitizeAttributes, e, null);
987
987
  let n = e.attributes;
988
- if (!n || Je(e)) return;
988
+ if (!n || Ye(e)) return;
989
989
  let r = {
990
990
  attrName: "",
991
991
  attrValue: "",
@@ -994,34 +994,34 @@ function or() {
994
994
  forceKeepAttr: void 0
995
995
  }, i = n.length;
996
996
  for (; i--;) {
997
- let a = n[i], o = a.name, s = a.namespaceURI, c = a.value, l = G(o), u = c, d = o === "value" ? u : bn(u);
998
- if (r.attrName = l, r.attrValue = d, r.keepAttr = !0, r.forceKeepAttr = void 0, Xe(k.uponSanitizeAttribute, e, r), d = r.attrValue, he && (l === "id" || l === "name") && yn(d, ge) !== 0 && (Ge(o, e), d = ge + d), ce && En(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, d)) {
999
- Ge(o, e);
997
+ let a = n[i], o = a.name, s = a.namespaceURI, c = a.value, l = W(o), u = c, d = o === "value" ? u : xn(u);
998
+ if (r.attrName = l, r.attrValue = d, r.keepAttr = !0, r.forceKeepAttr = void 0, Ze(k.uponSanitizeAttribute, e, r), d = r.attrValue, ge && (l === "id" || l === "name") && bn(d, _e) !== 0 && (Ke(o, e), d = _e + d), le && Dn(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, d)) {
999
+ Ke(o, e);
1000
1000
  continue;
1001
1001
  }
1002
- if (l === "attributename" && _n(d, "href")) {
1003
- Ge(o, e);
1002
+ if (l === "attributename" && vn(d, "href")) {
1003
+ Ke(o, e);
1004
1004
  continue;
1005
1005
  }
1006
1006
  if (r.forceKeepAttr) continue;
1007
1007
  if (!r.keepAttr) {
1008
- Ge(o, e);
1008
+ Ke(o, e);
1009
1009
  continue;
1010
1010
  }
1011
- if (!U && En(/\/>/i, d)) {
1012
- Ge(o, e);
1011
+ if (!H && Dn(/\/>/i, d)) {
1012
+ Ke(o, e);
1013
1013
  continue;
1014
1014
  }
1015
- se && ln([
1015
+ ce && un([
1016
1016
  A,
1017
1017
  j,
1018
1018
  M
1019
1019
  ], (e) => {
1020
- d = vn(d, e, " ");
1020
+ d = yn(d, e, " ");
1021
1021
  });
1022
- let f = G(e.nodeName);
1023
- if (!Qe(f, l, d)) {
1024
- Ge(o, e);
1022
+ let f = W(e.nodeName);
1023
+ if (!$e(f, l, d)) {
1024
+ Ke(o, e);
1025
1025
  continue;
1026
1026
  }
1027
1027
  if (x && typeof m == "object" && typeof m.getAttributeType == "function" && !s) switch (m.getAttributeType(f, l)) {
@@ -1033,87 +1033,87 @@ function or() {
1033
1033
  break;
1034
1034
  }
1035
1035
  if (d !== u) try {
1036
- s ? e.setAttributeNS(s, o, d) : e.setAttribute(o, d), Je(e) ? We(e) : dn(t.removed);
1036
+ s ? e.setAttributeNS(s, o, d) : e.setAttribute(o, d), Ye(e) ? Ge(e) : fn(t.removed);
1037
1037
  } catch {
1038
- Ge(o, e);
1038
+ Ke(o, e);
1039
1039
  }
1040
1040
  }
1041
- Xe(k.afterSanitizeAttributes, e, null);
1042
- }, nt = function(e) {
1043
- let t = null, n = qe(e);
1044
- for (Xe(k.beforeSanitizeShadowDOM, e, null); t = n.nextNode();) Xe(k.uponSanitizeShadowNode, t, null), Ze(t), tt(t), t.content instanceof a && nt(t.content);
1045
- Xe(k.afterSanitizeShadowDOM, e, null);
1041
+ Ze(k.afterSanitizeAttributes, e, null);
1046
1042
  }, rt = function(e) {
1043
+ let t = null, n = Je(e);
1044
+ for (Ze(k.beforeSanitizeShadowDOM, e, null); t = n.nextNode();) Ze(k.uponSanitizeShadowNode, t, null), Qe(t), nt(t), t.content instanceof a && rt(t.content);
1045
+ Ze(k.afterSanitizeShadowDOM, e, null);
1046
+ }, it = function(e) {
1047
1047
  if (e.nodeType === nr.element && e.shadowRoot instanceof a) {
1048
1048
  let t = e.shadowRoot;
1049
- rt(t), nt(t);
1049
+ it(t), rt(t);
1050
1050
  }
1051
1051
  let t = e.childNodes;
1052
1052
  if (!t) return;
1053
1053
  let n = [];
1054
- ln(t, (e) => {
1055
- fn(n, e);
1054
+ un(t, (e) => {
1055
+ pn(n, e);
1056
1056
  });
1057
- for (let e of n) rt(e);
1057
+ for (let e of n) it(e);
1058
1058
  };
1059
1059
  return t.sanitize = function(e) {
1060
1060
  let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, i = null, o = null, c = null, l = null;
1061
- if (Ae = !e, Ae && (e = "<!-->"), typeof e != "string" && !Ye(e) && (e = Mn(e), typeof e != "string")) throw Dn("dirty is not a string, aborting");
1061
+ if (je = !e, je && (e = "<!-->"), typeof e != "string" && !Xe(e) && (e = Mn(e), typeof e != "string")) throw On("dirty is not a string, aborting");
1062
1062
  if (!t.isSupported) return e;
1063
- if (le || Ve(n), t.removed = [], typeof e == "string" && (ve = !1), ve) {
1063
+ if (ue || He(n), t.removed = [], typeof e == "string" && (ye = !1), ye) {
1064
1064
  let t = e.nodeName;
1065
1065
  if (typeof t == "string") {
1066
- let e = G(t);
1067
- if (!R[e] || re[e]) throw Dn("root node is forbidden and cannot be sanitized in-place");
1066
+ let e = W(t);
1067
+ if (!L[e] || re[e]) throw On("root node is forbidden and cannot be sanitized in-place");
1068
1068
  }
1069
- rt(e);
1070
- } else if (e instanceof s) i = Ke("<!---->"), o = i.ownerDocument.importNode(e, !0), o.nodeType === nr.element && o.nodeName === "BODY" || o.nodeName === "HTML" ? i = o : i.appendChild(o), rt(o);
1069
+ it(e);
1070
+ } else if (e instanceof s) i = qe("<!---->"), o = i.ownerDocument.importNode(e, !0), o.nodeType === nr.element && o.nodeName === "BODY" || o.nodeName === "HTML" ? i = o : i.appendChild(o), it(o);
1071
1071
  else {
1072
- if (!de && !se && !W && e.indexOf("<") === -1) return x && pe ? x.createHTML(e) : e;
1073
- if (i = Ke(e), !i) return de ? null : pe ? S : "";
1074
- }
1075
- i && ue && We(i.firstChild);
1076
- let u = qe(ve ? e : i);
1077
- for (; c = u.nextNode();) Ze(c), tt(c), c.content instanceof a && nt(c.content);
1078
- if (ve) return e;
1079
- if (de) {
1080
- if (se) {
1072
+ if (!fe && !ce && !U && e.indexOf("<") === -1) return x && me ? x.createHTML(e) : e;
1073
+ if (i = qe(e), !i) return fe ? null : me ? S : "";
1074
+ }
1075
+ i && de && Ge(i.firstChild);
1076
+ let u = Je(ye ? e : i);
1077
+ for (; c = u.nextNode();) Qe(c), nt(c), c.content instanceof a && rt(c.content);
1078
+ if (ye) return e;
1079
+ if (fe) {
1080
+ if (ce) {
1081
1081
  i.normalize();
1082
1082
  let e = i.innerHTML;
1083
- ln([
1083
+ un([
1084
1084
  A,
1085
1085
  j,
1086
1086
  M
1087
1087
  ], (t) => {
1088
- e = vn(e, t, " ");
1088
+ e = yn(e, t, " ");
1089
1089
  }), i.innerHTML = e;
1090
1090
  }
1091
- if (fe) for (l = E.call(i.ownerDocument); i.firstChild;) l.appendChild(i.firstChild);
1091
+ if (pe) for (l = E.call(i.ownerDocument); i.firstChild;) l.appendChild(i.firstChild);
1092
1092
  else l = i;
1093
1093
  return (z.shadowroot || z.shadowrootmode) && (l = O.call(r, l, !0)), l;
1094
1094
  }
1095
- let d = W ? i.outerHTML : i.innerHTML;
1096
- return W && R["!doctype"] && i.ownerDocument && i.ownerDocument.doctype && i.ownerDocument.doctype.name && En(er, i.ownerDocument.doctype.name) && (d = "<!DOCTYPE " + i.ownerDocument.doctype.name + ">\n" + d), se && ln([
1095
+ let d = U ? i.outerHTML : i.innerHTML;
1096
+ return U && L["!doctype"] && i.ownerDocument && i.ownerDocument.doctype && i.ownerDocument.doctype.name && Dn(er, i.ownerDocument.doctype.name) && (d = "<!DOCTYPE " + i.ownerDocument.doctype.name + ">\n" + d), ce && un([
1097
1097
  A,
1098
1098
  j,
1099
1099
  M
1100
1100
  ], (e) => {
1101
- d = vn(d, e, " ");
1102
- }), x && pe ? x.createHTML(d) : d;
1101
+ d = yn(d, e, " ");
1102
+ }), x && me ? x.createHTML(d) : d;
1103
1103
  }, t.setConfig = function() {
1104
- Ve(arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}), le = !0;
1104
+ He(arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}), ue = !0;
1105
1105
  }, t.clearConfig = function() {
1106
- Re = null, le = !1;
1106
+ ze = null, ue = !1;
1107
1107
  }, t.isValidAttribute = function(e, t, n) {
1108
- return Re || Ve({}), Qe(G(e), G(t), n);
1108
+ return ze || He({}), $e(W(e), W(t), n);
1109
1109
  }, t.addHook = function(e, t) {
1110
- typeof t == "function" && fn(k[e], t);
1110
+ typeof t == "function" && pn(k[e], t);
1111
1111
  }, t.removeHook = function(e, t) {
1112
1112
  if (t !== void 0) {
1113
- let n = un(k[e], t);
1114
- return n === -1 ? void 0 : pn(k[e], n, 1)[0];
1113
+ let n = dn(k[e], t);
1114
+ return n === -1 ? void 0 : mn(k[e], n, 1)[0];
1115
1115
  }
1116
- return dn(k[e]);
1116
+ return fn(k[e]);
1117
1117
  }, t.removeHooks = function(e) {
1118
1118
  k[e] = [];
1119
1119
  }, t.removeAllHooks = function() {
@@ -1319,12 +1319,12 @@ hr.prototype.parse = function(e, t) {
1319
1319
  };
1320
1320
  //#endregion
1321
1321
  //#region node_modules/mdurl/index.mjs
1322
- var Dr = /* @__PURE__ */ Re({
1322
+ var Dr = /* @__PURE__ */ ze({
1323
1323
  decode: () => ur,
1324
1324
  encode: () => pr,
1325
1325
  format: () => mr,
1326
1326
  parse: () => Er
1327
- }), Or = /[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/, kr = /[\0-\x1F\x7F-\x9F]/, Ar = /[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/, jr = /[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/, Mr = /[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/, Nr = /[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/, Pr = /* @__PURE__ */ Re({
1327
+ }), Or = /[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/, kr = /[\0-\x1F\x7F-\x9F]/, Ar = /[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/, jr = /[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/, Mr = /[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/, Nr = /[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/, Pr = /* @__PURE__ */ ze({
1328
1328
  Any: () => Or,
1329
1329
  Cc: () => kr,
1330
1330
  Cf: () => Ar,
@@ -1519,7 +1519,7 @@ function $r(e, t = Jr.Legacy) {
1519
1519
  }
1520
1520
  //#endregion
1521
1521
  //#region node_modules/markdown-it/lib/common/utils.mjs
1522
- var ei = /* @__PURE__ */ Re({
1522
+ var ei = /* @__PURE__ */ ze({
1523
1523
  arrayReplaceAt: () => oi,
1524
1524
  assign: () => ai,
1525
1525
  escapeHtml: () => yi,
@@ -1754,7 +1754,7 @@ function ki(e, t, n, r) {
1754
1754
  }
1755
1755
  //#endregion
1756
1756
  //#region node_modules/markdown-it/lib/helpers/index.mjs
1757
- var Ai = /* @__PURE__ */ Re({
1757
+ var Ai = /* @__PURE__ */ ze({
1758
1758
  parseLinkDestination: () => Oi,
1759
1759
  parseLinkLabel: () => Di,
1760
1760
  parseLinkTitle: () => ki
@@ -3735,7 +3735,7 @@ var hs = new ms({
3735
3735
  "href",
3736
3736
  "target",
3737
3737
  "rel",
3738
- St,
3738
+ Ct,
3739
3739
  "class"
3740
3740
  ], vs = [
3741
3741
  "br",
@@ -3749,8 +3749,8 @@ var hs = new ms({
3749
3749
  ], ys = /<(?:\/)?(?:div|p|li|h[1-6]|blockquote|pre)[^>]*>/gi, bs = /<\/(?:div|p|li|h[1-6]|blockquote|pre)>/gi, xs = /<(?:div|p|li|h[1-6]|blockquote|pre)[^>]*>/gi, Ss = /&nbsp;/gi, Cs = /https?:\/\/[^\s<>()]+[^\s<>().,!?;:]/i, ws = /(^|[\s([{"'`])((?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,}(?:\/[^\s<]*)?)/gi, Ts = /[),.!?;:]+$/;
3750
3750
  function Es(e) {
3751
3751
  if (!e) return "";
3752
- let { shielded: t, tokens: n } = jt(e), r = t.replace(/\r\n?/g, "\n").replace(xs, "<br>").replace(bs, "").replace(Ss, " ");
3753
- return Mt(sr.sanitize(r, {
3752
+ let { shielded: t, tokens: n } = Mt(e), r = t.replace(/\r\n?/g, "\n").replace(xs, "<br>").replace(bs, "").replace(Ss, " ");
3753
+ return Nt(sr.sanitize(r, {
3754
3754
  ALLOWED_TAGS: vs,
3755
3755
  ALLOWED_ATTR: _s,
3756
3756
  ALLOW_DATA_ATTR: !1
@@ -3758,12 +3758,12 @@ function Es(e) {
3758
3758
  }
3759
3759
  function Ds(e, t) {
3760
3760
  if (!e) return "";
3761
- let n = Ht(kt(e), t ?? {}).replace(/<br\s*\/?>/gi, "\n").replace(ys, (e) => e.startsWith("</") ? "\n" : "");
3761
+ let n = Ut(At(e), t ?? {}).replace(/<br\s*\/?>/gi, "\n").replace(ys, (e) => e.startsWith("</") ? "\n" : "");
3762
3762
  return (new DOMParser().parseFromString(`<div>${n}</div>`, "text/html").body.textContent ?? "").replace(/\u00a0/g, " ").replace(/\n{3,}/g, "\n\n").trim();
3763
3763
  }
3764
3764
  function Os(e, t) {
3765
3765
  if (!e) return "";
3766
- let n = kt(e), r = Es(At(n) ? Ft(n, t?.mentionNameByUid ?? {}) : n);
3766
+ let n = At(e), r = Es(jt(n) ? It(n, t?.mentionNameByUid ?? {}) : n);
3767
3767
  if (!r) return "";
3768
3768
  let i = hs.render(Ps(r));
3769
3769
  return sr.sanitize(i, {
@@ -3788,7 +3788,7 @@ function Ms(e) {
3788
3788
  return e.replace(/\n{2,}/g, (e) => "\n" + "<br>".repeat(e.length - 1));
3789
3789
  }
3790
3790
  function Ns(e, t) {
3791
- return e.replace(vt, (e, n) => `<span class="${wt}">@${(t ?? []).find((e) => e.getUid?.() === n)?.getName?.() ?? n}</span>`);
3791
+ return e.replace(yt, (e, n) => `<span class="${Tt}">@${(t ?? []).find((e) => e.getUid?.() === n)?.getName?.() ?? n}</span>`);
3792
3792
  }
3793
3793
  function Ps(e) {
3794
3794
  let t = new DOMParser().parseFromString(`<div>${e}</div>`, "text/html"), n = t.body.firstElementChild;
@@ -3838,23 +3838,23 @@ function Ls(e) {
3838
3838
  function Rs(e, t) {
3839
3839
  if (!e) return t;
3840
3840
  switch (e.kind) {
3841
- case "image": return _t("photo");
3842
- case "video": return _t("video");
3843
- case "audio": return _t("audio");
3841
+ case "image": return vt("photo");
3842
+ case "video": return vt("video");
3843
+ case "audio": return vt("audio");
3844
3844
  case "file": return e.name || t;
3845
3845
  default: return t;
3846
3846
  }
3847
3847
  }
3848
- function zs(e, t = _t("attachment")) {
3848
+ function zs(e, t = vt("attachment")) {
3849
3849
  return Rs(e[0], t);
3850
3850
  }
3851
3851
  function Bs(e, t) {
3852
- let n = kt(e ?? "");
3853
- return n ? At(n) && t ? Es(Pt(n, t)) : Es(n) : "";
3852
+ let n = At(e ?? "");
3853
+ return n ? jt(n) && t ? Es(Ft(n, t)) : Es(n) : "";
3854
3854
  }
3855
3855
  function Vs(e) {
3856
3856
  let t = Es(e);
3857
- return t ? It(t) : "";
3857
+ return t ? Lt(t) : "";
3858
3858
  }
3859
3859
  function Hs(e) {
3860
3860
  return Ds(e).length > 0;
@@ -3862,26 +3862,26 @@ function Hs(e) {
3862
3862
  function Us(e, t) {
3863
3863
  return Ds(e, t);
3864
3864
  }
3865
- function Ws(e, t = _t("message"), n) {
3865
+ function Ws(e, t = vt("message"), n) {
3866
3866
  if (e.kind === "poll" && e.poll) return e.poll.question;
3867
3867
  let r = Us(e.text, n);
3868
3868
  return e.attachments.length > 0 ? r || zs(e.attachments, t) : r || t;
3869
3869
  }
3870
3870
  function Gs(e, t = {}) {
3871
- return Ht(e, t);
3871
+ return Ut(e, t);
3872
3872
  }
3873
3873
  function Ks(e) {
3874
- return e.source?.getText?.() || kt(e.text);
3874
+ return e.source?.getText?.() || At(e.text);
3875
3875
  }
3876
3876
  function qs(e, t = !1, n = !0) {
3877
3877
  if (!e) return "";
3878
3878
  if (e.getDeletedAt?.() != null) return "(Message removed)";
3879
- if (e instanceof U.TextMessage) return e.getText?.() ?? "";
3880
- if (e instanceof U.MediaMessage) {
3879
+ if (e instanceof H.TextMessage) return e.getText?.() ?? "";
3880
+ if (e instanceof H.MediaMessage) {
3881
3881
  let r = n ? e.getAttachment?.()?.getName?.() ?? "" : "", i = e.getCaption?.()?.trim?.() ?? "", a = e.getType?.();
3882
3882
  return a === "image" ? `${t ? "🖼️ " : ""}${i || "Photo"}` : a === "video" ? `${t ? "🎥 " : ""}${i || r || "Video"}` : a === "audio" ? `${t ? "🎤 " : ""}${r || "Audio message"}` : a === "file" ? `${t ? "📄 " : ""}${i || r || "File"}` : `${t ? "🖼️ " : ""}${i || r || "Media message"}`;
3883
3883
  }
3884
- if (e instanceof U.Action) {
3884
+ if (e instanceof H.Action) {
3885
3885
  let t = (e.getActionFor?.()?.getMetadata?.() ?? e.getReceiver?.()?.getMetadata?.() ?? {}).systemDisplayName, n = (e.getActionBy?.())?.getName?.() ?? "", r = e.getMessage?.() ?? "";
3886
3886
  return typeof t == "string" && t.trim() && n ? r.replace(n, t.trim()) : r;
3887
3887
  }
@@ -3911,9 +3911,9 @@ function Xs(e) {
3911
3911
  return Ys(e).join("\n").trim();
3912
3912
  }
3913
3913
  function Zs(e) {
3914
- if (e.kind === "poll" && e.poll) return _t("pollPrefix", { question: e.poll.question });
3915
- let t = Bt(e.source);
3916
- return Ws(e, e.attachments.length > 0 ? _t("sentAnAttachment") : _t("youSentAMessage"), t);
3914
+ if (e.kind === "poll" && e.poll) return vt("pollPrefix", { question: e.poll.question });
3915
+ let t = Vt(e.source);
3916
+ return Ws(e, e.attachments.length > 0 ? vt("sentAnAttachment") : vt("youSentAMessage"), t);
3917
3917
  }
3918
3918
  //#endregion
3919
3919
  //#region src/chat/offlineStore.ts
@@ -4161,7 +4161,7 @@ function ac(e) {
4161
4161
  //#region src/chat/client.ts
4162
4162
  var oc = null, sc = null;
4163
4163
  function cc({ environment: e }) {
4164
- Ve(e);
4164
+ He(e);
4165
4165
  let t = w(!1), r = w(!1), i = w(!1), a = w(!1), o = w(!1), s = w(!1), c = w(!1), l = w(!1), u = w(!1), d = w(!1), f = w(!1), p = w(!1), m = w(typeof navigator < "u" ? !navigator.onLine : !1), h = w(!1), g = w(null), _ = w(null), v = w([]), y = w([]), b = w([]), x = w([]), S = w(!1), C = w(!1), T = w(null), E = w(null), D = w(null), O = w(null), k = w([]), A = w({}), j = n(() => k.value.length);
4166
4166
  function M(e) {
4167
4167
  if (!e.length) return;
@@ -4170,7 +4170,7 @@ function cc({ environment: e }) {
4170
4170
  A.value = t;
4171
4171
  }
4172
4172
  function ee(e) {
4173
- M(Object.entries(Bt(e)).map(([e, t]) => ({
4173
+ M(Object.entries(Vt(e)).map(([e, t]) => ({
4174
4174
  uid: e,
4175
4175
  displayName: t
4176
4176
  })));
@@ -4178,131 +4178,131 @@ function cc({ environment: e }) {
4178
4178
  function N(e, t) {
4179
4179
  return ee(e), fc(e, t);
4180
4180
  }
4181
- let P = n(() => v.value.find((e) => e.id === T.value) ?? null), F = `bcc-ui-connection-${crypto.randomUUID()}`, I = `bcc-ui-message-${crypto.randomUUID()}`, L = !1, R = !1, te = null, z = null, ne = null, B = null, re = 0, ie = 0, V = !1, ae = !1, H = null, oe = /* @__PURE__ */ new Map(), se = /* @__PURE__ */ new Set(), ce = null, W = null, le = 0;
4182
- async function ue() {
4183
- await lc(e), !t.value && (he(), dt(), t.value = !0, await lt(), _.value && (ut(_.value.uid), pe(), we(), !m.value && !ae && Se()));
4181
+ let P = n(() => v.value.find((e) => e.id === T.value) ?? null), F = `bcc-ui-connection-${crypto.randomUUID()}`, I = `bcc-ui-message-${crypto.randomUUID()}`, te = !1, L = !1, R = null, z = null, ne = null, B = null, re = 0, ie = 0, ae = !1, oe = !1, V = null, se = /* @__PURE__ */ new Map(), ce = /* @__PURE__ */ new Set(), le = null, U = null, ue = 0;
4182
+ async function de() {
4183
+ await lc(e), !t.value && (ge(), ft(), t.value = !0, await ut(), _.value && (dt(_.value.uid), me(), Te(), !m.value && !oe && Ce()));
4184
4184
  }
4185
- async function de(e) {
4185
+ async function fe(e) {
4186
4186
  g.value = null, r.value = !0;
4187
4187
  try {
4188
- await ue();
4189
- let t = Ke();
4190
- await U.getLoggedinUser() && t !== e && await U.logout(), qe(e);
4188
+ await de();
4189
+ let t = qe();
4190
+ await H.getLoggedinUser() && t !== e && await H.logout(), Je(e);
4191
4191
  let n = await uc(e);
4192
- _.value = hc(await U.login(n)), ut(_.value.uid), h.value = !0, m.value = typeof navigator < "u" ? !navigator.onLine : !1, pe(), we(), ae || await Se(), await Oe(), Kt();
4192
+ _.value = hc(await H.login(n)), dt(_.value.uid), h.value = !0, m.value = typeof navigator < "u" ? !navigator.onLine : !1, me(), Te(), oe || await Ce(), await ke(), qt();
4193
4193
  } catch (e) {
4194
- throw xt(), g.value = Z(e, "Unable to sign in to chat."), e;
4194
+ throw St(), g.value = Z(e, "Unable to sign in to chat."), e;
4195
4195
  } finally {
4196
4196
  r.value = !1;
4197
4197
  }
4198
4198
  }
4199
- async function fe() {
4199
+ async function pe() {
4200
4200
  g.value = null;
4201
4201
  try {
4202
- qe(null), Ze(), await U.getLoggedinUser() && await U.logout();
4202
+ Je(null), Qe(), await H.getLoggedinUser() && await H.logout();
4203
4203
  } finally {
4204
- xt();
4204
+ St();
4205
4205
  }
4206
4206
  }
4207
- function pe() {
4208
- let e = ct();
4207
+ function me() {
4208
+ let e = lt();
4209
4209
  if (!e) {
4210
- H = null, k.value = [];
4210
+ V = null, k.value = [];
4211
4211
  return;
4212
4212
  }
4213
- let t = `bcc-chat:${K().appId}:${e}`;
4214
- me(t), H = new $s(t), k.value = H.getQueue();
4213
+ let t = `bcc-chat:${G().appId}:${e}`;
4214
+ he(t), V = new $s(t), k.value = V.getQueue();
4215
4215
  }
4216
- function me(e) {
4216
+ function he(e) {
4217
4217
  if (typeof window > "u") return;
4218
- let t = `bcc-chat:${K().appId}:`, n = [];
4218
+ let t = `bcc-chat:${G().appId}:`, n = [];
4219
4219
  for (let r = 0; r < window.localStorage.length; r += 1) {
4220
4220
  let i = window.localStorage.key(r);
4221
4221
  i && i.startsWith(t) && i !== e && n.push(i);
4222
4222
  }
4223
4223
  n.forEach((e) => window.localStorage.removeItem(e));
4224
4224
  }
4225
- function he() {
4226
- R || typeof window > "u" || (window.addEventListener("online", ge), window.addEventListener("offline", _e), R = !0);
4227
- }
4228
4225
  function ge() {
4229
- m.value = !1, V = !0, ae || xe(!0);
4226
+ L || typeof window > "u" || (window.addEventListener("online", _e), window.addEventListener("offline", ve), L = !0);
4230
4227
  }
4231
4228
  function _e() {
4232
- m.value = !0, p.value = !1, ve();
4229
+ m.value = !1, ae = !0, oe || Se(!0);
4233
4230
  }
4234
4231
  function ve() {
4235
- te !== null && (clearTimeout(te), te = null);
4232
+ m.value = !0, p.value = !1, ye();
4236
4233
  }
4237
4234
  function ye() {
4238
- re = Date.now() + 1500;
4235
+ R !== null && (clearTimeout(R), R = null);
4239
4236
  }
4240
4237
  function be() {
4238
+ re = Date.now() + 1500;
4239
+ }
4240
+ function xe() {
4241
4241
  return Date.now() < re;
4242
4242
  }
4243
- function xe(e = !1) {
4244
- if (te !== null || z || m.value || !h.value || ae) return;
4243
+ function Se(e = !1) {
4244
+ if (R !== null || z || m.value || !h.value || oe) return;
4245
4245
  let t = e ? 0 : Math.min(3e4, 1e3 * 2 ** Math.min(ie, 4));
4246
- te = setTimeout(() => {
4247
- te = null, Se();
4246
+ R = setTimeout(() => {
4247
+ R = null, Ce();
4248
4248
  }, t);
4249
4249
  }
4250
- async function Se() {
4251
- if (!(m.value || !h.value || ae)) return z || (z = (async () => {
4252
- ve();
4250
+ async function Ce() {
4251
+ if (!(m.value || !h.value || oe)) return z || (z = (async () => {
4252
+ ye();
4253
4253
  try {
4254
- let e = await U.getLoggedinUser();
4254
+ let e = await H.getLoggedinUser();
4255
4255
  if (!e) {
4256
- let t = Ke();
4256
+ let t = qe();
4257
4257
  if (!t) return;
4258
4258
  let n = await uc(t);
4259
- e = await U.login(n);
4259
+ e = await H.login(n);
4260
4260
  }
4261
- _.value = hc(e), h.value = !0, pe();
4262
- let t = U.connect;
4263
- typeof t == "function" && (await t.call(U), p.value = !0), ie = 0, V && await Ce();
4261
+ _.value = hc(e), h.value = !0, me();
4262
+ let t = H.connect;
4263
+ typeof t == "function" && (await t.call(H), p.value = !0), ie = 0, ae && await we();
4264
4264
  } catch (e) {
4265
- p.value = !1, ie += 1, It(e) || (g.value = Z(e, "Unable to reconnect to chat.")), xe();
4265
+ p.value = !1, ie += 1, Lt(e) || (g.value = Z(e, "Unable to reconnect to chat.")), Se();
4266
4266
  } finally {
4267
4267
  z = null;
4268
4268
  }
4269
4269
  })(), z);
4270
4270
  }
4271
- async function Ce() {
4272
- return ne || m.value || !h.value || ae || (ne = (async () => {
4273
- V = !1, g.value = null;
4271
+ async function we() {
4272
+ return ne || m.value || !h.value || oe || (ne = (async () => {
4273
+ ae = !1, g.value = null;
4274
4274
  try {
4275
- await Oe(), Kt();
4275
+ await ke(), qt();
4276
4276
  } finally {
4277
4277
  ne = null;
4278
4278
  }
4279
4279
  })()), ne;
4280
4280
  }
4281
- function we() {
4282
- if (!H || v.value.length > 0) return;
4283
- let e = H.getConversations();
4284
- e.length !== 0 && (v.value = bc(e), !T.value && v.value.length > 0 && Te(T.value));
4281
+ function Te() {
4282
+ if (!V || v.value.length > 0) return;
4283
+ let e = V.getConversations();
4284
+ e.length !== 0 && (v.value = bc(e), !T.value && v.value.length > 0 && Ee(T.value));
4285
4285
  }
4286
- function Te(e) {
4287
- if (!H || !e) return y.value = [], !1;
4288
- let t = H.getMessages(e).sort(xc);
4286
+ function Ee(e) {
4287
+ if (!V || !e) return y.value = [], !1;
4288
+ let t = V.getMessages(e).sort(xc);
4289
4289
  return y.value = t, t.length > 0;
4290
4290
  }
4291
- async function Ee() {
4292
- ae = !1, V = !0, await Se();
4293
- }
4294
4291
  async function De() {
4295
- ae = !0, V = !1, ve();
4296
- let e = U.disconnect;
4297
- typeof e == "function" && await e.call(U), p.value = !1;
4292
+ oe = !1, ae = !0, await Ce();
4298
4293
  }
4299
4294
  async function Oe() {
4300
- if (await ue(), i.value = !0, g.value = null, m.value && H) {
4301
- v.value = bc(H.getConversations()), P.value && await nt(), i.value = !1;
4295
+ oe = !0, ae = !1, ye();
4296
+ let e = H.disconnect;
4297
+ typeof e == "function" && await e.call(H), p.value = !1;
4298
+ }
4299
+ async function ke() {
4300
+ if (await de(), i.value = !0, g.value = null, m.value && V) {
4301
+ v.value = bc(V.getConversations()), P.value && await rt(), i.value = !1;
4302
4302
  return;
4303
4303
  }
4304
4304
  try {
4305
- let e = new U.ConversationsRequestBuilder().setLimit(50).withTags(!0).setConversationType(U.RECEIVER_TYPE.GROUP).build(), t = [], n = [];
4305
+ let e = new H.ConversationsRequestBuilder().setLimit(50).withTags(!0).setConversationType(H.RECEIVER_TYPE.GROUP).build(), t = [], n = [];
4306
4306
  do
4307
4307
  n = await e.fetchNext(), t.push(...n.map((e) => dc(e, _.value?.uid)));
4308
4308
  while (n.length === 50);
@@ -4311,9 +4311,9 @@ function cc({ environment: e }) {
4311
4311
  let t = r.get(e.id);
4312
4312
  t && (e.subtitle === "No messages yet" && t.subtitle && t.subtitle !== "No messages yet" && (e.subtitle = t.subtitle), !e.lastMessageAt && t.lastMessageAt && (e.lastMessageAt = t.lastMessageAt), !e.lastMessage && t.lastMessage && (e.lastMessage = t.lastMessage));
4313
4313
  }
4314
- v.value = bc(await pt(t)), H?.setConversations(v.value), P.value && await nt();
4314
+ v.value = bc(await mt(t)), V?.setConversations(v.value), P.value && await rt();
4315
4315
  } catch (e) {
4316
- let t = H?.getConversations() ?? [];
4316
+ let t = V?.getConversations() ?? [];
4317
4317
  if (t.length > 0) {
4318
4318
  v.value = bc(t);
4319
4319
  return;
@@ -4323,39 +4323,39 @@ function cc({ environment: e }) {
4323
4323
  i.value = !1;
4324
4324
  }
4325
4325
  }
4326
- async function ke(e) {
4327
- T.value = e, E.value = null, b.value = [], W = null, C.value = !1, D.value = null, O.value = null, Te(e), await nt();
4326
+ async function Ae(e) {
4327
+ T.value = e, E.value = null, b.value = [], U = null, C.value = !1, D.value = null, O.value = null, Ee(e), await rt();
4328
4328
  }
4329
- function Ae(e) {
4329
+ function je(e) {
4330
4330
  e && (O.value = null), D.value = e;
4331
4331
  }
4332
- function je(e) {
4332
+ function Me(e) {
4333
4333
  e && (D.value = null), O.value = e;
4334
4334
  }
4335
- async function Me(e) {
4336
- E.value = e, W = null, C.value = !1, D.value = null, O.value = null, await it(e.id);
4335
+ async function Ne(e) {
4336
+ E.value = e, U = null, C.value = !1, D.value = null, O.value = null, await at(e.id);
4337
4337
  }
4338
- function Ne() {
4339
- E.value = null, b.value = [], W = null, C.value = !1, D.value = null, O.value = null;
4338
+ function Pe() {
4339
+ E.value = null, b.value = [], U = null, C.value = !1, D.value = null, O.value = null;
4340
4340
  }
4341
- async function Pe(e, t) {
4341
+ async function Fe(e, t) {
4342
4342
  if (u.value) return;
4343
4343
  let n = P.value;
4344
4344
  if (!n) return;
4345
4345
  let r = Vs(e);
4346
4346
  if (!Hs(r)) return;
4347
4347
  if (O.value) {
4348
- await Fe(O.value, r);
4348
+ await Ie(O.value, r);
4349
4349
  return;
4350
4350
  }
4351
- let i = E.value?.id, a = crypto.randomUUID(), o = Dc(Pt(D.value, t), a);
4351
+ let i = E.value?.id, a = crypto.randomUUID(), o = Dc(Ft(D.value, t), a);
4352
4352
  u.value = !0, g.value = null;
4353
4353
  try {
4354
4354
  if (m.value) {
4355
- Lt(n, r, o, i, a), D.value = null;
4355
+ Rt(n, r, o, i, a), D.value = null;
4356
4356
  return;
4357
4357
  }
4358
- Ut(Nt({
4358
+ Wt(Pt({
4359
4359
  conversation: n,
4360
4360
  kind: "text",
4361
4361
  text: r,
@@ -4364,21 +4364,21 @@ function cc({ environment: e }) {
4364
4364
  muid: a,
4365
4365
  deliveryState: "sending"
4366
4366
  }));
4367
- let e = new U.TextMessage(n.targetId, r, kc(n));
4367
+ let e = new H.TextMessage(n.targetId, r, kc(n));
4368
4368
  e.setMuid?.(a), Object.keys(o).length > 0 && e.setMetadata?.(o), i && e.setParentMessageId?.(Number(i));
4369
- let t = await U.sendMessage(e);
4370
- Ct(N(t, _.value?.uid)), ht(t), await vt(t), D.value = null;
4369
+ let t = await H.sendMessage(e);
4370
+ wt(N(t, _.value?.uid)), gt(t), await yt(t), D.value = null;
4371
4371
  } catch (e) {
4372
- if (It(e)) {
4373
- Wt("queued", a), Lt(n, r, o, E.value?.id, a), D.value = null;
4372
+ if (Lt(e)) {
4373
+ Gt("queued", a), Rt(n, r, o, E.value?.id, a), D.value = null;
4374
4374
  return;
4375
4375
  }
4376
- throw Wt("failed", a), g.value = Z(e, "Unable to send the message."), e;
4376
+ throw Gt("failed", a), g.value = Z(e, "Unable to send the message."), e;
4377
4377
  } finally {
4378
4378
  u.value = !1;
4379
4379
  }
4380
4380
  }
4381
- async function Fe(e, t) {
4381
+ async function Ie(e, t) {
4382
4382
  let n = P.value;
4383
4383
  if (!n || m.value) return;
4384
4384
  let r = Vs(t);
@@ -4386,9 +4386,9 @@ function cc({ environment: e }) {
4386
4386
  u.value = !0, g.value = null;
4387
4387
  try {
4388
4388
  let t;
4389
- e.kind === "text" ? t = new U.TextMessage(n.targetId, r, kc(n)) : (t = new U.MediaMessage(n.targetId, e.source?.getAttachment?.()?.getFileUrl?.() ?? e.source?.getAttachment?.()?.getUrl?.() ?? e.attachments[0]?.url ?? "", e.source?.getType?.() ?? e.type ?? e.kind, kc(n)), t.setCaption(r)), t.setId(Number(e.id));
4390
- let i = await U.editMessage(t);
4391
- Ct(N(i, _.value?.uid)), ht(i), O.value = null;
4389
+ e.kind === "text" ? t = new H.TextMessage(n.targetId, r, kc(n)) : (t = new H.MediaMessage(n.targetId, e.source?.getAttachment?.()?.getFileUrl?.() ?? e.source?.getAttachment?.()?.getUrl?.() ?? e.attachments[0]?.url ?? "", e.source?.getType?.() ?? e.type ?? e.kind, kc(n)), t.setCaption(r)), t.setId(Number(e.id));
4390
+ let i = await H.editMessage(t);
4391
+ wt(N(i, _.value?.uid)), gt(i), O.value = null;
4392
4392
  } catch (e) {
4393
4393
  throw g.value = Z(e, "Unable to edit the message."), e;
4394
4394
  } finally {
@@ -4396,18 +4396,18 @@ function cc({ environment: e }) {
4396
4396
  }
4397
4397
  }
4398
4398
  }
4399
- async function Ie(e, t) {
4399
+ async function Le(e, t) {
4400
4400
  if (u.value) return;
4401
4401
  let n = P.value;
4402
4402
  if (!n) return;
4403
- let r = E.value?.id, i = crypto.randomUUID(), a = Dc(Pt(D.value, t), i), o = Nc(e.file);
4403
+ let r = E.value?.id, i = crypto.randomUUID(), a = Dc(Ft(D.value, t), i), o = Nc(e.file);
4404
4404
  u.value = !0, g.value = null;
4405
4405
  try {
4406
4406
  if (m.value) {
4407
- await Vt(n, e, a, r, i), D.value = null;
4407
+ await Ht(n, e, a, r, i), D.value = null;
4408
4408
  return;
4409
4409
  }
4410
- Ut(Nt({
4410
+ Wt(Pt({
4411
4411
  conversation: n,
4412
4412
  kind: o,
4413
4413
  text: e.caption?.trim() ?? "",
@@ -4422,37 +4422,37 @@ function cc({ environment: e }) {
4422
4422
  muid: i,
4423
4423
  deliveryState: "sending"
4424
4424
  }));
4425
- let t = new U.MediaMessage(n.targetId, e.file, o, kc(n));
4425
+ let t = new H.MediaMessage(n.targetId, e.file, o, kc(n));
4426
4426
  t.setMuid?.(i), Object.keys(a).length > 0 && t.setMetadata?.(a), r && t.setParentMessageId?.(Number(r)), e.caption?.trim() && t.setCaption?.(e.caption.trim());
4427
- let s = await U.sendMediaMessage(t);
4428
- Ct(N(s, _.value?.uid)), ht(s), await vt(s), D.value = null;
4427
+ let s = await H.sendMediaMessage(t);
4428
+ wt(N(s, _.value?.uid)), gt(s), await yt(s), D.value = null;
4429
4429
  } catch (t) {
4430
- if (It(t)) {
4431
- Wt("queued", i), await Vt(n, e, a, r, i), D.value = null;
4430
+ if (Lt(t)) {
4431
+ Gt("queued", i), await Ht(n, e, a, r, i), D.value = null;
4432
4432
  return;
4433
4433
  }
4434
- throw Wt("failed", i), g.value = Z(t, "Unable to send the attachment."), t;
4434
+ throw Gt("failed", i), g.value = Z(t, "Unable to send the attachment."), t;
4435
4435
  } finally {
4436
4436
  u.value = !1;
4437
4437
  }
4438
4438
  }
4439
- async function Le(e, t) {
4439
+ async function Re(e, t) {
4440
4440
  if (u.value) return;
4441
4441
  let n = P.value;
4442
4442
  if (!n) return;
4443
4443
  let r = e.question.trim(), i = e.options.map((e) => e.trim()).filter(Boolean);
4444
4444
  if (!r || i.length < 2) return;
4445
- let a = E.value?.id, o = crypto.randomUUID(), s = Dc(Pt(D.value, t), o);
4445
+ let a = E.value?.id, o = crypto.randomUUID(), s = Dc(Ft(D.value, t), o);
4446
4446
  u.value = !0, g.value = null;
4447
4447
  try {
4448
4448
  if (m.value) {
4449
- Rt(n, {
4449
+ zt(n, {
4450
4450
  question: r,
4451
4451
  options: i
4452
4452
  }, s, a, o), D.value = null;
4453
4453
  return;
4454
4454
  }
4455
- Ut(Nt({
4455
+ Wt(Pt({
4456
4456
  conversation: n,
4457
4457
  kind: "poll",
4458
4458
  text: `Poll: ${r}`,
@@ -4469,41 +4469,41 @@ function cc({ environment: e }) {
4469
4469
  question: r,
4470
4470
  options: i,
4471
4471
  receiver: n.targetId,
4472
- receiverType: n.type === "group" ? U.RECEIVER_TYPE.GROUP : U.RECEIVER_TYPE.USER
4472
+ receiverType: n.type === "group" ? H.RECEIVER_TYPE.GROUP : H.RECEIVER_TYPE.USER
4473
4473
  };
4474
4474
  a && (e.parentMessageId = Number(a)), Object.keys(s).length > 0 && (e.metadata = s);
4475
- let t = await U.callExtension("polls", "POST", "v2/create", e), c = t?.message ?? t?.custom_message ?? t?.data?.message ?? null;
4476
- c ? (Gt(o), Ct(N(c, _.value?.uid)), ht(c), await vt(c)) : (Gt(o), await St()), D.value = null;
4475
+ let t = await H.callExtension("polls", "POST", "v2/create", e), c = t?.message ?? t?.custom_message ?? t?.data?.message ?? null;
4476
+ c ? (Kt(o), wt(N(c, _.value?.uid)), gt(c), await yt(c)) : (Kt(o), await Ct()), D.value = null;
4477
4477
  } catch (e) {
4478
- if (It(e)) {
4479
- Wt("queued", o), Rt(n, {
4478
+ if (Lt(e)) {
4479
+ Gt("queued", o), zt(n, {
4480
4480
  question: r,
4481
4481
  options: i
4482
4482
  }, s, a, o), D.value = null;
4483
4483
  return;
4484
4484
  }
4485
- throw Wt("failed", o), g.value = Z(e, "Unable to send the poll."), e;
4485
+ throw Gt("failed", o), g.value = Z(e, "Unable to send the poll."), e;
4486
4486
  } finally {
4487
4487
  u.value = !1;
4488
4488
  }
4489
4489
  }
4490
- async function G(e, t) {
4490
+ async function W(e, t) {
4491
4491
  let n = e.poll?.id ?? e.id, r = _.value?.uid;
4492
4492
  if (!n || !t || m.value) return;
4493
- let i = Tt(e.id, e.parentMessageId) ?? e;
4493
+ let i = Et(e.id, e.parentMessageId) ?? e;
4494
4494
  if (i.poll && !i.poll.options.some((e) => e.id === t && e.voters.includes(r ?? ""))) {
4495
- g.value = null, r && Ct(Re(i, t, r));
4495
+ g.value = null, r && wt(ze(i, t, r));
4496
4496
  try {
4497
- await U.callExtension("polls", "POST", "v2/vote", {
4497
+ await H.callExtension("polls", "POST", "v2/vote", {
4498
4498
  id: n,
4499
4499
  vote: t
4500
4500
  });
4501
4501
  } catch (e) {
4502
- throw Ct(i), g.value = Z(e, "Unable to cast the vote."), e;
4502
+ throw wt(i), g.value = Z(e, "Unable to cast the vote."), e;
4503
4503
  }
4504
4504
  }
4505
4505
  }
4506
- function Re(e, t, n) {
4506
+ function ze(e, t, n) {
4507
4507
  if (!e.poll) return e;
4508
4508
  let r = e.poll, i = r.allowsMultipleAnswers, a = r.options.filter((e) => e.voters.includes(n)).map((e) => e.id), o = !i && a.length > 0, s = r.options.map((e) => o && e.voters.includes(n) && e.id !== t ? {
4509
4509
  ...e,
@@ -4523,80 +4523,80 @@ function cc({ environment: e }) {
4523
4523
  }
4524
4524
  };
4525
4525
  }
4526
- async function ze(e, t) {
4526
+ async function Be(e, t) {
4527
4527
  g.value = null;
4528
- let n = Tt(e.id, e.parentMessageId) ?? e, r = n.reactions.find((e) => e.emoji === t && e.reactedByMe);
4529
- Ct(Et(n, t));
4528
+ let n = Et(e.id, e.parentMessageId) ?? e, r = n.reactions.find((e) => e.emoji === t && e.reactedByMe);
4529
+ wt(Dt(n, t));
4530
4530
  try {
4531
- Ct(N(r ? await U.removeReaction(Number(e.id), t) : await U.addReaction(Number(e.id), t), _.value?.uid));
4531
+ wt(N(r ? await H.removeReaction(Number(e.id), t) : await H.addReaction(Number(e.id), t), _.value?.uid));
4532
4532
  } catch (e) {
4533
- throw Ct(n), g.value = Z(e, "Unable to update the reaction."), e;
4533
+ throw wt(n), g.value = Z(e, "Unable to update the reaction."), e;
4534
4534
  }
4535
4535
  }
4536
- async function Be(e) {
4536
+ async function Ve(e) {
4537
4537
  if (g.value = null, e.deliveryState === "queued" || e.deliveryState === "failed") {
4538
- kt(e);
4538
+ At(e);
4539
4539
  return;
4540
4540
  }
4541
4541
  if (!m.value) try {
4542
- let t = N(await U.deleteMessage(String(e.id)), _.value?.uid);
4543
- kt(t), At(t);
4542
+ let t = N(await H.deleteMessage(String(e.id)), _.value?.uid);
4543
+ At(t), jt(t);
4544
4544
  } catch (e) {
4545
4545
  throw g.value = Z(e, "Unable to delete the message."), e;
4546
4546
  }
4547
4547
  }
4548
- async function He(e) {
4548
+ async function Ue(e) {
4549
4549
  let t = e.source?.getText?.() ?? e.text;
4550
4550
  if (Hs(t)) {
4551
4551
  g.value = null;
4552
4552
  try {
4553
- let n = (await U.callExtension("message-translation", "POST", "v2/translate", {
4553
+ let n = (await H.callExtension("message-translation", "POST", "v2/translate", {
4554
4554
  msgId: Number(e.id),
4555
4555
  text: t,
4556
4556
  languages: typeof navigator < "u" ? navigator.languages : ["en"]
4557
4557
  })).translations?.[0]?.message_translated?.trim();
4558
4558
  if (!n) return;
4559
- wt({
4559
+ Tt({
4560
4560
  ...e,
4561
4561
  translatedText: n,
4562
4562
  metadata: {
4563
4563
  ...e.metadata ?? {},
4564
4564
  translated_message: n
4565
4565
  }
4566
- }), Ot();
4566
+ }), kt();
4567
4567
  } catch (e) {
4568
4568
  throw g.value = Z(e, "Unable to translate the message."), e;
4569
4569
  }
4570
4570
  }
4571
4571
  }
4572
- async function Ue(e) {
4573
- let t = e ?? P.value?.targetId, n = _.value?.uid, r = ++le;
4572
+ async function We(e) {
4573
+ let t = e ?? P.value?.targetId, n = _.value?.uid, r = ++ue;
4574
4574
  if (!t || !n) {
4575
- r === le && (x.value = []);
4575
+ r === ue && (x.value = []);
4576
4576
  return;
4577
4577
  }
4578
4578
  l.value = !0, g.value = null;
4579
4579
  try {
4580
- let e = new U.MessagesRequestBuilder().setLimit(50).setGUID(n).withTags(!0).setTags([t]).build(), i = [], a = [];
4580
+ let e = new H.MessagesRequestBuilder().setLimit(50).setGUID(n).withTags(!0).setTags([t]).build(), i = [], a = [];
4581
4581
  do
4582
4582
  a = await e.fetchPrevious(), i.push(...a.map((e) => N(e, _.value?.uid)));
4583
4583
  while (a.length === 50);
4584
4584
  let o = i.filter((e) => !(e.isDeleted || !e.scheduled?.scheduleDate || t && e.scheduled.originalChatUid && e.scheduled.originalChatUid !== t)).sort((e, t) => (e.scheduled?.scheduleDate?.getTime() ?? e.sentAt.getTime()) - (t.scheduled?.scheduleDate?.getTime() ?? t.sentAt.getTime()));
4585
- if (r !== le) return;
4585
+ if (r !== ue) return;
4586
4586
  x.value = o;
4587
4587
  } catch (e) {
4588
- if (r !== le) return;
4589
- throw g.value = Z(e, _t("loadScheduledMessagesError")), e;
4588
+ if (r !== ue) return;
4589
+ throw g.value = Z(e, vt("loadScheduledMessagesError")), e;
4590
4590
  } finally {
4591
- r === le && (l.value = !1);
4591
+ r === ue && (l.value = !1);
4592
4592
  }
4593
4593
  }
4594
- async function We(e, t) {
4594
+ async function Ge(e, t) {
4595
4595
  let n = P.value;
4596
4596
  if (n) {
4597
4597
  d.value = !0, g.value = null;
4598
4598
  try {
4599
- e.file ? await Mc(n, e, t) : await jc(n, e, t), await Ue(n.targetId);
4599
+ e.file ? await Mc(n, e, t) : await jc(n, e, t), await We(n.targetId);
4600
4600
  } catch (e) {
4601
4601
  throw g.value = Z(e, "Unable to schedule the message."), e;
4602
4602
  } finally {
@@ -4604,16 +4604,16 @@ function cc({ environment: e }) {
4604
4604
  }
4605
4605
  }
4606
4606
  }
4607
- async function Ge(e) {
4607
+ async function Ke(e) {
4608
4608
  if (g.value = null, !e.scheduled) return;
4609
4609
  let t = e.scheduled.originalChatUid;
4610
4610
  try {
4611
- await U.deleteMessage(String(e.id)), x.value = x.value.filter((t) => t.id !== e.id), await Ue(t);
4611
+ await H.deleteMessage(String(e.id)), x.value = x.value.filter((t) => t.id !== e.id), await We(t);
4612
4612
  } catch (e) {
4613
4613
  throw g.value = Z(e, "Unable to remove the scheduled message."), e;
4614
4614
  }
4615
4615
  }
4616
- async function Je(e, t) {
4616
+ async function Ye(e, t) {
4617
4617
  g.value = null;
4618
4618
  let n = _.value?.uid;
4619
4619
  if (!n || !e.scheduled?.muid || e.kind === "poll") return;
@@ -4623,22 +4623,22 @@ function cc({ environment: e }) {
4623
4623
  !i.scheduleDate && e.scheduled?.scheduleDate && (i.scheduleDate = e.scheduled.scheduleDate.toISOString()), !i.originalChatUid && e.scheduled?.originalChatUid && (i.originalChatUid = e.scheduled.originalChatUid), d.value = !0;
4624
4624
  try {
4625
4625
  let t;
4626
- if (e.kind === "text") t = new U.TextMessage(n, r, U.RECEIVER_TYPE.GROUP);
4626
+ if (e.kind === "text") t = new H.TextMessage(n, r, H.RECEIVER_TYPE.GROUP);
4627
4627
  else {
4628
4628
  let i = e.source?.getAttachment?.()?.getFileUrl?.() ?? e.source?.getAttachment?.()?.getUrl?.() ?? e.attachments[0]?.url ?? "";
4629
- t = new U.MediaMessage(n, i, e.source?.getType?.() ?? e.type ?? e.kind, U.RECEIVER_TYPE.GROUP), t.setCaption(r);
4629
+ t = new H.MediaMessage(n, i, e.source?.getType?.() ?? e.type ?? e.kind, H.RECEIVER_TYPE.GROUP), t.setCaption(r);
4630
4630
  }
4631
- Object.keys(i).length > 0 && t.setMetadata(i), t.setId(Number(e.id)), await U.editMessage(t), await Ue(e.scheduled.originalChatUid);
4631
+ Object.keys(i).length > 0 && t.setMetadata(i), t.setId(Number(e.id)), await H.editMessage(t), await We(e.scheduled.originalChatUid);
4632
4632
  } catch (e) {
4633
4633
  throw g.value = Z(e, "Unable to edit the scheduled message."), e;
4634
4634
  } finally {
4635
4635
  d.value = !1;
4636
4636
  }
4637
4637
  }
4638
- async function Ye(e) {
4638
+ async function Xe(e) {
4639
4639
  d.value = !0, g.value = null;
4640
4640
  try {
4641
- let t = Ac(), n = await fetch(`${K().chatApiBaseUrl}/chats/rescheduleMessage`, {
4641
+ let t = Ac(), n = await fetch(`${G().chatApiBaseUrl}/chats/rescheduleMessage`, {
4642
4642
  method: "POST",
4643
4643
  headers: {
4644
4644
  "Content-Type": "application/json",
@@ -4652,23 +4652,23 @@ function cc({ environment: e }) {
4652
4652
  })
4653
4653
  });
4654
4654
  if (!n.ok) throw Error(`Reschedule failed with status ${n.status}.`);
4655
- await Ue(e.originalChatUid);
4655
+ await We(e.originalChatUid);
4656
4656
  } catch (e) {
4657
4657
  throw g.value = Z(e, "Unable to reschedule the message."), e;
4658
4658
  } finally {
4659
4659
  d.value = !1;
4660
4660
  }
4661
4661
  }
4662
- function Xe(e) {
4663
- let t = new U.MessagesRequestBuilder().setLimit(50).hideReplies(!0).hideDeletedMessages(!0);
4662
+ function Ze(e) {
4663
+ let t = new H.MessagesRequestBuilder().setLimit(50).hideReplies(!0).hideDeletedMessages(!0);
4664
4664
  return e.type === "group" ? t.setGUID(e.targetId) : t.setUID(e.targetId), t.build();
4665
4665
  }
4666
- function Qe(e) {
4667
- return new U.MessagesRequestBuilder().setLimit(50).setParentMessageId(Number(e)).hideDeletedMessages(!0).build();
4666
+ function $e(e) {
4667
+ return new H.MessagesRequestBuilder().setLimit(50).setParentMessageId(Number(e)).hideDeletedMessages(!0).build();
4668
4668
  }
4669
- async function $e(e) {
4669
+ async function et(e) {
4670
4670
  if (!e.isOwn || e.receipts.readAt) return e;
4671
- let t = `bcc-chat:${K().appId}:message_${e.id}_receiptStatus`;
4671
+ let t = `bcc-chat:${G().appId}:message_${e.id}_receiptStatus`;
4672
4672
  try {
4673
4673
  let n = localStorage.getItem(t);
4674
4674
  if (n) {
@@ -4676,7 +4676,7 @@ function cc({ environment: e }) {
4676
4676
  if (!Number.isNaN(r.getTime()) && !Number.isNaN(i.getTime())) return e.receipts.readAt = r, e.receipts.deliveredAt = i, e;
4677
4677
  }
4678
4678
  } catch {}
4679
- let n = await bt(e);
4679
+ let n = await xt(e);
4680
4680
  for (let t of n) t.kind === "read" && t.timestamp && (!e.receipts.readAt || t.timestamp > e.receipts.readAt) && (e.receipts.readAt = t.timestamp), t.kind === "delivered" && t.timestamp && (!e.receipts.deliveredAt || t.timestamp > e.receipts.deliveredAt) && (e.receipts.deliveredAt = t.timestamp);
4681
4681
  if (e.receipts.readAt) try {
4682
4682
  localStorage.setItem(t, JSON.stringify({
@@ -4686,7 +4686,7 @@ function cc({ environment: e }) {
4686
4686
  } catch {}
4687
4687
  return e;
4688
4688
  }
4689
- async function et(e) {
4689
+ async function tt(e) {
4690
4690
  try {
4691
4691
  return await e.fetchPrevious();
4692
4692
  } catch (e) {
@@ -4694,37 +4694,37 @@ function cc({ environment: e }) {
4694
4694
  throw e;
4695
4695
  }
4696
4696
  }
4697
- async function tt(e) {
4697
+ async function nt(e) {
4698
4698
  let t = P.value;
4699
4699
  if (!t) return y.value = [], S.value = !1, !1;
4700
- if ((e?.reset || ce?.conversationId !== t.id) && (ce = {
4700
+ if ((e?.reset || le?.conversationId !== t.id) && (le = {
4701
4701
  conversationId: t.id,
4702
- request: Xe(t)
4703
- }, S.value = !0), !ce) return !1;
4704
- let n = await et(ce.request), r = await Promise.all(n.map((e) => N(e, _.value?.uid)).filter(Tc).sort(xc).map($e));
4705
- y.value = e?.reset ? Cc(y.value.filter((e) => e.conversationId === t.id && wc(e)), r) : Cc(y.value, r), S.value = n.length === 50, H?.setMessages(t.id, y.value);
4702
+ request: Ze(t)
4703
+ }, S.value = !0), !le) return !1;
4704
+ let n = await tt(le.request), r = await Promise.all(n.map((e) => N(e, _.value?.uid)).filter(Tc).sort(xc).map(et));
4705
+ y.value = e?.reset ? Cc(y.value.filter((e) => e.conversationId === t.id && wc(e)), r) : Cc(y.value, r), S.value = n.length === 50, V?.setMessages(t.id, y.value);
4706
4706
  let i = n[n.length - 1];
4707
- return i && (await yt(i), await vt(i)), n.length > 0;
4707
+ return i && (await bt(i), await yt(i)), n.length > 0;
4708
4708
  }
4709
- async function nt() {
4709
+ async function rt() {
4710
4710
  let e = P.value;
4711
4711
  if (!e) {
4712
- y.value = [], S.value = !1, ce = null;
4712
+ y.value = [], S.value = !1, le = null;
4713
4713
  return;
4714
4714
  }
4715
- let t = Te(e.id);
4716
- if (a.value = !0, m.value && H) {
4717
- S.value = !1, ce = null, a.value = !1;
4715
+ let t = Ee(e.id);
4716
+ if (a.value = !0, m.value && V) {
4717
+ S.value = !1, le = null, a.value = !1;
4718
4718
  return;
4719
4719
  }
4720
4720
  try {
4721
- await tt({ reset: !0 }), v.value = v.value.map((t) => t.id === e.id ? {
4721
+ await nt({ reset: !0 }), v.value = v.value.map((t) => t.id === e.id ? {
4722
4722
  ...t,
4723
4723
  lastMessage: y.value.at(-1) ?? null,
4724
4724
  unreadCount: 0
4725
- } : t), H?.setConversations(v.value);
4725
+ } : t), V?.setConversations(v.value);
4726
4726
  } catch (n) {
4727
- let r = H?.getMessages(e.id) ?? [];
4727
+ let r = V?.getMessages(e.id) ?? [];
4728
4728
  if (r.length > 0) {
4729
4729
  t || (y.value = r.sort(xc));
4730
4730
  return;
@@ -4734,27 +4734,27 @@ function cc({ environment: e }) {
4734
4734
  a.value = !1;
4735
4735
  }
4736
4736
  }
4737
- async function rt(e) {
4737
+ async function it(e) {
4738
4738
  let t = E.value?.id;
4739
4739
  if (!t) return b.value = [], C.value = !1, !1;
4740
- if ((e?.reset || W?.parentMessageId !== t) && (W = {
4740
+ if ((e?.reset || U?.parentMessageId !== t) && (U = {
4741
4741
  parentMessageId: t,
4742
- request: Qe(t)
4743
- }, C.value = !0), !W) return !1;
4744
- let n = await W.request.fetchPrevious(), r = await Promise.all(n.map((e) => N(e, _.value?.uid)).filter(Tc).sort(xc).map($e));
4745
- b.value = e?.reset ? Cc(b.value.filter((e) => e.parentMessageId === t && wc(e)), r) : Cc(b.value, r), C.value = n.length === 50, H?.setThreadMessages(t, b.value);
4742
+ request: $e(t)
4743
+ }, C.value = !0), !U) return !1;
4744
+ let n = await U.request.fetchPrevious(), r = await Promise.all(n.map((e) => N(e, _.value?.uid)).filter(Tc).sort(xc).map(et));
4745
+ b.value = e?.reset ? Cc(b.value.filter((e) => e.parentMessageId === t && wc(e)), r) : Cc(b.value, r), C.value = n.length === 50, V?.setThreadMessages(t, b.value);
4746
4746
  let i = n[n.length - 1];
4747
- return i && (await yt(i), await vt(i)), n.length > 0;
4747
+ return i && (await bt(i), await yt(i)), n.length > 0;
4748
4748
  }
4749
- async function it(e) {
4750
- if (o.value = !0, m.value && H) {
4751
- b.value = H.getThreadMessages(e).sort(xc), C.value = !1, W = null, o.value = !1;
4749
+ async function at(e) {
4750
+ if (o.value = !0, m.value && V) {
4751
+ b.value = V.getThreadMessages(e).sort(xc), C.value = !1, U = null, o.value = !1;
4752
4752
  return;
4753
4753
  }
4754
4754
  try {
4755
- await rt({ reset: !0 });
4755
+ await it({ reset: !0 });
4756
4756
  } catch (t) {
4757
- let n = H?.getThreadMessages(e) ?? [];
4757
+ let n = V?.getThreadMessages(e) ?? [];
4758
4758
  if (n.length > 0) {
4759
4759
  b.value = n.sort(xc);
4760
4760
  return;
@@ -4764,29 +4764,29 @@ function cc({ environment: e }) {
4764
4764
  o.value = !1;
4765
4765
  }
4766
4766
  }
4767
- async function at() {
4767
+ async function ot() {
4768
4768
  if (a.value || s.value || !S.value) return !1;
4769
4769
  s.value = !0, g.value = null;
4770
4770
  try {
4771
- return await tt();
4771
+ return await nt();
4772
4772
  } catch (e) {
4773
4773
  throw g.value = Z(e, "Unable to load messages."), e;
4774
4774
  } finally {
4775
4775
  s.value = !1;
4776
4776
  }
4777
4777
  }
4778
- async function ot() {
4778
+ async function st() {
4779
4779
  if (o.value || c.value || !C.value) return !1;
4780
4780
  c.value = !0, g.value = null;
4781
4781
  try {
4782
- return await rt();
4782
+ return await it();
4783
4783
  } catch (e) {
4784
4784
  throw g.value = Z(e, "Unable to load thread."), e;
4785
4785
  } finally {
4786
4786
  c.value = !1;
4787
4787
  }
4788
4788
  }
4789
- async function st(e) {
4789
+ async function ct(e) {
4790
4790
  let t = e.trim();
4791
4791
  if (!t) return !1;
4792
4792
  let n = () => y.value.some((e) => e.id === t) || b.value.some((e) => e.id === t) || E.value?.id === t;
@@ -4794,101 +4794,101 @@ function cc({ environment: e }) {
4794
4794
  let r = 0;
4795
4795
  for (; C.value && E.value && r < 100;) {
4796
4796
  r += 1;
4797
- let e = await ot();
4797
+ let e = await st();
4798
4798
  if (n()) return !0;
4799
4799
  if (!e) break;
4800
4800
  }
4801
4801
  for (; S.value && P.value && r < 100;) {
4802
4802
  r += 1;
4803
- let e = await at();
4803
+ let e = await ot();
4804
4804
  if (n()) return !0;
4805
4805
  if (!e) break;
4806
4806
  }
4807
4807
  return n();
4808
4808
  }
4809
- async function lt() {
4810
- let e = await U.getLoggedinUser();
4809
+ async function ut() {
4810
+ let e = await H.getLoggedinUser();
4811
4811
  _.value = e ? hc(e) : null, h.value = !!e;
4812
4812
  }
4813
- function dt() {
4814
- L ||= (U.addConnectionListener(F, new U.ConnectionListener({
4813
+ function ft() {
4814
+ te ||= (H.addConnectionListener(F, new H.ConnectionListener({
4815
4815
  onConnected: () => {
4816
- if (p.value = !0, ie = 0, ve(), V) {
4817
- Ce();
4816
+ if (p.value = !0, ie = 0, ye(), ae) {
4817
+ we();
4818
4818
  return;
4819
4819
  }
4820
- Kt();
4820
+ qt();
4821
4821
  },
4822
4822
  onDisconnected: () => {
4823
- p.value = !1, !m.value && h.value && !ae && (V = !0, xe(!0));
4823
+ p.value = !1, !m.value && h.value && !oe && (ae = !0, Se(!0));
4824
4824
  }
4825
- })), U.addMessageListener(I, new U.MessageListener({
4825
+ })), H.addMessageListener(I, new H.MessageListener({
4826
4826
  onTextMessageReceived: (e) => {
4827
- ft(e);
4827
+ pt(e);
4828
4828
  },
4829
4829
  onMediaMessageReceived: (e) => {
4830
- ft(e);
4830
+ pt(e);
4831
4831
  },
4832
4832
  onCustomMessageReceived: (e) => {
4833
- ft(e);
4833
+ pt(e);
4834
4834
  },
4835
4835
  onMessagesDelivered: () => {
4836
- be() || St({ includeThread: !1 });
4836
+ xe() || Ct({ includeThread: !1 });
4837
4837
  },
4838
4838
  onMessagesRead: () => {
4839
- be() || St({ includeThread: !1 });
4839
+ xe() || Ct({ includeThread: !1 });
4840
4840
  },
4841
4841
  onMessageEdited: (e) => {
4842
4842
  let t = N(e, _.value?.uid);
4843
- Tc(t) && (gt(t), ht(e));
4843
+ Tc(t) && (_t(t), gt(e));
4844
4844
  },
4845
4845
  onMessageDeleted: (e) => {
4846
4846
  let t = N(e, _.value?.uid);
4847
- t.parentMessageId ? kt(t) : (kt(t), At(t)), Ot();
4847
+ t.parentMessageId ? At(t) : (At(t), jt(t)), kt();
4848
4848
  },
4849
4849
  onMessageReactionAdded: () => {
4850
- St();
4850
+ Ct();
4851
4851
  },
4852
4852
  onMessageReactionRemoved: () => {
4853
- St();
4853
+ Ct();
4854
4854
  },
4855
4855
  onMessagesDeliveredToAll: () => {
4856
- be() || St({ includeThread: !1 });
4856
+ xe() || Ct({ includeThread: !1 });
4857
4857
  },
4858
4858
  onMessagesReadByAll: () => {
4859
- be() || St({ includeThread: !1 });
4859
+ xe() || Ct({ includeThread: !1 });
4860
4860
  }
4861
4861
  })), !0);
4862
4862
  }
4863
- async function ft(e) {
4863
+ async function pt(e) {
4864
4864
  let t = N(e, _.value?.uid);
4865
4865
  if (Tc(t)) {
4866
- if (ht(e), await yt(e), t.parentMessageId) {
4867
- q(t), Dt(t.parentMessageId), Ot();
4866
+ if (gt(e), await bt(e), t.parentMessageId) {
4867
+ K(t), Ot(t.parentMessageId), kt();
4868
4868
  return;
4869
4869
  }
4870
- t.conversationId === T.value && (gt(t), Ot(), await vt(e));
4870
+ t.conversationId === T.value && (_t(t), kt(), await yt(e));
4871
4871
  }
4872
4872
  }
4873
- async function pt(e) {
4873
+ async function mt(e) {
4874
4874
  return await Promise.all(e.map(async (e) => {
4875
- let t = await mt(e.targetId);
4875
+ let t = await ht(e.targetId);
4876
4876
  return {
4877
4877
  ...e,
4878
4878
  muteSettings: t ? new Date(t) : null
4879
4879
  };
4880
4880
  }));
4881
4881
  }
4882
- async function mt(e) {
4883
- let t = H?.getParticipantSettings(e), n = t?.lastUpdated ? Date.now() - t.lastUpdated > 1440 * 60 * 1e3 : !0;
4882
+ async function ht(e) {
4883
+ let t = V?.getParticipantSettings(e), n = t?.lastUpdated ? Date.now() - t.lastUpdated > 1440 * 60 * 1e3 : !0;
4884
4884
  if (t && (m.value || !n)) return t.mutedUntil;
4885
4885
  if (m.value || !h.value) return t?.mutedUntil ?? null;
4886
4886
  try {
4887
- let n = (await U.getLoggedinUser())?.getUid?.();
4887
+ let n = (await H.getLoggedinUser())?.getUid?.();
4888
4888
  if (!n || e === n) return t?.mutedUntil ?? null;
4889
- let r = Ke();
4889
+ let r = qe();
4890
4890
  if (!r) return t?.mutedUntil ?? null;
4891
- let i = await fetch(`${K().chatApiBaseUrl}/chats/${e}/settings/${n}`, {
4891
+ let i = await fetch(`${G().chatApiBaseUrl}/chats/${e}/settings/${n}`, {
4892
4892
  method: "GET",
4893
4893
  headers: {
4894
4894
  "Content-Type": "application/json",
@@ -4897,7 +4897,7 @@ function cc({ environment: e }) {
4897
4897
  });
4898
4898
  if (!i.ok) return t?.mutedUntil ?? null;
4899
4899
  let a = await i.json();
4900
- return H?.storeParticipantSettings({
4900
+ return V?.storeParticipantSettings({
4901
4901
  chatUid: e,
4902
4902
  mutedUntil: a.mutedUntil ?? null,
4903
4903
  lastUpdated: Date.now()
@@ -4906,12 +4906,12 @@ function cc({ environment: e }) {
4906
4906
  return t?.mutedUntil ?? null;
4907
4907
  }
4908
4908
  }
4909
- function ht(e) {
4909
+ function gt(e) {
4910
4910
  let t = N(e, _.value?.uid);
4911
4911
  if (!Tc(t) || t.isDeleted) return;
4912
4912
  let n = e.getConversationId(), r = v.value.find((e) => e.id === n);
4913
4913
  if (!r) {
4914
- Oe();
4914
+ ke();
4915
4915
  return;
4916
4916
  }
4917
4917
  let i = {
@@ -4921,35 +4921,35 @@ function cc({ environment: e }) {
4921
4921
  unreadCount: n === T.value ? 0 : r.unreadCount + 1,
4922
4922
  lastMessage: t
4923
4923
  };
4924
- v.value = bc(v.value.map((e) => e.id === n ? i : e)), H?.setConversations(v.value);
4924
+ v.value = bc(v.value.map((e) => e.id === n ? i : e)), V?.setConversations(v.value);
4925
4925
  }
4926
- function gt(e) {
4927
- y.value = Sc(y.value, e), T.value && H?.setMessages(T.value, y.value);
4926
+ function _t(e) {
4927
+ y.value = Sc(y.value, e), T.value && V?.setMessages(T.value, y.value);
4928
4928
  }
4929
- function q(e) {
4930
- e.parentMessageId === E.value?.id && (b.value = Sc(b.value, e), e.parentMessageId && H?.setThreadMessages(e.parentMessageId, b.value));
4929
+ function K(e) {
4930
+ e.parentMessageId === E.value?.id && (b.value = Sc(b.value, e), e.parentMessageId && V?.setThreadMessages(e.parentMessageId, b.value));
4931
4931
  }
4932
- async function vt(e) {
4932
+ async function yt(e) {
4933
4933
  if (m.value) return;
4934
4934
  let t = e.getSender?.()?.getUid?.();
4935
- !t || t === _.value?.uid || e.getReadByMeAt?.() || (ye(), await U.markAsRead(e));
4935
+ !t || t === _.value?.uid || e.getReadByMeAt?.() || (be(), await H.markAsRead(e));
4936
4936
  }
4937
- async function yt(e) {
4937
+ async function bt(e) {
4938
4938
  if (m.value) return;
4939
4939
  let t = e.getSender?.()?.getUid?.();
4940
- !t || t === _.value?.uid || e.getDeliveredToMeAt?.() || (ye(), await U.markAsDelivered(e));
4940
+ !t || t === _.value?.uid || e.getDeliveredToMeAt?.() || (be(), await H.markAsDelivered(e));
4941
4941
  }
4942
- async function bt(e) {
4943
- return m.value ? [] : pc(await U.getMessageReceipts(String(e.id)));
4942
+ async function xt(e) {
4943
+ return m.value ? [] : pc(await H.getMessageReceipts(String(e.id)));
4944
4944
  }
4945
- function xt() {
4946
- r.value = !1, i.value = !1, a.value = !1, o.value = !1, s.value = !1, c.value = !1, l.value = !1, u.value = !1, d.value = !1, f.value = !1, p.value = !1, ve(), ie = 0, V = !1, ae = !1, h.value = !1, _.value = null, v.value = [], y.value = [], b.value = [], x.value = [], E.value = null, D.value = null, O.value = null, k.value = [], T.value = null, S.value = !1, C.value = !1, ce = null, W = null, se.clear();
4945
+ function St() {
4946
+ r.value = !1, i.value = !1, a.value = !1, o.value = !1, s.value = !1, c.value = !1, l.value = !1, u.value = !1, d.value = !1, f.value = !1, p.value = !1, ye(), ie = 0, ae = !1, oe = !1, h.value = !1, _.value = null, v.value = [], y.value = [], b.value = [], x.value = [], E.value = null, D.value = null, O.value = null, k.value = [], T.value = null, S.value = !1, C.value = !1, le = null, U = null, ce.clear();
4947
4947
  }
4948
- async function St(e) {
4948
+ async function Ct(e) {
4949
4949
  if (B) return B;
4950
4950
  let t = e?.includeThread ?? !0;
4951
4951
  B = (async () => {
4952
- P.value && await nt(), t && E.value && await it(E.value.id);
4952
+ P.value && await rt(), t && E.value && await at(E.value.id);
4953
4953
  })();
4954
4954
  try {
4955
4955
  await B;
@@ -4957,20 +4957,20 @@ function cc({ environment: e }) {
4957
4957
  B = null;
4958
4958
  }
4959
4959
  }
4960
- function Ct(e) {
4961
- wt(e), e.parentMessageId && Dt(e.parentMessageId, e.replyCount), Ot();
4962
- }
4963
4960
  function wt(e) {
4961
+ Tt(e), e.parentMessageId && Ot(e.parentMessageId, e.replyCount), kt();
4962
+ }
4963
+ function Tt(e) {
4964
4964
  if (e.parentMessageId) {
4965
4965
  E.value?.id === e.parentMessageId && (b.value = Sc(b.value, e));
4966
4966
  return;
4967
4967
  }
4968
4968
  y.value = Sc(y.value, e), E.value?.id === e.id && (E.value = e);
4969
4969
  }
4970
- function Tt(e, t) {
4970
+ function Et(e, t) {
4971
4971
  return t ? b.value.find((t) => t.id === e) ?? null : E.value?.id === e ? E.value : y.value.find((t) => t.id === e) ?? null;
4972
4972
  }
4973
- function Et(e, t) {
4973
+ function Dt(e, t) {
4974
4974
  let n = e.reactions.find((e) => e.emoji === t);
4975
4975
  return n ? n.reactedByMe && n.count === 1 ? {
4976
4976
  ...e,
@@ -4991,7 +4991,7 @@ function cc({ environment: e }) {
4991
4991
  }]
4992
4992
  };
4993
4993
  }
4994
- function Dt(e, t) {
4994
+ function Ot(e, t) {
4995
4995
  let n = y.value.find((t) => t.id === e);
4996
4996
  if (!n) return;
4997
4997
  let r = {
@@ -5000,18 +5000,18 @@ function cc({ environment: e }) {
5000
5000
  };
5001
5001
  y.value = Sc(y.value, r), E.value?.id === e && (E.value = r);
5002
5002
  }
5003
- function Ot() {
5004
- T.value && H?.setMessages(T.value, y.value), E.value && H?.setThreadMessages(E.value.id, b.value);
5003
+ function kt() {
5004
+ T.value && V?.setMessages(T.value, y.value), E.value && V?.setThreadMessages(E.value.id, b.value);
5005
5005
  }
5006
- function kt(e) {
5007
- if (e.parentMessageId ? (b.value = b.value.filter((t) => t.id !== e.id), H?.setThreadMessages(e.parentMessageId, b.value)) : (y.value = y.value.filter((t) => t.id !== e.id), T.value && H?.setMessages(T.value, y.value)), e.muid) {
5006
+ function At(e) {
5007
+ if (e.parentMessageId ? (b.value = b.value.filter((t) => t.id !== e.id), V?.setThreadMessages(e.parentMessageId, b.value)) : (y.value = y.value.filter((t) => t.id !== e.id), T.value && V?.setMessages(T.value, y.value)), e.muid) {
5008
5008
  k.value = k.value.filter((t) => t.muid !== e.muid);
5009
- let t = H?.getQueue().filter((t) => t.muid === e.muid) ?? [];
5010
- for (let e of t) H?.dequeue(e.id), oe.delete(e.id), e.kind === "attachment" && H?.deleteQueuedAttachment(e.id);
5009
+ let t = V?.getQueue().filter((t) => t.muid === e.muid) ?? [];
5010
+ for (let e of t) V?.dequeue(e.id), se.delete(e.id), e.kind === "attachment" && V?.deleteQueuedAttachment(e.id);
5011
5011
  }
5012
- e.parentMessageId || jt(e.conversationId);
5012
+ e.parentMessageId || Mt(e.conversationId);
5013
5013
  }
5014
- function At(e) {
5014
+ function jt(e) {
5015
5015
  if (e.parentMessageId) return;
5016
5016
  let t = e.conversationId, n = v.value.find((e) => e.id === t);
5017
5017
  if (!n) return;
@@ -5034,28 +5034,28 @@ function cc({ environment: e }) {
5034
5034
  ...e,
5035
5035
  subtitle: "No messages yet",
5036
5036
  lastMessageAt: void 0
5037
- } : e : e)), H?.setConversations(v.value);
5037
+ } : e : e)), V?.setConversations(v.value);
5038
5038
  }
5039
- function jt(e, t) {
5039
+ function Mt(e, t) {
5040
5040
  let n = y.value.length > 0 ? y.value[y.value.length - 1] : null, r = t ?? n;
5041
5041
  v.value = bc(v.value.map((t) => t.id === e ? {
5042
5042
  ...t,
5043
5043
  subtitle: r ? Oc(r) : "No messages yet",
5044
5044
  lastMessageAt: r?.sentAt,
5045
5045
  lastMessage: r
5046
- } : t)), H?.setConversations(v.value);
5046
+ } : t)), V?.setConversations(v.value);
5047
5047
  }
5048
- function Mt(e) {
5048
+ function Nt(e) {
5049
5049
  v.value = bc(v.value.map((t) => t.id === e.conversationId ? {
5050
5050
  ...t,
5051
5051
  subtitle: Oc(e),
5052
5052
  lastMessageAt: e.sentAt,
5053
5053
  lastMessage: e,
5054
5054
  unreadCount: 0
5055
- } : t)), H?.setConversations(v.value);
5055
+ } : t)), V?.setConversations(v.value);
5056
5056
  }
5057
- function Nt(e) {
5058
- let t = /* @__PURE__ */ new Date(), n = Ft(e.metadata);
5057
+ function Pt(e) {
5058
+ let t = /* @__PURE__ */ new Date(), n = It(e.metadata);
5059
5059
  return {
5060
5060
  id: `local-${e.muid}`,
5061
5061
  muid: e.muid,
@@ -5094,11 +5094,11 @@ function cc({ environment: e }) {
5094
5094
  source: null
5095
5095
  };
5096
5096
  }
5097
- function Pt(e, t) {
5097
+ function Ft(e, t) {
5098
5098
  let n = {};
5099
5099
  return t?.senderDisplayName?.trim() && (n.senderDisplayName = t.senderDisplayName.trim()), e ? (n.replyToMessageId = e.id, n.replyPreview = Js(e), n) : n;
5100
5100
  }
5101
- function Ft(e) {
5101
+ function It(e) {
5102
5102
  let t = e.replyPreview;
5103
5103
  if (!t || typeof t != "object") return;
5104
5104
  let n = t;
@@ -5109,13 +5109,13 @@ function cc({ environment: e }) {
5109
5109
  kind: n.kind ?? "text"
5110
5110
  };
5111
5111
  }
5112
- function It(e) {
5112
+ function Lt(e) {
5113
5113
  if (typeof navigator < "u" && !navigator.onLine) return !0;
5114
5114
  let t = Z(e, "").toLowerCase();
5115
5115
  return t.includes("network") || t.includes("failed to fetch") || t.includes("socket") || t.includes("offline");
5116
5116
  }
5117
- function Lt(e, t, n, r, i) {
5118
- let a = Nt({
5117
+ function Rt(e, t, n, r, i) {
5118
+ let a = Pt({
5119
5119
  conversation: e,
5120
5120
  kind: "text",
5121
5121
  text: t,
@@ -5124,7 +5124,7 @@ function cc({ environment: e }) {
5124
5124
  muid: i,
5125
5125
  deliveryState: "queued"
5126
5126
  });
5127
- Ht(a, {
5127
+ Ut(a, {
5128
5128
  id: a.id,
5129
5129
  muid: i,
5130
5130
  conversationId: e.id,
@@ -5137,9 +5137,9 @@ function cc({ environment: e }) {
5137
5137
  createdAt: a.sentAt.toISOString()
5138
5138
  });
5139
5139
  }
5140
- function Rt(e, t, n, r, i) {
5141
- if (zt(e, t, r)) return;
5142
- let a = Nt({
5140
+ function zt(e, t, n, r, i) {
5141
+ if (Bt(e, t, r)) return;
5142
+ let a = Pt({
5143
5143
  conversation: e,
5144
5144
  kind: "poll",
5145
5145
  text: `Poll: ${t.question}`,
@@ -5149,7 +5149,7 @@ function cc({ environment: e }) {
5149
5149
  muid: i,
5150
5150
  deliveryState: "queued"
5151
5151
  });
5152
- Ht(a, {
5152
+ Ut(a, {
5153
5153
  id: a.id,
5154
5154
  muid: i,
5155
5155
  conversationId: e.id,
@@ -5162,7 +5162,7 @@ function cc({ environment: e }) {
5162
5162
  createdAt: a.sentAt.toISOString()
5163
5163
  });
5164
5164
  }
5165
- function zt(e, t, n) {
5165
+ function Bt(e, t, n) {
5166
5166
  let r = Date.now(), i = (e) => e.trim().toLowerCase(), a = (e) => e.map((e) => i(e)).filter(Boolean).join("\0"), o = i(t.question), s = a(t.options);
5167
5167
  return k.value.some((t) => {
5168
5168
  if (t.kind !== "poll" || !t.poll || t.conversationId !== e.id || t.targetId !== e.targetId || t.parentMessageId !== n) return !1;
@@ -5170,8 +5170,8 @@ function cc({ environment: e }) {
5170
5170
  return Number.isNaN(c) || r - c > 5e3 ? !1 : i(t.poll.question) === o && a(t.poll.options) === s;
5171
5171
  });
5172
5172
  }
5173
- async function Vt(e, t, n, r, i) {
5174
- let a = Nc(t.file), o = Nt({
5173
+ async function Ht(e, t, n, r, i) {
5174
+ let a = Nc(t.file), o = Pt({
5175
5175
  conversation: e,
5176
5176
  kind: a,
5177
5177
  text: t.caption?.trim() ?? "",
@@ -5203,19 +5203,19 @@ function cc({ environment: e }) {
5203
5203
  parentMessageId: r,
5204
5204
  createdAt: o.sentAt.toISOString()
5205
5205
  };
5206
- oe.set(s.id, t.file);
5206
+ se.set(s.id, t.file);
5207
5207
  try {
5208
- await H?.storeQueuedAttachment(s.id, t.file);
5208
+ await V?.storeQueuedAttachment(s.id, t.file);
5209
5209
  } catch {}
5210
- Ht(o, s);
5210
+ Ut(o, s);
5211
5211
  }
5212
- function Ht(e, t) {
5213
- k.value = [...k.value, t], H?.enqueue(t), Ut(e);
5212
+ function Ut(e, t) {
5213
+ k.value = [...k.value, t], V?.enqueue(t), Wt(e);
5214
5214
  }
5215
- function Ut(e) {
5216
- e.parentMessageId ? (E.value?.id === e.parentMessageId && (b.value = Sc(b.value, e)), Dt(e.parentMessageId)) : y.value = Sc(y.value, e), Mt(e), Ot();
5215
+ function Wt(e) {
5216
+ e.parentMessageId ? (E.value?.id === e.parentMessageId && (b.value = Sc(b.value, e)), Ot(e.parentMessageId)) : y.value = Sc(y.value, e), Nt(e), kt();
5217
5217
  }
5218
- function Wt(e, t) {
5218
+ function Gt(e, t) {
5219
5219
  let n = (n) => n.map((n) => {
5220
5220
  let r = Ec(n);
5221
5221
  return n.muid !== t && r !== t ? n : {
@@ -5223,40 +5223,40 @@ function cc({ environment: e }) {
5223
5223
  deliveryState: e
5224
5224
  };
5225
5225
  });
5226
- y.value = n(y.value), b.value = n(b.value), Ot();
5226
+ y.value = n(y.value), b.value = n(b.value), kt();
5227
5227
  }
5228
- function Gt(e) {
5228
+ function Kt(e) {
5229
5229
  if (!e) return;
5230
5230
  let t = [...y.value, ...b.value].filter((t) => {
5231
5231
  if (!t.id.startsWith("local-")) return !1;
5232
5232
  let n = Ec(t);
5233
5233
  return t.muid === e || n === e;
5234
5234
  });
5235
- for (let e of t) kt(e);
5235
+ for (let e of t) At(e);
5236
5236
  }
5237
- async function Kt() {
5237
+ async function qt() {
5238
5238
  if (!(f.value || k.value.length === 0 || !h.value || m.value)) {
5239
5239
  f.value = !0;
5240
5240
  try {
5241
- let e = [...k.value].filter((e) => !se.has(e.id)).sort((e, t) => e.createdAt.localeCompare(t.createdAt));
5242
- for (let t of e) if (!se.has(t.id)) {
5243
- se.add(t.id);
5241
+ let e = [...k.value].filter((e) => !ce.has(e.id)).sort((e, t) => e.createdAt.localeCompare(t.createdAt));
5242
+ for (let t of e) if (!ce.has(t.id)) {
5243
+ ce.add(t.id);
5244
5244
  try {
5245
- let e = await qt(t);
5246
- k.value = k.value.filter((e) => e.id !== t.id), H?.dequeue(t.id), oe.delete(t.id), t.kind === "attachment" && await H?.deleteQueuedAttachment(t.id), Gt(t.muid), e ? Ct(N(e, _.value?.uid)) : await St();
5245
+ let e = await Jt(t);
5246
+ k.value = k.value.filter((e) => e.id !== t.id), V?.dequeue(t.id), se.delete(t.id), t.kind === "attachment" && await V?.deleteQueuedAttachment(t.id), Kt(t.muid), e ? wt(N(e, _.value?.uid)) : await Ct();
5247
5247
  } finally {
5248
- se.delete(t.id);
5248
+ ce.delete(t.id);
5249
5249
  }
5250
5250
  }
5251
5251
  } catch (e) {
5252
- It(e) || (g.value = Z(e, "Unable to sync queued messages."));
5252
+ Lt(e) || (g.value = Z(e, "Unable to sync queued messages."));
5253
5253
  } finally {
5254
5254
  f.value = !1;
5255
5255
  }
5256
5256
  }
5257
5257
  }
5258
- async function qt(e) {
5259
- let t = e.receiverType === "group" ? U.RECEIVER_TYPE.GROUP : U.RECEIVER_TYPE.USER;
5258
+ async function Jt(e) {
5259
+ let t = e.receiverType === "group" ? H.RECEIVER_TYPE.GROUP : H.RECEIVER_TYPE.USER;
5260
5260
  if (e.kind === "poll" && e.poll) {
5261
5261
  let n = {
5262
5262
  question: e.poll.question,
@@ -5265,17 +5265,17 @@ function cc({ environment: e }) {
5265
5265
  receiverType: t
5266
5266
  };
5267
5267
  e.parentMessageId && (n.parentMessageId = Number(e.parentMessageId)), e.metadata && Object.keys(e.metadata).length > 0 && (n.metadata = e.metadata);
5268
- let r = await U.callExtension("polls", "POST", "v2/create", n);
5268
+ let r = await H.callExtension("polls", "POST", "v2/create", n);
5269
5269
  return r?.message ?? r?.custom_message ?? r?.data?.message ?? null;
5270
5270
  }
5271
5271
  if (e.kind === "attachment" && e.attachment) {
5272
- let n = oe.get(e.id) ?? await H?.getQueuedAttachment(e.id) ?? null;
5272
+ let n = se.get(e.id) ?? await V?.getQueuedAttachment(e.id) ?? null;
5273
5273
  if (!n) throw Error(`Queued attachment ${e.attachment.name} is no longer available for upload.`);
5274
- let r = new U.MediaMessage(e.targetId, n, e.attachment.kind, t);
5275
- return r.setMuid?.(e.muid), e.metadata && Object.keys(e.metadata).length > 0 && r.setMetadata?.(e.metadata), e.parentMessageId && r.setParentMessageId?.(Number(e.parentMessageId)), e.attachment.caption && r.setCaption?.(e.attachment.caption), U.sendMediaMessage(r);
5274
+ let r = new H.MediaMessage(e.targetId, n, e.attachment.kind, t);
5275
+ return r.setMuid?.(e.muid), e.metadata && Object.keys(e.metadata).length > 0 && r.setMetadata?.(e.metadata), e.parentMessageId && r.setParentMessageId?.(Number(e.parentMessageId)), e.attachment.caption && r.setCaption?.(e.attachment.caption), H.sendMediaMessage(r);
5276
5276
  }
5277
- let n = new U.TextMessage(e.targetId, e.text ?? "", t);
5278
- return n.setMuid?.(e.muid), e.metadata && Object.keys(e.metadata).length > 0 && n.setMetadata?.(e.metadata), e.parentMessageId && n.setParentMessageId?.(Number(e.parentMessageId)), U.sendMessage(n);
5277
+ let n = new H.TextMessage(e.targetId, e.text ?? "", t);
5278
+ return n.setMuid?.(e.muid), e.metadata && Object.keys(e.metadata).length > 0 && n.setMetadata?.(e.metadata), e.parentMessageId && n.setParentMessageId?.(Number(e.parentMessageId)), H.sendMessage(n);
5279
5279
  }
5280
5280
  return {
5281
5281
  initialized: t,
@@ -5306,69 +5306,69 @@ function cc({ environment: e }) {
5306
5306
  activeThreadParentMessage: E,
5307
5307
  replyToMessage: D,
5308
5308
  editingMessage: O,
5309
- init: ue,
5310
- connectRealtime: Ee,
5311
- disconnectRealtime: De,
5312
- login: de,
5313
- logout: fe,
5314
- fetchConversations: Oe,
5315
- selectConversation: ke,
5316
- sendTextMessage: Pe,
5317
- sendAttachmentMessage: Ie,
5318
- sendPollMessage: Le,
5319
- fetchScheduledMessages: Ue,
5320
- loadOlderMessages: at,
5321
- loadOlderThreadMessages: ot,
5322
- ensureMessageLoaded: st,
5323
- scheduleMessage: We,
5324
- rescheduleMessage: Ye,
5325
- removeScheduledMessage: Ge,
5326
- editScheduledMessage: Je,
5327
- setReplyToMessage: Ae,
5328
- setEditingMessage: je,
5329
- openThread: Me,
5330
- closeThread: Ne,
5331
- refreshVisibleMessages: St,
5332
- fetchMessageReceipts: bt,
5333
- deleteMessage: Be,
5334
- votePoll: G,
5335
- toggleReaction: ze,
5336
- translateMessage: He,
5309
+ init: de,
5310
+ connectRealtime: De,
5311
+ disconnectRealtime: Oe,
5312
+ login: fe,
5313
+ logout: pe,
5314
+ fetchConversations: ke,
5315
+ selectConversation: Ae,
5316
+ sendTextMessage: Fe,
5317
+ sendAttachmentMessage: Le,
5318
+ sendPollMessage: Re,
5319
+ fetchScheduledMessages: We,
5320
+ loadOlderMessages: ot,
5321
+ loadOlderThreadMessages: st,
5322
+ ensureMessageLoaded: ct,
5323
+ scheduleMessage: Ge,
5324
+ rescheduleMessage: Xe,
5325
+ removeScheduledMessage: Ke,
5326
+ editScheduledMessage: Ye,
5327
+ setReplyToMessage: je,
5328
+ setEditingMessage: Me,
5329
+ openThread: Ne,
5330
+ closeThread: Pe,
5331
+ refreshVisibleMessages: Ct,
5332
+ fetchMessageReceipts: xt,
5333
+ deleteMessage: Ve,
5334
+ votePoll: W,
5335
+ toggleReaction: Be,
5336
+ translateMessage: Ue,
5337
5337
  mentionDisplayNamesByUid: A,
5338
5338
  rememberMentionDisplayNames: M
5339
5339
  };
5340
5340
  }
5341
5341
  async function lc(e) {
5342
- return Ve(e), oc === e && sc || (sc = (async () => {
5343
- let t = K(), n = new U.AppSettingsBuilder().subscribePresenceForAllUsers().setRegion(t.region).autoEstablishSocketConnection(!0).setStorageMode(U.StorageMode.SESSION).build();
5344
- await U.init(t.appId, n), oc = e;
5342
+ return He(e), oc === e && sc || (sc = (async () => {
5343
+ let t = G(), n = new H.AppSettingsBuilder().subscribePresenceForAllUsers().setRegion(t.region).autoEstablishSocketConnection(!0).setStorageMode(H.StorageMode.SESSION).build();
5344
+ await H.init(t.appId, n), oc = e;
5345
5345
  })()), sc;
5346
5346
  }
5347
5347
  async function uc(e) {
5348
5348
  let t = JSON.parse(atob(e.split(".")[1]));
5349
5349
  if (!t.sub) throw Error("Cannot read JWT subject from access token.");
5350
- let n = Je();
5350
+ let n = Ye();
5351
5351
  if (n && n.sub === t.sub && n.token) return n.token;
5352
- let r = await fetch(`${K().chatApiBaseUrl}/chats/token`, {
5352
+ let r = await fetch(`${G().chatApiBaseUrl}/chats/token`, {
5353
5353
  method: "POST",
5354
5354
  headers: new Headers([["Authorization", `Bearer ${e}`]])
5355
5355
  });
5356
- if (r.status === 401) throw qe(null), Ze(), Error("Unauthorized while fetching CometChat token.");
5356
+ if (r.status === 401) throw Je(null), Qe(), Error("Unauthorized while fetching CometChat token.");
5357
5357
  if (!r.ok) throw Error(`Token exchange failed with status ${r.status}.`);
5358
5358
  let i = await r.json();
5359
- return Xe({
5359
+ return Ze({
5360
5360
  sub: t.sub,
5361
5361
  token: i.token
5362
5362
  }), i.token;
5363
5363
  }
5364
5364
  function dc(e, t) {
5365
- let n = e.getConversationWith(), r = e.getConversationType() === U.RECEIVER_TYPE.GROUP ? "group" : "user", i = r === "user" ? n : null, a = r === "group" ? n : null, o = r === "group" ? a.getGuid() : i.getUid(), s = e.getLastMessage(), c = t ? `group_${t}` : null;
5365
+ let n = e.getConversationWith(), r = e.getConversationType() === H.RECEIVER_TYPE.GROUP ? "group" : "user", i = r === "user" ? n : null, a = r === "group" ? n : null, o = r === "group" ? a.getGuid() : i.getUid(), s = e.getLastMessage(), c = t ? `group_${t}` : null;
5366
5366
  if (c && e.getConversationId() === c) return {
5367
5367
  id: e.getConversationId(),
5368
5368
  targetId: o,
5369
5369
  type: r,
5370
- title: _t("scheduledMessages"),
5371
- subtitle: _t("hiddenHelperConversation"),
5370
+ title: vt("scheduledMessages"),
5371
+ subtitle: vt("hiddenHelperConversation"),
5372
5372
  hasJoined: !0,
5373
5373
  unreadCount: 0,
5374
5374
  tags: [],
@@ -5381,7 +5381,7 @@ function dc(e, t) {
5381
5381
  type: r,
5382
5382
  title: n.getName() ?? o,
5383
5383
  subtitle: l && Tc(l) && !l.isDeleted ? Oc(l) : "No messages yet",
5384
- avatar: i ? Qe(i.getAvatar()) : void 0,
5384
+ avatar: i ? $e(i.getAvatar()) : void 0,
5385
5385
  unreadCount: Number.isFinite(u) ? u : 0,
5386
5386
  hasJoined: a?.getHasJoined() ?? !0,
5387
5387
  lastMessageAt: s && !l?.isDeleted ? /* @__PURE__ */ new Date((s.getSentAt?.() ?? 0) * 1e3) : void 0,
@@ -5441,7 +5441,7 @@ function hc(e) {
5441
5441
  return {
5442
5442
  uid: e.getUid(),
5443
5443
  name: e.getName?.() ?? e.getUid(),
5444
- avatar: Qe(e.getAvatar?.()),
5444
+ avatar: $e(e.getAvatar?.()),
5445
5445
  status: e.getStatus?.() ?? void 0
5446
5446
  };
5447
5447
  }
@@ -5461,7 +5461,7 @@ function vc(e, t) {
5461
5461
  let n = e.getType?.(), r = e.getCategory?.(), i = el(e);
5462
5462
  if (String(r).toLowerCase() === "action") return Uc(e);
5463
5463
  if (i) return `Poll: ${i.question}`;
5464
- if (n === U.MESSAGE_TYPE.TEXT || typeof e.getText == "function") {
5464
+ if (n === H.MESSAGE_TYPE.TEXT || typeof e.getText == "function") {
5465
5465
  let t = Us(e.getText());
5466
5466
  if (t) return t;
5467
5467
  }
@@ -5469,14 +5469,14 @@ function vc(e, t) {
5469
5469
  let t = Yc(e, Kc(e))[0];
5470
5470
  return e.getCaption?.()?.trim?.() || zs(t ? [t] : [], "Sent an attachment");
5471
5471
  }
5472
- return e.getSender?.()?.getUid?.() === t ? _t("youSentAMessage") : _t("unsupportedMessageType");
5472
+ return e.getSender?.()?.getUid?.() === t ? vt("youSentAMessage") : vt("unsupportedMessageType");
5473
5473
  }
5474
5474
  function yc(e, t) {
5475
5475
  if (e.getDeletedAt?.()) return "Message removed";
5476
5476
  let n = e.getType?.(), r = e.getCategory?.(), i = el(e);
5477
5477
  if (String(r).toLowerCase() === "action") return Uc(e);
5478
5478
  if (i) return `Poll: ${i.question}`;
5479
- if (n === U.MESSAGE_TYPE.TEXT || typeof e.getText == "function") {
5479
+ if (n === H.MESSAGE_TYPE.TEXT || typeof e.getText == "function") {
5480
5480
  let t = Bs(e.getText?.());
5481
5481
  if (Hs(t)) return t;
5482
5482
  }
@@ -5486,10 +5486,10 @@ function yc(e, t) {
5486
5486
  let n = Yc(e, Kc(e))[0];
5487
5487
  return zs(n ? [n] : [], "Sent an attachment");
5488
5488
  }
5489
- return e.getSender?.()?.getUid?.() === t ? _t("youSentAMessage") : _t("unsupportedMessageType");
5489
+ return e.getSender?.()?.getUid?.() === t ? vt("youSentAMessage") : vt("unsupportedMessageType");
5490
5490
  }
5491
5491
  function bc(e) {
5492
- return [...e].filter((e) => e.title !== _t("scheduledMessages")).sort((e, t) => {
5492
+ return [...e].filter((e) => e.title !== vt("scheduledMessages")).sort((e, t) => {
5493
5493
  let n = e.lastMessageAt?.getTime() ?? 0;
5494
5494
  return (t.lastMessageAt?.getTime() ?? 0) - n;
5495
5495
  });
@@ -5525,20 +5525,23 @@ function Oc(e) {
5525
5525
  return Zs(e);
5526
5526
  }
5527
5527
  function Z(e, t) {
5528
- return e instanceof Error && e.message ? e.message : t;
5528
+ return console.warn("BCC Chat: an error occurred", {
5529
+ error: e,
5530
+ fallbackMessage: t
5531
+ }), e instanceof Error && e.message ? e.message : t;
5529
5532
  }
5530
5533
  function kc(e) {
5531
- return e.type === "group" ? U.RECEIVER_TYPE.GROUP : U.RECEIVER_TYPE.USER;
5534
+ return e.type === "group" ? H.RECEIVER_TYPE.GROUP : H.RECEIVER_TYPE.USER;
5532
5535
  }
5533
5536
  function Ac() {
5534
- let e = Ke();
5537
+ let e = qe();
5535
5538
  if (!e) throw Error("Missing access token.");
5536
5539
  return e;
5537
5540
  }
5538
5541
  async function jc(e, t, n) {
5539
5542
  let r = t.text?.trim();
5540
5543
  if (!r) return;
5541
- let i = Ac(), a = await fetch(`${K().chatApiBaseUrl}/chats/scheduledMessages`, {
5544
+ let i = Ac(), a = await fetch(`${G().chatApiBaseUrl}/chats/scheduledMessages`, {
5542
5545
  method: "POST",
5543
5546
  headers: {
5544
5547
  "Content-Type": "application/json",
@@ -5558,9 +5561,9 @@ async function jc(e, t, n) {
5558
5561
  }
5559
5562
  async function Mc(e, t, n) {
5560
5563
  if (!t.file) return;
5561
- let r = Ac(), i = Je()?.token;
5564
+ let r = Ac(), i = Ye()?.token;
5562
5565
  if (!i) throw Error("Missing CometChat auth token.");
5563
- let a = Pc(t.file), o = t.caption?.trim() ?? "", s = Fc(e, t.file, a, o, t.scheduleDate, n), c = await fetch(`${K().chatApiBaseUrl}/chats/scheduledMediaMessages`, {
5566
+ let a = Pc(t.file), o = t.caption?.trim() ?? "", s = Fc(e, t.file, a, o, t.scheduleDate, n), c = await fetch(`${G().chatApiBaseUrl}/chats/scheduledMediaMessages`, {
5564
5567
  method: "POST",
5565
5568
  headers: {
5566
5569
  Accept: "multipart/form-data",
@@ -5581,7 +5584,7 @@ function Pc(e) {
5581
5584
  return t;
5582
5585
  }
5583
5586
  function Fc(e, t, n, r, i, a) {
5584
- let o = new U.MediaMessage(e.targetId, t, n, kc(e));
5587
+ let o = new H.MediaMessage(e.targetId, t, n, kc(e));
5585
5588
  return o.setSentAt(Math.floor(Date.now() / 1e3)), o.setMuid(globalThis.crypto?.randomUUID?.() ?? `${Date.now()}-${t.name}`), r && o.setCaption(r), o.setMetadata({
5586
5589
  scheduleDate: i,
5587
5590
  file: t,
@@ -5614,11 +5617,11 @@ function Rc(e, t) {
5614
5617
  return typeof n == "string" && n.trim() ? n.trim() : e?.getName?.() ?? "System";
5615
5618
  }
5616
5619
  function zc(e, t) {
5617
- return Qe(Vc(t)) || (Bc(e, "sender") ?? void 0);
5620
+ return $e(Vc(t)) || (Bc(e, "sender") ?? void 0);
5618
5621
  }
5619
5622
  function Bc(e, t) {
5620
5623
  let n = ol(e)?.entities?.[t]?.entity;
5621
- return Qe(Vc(n));
5624
+ return $e(Vc(n));
5622
5625
  }
5623
5626
  function Vc(e) {
5624
5627
  if (!e || typeof e != "object") return e;
@@ -5866,9 +5869,9 @@ function ll(e, t) {
5866
5869
  let n = t?.value?.getMetadata?.() ?? {};
5867
5870
  if (!e?.getSender?.() || n.isChannel) return "";
5868
5871
  let r = e?.getData?.()?.entities?.receiver?.entity?.scope, i = e?.getReceiver?.()?.getMetadata?.() ?? {};
5869
- e instanceof U.Action && (i = e?.getActionFor?.()?.getMetadata?.() ?? {});
5872
+ e instanceof H.Action && (i = e?.getActionFor?.()?.getMetadata?.() ?? {});
5870
5873
  let a = i.systemDisplayName;
5871
- return e?.getData?.()?.metadata?.senderDisplayName && (r == "moderator" || r === void 0) ? e.getData().metadata.senderDisplayName : a && (e instanceof U.Action || r == "admin") ? a : e?.getSender?.()?.getName?.();
5874
+ return e?.getData?.()?.metadata?.senderDisplayName && (r == "moderator" || r === void 0) ? e.getData().metadata.senderDisplayName : a && (e instanceof H.Action || r == "admin") ? a : e?.getSender?.()?.getName?.();
5872
5875
  }
5873
5876
  function ul(e, t = 25, n) {
5874
5877
  let r = e.trim();
@@ -5891,7 +5894,7 @@ function ul(e, t = 25, n) {
5891
5894
  };
5892
5895
  }
5893
5896
  async function dl(e) {
5894
- let t = new U.GroupMembersRequestBuilder(e).setLimit(50).build(), n = !0, r = [];
5897
+ let t = new H.GroupMembersRequestBuilder(e).setLimit(50).build(), n = !0, r = [];
5895
5898
  try {
5896
5899
  for (; n;) {
5897
5900
  let e = await t.fetchNext();
@@ -5910,7 +5913,7 @@ async function dl(e) {
5910
5913
  }
5911
5914
  async function fl(e) {
5912
5915
  await Sl("failed to get muted setting. User not logged in");
5913
- let t = await Cl(`${K().chatApiBaseUrl}/chats/${e}/settings/${(await U.getLoggedinUser())?.getUid?.()}`, { method: "GET" });
5916
+ let t = await Cl(`${G().chatApiBaseUrl}/chats/${e}/settings/${(await H.getLoggedinUser())?.getUid?.()}`, { method: "GET" });
5914
5917
  return yl()?.storeParticipantSettings({
5915
5918
  chatUid: e,
5916
5919
  mutedUntil: t.mutedUntil,
@@ -5919,7 +5922,7 @@ async function fl(e) {
5919
5922
  }
5920
5923
  async function pl(e, t) {
5921
5924
  await Sl("failed to mute chat. User not logged in");
5922
- let n = await Cl(`${K().chatApiBaseUrl}/chats/${e}/settings/${(await U.getLoggedinUser())?.getUid?.()}`, {
5925
+ let n = await Cl(`${G().chatApiBaseUrl}/chats/${e}/settings/${(await H.getLoggedinUser())?.getUid?.()}`, {
5923
5926
  method: "PATCH",
5924
5927
  body: JSON.stringify({ mutedUntil: t })
5925
5928
  });
@@ -5930,10 +5933,10 @@ async function pl(e, t) {
5930
5933
  }), n.mutedUntil;
5931
5934
  }
5932
5935
  async function ml() {
5933
- return await Sl("failed to get muted all setting. User not logged in"), Cl(`${K().chatApiBaseUrl}/person/settings`, { method: "GET" });
5936
+ return await Sl("failed to get muted all setting. User not logged in"), Cl(`${G().chatApiBaseUrl}/person/settings`, { method: "GET" });
5934
5937
  }
5935
5938
  async function hl(e) {
5936
- return await Sl("failed to update person settings. User not logged in"), Cl(`${K().chatApiBaseUrl}/person/settings`, {
5939
+ return await Sl("failed to update person settings. User not logged in"), Cl(`${G().chatApiBaseUrl}/person/settings`, {
5937
5940
  method: "PATCH",
5938
5941
  body: JSON.stringify(e)
5939
5942
  });
@@ -5958,19 +5961,19 @@ function yl() {
5958
5961
  return e ? new $s(e) : null;
5959
5962
  }
5960
5963
  function bl() {
5961
- let e = ct();
5962
- return e ? `bcc-chat:${K().appId}:${e}` : null;
5964
+ let e = lt();
5965
+ return e ? `bcc-chat:${G().appId}:${e}` : null;
5963
5966
  }
5964
5967
  function xl() {
5965
- return U.__bccCompatLoggedInUser ?? null;
5968
+ return H.__bccCompatLoggedInUser ?? null;
5966
5969
  }
5967
5970
  async function Sl(e) {
5968
- let t = await U.getLoggedinUser();
5969
- if (U.__bccCompatLoggedInUser = t ?? null, !t?.getUid?.()) throw Error(e);
5971
+ let t = await H.getLoggedinUser();
5972
+ if (H.__bccCompatLoggedInUser = t ?? null, !t?.getUid?.()) throw Error(e);
5970
5973
  return t;
5971
5974
  }
5972
5975
  async function Cl(e, t) {
5973
- let n = Ke();
5976
+ let n = qe();
5974
5977
  if (!n) throw Error("Missing access token.");
5975
5978
  let r = await fetch(e, {
5976
5979
  ...t,
@@ -6034,7 +6037,7 @@ function Vl(e) {
6034
6037
  if (Q.value && !e && !Al.value) return Q.value;
6035
6038
  let t = e ?? Al.value;
6036
6039
  if (!t) throw Error("Environment has not been set yet. Call app.use(chat, { environment: ... }) first.");
6037
- return (!Q.value || Al.value !== t) && (Al.value = t, Ve(t), Q.value = cc({ environment: t })), Q.value;
6040
+ return (!Q.value || Al.value !== t) && (Al.value = t, He(t), Q.value = cc({ environment: t })), Q.value;
6038
6041
  }
6039
6042
  var Hl = n(() => Q.value?.currentUser.value?.uid);
6040
6043
  function Ul(e) {
@@ -6049,7 +6052,7 @@ async function Wl(e) {
6049
6052
  if (!Ll.has(e)) {
6050
6053
  Ll.add(e);
6051
6054
  try {
6052
- let t = await U.getMessageReceipts(e);
6055
+ let t = await H.getMessageReceipts(e);
6053
6056
  Il.value = {
6054
6057
  ...Il.value,
6055
6058
  [e]: Ul(t)
@@ -6108,17 +6111,17 @@ F([() => Q.value?.conversations.value, () => Hl.value], async () => {
6108
6111
  Il.value = {}, Ll.clear();
6109
6112
  });
6110
6113
  async function Ql(e, t) {
6111
- Pl.value = t.loggerCallback, gt(t.language ?? "en"), Bl(t.themeMode);
6114
+ Pl.value = t.loggerCallback, _t(t.language ?? "en"), Bl(t.themeMode);
6112
6115
  let n = e.config.globalProperties.$primevue;
6113
6116
  n && (n.config.ripple = !0, n.config.inputVariant = "filled"), e.component("BccChat", vh), e.component("BccChatMessageList", vh), e.provide("theme", { theme: El });
6114
6117
  let r = Vl(t.environment);
6115
6118
  zl(Ol.INFO, "Initializing chat", {
6116
6119
  environment: t.environment,
6117
- language: ft.value,
6120
+ language: pt.value,
6118
6121
  themeMode: t.themeMode
6119
6122
  }), await r.init(), kl.value = !0, Rl?.(), p(t.accessToken) ? Rl = F(t.accessToken, async (e) => {
6120
6123
  e ? await $l(e) : await eu();
6121
- }, { immediate: !0 }) : t.accessToken && await $l(t.accessToken), zl(Ol.INFO, "Chat initialized", { environment: K().appId });
6124
+ }, { immediate: !0 }) : t.accessToken && await $l(t.accessToken), zl(Ol.INFO, "Chat initialized", { environment: G().appId });
6122
6125
  }
6123
6126
  async function $l(e) {
6124
6127
  if (!e) return eu();
@@ -6146,7 +6149,7 @@ function iu(e) {
6146
6149
  Ml.value = e;
6147
6150
  }
6148
6151
  function au(e) {
6149
- gt(e);
6152
+ _t(e);
6150
6153
  }
6151
6154
  function ou(e) {
6152
6155
  Bl(e);
@@ -6160,7 +6163,7 @@ function cu(e) {
6160
6163
  async function lu(e, t = !1) {
6161
6164
  if (!Jl.value) return null;
6162
6165
  try {
6163
- return await U.getGroup(e);
6166
+ return await H.getGroup(e);
6164
6167
  } catch (e) {
6165
6168
  if (e && typeof e == "object" && "code" in e && e.code === "ERR_GUID_NOT_FOUND") return;
6166
6169
  if (t) throw e;
@@ -6177,7 +6180,7 @@ async function du(e) {
6177
6180
  }
6178
6181
  async function fu(e) {
6179
6182
  try {
6180
- return Jl.value && (await U.getOnlineGroupMemberCount([e]))[e] || 0;
6183
+ return Jl.value && (await H.getOnlineGroupMemberCount([e]))[e] || 0;
6181
6184
  } catch {
6182
6185
  return 0;
6183
6186
  }
@@ -6209,7 +6212,7 @@ var gu = {
6209
6212
  login: $l,
6210
6213
  logout: eu,
6211
6214
  setCurrentEnvironment: cu,
6212
- getCurrentEnvironment: K,
6215
+ getCurrentEnvironment: G,
6213
6216
  setThemeMode: ou,
6214
6217
  setLanguage: au,
6215
6218
  getGroup: lu,
@@ -6221,7 +6224,7 @@ var gu = {
6221
6224
  searchChat: (e, t = 25) => ul(e, t, Q.value?.currentUser.value?.uid),
6222
6225
  getSenderDisplayName: ll,
6223
6226
  getMessageTextPreview: qs,
6224
- proxyImage: $e,
6227
+ proxyImage: et,
6225
6228
  getMutedUntil: mu,
6226
6229
  muteChat: pu,
6227
6230
  getMyChatSettings: ml,
@@ -6229,7 +6232,7 @@ var gu = {
6229
6232
  setMuteAll: gl,
6230
6233
  toggleMuteAll: _l,
6231
6234
  toMarkdownHtml: ks,
6232
- retrieveCcToken: Ye,
6235
+ retrieveCcToken: Xe,
6233
6236
  getChatMessages: Ml,
6234
6237
  scrollToMessageId: Nl,
6235
6238
  scrollToMessage: hu,
@@ -6238,7 +6241,7 @@ var gu = {
6238
6241
  onlineStatus: Yl.onlineStatus,
6239
6242
  theme: El,
6240
6243
  themeMode: jl,
6241
- language: ft
6244
+ language: pt
6242
6245
  };
6243
6246
  //#endregion
6244
6247
  //#region src/chat/conversationState.ts
@@ -6289,7 +6292,7 @@ function Ou(e) {
6289
6292
  uid: t.targetId,
6290
6293
  displayName: t.title,
6291
6294
  avatar: t.avatar
6292
- }] : a.filter((e) => e.uid !== n).map(Tt) : [];
6295
+ }] : a.filter((e) => e.uid !== n).map(Et) : [];
6293
6296
  });
6294
6297
  return {
6295
6298
  client: t,
@@ -6303,7 +6306,7 @@ function Ou(e) {
6303
6306
  isChannel: u,
6304
6307
  sendOptions: d,
6305
6308
  mentionCandidates: f,
6306
- mentionNameByUid: n(() => Vt(Et(f.value), t.value?.mentionDisplayNamesByUid.value ?? {}))
6309
+ mentionNameByUid: n(() => Ht(Dt(f.value), t.value?.mentionDisplayNamesByUid.value ?? {}))
6307
6310
  };
6308
6311
  }
6309
6312
  var ku = Symbol("conversationCtx");
@@ -6688,10 +6691,10 @@ function Qu(e) {
6688
6691
  return;
6689
6692
  }
6690
6693
  try {
6691
- t.value = (await new U.GroupMembersRequestBuilder(n).setLimit(50).build().fetchNext() ?? []).map((e) => ({
6694
+ t.value = (await new H.GroupMembersRequestBuilder(n).setLimit(50).build().fetchNext() ?? []).map((e) => ({
6692
6695
  uid: e.getUid(),
6693
6696
  displayName: e.getName(),
6694
- avatar: Qe(e.getAvatar?.()) ?? "",
6697
+ avatar: $e(e.getAvatar?.()) ?? "",
6695
6698
  role: e.getScope()
6696
6699
  })), e.onMembersChanged(t.value);
6697
6700
  } catch {
@@ -6704,8 +6707,8 @@ function Qu(e) {
6704
6707
  let c = {
6705
6708
  uid: r.getUid(),
6706
6709
  displayName: r.getName(),
6707
- avatar: Qe(r.getAvatar?.()) ?? "",
6708
- role: a ?? r.getScope?.() ?? U.GROUP_MEMBER_SCOPE.PARTICIPANT
6710
+ avatar: $e(r.getAvatar?.()) ?? "",
6711
+ role: a ?? r.getScope?.() ?? H.GROUP_MEMBER_SCOPE.PARTICIPANT
6709
6712
  };
6710
6713
  i === "add" ? t.value.some((e) => e.uid === c.uid) || (t.value = [...t.value, c]) : i === "remove" ? t.value = t.value.filter((e) => e.uid !== c.uid) : t.value = t.value.map((e) => e.uid === c.uid ? {
6711
6714
  ...e,
@@ -6713,7 +6716,7 @@ function Qu(e) {
6713
6716
  } : e), e.onMembersChanged(t.value);
6714
6717
  }
6715
6718
  return b(() => {
6716
- U.addGroupListener(n, new U.GroupListener({
6719
+ H.addGroupListener(n, new H.GroupListener({
6717
6720
  onGroupMemberScopeChanged: (e, t, n, r, a) => {
6718
6721
  i(a, t, "update", n);
6719
6722
  },
@@ -6737,7 +6740,7 @@ function Qu(e) {
6737
6740
  }
6738
6741
  }));
6739
6742
  }), x(() => {
6740
- U.removeGroupListener(n);
6743
+ H.removeGroupListener(n);
6741
6744
  }), {
6742
6745
  groupMembers: t,
6743
6746
  fetchGroupMembers: r
@@ -6820,7 +6823,7 @@ function id(e) {
6820
6823
  triggerChar: "@",
6821
6824
  enabled: e.enabled,
6822
6825
  maxSuggestions: e.maxSuggestions ?? 8,
6823
- getCandidates: (t) => Dt(e.getMentionCandidates(), t, e.maxSuggestions ?? 8).map((e) => ({
6826
+ getCandidates: (t) => Ot(e.getMentionCandidates(), t, e.maxSuggestions ?? 8).map((e) => ({
6824
6827
  id: e.uid,
6825
6828
  label: e.displayName,
6826
6829
  avatar: e.avatar
@@ -6990,7 +6993,7 @@ function ud(e, t, r, i) {
6990
6993
  }, { deep: !0 });
6991
6994
  function C(e) {
6992
6995
  let t = Es(e);
6993
- return t.includes("<@uid:") ? Es(Pt(t, i.getMentionNameByUid?.() ?? {})) : t;
6996
+ return t.includes("<@uid:") ? Es(Ft(t, i.getMentionNameByUid?.() ?? {})) : t;
6994
6997
  }
6995
6998
  F(() => i.getModelValue(), (e) => {
6996
6999
  let n = t.value, r = C(e);
@@ -7083,21 +7086,21 @@ function ud(e, t, r, i) {
7083
7086
  function I(e) {
7084
7087
  x(e), D();
7085
7088
  }
7086
- function L() {
7089
+ function te() {
7087
7090
  k() || O();
7088
7091
  }
7089
- function R() {
7092
+ function L() {
7090
7093
  o.value += 1, O(), g(), l.value = "", i.updateModelValue("");
7091
7094
  }
7092
7095
  return b(() => {
7093
- document.addEventListener("pointerdown", P), document.addEventListener("selectionchange", L), h(() => {
7096
+ document.addEventListener("pointerdown", P), document.addEventListener("selectionchange", te), h(() => {
7094
7097
  if (t.value) {
7095
7098
  let e = C(i.getModelValue());
7096
7099
  t.value.innerHTML = e, T(t.value), e ? delete t.value.dataset.empty : t.value.dataset.empty = "true", l.value = e;
7097
7100
  }
7098
7101
  });
7099
7102
  }), y(() => {
7100
- document.removeEventListener("pointerdown", P), document.removeEventListener("selectionchange", L);
7103
+ document.removeEventListener("pointerdown", P), document.removeEventListener("selectionchange", te);
7101
7104
  }), {
7102
7105
  applyFormat: A,
7103
7106
  editorKey: o,
@@ -7108,7 +7111,7 @@ function ud(e, t, r, i) {
7108
7111
  handleKeydown: M,
7109
7112
  handlePaste: ee,
7110
7113
  hideFormatMenu: O,
7111
- resetEditor: R,
7114
+ resetEditor: L,
7112
7115
  showFormatMenu: s,
7113
7116
  triggerCandidates: d,
7114
7117
  triggerMenuPosition: f,
@@ -7123,29 +7126,29 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7123
7126
  __name: "ComposerActionsPopover",
7124
7127
  emits: ["pickFile", "openPoll"],
7125
7128
  setup(t, { expose: n, emit: i }) {
7126
- let s = i, c = w(!1), l = w(null), { t: u } = q(), d = typeof navigator < "u" && (/iPad|iPhone|iPod/.test(navigator.userAgent) || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1), f = [
7129
+ let s = i, c = w(!1), l = w(null), { t: u } = K(), d = typeof navigator < "u" && (/iPad|iPhone|iPod/.test(navigator.userAgent) || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1), f = [
7127
7130
  {
7128
7131
  kind: "image",
7129
7132
  label: "attachImage",
7130
- icon: Ce,
7133
+ icon: we,
7131
7134
  testId: "composer-attach-image"
7132
7135
  },
7133
7136
  {
7134
7137
  kind: "video",
7135
7138
  label: "attachVideo",
7136
- icon: Le,
7139
+ icon: Re,
7137
7140
  testId: "composer-attach-video"
7138
7141
  },
7139
7142
  {
7140
7143
  kind: "audio",
7141
7144
  label: "attachAudio",
7142
- icon: De,
7145
+ icon: Oe,
7143
7146
  testId: "composer-attach-audio"
7144
7147
  },
7145
7148
  {
7146
7149
  kind: "file",
7147
7150
  label: "attachFile",
7148
- icon: ce,
7151
+ icon: le,
7149
7152
  testId: "composer-attach-file"
7150
7153
  }
7151
7154
  ];
@@ -7173,7 +7176,7 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7173
7176
  }), n({
7174
7177
  toggle: p,
7175
7178
  hide: m
7176
- }), (t, n) => L((S(), a("div", {
7179
+ }), (t, n) => te((S(), a("div", {
7177
7180
  ref_key: "menuRef",
7178
7181
  ref: l,
7179
7182
  class: "composer-actions-menu",
@@ -7189,7 +7192,7 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7189
7192
  class: "composer-actions-menu__item",
7190
7193
  "data-testid": "composer-create-poll",
7191
7194
  onClick: g
7192
- }, [o("span", pd, [(S(), r(D(j(W)), { class: "size-5" }))]), o("span", null, k(j(u)("createPoll")), 1)])], 512)), [[P, c.value]]);
7195
+ }, [o("span", pd, [(S(), r(D(j(U)), { class: "size-5" }))]), o("span", null, k(j(u)("createPoll")), 1)])], 512)), [[P, c.value]]);
7193
7196
  }
7194
7197
  }), $ = (e, t) => {
7195
7198
  let n = e.__vccOpts || e;
@@ -7204,13 +7207,13 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7204
7207
  },
7205
7208
  emits: ["cancel"],
7206
7209
  setup(e, { emit: t }) {
7207
- let r = e, i = t, { t: s } = q(), c = ju(), u = n(() => Ws(r.message, s("message"), c.mentionNameByUid.value));
7210
+ let r = e, i = t, { t: s } = K(), c = ju(), u = n(() => Ws(r.message, s("message"), c.mentionNameByUid.value));
7208
7211
  return (t, n) => (S(), a("div", { class: g(["context-banner", `context-banner--${e.variant}`]) }, [o("div", gd, [
7209
7212
  o("p", _d, k(e.variant === "editing" ? j(s)("editingInContext", { context: e.contextLabel }) : j(s)("replyingInContext", { context: e.contextLabel })), 1),
7210
7213
  o("p", vd, k(e.message.senderName), 1),
7211
7214
  o("p", yd, k(u.value), 1)
7212
7215
  ]), l(j(z), {
7213
- icon: j(de),
7216
+ icon: j(fe),
7214
7217
  text: "",
7215
7218
  rounded: "",
7216
7219
  severity: "secondary",
@@ -7225,7 +7228,7 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7225
7228
  },
7226
7229
  emits: ["format"],
7227
7230
  setup(e, { emit: t }) {
7228
- let n = t, { t: r } = q();
7231
+ let n = t, { t: r } = K();
7229
7232
  return (t, s) => e.visible ? (S(), a("div", {
7230
7233
  key: 0,
7231
7234
  class: "format-menu",
@@ -7237,19 +7240,19 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7237
7240
  o("button", {
7238
7241
  type: "button",
7239
7242
  class: "format-menu__item",
7240
- onMousedown: s[0] ||= R(() => {}, ["prevent"]),
7243
+ onMousedown: s[0] ||= L(() => {}, ["prevent"]),
7241
7244
  onClick: s[1] ||= (e) => n("format", "bold")
7242
7245
  }, [s[6] ||= o("span", { class: "format-menu__icon font-bold" }, "B", -1), o("span", null, k(j(r)("bold")), 1)], 32),
7243
7246
  o("button", {
7244
7247
  type: "button",
7245
7248
  class: "format-menu__item",
7246
- onMousedown: s[2] ||= R(() => {}, ["prevent"]),
7249
+ onMousedown: s[2] ||= L(() => {}, ["prevent"]),
7247
7250
  onClick: s[3] ||= (e) => n("format", "italic")
7248
7251
  }, [s[7] ||= o("span", { class: "format-menu__icon italic" }, "I", -1), o("span", null, k(j(r)("italic")), 1)], 32),
7249
7252
  o("button", {
7250
7253
  type: "button",
7251
7254
  class: "format-menu__item",
7252
- onMousedown: s[4] ||= R(() => {}, ["prevent"]),
7255
+ onMousedown: s[4] ||= L(() => {}, ["prevent"]),
7253
7256
  onClick: s[5] ||= (e) => n("format", "underline")
7254
7257
  }, [s[8] ||= o("span", { class: "format-menu__icon underline" }, "U", -1), o("span", null, k(j(r)("underline")), 1)], 32)
7255
7258
  ], 4)) : i("", !0);
@@ -7262,7 +7265,7 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7262
7265
  },
7263
7266
  emits: ["update:visible", "send"],
7264
7267
  setup(t, { expose: i, emit: s }) {
7265
- let c = t, u = s, { t: d } = q(), f = w(""), p = w(["", ""]), m = n(() => {
7268
+ let c = t, u = s, { t: d } = K(), f = w(""), p = w(["", ""]), m = n(() => {
7266
7269
  let e = f.value.trim(), t = p.value.map((e) => e.trim()).filter(Boolean);
7267
7270
  return !!e && t.length >= 2;
7268
7271
  });
@@ -7298,7 +7301,7 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7298
7301
  onClick: y
7299
7302
  }, null, 8, ["label"]), l(j(z), {
7300
7303
  label: j(d)("sendPoll"),
7301
- icon: j(Ne),
7304
+ icon: j(Pe),
7302
7305
  disabled: c.disabled || !m.value,
7303
7306
  onClick: v
7304
7307
  }, null, 8, [
@@ -7326,7 +7329,7 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7326
7329
  "placeholder",
7327
7330
  "onUpdate:modelValue"
7328
7331
  ]), l(j(z), {
7329
- icon: j(de),
7332
+ icon: j(fe),
7330
7333
  text: "",
7331
7334
  rounded: "",
7332
7335
  severity: "secondary",
@@ -7339,7 +7342,7 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7339
7342
  ])]))), 128)),
7340
7343
  l(j(z), {
7341
7344
  label: j(d)("addOption"),
7342
- icon: j(se),
7345
+ icon: j(ce),
7343
7346
  text: "",
7344
7347
  onClick: h
7345
7348
  }, null, 8, ["label", "icon"])
@@ -7357,7 +7360,7 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7357
7360
  },
7358
7361
  emits: ["update:visible", "schedule"],
7359
7362
  setup(e, { expose: t, emit: i }) {
7360
- let a = e, s = i, { t: c } = q(), u = w(p()), d = w(m());
7363
+ let a = e, s = i, { t: c } = K(), u = w(p()), d = w(m());
7361
7364
  function f() {
7362
7365
  return new Date(Date.now() + 3600 * 1e3);
7363
7366
  }
@@ -7397,7 +7400,7 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7397
7400
  onClick: b
7398
7401
  }, null, 8, ["label"]), l(j(z), {
7399
7402
  label: j(c)("schedule"),
7400
- icon: j(le),
7403
+ icon: j(ue),
7401
7404
  disabled: a.disabled || !g.value,
7402
7405
  onClick: y
7403
7406
  }, null, 8, [
@@ -7455,7 +7458,7 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7455
7458
  top: `${t.position.y}px`
7456
7459
  }),
7457
7460
  role: "listbox",
7458
- onMousedown: l[0] ||= R(() => {}, ["stop"])
7461
+ onMousedown: l[0] ||= L(() => {}, ["stop"])
7459
7462
  }, [(S(!0), a(e, null, T(t.candidates, (e, t) => (S(), a("button", {
7460
7463
  key: e.id,
7461
7464
  type: "button",
@@ -7463,8 +7466,8 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7463
7466
  role: "option",
7464
7467
  "aria-selected": t === s.value,
7465
7468
  onMouseover: (e) => s.value = t,
7466
- onMousedown: R((t) => c("select", e), ["stop", "prevent"])
7467
- }, [e.avatar ? (S(), r(j(te), {
7469
+ onMousedown: L((t) => c("select", e), ["stop", "prevent"])
7470
+ }, [e.avatar ? (S(), r(j(R), {
7468
7471
  key: 0,
7469
7472
  src: e.avatar,
7470
7473
  name: e.label,
@@ -7513,62 +7516,62 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7513
7516
  video: "video/*",
7514
7517
  audio: "audio/*",
7515
7518
  file: "*/*"
7516
- }, u = e, d = s, f = w(null), m = w(null), _ = w(null), v = w("file"), y = w(!1), b = w(!1), x = w(!1), { t: C } = q(), T = null, E = w(null), D = w(null), O = w(null), { applyFormat: A, editorKey: M, formatMenuPosition: ee, focusEditor: N, handleContextMenu: P, handleInput: I, handleKeydown: L, handlePaste: te, hideFormatMenu: ne, resetEditor: B, showFormatMenu: re, triggerCandidates: ie, triggerMenuPosition: V, highlightedTriggerIndex: ae, showTriggerMenu: H, selectTriggerCandidate: U } = ud(E, D, O, {
7519
+ }, u = e, d = s, f = w(null), m = w(null), _ = w(null), v = w("file"), y = w(!1), b = w(!1), x = w(!1), { t: C } = K(), T = null, E = w(null), D = w(null), O = w(null), { applyFormat: A, editorKey: M, formatMenuPosition: ee, focusEditor: N, handleContextMenu: P, handleInput: I, handleKeydown: te, handlePaste: R, hideFormatMenu: ne, resetEditor: B, showFormatMenu: re, triggerCandidates: ie, triggerMenuPosition: ae, highlightedTriggerIndex: oe, showTriggerMenu: V, selectTriggerCandidate: H } = ud(E, D, O, {
7517
7520
  getModelValue: () => u.modelValue,
7518
7521
  updateModelValue: (e) => d("update:modelValue", e),
7519
- submit: () => we(),
7522
+ submit: () => Te(),
7520
7523
  getMentionCandidates: () => u.mentionCandidates ?? [],
7521
7524
  getMentionNameByUid: () => u.mentionNameByUid ?? {},
7522
7525
  mentionsEnabled: () => u.mentionsEnabled ?? (u.mentionCandidates?.length ?? 0) > 0
7523
- }), ce = n(() => c[v.value]), W = n(() => {
7526
+ }), le = n(() => c[v.value]), U = n(() => {
7524
7527
  if (!_.value) return null;
7525
7528
  let e = _.value.type;
7526
7529
  return e.startsWith("image/") ? "image" : e.startsWith("video/") ? "video" : e.startsWith("audio/") ? "audio" : "file";
7527
- }), le = n(() => {
7528
- switch (W.value) {
7530
+ }), ue = n(() => {
7531
+ switch (U.value) {
7529
7532
  case "image": return C("image");
7530
7533
  case "video": return C("video");
7531
7534
  case "audio": return C("audio");
7532
7535
  case "file": return C("file");
7533
7536
  default: return C("attachment");
7534
7537
  }
7535
- }), fe = n(() => !u.editingMessage && !u.replyToMessage ? "" : u.compact ? "pt-1" : "pt-1.5"), pe = n(() => Hs(u.modelValue) || !!_.value), me = n(() => pe.value && W.value !== "file"), he = n(() => _.value ? C("attachmentSummary", { name: _.value.name }) : Us(u.modelValue) || C("currentDraftWillBeScheduled"));
7538
+ }), pe = n(() => !u.editingMessage && !u.replyToMessage ? "" : u.compact ? "pt-1" : "pt-1.5"), me = n(() => Hs(u.modelValue) || !!_.value), he = n(() => me.value && U.value !== "file"), ge = n(() => _.value ? C("attachmentSummary", { name: _.value.name }) : Us(u.modelValue) || C("currentDraftWillBeScheduled"));
7536
7539
  F(() => u.resetSignal, () => {
7537
7540
  B(), _.value = null, y.value = !1, b.value = !1, f.value && (f.value.value = "");
7538
7541
  });
7539
- async function ge() {
7542
+ async function _e() {
7540
7543
  await h(), N();
7541
7544
  }
7542
- function ve() {
7545
+ function ye() {
7543
7546
  m.value?.hide();
7544
7547
  }
7545
7548
  t({
7546
- focusEditor: ge,
7547
- hideComposerActions: ve
7549
+ focusEditor: _e,
7550
+ hideComposerActions: ye
7548
7551
  });
7549
- async function ye(e = "file") {
7552
+ async function be(e = "file") {
7550
7553
  v.value = e, await h(), f.value?.click();
7551
7554
  }
7552
- function be(e) {
7553
- _.value = e.target.files?.[0] ?? null, ve();
7554
- }
7555
7555
  function xe(e) {
7556
+ _.value = e.target.files?.[0] ?? null, ye();
7557
+ }
7558
+ function Se(e) {
7556
7559
  if (u.disabled) return;
7557
7560
  let t = rd(e);
7558
7561
  if (t) {
7559
- e.preventDefault(), _.value = t, ve();
7562
+ e.preventDefault(), _.value = t, ye();
7560
7563
  return;
7561
7564
  }
7562
- te(e);
7565
+ R(e);
7563
7566
  }
7564
- function Se() {
7567
+ function Ce() {
7565
7568
  _.value = null, f.value && (f.value.value = "");
7566
7569
  }
7567
- function Ce(e) {
7570
+ function we(e) {
7568
7571
  m.value?.toggle(e);
7569
7572
  }
7570
- function we() {
7571
- if (!(u.disabled || !pe.value)) {
7573
+ function Te() {
7574
+ if (!(u.disabled || !me.value)) {
7572
7575
  if (_.value) {
7573
7576
  d("sendAttachment", {
7574
7577
  file: _.value,
@@ -7579,10 +7582,10 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7579
7582
  d("sendText");
7580
7583
  }
7581
7584
  }
7582
- function Te(e) {
7585
+ function Ee(e) {
7583
7586
  d("sendPoll", e);
7584
7587
  }
7585
- function Ee(e) {
7588
+ function De(e) {
7586
7589
  d("scheduleMessage", {
7587
7590
  ...e,
7588
7591
  text: _.value ? void 0 : Vs(u.modelValue),
@@ -7590,39 +7593,39 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7590
7593
  caption: _.value ? Vs(u.modelValue) : void 0
7591
7594
  });
7592
7595
  }
7593
- function De() {
7596
+ function Oe() {
7594
7597
  d("openScheduled");
7595
7598
  }
7596
- function Oe() {
7599
+ function ke() {
7597
7600
  T !== null && (clearTimeout(T), T = null);
7598
7601
  }
7599
- function ke(e) {
7600
- u.disabled || !me.value || e instanceof MouseEvent && e.button !== 0 || (x.value = !1, Oe(), T = setTimeout(() => {
7602
+ function Ae(e) {
7603
+ u.disabled || !he.value || e instanceof MouseEvent && e.button !== 0 || (x.value = !1, ke(), T = setTimeout(() => {
7601
7604
  T = null, x.value = !0, b.value = !0;
7602
7605
  }, Jd));
7603
7606
  }
7604
- function Ae() {
7605
- Oe();
7606
- }
7607
7607
  function je() {
7608
- if (!(u.disabled || !pe.value)) {
7608
+ ke();
7609
+ }
7610
+ function Me() {
7611
+ if (!(u.disabled || !me.value)) {
7609
7612
  if (x.value) {
7610
7613
  x.value = !1;
7611
7614
  return;
7612
7615
  }
7613
- we();
7616
+ Te();
7614
7617
  }
7615
7618
  }
7616
- return (t, n) => (S(), a("div", { class: g([u.compact ? "space-y-1 px-1 pb-1.5" : "space-y-1.5 px-1 pb-1.5", fe.value]) }, [
7619
+ return (t, n) => (S(), a("div", { class: g([u.compact ? "space-y-1 px-1 pb-1.5" : "space-y-1.5 px-1 pb-1.5", pe.value]) }, [
7617
7620
  o("input", {
7618
7621
  ref_key: "fileInputRef",
7619
7622
  ref: f,
7620
7623
  type: "file",
7621
7624
  class: "hidden",
7622
- accept: ce.value,
7625
+ accept: le.value,
7623
7626
  disabled: e.disabled,
7624
- onChange: be,
7625
- onCancel: ve
7627
+ onChange: xe,
7628
+ onCancel: ye
7626
7629
  }, null, 40, Bd),
7627
7630
  e.editingMessage ? (S(), r(bd, {
7628
7631
  key: 0,
@@ -7639,12 +7642,12 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7639
7642
  "data-testid": "composer-reply-context",
7640
7643
  onCancel: n[1] ||= (e) => d("cancelReply")
7641
7644
  }, null, 8, ["message", "context-label"])) : i("", !0),
7642
- _.value ? (S(), a("div", Vd, [o("div", Hd, [o("p", Ud, k(_.value.name), 1), o("p", Wd, k(_.value.type || le.value), 1)]), l(j(z), {
7643
- icon: j(de),
7645
+ _.value ? (S(), a("div", Vd, [o("div", Hd, [o("p", Ud, k(_.value.name), 1), o("p", Wd, k(_.value.type || ue.value), 1)]), l(j(z), {
7646
+ icon: j(fe),
7644
7647
  text: "",
7645
7648
  rounded: "",
7646
7649
  severity: "secondary",
7647
- onClick: Se
7650
+ onClick: Ce
7648
7651
  }, null, 8, ["icon"])])) : i("", !0),
7649
7652
  o("div", {
7650
7653
  ref_key: "composerShellRef",
@@ -7654,7 +7657,7 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7654
7657
  l(hd, {
7655
7658
  ref_key: "composerActionsRef",
7656
7659
  ref: m,
7657
- onPickFile: ye,
7660
+ onPickFile: be,
7658
7661
  onOpenPoll: n[2] ||= (e) => y.value = !0
7659
7662
  }, null, 512),
7660
7663
  l(j(z), {
@@ -7665,8 +7668,8 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7665
7668
  disabled: e.disabled || !!e.editingMessage,
7666
7669
  "aria-label": j(C)("addToMessage"),
7667
7670
  "data-testid": "composer-actions-button",
7668
- icon: j(se),
7669
- onClick: Ce
7671
+ icon: j(ce),
7672
+ onClick: we
7670
7673
  }, null, 8, [
7671
7674
  "class",
7672
7675
  "disabled",
@@ -7685,12 +7688,12 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7685
7688
  onFocus: n[3] ||= (...e) => j(ne) && j(ne)(...e),
7686
7689
  onInput: n[4] ||= (...e) => j(I) && j(I)(...e),
7687
7690
  onKeyup: n[5] ||= (...e) => j(I) && j(I)(...e),
7688
- onKeydown: n[6] ||= (...e) => j(L) && j(L)(...e),
7689
- onPaste: xe,
7691
+ onKeydown: n[6] ||= (...e) => j(te) && j(te)(...e),
7692
+ onPaste: Se,
7690
7693
  onContextmenu: n[7] ||= (...e) => j(P) && j(P)(...e)
7691
7694
  }, null, 42, Gd)),
7692
7695
  _.value || e.editingMessage || e.contextLabel || e.offlineMode ? (S(), a("div", Kd, [
7693
- e.editingMessage ? (S(), r(j(oe), {
7696
+ e.editingMessage ? (S(), r(j(se), {
7694
7697
  key: 0,
7695
7698
  text: j(C)("editing"),
7696
7699
  context: "info",
@@ -7698,7 +7701,7 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7698
7701
  size: "sm",
7699
7702
  class: "composer-meta-tag"
7700
7703
  }, null, 8, ["text"])) : i("", !0),
7701
- e.contextLabel ? (S(), r(j(oe), {
7704
+ e.contextLabel ? (S(), r(j(se), {
7702
7705
  key: 1,
7703
7706
  text: e.contextLabel,
7704
7707
  context: "contrast",
@@ -7715,8 +7718,8 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7715
7718
  class: g(["composer-schedule-button shrink-0 self-end", u.compact ? "h-9 w-9" : "h-10 w-10 max-md:h-9 max-md:w-9"]),
7716
7719
  disabled: e.disabled,
7717
7720
  "aria-label": j(C)("scheduledMessages"),
7718
- icon: j(_e),
7719
- onClick: De
7721
+ icon: j(ve),
7722
+ onClick: Oe
7720
7723
  }, null, 8, [
7721
7724
  "class",
7722
7725
  "disabled",
@@ -7728,17 +7731,17 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7728
7731
  severity: "primary",
7729
7732
  text: "",
7730
7733
  class: g(["composer-send-button shrink-0 self-end", u.compact ? "h-9 w-9" : "h-10 w-10 max-md:h-9 max-md:w-9"]),
7731
- disabled: e.disabled || !pe.value,
7734
+ disabled: e.disabled || !me.value,
7732
7735
  "aria-label": e.editingMessage ? j(C)("saveMessage") : _.value ? j(C)("sendAttachment") : j(C)("sendMessage"),
7733
- icon: e.editingMessage ? j(ue) : j(Ne),
7734
- onMousedown: ke,
7735
- onMouseup: Ae,
7736
- onMouseleave: Ae,
7737
- onTouchstart: ke,
7738
- onTouchend: Ae,
7739
- onTouchcancel: Ae,
7740
- onContextmenu: n[8] ||= R(() => {}, ["prevent"]),
7741
- onClick: je
7736
+ icon: e.editingMessage ? j(de) : j(Pe),
7737
+ onMousedown: Ae,
7738
+ onMouseup: je,
7739
+ onMouseleave: je,
7740
+ onTouchstart: Ae,
7741
+ onTouchend: je,
7742
+ onTouchcancel: je,
7743
+ onContextmenu: n[8] ||= L(() => {}, ["prevent"]),
7744
+ onClick: Me
7742
7745
  }, null, 8, [
7743
7746
  "class",
7744
7747
  "disabled",
@@ -7754,12 +7757,12 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7754
7757
  l(zd, {
7755
7758
  ref_key: "triggerMenuRef",
7756
7759
  ref: O,
7757
- "highlighted-index": j(ae),
7758
- "onUpdate:highlightedIndex": n[10] ||= (e) => p(ae) ? ae.value = e : null,
7759
- visible: j(H),
7760
- position: j(V),
7760
+ "highlighted-index": j(oe),
7761
+ "onUpdate:highlightedIndex": n[10] ||= (e) => p(oe) ? oe.value = e : null,
7762
+ visible: j(V),
7763
+ position: j(ae),
7761
7764
  candidates: j(ie),
7762
- onSelect: n[11] ||= (e) => j(U)(e)
7765
+ onSelect: n[11] ||= (e) => j(H)(e)
7763
7766
  }, null, 8, [
7764
7767
  "highlighted-index",
7765
7768
  "visible",
@@ -7770,15 +7773,15 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7770
7773
  visible: y.value,
7771
7774
  "onUpdate:visible": n[12] ||= (e) => y.value = e,
7772
7775
  disabled: e.disabled,
7773
- onSend: Te
7776
+ onSend: Ee
7774
7777
  }, null, 8, ["visible", "disabled"]),
7775
7778
  l(Nd, {
7776
7779
  visible: b.value,
7777
7780
  "onUpdate:visible": n[13] ||= (e) => b.value = e,
7778
7781
  disabled: e.disabled,
7779
- "can-schedule": me.value,
7780
- "content-preview": he.value,
7781
- onSchedule: Ee
7782
+ "can-schedule": he.value,
7783
+ "content-preview": ge.value,
7784
+ onSchedule: De
7782
7785
  }, null, 8, [
7783
7786
  "visible",
7784
7787
  "disabled",
@@ -7794,7 +7797,7 @@ var dd = ["data-testid", "onClick"], fd = { class: "composer-actions-menu__icon"
7794
7797
  __name: "ConversationComposer",
7795
7798
  props: { target: {} },
7796
7799
  setup(e, { expose: t }) {
7797
- let o = e, { t: s } = q(), c = ju(), l = Fu(), u = Bu(), d = Gu(), f = Xu(), p = n(() => o.target === "thread"), m = n({
7800
+ let o = e, { t: s } = K(), c = ju(), l = Fu(), u = Bu(), d = Gu(), f = Xu(), p = n(() => o.target === "thread"), m = n({
7798
7801
  get: () => p.value ? u.threadDraft.value : u.draft.value,
7799
7802
  set: (e) => {
7800
7803
  p.value ? u.threadDraft.value = e : u.draft.value = e;
@@ -8006,49 +8009,49 @@ function $d(e) {
8006
8009
  {
8007
8010
  key: "reply",
8008
8011
  label: e.t("reply"),
8009
- icon: je,
8012
+ icon: Me,
8010
8013
  visible: e.canReply(),
8011
8014
  command: () => C(t)
8012
8015
  },
8013
8016
  {
8014
8017
  key: "edit",
8015
8018
  label: e.t("edit"),
8016
- icon: ve,
8019
+ icon: ye,
8017
8020
  visible: s(t),
8018
8021
  command: () => T(t)
8019
8022
  },
8020
8023
  {
8021
8024
  key: "copy",
8022
8025
  label: r.value === t.id ? e.t("copied") : e.t("copyText"),
8023
- icon: r.value === t.id ? ue : pe,
8026
+ icon: r.value === t.id ? de : me,
8024
8027
  visible: !0,
8025
8028
  command: () => S(t)
8026
8029
  },
8027
8030
  {
8028
8031
  key: "info",
8029
8032
  label: e.t("info"),
8030
- icon: we,
8033
+ icon: Te,
8031
8034
  visible: c(t),
8032
8035
  command: () => O(t)
8033
8036
  },
8034
8037
  {
8035
8038
  key: "thread",
8036
8039
  label: e.t("threadWithCount", { count: t.replyCount }),
8037
- icon: Se,
8040
+ icon: Ce,
8038
8041
  visible: !e.isInThread() && e.canOpenThread(),
8039
8042
  command: () => E(t)
8040
8043
  },
8041
8044
  {
8042
8045
  key: "delete",
8043
8046
  label: e.t("delete"),
8044
- icon: me,
8047
+ icon: he,
8045
8048
  visible: l(t),
8046
8049
  command: () => k(t)
8047
8050
  },
8048
8051
  {
8049
8052
  key: "translate",
8050
8053
  label: e.t("translate"),
8051
- icon: Ie,
8054
+ icon: Le,
8052
8055
  visible: o(t),
8053
8056
  command: () => D(t)
8054
8057
  }
@@ -8306,7 +8309,7 @@ var uf = { class: "w-full" }, df = {
8306
8309
  props: { attachment: {} },
8307
8310
  emits: ["close"],
8308
8311
  setup(t, { emit: s }) {
8309
- let c = t, l = s, u = w(null), d = w(null), f = n(() => !!c.attachment?.url), p = n(() => c.attachment?.kind === "image"), m = n(() => c.attachment?.kind === "video"), h = n(() => c.attachment?.kind === "audio"), { t: _ } = q(), { scale: y, translateX: b, translateY: x, isDragging: C, resetTransform: T, handlePointerDown: E, handlePointerMove: O, handlePointerUp: A, handlePointerCancel: M, handleWheel: ee, handleDoubleClick: N } = lf({
8312
+ let c = t, l = s, u = w(null), d = w(null), f = n(() => !!c.attachment?.url), p = n(() => c.attachment?.kind === "image"), m = n(() => c.attachment?.kind === "video"), h = n(() => c.attachment?.kind === "audio"), { t: _ } = K(), { scale: y, translateX: b, translateY: x, isDragging: C, resetTransform: T, handlePointerDown: E, handlePointerMove: O, handlePointerUp: A, handlePointerCancel: M, handleWheel: ee, handleDoubleClick: N } = lf({
8310
8313
  viewportRef: u,
8311
8314
  imageRef: d,
8312
8315
  isImage: () => p.value
@@ -8331,7 +8334,7 @@ var uf = { class: "w-full" }, df = {
8331
8334
  target: "_blank",
8332
8335
  rel: "noreferrer",
8333
8336
  class: "media-viewer-link-action"
8334
- }, [(S(), r(D(j(Oe)), {
8337
+ }, [(S(), r(D(j(ke)), {
8335
8338
  class: "size-4",
8336
8339
  "aria-hidden": "true"
8337
8340
  })), o("span", null, k(j(_)("openInNewTab")), 1)], 8, pf)) : i("", !0)]),
@@ -8379,7 +8382,7 @@ var uf = { class: "w-full" }, df = {
8379
8382
  __name: "MessageDateSeparator",
8380
8383
  props: { date: {} },
8381
8384
  setup(e) {
8382
- let t = e, { locale: r, t: i } = q(), s = n(() => {
8385
+ let t = e, { locale: r, t: i } = K(), s = n(() => {
8383
8386
  let e = /* @__PURE__ */ new Date(), n = t.date, a = new Date(e.getFullYear(), e.getMonth(), e.getDate()), o = new Date(a);
8384
8387
  o.setDate(o.getDate() - 1);
8385
8388
  let s = new Date(a);
@@ -8413,7 +8416,7 @@ var uf = { class: "w-full" }, df = {
8413
8416
  isOwn: { type: Boolean }
8414
8417
  },
8415
8418
  setup(e) {
8416
- let t = e, r = w(null), s = w(!1), { t: c } = q(), l = n(() => {
8419
+ let t = e, r = w(null), s = w(!1), { t: c } = K(), l = n(() => {
8417
8420
  try {
8418
8421
  return new URL(t.url).hostname.replace(/^www\./, "");
8419
8422
  } catch {
@@ -8526,7 +8529,7 @@ var uf = { class: "w-full" }, df = {
8526
8529
  props: { message: {} },
8527
8530
  emits: ["openMedia"],
8528
8531
  setup(t, { emit: n }) {
8529
- let s = n, { t: l } = q();
8532
+ let s = n, { t: l } = K();
8530
8533
  function u(e) {
8531
8534
  return !e || Number.isNaN(e) ? "" : e < 1024 * 1024 ? `${Math.round(e / 1024)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
8532
8535
  }
@@ -8535,21 +8538,21 @@ var uf = { class: "w-full" }, df = {
8535
8538
  }
8536
8539
  function f(e) {
8537
8540
  let t = d(e), n = e.mimeType?.toLowerCase() || "";
8538
- return n === "application/pdf" || t === "pdf" ? Ae : [
8541
+ return n === "application/pdf" || t === "pdf" ? je : [
8539
8542
  "doc",
8540
8543
  "docx",
8541
8544
  "odt",
8542
8545
  "rtf"
8543
- ].includes(t) ? he : [
8546
+ ].includes(t) ? ge : [
8544
8547
  "xls",
8545
8548
  "xlsx",
8546
8549
  "csv",
8547
8550
  "ods"
8548
- ].includes(t) ? Pe : [
8551
+ ].includes(t) ? Fe : [
8549
8552
  "ppt",
8550
8553
  "pptx",
8551
8554
  "odp"
8552
- ].includes(t) ? be : [
8555
+ ].includes(t) ? xe : [
8553
8556
  "txt",
8554
8557
  "md",
8555
8558
  "json",
@@ -8560,13 +8563,13 @@ var uf = { class: "w-full" }, df = {
8560
8563
  "ts",
8561
8564
  "html",
8562
8565
  "css"
8563
- ].includes(t) || n.startsWith("text/") ? n.startsWith("text/") ? Fe : fe : [
8566
+ ].includes(t) || n.startsWith("text/") ? n.startsWith("text/") ? Ie : pe : [
8564
8567
  "zip",
8565
8568
  "rar",
8566
8569
  "7z",
8567
8570
  "tar",
8568
8571
  "gz"
8569
- ].includes(t) ? xe : he;
8572
+ ].includes(t) ? Se : ge;
8570
8573
  }
8571
8574
  function p(e) {
8572
8575
  let t = Us(e.text).trim();
@@ -8632,11 +8635,11 @@ var uf = { class: "w-full" }, df = {
8632
8635
  __name: "MessageDeliveryStatus",
8633
8636
  props: { message: {} },
8634
8637
  setup(e) {
8635
- let t = e, { locale: s, t: c } = q();
8638
+ let t = e, { locale: s, t: c } = K();
8636
8639
  function l(e) {
8637
8640
  return new Intl.DateTimeFormat(s.value, {
8638
8641
  timeStyle: "short",
8639
- hourCycle: ht()
8642
+ hourCycle: gt()
8640
8643
  }).format(e);
8641
8644
  }
8642
8645
  let u = n(() => {
@@ -8646,34 +8649,34 @@ var uf = { class: "w-full" }, df = {
8646
8649
  case "read": return {
8647
8650
  state: "read",
8648
8651
  label: c("read"),
8649
- icon: ge,
8652
+ icon: _e,
8650
8653
  class: "text-success"
8651
8654
  };
8652
8655
  case "delivered": return {
8653
8656
  state: "delivered",
8654
8657
  label: c("delivered"),
8655
- icon: ue
8658
+ icon: de
8656
8659
  };
8657
8660
  case "queued": return {
8658
8661
  state: "queued",
8659
8662
  label: c("queued"),
8660
- icon: Me
8663
+ icon: Ne
8661
8664
  };
8662
8665
  case "sending": return {
8663
8666
  state: "sending",
8664
8667
  label: c("sending"),
8665
- icon: Ne
8668
+ icon: Pe
8666
8669
  };
8667
8670
  case "failed": return {
8668
8671
  state: "failed",
8669
8672
  label: c("failed"),
8670
- icon: ye,
8673
+ icon: be,
8671
8674
  class: "text-danger"
8672
8675
  };
8673
8676
  default: return {
8674
8677
  state: "sent",
8675
8678
  label: c("sent"),
8676
- icon: ke
8679
+ icon: Ae
8677
8680
  };
8678
8681
  }
8679
8682
  });
@@ -8697,7 +8700,7 @@ var uf = { class: "w-full" }, df = {
8697
8700
  __name: "MessageItemHeader",
8698
8701
  props: { message: {} },
8699
8702
  setup(e) {
8700
- let t = e, { locale: n, t: s } = q();
8703
+ let t = e, { locale: n, t: s } = K();
8701
8704
  function c(e) {
8702
8705
  return e ? new Intl.DateTimeFormat(n.value, {
8703
8706
  month: "short",
@@ -8709,7 +8712,7 @@ var uf = { class: "w-full" }, df = {
8709
8712
  function l() {
8710
8713
  return t.message.senderName?.trim() || (t.message.isOwn ? s("you") : s("system"));
8711
8714
  }
8712
- return (t, n) => (S(), a("div", fp, [o("span", pp, k(l()), 1), e.message.scheduled?.scheduleDate ? (S(), r(j(oe), {
8715
+ return (t, n) => (S(), a("div", fp, [o("span", pp, k(l()), 1), e.message.scheduled?.scheduleDate ? (S(), r(j(se), {
8713
8716
  key: 0,
8714
8717
  text: j(s)("scheduledDateLabel", { date: c(e.message.scheduled.scheduleDate) }),
8715
8718
  context: "warn",
@@ -8748,7 +8751,7 @@ var uf = { class: "w-full" }, df = {
8748
8751
  },
8749
8752
  emits: ["toggleReaction", "openThread"],
8750
8753
  setup(e, { emit: t }) {
8751
- let s = e, c = t, { t: u } = q(), d = n(() => u("threadReplies", { count: s.message.replyCount })), f = n(() => s.canOpenThread !== !1 && s.message.replyCount > 0);
8754
+ let s = e, c = t, { t: u } = K(), d = n(() => u("threadReplies", { count: s.message.replyCount })), f = n(() => s.canOpenThread !== !1 && s.message.replyCount > 0);
8752
8755
  return (t, n) => (S(), a("div", _p, [l(gp, {
8753
8756
  message: e.message,
8754
8757
  disabled: e.canReact === !1,
@@ -8760,8 +8763,8 @@ var uf = { class: "w-full" }, df = {
8760
8763
  class: "message-reactions__thread-button text-subtle hover:text-default inline-flex items-center gap-1 rounded-full px-1 py-0 font-medium transition",
8761
8764
  "aria-label": d.value,
8762
8765
  title: d.value,
8763
- onClick: n[1] ||= R((e) => c("openThread"), ["stop"])
8764
- }, [(S(), r(D(j(je)), {
8766
+ onClick: n[1] ||= L((e) => c("openThread"), ["stop"])
8767
+ }, [(S(), r(D(j(Me)), {
8765
8768
  class: "size-4",
8766
8769
  "aria-hidden": "true"
8767
8770
  })), o("span", yp, k(e.message.replyCount), 1)], 8, vp)) : i("", !0)]));
@@ -8778,7 +8781,7 @@ var uf = { class: "w-full" }, df = {
8778
8781
  },
8779
8782
  emits: ["vote"],
8780
8783
  setup(t, { emit: n }) {
8781
- let r = t, s = n, { t: c } = q();
8784
+ let r = t, s = n, { t: c } = K();
8782
8785
  function l(e) {
8783
8786
  let t = r.currentUserId;
8784
8787
  return !t || !r.message.poll ? !1 : r.message.poll.options.some((n) => n.id === e && n.voters.includes(t));
@@ -8894,7 +8897,7 @@ var uf = { class: "w-full" }, df = {
8894
8897
  key: 0,
8895
8898
  text: t.message.text,
8896
8899
  class: g(f.value)
8897
- }, null, 8, ["text", "class"])) : (S(), a(e, { key: 1 }, [t.canShowSenderAvatar && !t.message.isOwn ? (S(), r(j(te), {
8900
+ }, null, 8, ["text", "class"])) : (S(), a(e, { key: 1 }, [t.canShowSenderAvatar && !t.message.isOwn ? (S(), r(j(R), {
8898
8901
  key: 0,
8899
8902
  image: t.message.senderAvatar,
8900
8903
  label: t.message.senderAvatar ? void 0 : t.message.senderName.slice(0, 1).toUpperCase(),
@@ -8987,7 +8990,7 @@ var uf = { class: "w-full" }, df = {
8987
8990
  class: "message-reaction-more",
8988
8991
  disabled: !t.canReact,
8989
8992
  onClick: p
8990
- }, [(S(), r(D(u.value ? j(Ee) : j(Te)), {
8993
+ }, [(S(), r(D(u.value ? j(De) : j(Ee)), {
8991
8994
  class: "size-7",
8992
8995
  "aria-hidden": "true"
8993
8996
  }))], 8, Hp)]), u.value && t.canReact ? (S(), a("div", Up, [(S(!0), a(e, null, T(d.value, (e) => (S(), a("button", {
@@ -9065,7 +9068,7 @@ var uf = { class: "w-full" }, df = {
9065
9068
  message: e.message,
9066
9069
  "can-react": e.canReact,
9067
9070
  onReact: o[0] ||= (e) => s("react", e)
9068
- }, null, 8, ["message", "can-react"]), l(j(V), { model: e.actionItems }, null, 8, ["model"])], 4)) : i("", !0)]));
9071
+ }, null, 8, ["message", "can-react"]), l(j(ae), { model: e.actionItems }, null, 8, ["model"])], 4)) : i("", !0)]));
9069
9072
  }
9070
9073
  }), [["__scopeId", "data-v-54f6bf5c"]]), qp = { class: "chat-header border-default bg-elevation-surface-default sticky top-0 z-10 flex items-center justify-between gap-3 border-b px-4 py-3 max-md:px-4 max-md:pb-3 sm:px-5 sm:py-3.5" }, Jp = {
9071
9074
  key: 0,
@@ -9080,13 +9083,13 @@ var uf = { class: "w-full" }, df = {
9080
9083
  parentMessage: {}
9081
9084
  },
9082
9085
  setup(t) {
9083
- let { t: n } = q();
9084
- return (s, c) => (S(), a("header", qp, [t.conversation ? (S(), a("div", Jp, [l(j(te), {
9086
+ let { t: n } = K();
9087
+ return (s, c) => (S(), a("header", qp, [t.conversation ? (S(), a("div", Jp, [l(j(R), {
9085
9088
  image: t.conversation.avatar,
9086
9089
  label: t.conversation.avatar ? void 0 : t.conversation.title.slice(0, 1).toUpperCase(),
9087
9090
  shape: "circle",
9088
9091
  class: "chat-header__avatar shrink-0"
9089
- }, null, 8, ["image", "label"]), o("div", Yp, [o("p", Xp, k(t.parentMessage ? j(n)("thread") : t.conversation.title), 1), o("p", Zp, [t.parentMessage ? (S(), a("span", Qp, k(t.parentMessage.senderName), 1)) : (S(), a("span", $p, k(t.conversation.memberCount ? j(n)("members", { count: t.conversation.memberCount }) : j(n)("groupChat")), 1))])])])) : i("", !0), o("div", em, [t.conversation?.tags?.length ? (S(), a("div", tm, [(S(!0), a(e, null, T(t.conversation.tags.slice(0, 3), (e) => (S(), r(j(oe), {
9092
+ }, null, 8, ["image", "label"]), o("div", Yp, [o("p", Xp, k(t.parentMessage ? j(n)("thread") : t.conversation.title), 1), o("p", Zp, [t.parentMessage ? (S(), a("span", Qp, k(t.parentMessage.senderName), 1)) : (S(), a("span", $p, k(t.conversation.memberCount ? j(n)("members", { count: t.conversation.memberCount }) : j(n)("groupChat")), 1))])])])) : i("", !0), o("div", em, [t.conversation?.tags?.length ? (S(), a("div", tm, [(S(!0), a(e, null, T(t.conversation.tags.slice(0, 3), (e) => (S(), r(j(se), {
9090
9093
  key: e,
9091
9094
  text: e,
9092
9095
  context: "secondary",
@@ -9113,13 +9116,13 @@ var uf = { class: "w-full" }, df = {
9113
9116
  },
9114
9117
  emits: ["anchorclick"],
9115
9118
  setup(t) {
9116
- let s = t, { t: c } = q(), u = ju(), d = Fu(), f = Xu(), p = n(() => s.target === "thread"), m = n(() => p.value ? d.threadMessages.value : s.hideGroupActions ? d.messages.value.filter((e) => e.kind !== "action") : d.messages.value), h = n(() => p.value ? d.loadingThreadMessages.value : d.loadingMessages.value), _ = n(() => p.value ? d.activeThreadParentMessage.value : null), v = n(() => p.value ? !1 : u.canOpenThread.value), y = n(() => s.showHeader ?? !p.value), b = n(() => p.value ? d.hasOlderThreadMessages.value : d.hasOlderMessages.value), x = n(() => p.value ? d.loadingOlderThreadMessages.value : d.loadingOlderMessages.value), C = n(() => p.value ? !0 : d.showDefaultEmptyState.value), D = n(() => {
9119
+ let s = t, { t: c } = K(), u = ju(), d = Fu(), f = Xu(), p = n(() => s.target === "thread"), m = n(() => p.value ? d.threadMessages.value : s.hideGroupActions ? d.messages.value.filter((e) => e.kind !== "action") : d.messages.value), h = n(() => p.value ? d.loadingThreadMessages.value : d.loadingMessages.value), _ = n(() => p.value ? d.activeThreadParentMessage.value : null), v = n(() => p.value ? !1 : u.canOpenThread.value), y = n(() => s.showHeader ?? !p.value), b = n(() => p.value ? d.hasOlderThreadMessages.value : d.hasOlderMessages.value), x = n(() => p.value ? d.loadingOlderThreadMessages.value : d.loadingOlderMessages.value), C = n(() => p.value ? !0 : d.showDefaultEmptyState.value), D = n(() => {
9117
9120
  let e = u.conversation.value;
9118
9121
  return e ? _.value ? c("thread") : e.title : "";
9119
9122
  }), O = n(() => {
9120
9123
  let e = u.conversation.value;
9121
9124
  return e ? _.value ? _.value.senderName : e.memberCount ? c("members", { count: e.memberCount }) : c("groupChat") : "";
9122
- }), A = n(() => u.conversation.value?.memberCount ?? 0), M = w(null), N = w(null), P = n(() => !!_.value), F = n(() => P.value && !y.value), I = n(() => Eu(u.conversation.value)), L = ee("threadRef"), { handleThreadScroll: R } = of({
9125
+ }), A = n(() => u.conversation.value?.memberCount ?? 0), M = w(null), N = w(null), P = n(() => !!_.value), F = n(() => P.value && !y.value), I = n(() => Eu(u.conversation.value)), te = ee("threadRef"), { handleThreadScroll: L } = of({
9123
9126
  getConversation: () => u.conversation.value,
9124
9127
  getParentMessage: () => _.value,
9125
9128
  getMessages: () => m.value,
@@ -9127,14 +9130,14 @@ var uf = { class: "w-full" }, df = {
9127
9130
  isLoadingOlder: () => x.value,
9128
9131
  canLoadOlder: () => b.value,
9129
9132
  onLoadOlder: () => f.emit("list:loadOlder", { target: s.target }),
9130
- threadRef: L
9131
- }), te = ee("actionMenuRef"), { activeActionMessage: z, handleMessageContextMenu: ne, handleMessageTap: B, resetActionMenuState: re, reactToMessage: ie, toggleInlineReaction: V, getActionItems: ae } = $d({
9133
+ threadRef: te
9134
+ }), R = ee("actionMenuRef"), { activeActionMessage: z, handleMessageContextMenu: ne, handleMessageTap: B, resetActionMenuState: re, reactToMessage: ie, toggleInlineReaction: ae, getActionItems: oe } = $d({
9132
9135
  canUseMessageActions: () => u.canUseMessageActions.value,
9133
9136
  canReact: () => u.canReact.value,
9134
9137
  canReply: () => u.canReply.value,
9135
9138
  canOpenThread: () => v.value,
9136
9139
  isInThread: () => p.value,
9137
- actionMenuRef: te,
9140
+ actionMenuRef: R,
9138
9141
  t: c,
9139
9142
  emit: {
9140
9143
  reply: (e) => f.emit("message:reply", e),
@@ -9150,20 +9153,20 @@ var uf = { class: "w-full" }, df = {
9150
9153
  },
9151
9154
  onMenuOpen: () => f.emit("ui:closeComposerActions")
9152
9155
  });
9153
- function H(e) {
9156
+ function V(e) {
9154
9157
  return !!e.url && [
9155
9158
  "image",
9156
9159
  "video",
9157
9160
  "audio"
9158
9161
  ].includes(e.kind);
9159
9162
  }
9160
- function oe(e) {
9161
- H(e) && (M.value = e);
9163
+ function se(e) {
9164
+ V(e) && (M.value = e);
9162
9165
  }
9163
- function U() {
9166
+ function H() {
9164
9167
  M.value = null;
9165
9168
  }
9166
- async function se(e, t) {
9169
+ async function ce(e, t) {
9167
9170
  N.value = `${e.id}:${t}`;
9168
9171
  try {
9169
9172
  f.emit("message:votePoll", {
@@ -9176,15 +9179,15 @@ var uf = { class: "w-full" }, df = {
9176
9179
  }, 300);
9177
9180
  }
9178
9181
  }
9179
- function ce(e) {
9182
+ function le(e) {
9180
9183
  v.value && f.emit("message:openThread", e);
9181
9184
  }
9182
- function W(e, t) {
9185
+ function U(e, t) {
9183
9186
  return e.getFullYear() !== t.getFullYear() || e.getMonth() !== t.getMonth() || e.getDate() !== t.getDate();
9184
9187
  }
9185
- function le(e) {
9188
+ function ue(e) {
9186
9189
  let t = m.value;
9187
- return e === 0 ? !0 : W(t[e].sentAt, t[e - 1].sentAt);
9190
+ return e === 0 ? !0 : U(t[e].sentAt, t[e - 1].sentAt);
9188
9191
  }
9189
9192
  return (t, n) => (S(), a(e, null, [
9190
9193
  o("section", { class: g(["message-list-root", [t.$attrs.class, F.value ? "message-list--embedded-thread" : P.value ? "message-list--thread" : "message-list--main"]]) }, [y.value ? E(t.$slots, "header", {
@@ -9203,12 +9206,12 @@ var uf = { class: "w-full" }, df = {
9203
9206
  class: g(["message-list__body", F.value || P.value ? "bg-elevation-surface-overlay" : ""])
9204
9207
  }, [o("div", {
9205
9208
  ref_key: "threadRef",
9206
- ref: L,
9209
+ ref: te,
9207
9210
  class: g(["message-list__scroll min-h-0 flex-1", F.value ? "p-0" : P.value ? "px-5 py-4" : "px-2 pt-2 pb-3"]),
9208
- onScroll: n[2] ||= (...e) => j(R) && j(R)(...e)
9211
+ onScroll: n[2] ||= (...e) => j(L) && j(L)(...e)
9209
9212
  }, [o("div", im, [
9210
9213
  _.value ? (S(), a("div", am, [o("p", om, k(_.value.senderName), 1), o("p", sm, k(j(Ws)(_.value, j(c)("message"), j(u).mentionNameByUid.value)), 1)])) : i("", !0),
9211
- (S(!0), a(e, null, T(m.value, (o, c) => (S(), a(e, { key: o.id }, [le(c) ? (S(), r(kf, {
9214
+ (S(!0), a(e, null, T(m.value, (o, c) => (S(), a(e, { key: o.id }, [ue(c) ? (S(), r(kf, {
9212
9215
  key: 0,
9213
9216
  date: o.sentAt
9214
9217
  }, null, 8, ["date"])) : i("", !0), l(Lp, {
@@ -9222,10 +9225,10 @@ var uf = { class: "w-full" }, df = {
9222
9225
  "action-message-row-class": s.actionMessageRowClass,
9223
9226
  onContextmenu: (e) => j(ne)(o, e),
9224
9227
  onTap: (e) => j(B)(o, e),
9225
- onOpenMedia: oe,
9226
- onVotePoll: (e) => se(o, e),
9227
- onToggleReaction: (e) => j(V)(o, e),
9228
- onOpenThread: (e) => ce(o),
9228
+ onOpenMedia: se,
9229
+ onVotePoll: (e) => ce(o, e),
9230
+ onToggleReaction: (e) => j(ae)(o, e),
9231
+ onOpenThread: (e) => le(o),
9229
9232
  onOpenReferencedMessage: n[0] ||= (e) => j(f).emit("message:openReference", e),
9230
9233
  onAnchorclick: n[1] ||= (e, n) => t.$emit("anchorclick", e, n)
9231
9234
  }, null, 8, [
@@ -9247,14 +9250,14 @@ var uf = { class: "w-full" }, df = {
9247
9250
  ])], 34), o("footer", { class: g(["message-list__composer flex shrink-0 flex-col", P.value ? F.value ? "bg-transparent p-0" : "message-list__composer--thread" : "bg-transparent p-0"]) }, [E(t.$slots, "composer", {}, void 0, !0)], 2)], 2)) : (S(), a("div", rm, k(j(c)("selectConversationToStart")), 1))], 2),
9248
9251
  l(Ef, {
9249
9252
  attachment: M.value,
9250
- onClose: U
9253
+ onClose: H
9251
9254
  }, null, 8, ["attachment"]),
9252
9255
  l(Kp, {
9253
9256
  ref_key: "actionMenuRef",
9254
- ref: te,
9257
+ ref: R,
9255
9258
  message: j(z),
9256
9259
  "can-react": j(u).canReact.value,
9257
- "action-items": j(z) ? j(ae)(j(z)) : [],
9260
+ "action-items": j(z) ? j(oe)(j(z)) : [],
9258
9261
  onHide: j(re),
9259
9262
  onReact: n[3] ||= (e) => j(ie)(j(z), e)
9260
9263
  }, null, 8, [
@@ -9283,7 +9286,7 @@ var uf = { class: "w-full" }, df = {
9283
9286
  return (n, r) => (S(), a("section", um, [o("div", dm, [o("p", fm, k(t.title), 1), o("span", pm, k(t.receipts.length), 1)]), t.receipts.length ? (S(), a("div", mm, [(S(!0), a(e, null, T(t.receipts, (e) => (S(), a("div", {
9284
9287
  key: `${e.kind}-${e.user.uid}`,
9285
9288
  class: "receipt-section__row"
9286
- }, [o("div", hm, [l(j(te), {
9289
+ }, [o("div", hm, [l(j(R), {
9287
9290
  image: e.user.avatar,
9288
9291
  label: e.user.avatar ? void 0 : e.user.name.slice(0, 1).toUpperCase(),
9289
9292
  shape: "circle",
@@ -9313,12 +9316,12 @@ var uf = { class: "w-full" }, df = {
9313
9316
  },
9314
9317
  emits: ["close"],
9315
9318
  setup(e, { emit: t }) {
9316
- let s = e, c = t, { locale: u, t: d } = q(), f = ju(), p = n(() => s.receipts.filter((e) => e.kind === "delivered")), m = n(() => s.receipts.filter((e) => e.kind === "read")), h = n(() => s.receipts.filter((e) => e.kind === "delivered" || e.kind === "read"));
9319
+ let s = e, c = t, { locale: u, t: d } = K(), f = ju(), p = n(() => s.receipts.filter((e) => e.kind === "delivered")), m = n(() => s.receipts.filter((e) => e.kind === "read")), h = n(() => s.receipts.filter((e) => e.kind === "delivered" || e.kind === "read"));
9317
9320
  function g(e) {
9318
9321
  return e ? new Intl.DateTimeFormat(u.value, {
9319
9322
  dateStyle: "medium",
9320
9323
  timeStyle: "short",
9321
- hourCycle: ht()
9324
+ hourCycle: gt()
9322
9325
  }).format(e) : d("notYet");
9323
9326
  }
9324
9327
  function _(e, t) {
@@ -9333,19 +9336,19 @@ var uf = { class: "w-full" }, df = {
9333
9336
  }, {
9334
9337
  default: I(() => [e.message ? (S(), a("div", Sm, [o("div", Cm, [o("p", wm, k(j(Ws)(e.message, j(d)("message"), j(f).mentionNameByUid.value)), 1), o("div", Tm, [
9335
9338
  o("div", Em, [o("p", Dm, k(j(d)("sent")), 1), o("p", Om, k(g(e.message.sentAt)), 1)]),
9336
- o("div", km, [o("div", Am, [o("p", jm, k(j(d)("deliveredToAll")), 1), h.value.length ? (S(), r(j(oe), {
9339
+ o("div", km, [o("div", Am, [o("p", jm, k(j(d)("deliveredToAll")), 1), h.value.length ? (S(), r(j(se), {
9337
9340
  key: 0,
9338
9341
  text: String(h.value.length),
9339
9342
  context: "secondary",
9340
9343
  rounded: ""
9341
9344
  }, null, 8, ["text"])) : i("", !0)]), o("p", Mm, k(_(e.message.receipts.deliveredAt, h.value.length)), 1)]),
9342
- o("div", Nm, [o("div", Pm, [o("p", Fm, k(j(d)("readByAll")), 1), m.value.length ? (S(), r(j(oe), {
9345
+ o("div", Nm, [o("div", Pm, [o("p", Fm, k(j(d)("readByAll")), 1), m.value.length ? (S(), r(j(se), {
9343
9346
  key: 0,
9344
9347
  text: String(m.value.length),
9345
9348
  context: "success",
9346
9349
  rounded: ""
9347
9350
  }, null, 8, ["text"])) : i("", !0)]), o("p", Im, k(_(e.message.receipts.readAt, m.value.length)), 1)])
9348
- ])]), e.loading ? (S(), a("div", Lm, [l(j(H), {
9351
+ ])]), e.loading ? (S(), a("div", Lm, [l(j(V), {
9349
9352
  style: {
9350
9353
  width: "2.5rem",
9351
9354
  height: "2.5rem"
@@ -9420,7 +9423,7 @@ var uf = { class: "w-full" }, df = {
9420
9423
  "editText"
9421
9424
  ],
9422
9425
  setup(t, { emit: s }) {
9423
- let c = t, u = s, d = w(null), f = w(null), p = w(!1), m = w(""), h = w(""), g = w(""), { locale: _, t: v } = q(), y = n(() => c.messages.filter((e) => !e.isDeleted && !!e.scheduled?.scheduleDate)), b = n(() => /^([01]\d|2[0-3]):([0-5]\d)$/.test(h.value));
9426
+ let c = t, u = s, d = w(null), f = w(null), p = w(!1), m = w(""), h = w(""), g = w(""), { locale: _, t: v } = K(), y = n(() => c.messages.filter((e) => !e.isDeleted && !!e.scheduled?.scheduleDate)), b = n(() => /^([01]\d|2[0-3]):([0-5]\d)$/.test(h.value));
9424
9427
  F(() => c.open, (e) => {
9425
9428
  e || (d.value = null, f.value = null, p.value = !1, m.value = "", h.value = "", g.value = "");
9426
9429
  });
@@ -9428,7 +9431,7 @@ var uf = { class: "w-full" }, df = {
9428
9431
  return e ? new Intl.DateTimeFormat(_.value, {
9429
9432
  dateStyle: "medium",
9430
9433
  timeStyle: "short",
9431
- hourCycle: ht()
9434
+ hourCycle: gt()
9432
9435
  }).format(e) : v("unscheduled");
9433
9436
  }
9434
9437
  function C(e) {
@@ -9460,10 +9463,10 @@ var uf = { class: "w-full" }, df = {
9460
9463
  function P() {
9461
9464
  p.value = !0;
9462
9465
  }
9463
- function R(e) {
9466
+ function L(e) {
9464
9467
  return e.attachments.length ? !(d.value === e.id && p.value) : !1;
9465
9468
  }
9466
- function te(e) {
9469
+ function R(e) {
9467
9470
  if (!e.scheduled?.messageId || !e.scheduled?.muid || !e.scheduled?.originalChatUid || !m.value || !b.value) return;
9468
9471
  let [t, n, r] = m.value.split("-").map(Number), [i, a] = h.value.split(":").map(Number), o = new Date(t, n - 1, r, i, a, 0, 0);
9469
9472
  u("reschedule", {
@@ -9494,7 +9497,7 @@ var uf = { class: "w-full" }, df = {
9494
9497
  "close-label": j(v)("close"),
9495
9498
  onClose: s[3] ||= (e) => u("close")
9496
9499
  }, {
9497
- default: I(() => [o("div", Vm, [t.loading ? (S(), a("div", Hm, [l(j(H), {
9500
+ default: I(() => [o("div", Vm, [t.loading ? (S(), a("div", Hm, [l(j(V), {
9498
9501
  style: {
9499
9502
  width: "2.75rem",
9500
9503
  height: "2.75rem"
@@ -9504,33 +9507,33 @@ var uf = { class: "w-full" }, df = {
9504
9507
  key: e.id,
9505
9508
  class: "border-default rounded-lg border px-4 py-3"
9506
9509
  }, [o("div", Gm, [o("div", Km, [
9507
- o("div", qm, [o("div", Jm, [e.kind === "poll" ? (S(), r(j(oe), {
9510
+ o("div", qm, [o("div", Jm, [e.kind === "poll" ? (S(), r(j(se), {
9508
9511
  key: 0,
9509
9512
  text: j(v)("poll"),
9510
9513
  context: "info",
9511
9514
  rounded: ""
9512
- }, null, 8, ["text"])) : e.attachments.length ? (S(), r(j(oe), {
9515
+ }, null, 8, ["text"])) : e.attachments.length ? (S(), r(j(se), {
9513
9516
  key: 1,
9514
9517
  text: D(e.attachments[0].kind),
9515
9518
  context: "info",
9516
9519
  rounded: ""
9517
- }, null, 8, ["text"])) : (S(), r(j(oe), {
9520
+ }, null, 8, ["text"])) : (S(), r(j(se), {
9518
9521
  key: 2,
9519
9522
  text: j(v)("message"),
9520
9523
  context: "info",
9521
9524
  rounded: ""
9522
9525
  }, null, 8, ["text"]))]), l(j(z), {
9523
- icon: j(me),
9526
+ icon: j(he),
9524
9527
  text: "",
9525
9528
  size: "small",
9526
9529
  onClick: (t) => B(e)
9527
9530
  }, null, 8, ["icon", "onClick"])]),
9528
9531
  o("div", Ym, [o("p", Xm, k(x(e.scheduled?.scheduleDate)), 1), e.kind === "poll" && e.poll ? (S(), a("p", Zm, k(e.poll.question), 1)) : (S(), a("p", Qm, k(j(Ws)(e, j(v)("attachment"))), 1))]),
9529
- R(e) && !(d.value === e.id && f.value === "text") ? (S(), a("div", $m, [l(cp, { message: ee(e) }, null, 8, ["message"])])) : i("", !0)
9532
+ L(e) && !(d.value === e.id && f.value === "text") ? (S(), a("div", $m, [l(cp, { message: ee(e) }, null, 8, ["message"])])) : i("", !0)
9530
9533
  ]), o("div", eh, [e.kind === "poll" ? i("", !0) : (S(), r(j(z), {
9531
9534
  key: 0,
9532
9535
  label: j(v)("edit"),
9533
- icon: j(ve),
9536
+ icon: j(ye),
9534
9537
  severity: "secondary",
9535
9538
  size: "small",
9536
9539
  onClick: (t) => A(e)
@@ -9541,7 +9544,7 @@ var uf = { class: "w-full" }, df = {
9541
9544
  ])), e.scheduled?.messageId && e.scheduled?.muid && e.scheduled?.originalChatUid ? (S(), r(j(z), {
9542
9545
  key: 1,
9543
9546
  label: j(v)("reschedule"),
9544
- icon: j(le),
9547
+ icon: j(ue),
9545
9548
  severity: "secondary",
9546
9549
  size: "small",
9547
9550
  onClick: (t) => O(e)
@@ -9549,11 +9552,11 @@ var uf = { class: "w-full" }, df = {
9549
9552
  "label",
9550
9553
  "icon",
9551
9554
  "onClick"
9552
- ])) : i("", !0)])]), d.value === e.id && f.value === "reschedule" ? (S(), a("div", th, [o("div", nh, [L(o("input", {
9555
+ ])) : i("", !0)])]), d.value === e.id && f.value === "reschedule" ? (S(), a("div", th, [o("div", nh, [te(o("input", {
9553
9556
  "onUpdate:modelValue": s[0] ||= (e) => m.value = e,
9554
9557
  type: "date",
9555
9558
  class: "surface-input body-md w-full rounded-xl p-2 ring-0 outline-none"
9556
- }, null, 512), [[N, m.value]]), L(o("input", {
9559
+ }, null, 512), [[N, m.value]]), te(o("input", {
9557
9560
  "onUpdate:modelValue": s[1] ||= (e) => h.value = e,
9558
9561
  type: "time",
9559
9562
  inputmode: "numeric",
@@ -9565,7 +9568,7 @@ var uf = { class: "w-full" }, df = {
9565
9568
  label: j(v)("save"),
9566
9569
  size: "small",
9567
9570
  disabled: !m.value || !b.value,
9568
- onClick: (t) => te(e)
9571
+ onClick: (t) => R(e)
9569
9572
  }, null, 8, [
9570
9573
  "label",
9571
9574
  "disabled",
@@ -9576,8 +9579,8 @@ var uf = { class: "w-full" }, df = {
9576
9579
  text: "",
9577
9580
  onClick: M
9578
9581
  }, null, 8, ["label"])])])) : d.value === e.id && f.value === "text" ? (S(), a("div", ih, [
9579
- R(e) ? (S(), a("div", ah, [l(cp, { message: ee(e) }, null, 8, ["message"]), o("div", oh, [l(j(z), {
9580
- icon: j(de),
9582
+ L(e) ? (S(), a("div", ah, [l(cp, { message: ee(e) }, null, 8, ["message"]), o("div", oh, [l(j(z), {
9583
+ icon: j(fe),
9581
9584
  "aria-label": j(v)("remove"),
9582
9585
  text: "",
9583
9586
  rounded: "",
@@ -9585,7 +9588,7 @@ var uf = { class: "w-full" }, df = {
9585
9588
  size: "small",
9586
9589
  onClick: P
9587
9590
  }, null, 8, ["icon", "aria-label"])])])) : i("", !0),
9588
- L(o("textarea", {
9591
+ te(o("textarea", {
9589
9592
  "onUpdate:modelValue": s[2] ||= (e) => g.value = e,
9590
9593
  rows: "3",
9591
9594
  class: "surface-input body-md w-full rounded-xl px-3 py-2 ring-0 outline-none",
@@ -9684,8 +9687,8 @@ var uf = { class: "w-full" }, df = {
9684
9687
  "linkClicked",
9685
9688
  "chatNotAMember"
9686
9689
  ],
9687
- setup(t, { expose: o, emit: u }) {
9688
- function f(e) {
9690
+ setup(t, { expose: r, emit: o }) {
9691
+ function u(e) {
9689
9692
  let t = /* @__PURE__ */ new Set(), n = [], r = (r) => {
9690
9693
  !r.uid || r.uid === e.currentUserId || t.has(r.uid) || (t.add(r.uid), n.push(r));
9691
9694
  };
@@ -9698,121 +9701,121 @@ var uf = { class: "w-full" }, df = {
9698
9701
  });
9699
9702
  return n;
9700
9703
  }
9701
- let p = t, m = u, { t: h } = q(() => p.language), v = w(null), x = w(!1), C = w(!1), T = w(!1), D = n(() => p.client ?? Q.value ?? null), O = n(() => !!p.chatUid), A = n(() => {
9702
- if (p.conversation !== void 0) return p.conversation;
9703
- let e = D.value;
9704
- return e ? p.chatUid ? e.conversations.value.find((e) => e.targetId === p.chatUid || e.id === p.chatUid) ?? null : e.activeConversation.value : null;
9705
- }), { groupMembers: M, fetchGroupMembers: N } = Qu({
9706
- getConversationTargetId: () => A.value?.targetId,
9707
- isChannel: () => vu(A.value),
9704
+ let f = t, p = o, { t: m } = K(() => f.language), h = w(null), v = w(!1), x = w(!1), C = w(!1), T = n(() => f.client ?? Q.value ?? null), D = n(() => !!f.chatUid), O = n(() => {
9705
+ if (f.conversation !== void 0) return f.conversation;
9706
+ let e = T.value;
9707
+ return e ? f.chatUid ? e.conversations.value.find((e) => e.targetId === f.chatUid || e.id === f.chatUid) ?? null : e.activeConversation.value : null;
9708
+ }), { groupMembers: A, fetchGroupMembers: M } = Qu({
9709
+ getConversationTargetId: () => O.value?.targetId,
9710
+ isChannel: () => vu(O.value),
9708
9711
  onMembersChanged: (e) => {
9709
- m("chatMembersFetched", e), D.value?.rememberMentionDisplayNames(e);
9712
+ p("chatMembersFetched", e), T.value?.rememberMentionDisplayNames(e);
9710
9713
  }
9711
- }), P = Ou({
9712
- chatClient: D,
9713
- selectedConversation: A,
9714
- getPropIsReadOnly: () => p.isReadOnly,
9715
- getPropSendOptions: () => p.sendOptions,
9716
- getSenderDisplayName: () => p.senderDisplayName,
9717
- getMentionCandidates: () => f({
9718
- groupMembers: M.value,
9719
- messages: p.messages ?? D.value?.messages.value ?? [],
9720
- currentUserId: D.value?.currentUser.value?.uid
9714
+ }), N = Ou({
9715
+ chatClient: T,
9716
+ selectedConversation: O,
9717
+ getPropIsReadOnly: () => f.isReadOnly,
9718
+ getPropSendOptions: () => f.sendOptions,
9719
+ getSenderDisplayName: () => f.senderDisplayName,
9720
+ getMentionCandidates: () => u({
9721
+ groupMembers: A.value,
9722
+ messages: f.messages ?? T.value?.messages.value ?? [],
9723
+ currentUserId: T.value?.currentUser.value?.uid
9721
9724
  })
9722
9725
  });
9723
- Au(P);
9724
- let L = Mu({
9725
- chatClient: D,
9726
- selectedConversation: A,
9727
- usesPublicContract: O,
9728
- loadingChat: C,
9729
- getPropMessages: () => p.messages,
9730
- getPropThreadMessages: () => p.threadMessages,
9731
- getPropLoadingMessages: () => p.loadingMessages,
9732
- getPropLoadingThreadMessages: () => p.loadingThreadMessages,
9733
- getPropShowDefaultEmptyState: () => p.showDefaultEmptyState,
9734
- getHideDeletedMessages: () => p.hideDeletedMessages
9726
+ Au(N);
9727
+ let P = Mu({
9728
+ chatClient: T,
9729
+ selectedConversation: O,
9730
+ usesPublicContract: D,
9731
+ loadingChat: x,
9732
+ getPropMessages: () => f.messages,
9733
+ getPropThreadMessages: () => f.threadMessages,
9734
+ getPropLoadingMessages: () => f.loadingMessages,
9735
+ getPropLoadingThreadMessages: () => f.loadingThreadMessages,
9736
+ getPropShowDefaultEmptyState: () => f.showDefaultEmptyState,
9737
+ getHideDeletedMessages: () => f.hideDeletedMessages
9735
9738
  });
9736
- Pu(L);
9737
- let R = n(() => L.messages.value.length > 0), te = n(() => p.showHeader ?? p.showMessageHeader), z = Hu({
9738
- chatClient: D,
9739
- selectedConversation: A,
9740
- getInitialScheduledMessagesOpen: () => !!p.initialScheduledMessagesOpen,
9741
- fetchErrorFallback: h("loadMessageReceiptsError")
9739
+ Pu(P);
9740
+ let te = n(() => P.messages.value.length > 0), L = n(() => f.showHeader ?? f.showMessageHeader), R = Hu({
9741
+ chatClient: T,
9742
+ selectedConversation: O,
9743
+ getInitialScheduledMessagesOpen: () => !!f.initialScheduledMessagesOpen,
9744
+ fetchErrorFallback: m("loadMessageReceiptsError")
9742
9745
  });
9743
- Wu(z);
9744
- let ne = ee("mainComposerRef"), B = ee("threadComposerRef"), re = Lu({
9745
- chatClient: D,
9746
- sendOptions: P.sendOptions,
9747
- mentionNameByUid: P.mentionNameByUid,
9748
- afterSchedule: () => z.openScheduledMessages(),
9749
- mainComposerRef: ne,
9750
- threadComposerRef: B
9746
+ Wu(R);
9747
+ let z = ee("mainComposerRef"), ne = ee("threadComposerRef"), B = Lu({
9748
+ chatClient: T,
9749
+ sendOptions: N.sendOptions,
9750
+ mentionNameByUid: N.mentionNameByUid,
9751
+ afterSchedule: () => R.openScheduledMessages(),
9752
+ mainComposerRef: z,
9753
+ threadComposerRef: ne
9751
9754
  });
9752
- zu(re);
9753
- let ie = Ju();
9754
- Yu(ie), Ku({
9755
- conversation: P,
9756
- composer: re,
9757
- dialogs: z,
9758
- bus: ie
9755
+ zu(B);
9756
+ let re = Ju();
9757
+ Yu(re), Ku({
9758
+ conversation: N,
9759
+ composer: B,
9760
+ dialogs: R,
9761
+ bus: re
9759
9762
  });
9760
- let { scrollToRequestedMessage: V } = $u({
9761
- chatRootRef: v,
9762
- getClient: () => D.value
9763
+ let { scrollToRequestedMessage: ie } = $u({
9764
+ chatRootRef: h,
9765
+ getClient: () => T.value
9763
9766
  });
9764
- F(() => A.value?.targetId ?? null, () => {
9765
- z.refreshScheduledMessages();
9766
- }, { immediate: !0 }), F(() => A.value?.targetId ?? null, async (e) => {
9767
- !e || A.value?.type !== "group" || await N(e);
9768
- }, { immediate: !0 }), F(() => A.value?.id, () => {
9769
- re.resetMainComposer(), re.resetThreadComposer(), z.showScheduledMessages.value = !1, z.closeMessageInfo();
9770
- }), F(() => p.chatMessageGetter, (e) => {
9767
+ F(() => O.value?.targetId ?? null, () => {
9768
+ R.refreshScheduledMessages();
9769
+ }, { immediate: !0 }), F(() => O.value?.targetId ?? null, async (e) => {
9770
+ !e || O.value?.type !== "group" || await M(e);
9771
+ }, { immediate: !0 }), F(() => O.value?.id, () => {
9772
+ B.resetMainComposer(), B.resetThreadComposer(), R.showScheduledMessages.value = !1, R.closeMessageInfo();
9773
+ }), F(() => f.chatMessageGetter, (e) => {
9771
9774
  gu.setGetChatMessagesCallback(e);
9772
- }, { immediate: !0 }), F(() => p.language, (e) => {
9773
- e && gt(e);
9774
- }, { immediate: !0 }), F(L.isChatEmpty, (e) => {
9775
- e && m("chatEmpty");
9775
+ }, { immediate: !0 }), F(() => f.language, (e) => {
9776
+ e && _t(e);
9777
+ }, { immediate: !0 }), F(P.isChatEmpty, (e) => {
9778
+ e && p("chatEmpty");
9776
9779
  }), F([
9777
- () => p.chatUid,
9778
- () => p.client ? p.client.initialized.value : gu.initialized.value,
9779
- () => p.client ? p.client.loggedIn.value : gu.loggedIn.value,
9780
- () => D.value?.conversations.value.length ?? 0
9780
+ () => f.chatUid,
9781
+ () => f.client ? f.client.initialized.value : gu.initialized.value,
9782
+ () => f.client ? f.client.loggedIn.value : gu.loggedIn.value,
9783
+ () => T.value?.conversations.value.length ?? 0
9781
9784
  ], async ([e, t, n]) => {
9782
- !O.value || !e || !t || !n || !D.value || await H();
9785
+ !D.value || !e || !t || !n || !T.value || await ae();
9783
9786
  }, { immediate: !0 }), F([
9784
- () => L.messages.value.length,
9785
- () => L.threadMessages.value.length,
9787
+ () => P.messages.value.length,
9788
+ () => P.threadMessages.value.length,
9786
9789
  () => gu.scrollToMessageId.value
9787
9790
  ], async () => {
9788
- await V();
9791
+ await ie();
9789
9792
  });
9790
- async function H() {
9791
- let e = D.value;
9793
+ async function ae() {
9794
+ let e = T.value;
9792
9795
  if (e) {
9793
- C.value = !0, x.value = !1, T.value = !1;
9796
+ x.value = !0, v.value = !1, C.value = !1;
9794
9797
  try {
9795
9798
  e.conversations.value.length === 0 && await e.fetchConversations();
9796
- let t = e.conversations.value.find((e) => e.targetId === p.chatUid || e.id === p.chatUid) ?? null;
9799
+ let t = e.conversations.value.find((e) => e.targetId === f.chatUid || e.id === f.chatUid) ?? null;
9797
9800
  if (!t) try {
9798
- t = await oe(p.chatUid, e);
9801
+ t = await V(f.chatUid, e);
9799
9802
  } catch (e) {
9800
9803
  if (e && typeof e == "object" && "code" in e && e.code === "ERR_NOT_A_MEMBER") {
9801
- x.value = !1, T.value = !0, m("chatMembersFetched", []);
9804
+ v.value = !1, C.value = !0, p("chatMembersFetched", []);
9802
9805
  return;
9803
9806
  }
9804
9807
  }
9805
9808
  if (!t) {
9806
- x.value = !0, T.value = !1, m("chatMembersFetched", []);
9809
+ v.value = !0, C.value = !1, p("chatMembersFetched", []);
9807
9810
  return;
9808
9811
  }
9809
- e.activeConversationId.value !== t.id && await e.selectConversation(t.id), await N(t.targetId);
9812
+ e.activeConversationId.value !== t.id && await e.selectConversation(t.id), await M(t.targetId);
9810
9813
  } finally {
9811
- C.value = !1;
9814
+ x.value = !1;
9812
9815
  }
9813
9816
  }
9814
9817
  }
9815
- async function oe(e, t) {
9818
+ async function V(e, t) {
9816
9819
  let n = await gu.getGroup(e, !0);
9817
9820
  if (!n || typeof n != "object") return null;
9818
9821
  let r = String(n.getGuid());
@@ -9831,51 +9834,53 @@ var uf = { class: "w-full" }, df = {
9831
9834
  };
9832
9835
  return t.conversations.value = [i, ...t.conversations.value.filter((e) => e.id !== i.id && e.targetId !== r)], i;
9833
9836
  }
9834
- function U(e, t) {
9835
- m("linkClicked", e, t);
9837
+ function se(e, t) {
9838
+ p("linkClicked", e, t);
9836
9839
  }
9837
- let se = w(!1);
9840
+ let H = w(!1);
9838
9841
  b(() => {
9839
9842
  setTimeout(() => {
9840
- se.value = !0;
9843
+ H.value = !0;
9841
9844
  }, 200);
9842
9845
  }), y(() => {
9843
- let e = D.value;
9844
- e && e.activeConversation.value === A.value && e.selectConversation(null);
9846
+ let e = T.value;
9847
+ e && e.activeConversation.value === O.value && e.selectConversation(null);
9845
9848
  });
9846
9849
  async function ce(e) {
9847
- return await new Promise((e) => setTimeout(e, 100)), se.value ? V(e) : (await new Promise((e) => setTimeout(e, 110)), ce(e));
9850
+ return await new Promise((e) => setTimeout(e, 100)), H.value ? ie(e) : (await new Promise((e) => setTimeout(e, 110)), ce(e));
9848
9851
  }
9849
- return o({
9852
+ return r({
9850
9853
  scrollToMessage: ce,
9851
- groupMembers: n(() => M.value)
9852
- }), (n, o) => (S(), a("div", {
9854
+ groupMembers: n(() => A.value)
9855
+ }), (n, r) => (S(), a("div", {
9853
9856
  ref_key: "chatRootRef",
9854
- ref: v,
9857
+ ref: h,
9855
9858
  class: "text-default relative h-full min-h-104"
9856
9859
  }, [
9857
- O.value && D.value?.error.value ? (S(), r(j(ae), {
9860
+ D.value && T.value?.error.value ? E(n.$slots, "error-message", {
9858
9861
  key: 0,
9862
+ message: T.value.error.value
9863
+ }, () => [l(j(oe), {
9859
9864
  severity: "error",
9860
9865
  closable: !1,
9861
9866
  class: "pointer-events-auto absolute inset-x-2 top-2 z-20 shadow-lg"
9862
9867
  }, {
9863
- default: I(() => [c(k(D.value.error.value), 1)]),
9868
+ default: I(() => [c(k(T.value.error.value), 1)]),
9864
9869
  _: 1
9865
- })) : i("", !0),
9866
- D.value ? (S(), a(e, { key: 1 }, [
9870
+ })]) : i("", !0),
9871
+ T.value ? (S(), a(e, { key: 1 }, [
9867
9872
  l(lm, {
9868
9873
  target: "main",
9869
9874
  class: g(["h-full", t.containerClass]),
9870
9875
  "hide-group-actions": t.hideGroupActions,
9871
- "show-header": te.value,
9876
+ "show-header": L.value,
9872
9877
  "action-message-class": t.actionMessageClass,
9873
9878
  "action-message-row-class": t.actionMessageRowClass,
9874
- onAnchorclick: U
9879
+ onAnchorclick: se
9875
9880
  }, s({
9876
9881
  composer: I(() => [l(Zd, {
9877
9882
  ref_key: "mainComposerRef",
9878
- ref: ne,
9883
+ ref: z,
9879
9884
  target: "main"
9880
9885
  }, null, 512)]),
9881
9886
  _: 2
@@ -9891,12 +9896,12 @@ var uf = { class: "w-full" }, df = {
9891
9896
  "action-message-row-class"
9892
9897
  ]),
9893
9898
  l(ff, {
9894
- open: !!j(L).activeThreadParentMessage.value,
9895
- title: j(h)("threadWithCount", { count: j(L).activeThreadParentMessage.value?.replyCount ?? 0 }),
9896
- subtitle: A.value?.title ?? "",
9897
- "close-label": j(h)("close"),
9898
- "close-aria-label": j(h)("closeThread"),
9899
- onClose: o[0] ||= (e) => j(ie).emit("ui:closeThread")
9899
+ open: !!j(P).activeThreadParentMessage.value,
9900
+ title: j(m)("threadWithCount", { count: j(P).activeThreadParentMessage.value?.replyCount ?? 0 }),
9901
+ subtitle: O.value?.title ?? "",
9902
+ "close-label": j(m)("close"),
9903
+ "close-aria-label": j(m)("closeThread"),
9904
+ onClose: r[0] ||= (e) => j(re).emit("ui:closeThread")
9900
9905
  }, {
9901
9906
  default: I(() => [l(lm, {
9902
9907
  target: "thread",
@@ -9906,7 +9911,7 @@ var uf = { class: "w-full" }, df = {
9906
9911
  }, {
9907
9912
  composer: I(() => [l(Zd, {
9908
9913
  ref_key: "threadComposerRef",
9909
- ref: B,
9914
+ ref: ne,
9910
9915
  target: "thread"
9911
9916
  }, null, 512)]),
9912
9917
  _: 1
@@ -9920,14 +9925,14 @@ var uf = { class: "w-full" }, df = {
9920
9925
  "close-aria-label"
9921
9926
  ]),
9922
9927
  l(lh, {
9923
- open: j(z).showScheduledMessages.value,
9924
- loading: j(z).loadingScheduledMessages.value,
9925
- messages: j(z).scheduledMessages.value,
9926
- "conversation-title": A.value?.title,
9927
- onClose: o[1] ||= (e) => j(z).showScheduledMessages.value = !1,
9928
- onReschedule: o[2] ||= (e) => j(ie).emit("ui:reschedule", e),
9929
- onRemove: o[3] ||= (e) => j(ie).emit("ui:removeScheduled", e),
9930
- onEditText: o[4] ||= (e) => j(ie).emit("ui:editScheduledText", e)
9928
+ open: j(R).showScheduledMessages.value,
9929
+ loading: j(R).loadingScheduledMessages.value,
9930
+ messages: j(R).scheduledMessages.value,
9931
+ "conversation-title": O.value?.title,
9932
+ onClose: r[1] ||= (e) => j(R).showScheduledMessages.value = !1,
9933
+ onReschedule: r[2] ||= (e) => j(re).emit("ui:reschedule", e),
9934
+ onRemove: r[3] ||= (e) => j(re).emit("ui:removeScheduled", e),
9935
+ onEditText: r[4] ||= (e) => j(re).emit("ui:editScheduledText", e)
9931
9936
  }, null, 8, [
9932
9937
  "open",
9933
9938
  "loading",
@@ -9935,12 +9940,12 @@ var uf = { class: "w-full" }, df = {
9935
9940
  "conversation-title"
9936
9941
  ]),
9937
9942
  l(Bm, {
9938
- open: !!j(z).infoMessage.value,
9939
- message: j(z).infoMessage.value,
9940
- receipts: j(z).infoMessageReceipts.value,
9941
- loading: j(z).loadingMessageReceipts.value,
9942
- error: j(z).messageReceiptsError.value,
9943
- onClose: o[5] ||= (e) => j(z).closeMessageInfo()
9943
+ open: !!j(R).infoMessage.value,
9944
+ message: j(R).infoMessage.value,
9945
+ receipts: j(R).infoMessageReceipts.value,
9946
+ loading: j(R).loadingMessageReceipts.value,
9947
+ error: j(R).messageReceiptsError.value,
9948
+ onClose: r[5] ||= (e) => j(R).closeMessageInfo()
9944
9949
  }, null, 8, [
9945
9950
  "open",
9946
9951
  "message",
@@ -9950,21 +9955,21 @@ var uf = { class: "w-full" }, df = {
9950
9955
  ])
9951
9956
  ], 64)) : i("", !0),
9952
9957
  l(_h, {
9953
- visible: O.value && (D.value?.offlineMode.value || !D.value?.connected.value || C.value && !R.value || x.value || T.value || t.displayNoMessagesText && j(L).isChatEmpty.value),
9954
- "offline-mode": !!(D.value?.offlineMode.value && !A.value),
9955
- connected: !!(D.value?.connected.value || A.value),
9956
- loading: C.value,
9957
- "not-found": x.value,
9958
- "not-a-member": T.value,
9959
- "is-empty": j(L).isChatEmpty.value,
9958
+ visible: D.value && (T.value?.offlineMode.value || !T.value?.connected.value || x.value && !te.value || v.value || C.value || t.displayNoMessagesText && j(P).isChatEmpty.value),
9959
+ "offline-mode": !!(T.value?.offlineMode.value && !O.value),
9960
+ connected: !!(T.value?.connected.value || O.value),
9961
+ loading: x.value,
9962
+ "not-found": v.value,
9963
+ "not-a-member": C.value,
9964
+ "is-empty": j(P).isChatEmpty.value,
9960
9965
  "show-empty-slot": t.displayNoMessagesText,
9961
9966
  messages: {
9962
- waitingForNetwork: j(h)("waitingForNetwork"),
9963
- connecting: j(h)("connecting"),
9964
- loading: j(h)("loadingChat"),
9965
- notFound: j(h)("chatNotFound"),
9966
- noMessages: j(h)("noMessagesHaveBeenSentYet"),
9967
- notAMember: j(h)("chatNotAMember")
9967
+ waitingForNetwork: j(m)("waitingForNetwork"),
9968
+ connecting: j(m)("connecting"),
9969
+ loading: j(m)("loadingChat"),
9970
+ notFound: j(m)("chatNotFound"),
9971
+ noMessages: j(m)("noMessagesHaveBeenSentYet"),
9972
+ notAMember: j(m)("chatNotAMember")
9968
9973
  }
9969
9974
  }, s({ _: 2 }, [n.$slots["no-messages"] ? {
9970
9975
  name: "no-messages",