@paramms/chat-widget 1.0.26 → 1.0.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/embed.js +4 -4
- package/dist/embed.js.map +1 -1
- package/dist/index.js +51 -55
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var De = Object.defineProperty;
|
|
2
2
|
var _e = (s, e, t) => e in s ? De(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
|
|
3
3
|
var a = (s, e, t) => _e(s, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
import { p as $e, r as
|
|
4
|
+
import { p as $e, r as He, a as Re } from "./uid.js";
|
|
5
5
|
import { h as nn } from "./uid.js";
|
|
6
6
|
const Gt = (s) => s;
|
|
7
7
|
function Fe(s) {
|
|
@@ -1214,7 +1214,7 @@ class Et {
|
|
|
1214
1214
|
var n, i;
|
|
1215
1215
|
if (this.state === "connecting" || this.state === "open") return;
|
|
1216
1216
|
this.stopped = !1, this.state = "connecting", this.authed = !1, (i = (n = this.opts).onStatusChange) == null || i.call(n, this.attempt > 0 ? "reconnecting" : "connecting");
|
|
1217
|
-
const t = (this.opts.socketFactory ??
|
|
1217
|
+
const t = (this.opts.socketFactory ?? Pt)(this.opts.url);
|
|
1218
1218
|
t.binaryType = "arraybuffer", this.socket = t, t.onopen = () => {
|
|
1219
1219
|
this.raw({ type: "auth", token: this.opts.token });
|
|
1220
1220
|
}, t.onmessage = (o) => {
|
|
@@ -1283,23 +1283,19 @@ class Et {
|
|
|
1283
1283
|
this.attempt++, this.attempt >= 3 && !this.everAuthed && ((o = (i = this.opts).onStatusChange) == null || o.call(i, "reconnecting", "Can't reach chat — retrying…")), this.timer = setTimeout(() => this.connect(), n);
|
|
1284
1284
|
}
|
|
1285
1285
|
}
|
|
1286
|
-
const Tt = /* @__PURE__ */ new Set(["UNAUTHORIZED"
|
|
1286
|
+
const Tt = /* @__PURE__ */ new Set(["UNAUTHORIZED"]);
|
|
1287
1287
|
function Ut(s) {
|
|
1288
1288
|
switch (s) {
|
|
1289
1289
|
case "UNAUTHORIZED":
|
|
1290
1290
|
return "Chat unavailable — sign-in/token was rejected";
|
|
1291
|
-
case "FORBIDDEN":
|
|
1292
|
-
return "Chat unavailable";
|
|
1293
|
-
case "NOT_FOUND":
|
|
1294
|
-
return "This chat isn't available";
|
|
1295
1291
|
default:
|
|
1296
1292
|
return "Chat unavailable";
|
|
1297
1293
|
}
|
|
1298
1294
|
}
|
|
1299
|
-
function
|
|
1295
|
+
function Pt(s) {
|
|
1300
1296
|
return new WebSocket(s);
|
|
1301
1297
|
}
|
|
1302
|
-
const ge = 200,
|
|
1298
|
+
const ge = 200, Bt = 7 * 864e5;
|
|
1303
1299
|
class At {
|
|
1304
1300
|
constructor(e) {
|
|
1305
1301
|
a(this, "key");
|
|
@@ -1310,7 +1306,7 @@ class At {
|
|
|
1310
1306
|
try {
|
|
1311
1307
|
const e = localStorage.getItem(this.key);
|
|
1312
1308
|
if (!e) return [];
|
|
1313
|
-
const t = JSON.parse(e), n = Date.now() -
|
|
1309
|
+
const t = JSON.parse(e), n = Date.now() - Bt, i = t.filter((o) => o.ts >= n);
|
|
1314
1310
|
return i.length !== t.length && this.save(i), i;
|
|
1315
1311
|
} catch {
|
|
1316
1312
|
return [];
|
|
@@ -1436,7 +1432,7 @@ async function $t(s, e) {
|
|
|
1436
1432
|
const t = await V(), n = await _(t.publicKey), i = await F(e.identityKey), o = await F(e.signedPrekey), r = e.oneTimePrekey ? await F(e.oneTimePrekey) : null, p = await D(s.privateKey, o), w = await D(t.privateKey, i), d = await D(t.privateKey, o), v = r ? await D(t.privateKey, r) : null, x = Ee(p, w, d, ...v ? [v] : []);
|
|
1437
1433
|
return { sharedKey: await Te(x), ephemeralPublicKey: n };
|
|
1438
1434
|
}
|
|
1439
|
-
async function
|
|
1435
|
+
async function Ht(s, e, t, n, i) {
|
|
1440
1436
|
const o = await F(t), r = await F(n), p = await D(e.privateKey, o), w = await D(s.privateKey, r), d = await D(e.privateKey, r), v = i ? await D(i.privateKey, r) : null, x = Ee(p, w, d, ...v ? [v] : []);
|
|
1441
1437
|
return Te(x);
|
|
1442
1438
|
}
|
|
@@ -1460,7 +1456,7 @@ async function Te(s) {
|
|
|
1460
1456
|
["encrypt", "decrypt"]
|
|
1461
1457
|
);
|
|
1462
1458
|
}
|
|
1463
|
-
const
|
|
1459
|
+
const Rt = 20;
|
|
1464
1460
|
class Ft {
|
|
1465
1461
|
constructor(e) {
|
|
1466
1462
|
// Live ECDH mode state
|
|
@@ -1493,7 +1489,7 @@ class Ft {
|
|
|
1493
1489
|
* Returns the upload frame payload the caller should send to the server. */
|
|
1494
1490
|
async initX3DH() {
|
|
1495
1491
|
this.identityKP = await be(this.storageKey), this.signedPreKP = await V(), this.signedPrekeyId = `spk-${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
1496
|
-
for (let i = 0; i <
|
|
1492
|
+
for (let i = 0; i < Rt; i++) this.otpKeys.push(await V());
|
|
1497
1493
|
const e = await _(this.signedPreKP.publicKey), t = await Dt(this.identityKP.ecdsaKP.privateKey, this.signedPreKP.publicKey), n = await Promise.all(this.otpKeys.map((i) => _(i.publicKey)));
|
|
1498
1494
|
return {
|
|
1499
1495
|
identityKey: this.identityKP.publicKeyB64,
|
|
@@ -1517,7 +1513,7 @@ class Ft {
|
|
|
1517
1513
|
return;
|
|
1518
1514
|
}
|
|
1519
1515
|
const i = this.otpKeys.shift();
|
|
1520
|
-
this.x3dhShared = await
|
|
1516
|
+
this.x3dhShared = await Ht(this.identityKP.ecdhKP, this.signedPreKP, e, t, i);
|
|
1521
1517
|
}
|
|
1522
1518
|
/** Flush pending X3DH derivation after initX3DH() completes. */
|
|
1523
1519
|
async flushPendingX3DH() {
|
|
@@ -1788,7 +1784,7 @@ class Wt {
|
|
|
1788
1784
|
a(this, "translationCache", /* @__PURE__ */ new Map());
|
|
1789
1785
|
a(this, "showingTranslation", /* @__PURE__ */ new Set());
|
|
1790
1786
|
a(this, "subjectBuilt", !1);
|
|
1791
|
-
var m, g, U, A,
|
|
1787
|
+
var m, g, U, A, P, K, b, S, M;
|
|
1792
1788
|
this.root = e, this.me = t, this.h = n, this.cfg = i, Nt(), e.replaceChildren(), e.classList.add("ocw"), i.accent && e.style.setProperty("--ocw-accent", i.accent);
|
|
1793
1789
|
const o = c("div", "ocw-head"), r = c("div", "ocw-avatar");
|
|
1794
1790
|
if ((m = i.userInfo) != null && m.avatar) {
|
|
@@ -1798,7 +1794,7 @@ class Wt {
|
|
|
1798
1794
|
r.textContent = (g = i.userInfo) != null && g.name ? i.userInfo.name[0].toUpperCase() : "🧑";
|
|
1799
1795
|
o.append(r);
|
|
1800
1796
|
const p = c("div", "ocw-head-main");
|
|
1801
|
-
this.headerName = c("div", "ocw-head-name", ((U = i.subject) == null ? void 0 : U.ownerLabel) ?? ((A = i.subject) == null ? void 0 : A.title) ?? ""), p.append(this.headerName), (
|
|
1797
|
+
this.headerName = c("div", "ocw-head-name", ((U = i.subject) == null ? void 0 : U.ownerLabel) ?? ((A = i.subject) == null ? void 0 : A.title) ?? ""), p.append(this.headerName), (P = i.subject) != null && P.subtitle && p.append(c("div", "ocw-head-meta", i.subject.subtitle)), o.append(p), this.statusBadge = c("span", "ocw-badge", ((K = i.subject) == null ? void 0 : K.status) ?? ""), (b = i.subject) != null && b.status || (this.statusBadge.style.display = "none"), o.append(this.statusBadge), this.e2eBadge = c("span", "ocw-e2e", "🔒 E2E"), this.e2eBadge.style.display = "none", o.append(this.e2eBadge), this.connStatus = c("span", "ocw-conn-status"), this.connStatus.style.display = "none", o.append(this.connStatus), this.cobrowseBtn = c("button", "ocw-menu ocw-cobrowse-btn", "🖍"), this.cobrowseBtn.title = "Shared whiteboard — draw to point things out together", this.cobrowseBtn.addEventListener("click", () => {
|
|
1802
1798
|
this.cobrowseActive = !this.cobrowseActive, this.updateCobrowseUI();
|
|
1803
1799
|
}), o.append(this.cobrowseBtn), o.append(c("button", "ocw-menu", "⋯")), this.chips = c("div", "ocw-chiprow"), this.scroll = c("div", "ocw-scroll"), this.subjectCard = c("div", "ocw-subject"), this.typing = c("div", "ocw-typing");
|
|
1804
1800
|
const w = c("div", "ocw-typing-bubble");
|
|
@@ -2121,10 +2117,10 @@ Message: ${o.value}`), this.offlinePanel.replaceChildren(c("div", "ocw-offline-t
|
|
|
2121
2117
|
U.style.cssText = "margin-top:6px;padding:5px 14px;font-size:13px";
|
|
2122
2118
|
const A = c("button", "ocw-form-cancel", "Cancel");
|
|
2123
2119
|
A.style.cssText = "margin-top:6px;padding:5px 10px;font-size:13px";
|
|
2124
|
-
const
|
|
2125
|
-
|
|
2120
|
+
const P = c("div");
|
|
2121
|
+
P.style.cssText = "display:flex;gap:6px;justify-content:flex-end", P.append(A, U);
|
|
2126
2122
|
const K = c("div");
|
|
2127
|
-
K.append(g,
|
|
2123
|
+
K.append(g, P), w.replaceChildren(K), g.focus(), g.select();
|
|
2128
2124
|
const b = () => w.replaceChildren(d ?? document.createTextNode(m));
|
|
2129
2125
|
A.addEventListener("click", b), U.addEventListener("click", () => {
|
|
2130
2126
|
const S = g.value.trim();
|
|
@@ -2148,8 +2144,8 @@ Message: ${o.value}`), this.offlinePanel.replaceChildren(c("div", "ocw-offline-t
|
|
|
2148
2144
|
for (const [g, U] of Object.entries(e.reactions)) {
|
|
2149
2145
|
const A = c("button", `ocw-react-pill${U.includes(this.me) ? " mine" : ""}`, `${g} ${U.length}`);
|
|
2150
2146
|
A.addEventListener("click", () => {
|
|
2151
|
-
var
|
|
2152
|
-
return (K = (
|
|
2147
|
+
var P, K;
|
|
2148
|
+
return (K = (P = this.h).onReact) == null ? void 0 : K.call(P, e.id, g, U.includes(this.me));
|
|
2153
2149
|
}), u.append(A);
|
|
2154
2150
|
}
|
|
2155
2151
|
const I = c("button", "ocw-react-btn", "+"), m = c("div", "ocw-react-picker");
|
|
@@ -2158,8 +2154,8 @@ Message: ${o.value}`), this.offlinePanel.replaceChildren(c("div", "ocw-offline-t
|
|
|
2158
2154
|
U.addEventListener("click", (A) => {
|
|
2159
2155
|
var K, b, S, M;
|
|
2160
2156
|
A.stopPropagation();
|
|
2161
|
-
const
|
|
2162
|
-
(M = (S = this.h).onReact) == null || M.call(S, e.id, g, !!
|
|
2157
|
+
const P = (b = (K = e.reactions) == null ? void 0 : K[g]) == null ? void 0 : b.includes(this.me);
|
|
2158
|
+
(M = (S = this.h).onReact) == null || M.call(S, e.id, g, !!P), m.style.display = "none";
|
|
2163
2159
|
}), m.append(U);
|
|
2164
2160
|
}
|
|
2165
2161
|
m.style.display = "none", I.addEventListener("click", (g) => {
|
|
@@ -2188,18 +2184,18 @@ function Xt(s) {
|
|
|
2188
2184
|
return "🕓";
|
|
2189
2185
|
}
|
|
2190
2186
|
}
|
|
2191
|
-
const
|
|
2187
|
+
const H = /* @__PURE__ */ new WeakMap(), Z = /* @__PURE__ */ new Map();
|
|
2192
2188
|
function ve(s) {
|
|
2193
2189
|
return `relay-launcher::${s.profileId}::${s.subjectId ?? ""}`;
|
|
2194
2190
|
}
|
|
2195
2191
|
function Zt(s) {
|
|
2196
2192
|
var e;
|
|
2197
|
-
(e =
|
|
2193
|
+
(e = H.get(s)) == null || e.close(), H.delete(s);
|
|
2198
2194
|
}
|
|
2199
2195
|
function Qt(s) {
|
|
2200
2196
|
var he, pe, ue, fe, we;
|
|
2201
|
-
|
|
2202
|
-
const e = $e(), t = s.token ?? s.userId ?? e, n = t !== e ? e : void 0, { wsUrl: i, httpBase: o } =
|
|
2197
|
+
H.has(s.el) && (H.get(s.el).close(), H.delete(s.el)), s.launcher && ((he = Z.get(ve(s))) == null || he.close());
|
|
2198
|
+
const e = $e(), t = s.token ?? s.userId ?? e, n = t !== e ? e : void 0, { wsUrl: i, httpBase: o } = He(s.url, s.apiUrl);
|
|
2203
2199
|
let r = new Ct(t);
|
|
2204
2200
|
const p = s.subjectId ? `${t}::${s.subjectId}` : t, w = new At(p);
|
|
2205
2201
|
let d, v = !1, x = null, f = null;
|
|
@@ -2209,7 +2205,7 @@ function Qt(s) {
|
|
|
2209
2205
|
if (s.launcher) {
|
|
2210
2206
|
const h = (s.position ?? "bottom-right").includes("right");
|
|
2211
2207
|
u = document.createElement("div"), u.style.cssText = `position:fixed;${h ? "right:20px" : "left:20px"};bottom:20px;z-index:9999;display:flex;flex-direction:column;align-items:${h ? "flex-end" : "flex-start"};gap:12px`;
|
|
2212
|
-
const y = document.createElement("div"), E = typeof window < "u" ? window.matchMedia("(max-width: 479px)") : null,
|
|
2208
|
+
const y = document.createElement("div"), E = typeof window < "u" ? window.matchMedia("(max-width: 479px)") : null, R = ($) => {
|
|
2213
2209
|
y.style.cssText = $ ? [
|
|
2214
2210
|
"position:fixed",
|
|
2215
2211
|
"inset:0",
|
|
@@ -2239,22 +2235,22 @@ function Qt(s) {
|
|
|
2239
2235
|
"transform:scale(.95)"
|
|
2240
2236
|
].join(";");
|
|
2241
2237
|
};
|
|
2242
|
-
|
|
2243
|
-
const Y = ($) =>
|
|
2238
|
+
R((E == null ? void 0 : E.matches) ?? !1);
|
|
2239
|
+
const Y = ($) => R($.matches);
|
|
2244
2240
|
E == null || E.addEventListener("change", Y), x = E, f = Y, s.el.style.cssText = "width:100%;height:100%;overflow:hidden", y.append(s.el);
|
|
2245
|
-
const
|
|
2246
|
-
|
|
2241
|
+
const B = document.createElement("button");
|
|
2242
|
+
B.style.cssText = [
|
|
2247
2243
|
"width:56px;height:56px;border-radius:50%",
|
|
2248
2244
|
`background:${s.accent ?? "#4F63F5"}`,
|
|
2249
2245
|
"color:#fff;border:none;font-size:24px;cursor:pointer",
|
|
2250
2246
|
"box-shadow:0 4px 16px rgba(0,0,0,.25)",
|
|
2251
2247
|
"position:relative;flex:none",
|
|
2252
2248
|
"transition:transform .15s"
|
|
2253
|
-
].join(";"),
|
|
2254
|
-
|
|
2255
|
-
},
|
|
2256
|
-
|
|
2257
|
-
}, I = document.createElement("span"), I.style.cssText = "position:absolute;top:-4px;right:-4px;background:#ef4444;color:#fff;border-radius:50%;width:20px;height:20px;font-size:11px;font-weight:700;display:none;align-items:center;justify-content:center",
|
|
2249
|
+
].join(";"), B.textContent = "💬", B.onmouseenter = () => {
|
|
2250
|
+
B.style.transform = "scale(1.08)";
|
|
2251
|
+
}, B.onmouseleave = () => {
|
|
2252
|
+
B.style.transform = "scale(1)";
|
|
2253
|
+
}, I = document.createElement("span"), I.style.cssText = "position:absolute;top:-4px;right:-4px;background:#ef4444;color:#fff;border-radius:50%;width:20px;height:20px;font-size:11px;font-weight:700;display:none;align-items:center;justify-content:center", B.append(I), u.append(y, B), document.body.append(u);
|
|
2258
2254
|
const J = ($) => {
|
|
2259
2255
|
$ ? (y.style.display = "flex", requestAnimationFrame(() => {
|
|
2260
2256
|
y.style.opacity = "1", y.style.transform = "scale(1)";
|
|
@@ -2262,10 +2258,10 @@ function Qt(s) {
|
|
|
2262
2258
|
g || (y.style.display = "none");
|
|
2263
2259
|
}, 180));
|
|
2264
2260
|
};
|
|
2265
|
-
|
|
2266
|
-
g = !g, J(g),
|
|
2261
|
+
B.addEventListener("click", () => {
|
|
2262
|
+
g = !g, J(g), B.textContent = g ? "✕" : "💬", B.append(I), g && (m = 0, I && (I.style.display = "none"));
|
|
2267
2263
|
}), document.addEventListener("keydown", ($) => {
|
|
2268
|
-
$.key === "Escape" && g && (g = !1, J(!1),
|
|
2264
|
+
$.key === "Escape" && g && (g = !1, J(!1), B.textContent = "💬", B.append(I));
|
|
2269
2265
|
});
|
|
2270
2266
|
}
|
|
2271
2267
|
const U = () => {
|
|
@@ -2276,9 +2272,9 @@ function Qt(s) {
|
|
|
2276
2272
|
h.connect(y), y.connect(l.destination), h.frequency.setValueAtTime(880, l.currentTime), h.frequency.exponentialRampToValueAtTime(440, l.currentTime + 0.15), y.gain.setValueAtTime(0.3, l.currentTime), y.gain.exponentialRampToValueAtTime(1e-3, l.currentTime + 0.3), h.start(), h.stop(l.currentTime + 0.3);
|
|
2277
2273
|
} catch {
|
|
2278
2274
|
}
|
|
2279
|
-
},
|
|
2280
|
-
for (;
|
|
2281
|
-
const h =
|
|
2275
|
+
}, P = [], K = (l) => {
|
|
2276
|
+
for (; P.length; ) {
|
|
2277
|
+
const h = P.shift();
|
|
2282
2278
|
w.add({ clientMsgId: h.clientMsgId, content: h.content, ts: Date.now() }), b.send({ type: "send", conversationId: l, clientMsgId: h.clientMsgId, content: h.content });
|
|
2283
2279
|
}
|
|
2284
2280
|
};
|
|
@@ -2295,7 +2291,7 @@ function Qt(s) {
|
|
|
2295
2291
|
S.sealText(h, y).then((E) => {
|
|
2296
2292
|
d && b.send({ type: "send", conversationId: d, clientMsgId: l, content: E });
|
|
2297
2293
|
});
|
|
2298
|
-
},
|
|
2294
|
+
}, Pe = () => {
|
|
2299
2295
|
for (; k.length; ) {
|
|
2300
2296
|
const l = k.shift();
|
|
2301
2297
|
ne(l.clientMsgId, l.text);
|
|
@@ -2304,14 +2300,14 @@ function Qt(s) {
|
|
|
2304
2300
|
const l = T.shift();
|
|
2305
2301
|
ne(l.clientMsgId, l.text);
|
|
2306
2302
|
}
|
|
2307
|
-
},
|
|
2303
|
+
}, Be = (l) => {
|
|
2308
2304
|
b.send({ type: "fetchPrekey", targetUserId: l });
|
|
2309
2305
|
}, Ae = s.i18n ?? {}, Ke = ["ar", "he", "fa", "ur"], ze = typeof navigator < "u" ? (navigator.language ?? "").slice(0, 2).toLowerCase() : "";
|
|
2310
2306
|
Ke.includes(ze) && !s.el.dir && (s.el.dir = "rtl", s.el.style.fontFamily = s.el.style.fontFamily || "Tahoma,Arial,system-ui,sans-serif");
|
|
2311
2307
|
const L = new Wt(s.el, t, {
|
|
2312
2308
|
onSend(l) {
|
|
2313
2309
|
const h = `cm_${Math.random().toString(36).slice(2)}`, y = { kind: "text", text: l };
|
|
2314
|
-
r.addOptimistic(h, y), L.render(r), r.e2e ? S.ready ? ne(h, l) : W ? T.push({ clientMsgId: h, text: l }) : (k.push({ clientMsgId: h, text: l }), r.assignedAgentId &&
|
|
2310
|
+
r.addOptimistic(h, y), L.render(r), r.e2e ? S.ready ? ne(h, l) : W ? T.push({ clientMsgId: h, text: l }) : (k.push({ clientMsgId: h, text: l }), r.assignedAgentId && Be(r.assignedAgentId)) : d ? (w.add({ clientMsgId: h, content: y, ts: Date.now() }), b.send({ type: "send", conversationId: d, clientMsgId: h, content: y })) : P.push({ clientMsgId: h, content: y });
|
|
2315
2311
|
},
|
|
2316
2312
|
async onAttach(l) {
|
|
2317
2313
|
if (!d) return;
|
|
@@ -2324,8 +2320,8 @@ function Qt(s) {
|
|
|
2324
2320
|
body: l
|
|
2325
2321
|
});
|
|
2326
2322
|
if (!E.ok) throw new Error(`Upload failed: ${E.status}`);
|
|
2327
|
-
const { url:
|
|
2328
|
-
b.send({ type: "send", conversationId: d, clientMsgId: y, content: { kind: "attachment", url:
|
|
2323
|
+
const { url: R, name: Y, mime: B, size: J } = await E.json();
|
|
2324
|
+
b.send({ type: "send", conversationId: d, clientMsgId: y, content: { kind: "attachment", url: R, name: Y, mime: B, size: J } });
|
|
2329
2325
|
} catch (E) {
|
|
2330
2326
|
r.addOptimistic(y, { kind: "text", text: `⚠️ Upload failed: ${E.message}` }), L.render(r);
|
|
2331
2327
|
}
|
|
@@ -2404,7 +2400,7 @@ function Qt(s) {
|
|
|
2404
2400
|
const h = s.user;
|
|
2405
2401
|
if (!h || !h.name && !h.email && !h.avatar && !h.meta) return;
|
|
2406
2402
|
const y = [];
|
|
2407
|
-
if (h.name && y.push(`Name: ${h.name}`), h.email && y.push(`Email: ${h.email}`), h.avatar && y.push(`Avatar: ${h.avatar}`), h.meta) for (const [E,
|
|
2403
|
+
if (h.name && y.push(`Name: ${h.name}`), h.email && y.push(`Email: ${h.email}`), h.avatar && y.push(`Avatar: ${h.avatar}`), h.meta) for (const [E, R] of Object.entries(h.meta)) y.push(`${E}: ${R}`);
|
|
2408
2404
|
b.send({ type: "note", conversationId: l, clientMsgId: `ui_${Date.now()}`, text: `[User info]
|
|
2409
2405
|
${y.join(`
|
|
2410
2406
|
`)}` });
|
|
@@ -2423,7 +2419,7 @@ ${y.join(`
|
|
|
2423
2419
|
for (const y of w.load())
|
|
2424
2420
|
b.send({ type: "send", conversationId: d, clientMsgId: y.clientMsgId, content: y.content });
|
|
2425
2421
|
}
|
|
2426
|
-
|
|
2422
|
+
Re(i, t, d, r, L, o), P.length && K(d), h && l.conversation.lastSeq === 0 && Me(d);
|
|
2427
2423
|
}
|
|
2428
2424
|
if (l.type === "ack" && w.remove(l.clientMsgId), l.type === "prekeyBundle") {
|
|
2429
2425
|
l.bundle && (W = !0, S.x3dhSendTo(l.bundle).then((h) => {
|
|
@@ -2444,7 +2440,7 @@ ${y.join(`
|
|
|
2444
2440
|
}
|
|
2445
2441
|
if (l.type === "peerkey") {
|
|
2446
2442
|
S.onPeerKey(l.key).then(() => {
|
|
2447
|
-
|
|
2443
|
+
Pe(), L.render(r);
|
|
2448
2444
|
});
|
|
2449
2445
|
return;
|
|
2450
2446
|
}
|
|
@@ -2461,9 +2457,9 @@ ${y.join(`
|
|
|
2461
2457
|
}
|
|
2462
2458
|
}), b.connect(), L.render(r);
|
|
2463
2459
|
const j = s.launcher ? ve(s) : null, X = { close: () => {
|
|
2464
|
-
b.close(), u == null || u.remove(), L.destroy(), x && f && x.removeEventListener("change", f),
|
|
2460
|
+
b.close(), u == null || u.remove(), L.destroy(), x && f && x.removeEventListener("change", f), H.delete(s.el), j && Z.get(j) === X && Z.delete(j);
|
|
2465
2461
|
} };
|
|
2466
|
-
return
|
|
2462
|
+
return H.set(s.el, X), j && Z.set(j, X), X;
|
|
2467
2463
|
}
|
|
2468
2464
|
export {
|
|
2469
2465
|
Ct as ChatStore,
|
|
@@ -2475,8 +2471,8 @@ export {
|
|
|
2475
2471
|
jt as extractX3DHInit,
|
|
2476
2472
|
nn as httpBaseFromWsUrl,
|
|
2477
2473
|
Qt as mount,
|
|
2478
|
-
|
|
2479
|
-
|
|
2474
|
+
He as resolveRelayUrls,
|
|
2475
|
+
Re as restoreHistory,
|
|
2480
2476
|
Zt as unmount
|
|
2481
2477
|
};
|
|
2482
2478
|
//# sourceMappingURL=index.js.map
|