@wexio/messenger-widget-react 1.0.20 → 1.0.21
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/widget-react.js +326 -326
- package/package.json +1 -1
package/dist/widget-react.js
CHANGED
|
@@ -13,9 +13,9 @@ import "react/jsx-runtime";
|
|
|
13
13
|
import "react-dom/client";
|
|
14
14
|
import { S as e, a as t, d as n, i as r, l as i, n as a, r as o, t as s, u as c, w as l, y as u } from "./widget-react-B9XrHKqv.js";
|
|
15
15
|
import { A as d, C as f, D as p, E as m, F as h, I as g, L as _, M as v, N as y, O as b, P as x, R as S, S as C, T as w, X as T, Z as E, _ as D, a as O, b as k, c as A, d as j, et as M, f as N, g as ee, i as P, j as te, k as ne, l as F, ln as I, mn as re, n as ie, nn as ae, o as oe, p as se, pn as ce, r as le, rn as ue, s as L, t as R, tt as de, u as z, v as fe, x as pe, y as me, z as B } from "./widget-react-CxCHz0ip.js";
|
|
16
|
-
import { _ as he, a as ge, b as
|
|
17
|
-
import { a as
|
|
18
|
-
import { a as
|
|
16
|
+
import { _ as he, a as ge, b as _e, c as ve, d as ye, f as be, h as xe, i as Se, m as Ce, o as we, p as Te, s as Ee, t as De, u as Oe, v as ke, y as Ae } from "./widget-react-DyCyhde3.js";
|
|
17
|
+
import { a as je, i as V, n as H, o as Me, s as Ne, t as U } from "./widget-react-CQ0DMi7b.js";
|
|
18
|
+
import { a as Pe, c as Fe, d as Ie, f as W, h as Le, i as Re, l as ze, m as Be, p as Ve, t as He, u as Ue } from "./widget-react-BYrOtI3f.js";
|
|
19
19
|
import { n as We, r as Ge, t as Ke } from "./widget-react-TZUXHkN3.js";
|
|
20
20
|
import { t as qe } from "./widget-react-BTMh-VbZ.js";
|
|
21
21
|
import { t as Je } from "./widget-react-GkCAcRz0.js";
|
|
@@ -188,7 +188,7 @@ function qt(e, t, n, r, i, a) {
|
|
|
188
188
|
//#region node_modules/next-intl/dist/esm/production/shared/NextIntlClientProvider.js
|
|
189
189
|
function Jt({ locale: e, ...t }) {
|
|
190
190
|
if (!e) throw Error(void 0);
|
|
191
|
-
return Z(
|
|
191
|
+
return Z(Ne, {
|
|
192
192
|
locale: e,
|
|
193
193
|
...t
|
|
194
194
|
});
|
|
@@ -615,12 +615,12 @@ function Un(e) {
|
|
|
615
615
|
displayName: e.displayName,
|
|
616
616
|
expiresAt: Date.now() + e.expiresIn * 1e3
|
|
617
617
|
};
|
|
618
|
-
localStorage.setItem(Bn(
|
|
618
|
+
localStorage.setItem(Bn(xe()), JSON.stringify(t));
|
|
619
619
|
} catch {}
|
|
620
620
|
}
|
|
621
621
|
function Wn() {
|
|
622
622
|
if (typeof window > "u") return null;
|
|
623
|
-
let e =
|
|
623
|
+
let e = xe();
|
|
624
624
|
try {
|
|
625
625
|
let t = localStorage.getItem(Bn(e));
|
|
626
626
|
if (!t && e) {
|
|
@@ -636,13 +636,13 @@ function Wn() {
|
|
|
636
636
|
}
|
|
637
637
|
function Gn() {
|
|
638
638
|
if (!(typeof window > "u")) try {
|
|
639
|
-
localStorage.removeItem(Bn(
|
|
639
|
+
localStorage.removeItem(Bn(xe())), localStorage.removeItem(Hn);
|
|
640
640
|
} catch {}
|
|
641
641
|
}
|
|
642
642
|
var Kn = 30, qn = "wexio:prechat-submitted:";
|
|
643
643
|
function Jn() {
|
|
644
|
-
if (
|
|
645
|
-
let e =
|
|
644
|
+
if (_e(null), Gn(), !(typeof window > "u")) try {
|
|
645
|
+
let e = xe();
|
|
646
646
|
localStorage.removeItem(zn(e)), localStorage.removeItem(Vn);
|
|
647
647
|
for (let e = localStorage.length - 1; e >= 0; e--) {
|
|
648
648
|
let t = localStorage.key(e);
|
|
@@ -716,9 +716,9 @@ function Yn(e) {
|
|
|
716
716
|
return;
|
|
717
717
|
}
|
|
718
718
|
if (f.visitorId && f.visitorId !== t) try {
|
|
719
|
-
localStorage.setItem(zn(
|
|
719
|
+
localStorage.setItem(zn(xe()), f.visitorId);
|
|
720
720
|
} catch {}
|
|
721
|
-
|
|
721
|
+
_e(f.token), n({
|
|
722
722
|
token: f.token,
|
|
723
723
|
chatId: f.chatId,
|
|
724
724
|
peopleId: f.peopleId,
|
|
@@ -761,7 +761,7 @@ function Yn(e) {
|
|
|
761
761
|
if (typeof window > "u") return;
|
|
762
762
|
let t = { current: !1 }, r = a.current ? null : Wn();
|
|
763
763
|
if (r) {
|
|
764
|
-
|
|
764
|
+
_e(r.token), n({
|
|
765
765
|
token: r.token,
|
|
766
766
|
chatId: r.chatId,
|
|
767
767
|
peopleId: r.peopleId,
|
|
@@ -789,15 +789,15 @@ function Yn(e) {
|
|
|
789
789
|
]), J(() => {
|
|
790
790
|
if (!e.enabled || typeof window > "u") return;
|
|
791
791
|
let t = !1;
|
|
792
|
-
return
|
|
793
|
-
t || (t = !0, Gn(),
|
|
792
|
+
return ke(() => {
|
|
793
|
+
t || (t = !0, Gn(), _e(null), l({ current: !1 }).finally(() => {
|
|
794
794
|
t = !1;
|
|
795
795
|
}));
|
|
796
796
|
}), he(() => {
|
|
797
797
|
if (!t) {
|
|
798
|
-
t = !0, Gn(),
|
|
798
|
+
t = !0, Gn(), _e(null);
|
|
799
799
|
try {
|
|
800
|
-
let e =
|
|
800
|
+
let e = xe();
|
|
801
801
|
localStorage.removeItem(zn(e));
|
|
802
802
|
} catch {}
|
|
803
803
|
l({ current: !1 }).finally(() => {
|
|
@@ -805,7 +805,7 @@ function Yn(e) {
|
|
|
805
805
|
});
|
|
806
806
|
}
|
|
807
807
|
}), () => {
|
|
808
|
-
|
|
808
|
+
ke(null), he(null);
|
|
809
809
|
};
|
|
810
810
|
}, [e.enabled, l]), t;
|
|
811
811
|
}
|
|
@@ -860,7 +860,7 @@ function Xn(e) {
|
|
|
860
860
|
}
|
|
861
861
|
function Zn() {
|
|
862
862
|
try {
|
|
863
|
-
let e =
|
|
863
|
+
let e = xe(), t = zn(e), n = localStorage.getItem(t);
|
|
864
864
|
if (n) return n;
|
|
865
865
|
if (e) {
|
|
866
866
|
let e = localStorage.getItem(Vn);
|
|
@@ -941,7 +941,7 @@ function cr({ chatId: e, token: t, enabled: n = !0, onMessage: r }) {
|
|
|
941
941
|
i.current = r;
|
|
942
942
|
}, [r]), J(() => {
|
|
943
943
|
if (!n || !e || !t || typeof window > "u") return;
|
|
944
|
-
let r =
|
|
944
|
+
let r = xe();
|
|
945
945
|
if (!r) return;
|
|
946
946
|
let a = `${w()}/api/web/realtime/${encodeURIComponent(e)}?token=${encodeURIComponent(t)}&publicKey=${encodeURIComponent(r)}`, o = new EventSource(a, { withCredentials: !1 }), s = (e) => {
|
|
947
947
|
try {
|
|
@@ -1005,7 +1005,7 @@ function dr(e) {
|
|
|
1005
1005
|
//#endregion
|
|
1006
1006
|
//#region lib/use-visitor-unread.ts
|
|
1007
1007
|
function fr({ chatId: e, isDummy: t }) {
|
|
1008
|
-
let n =
|
|
1008
|
+
let n = V("demo"), [r, i] = X(!1), [a, o] = X(0), [s, c] = X(null), l = Y(/* @__PURE__ */ new Set()), u = Y(null), d = Y(!1), [f] = sn({ fetchPolicy: "network-only" });
|
|
1009
1009
|
J(() => {
|
|
1010
1010
|
t || !e || u.current !== e && (u.current = e, l.current = /* @__PURE__ */ new Set(), d.current = !1, f({ variables: { chatId: e } }).then((e) => {
|
|
1011
1011
|
if (d.current) return;
|
|
@@ -1157,25 +1157,25 @@ function xr(e, t) {
|
|
|
1157
1157
|
]) if (yr(e, t)) return e;
|
|
1158
1158
|
return e;
|
|
1159
1159
|
}
|
|
1160
|
-
var Sr =
|
|
1160
|
+
var Sr = U("arrow-right", [["path", {
|
|
1161
1161
|
d: "M5 12h14",
|
|
1162
1162
|
key: "1ays0h"
|
|
1163
1163
|
}], ["path", {
|
|
1164
1164
|
d: "m12 5 7 7-7 7",
|
|
1165
1165
|
key: "xquz4c"
|
|
1166
|
-
}]]), Cr =
|
|
1166
|
+
}]]), Cr = U("bell", [["path", {
|
|
1167
1167
|
d: "M10.268 21a2 2 0 0 0 3.464 0",
|
|
1168
1168
|
key: "vwvbt9"
|
|
1169
1169
|
}], ["path", {
|
|
1170
1170
|
d: "M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",
|
|
1171
1171
|
key: "11g9vi"
|
|
1172
|
-
}]]), wr =
|
|
1172
|
+
}]]), wr = U("book", [["path", {
|
|
1173
1173
|
d: "M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",
|
|
1174
1174
|
key: "k3hazp"
|
|
1175
|
-
}]]), Tr =
|
|
1175
|
+
}]]), Tr = U("bookmark", [["path", {
|
|
1176
1176
|
d: "M17 3a2 2 0 0 1 2 2v15a1 1 0 0 1-1.496.868l-4.512-2.578a2 2 0 0 0-1.984 0l-4.512 2.578A1 1 0 0 1 5 20V5a2 2 0 0 1 2-2z",
|
|
1177
1177
|
key: "oz39mx"
|
|
1178
|
-
}]]), Er =
|
|
1178
|
+
}]]), Er = U("camera", [["path", {
|
|
1179
1179
|
d: "M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",
|
|
1180
1180
|
key: "18u6gg"
|
|
1181
1181
|
}], ["circle", {
|
|
@@ -1183,7 +1183,7 @@ var Sr = W("arrow-right", [["path", {
|
|
|
1183
1183
|
cy: "13",
|
|
1184
1184
|
r: "3",
|
|
1185
1185
|
key: "1vg3eu"
|
|
1186
|
-
}]]), Dr =
|
|
1186
|
+
}]]), Dr = U("circle-alert", [
|
|
1187
1187
|
["circle", {
|
|
1188
1188
|
cx: "12",
|
|
1189
1189
|
cy: "12",
|
|
@@ -1204,7 +1204,7 @@ var Sr = W("arrow-right", [["path", {
|
|
|
1204
1204
|
y2: "16",
|
|
1205
1205
|
key: "4dfq90"
|
|
1206
1206
|
}]
|
|
1207
|
-
]), Or =
|
|
1207
|
+
]), Or = U("circle-question-mark", [
|
|
1208
1208
|
["circle", {
|
|
1209
1209
|
cx: "12",
|
|
1210
1210
|
cy: "12",
|
|
@@ -1219,10 +1219,10 @@ var Sr = W("arrow-right", [["path", {
|
|
|
1219
1219
|
d: "M12 17h.01",
|
|
1220
1220
|
key: "p32p05"
|
|
1221
1221
|
}]
|
|
1222
|
-
]), kr =
|
|
1222
|
+
]), kr = U("command", [["path", {
|
|
1223
1223
|
d: "M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",
|
|
1224
1224
|
key: "11bfej"
|
|
1225
|
-
}]]), Ar =
|
|
1225
|
+
}]]), Ar = U("file-text", [
|
|
1226
1226
|
["path", {
|
|
1227
1227
|
d: "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",
|
|
1228
1228
|
key: "1oefj6"
|
|
@@ -1243,7 +1243,7 @@ var Sr = W("arrow-right", [["path", {
|
|
|
1243
1243
|
d: "M16 17H8",
|
|
1244
1244
|
key: "z1uh3a"
|
|
1245
1245
|
}]
|
|
1246
|
-
]), jr =
|
|
1246
|
+
]), jr = U("gamepad-2", [
|
|
1247
1247
|
["line", {
|
|
1248
1248
|
x1: "6",
|
|
1249
1249
|
x2: "10",
|
|
@@ -1276,7 +1276,7 @@ var Sr = W("arrow-right", [["path", {
|
|
|
1276
1276
|
d: "M17.32 5H6.68a4 4 0 0 0-3.978 3.59c-.006.052-.01.101-.017.152C2.604 9.416 2 14.456 2 16a3 3 0 0 0 3 3c1 0 1.5-.5 2-1l1.414-1.414A2 2 0 0 1 9.828 16h4.344a2 2 0 0 1 1.414.586L17 18c.5.5 1 1 2 1a3 3 0 0 0 3-3c0-1.545-.604-6.584-.685-7.258-.007-.05-.011-.1-.017-.151A4 4 0 0 0 17.32 5z",
|
|
1277
1277
|
key: "mfqc10"
|
|
1278
1278
|
}]
|
|
1279
|
-
]), Mr =
|
|
1279
|
+
]), Mr = U("hash", [
|
|
1280
1280
|
["line", {
|
|
1281
1281
|
x1: "4",
|
|
1282
1282
|
x2: "20",
|
|
@@ -1305,10 +1305,10 @@ var Sr = W("arrow-right", [["path", {
|
|
|
1305
1305
|
y2: "21",
|
|
1306
1306
|
key: "weycgp"
|
|
1307
1307
|
}]
|
|
1308
|
-
]), Nr =
|
|
1308
|
+
]), Nr = U("heart", [["path", {
|
|
1309
1309
|
d: "M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",
|
|
1310
1310
|
key: "mvr1a0"
|
|
1311
|
-
}]]), Pr =
|
|
1311
|
+
}]]), Pr = U("image-plus", [
|
|
1312
1312
|
["path", {
|
|
1313
1313
|
d: "M16 5h6",
|
|
1314
1314
|
key: "1vod17"
|
|
@@ -1331,7 +1331,7 @@ var Sr = W("arrow-right", [["path", {
|
|
|
1331
1331
|
r: "2",
|
|
1332
1332
|
key: "af1f0g"
|
|
1333
1333
|
}]
|
|
1334
|
-
]), Fr =
|
|
1334
|
+
]), Fr = U("lightbulb", [
|
|
1335
1335
|
["path", {
|
|
1336
1336
|
d: "M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",
|
|
1337
1337
|
key: "1gvzjb"
|
|
@@ -1344,7 +1344,7 @@ var Sr = W("arrow-right", [["path", {
|
|
|
1344
1344
|
d: "M10 22h4",
|
|
1345
1345
|
key: "ceow96"
|
|
1346
1346
|
}]
|
|
1347
|
-
]), Ir =
|
|
1347
|
+
]), Ir = U("lock", [["rect", {
|
|
1348
1348
|
width: "18",
|
|
1349
1349
|
height: "11",
|
|
1350
1350
|
x: "3",
|
|
@@ -1355,7 +1355,7 @@ var Sr = W("arrow-right", [["path", {
|
|
|
1355
1355
|
}], ["path", {
|
|
1356
1356
|
d: "M7 11V7a5 5 0 0 1 10 0v4",
|
|
1357
1357
|
key: "fwvmzm"
|
|
1358
|
-
}]]), Lr =
|
|
1358
|
+
}]]), Lr = U("mail", [["path", {
|
|
1359
1359
|
d: "m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",
|
|
1360
1360
|
key: "132q7q"
|
|
1361
1361
|
}], ["rect", {
|
|
@@ -1365,7 +1365,7 @@ var Sr = W("arrow-right", [["path", {
|
|
|
1365
1365
|
height: "16",
|
|
1366
1366
|
rx: "2",
|
|
1367
1367
|
key: "izxlao"
|
|
1368
|
-
}]]), Rr =
|
|
1368
|
+
}]]), Rr = U("message-circle-more", [
|
|
1369
1369
|
["path", {
|
|
1370
1370
|
d: "M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",
|
|
1371
1371
|
key: "1sd12s"
|
|
@@ -1382,13 +1382,13 @@ var Sr = W("arrow-right", [["path", {
|
|
|
1382
1382
|
d: "M16 12h.01",
|
|
1383
1383
|
key: "1l6xoz"
|
|
1384
1384
|
}]
|
|
1385
|
-
]), zr =
|
|
1385
|
+
]), zr = U("message-circle", [["path", {
|
|
1386
1386
|
d: "M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",
|
|
1387
1387
|
key: "1sd12s"
|
|
1388
|
-
}]]), Br =
|
|
1388
|
+
}]]), Br = U("message-square", [["path", {
|
|
1389
1389
|
d: "M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",
|
|
1390
1390
|
key: "18887p"
|
|
1391
|
-
}]]), Vr =
|
|
1391
|
+
}]]), Vr = U("monitor", [
|
|
1392
1392
|
["rect", {
|
|
1393
1393
|
width: "20",
|
|
1394
1394
|
height: "14",
|
|
@@ -1411,16 +1411,16 @@ var Sr = W("arrow-right", [["path", {
|
|
|
1411
1411
|
y2: "21",
|
|
1412
1412
|
key: "vw1qmm"
|
|
1413
1413
|
}]
|
|
1414
|
-
]), Hr =
|
|
1414
|
+
]), Hr = U("moon", [["path", {
|
|
1415
1415
|
d: "M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",
|
|
1416
1416
|
key: "kfwtm"
|
|
1417
|
-
}]]), Ur =
|
|
1417
|
+
}]]), Ur = U("paperclip", [["path", {
|
|
1418
1418
|
d: "m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",
|
|
1419
1419
|
key: "1miecu"
|
|
1420
|
-
}]]), Wr =
|
|
1420
|
+
}]]), Wr = U("phone", [["path", {
|
|
1421
1421
|
d: "M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",
|
|
1422
1422
|
key: "9njp5v"
|
|
1423
|
-
}]]), Gr =
|
|
1423
|
+
}]]), Gr = U("refresh-cw", [
|
|
1424
1424
|
["path", {
|
|
1425
1425
|
d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",
|
|
1426
1426
|
key: "v9h5vc"
|
|
@@ -1437,7 +1437,7 @@ var Sr = W("arrow-right", [["path", {
|
|
|
1437
1437
|
d: "M8 16H3v5",
|
|
1438
1438
|
key: "1cv678"
|
|
1439
1439
|
}]
|
|
1440
|
-
]), Kr =
|
|
1440
|
+
]), Kr = U("search", [["path", {
|
|
1441
1441
|
d: "m21 21-4.34-4.34",
|
|
1442
1442
|
key: "14j7rj"
|
|
1443
1443
|
}], ["circle", {
|
|
@@ -1445,7 +1445,7 @@ var Sr = W("arrow-right", [["path", {
|
|
|
1445
1445
|
cy: "11",
|
|
1446
1446
|
r: "8",
|
|
1447
1447
|
key: "4ej97u"
|
|
1448
|
-
}]]), qr =
|
|
1448
|
+
}]]), qr = U("shield-alert", [
|
|
1449
1449
|
["path", {
|
|
1450
1450
|
d: "M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",
|
|
1451
1451
|
key: "oel41y"
|
|
@@ -1458,10 +1458,10 @@ var Sr = W("arrow-right", [["path", {
|
|
|
1458
1458
|
d: "M12 16h.01",
|
|
1459
1459
|
key: "1drbdi"
|
|
1460
1460
|
}]
|
|
1461
|
-
]), Jr =
|
|
1461
|
+
]), Jr = U("shield", [["path", {
|
|
1462
1462
|
d: "M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",
|
|
1463
1463
|
key: "oel41y"
|
|
1464
|
-
}]]), Yr =
|
|
1464
|
+
}]]), Yr = U("smile", [
|
|
1465
1465
|
["circle", {
|
|
1466
1466
|
cx: "12",
|
|
1467
1467
|
cy: "12",
|
|
@@ -1486,7 +1486,7 @@ var Sr = W("arrow-right", [["path", {
|
|
|
1486
1486
|
y2: "9",
|
|
1487
1487
|
key: "1p4y9e"
|
|
1488
1488
|
}]
|
|
1489
|
-
]), Xr =
|
|
1489
|
+
]), Xr = U("sparkles", [
|
|
1490
1490
|
["path", {
|
|
1491
1491
|
d: "M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",
|
|
1492
1492
|
key: "1s2grr"
|
|
@@ -1505,10 +1505,10 @@ var Sr = W("arrow-right", [["path", {
|
|
|
1505
1505
|
r: "2",
|
|
1506
1506
|
key: "6kqj1y"
|
|
1507
1507
|
}]
|
|
1508
|
-
]), Zr =
|
|
1508
|
+
]), Zr = U("star", [["path", {
|
|
1509
1509
|
d: "M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",
|
|
1510
1510
|
key: "r04s7s"
|
|
1511
|
-
}]]), Qr =
|
|
1511
|
+
}]]), Qr = U("sun", [
|
|
1512
1512
|
["circle", {
|
|
1513
1513
|
cx: "12",
|
|
1514
1514
|
cy: "12",
|
|
@@ -1547,7 +1547,7 @@ var Sr = W("arrow-right", [["path", {
|
|
|
1547
1547
|
d: "m19.07 4.93-1.41 1.41",
|
|
1548
1548
|
key: "1shlcs"
|
|
1549
1549
|
}]
|
|
1550
|
-
]), $r =
|
|
1550
|
+
]), $r = U("trash-2", [
|
|
1551
1551
|
["path", {
|
|
1552
1552
|
d: "M10 11v6",
|
|
1553
1553
|
key: "nco0om"
|
|
@@ -1568,7 +1568,7 @@ var Sr = W("arrow-right", [["path", {
|
|
|
1568
1568
|
d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",
|
|
1569
1569
|
key: "e791ji"
|
|
1570
1570
|
}]
|
|
1571
|
-
]), ei =
|
|
1571
|
+
]), ei = U("user", [["path", {
|
|
1572
1572
|
d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",
|
|
1573
1573
|
key: "975kel"
|
|
1574
1574
|
}], ["circle", {
|
|
@@ -1576,7 +1576,7 @@ var Sr = W("arrow-right", [["path", {
|
|
|
1576
1576
|
cy: "7",
|
|
1577
1577
|
r: "4",
|
|
1578
1578
|
key: "17ys0d"
|
|
1579
|
-
}]]), ti =
|
|
1579
|
+
}]]), ti = U("users", [
|
|
1580
1580
|
["path", {
|
|
1581
1581
|
d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",
|
|
1582
1582
|
key: "1yyitq"
|
|
@@ -1595,7 +1595,7 @@ var Sr = W("arrow-right", [["path", {
|
|
|
1595
1595
|
r: "4",
|
|
1596
1596
|
key: "nufk8"
|
|
1597
1597
|
}]
|
|
1598
|
-
]), ni =
|
|
1598
|
+
]), ni = U("video", [["path", {
|
|
1599
1599
|
d: "m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",
|
|
1600
1600
|
key: "ftymec"
|
|
1601
1601
|
}], ["rect", {
|
|
@@ -1605,7 +1605,7 @@ var Sr = W("arrow-right", [["path", {
|
|
|
1605
1605
|
height: "12",
|
|
1606
1606
|
rx: "2",
|
|
1607
1607
|
key: "158x01"
|
|
1608
|
-
}]]), ri =
|
|
1608
|
+
}]]), ri = U("volume-2", [
|
|
1609
1609
|
["path", {
|
|
1610
1610
|
d: "M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",
|
|
1611
1611
|
key: "uqj9uw"
|
|
@@ -1618,7 +1618,7 @@ var Sr = W("arrow-right", [["path", {
|
|
|
1618
1618
|
d: "M19.364 18.364a9 9 0 0 0 0-12.728",
|
|
1619
1619
|
key: "ijwkga"
|
|
1620
1620
|
}]
|
|
1621
|
-
]), ii =
|
|
1621
|
+
]), ii = U("volume-x", [
|
|
1622
1622
|
["path", {
|
|
1623
1623
|
d: "M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",
|
|
1624
1624
|
key: "uqj9uw"
|
|
@@ -1652,7 +1652,7 @@ function oi({ count: e, size: t = "sm", className: r }) {
|
|
|
1652
1652
|
stiffness: 600,
|
|
1653
1653
|
damping: 9
|
|
1654
1654
|
},
|
|
1655
|
-
className:
|
|
1655
|
+
className: H("inline-flex", r),
|
|
1656
1656
|
"aria-label": `${e} unread`,
|
|
1657
1657
|
children: [
|
|
1658
1658
|
/* @__PURE__ */ Z("span", {
|
|
@@ -1675,7 +1675,7 @@ function oi({ count: e, size: t = "sm", className: r }) {
|
|
|
1675
1675
|
className: "absolute inset-0 -z-10 rounded-full bg-wx-danger blur-[2px]"
|
|
1676
1676
|
}),
|
|
1677
1677
|
/* @__PURE__ */ Z("span", {
|
|
1678
|
-
className:
|
|
1678
|
+
className: H("relative flex items-center justify-center", "rounded-full bg-wx-danger font-bold leading-none text-white", ai[t]),
|
|
1679
1679
|
children: e > 99 ? "99+" : e
|
|
1680
1680
|
})
|
|
1681
1681
|
]
|
|
@@ -1691,12 +1691,12 @@ var si = [
|
|
|
1691
1691
|
"profile"
|
|
1692
1692
|
];
|
|
1693
1693
|
function ci({ active: e, features: t, onChange: n, unreadCount: i = 0 }) {
|
|
1694
|
-
let a =
|
|
1694
|
+
let a = V("tabs"), s = Je(), c = Je(), l = si.filter((e) => di(e, t));
|
|
1695
1695
|
return /* @__PURE__ */ Z("div", {
|
|
1696
1696
|
className: "px-3 pt-2 pb-2",
|
|
1697
1697
|
children: /* @__PURE__ */ Z("nav", {
|
|
1698
1698
|
role: "tablist",
|
|
1699
|
-
className:
|
|
1699
|
+
className: H("relative flex w-full items-center gap-1", "rounded-full bg-wx-bg-elevated/70 p-1 backdrop-blur-md", "shadow-[inset_0_0_0_1px_rgb(0_0_0/0.04)]"),
|
|
1700
1700
|
children: l.map((t) => {
|
|
1701
1701
|
let l = t === e;
|
|
1702
1702
|
if (t === "home") return /* @__PURE__ */ Z(li, {
|
|
@@ -1741,7 +1741,7 @@ function li({ id: e, label: t, isActive: r, onClick: i, icon: a, parentHandlers:
|
|
|
1741
1741
|
"aria-selected": r,
|
|
1742
1742
|
onClick: i,
|
|
1743
1743
|
...o,
|
|
1744
|
-
className:
|
|
1744
|
+
className: H("relative z-10 flex items-center justify-center gap-1.5 rounded-full px-3 py-2", "transition-colors duration-150", r ? "flex-[2_2_0%] text-wx-fg" : "flex-1 text-wx-fg-muted hover:text-wx-fg"),
|
|
1745
1745
|
children: [
|
|
1746
1746
|
r && /* @__PURE__ */ Z(n.span, {
|
|
1747
1747
|
layoutId: "bottom-nav-pill",
|
|
@@ -1796,7 +1796,7 @@ function ui({ id: e, label: t, isActive: r, onClick: i, Icon: a }) {
|
|
|
1796
1796
|
10,
|
|
1797
1797
|
0
|
|
1798
1798
|
] }),
|
|
1799
|
-
className:
|
|
1799
|
+
className: H("relative z-10 flex items-center justify-center gap-1.5 rounded-full px-3 py-2", "transition-colors duration-150", r ? "flex-[2_2_0%] text-wx-fg" : "flex-1 text-wx-fg-muted hover:text-wx-fg"),
|
|
1800
1800
|
children: [
|
|
1801
1801
|
r && /* @__PURE__ */ Z(n.span, {
|
|
1802
1802
|
layoutId: "bottom-nav-pill",
|
|
@@ -1838,7 +1838,7 @@ function di(e, t) {
|
|
|
1838
1838
|
//#endregion
|
|
1839
1839
|
//#region components/widget/branding-footer.tsx
|
|
1840
1840
|
function fi({ className: e }) {
|
|
1841
|
-
let t =
|
|
1841
|
+
let t = V("branding");
|
|
1842
1842
|
return /* @__PURE__ */ Q(n.div, {
|
|
1843
1843
|
initial: {
|
|
1844
1844
|
opacity: 0,
|
|
@@ -1853,7 +1853,7 @@ function fi({ className: e }) {
|
|
|
1853
1853
|
delay: .15,
|
|
1854
1854
|
ease: "easeOut"
|
|
1855
1855
|
},
|
|
1856
|
-
className:
|
|
1856
|
+
className: H("flex items-center justify-center gap-1 bg-wx-bg px-4 py-1.5 text-[10px] font-medium text-wx-fg-subtle", e),
|
|
1857
1857
|
children: [/* @__PURE__ */ Z("span", { children: t("poweredBy") }), /* @__PURE__ */ Z("a", {
|
|
1858
1858
|
href: "https://wexio.io?ref=widget",
|
|
1859
1859
|
target: "_blank",
|
|
@@ -1866,11 +1866,11 @@ function fi({ className: e }) {
|
|
|
1866
1866
|
//#endregion
|
|
1867
1867
|
//#region components/widget/sound-toggle.tsx
|
|
1868
1868
|
function pi({ muted: e, onToggle: t }) {
|
|
1869
|
-
return /* @__PURE__ */ Z(
|
|
1869
|
+
return /* @__PURE__ */ Z(Oe, {
|
|
1870
1870
|
type: "button",
|
|
1871
1871
|
variant: "ghost",
|
|
1872
1872
|
size: "icon",
|
|
1873
|
-
"aria-label":
|
|
1873
|
+
"aria-label": V("sound")(e ? "unmute" : "mute"),
|
|
1874
1874
|
onClick: t,
|
|
1875
1875
|
children: /* @__PURE__ */ Z(Ve, {
|
|
1876
1876
|
icon: e ? ii : ri,
|
|
@@ -1881,11 +1881,11 @@ function pi({ muted: e, onToggle: t }) {
|
|
|
1881
1881
|
//#endregion
|
|
1882
1882
|
//#region components/widget/conversation-header.tsx
|
|
1883
1883
|
function mi({ title: e, subtitle: t, organizationLogoUrl: n, muted: r, onToggleMute: a, onBack: o, onClose: c, expanded: l, onToggleExpand: u }) {
|
|
1884
|
-
let d =
|
|
1884
|
+
let d = V("header"), f = V("header"), p = Je(), m = Je();
|
|
1885
1885
|
return /* @__PURE__ */ Q("header", {
|
|
1886
|
-
className:
|
|
1886
|
+
className: H("flex items-center gap-3 border-b border-wx-border bg-wx-bg px-3 py-3"),
|
|
1887
1887
|
children: [
|
|
1888
|
-
o && /* @__PURE__ */ Z(
|
|
1888
|
+
o && /* @__PURE__ */ Z(Oe, {
|
|
1889
1889
|
type: "button",
|
|
1890
1890
|
variant: "ghost",
|
|
1891
1891
|
size: "icon",
|
|
@@ -1920,7 +1920,7 @@ function mi({ title: e, subtitle: t, organizationLogoUrl: n, muted: r, onToggleM
|
|
|
1920
1920
|
muted: r,
|
|
1921
1921
|
onToggle: a
|
|
1922
1922
|
}),
|
|
1923
|
-
u && /* @__PURE__ */ Z(
|
|
1923
|
+
u && /* @__PURE__ */ Z(Oe, {
|
|
1924
1924
|
type: "button",
|
|
1925
1925
|
variant: "ghost",
|
|
1926
1926
|
size: "icon",
|
|
@@ -1929,7 +1929,7 @@ function mi({ title: e, subtitle: t, organizationLogoUrl: n, muted: r, onToggleM
|
|
|
1929
1929
|
className: "shrink-0",
|
|
1930
1930
|
children: /* @__PURE__ */ Z(hi, { expanded: !!l })
|
|
1931
1931
|
}),
|
|
1932
|
-
/* @__PURE__ */ Z(
|
|
1932
|
+
/* @__PURE__ */ Z(Oe, {
|
|
1933
1933
|
type: "button",
|
|
1934
1934
|
variant: "ghost",
|
|
1935
1935
|
size: "icon",
|
|
@@ -2005,7 +2005,7 @@ function hi({ expanded: e }) {
|
|
|
2005
2005
|
//#endregion
|
|
2006
2006
|
//#region components/widget/demo-messages.tsx
|
|
2007
2007
|
function gi({ children: e }) {
|
|
2008
|
-
let { isDummy: t } = C(), n =
|
|
2008
|
+
let { isDummy: t } = C(), n = Me(), r = je(), i = r.demo, a = i !== void 0 && typeof i == "object" && !!i && Object.keys(i).length > 0, [o, s] = X(null);
|
|
2009
2009
|
return J(() => {
|
|
2010
2010
|
if (!t || a) return;
|
|
2011
2011
|
let e = !0;
|
|
@@ -2053,16 +2053,16 @@ function vi({ title: e, description: t, meta: r, authors: i, onClick: a, kind: o
|
|
|
2053
2053
|
duration: .18,
|
|
2054
2054
|
delay: s
|
|
2055
2055
|
},
|
|
2056
|
-
className:
|
|
2056
|
+
className: H("group flex w-full items-center gap-3 border-wx-border border-b text-left transition-colors", "hover:bg-wx-bg-elevated/60", "last:border-b-0", c ? "px-5 py-3" : "px-5 py-3.5"),
|
|
2057
2057
|
children: [/* @__PURE__ */ Q("span", {
|
|
2058
2058
|
className: "flex min-w-0 flex-1 flex-col gap-0.5",
|
|
2059
2059
|
children: [
|
|
2060
2060
|
/* @__PURE__ */ Z("span", {
|
|
2061
|
-
className:
|
|
2061
|
+
className: H("text-wx-fg", c ? "font-normal text-sm" : "font-semibold text-sm"),
|
|
2062
2062
|
children: e
|
|
2063
2063
|
}),
|
|
2064
2064
|
t && /* @__PURE__ */ Z("span", {
|
|
2065
|
-
className:
|
|
2065
|
+
className: H("leading-snug", c ? "truncate text-[11px] text-wx-fg-subtle" : "text-wx-fg-muted text-xs"),
|
|
2066
2066
|
children: t
|
|
2067
2067
|
}),
|
|
2068
2068
|
r && /* @__PURE__ */ Z("span", {
|
|
@@ -2084,13 +2084,13 @@ function vi({ title: e, description: t, meta: r, authors: i, onClick: a, kind: o
|
|
|
2084
2084
|
//#region components/widget/help-category-view.tsx
|
|
2085
2085
|
var yi = 10, bi = 240, xi = 3;
|
|
2086
2086
|
function Si({ categoryId: e, categoryName: t, categoryDescription: r, categoryArticleCount: i, isDummy: a, onOpenCategory: o, onOpenArticle: s }) {
|
|
2087
|
-
let c =
|
|
2087
|
+
let c = V("help"), l = V("demo"), u = Me(), [d, f] = X(""), p = wi(d, 300), m = p.length >= 2, { data: h } = we({
|
|
2088
2088
|
variables: {
|
|
2089
2089
|
parentId: e,
|
|
2090
2090
|
locale: u
|
|
2091
2091
|
},
|
|
2092
2092
|
skip: a
|
|
2093
|
-
}), g = Nt(() => h?.visitorHelpFolders ?? [], [h]), { data: _, loading: v, fetchMore: y } =
|
|
2093
|
+
}), g = Nt(() => h?.visitorHelpFolders ?? [], [h]), { data: _, loading: v, fetchMore: y } = Ee({
|
|
2094
2094
|
variables: { args: {
|
|
2095
2095
|
folderId: e,
|
|
2096
2096
|
locale: u,
|
|
@@ -2100,40 +2100,40 @@ function Si({ categoryId: e, categoryName: t, categoryDescription: r, categoryAr
|
|
|
2100
2100
|
} },
|
|
2101
2101
|
skip: a,
|
|
2102
2102
|
notifyOnNetworkStatusChange: !0
|
|
2103
|
-
}), { data: b, loading: x } =
|
|
2103
|
+
}), { data: b, loading: x } = Ee({
|
|
2104
2104
|
variables: { args: {
|
|
2105
2105
|
query: p,
|
|
2106
2106
|
locale: u,
|
|
2107
2107
|
limit: 10
|
|
2108
2108
|
} },
|
|
2109
2109
|
skip: p.length < 2 || a
|
|
2110
|
-
}), S = a ?
|
|
2110
|
+
}), S = a ? Te(l).find((t) => t.id === e) : null, C = a ? be(l).filter((t) => t.categoryId === e) : [], w = a ? C.map((e) => ({
|
|
2111
2111
|
id: e.id,
|
|
2112
2112
|
slug: e.slug,
|
|
2113
2113
|
title: e.title,
|
|
2114
2114
|
excerpt: e.excerpt,
|
|
2115
|
-
authors:
|
|
2115
|
+
authors: Ie(e.authors),
|
|
2116
2116
|
reactionCounts: null
|
|
2117
2117
|
})) : (_?.visitorHelpList.items ?? []).map((e) => ({
|
|
2118
2118
|
id: e._id,
|
|
2119
2119
|
slug: e.slug,
|
|
2120
2120
|
title: e.title,
|
|
2121
2121
|
excerpt: e.excerpt ?? null,
|
|
2122
|
-
authors:
|
|
2122
|
+
authors: Ie(e.authors),
|
|
2123
2123
|
reactionCounts: e.reactionCounts ?? null
|
|
2124
|
-
})), T = a ?
|
|
2124
|
+
})), T = a ? be(l).filter((e) => e.title.toLowerCase().includes(p.toLowerCase()) || e.excerpt.toLowerCase().includes(p.toLowerCase())).map((e) => ({
|
|
2125
2125
|
id: e.id,
|
|
2126
2126
|
slug: e.slug,
|
|
2127
2127
|
title: e.title,
|
|
2128
2128
|
excerpt: e.excerpt,
|
|
2129
|
-
authors:
|
|
2129
|
+
authors: Ie(e.authors),
|
|
2130
2130
|
reactionCounts: null
|
|
2131
2131
|
})) : [], E = (b?.visitorHelpList.items ?? []).map((e) => ({
|
|
2132
2132
|
id: e._id,
|
|
2133
2133
|
slug: e.slug,
|
|
2134
2134
|
title: e.title,
|
|
2135
2135
|
excerpt: e.excerpt ?? null,
|
|
2136
|
-
authors:
|
|
2136
|
+
authors: Ie(e.authors),
|
|
2137
2137
|
reactionCounts: e.reactionCounts ?? null
|
|
2138
2138
|
})), D = m ? a ? T : E : w, O = t ?? S?.title ?? "", k = r ?? S?.description ?? "", A = i ?? S?.articleCount ?? w.length, j = Nt(() => {
|
|
2139
2139
|
let e = /* @__PURE__ */ new Map();
|
|
@@ -2257,7 +2257,7 @@ function Si({ categoryId: e, categoryName: t, categoryDescription: r, categoryAr
|
|
|
2257
2257
|
}, e._id)),
|
|
2258
2258
|
(ne || x) && /* @__PURE__ */ Z("div", {
|
|
2259
2259
|
className: "flex justify-center py-3",
|
|
2260
|
-
children: /* @__PURE__ */ Z(
|
|
2260
|
+
children: /* @__PURE__ */ Z(W, { className: "h-3 w-24" })
|
|
2261
2261
|
})
|
|
2262
2262
|
]
|
|
2263
2263
|
})
|
|
@@ -2272,8 +2272,8 @@ function Ci() {
|
|
|
2272
2272
|
className: "flex items-center gap-3 border-wx-border border-b px-5 py-4 last:border-b-0",
|
|
2273
2273
|
children: [/* @__PURE__ */ Q("div", {
|
|
2274
2274
|
className: "flex min-w-0 flex-1 flex-col gap-2",
|
|
2275
|
-
children: [/* @__PURE__ */ Z(
|
|
2276
|
-
}), /* @__PURE__ */ Z(
|
|
2275
|
+
children: [/* @__PURE__ */ Z(W, { className: "h-4 w-32 rounded" }), /* @__PURE__ */ Z(W, { className: "h-3 w-56 rounded" })]
|
|
2276
|
+
}), /* @__PURE__ */ Z(W, { className: "h-4 w-4 rounded" })]
|
|
2277
2277
|
}, t))
|
|
2278
2278
|
});
|
|
2279
2279
|
}
|
|
@@ -2298,7 +2298,7 @@ function Ti(e) {
|
|
|
2298
2298
|
//#endregion
|
|
2299
2299
|
//#region components/widget/launcher-peek.tsx
|
|
2300
2300
|
function Ei({ message: e, onOpen: t, onDismiss: r, onSendButton: i, position: a = "right", embedded: o = !1 }) {
|
|
2301
|
-
let s =
|
|
2301
|
+
let s = V("peek"), c = a === "left";
|
|
2302
2302
|
return /* @__PURE__ */ Z(ne, { children: e && /* @__PURE__ */ Q(n.div, {
|
|
2303
2303
|
initial: {
|
|
2304
2304
|
opacity: 0,
|
|
@@ -2320,7 +2320,7 @@ function Ei({ message: e, onOpen: t, onDismiss: r, onSendButton: i, position: a
|
|
|
2320
2320
|
stiffness: 440,
|
|
2321
2321
|
damping: 20
|
|
2322
2322
|
},
|
|
2323
|
-
className:
|
|
2323
|
+
className: H("bottom-24 z-2147483599 flex w-[300px] flex-col gap-2", o ? "absolute" : "fixed", c ? "left-4" : "right-4"),
|
|
2324
2324
|
role: "dialog",
|
|
2325
2325
|
"aria-label": s("newMessage"),
|
|
2326
2326
|
children: [e.text && /* @__PURE__ */ Q(n.div, {
|
|
@@ -2330,24 +2330,24 @@ function Ei({ message: e, onOpen: t, onDismiss: r, onSendButton: i, position: a
|
|
|
2330
2330
|
stiffness: 400,
|
|
2331
2331
|
damping: 24
|
|
2332
2332
|
},
|
|
2333
|
-
className:
|
|
2333
|
+
className: H("relative rounded-wx-lg border border-wx-border bg-wx-bg", "p-4 pr-9 text-wx-fg", "shadow-[0_16px_40px_rgba(0,0,0,0.16)]"),
|
|
2334
2334
|
children: [/* @__PURE__ */ Z("button", {
|
|
2335
2335
|
type: "button",
|
|
2336
2336
|
onClick: r,
|
|
2337
2337
|
"aria-label": s("dismiss"),
|
|
2338
|
-
className:
|
|
2338
|
+
className: H("absolute top-2 right-2 flex h-6 w-6 items-center justify-center rounded-full", "text-wx-fg-muted transition-colors hover:bg-wx-bg-elevated hover:text-wx-fg"),
|
|
2339
2339
|
children: /* @__PURE__ */ Z(fe, { size: 12 })
|
|
2340
2340
|
}), /* @__PURE__ */ Q("button", {
|
|
2341
2341
|
type: "button",
|
|
2342
2342
|
onClick: t,
|
|
2343
|
-
className:
|
|
2343
|
+
className: H("block w-full text-left", "transition-opacity hover:opacity-90"),
|
|
2344
2344
|
children: [/* @__PURE__ */ Z(Di, { sender: e.sender }), /* @__PURE__ */ Z("span", {
|
|
2345
|
-
className:
|
|
2345
|
+
className: H("mt-1.5 block text-sm leading-relaxed", "wrap-anywhere", "line-clamp-10"),
|
|
2346
2346
|
children: Ti(e.text)
|
|
2347
2347
|
})]
|
|
2348
2348
|
})]
|
|
2349
2349
|
}), e.buttons.length > 0 && /* @__PURE__ */ Z("div", {
|
|
2350
|
-
className:
|
|
2350
|
+
className: H("flex flex-col gap-1.5", c ? "items-start" : "items-end"),
|
|
2351
2351
|
children: e.buttons.map((e) => /* @__PURE__ */ Z(n.button, {
|
|
2352
2352
|
type: "button",
|
|
2353
2353
|
onClick: () => i(e.payload, e.text),
|
|
@@ -2358,14 +2358,14 @@ function Ei({ message: e, onOpen: t, onDismiss: r, onSendButton: i, position: a
|
|
|
2358
2358
|
stiffness: 480,
|
|
2359
2359
|
damping: 26
|
|
2360
2360
|
},
|
|
2361
|
-
className:
|
|
2361
|
+
className: H("max-w-full rounded-full bg-wx-bg px-3.5 py-2 text-sm font-medium text-wx-primary", "transition-colors hover:bg-wx-primary hover:text-wx-primary-fg", "shadow-[0_4px_12px_rgba(0,0,0,0.08)]"),
|
|
2362
2362
|
children: e.text
|
|
2363
2363
|
}, e.payload))
|
|
2364
2364
|
})]
|
|
2365
2365
|
}, e.id) });
|
|
2366
2366
|
}
|
|
2367
2367
|
function Di({ sender: e }) {
|
|
2368
|
-
let { config: t } = C(), n =
|
|
2368
|
+
let { config: t } = C(), n = V("peek"), r = e.kind === "ai" || e.kind === "bot", i = r ? Yt : e.name?.trim() ?? "", a = i ? null : e.kind === "operator" ? n("operator") : null, o = t.messenger?.aiAssistantAvatar ?? null;
|
|
2369
2369
|
return /* @__PURE__ */ Q("span", {
|
|
2370
2370
|
className: "flex items-center gap-2 text-xs",
|
|
2371
2371
|
children: [r ? o ? /* @__PURE__ */ Z("span", {
|
|
@@ -2384,7 +2384,7 @@ function Di({ sender: e }) {
|
|
|
2384
2384
|
alt: i || a || "",
|
|
2385
2385
|
className: "h-5 w-5 shrink-0 rounded-full object-cover"
|
|
2386
2386
|
}) : /* @__PURE__ */ Z("span", {
|
|
2387
|
-
className:
|
|
2387
|
+
className: H("flex h-5 w-5 shrink-0 items-center justify-center rounded-full", "bg-wx-bg-elevated text-[9px] font-semibold text-wx-fg-muted"),
|
|
2388
2388
|
children: Oi(i || a || "")
|
|
2389
2389
|
}), /* @__PURE__ */ Z("span", {
|
|
2390
2390
|
className: "font-medium text-wx-fg-muted",
|
|
@@ -2399,13 +2399,13 @@ function Oi(e) {
|
|
|
2399
2399
|
//#endregion
|
|
2400
2400
|
//#region components/widget/tab-title-header.tsx
|
|
2401
2401
|
function ki({ title: e, onBack: t, onClose: n, className: r, expanded: a, onToggleExpand: o }) {
|
|
2402
|
-
let c =
|
|
2402
|
+
let c = V("header"), l = Je(), u = Je();
|
|
2403
2403
|
return /* @__PURE__ */ Q("header", {
|
|
2404
|
-
className:
|
|
2404
|
+
className: H("flex h-14 items-center gap-2 border-b border-wx-border bg-wx-bg px-2", r),
|
|
2405
2405
|
children: [
|
|
2406
2406
|
/* @__PURE__ */ Z("div", {
|
|
2407
2407
|
className: "flex flex-1 items-center justify-start",
|
|
2408
|
-
children: t && /* @__PURE__ */ Z(
|
|
2408
|
+
children: t && /* @__PURE__ */ Z(Oe, {
|
|
2409
2409
|
type: "button",
|
|
2410
2410
|
variant: "ghost",
|
|
2411
2411
|
size: "icon",
|
|
@@ -2425,7 +2425,7 @@ function ki({ title: e, onBack: t, onClose: n, className: r, expanded: a, onTogg
|
|
|
2425
2425
|
}),
|
|
2426
2426
|
/* @__PURE__ */ Q("div", {
|
|
2427
2427
|
className: "flex flex-1 items-center justify-end gap-0",
|
|
2428
|
-
children: [o && /* @__PURE__ */ Z(
|
|
2428
|
+
children: [o && /* @__PURE__ */ Z(Oe, {
|
|
2429
2429
|
type: "button",
|
|
2430
2430
|
variant: "ghost",
|
|
2431
2431
|
size: "icon",
|
|
@@ -2486,7 +2486,7 @@ function ki({ title: e, onBack: t, onClose: n, className: r, expanded: a, onTogg
|
|
|
2486
2486
|
})
|
|
2487
2487
|
]
|
|
2488
2488
|
})
|
|
2489
|
-
}), /* @__PURE__ */ Z(
|
|
2489
|
+
}), /* @__PURE__ */ Z(Oe, {
|
|
2490
2490
|
type: "button",
|
|
2491
2491
|
variant: "ghost",
|
|
2492
2492
|
size: "icon",
|
|
@@ -2505,13 +2505,13 @@ function ki({ title: e, onBack: t, onClose: n, className: r, expanded: a, onTogg
|
|
|
2505
2505
|
//#endregion
|
|
2506
2506
|
//#region components/widget/tabs/help-tab.tsx
|
|
2507
2507
|
function Ai({ isDummy: e, onOpenCategory: t, onOpenArticle: n }) {
|
|
2508
|
-
let r =
|
|
2508
|
+
let r = V("help"), i = V("demo"), a = Me(), [o, s] = X(""), c = Ni(o, 300), { data: l, loading: u } = we({
|
|
2509
2509
|
variables: {
|
|
2510
2510
|
parentId: null,
|
|
2511
2511
|
locale: a
|
|
2512
2512
|
},
|
|
2513
2513
|
skip: e
|
|
2514
|
-
}), { data: d } =
|
|
2514
|
+
}), { data: d } = Ee({
|
|
2515
2515
|
variables: { args: {
|
|
2516
2516
|
folderId: null,
|
|
2517
2517
|
locale: a,
|
|
@@ -2519,31 +2519,31 @@ function Ai({ isDummy: e, onOpenCategory: t, onOpenArticle: n }) {
|
|
|
2519
2519
|
limit: 20
|
|
2520
2520
|
} },
|
|
2521
2521
|
skip: e
|
|
2522
|
-
}), { data: f } =
|
|
2522
|
+
}), { data: f } = Ee({
|
|
2523
2523
|
variables: { args: {
|
|
2524
2524
|
query: c,
|
|
2525
2525
|
locale: a,
|
|
2526
2526
|
limit: 10
|
|
2527
2527
|
} },
|
|
2528
2528
|
skip: c.length < 2 || e
|
|
2529
|
-
}), p = Pi(l), m = e ?
|
|
2529
|
+
}), p = Pi(l), m = e ? Te(i) : p ?? [], h = c.length >= 2, g = Fi(f), _ = e ? be(i).filter((e) => e.title.toLowerCase().includes(c.toLowerCase()) || e.excerpt.toLowerCase().includes(c.toLowerCase())).map((e) => ({
|
|
2530
2530
|
id: e.id,
|
|
2531
2531
|
title: e.title,
|
|
2532
2532
|
excerpt: e.excerpt,
|
|
2533
2533
|
slug: e.slug,
|
|
2534
|
-
authors:
|
|
2534
|
+
authors: Ie(e.authors)
|
|
2535
2535
|
})) : [], v = e ? _ : g, y = e ? [] : (d?.visitorHelpList.items ?? []).map((e) => ({
|
|
2536
2536
|
id: e._id,
|
|
2537
2537
|
title: e.title,
|
|
2538
2538
|
excerpt: e.excerpt ?? null,
|
|
2539
2539
|
slug: e.slug,
|
|
2540
|
-
authors:
|
|
2540
|
+
authors: Ie(e.authors)
|
|
2541
2541
|
}));
|
|
2542
2542
|
return /* @__PURE__ */ Z("div", {
|
|
2543
2543
|
className: "flex h-full min-h-0 flex-col",
|
|
2544
2544
|
children: /* @__PURE__ */ Q(le, {
|
|
2545
2545
|
className: "min-h-0 flex-1",
|
|
2546
|
-
viewportRef:
|
|
2546
|
+
viewportRef: Fe("help"),
|
|
2547
2547
|
children: [/* @__PURE__ */ Z(ze, {
|
|
2548
2548
|
value: o,
|
|
2549
2549
|
onChange: s,
|
|
@@ -2595,7 +2595,7 @@ function Ai({ isDummy: e, onOpenCategory: t, onOpenArticle: n }) {
|
|
|
2595
2595
|
});
|
|
2596
2596
|
}
|
|
2597
2597
|
function ji({ results: e, onOpen: t }) {
|
|
2598
|
-
let n =
|
|
2598
|
+
let n = V("help");
|
|
2599
2599
|
return e.length === 0 ? /* @__PURE__ */ Z("div", {
|
|
2600
2600
|
className: "px-5 py-6",
|
|
2601
2601
|
children: /* @__PURE__ */ Z(N, { children: /* @__PURE__ */ Z(se, {
|
|
@@ -2624,11 +2624,11 @@ function Mi() {
|
|
|
2624
2624
|
children: [/* @__PURE__ */ Q("div", {
|
|
2625
2625
|
className: "flex min-w-0 flex-1 flex-col gap-2",
|
|
2626
2626
|
children: [
|
|
2627
|
-
/* @__PURE__ */ Z(
|
|
2628
|
-
/* @__PURE__ */ Z(
|
|
2629
|
-
/* @__PURE__ */ Z(
|
|
2627
|
+
/* @__PURE__ */ Z(W, { className: "h-4 w-32 rounded" }),
|
|
2628
|
+
/* @__PURE__ */ Z(W, { className: "h-3 w-56 rounded" }),
|
|
2629
|
+
/* @__PURE__ */ Z(W, { className: "h-3 w-20 rounded" })
|
|
2630
2630
|
]
|
|
2631
|
-
}), /* @__PURE__ */ Z(
|
|
2631
|
+
}), /* @__PURE__ */ Z(W, { className: "h-4 w-4 rounded" })]
|
|
2632
2632
|
}, t))
|
|
2633
2633
|
});
|
|
2634
2634
|
}
|
|
@@ -2653,7 +2653,7 @@ function Fi(e) {
|
|
|
2653
2653
|
title: e.title,
|
|
2654
2654
|
excerpt: e.excerpt ?? null,
|
|
2655
2655
|
slug: e.slug,
|
|
2656
|
-
authors:
|
|
2656
|
+
authors: Ie(e.authors),
|
|
2657
2657
|
reactionCounts: e.reactionCounts ?? null
|
|
2658
2658
|
})) : [];
|
|
2659
2659
|
}
|
|
@@ -2736,7 +2736,7 @@ var Ri = [
|
|
|
2736
2736
|
"svg",
|
|
2737
2737
|
"ul"
|
|
2738
2738
|
].reduce((e, t) => {
|
|
2739
|
-
let n =
|
|
2739
|
+
let n = ye(`Primitive.${t}`), r = K.forwardRef((e, r) => {
|
|
2740
2740
|
let { asChild: i, ...a } = e, o = i ? n : t;
|
|
2741
2741
|
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ Z(o, {
|
|
2742
2742
|
...a,
|
|
@@ -2859,35 +2859,35 @@ function ea(e, { referrerPolicy: t, crossOrigin: n }) {
|
|
|
2859
2859
|
}
|
|
2860
2860
|
var ta = Ji, na = Xi, ra = Qi, ia = K.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ Z(ta, {
|
|
2861
2861
|
ref: n,
|
|
2862
|
-
className:
|
|
2862
|
+
className: H("relative flex h-8 w-8 shrink-0 overflow-hidden rounded-full", e),
|
|
2863
2863
|
...t
|
|
2864
2864
|
}));
|
|
2865
2865
|
ia.displayName = ta.displayName;
|
|
2866
2866
|
var aa = K.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ Z(na, {
|
|
2867
2867
|
ref: n,
|
|
2868
|
-
className:
|
|
2868
|
+
className: H("aspect-square h-full w-full object-cover", e),
|
|
2869
2869
|
...t
|
|
2870
2870
|
}));
|
|
2871
2871
|
aa.displayName = na.displayName;
|
|
2872
2872
|
var oa = K.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ Z(ra, {
|
|
2873
2873
|
ref: n,
|
|
2874
2874
|
delayMs: 300,
|
|
2875
|
-
className:
|
|
2875
|
+
className: H("flex h-full w-full items-center justify-center bg-wx-bg-elevated-2 text-xs font-medium text-wx-fg-muted", e),
|
|
2876
2876
|
...t
|
|
2877
2877
|
}));
|
|
2878
2878
|
oa.displayName = ra.displayName;
|
|
2879
2879
|
function sa({ avatars: e, max: t = 3, size: n = "md", ringClass: r = "ring-wx-bg", className: i }) {
|
|
2880
2880
|
let a = e.slice(0, t), o = e.length - a.length, s = n === "sm" ? "h-7 w-7" : "h-8 w-8";
|
|
2881
2881
|
return /* @__PURE__ */ Q("div", {
|
|
2882
|
-
className:
|
|
2882
|
+
className: H("flex -space-x-2", i),
|
|
2883
2883
|
children: [a.map((e) => /* @__PURE__ */ Q(ia, {
|
|
2884
|
-
className:
|
|
2884
|
+
className: H(s, "ring-2", r),
|
|
2885
2885
|
children: [/* @__PURE__ */ Z(aa, {
|
|
2886
2886
|
src: e.src,
|
|
2887
2887
|
alt: e.alt
|
|
2888
2888
|
}), /* @__PURE__ */ Z(oa, { children: ca(e.alt) })]
|
|
2889
2889
|
}, e.src)), o > 0 && /* @__PURE__ */ Z(ia, {
|
|
2890
|
-
className:
|
|
2890
|
+
className: H(s, "ring-2", r),
|
|
2891
2891
|
children: /* @__PURE__ */ Q(oa, { children: ["+", o] })
|
|
2892
2892
|
})]
|
|
2893
2893
|
});
|
|
@@ -2908,13 +2908,13 @@ function da(e) {
|
|
|
2908
2908
|
return e.toLowerCase().split("-")[0];
|
|
2909
2909
|
}
|
|
2910
2910
|
function fa() {
|
|
2911
|
-
let e =
|
|
2911
|
+
let e = Me(), { config: t } = C(), n = t.defaultLocale ?? "en";
|
|
2912
2912
|
return q((t, r) => la(t, r, e, n), [e, n]);
|
|
2913
2913
|
}
|
|
2914
2914
|
//#endregion
|
|
2915
2915
|
//#region components/widget/home-blocks/blocks/ask-question.tsx
|
|
2916
2916
|
function pa({ block: e, config: t, onOpenTab: r }) {
|
|
2917
|
-
let i =
|
|
2917
|
+
let i = V("home"), a = fa(), o = e.action ?? "open-messenger", s = o === "open-help" ? "help" : o === "open-news" ? "news" : "messages";
|
|
2918
2918
|
return /* @__PURE__ */ Q(n.button, {
|
|
2919
2919
|
type: "button",
|
|
2920
2920
|
onClick: () => r(s),
|
|
@@ -3008,7 +3008,7 @@ function ya(e) {
|
|
|
3008
3008
|
//#endregion
|
|
3009
3009
|
//#region components/widget/home-blocks/blocks/featured-article.tsx
|
|
3010
3010
|
function ba({ block: e, onOpenTab: t, onOpenNewsArticle: r, isDummy: i }) {
|
|
3011
|
-
let a =
|
|
3011
|
+
let a = V("home"), o = p(), s = !i && e.newsId ? o.previewData?.newsPostsById?.[e.newsId] : void 0, c = s !== void 0, { data: l, loading: u } = Pe({
|
|
3012
3012
|
variables: { args: { id: e.newsId ?? "" } },
|
|
3013
3013
|
skip: i || c || !e.newsId
|
|
3014
3014
|
});
|
|
@@ -3151,7 +3151,7 @@ function Sa({ title: e, slug: t, onOpenArticle: n, onOpenTab: r }) {
|
|
|
3151
3151
|
});
|
|
3152
3152
|
}
|
|
3153
3153
|
function Ca({ block: e, onOpenTab: t, onOpenArticle: n, isDummy: r }) {
|
|
3154
|
-
let i =
|
|
3154
|
+
let i = V("home"), a = V("demo"), o = p(), s = Me(), c = e.suggestions, l = c ? c.mode === "manual" ? Math.min((c.articleIds ?? []).length, 10) : Math.max(0, Math.min(c.maxItems ?? 0, 10)) : 0, u = o.previewData?.helpArticles, d = !r && !!u && l > 0, f = c?.mode === "popular" ? De.Popular : c?.mode === "recent" ? De.Recent : void 0, m = c?.mode === "category" ? c.categoryId : void 0, h = r || d || l === 0 || !c || !(c.mode === "popular" || c.mode === "recent" || c.mode === "category") || c.mode === "category" && !m, { data: g, loading: _ } = ve({
|
|
3155
3155
|
variables: { args: {
|
|
3156
3156
|
limit: l,
|
|
3157
3157
|
locale: s,
|
|
@@ -3169,7 +3169,7 @@ function Ca({ block: e, onOpenTab: t, onOpenArticle: n, isDummy: r }) {
|
|
|
3169
3169
|
}), S = (() => {
|
|
3170
3170
|
if (l === 0 || !c) return [];
|
|
3171
3171
|
if (r) {
|
|
3172
|
-
let e =
|
|
3172
|
+
let e = be(a);
|
|
3173
3173
|
return (c.mode === "popular" ? e.slice().sort((e, t) => t.viewCount - e.viewCount) : c.mode === "recent" ? e.slice().sort((e, t) => (t.publishedAt ?? "").localeCompare(e.publishedAt ?? "")) : c.mode === "category" && c.categoryId ? e.filter((e) => e.categoryId === c.categoryId) : c.mode === "manual" ? (c.articleIds ?? []).map((t) => e.find((e) => e.id === t)).filter((e) => e != null) : e).slice(0, l).map((e) => ({
|
|
3174
3174
|
id: e.id,
|
|
3175
3175
|
title: e.title,
|
|
@@ -3248,7 +3248,7 @@ function wa({ title: e, onOpenAll: t, children: n }) {
|
|
|
3248
3248
|
//#endregion
|
|
3249
3249
|
//#region components/widget/home-blocks/blocks/news-preview.tsx
|
|
3250
3250
|
function Ta({ block: e, onOpenTab: t, isDummy: n }) {
|
|
3251
|
-
let r =
|
|
3251
|
+
let r = V("home"), i = V("demo"), a = Me(), o = p(), s = fa(), c = Math.max(1, Math.min(10, e.maxItems ?? 3)), l = n ? void 0 : o.previewData?.newsPosts, u = Array.isArray(l) && l.length > 0, { data: d, error: f, loading: m } = Re({
|
|
3252
3252
|
variables: { args: {
|
|
3253
3253
|
locale: a,
|
|
3254
3254
|
limit: c
|
|
@@ -3285,7 +3285,7 @@ function Ta({ block: e, onOpenTab: t, isDummy: n }) {
|
|
|
3285
3285
|
//#endregion
|
|
3286
3286
|
//#region components/widget/home-blocks/blocks/pinned-articles.tsx
|
|
3287
3287
|
function Ea({ block: e, onOpenTab: t, onOpenArticle: n, isDummy: r }) {
|
|
3288
|
-
let i =
|
|
3288
|
+
let i = V("home"), a = V("demo"), o = p(), s = Me(), c = fa(), l = (e.articleIds ?? []).slice(0, 10), u = l.length, d = r ? null : o.previewData?.helpArticlesById, f = !!d, { data: m } = Se({
|
|
3289
3289
|
variables: {
|
|
3290
3290
|
ids: l,
|
|
3291
3291
|
locale: s
|
|
@@ -3293,7 +3293,7 @@ function Ea({ block: e, onOpenTab: t, onOpenArticle: n, isDummy: r }) {
|
|
|
3293
3293
|
skip: r || f || l.length === 0
|
|
3294
3294
|
});
|
|
3295
3295
|
if (r) {
|
|
3296
|
-
let r =
|
|
3296
|
+
let r = be(a).slice().sort((e, t) => t.viewCount - e.viewCount).slice(0, 4);
|
|
3297
3297
|
return /* @__PURE__ */ Z(wa, {
|
|
3298
3298
|
title: c(e.title, i("popularArticlesTitle")),
|
|
3299
3299
|
onOpenAll: () => t("help"),
|
|
@@ -3602,7 +3602,7 @@ function Ua({ block: e, onOpenTab: t }) {
|
|
|
3602
3602
|
if (e.layout === "inline") {
|
|
3603
3603
|
let t = e.buttons.slice(0, 8);
|
|
3604
3604
|
return /* @__PURE__ */ Z("div", {
|
|
3605
|
-
className:
|
|
3605
|
+
className: H("grid gap-2", t.length === 1 && "grid-cols-1", t.length === 2 && "grid-cols-2", t.length === 3 && "grid-cols-3", t.length >= 4 && "grid-cols-4"),
|
|
3606
3606
|
children: t.map((e, t) => /* @__PURE__ */ Z(Wa, {
|
|
3607
3607
|
btn: e,
|
|
3608
3608
|
onClick: () => n(e)
|
|
@@ -3668,7 +3668,7 @@ function Ga({ btn: e, onClick: t }) {
|
|
|
3668
3668
|
alt: "",
|
|
3669
3669
|
className: "w-full object-cover"
|
|
3670
3670
|
})
|
|
3671
|
-
}) : /* @__PURE__ */ Q(
|
|
3671
|
+
}) : /* @__PURE__ */ Q(Oe, {
|
|
3672
3672
|
type: "button",
|
|
3673
3673
|
variant: e.style === "primary" ? "solid" : e.style === "ghost" ? "ghost" : "tonal",
|
|
3674
3674
|
size: "lg",
|
|
@@ -3702,7 +3702,7 @@ function Ka({ size: e = 24, className: t }) {
|
|
|
3702
3702
|
width: e,
|
|
3703
3703
|
height: e
|
|
3704
3704
|
},
|
|
3705
|
-
className:
|
|
3705
|
+
className: H("relative inline-block", t),
|
|
3706
3706
|
role: "img",
|
|
3707
3707
|
"aria-label": "Wexio",
|
|
3708
3708
|
children: [/* @__PURE__ */ Z("img", {
|
|
@@ -3723,7 +3723,7 @@ function Ka({ size: e = 24, className: t }) {
|
|
|
3723
3723
|
//#endregion
|
|
3724
3724
|
//#region components/widget/home-blocks/blocks/recent-message.tsx
|
|
3725
3725
|
function qa({ block: e, onOpenTab: t, isDummy: n, chatId: r, config: i }) {
|
|
3726
|
-
let a =
|
|
3726
|
+
let a = V("home"), o = fa(), { data: s, loading: c } = yn({
|
|
3727
3727
|
variables: { chatId: r ?? "" },
|
|
3728
3728
|
skip: n || !r
|
|
3729
3729
|
});
|
|
@@ -3815,7 +3815,7 @@ function Ja({ block: e }) {
|
|
|
3815
3815
|
//#endregion
|
|
3816
3816
|
//#region components/widget/home-blocks/blocks/team-status.tsx
|
|
3817
3817
|
function Ya({ block: e, config: t }) {
|
|
3818
|
-
let n =
|
|
3818
|
+
let n = V("home");
|
|
3819
3819
|
return /* @__PURE__ */ Q("div", {
|
|
3820
3820
|
className: "flex items-center gap-3 rounded-wx-lg bg-wx-bg-elevated px-3.5 py-3",
|
|
3821
3821
|
children: [
|
|
@@ -3925,7 +3925,7 @@ function Qa({ delay: e, children: t, className: r }) {
|
|
|
3925
3925
|
delay: e,
|
|
3926
3926
|
ease: "easeOut"
|
|
3927
3927
|
},
|
|
3928
|
-
className:
|
|
3928
|
+
className: H(r),
|
|
3929
3929
|
children: t
|
|
3930
3930
|
});
|
|
3931
3931
|
}
|
|
@@ -3935,7 +3935,7 @@ function $a(e, t) {
|
|
|
3935
3935
|
//#endregion
|
|
3936
3936
|
//#region components/widget/tabs/home-tab.tsx
|
|
3937
3937
|
function eo({ config: e, organizationLogoUrl: t, onClose: n, onOpenTab: r, isDummy: a, chatId: o, onOpenNewsArticle: s, onOpenHelpArticle: c }) {
|
|
3938
|
-
let l =
|
|
3938
|
+
let l = V("header"), u = Je(), d = $a(e.homeLayout ?? f, e.features), p = a || !!e.greeting?.headline?.trim() || !!e.greeting?.subheadline?.trim();
|
|
3939
3939
|
return /* @__PURE__ */ Z(le, {
|
|
3940
3940
|
className: "flex-1",
|
|
3941
3941
|
children: /* @__PURE__ */ Q("div", {
|
|
@@ -3956,7 +3956,7 @@ function eo({ config: e, organizationLogoUrl: t, onClose: n, onOpenTab: r, isDum
|
|
|
3956
3956
|
avatars: e.operatorAvatars,
|
|
3957
3957
|
ringClass: "ring-wx-bg-elevated/60",
|
|
3958
3958
|
className: "mr-2"
|
|
3959
|
-
}), /* @__PURE__ */ Z(
|
|
3959
|
+
}), /* @__PURE__ */ Z(Oe, {
|
|
3960
3960
|
type: "button",
|
|
3961
3961
|
variant: "ghost",
|
|
3962
3962
|
size: "icon",
|
|
@@ -3991,7 +3991,7 @@ function eo({ config: e, organizationLogoUrl: t, onClose: n, onOpenTab: r, isDum
|
|
|
3991
3991
|
});
|
|
3992
3992
|
}
|
|
3993
3993
|
function to({ config: e, isDummy: t }) {
|
|
3994
|
-
let n =
|
|
3994
|
+
let n = V("home"), r = Me(), i = e.greeting?.headline?.trim() ?? "", a = e.greeting?.subheadline?.trim() ?? "";
|
|
3995
3995
|
if (!t && !(i || a)) return null;
|
|
3996
3996
|
let o = ua(r, e.defaultLocale ?? "en"), s = !t && o, c = s ? i : n("greetingHeadline"), l = s ? a : n("greetingSubheadline");
|
|
3997
3997
|
return !c && !l ? null : /* @__PURE__ */ Q("section", {
|
|
@@ -4036,7 +4036,7 @@ var ro = new Set([
|
|
|
4036
4036
|
"application/pdf"
|
|
4037
4037
|
]), io = "https://accounts.google.com/gsi/client";
|
|
4038
4038
|
function ao({ clientId: e, onCredential: t }) {
|
|
4039
|
-
let n =
|
|
4039
|
+
let n = V("messages"), r = Y(null), i = Y(t);
|
|
4040
4040
|
return J(() => {
|
|
4041
4041
|
i.current = t;
|
|
4042
4042
|
}, [t]), J(() => {
|
|
@@ -4433,7 +4433,7 @@ function ko(e) {
|
|
|
4433
4433
|
responseJson: JSON.stringify(u)
|
|
4434
4434
|
}, f = t === "register" ? (await o({ variables: { input: d } })).data?.verifyVisitorPasskeyRegistration : (await c({ variables: { input: d } })).data?.verifyVisitorPasskeyAuthentication;
|
|
4435
4435
|
if (!f) throw Error("passkey_verify_failed");
|
|
4436
|
-
return
|
|
4436
|
+
return _e(f.token), n("idle"), f;
|
|
4437
4437
|
} catch (e) {
|
|
4438
4438
|
return n("error"), i(e.message || "passkey_failed"), null;
|
|
4439
4439
|
}
|
|
@@ -4456,7 +4456,7 @@ function ko(e) {
|
|
|
4456
4456
|
//#endregion
|
|
4457
4457
|
//#region components/widget/auth/passkey-sign-in-button.tsx
|
|
4458
4458
|
function Ao({ onSession: e }) {
|
|
4459
|
-
let t =
|
|
4459
|
+
let t = V("messages"), { authenticate: n, register: r, status: i, supported: a } = ko({
|
|
4460
4460
|
visitorId: Nt(() => Zn(), []),
|
|
4461
4461
|
origin: typeof window < "u" ? window.location.origin : ""
|
|
4462
4462
|
}), [o, s] = X(null);
|
|
@@ -4516,7 +4516,7 @@ function jo() {
|
|
|
4516
4516
|
//#region components/widget/tabs/messages-tab/composer/attachment-preview.tsx
|
|
4517
4517
|
var Mo = (e) => e.startsWith("image/"), No = (e) => e.startsWith("video/"), Po = (e) => e.startsWith("audio/"), Fo = (e) => e === "application/pdf";
|
|
4518
4518
|
function Io({ attachments: e, onRemove: t, onOpenLightbox: n }) {
|
|
4519
|
-
let r =
|
|
4519
|
+
let r = V("messages"), i = Y(null), [a, o] = X(null);
|
|
4520
4520
|
J(() => {
|
|
4521
4521
|
a && (e.some((e) => e.tempId === a) || (i.current?.pause(), i.current = null, o(null)));
|
|
4522
4522
|
}, [e, a]), J(() => () => {
|
|
@@ -4598,7 +4598,7 @@ function Io({ attachments: e, onRemove: t, onOpenLightbox: n }) {
|
|
|
4598
4598
|
type: "button",
|
|
4599
4599
|
onClick: () => s(e),
|
|
4600
4600
|
"aria-label": r(o ? "pause" : "play"),
|
|
4601
|
-
className:
|
|
4601
|
+
className: H("flex h-16 w-16 items-center justify-center rounded-wx-sm transition-colors", o ? "bg-wx-primary text-wx-primary-fg" : "bg-wx-bg-elevated text-wx-fg-muted hover:text-wx-fg"),
|
|
4602
4602
|
children: /* @__PURE__ */ Z(c, {
|
|
4603
4603
|
size: 22,
|
|
4604
4604
|
fill: "currentColor",
|
|
@@ -4616,7 +4616,7 @@ function Io({ attachments: e, onRemove: t, onOpenLightbox: n }) {
|
|
|
4616
4616
|
type: "button",
|
|
4617
4617
|
onClick: () => u(e),
|
|
4618
4618
|
"aria-label": r("openPreview"),
|
|
4619
|
-
className:
|
|
4619
|
+
className: H("flex h-16 w-16 items-center justify-center rounded-wx-sm", "bg-wx-bg-elevated text-wx-fg-muted transition-colors hover:text-wx-fg"),
|
|
4620
4620
|
children: /* @__PURE__ */ Z(Ar, {
|
|
4621
4621
|
size: 22,
|
|
4622
4622
|
"aria-hidden": "true"
|
|
@@ -4646,14 +4646,14 @@ function Lo({ children: e, uploading: t, onRemove: n, removeLabel: r, title: i }
|
|
|
4646
4646
|
e,
|
|
4647
4647
|
t && /* @__PURE__ */ Z("span", {
|
|
4648
4648
|
"aria-hidden": "true",
|
|
4649
|
-
className:
|
|
4649
|
+
className: H("pointer-events-none absolute inset-0 flex items-center justify-center", "rounded-wx-sm bg-black/30"),
|
|
4650
4650
|
children: /* @__PURE__ */ Z("span", { className: "h-4 w-4 animate-spin rounded-full border-2 border-white border-t-transparent" })
|
|
4651
4651
|
}),
|
|
4652
4652
|
/* @__PURE__ */ Z("button", {
|
|
4653
4653
|
type: "button",
|
|
4654
4654
|
onClick: n,
|
|
4655
4655
|
"aria-label": r,
|
|
4656
|
-
className:
|
|
4656
|
+
className: H("absolute -top-1.5 -right-1.5 flex h-5 w-5 items-center justify-center", "rounded-full bg-wx-bg text-wx-fg-muted shadow ring-1 ring-wx-border", "transition-colors hover:text-wx-fg"),
|
|
4657
4657
|
children: /* @__PURE__ */ Z(fe, { size: 11 })
|
|
4658
4658
|
})
|
|
4659
4659
|
]
|
|
@@ -4692,7 +4692,7 @@ var Ro = At(() => import("./widget-react-BhdM1EXE2.js")), zo = "native", Bo = {
|
|
|
4692
4692
|
"--epr-horizontal-padding": "8px"
|
|
4693
4693
|
};
|
|
4694
4694
|
function Vo({ open: e, onClose: t, onSelect: r, anchorRef: i }) {
|
|
4695
|
-
let a =
|
|
4695
|
+
let a = V("messages"), o = Y(null);
|
|
4696
4696
|
return J(() => {
|
|
4697
4697
|
if (!e) return;
|
|
4698
4698
|
let n = (e) => {
|
|
@@ -4729,7 +4729,7 @@ function Vo({ open: e, onClose: t, onSelect: r, anchorRef: i }) {
|
|
|
4729
4729
|
duration: .14,
|
|
4730
4730
|
ease: "easeOut"
|
|
4731
4731
|
},
|
|
4732
|
-
className:
|
|
4732
|
+
className: H("absolute bottom-full left-3 z-20 mb-2 origin-bottom-left", "overflow-hidden rounded-wx-lg shadow-lg", "[&_.epr-btn-clear-search:hover]:!bg-wx-bg-elevated-2", "[&_.epr-btn-clear-search:focus]:!bg-wx-bg-elevated-2"),
|
|
4733
4733
|
role: "dialog",
|
|
4734
4734
|
"aria-label": a("emojiPicker"),
|
|
4735
4735
|
children: /* @__PURE__ */ Z(Ot, {
|
|
@@ -4772,7 +4772,7 @@ function Ho({ kind: e, disabled: r, onSend: i, onMic: a, ariaLabels: o }) {
|
|
|
4772
4772
|
damping: 22
|
|
4773
4773
|
},
|
|
4774
4774
|
...e === "mic" ? l.parentHandlers : {},
|
|
4775
|
-
className:
|
|
4775
|
+
className: H("flex h-8 w-8 items-center justify-center rounded-full transition-colors", "bg-wx-primary text-wx-primary-fg hover:bg-wx-primary-hover", "disabled:opacity-50"),
|
|
4776
4776
|
children: /* @__PURE__ */ Q(ne, {
|
|
4777
4777
|
mode: "wait",
|
|
4778
4778
|
initial: !1,
|
|
@@ -4902,13 +4902,13 @@ function Go(e, t) {
|
|
|
4902
4902
|
//#endregion
|
|
4903
4903
|
//#region components/widget/tabs/messages-tab/message/bot-avatar.tsx
|
|
4904
4904
|
function Ko({ size: e, senderKind: t, senderName: n, senderAvatarUrl: r, aiAssistantAvatarUrl: i, organizationLogoUrl: a, organizationName: o, className: s }) {
|
|
4905
|
-
let c =
|
|
4905
|
+
let c = V("messages"), l = {
|
|
4906
4906
|
width: e,
|
|
4907
4907
|
height: e
|
|
4908
4908
|
};
|
|
4909
4909
|
if (t === "ai" || t === "bot") return i ? /* @__PURE__ */ Z("span", {
|
|
4910
4910
|
style: l,
|
|
4911
|
-
className:
|
|
4911
|
+
className: H("relative flex shrink-0 items-center justify-center overflow-hidden rounded-full bg-wx-bg-elevated shadow-sm", s),
|
|
4912
4912
|
role: "img",
|
|
4913
4913
|
"aria-label": c("aiAssistant"),
|
|
4914
4914
|
children: /* @__PURE__ */ Z("img", {
|
|
@@ -4920,12 +4920,12 @@ function Ko({ size: e, senderKind: t, senderName: n, senderAvatarUrl: r, aiAssis
|
|
|
4920
4920
|
})
|
|
4921
4921
|
}) : /* @__PURE__ */ Z("span", {
|
|
4922
4922
|
style: l,
|
|
4923
|
-
className:
|
|
4923
|
+
className: H("shrink-0", s),
|
|
4924
4924
|
"aria-hidden": "true"
|
|
4925
4925
|
});
|
|
4926
4926
|
if (r) return /* @__PURE__ */ Z("span", {
|
|
4927
4927
|
style: l,
|
|
4928
|
-
className:
|
|
4928
|
+
className: H("shrink-0 overflow-hidden rounded-full", s),
|
|
4929
4929
|
children: /* @__PURE__ */ Z("img", {
|
|
4930
4930
|
src: r,
|
|
4931
4931
|
alt: "",
|
|
@@ -4935,7 +4935,7 @@ function Ko({ size: e, senderKind: t, senderName: n, senderAvatarUrl: r, aiAssis
|
|
|
4935
4935
|
let u = n ? qo(n) : "";
|
|
4936
4936
|
if (!u && a) return /* @__PURE__ */ Z("span", {
|
|
4937
4937
|
style: l,
|
|
4938
|
-
className:
|
|
4938
|
+
className: H("shrink-0 overflow-hidden rounded-full", s),
|
|
4939
4939
|
children: /* @__PURE__ */ Z("img", {
|
|
4940
4940
|
src: a,
|
|
4941
4941
|
alt: o ?? "",
|
|
@@ -4945,7 +4945,7 @@ function Ko({ size: e, senderKind: t, senderName: n, senderAvatarUrl: r, aiAssis
|
|
|
4945
4945
|
let d = u || (o ?? "").trim().charAt(0).toUpperCase();
|
|
4946
4946
|
return /* @__PURE__ */ Z("span", {
|
|
4947
4947
|
style: l,
|
|
4948
|
-
className:
|
|
4948
|
+
className: H("flex shrink-0 items-center justify-center overflow-hidden rounded-full bg-wx-bg-elevated text-[0.7em] font-semibold text-wx-fg-muted", s),
|
|
4949
4949
|
children: d || ""
|
|
4950
4950
|
});
|
|
4951
4951
|
}
|
|
@@ -4957,7 +4957,7 @@ function qo(e) {
|
|
|
4957
4957
|
//#region components/widget/tabs/messages-tab/message/message-bubble.tsx
|
|
4958
4958
|
var Jo = At(() => import("./widget-react-BKH1V5yP2.js").then((e) => ({ default: e.AudioBubblePlayer })));
|
|
4959
4959
|
function Yo({ message: e, organizationLogoUrl: t, organizationName: r, aiAssistantAvatarUrl: i, buttonsActive: a, onButtonClick: o, onOpenLightbox: s, onInternalLink: c }) {
|
|
4960
|
-
let l =
|
|
4960
|
+
let l = V("messages"), u = e.direction === "OUTBOUND", d = e.sender.kind === "ai" || e.sender.kind === "bot" ? Yt : e.sender.name?.trim() || "", f = d ? null : e.sender.kind === "operator" ? l("operator") : null;
|
|
4961
4961
|
return /* @__PURE__ */ Q(n.div, {
|
|
4962
4962
|
layout: "position",
|
|
4963
4963
|
"data-message-id": e.id,
|
|
@@ -4974,10 +4974,10 @@ function Yo({ message: e, organizationLogoUrl: t, organizationName: r, aiAssista
|
|
|
4974
4974
|
duration: .24,
|
|
4975
4975
|
ease: "easeOut"
|
|
4976
4976
|
},
|
|
4977
|
-
className:
|
|
4977
|
+
className: H("flex flex-col gap-1.5", u ? "items-start" : "items-end"),
|
|
4978
4978
|
children: [
|
|
4979
4979
|
/* @__PURE__ */ Q("div", {
|
|
4980
|
-
className:
|
|
4980
|
+
className: H("flex max-w-[85%] items-start gap-2", u ? "flex-row" : "flex-row-reverse"),
|
|
4981
4981
|
children: [u && /* @__PURE__ */ Z(Ko, {
|
|
4982
4982
|
size: 28,
|
|
4983
4983
|
senderKind: e.sender.kind,
|
|
@@ -4990,12 +4990,12 @@ function Yo({ message: e, organizationLogoUrl: t, organizationName: r, aiAssista
|
|
|
4990
4990
|
}), (() => {
|
|
4991
4991
|
let t = e.media ?? [], n = (e) => e.mimetype.startsWith("image/") || e.mimetype.startsWith("video/") || e.mimetype === "application/pdf", r = t.filter(n), i = t.filter((e) => !n(e)), a = !!e.text, o = i.length > 0;
|
|
4992
4992
|
return /* @__PURE__ */ Q("div", {
|
|
4993
|
-
className:
|
|
4993
|
+
className: H("max-w-full overflow-hidden rounded-wx-lg", (a || o) && (u ? "bg-wx-bg-elevated text-wx-fg" : "bg-wx-primary text-wx-primary-fg")),
|
|
4994
4994
|
children: [r.length > 0 && /* @__PURE__ */ Z(Zo, {
|
|
4995
4995
|
items: r,
|
|
4996
4996
|
onOpenLightbox: s
|
|
4997
4997
|
}), (a || o) && /* @__PURE__ */ Q("div", {
|
|
4998
|
-
className:
|
|
4998
|
+
className: H("flex flex-col gap-2 px-4 py-2.5 text-sm", r.length > 0 && "pt-2"),
|
|
4999
4999
|
children: [a && /* @__PURE__ */ Z(Xo, {
|
|
5000
5000
|
text: e.text,
|
|
5001
5001
|
isOutbound: u,
|
|
@@ -5009,7 +5009,7 @@ function Yo({ message: e, organizationLogoUrl: t, organizationName: r, aiAssista
|
|
|
5009
5009
|
})()]
|
|
5010
5010
|
}),
|
|
5011
5011
|
(d || e.ageLabel) && /* @__PURE__ */ Q("p", {
|
|
5012
|
-
className:
|
|
5012
|
+
className: H("flex items-center gap-1.5 text-[11px] text-wx-fg-subtle", u ? "ml-9" : "mr-1"),
|
|
5013
5013
|
children: [
|
|
5014
5014
|
u && d && /* @__PURE__ */ Z("span", {
|
|
5015
5015
|
className: "font-medium text-wx-fg-muted",
|
|
@@ -5039,7 +5039,7 @@ function Yo({ message: e, organizationLogoUrl: t, organizationName: r, aiAssista
|
|
|
5039
5039
|
duration: .18,
|
|
5040
5040
|
ease: "easeOut"
|
|
5041
5041
|
},
|
|
5042
|
-
className:
|
|
5042
|
+
className: H("flex flex-wrap gap-1", u ? "ml-9 max-w-[85%]" : "mr-1 justify-end"),
|
|
5043
5043
|
children: e.buttons.map((e) => /* @__PURE__ */ Z(n.button, {
|
|
5044
5044
|
type: "button",
|
|
5045
5045
|
onClick: () => o?.(e),
|
|
@@ -5050,7 +5050,7 @@ function Yo({ message: e, organizationLogoUrl: t, organizationName: r, aiAssista
|
|
|
5050
5050
|
stiffness: 480,
|
|
5051
5051
|
damping: 26
|
|
5052
5052
|
},
|
|
5053
|
-
className:
|
|
5053
|
+
className: H("rounded-full bg-wx-bg-elevated px-2.5 py-1 text-xs font-medium text-wx-primary", "transition-colors hover:bg-wx-primary hover:text-wx-primary-fg"),
|
|
5054
5054
|
children: e.text
|
|
5055
5055
|
}, e.payload))
|
|
5056
5056
|
})
|
|
@@ -5070,25 +5070,25 @@ function Xo({ text: e, isOutbound: t, onInternalLink: n }) {
|
|
|
5070
5070
|
return /^\s*<[a-z][a-z0-9]*(\s|>|\/)/i.test(e) ? /* @__PURE__ */ Z("div", {
|
|
5071
5071
|
onClick: r,
|
|
5072
5072
|
dangerouslySetInnerHTML: { __html: e },
|
|
5073
|
-
className:
|
|
5073
|
+
className: H("leading-relaxed", "[&>p]:my-0 [&>p+p]:mt-2", "[&_a]:underline [&_a]:underline-offset-2 [&_a]:opacity-90 [&_a:hover]:opacity-100", "[&_strong]:font-semibold [&_em]:italic", "[&_ul]:my-1.5 [&_ul]:list-disc [&_ul]:pl-5", "[&_ol]:my-1.5 [&_ol]:list-decimal [&_ol]:pl-5", "[&_li]:my-0.5", "[&_code]:rounded-sm [&_code]:bg-black/10 [&_code]:px-1 [&_code]:py-0.5 [&_code]:text-[0.85em]", !t && "[&_code]:bg-white/15")
|
|
5074
5074
|
}) : /* @__PURE__ */ Z("p", {
|
|
5075
5075
|
className: "whitespace-pre-wrap leading-relaxed",
|
|
5076
5076
|
children: e
|
|
5077
5077
|
});
|
|
5078
5078
|
}
|
|
5079
5079
|
function Zo({ items: e, onOpenLightbox: t }) {
|
|
5080
|
-
let n =
|
|
5080
|
+
let n = V("messages");
|
|
5081
5081
|
if (e.length === 0) return null;
|
|
5082
5082
|
let r = e.length > 1;
|
|
5083
5083
|
return /* @__PURE__ */ Z("div", {
|
|
5084
|
-
className:
|
|
5084
|
+
className: H("grid w-full", r ? "max-h-[20rem] grid-cols-2 gap-0.5 auto-rows-fr" : "grid-cols-1"),
|
|
5085
5085
|
children: e.map((i, a) => {
|
|
5086
5086
|
let o = () => t?.(e, a);
|
|
5087
5087
|
return i.mimetype === "application/pdf" ? /* @__PURE__ */ Q("button", {
|
|
5088
5088
|
type: "button",
|
|
5089
5089
|
onClick: o,
|
|
5090
5090
|
"aria-label": i.alt || n("openPreview"),
|
|
5091
|
-
className:
|
|
5091
|
+
className: H("group flex w-full cursor-zoom-in items-center gap-3 px-4 py-3 text-left", "bg-wx-bg-elevated text-wx-fg transition-colors hover:bg-wx-bg-elevated-2"),
|
|
5092
5092
|
children: [/* @__PURE__ */ Z("span", {
|
|
5093
5093
|
className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-wx-sm bg-wx-bg text-[10px] font-bold tracking-wider text-wx-fg-muted shadow-sm",
|
|
5094
5094
|
children: "PDF"
|
|
@@ -5108,7 +5108,7 @@ function Zo({ items: e, onOpenLightbox: t }) {
|
|
|
5108
5108
|
src: i.url,
|
|
5109
5109
|
controls: !0,
|
|
5110
5110
|
preload: "metadata",
|
|
5111
|
-
className:
|
|
5111
|
+
className: H("block w-full", r ? "h-full object-cover" : "max-h-80")
|
|
5112
5112
|
}), r && /* @__PURE__ */ Z("button", {
|
|
5113
5113
|
type: "button",
|
|
5114
5114
|
"aria-label": i.alt || n("openPreview"),
|
|
@@ -5119,12 +5119,12 @@ function Zo({ items: e, onOpenLightbox: t }) {
|
|
|
5119
5119
|
type: "button",
|
|
5120
5120
|
onClick: o,
|
|
5121
5121
|
"aria-label": i.alt || n("openImage"),
|
|
5122
|
-
className:
|
|
5122
|
+
className: H("group relative block w-full overflow-hidden", "cursor-zoom-in"),
|
|
5123
5123
|
children: /* @__PURE__ */ Z("img", {
|
|
5124
5124
|
src: i.url,
|
|
5125
5125
|
alt: i.alt,
|
|
5126
5126
|
loading: "lazy",
|
|
5127
|
-
className:
|
|
5127
|
+
className: H("block w-full transition-transform duration-200 group-hover:scale-[1.02]", r ? "h-full object-cover" : "max-h-80 object-cover")
|
|
5128
5128
|
})
|
|
5129
5129
|
}, a);
|
|
5130
5130
|
})
|
|
@@ -5167,7 +5167,7 @@ function es(e) {
|
|
|
5167
5167
|
//#endregion
|
|
5168
5168
|
//#region components/widget/tabs/messages-tab/message/typing-bubble.tsx
|
|
5169
5169
|
function ts({ actorName: e, actorKind: t, actorAvatarUrl: r, actorPhase: i, aiAssistantAvatarUrl: a, organizationLogoUrl: o, organizationName: s }) {
|
|
5170
|
-
let c =
|
|
5170
|
+
let c = V("messages");
|
|
5171
5171
|
return /* @__PURE__ */ Q(n.div, {
|
|
5172
5172
|
layout: "position",
|
|
5173
5173
|
initial: {
|
|
@@ -5404,7 +5404,7 @@ function ms(e, t) {
|
|
|
5404
5404
|
var hs = K.forwardRef(({ className: e, type: t, ...n }, r) => /* @__PURE__ */ Z("input", {
|
|
5405
5405
|
ref: r,
|
|
5406
5406
|
type: t,
|
|
5407
|
-
className:
|
|
5407
|
+
className: H("h-11 w-full rounded-wx bg-wx-bg-elevated px-4 text-sm text-wx-fg", "placeholder:text-wx-fg-muted", "focus:outline-none focus:ring-2 focus:ring-wx-primary", "disabled:cursor-not-allowed disabled:opacity-50", e),
|
|
5408
5408
|
...n
|
|
5409
5409
|
}));
|
|
5410
5410
|
hs.displayName = "Input";
|
|
@@ -5461,7 +5461,7 @@ function Cs(e, t) {
|
|
|
5461
5461
|
//#endregion
|
|
5462
5462
|
//#region components/widget/tabs/messages-tab/prechat-form/composer-fields.tsx
|
|
5463
5463
|
function ws({ form: e, values: t, errors: n, onChange: r, disabled: i = !1 }) {
|
|
5464
|
-
let a =
|
|
5464
|
+
let a = V("prechat"), o = (e) => {
|
|
5465
5465
|
if (e.label.trim()) return e.label;
|
|
5466
5466
|
switch (e.kind) {
|
|
5467
5467
|
case "NAME": return a("labelName");
|
|
@@ -5483,7 +5483,7 @@ function ws({ form: e, values: t, errors: n, onChange: r, disabled: i = !1 }) {
|
|
|
5483
5483
|
"aria-invalid": !!s,
|
|
5484
5484
|
"aria-label": a,
|
|
5485
5485
|
placeholder: e.required ? `${a} *` : a,
|
|
5486
|
-
className:
|
|
5486
|
+
className: H("h-8 rounded-wx-md px-3 text-[13px]", s && "ring-1 ring-wx-danger placeholder:text-wx-danger/60 focus:ring-wx-danger")
|
|
5487
5487
|
}), s && /* @__PURE__ */ Z("p", {
|
|
5488
5488
|
className: "mt-0.5 px-1 text-[10px] text-wx-danger leading-none",
|
|
5489
5489
|
children: s
|
|
@@ -5499,7 +5499,7 @@ var Ts = {
|
|
|
5499
5499
|
invalidPhone: "p"
|
|
5500
5500
|
}, Es = At(() => import("./widget-react-B3JUsNG42.js").then((e) => ({ default: e.VoiceRecorderBar })));
|
|
5501
5501
|
function Ds({ isDummy: e, chatId: t, token: r, prechatForm: i, messenger: a, organizationLogoUrl: o, organizationName: s, isOpen: c = !0, onInbound: l, onOutbound: u, registerRealtimeHandler: d, unreadCount: f = 0, clearUnread: p, liveMessages: m, appendLiveMessage: h, replaceLiveMessage: g, initialVisitorMessage: _, onInitialVisitorMessageSent: v, visitorIdentity: y, visitorPrefill: b, security: x, verified: S = !1, onGoogleCredential: C, onPasskeySession: w, onInternalLink: T, getTurnstileToken: E }) {
|
|
5502
|
-
let D =
|
|
5502
|
+
let D = V("messages"), O = V("demo"), k = V("prechat"), A = Me(), j = xe() ?? "", [M, N] = X(null);
|
|
5503
5503
|
J(() => {
|
|
5504
5504
|
N(ys(j));
|
|
5505
5505
|
}, [j]);
|
|
@@ -5566,7 +5566,7 @@ function Ds({ isDummy: e, chatId: t, token: r, prechatForm: i, messenger: a, org
|
|
|
5566
5566
|
try {
|
|
5567
5567
|
e ? sessionStorage.setItem("wexio:demo-authed", "1") : sessionStorage.removeItem("wexio:demo-authed");
|
|
5568
5568
|
} catch {}
|
|
5569
|
-
}, he = x?.google?.enabled ? x.google.clientId : null, ge = !!x?.passkey?.enabled,
|
|
5569
|
+
}, he = x?.google?.enabled ? x.google.clientId : null, ge = !!x?.passkey?.enabled, _e = !!x?.requireAuth && !S && !(e && pe), ve = q(async () => {
|
|
5570
5570
|
if (!fe || !i) return !0;
|
|
5571
5571
|
let t = xs(i, ee, {
|
|
5572
5572
|
required: k("required"),
|
|
@@ -5593,39 +5593,39 @@ function Ds({ isDummy: e, chatId: t, token: r, prechatForm: i, messenger: a, org
|
|
|
5593
5593
|
ae,
|
|
5594
5594
|
k,
|
|
5595
5595
|
E
|
|
5596
|
-
]), [
|
|
5596
|
+
]), [ye, be] = X(""), [Se, Ce] = X(!1), [we, Te] = X(!1), [Ee, De] = X(!1), Oe = Y(null), ke = Y(null), Ae = Y(null);
|
|
5597
5597
|
J(() => {
|
|
5598
|
-
if (!
|
|
5598
|
+
if (!we) return;
|
|
5599
5599
|
let e = (e) => {
|
|
5600
5600
|
let t = e.target;
|
|
5601
|
-
|
|
5601
|
+
Ae.current?.contains(t) || t instanceof Element && t.closest("[data-wx-commands-panel]") || Te(!1);
|
|
5602
5602
|
};
|
|
5603
5603
|
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
5604
|
-
}, [
|
|
5605
|
-
let
|
|
5606
|
-
let t =
|
|
5604
|
+
}, [we]);
|
|
5605
|
+
let je = (e) => {
|
|
5606
|
+
let t = Oe.current;
|
|
5607
5607
|
if (!t) {
|
|
5608
|
-
|
|
5608
|
+
be((t) => t + e);
|
|
5609
5609
|
return;
|
|
5610
5610
|
}
|
|
5611
|
-
let n = t.selectionStart ??
|
|
5612
|
-
ye
|
|
5611
|
+
let n = t.selectionStart ?? ye.length, r = t.selectionEnd ?? ye.length;
|
|
5612
|
+
be(ye.slice(0, n) + e + ye.slice(r)), requestAnimationFrame(() => {
|
|
5613
5613
|
t.focus();
|
|
5614
5614
|
let r = n + e.length;
|
|
5615
5615
|
t.setSelectionRange(r, r);
|
|
5616
5616
|
});
|
|
5617
5617
|
};
|
|
5618
5618
|
J(() => {
|
|
5619
|
-
let e =
|
|
5619
|
+
let e = Oe.current;
|
|
5620
5620
|
e && (e.style.height = "auto", e.style.height = `${Math.min(e.scrollHeight, 120)}px`);
|
|
5621
|
-
}, [
|
|
5622
|
-
let [
|
|
5621
|
+
}, [ye]);
|
|
5622
|
+
let [Ne, U] = X(e ? dr(O) : []), Pe = e ? Ne : m ?? [], Fe = q((t) => {
|
|
5623
5623
|
if (e) {
|
|
5624
|
-
|
|
5624
|
+
U((e) => e.some((e) => e.id === t.id) ? e : [...e, t]);
|
|
5625
5625
|
return;
|
|
5626
5626
|
}
|
|
5627
5627
|
h?.(t);
|
|
5628
|
-
}, [e, h]), [
|
|
5628
|
+
}, [e, h]), [Ie, Le] = X(/* @__PURE__ */ new Set()), [Re, ze] = X(null), Be = Y(null);
|
|
5629
5629
|
J(() => () => {
|
|
5630
5630
|
Be.current && clearTimeout(Be.current);
|
|
5631
5631
|
}, []);
|
|
@@ -5727,12 +5727,12 @@ function Ds({ isDummy: e, chatId: t, token: r, prechatForm: i, messenger: a, org
|
|
|
5727
5727
|
}
|
|
5728
5728
|
Be.current && (clearTimeout(Be.current), Be.current = null), ze(null);
|
|
5729
5729
|
}, G = Nt(() => {
|
|
5730
|
-
if (e) return
|
|
5731
|
-
let t = ss(ot, A), n = new Set(t.map((e) => e.id)), r =
|
|
5730
|
+
if (e) return Pe;
|
|
5731
|
+
let t = ss(ot, A), n = new Set(t.map((e) => e.id)), r = Pe.filter((e) => !n.has(e.id));
|
|
5732
5732
|
return [...t, ...r];
|
|
5733
5733
|
}, [
|
|
5734
5734
|
e,
|
|
5735
|
-
|
|
5735
|
+
Pe,
|
|
5736
5736
|
ot,
|
|
5737
5737
|
A
|
|
5738
5738
|
]), Ct = Y(0);
|
|
@@ -5876,12 +5876,12 @@ function Ds({ isDummy: e, chatId: t, token: r, prechatForm: i, messenger: a, org
|
|
|
5876
5876
|
for (let e = G.length - 1; e >= 0; e--) {
|
|
5877
5877
|
let t = G[e];
|
|
5878
5878
|
if (t.direction !== "OUTBOUND") break;
|
|
5879
|
-
if (t.buttons && t.buttons.length > 0 && !
|
|
5879
|
+
if (t.buttons && t.buttons.length > 0 && !Ie.has(t.id)) return t.id;
|
|
5880
5880
|
}
|
|
5881
5881
|
return null;
|
|
5882
5882
|
})(), It = (e) => {
|
|
5883
5883
|
let t = `tmp-${Date.now()}`;
|
|
5884
|
-
|
|
5884
|
+
Fe({
|
|
5885
5885
|
id: t,
|
|
5886
5886
|
direction: "INBOUND",
|
|
5887
5887
|
text: e,
|
|
@@ -5893,7 +5893,7 @@ function Ds({ isDummy: e, chatId: t, token: r, prechatForm: i, messenger: a, org
|
|
|
5893
5893
|
deliveryStatus: "DELIVERED"
|
|
5894
5894
|
}), u?.(), setTimeout(() => {
|
|
5895
5895
|
let n = Uo(e, O);
|
|
5896
|
-
|
|
5896
|
+
Fe({
|
|
5897
5897
|
id: `tmp-fin-${Date.now()}`,
|
|
5898
5898
|
direction: "OUTBOUND",
|
|
5899
5899
|
text: n.text,
|
|
@@ -5921,7 +5921,7 @@ function Ds({ isDummy: e, chatId: t, token: r, prechatForm: i, messenger: a, org
|
|
|
5921
5921
|
return;
|
|
5922
5922
|
}
|
|
5923
5923
|
let r = `tmp-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
|
|
5924
|
-
|
|
5924
|
+
Fe({
|
|
5925
5925
|
id: r,
|
|
5926
5926
|
clientKey: r,
|
|
5927
5927
|
direction: "INBOUND",
|
|
@@ -5992,15 +5992,15 @@ function Ds({ isDummy: e, chatId: t, token: r, prechatForm: i, messenger: a, org
|
|
|
5992
5992
|
let n = Ve.find((e) => e.tempId === t);
|
|
5993
5993
|
n?.url?.startsWith("blob:") && URL.revokeObjectURL(n.url), n && !e && (n.mediaId ? Je({ variables: { mediaId: n.mediaId } }).catch(() => void 0) : Xe.current.add(t)), He((e) => e.filter((e) => e.tempId !== t));
|
|
5994
5994
|
}, Vt = async () => {
|
|
5995
|
-
We(null), await
|
|
5995
|
+
We(null), await ve() && De(!0);
|
|
5996
5996
|
}, Ht = async (t) => {
|
|
5997
|
-
if (
|
|
5997
|
+
if (De(!1), t.size > 10485760) {
|
|
5998
5998
|
We(D("fileTooLarge"));
|
|
5999
5999
|
return;
|
|
6000
6000
|
}
|
|
6001
6001
|
if (e) {
|
|
6002
6002
|
let e = ls(t.base64, t.mimetype), n = URL.createObjectURL(e), r = `tmp-voice-${Date.now()}`;
|
|
6003
|
-
|
|
6003
|
+
Fe({
|
|
6004
6004
|
id: r,
|
|
6005
6005
|
direction: "INBOUND",
|
|
6006
6006
|
text: "",
|
|
@@ -6016,7 +6016,7 @@ function Ds({ isDummy: e, chatId: t, token: r, prechatForm: i, messenger: a, org
|
|
|
6016
6016
|
}],
|
|
6017
6017
|
deliveryStatus: "DELIVERED"
|
|
6018
6018
|
}), u?.(), setTimeout(() => {
|
|
6019
|
-
|
|
6019
|
+
Fe({
|
|
6020
6020
|
id: `tmp-fin-${Date.now()}`,
|
|
6021
6021
|
direction: "OUTBOUND",
|
|
6022
6022
|
text: "Got your voice note - let me check that and circle back.",
|
|
@@ -6040,7 +6040,7 @@ function Ds({ isDummy: e, chatId: t, token: r, prechatForm: i, messenger: a, org
|
|
|
6040
6040
|
} } })).data?.uploadVisitorMedia?.mediaId;
|
|
6041
6041
|
if (!e) throw Error("empty upload response");
|
|
6042
6042
|
let n = ls(t.base64, t.mimetype), r = URL.createObjectURL(n), i = `tmp-voice-${Date.now()}`;
|
|
6043
|
-
|
|
6043
|
+
Fe({
|
|
6044
6044
|
id: i,
|
|
6045
6045
|
clientKey: i,
|
|
6046
6046
|
direction: "INBOUND",
|
|
@@ -6061,22 +6061,22 @@ function Ds({ isDummy: e, chatId: t, token: r, prechatForm: i, messenger: a, org
|
|
|
6061
6061
|
We(D("uploadFailed"));
|
|
6062
6062
|
}
|
|
6063
6063
|
}, Ut = (e) => {
|
|
6064
|
-
|
|
6064
|
+
De(!1), We(D(e === "unsupported" ? "voiceUnsupported" : e === "denied" ? "voiceDenied" : "uploadFailed"));
|
|
6065
6065
|
}, Wt = async () => {
|
|
6066
|
-
let t =
|
|
6066
|
+
let t = ye.trim(), n = Ve.map((e) => e.mediaId).filter((e) => !!e);
|
|
6067
6067
|
if (!t && n.length === 0 || vt || oe) return;
|
|
6068
6068
|
let r = Ve.filter((e) => !!e.mediaId && !!e.url).map((e) => ({
|
|
6069
6069
|
url: e.url,
|
|
6070
6070
|
mimetype: e.mimetype,
|
|
6071
6071
|
alt: e.filename
|
|
6072
6072
|
}));
|
|
6073
|
-
if (!await
|
|
6073
|
+
if (!await ve()) return;
|
|
6074
6074
|
if (e) {
|
|
6075
|
-
|
|
6075
|
+
be(""), He([]), It(t || "[file]");
|
|
6076
6076
|
return;
|
|
6077
6077
|
}
|
|
6078
6078
|
let i = `tmp-${Date.now()}`;
|
|
6079
|
-
|
|
6079
|
+
Fe({
|
|
6080
6080
|
id: i,
|
|
6081
6081
|
clientKey: i,
|
|
6082
6082
|
direction: "INBOUND",
|
|
@@ -6088,7 +6088,7 @@ function Ds({ isDummy: e, chatId: t, token: r, prechatForm: i, messenger: a, org
|
|
|
6088
6088
|
},
|
|
6089
6089
|
...r.length > 0 ? { media: r } : {},
|
|
6090
6090
|
deliveryStatus: "SENT"
|
|
6091
|
-
}),
|
|
6091
|
+
}), be(""), He([]);
|
|
6092
6092
|
try {
|
|
6093
6093
|
let e = await _t({ variables: { input: {
|
|
6094
6094
|
...t ? { text: t } : {},
|
|
@@ -6110,13 +6110,13 @@ function Ds({ isDummy: e, chatId: t, token: r, prechatForm: i, messenger: a, org
|
|
|
6110
6110
|
});
|
|
6111
6111
|
} catch {}
|
|
6112
6112
|
}, Gt = async (t) => {
|
|
6113
|
-
if (
|
|
6113
|
+
if (Te(!1), !await ve()) return;
|
|
6114
6114
|
if (e) {
|
|
6115
6115
|
It(t);
|
|
6116
6116
|
return;
|
|
6117
6117
|
}
|
|
6118
6118
|
let n = `tmp-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
|
|
6119
|
-
|
|
6119
|
+
Fe({
|
|
6120
6120
|
id: n,
|
|
6121
6121
|
clientKey: n,
|
|
6122
6122
|
direction: "INBOUND",
|
|
@@ -6142,7 +6142,7 @@ function Ds({ isDummy: e, chatId: t, token: r, prechatForm: i, messenger: a, org
|
|
|
6142
6142
|
deliveryStatus: "DELIVERED"
|
|
6143
6143
|
});
|
|
6144
6144
|
} catch {}
|
|
6145
|
-
}, Kt =
|
|
6145
|
+
}, Kt = ye.trim() || Ve.length > 0 ? "send" : "mic", qt = Ve.some((e) => e.mediaId === null), Jt = e ? lr(O) : a?.messages ?? [], Xt = Jt.filter((e) => e.kind === "SYSTEM"), Zt = Jt.filter((e) => e.kind === "HINT"), Qt = e || _e || !st && !ut;
|
|
6146
6146
|
a?.showRelatedNews, a?.showRelatedHelpArticles, a?.showReactionCounts;
|
|
6147
6147
|
let $t = Nt(() => ms(G, {
|
|
6148
6148
|
locale: A,
|
|
@@ -6178,20 +6178,20 @@ function Ds({ isDummy: e, chatId: t, token: r, prechatForm: i, messenger: a, org
|
|
|
6178
6178
|
text: e.text
|
|
6179
6179
|
}, `${e.kind}:${e.text}`))
|
|
6180
6180
|
}),
|
|
6181
|
-
!
|
|
6181
|
+
!_e && /* @__PURE__ */ Q(Pt, { children: [st && G.length === 0 && /* @__PURE__ */ Q("div", {
|
|
6182
6182
|
className: "flex flex-col gap-3",
|
|
6183
6183
|
children: [
|
|
6184
6184
|
/* @__PURE__ */ Q("div", {
|
|
6185
6185
|
className: "flex items-start gap-2",
|
|
6186
|
-
children: [/* @__PURE__ */ Z(
|
|
6186
|
+
children: [/* @__PURE__ */ Z(W, { className: "h-7 w-7 shrink-0 rounded-full" }), /* @__PURE__ */ Z(W, { className: "h-10 w-3/4 rounded-wx-lg" })]
|
|
6187
6187
|
}),
|
|
6188
6188
|
/* @__PURE__ */ Z("div", {
|
|
6189
6189
|
className: "flex flex-row-reverse items-start",
|
|
6190
|
-
children: /* @__PURE__ */ Z(
|
|
6190
|
+
children: /* @__PURE__ */ Z(W, { className: "h-8 w-2/3 rounded-wx-lg" })
|
|
6191
6191
|
}),
|
|
6192
6192
|
/* @__PURE__ */ Q("div", {
|
|
6193
6193
|
className: "flex items-start gap-2",
|
|
6194
|
-
children: [/* @__PURE__ */ Z(
|
|
6194
|
+
children: [/* @__PURE__ */ Z(W, { className: "h-7 w-7 shrink-0 rounded-full" }), /* @__PURE__ */ Z(W, { className: "h-12 w-4/5 rounded-wx-lg" })]
|
|
6195
6195
|
})
|
|
6196
6196
|
]
|
|
6197
6197
|
}), /* @__PURE__ */ Z(ne, {
|
|
@@ -6218,7 +6218,7 @@ function Ds({ isDummy: e, chatId: t, token: r, prechatForm: i, messenger: a, org
|
|
|
6218
6218
|
}, e.key);
|
|
6219
6219
|
})
|
|
6220
6220
|
})] }),
|
|
6221
|
-
!
|
|
6221
|
+
!_e && Re && /* @__PURE__ */ Z(ts, {
|
|
6222
6222
|
actorName: Re.name,
|
|
6223
6223
|
actorKind: Re.kind,
|
|
6224
6224
|
actorAvatarUrl: Re.avatar,
|
|
@@ -6234,10 +6234,10 @@ function Ds({ isDummy: e, chatId: t, token: r, prechatForm: i, messenger: a, org
|
|
|
6234
6234
|
className: "relative bg-wx-bg px-3 pt-2 pb-3",
|
|
6235
6235
|
children: [
|
|
6236
6236
|
/* @__PURE__ */ Z(Vo, {
|
|
6237
|
-
open:
|
|
6238
|
-
onClose: () =>
|
|
6239
|
-
onSelect:
|
|
6240
|
-
anchorRef:
|
|
6237
|
+
open: Se,
|
|
6238
|
+
onClose: () => Ce(!1),
|
|
6239
|
+
onSelect: je,
|
|
6240
|
+
anchorRef: ke
|
|
6241
6241
|
}),
|
|
6242
6242
|
Ue && /* @__PURE__ */ Z("p", {
|
|
6243
6243
|
className: "mb-2 text-xs text-wx-danger",
|
|
@@ -6246,7 +6246,7 @@ function Ds({ isDummy: e, chatId: t, token: r, prechatForm: i, messenger: a, org
|
|
|
6246
6246
|
/* @__PURE__ */ Z(ne, {
|
|
6247
6247
|
mode: "wait",
|
|
6248
6248
|
initial: !1,
|
|
6249
|
-
children:
|
|
6249
|
+
children: _e ? /* @__PURE__ */ Q(n.div, {
|
|
6250
6250
|
initial: {
|
|
6251
6251
|
opacity: 0,
|
|
6252
6252
|
y: 6
|
|
@@ -6295,11 +6295,11 @@ function Ds({ isDummy: e, chatId: t, token: r, prechatForm: i, messenger: a, org
|
|
|
6295
6295
|
})
|
|
6296
6296
|
] })
|
|
6297
6297
|
})]
|
|
6298
|
-
}, "auth-gate") :
|
|
6298
|
+
}, "auth-gate") : Ee ? /* @__PURE__ */ Z(Ot, {
|
|
6299
6299
|
fallback: /* @__PURE__ */ Z("div", { className: "h-13 w-full animate-pulse rounded-wx-lg bg-wx-bg-elevated" }),
|
|
6300
6300
|
children: /* @__PURE__ */ Z(Es, {
|
|
6301
6301
|
onComplete: Ht,
|
|
6302
|
-
onCancel: () =>
|
|
6302
|
+
onCancel: () => De(!1),
|
|
6303
6303
|
onError: Ut
|
|
6304
6304
|
})
|
|
6305
6305
|
}, "recorder") : /* @__PURE__ */ Q(n.div, {
|
|
@@ -6316,7 +6316,7 @@ function Ds({ isDummy: e, chatId: t, token: r, prechatForm: i, messenger: a, org
|
|
|
6316
6316
|
y: -6
|
|
6317
6317
|
},
|
|
6318
6318
|
transition: { duration: .18 },
|
|
6319
|
-
className:
|
|
6319
|
+
className: H("flex flex-col rounded-wx-lg border border-wx-border bg-wx-bg", "focus-within:border-wx-primary focus-within:ring-2 focus-within:ring-wx-primary/20", "transition-colors"),
|
|
6320
6320
|
children: [
|
|
6321
6321
|
Ve.length > 0 && /* @__PURE__ */ Z("div", {
|
|
6322
6322
|
className: "px-3 pt-3 pb-1",
|
|
@@ -6337,11 +6337,11 @@ function Ds({ isDummy: e, chatId: t, token: r, prechatForm: i, messenger: a, org
|
|
|
6337
6337
|
children: I
|
|
6338
6338
|
})] }),
|
|
6339
6339
|
/* @__PURE__ */ Z("textarea", {
|
|
6340
|
-
ref:
|
|
6340
|
+
ref: Oe,
|
|
6341
6341
|
name: "wexio-message",
|
|
6342
|
-
value:
|
|
6342
|
+
value: ye,
|
|
6343
6343
|
onChange: (e) => {
|
|
6344
|
-
|
|
6344
|
+
be(e.target.value), xt();
|
|
6345
6345
|
},
|
|
6346
6346
|
onKeyDown: (e) => {
|
|
6347
6347
|
e.key === "Enter" && !e.shiftKey && (e.preventDefault(), Wt());
|
|
@@ -6358,7 +6358,7 @@ function Ds({ isDummy: e, chatId: t, token: r, prechatForm: i, messenger: a, org
|
|
|
6358
6358
|
"data-1p-ignore": "true",
|
|
6359
6359
|
"data-lpignore": "true",
|
|
6360
6360
|
"data-form-type": "other",
|
|
6361
|
-
className:
|
|
6361
|
+
className: H("w-full resize-none rounded-wx-lg bg-transparent px-4 pt-2.5 pb-1 text-sm text-wx-fg", "placeholder:text-wx-fg-muted", "focus:outline-none")
|
|
6362
6362
|
}),
|
|
6363
6363
|
/* @__PURE__ */ Q("div", {
|
|
6364
6364
|
className: "flex items-center justify-between px-1.5 pt-0.5 pb-1.5",
|
|
@@ -6390,11 +6390,11 @@ function Ds({ isDummy: e, chatId: t, token: r, prechatForm: i, messenger: a, org
|
|
|
6390
6390
|
children: /* @__PURE__ */ Z(Ur, { size: 14 })
|
|
6391
6391
|
}),
|
|
6392
6392
|
/* @__PURE__ */ Z(n.button, {
|
|
6393
|
-
ref:
|
|
6393
|
+
ref: ke,
|
|
6394
6394
|
type: "button",
|
|
6395
6395
|
"aria-label": D("emoji"),
|
|
6396
|
-
"aria-expanded":
|
|
6397
|
-
onClick: () =>
|
|
6396
|
+
"aria-expanded": Se,
|
|
6397
|
+
onClick: () => Ce((e) => !e),
|
|
6398
6398
|
whileHover: { scale: 1.12 },
|
|
6399
6399
|
whileTap: { scale: .9 },
|
|
6400
6400
|
transition: {
|
|
@@ -6402,17 +6402,17 @@ function Ds({ isDummy: e, chatId: t, token: r, prechatForm: i, messenger: a, org
|
|
|
6402
6402
|
stiffness: 400,
|
|
6403
6403
|
damping: 20
|
|
6404
6404
|
},
|
|
6405
|
-
className:
|
|
6405
|
+
className: H("flex h-7 w-7 items-center justify-center rounded-full transition-colors", Se ? "bg-wx-bg-elevated text-wx-fg" : "text-wx-fg-muted hover:bg-wx-bg-elevated hover:text-wx-fg"),
|
|
6406
6406
|
children: /* @__PURE__ */ Z(Yr, { size: 14 })
|
|
6407
6407
|
}),
|
|
6408
6408
|
(a?.commands?.length ?? 0) > 0 && /* @__PURE__ */ Q("div", {
|
|
6409
6409
|
className: "relative",
|
|
6410
6410
|
children: [/* @__PURE__ */ Z(n.button, {
|
|
6411
|
-
ref:
|
|
6411
|
+
ref: Ae,
|
|
6412
6412
|
type: "button",
|
|
6413
6413
|
"aria-label": D("commands"),
|
|
6414
|
-
"aria-expanded":
|
|
6415
|
-
onClick: () =>
|
|
6414
|
+
"aria-expanded": we,
|
|
6415
|
+
onClick: () => Te((e) => !e),
|
|
6416
6416
|
whileHover: { scale: 1.12 },
|
|
6417
6417
|
whileTap: { scale: .9 },
|
|
6418
6418
|
transition: {
|
|
@@ -6420,9 +6420,9 @@ function Ds({ isDummy: e, chatId: t, token: r, prechatForm: i, messenger: a, org
|
|
|
6420
6420
|
stiffness: 400,
|
|
6421
6421
|
damping: 20
|
|
6422
6422
|
},
|
|
6423
|
-
className:
|
|
6423
|
+
className: H("flex h-7 w-7 items-center justify-center rounded-full transition-colors", we ? "bg-wx-bg-elevated text-wx-fg" : "text-wx-fg-muted hover:bg-wx-bg-elevated hover:text-wx-fg"),
|
|
6424
6424
|
children: /* @__PURE__ */ Z(kr, { size: 14 })
|
|
6425
|
-
}), /* @__PURE__ */ Z(ne, { children:
|
|
6425
|
+
}), /* @__PURE__ */ Z(ne, { children: we && /* @__PURE__ */ Z(n.div, {
|
|
6426
6426
|
"data-wx-commands-panel": !0,
|
|
6427
6427
|
initial: {
|
|
6428
6428
|
opacity: 0,
|
|
@@ -6502,7 +6502,7 @@ function Os({ field: e, value: t, uploading: n, onPick: r, onClear: i, displayNa
|
|
|
6502
6502
|
height: 88,
|
|
6503
6503
|
width: 88
|
|
6504
6504
|
},
|
|
6505
|
-
className:
|
|
6505
|
+
className: H("relative flex items-center justify-center overflow-hidden rounded-full", "bg-gradient-to-br from-wx-bg-elevated to-wx-bg-elevated-2 text-2xl font-semibold text-wx-fg-muted", "ring-1 ring-inset ring-wx-border", !d && !n && "cursor-pointer transition-transform duration-200 hover:scale-[1.04]", d && "cursor-not-allowed"),
|
|
6506
6506
|
children: [t && !c ? /* @__PURE__ */ Z("img", {
|
|
6507
6507
|
src: t,
|
|
6508
6508
|
alt: "",
|
|
@@ -6578,10 +6578,10 @@ function ks({ checked: e, onChange: t, disabled: n }) {
|
|
|
6578
6578
|
"aria-checked": e,
|
|
6579
6579
|
disabled: n,
|
|
6580
6580
|
onClick: () => t(!e),
|
|
6581
|
-
className:
|
|
6581
|
+
className: H("relative h-6 w-10 shrink-0 rounded-full transition-colors", e ? "bg-wx-primary" : "bg-wx-bg-elevated-2", n && "cursor-not-allowed opacity-60"),
|
|
6582
6582
|
children: /* @__PURE__ */ Z("span", {
|
|
6583
6583
|
"aria-hidden": "true",
|
|
6584
|
-
className:
|
|
6584
|
+
className: H("absolute top-0.5 left-0.5 h-5 w-5 rounded-full bg-white shadow transition-transform", e && "translate-x-4")
|
|
6585
6585
|
})
|
|
6586
6586
|
});
|
|
6587
6587
|
}
|
|
@@ -6666,7 +6666,7 @@ function Ls(e) {
|
|
|
6666
6666
|
}
|
|
6667
6667
|
//#endregion
|
|
6668
6668
|
//#region components/widget/tabs/profile-tab/input-class.ts
|
|
6669
|
-
var Rs =
|
|
6669
|
+
var Rs = H("w-full rounded-wx-sm border border-wx-border bg-wx-bg px-3 py-2 text-sm text-wx-fg", "focus:border-wx-primary focus:outline-none focus:ring-2 focus:ring-wx-primary/20", "read-only:cursor-not-allowed read-only:bg-wx-bg-elevated/60 read-only:text-wx-fg-muted", "disabled:cursor-not-allowed disabled:bg-wx-bg-elevated/60 disabled:text-wx-fg-muted");
|
|
6670
6670
|
//#endregion
|
|
6671
6671
|
//#region components/widget/tabs/profile-tab/field-controls/date-control.tsx
|
|
6672
6672
|
function zs({ id: e, value: t, disabled: n, onChange: r }) {
|
|
@@ -9709,7 +9709,7 @@ function hm({ modal: e = !1, ...t }) {
|
|
|
9709
9709
|
}
|
|
9710
9710
|
var gm = sm, _m = K.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__ */ Q(om, {
|
|
9711
9711
|
ref: r,
|
|
9712
|
-
className:
|
|
9712
|
+
className: H("flex h-9 w-full items-center justify-between gap-2 rounded-wx-sm border border-wx-border bg-wx-bg px-3 py-2 text-sm text-wx-fg", "placeholder:text-wx-fg-subtle", "focus:border-wx-primary focus:outline-none focus:ring-2 focus:ring-wx-primary/20", "disabled:cursor-not-allowed disabled:bg-wx-bg-elevated/60 disabled:text-wx-fg-muted", "[&>span]:line-clamp-1", e),
|
|
9713
9713
|
...n,
|
|
9714
9714
|
children: [t, /* @__PURE__ */ Z(cm, {
|
|
9715
9715
|
asChild: !0,
|
|
@@ -9726,10 +9726,10 @@ var vm = K.forwardRef(({ className: e, children: t, position: n = "popper", ...r
|
|
|
9726
9726
|
children: /* @__PURE__ */ Z(um, {
|
|
9727
9727
|
ref: i,
|
|
9728
9728
|
position: n,
|
|
9729
|
-
className:
|
|
9729
|
+
className: H("relative z-2147483602 max-h-72 min-w-32 overflow-hidden rounded-wx-sm border border-wx-border bg-wx-bg text-wx-fg shadow-lg", "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", n === "popper" && "data-[side=bottom]:translate-y-1 data-[side=top]:-translate-y-1", e),
|
|
9730
9730
|
...r,
|
|
9731
9731
|
children: /* @__PURE__ */ Z(dm, {
|
|
9732
|
-
className:
|
|
9732
|
+
className: H("p-1", n === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),
|
|
9733
9733
|
children: t
|
|
9734
9734
|
})
|
|
9735
9735
|
})
|
|
@@ -9737,7 +9737,7 @@ var vm = K.forwardRef(({ className: e, children: t, position: n = "popper", ...r
|
|
|
9737
9737
|
vm.displayName = um.displayName;
|
|
9738
9738
|
var ym = K.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__ */ Q(fm, {
|
|
9739
9739
|
ref: r,
|
|
9740
|
-
className:
|
|
9740
|
+
className: H("relative flex w-full cursor-pointer select-none items-center rounded-sm py-1.5 pr-2 pl-7 text-sm outline-none", "focus:bg-wx-bg-elevated focus:text-wx-fg", "data-[disabled]:pointer-events-none data-[disabled]:opacity-50", "data-[state=checked]:font-medium", e),
|
|
9741
9741
|
...n,
|
|
9742
9742
|
children: [/* @__PURE__ */ Z("span", {
|
|
9743
9743
|
className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center",
|
|
@@ -10032,7 +10032,7 @@ function Pm({ profile: e, locale: t, themeMode: n, prefSaving: r, applyPref: i,
|
|
|
10032
10032
|
title: o(a),
|
|
10033
10033
|
disabled: r === "themeMode",
|
|
10034
10034
|
onClick: () => i("themeMode", t),
|
|
10035
|
-
className:
|
|
10035
|
+
className: H("flex h-7 w-9 items-center justify-center rounded-full transition-all", s ? "bg-wx-bg text-wx-fg shadow-[0_1px_3px_rgba(0,0,0,0.08)]" : "text-wx-fg-muted hover:text-wx-fg", "disabled:cursor-not-allowed disabled:opacity-50"),
|
|
10036
10036
|
children: /* @__PURE__ */ Z(n, {
|
|
10037
10037
|
size: 13,
|
|
10038
10038
|
"aria-hidden": "true"
|
|
@@ -19367,9 +19367,9 @@ function dv(e, t) {
|
|
|
19367
19367
|
//#endregion
|
|
19368
19368
|
//#region components/widget/tabs/profile-tab/index.tsx
|
|
19369
19369
|
function fv({ isDummy: e }) {
|
|
19370
|
-
let t =
|
|
19371
|
-
|
|
19372
|
-
let n =
|
|
19370
|
+
let t = V("profile");
|
|
19371
|
+
V("tabs");
|
|
19372
|
+
let n = Me(), { config: r } = C(), { data: i, loading: a, error: o, refetch: s } = wn({ skip: e }), c = Nt(() => e ? pv(n) : null, [e, n]) ?? i?.visitorProfile, [l, { loading: u }] = En(), [d, { loading: f }] = dn(), { apply: p, saving: m } = Rm(c, t), [h, g] = X({}), [_, v] = X(!1), [y, b] = X(!1), [x, S] = X(null), [w, T] = X({});
|
|
19373
19373
|
J(() => {
|
|
19374
19374
|
c && (_ || g(js(c)));
|
|
19375
19375
|
}, [c, _]);
|
|
@@ -19481,11 +19481,11 @@ function fv({ isDummy: e }) {
|
|
|
19481
19481
|
children: [
|
|
19482
19482
|
/* @__PURE__ */ Q("div", {
|
|
19483
19483
|
className: "mx-auto flex flex-col items-center gap-3",
|
|
19484
|
-
children: [/* @__PURE__ */ Z(
|
|
19484
|
+
children: [/* @__PURE__ */ Z(W, { className: "h-24 w-24 rounded-full" }), /* @__PURE__ */ Z(W, { className: "h-4 w-32 rounded" })]
|
|
19485
19485
|
}),
|
|
19486
|
-
/* @__PURE__ */ Z(
|
|
19487
|
-
/* @__PURE__ */ Z(
|
|
19488
|
-
/* @__PURE__ */ Z(
|
|
19486
|
+
/* @__PURE__ */ Z(W, { className: "h-9 w-full rounded-wx-sm" }),
|
|
19487
|
+
/* @__PURE__ */ Z(W, { className: "h-9 w-full rounded-wx-sm" }),
|
|
19488
|
+
/* @__PURE__ */ Z(W, { className: "h-9 w-full rounded-wx-sm" }),
|
|
19489
19489
|
/* @__PURE__ */ Z("span", {
|
|
19490
19490
|
className: "sr-only",
|
|
19491
19491
|
children: t("loading")
|
|
@@ -19585,7 +19585,7 @@ function fv({ isDummy: e }) {
|
|
|
19585
19585
|
type: "submit",
|
|
19586
19586
|
form: "wx-profile-form",
|
|
19587
19587
|
disabled: u,
|
|
19588
|
-
className:
|
|
19588
|
+
className: H("flex flex-1 items-center justify-center gap-1.5 rounded-full bg-wx-primary px-4 py-2 text-sm font-semibold text-wx-primary-fg", "hover:bg-wx-primary-hover disabled:cursor-not-allowed disabled:opacity-60"),
|
|
19589
19589
|
children: [u && /* @__PURE__ */ Z(Ge, {
|
|
19590
19590
|
size: 14,
|
|
19591
19591
|
className: "animate-spin",
|
|
@@ -19595,7 +19595,7 @@ function fv({ isDummy: e }) {
|
|
|
19595
19595
|
type: "button",
|
|
19596
19596
|
onClick: A,
|
|
19597
19597
|
disabled: u,
|
|
19598
|
-
className:
|
|
19598
|
+
className: H("rounded-full bg-wx-bg-elevated px-4 py-2 text-sm font-medium text-wx-fg", "hover:bg-wx-bg-elevated-2 disabled:cursor-not-allowed disabled:opacity-60"),
|
|
19599
19599
|
children: t("cancel")
|
|
19600
19600
|
})]
|
|
19601
19601
|
})]
|
|
@@ -19648,7 +19648,7 @@ function pv(e) {
|
|
|
19648
19648
|
//#endregion
|
|
19649
19649
|
//#region components/widget/widget-launcher.tsx
|
|
19650
19650
|
function mv({ isOpen: e, onToggle: t, unreadCount: i = 0, position: o = "right", embedded: s = !1, loading: c = !1 }) {
|
|
19651
|
-
let l =
|
|
19651
|
+
let l = V("launcher"), u = Je(), d = Je(), f = e ? d.parentHandlers : u.parentHandlers, p = !e && i > 0;
|
|
19652
19652
|
return /* @__PURE__ */ Q(n.button, {
|
|
19653
19653
|
type: "button",
|
|
19654
19654
|
onClick: c ? void 0 : t,
|
|
@@ -19665,7 +19665,7 @@ function mv({ isOpen: e, onToggle: t, unreadCount: i = 0, position: o = "right",
|
|
|
19665
19665
|
onHoverStart: f.onMouseEnter,
|
|
19666
19666
|
onHoverEnd: f.onMouseLeave,
|
|
19667
19667
|
...f,
|
|
19668
|
-
className:
|
|
19668
|
+
className: H(s ? "absolute" : "fixed", "bottom-4 z-2147483600", o === "left" ? "left-4" : "right-4", "flex h-14 w-14 items-center justify-center rounded-full", "bg-wx-launcher-bg text-wx-launcher-fg", "shadow-[0_8px_24px_rgba(0,0,0,0.18)]", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-wx-launcher-bg focus-visible:ring-offset-2 focus-visible:ring-offset-white"),
|
|
19669
19669
|
children: [/* @__PURE__ */ Z(oi, {
|
|
19670
19670
|
count: p ? i : 0,
|
|
19671
19671
|
size: "md",
|
|
@@ -19687,7 +19687,7 @@ function mv({ isOpen: e, onToggle: t, unreadCount: i = 0, position: o = "right",
|
|
|
19687
19687
|
scale: .7
|
|
19688
19688
|
},
|
|
19689
19689
|
transition: { duration: .18 },
|
|
19690
|
-
className:
|
|
19690
|
+
className: H("h-6 w-6 animate-spin rounded-full border-2", "border-wx-launcher-fg/30 border-t-wx-launcher-fg", "dark:border-wx-bg/30 dark:border-t-wx-bg"),
|
|
19691
19691
|
"aria-hidden": "true"
|
|
19692
19692
|
}, "spinner") : e ? /* @__PURE__ */ Z(n.span, {
|
|
19693
19693
|
initial: {
|
|
@@ -19739,7 +19739,7 @@ function mv({ isOpen: e, onToggle: t, unreadCount: i = 0, position: o = "right",
|
|
|
19739
19739
|
//#endregion
|
|
19740
19740
|
//#region components/widget/widget-shell/auth-error-overlay.tsx
|
|
19741
19741
|
function hv({ open: e, errorCode: t, onRetry: r, onDismiss: i, position: a = "right", embedded: o = !1 }) {
|
|
19742
|
-
let s =
|
|
19742
|
+
let s = V("authError"), c = a === "left", l = t?.startsWith("turnstile_failed:") ?? !1, u = s(l ? "turnstileTitle" : "genericTitle"), d = s(l ? "turnstileBody" : "genericBody");
|
|
19743
19743
|
return /* @__PURE__ */ Z(ne, { children: e && /* @__PURE__ */ Z(n.div, {
|
|
19744
19744
|
initial: {
|
|
19745
19745
|
opacity: 0,
|
|
@@ -19761,24 +19761,24 @@ function hv({ open: e, errorCode: t, onRetry: r, onDismiss: i, position: a = "ri
|
|
|
19761
19761
|
stiffness: 440,
|
|
19762
19762
|
damping: 20
|
|
19763
19763
|
},
|
|
19764
|
-
className:
|
|
19764
|
+
className: H("bottom-24 z-2147483599 w-[300px]", o ? "absolute" : "fixed", c ? "left-4" : "right-4"),
|
|
19765
19765
|
role: "alert",
|
|
19766
19766
|
"aria-live": "polite",
|
|
19767
19767
|
"aria-label": u,
|
|
19768
19768
|
children: /* @__PURE__ */ Q("div", {
|
|
19769
|
-
className:
|
|
19769
|
+
className: H("relative rounded-wx-lg border border-wx-border bg-wx-bg", "p-4 pr-9 text-wx-fg", "shadow-[0_16px_40px_rgba(0,0,0,0.16)]"),
|
|
19770
19770
|
children: [
|
|
19771
19771
|
/* @__PURE__ */ Z("button", {
|
|
19772
19772
|
type: "button",
|
|
19773
19773
|
onClick: i,
|
|
19774
19774
|
"aria-label": s("dismiss"),
|
|
19775
|
-
className:
|
|
19775
|
+
className: H("absolute top-2 right-2 flex h-6 w-6 items-center justify-center rounded-full", "text-wx-fg-muted transition-colors hover:bg-wx-bg-elevated hover:text-wx-fg"),
|
|
19776
19776
|
children: /* @__PURE__ */ Z(fe, { size: 12 })
|
|
19777
19777
|
}),
|
|
19778
19778
|
/* @__PURE__ */ Q("div", {
|
|
19779
19779
|
className: "flex items-start gap-3",
|
|
19780
19780
|
children: [/* @__PURE__ */ Z("div", {
|
|
19781
|
-
className:
|
|
19781
|
+
className: H("flex h-8 w-8 shrink-0 items-center justify-center rounded-full", "bg-wx-danger/10 text-wx-danger"),
|
|
19782
19782
|
children: Z(l ? qr : Gr, {
|
|
19783
19783
|
size: 16,
|
|
19784
19784
|
"aria-hidden": "true"
|
|
@@ -19799,7 +19799,7 @@ function hv({ open: e, errorCode: t, onRetry: r, onDismiss: i, position: a = "ri
|
|
|
19799
19799
|
children: /* @__PURE__ */ Q("button", {
|
|
19800
19800
|
type: "button",
|
|
19801
19801
|
onClick: r,
|
|
19802
|
-
className:
|
|
19802
|
+
className: H("inline-flex items-center gap-1.5 rounded-full px-3 py-1.5 text-xs font-medium", "bg-wx-primary text-wx-primary-fg transition-colors", "hover:bg-wx-primary-hover", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-wx-primary focus-visible:ring-offset-2 focus-visible:ring-offset-wx-bg"),
|
|
19803
19803
|
children: [/* @__PURE__ */ Z(Gr, {
|
|
19804
19804
|
size: 12,
|
|
19805
19805
|
"aria-hidden": "true"
|
|
@@ -19884,7 +19884,7 @@ function Av() {
|
|
|
19884
19884
|
return /* @__PURE__ */ Z(gi, { children: /* @__PURE__ */ Z(jv, {}) });
|
|
19885
19885
|
}
|
|
19886
19886
|
function jv() {
|
|
19887
|
-
let e =
|
|
19887
|
+
let e = V("header"), t = Me(), r = p(), { mode: i, config: a, isDummy: o, isLoading: s, error: c } = C(), l = a.theme?.launcherPosition === "LEFT_BOTTOM", u = r.embedded ?? !1, { muted: d, toggleMuted: f, playInbound: m, playOutbound: h } = An(a.sounds), { identity: g, prefill: _ } = Xn(r), [v, y] = X(null), [x, S] = X(0);
|
|
19888
19888
|
J(() => {
|
|
19889
19889
|
if (typeof window > "u") return;
|
|
19890
19890
|
let e = (e) => {
|
|
@@ -19971,32 +19971,32 @@ function jv() {
|
|
|
19971
19971
|
i,
|
|
19972
19972
|
r
|
|
19973
19973
|
]);
|
|
19974
|
-
let
|
|
19974
|
+
let _e = fr({
|
|
19975
19975
|
chatId: M.chatId,
|
|
19976
19976
|
isDummy: o
|
|
19977
|
-
}),
|
|
19977
|
+
}), ve = T(), ye = Y(null), [be, xe] = X([]), [Se, Ce] = X(null);
|
|
19978
19978
|
J(() => {
|
|
19979
|
-
|
|
19979
|
+
xe([]);
|
|
19980
19980
|
}, [M.chatId]), J(() => {
|
|
19981
|
-
a.features.profile && (!M.peopleId || !M.token ||
|
|
19981
|
+
a.features.profile && (!M.peopleId || !M.token || ve.refetchQueries({ include: [Cn] }));
|
|
19982
19982
|
}, [M.peopleId]);
|
|
19983
|
-
let
|
|
19984
|
-
|
|
19985
|
-
}, []),
|
|
19986
|
-
|
|
19983
|
+
let we = q((e) => {
|
|
19984
|
+
xe((t) => t.some((t) => t.id === e.id) ? t : [...t, e]);
|
|
19985
|
+
}, []), Te = q((e, t) => {
|
|
19986
|
+
xe((n) => n.map((n) => n.id === e ? {
|
|
19987
19987
|
...t,
|
|
19988
19988
|
clientKey: t.clientKey ?? n.clientKey ?? e
|
|
19989
19989
|
} : n));
|
|
19990
|
-
}, []),
|
|
19991
|
-
|
|
19990
|
+
}, []), Ee = Y((e) => (ye.current = e, () => {
|
|
19991
|
+
ye.current === e && (ye.current = null);
|
|
19992
19992
|
})).current;
|
|
19993
19993
|
cr({
|
|
19994
19994
|
chatId: M.chatId,
|
|
19995
19995
|
token: M.token,
|
|
19996
19996
|
enabled: !o && i === "production",
|
|
19997
19997
|
onMessage: (e) => {
|
|
19998
|
-
if (
|
|
19999
|
-
|
|
19998
|
+
if (ye.current?.(e), e.kind === "read-receipt") {
|
|
19999
|
+
_e.noteRead(e.readReceipt?.messageIds ?? []);
|
|
20000
20000
|
return;
|
|
20001
20001
|
}
|
|
20002
20002
|
if (e.kind === "typing") return;
|
|
@@ -20016,7 +20016,7 @@ function jv() {
|
|
|
20016
20016
|
return "";
|
|
20017
20017
|
}
|
|
20018
20018
|
})(), s = e.media, c = cs(s), l = s && typeof s == "object" && !Array.isArray(s) ? s.caption : void 0;
|
|
20019
|
-
|
|
20019
|
+
we({
|
|
20020
20020
|
id: e.externalMessageId,
|
|
20021
20021
|
direction: "OUTBOUND",
|
|
20022
20022
|
text: e.text || (typeof l == "string" ? l : ""),
|
|
@@ -20029,7 +20029,7 @@ function jv() {
|
|
|
20029
20029
|
...c.length > 0 ? { media: c } : {},
|
|
20030
20030
|
...r ? { buttons: r } : {},
|
|
20031
20031
|
deliveryStatus: "DELIVERED"
|
|
20032
|
-
}),
|
|
20032
|
+
}), _e.noteInbound(e);
|
|
20033
20033
|
let u = typeof document < "u" && !document.hidden, d = de && u && L.kind === "messages", f = se.desktopNotifications, p = typeof Notification < "u" ? Notification.permission : "(unsupported)", h = p === "granted", g = f && h && !d;
|
|
20034
20034
|
if (console.log("[wexio] inbound:", {
|
|
20035
20035
|
id: e.externalMessageId,
|
|
@@ -20058,7 +20058,7 @@ function jv() {
|
|
|
20058
20058
|
console.warn("[wexio] desktop notification failed:", e);
|
|
20059
20059
|
}
|
|
20060
20060
|
else f && !h && console.warn("[wexio] desktop notifications enabled but browser permission is not granted; current value:", p);
|
|
20061
|
-
M.chatId &&
|
|
20061
|
+
M.chatId && ve.writeQuery({
|
|
20062
20062
|
query: vn,
|
|
20063
20063
|
variables: { chatId: M.chatId },
|
|
20064
20064
|
data: {
|
|
@@ -20079,36 +20079,36 @@ function jv() {
|
|
|
20079
20079
|
});
|
|
20080
20080
|
}
|
|
20081
20081
|
});
|
|
20082
|
-
let [
|
|
20082
|
+
let [De] = nn(), Oe = (L.kind === "messages" || L.kind === "help-article" || L.kind === "news-article") && fe, ke = Oe ? 640 : 420, Ae = Oe ? 860 : 670, [je, Ne] = X(null);
|
|
20083
20083
|
J(() => {
|
|
20084
20084
|
if (typeof window > "u") return;
|
|
20085
20085
|
let e = () => {
|
|
20086
20086
|
let e = window.innerWidth, t = window.innerHeight;
|
|
20087
|
-
|
|
20087
|
+
Ne((n) => n && n.w === e && n.h === t ? n : {
|
|
20088
20088
|
w: e,
|
|
20089
20089
|
h: t
|
|
20090
20090
|
});
|
|
20091
20091
|
};
|
|
20092
20092
|
return e(), window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
|
|
20093
20093
|
}, []);
|
|
20094
|
-
let
|
|
20095
|
-
let e = yv(L), t =
|
|
20096
|
-
return
|
|
20097
|
-
})(),
|
|
20098
|
-
|
|
20099
|
-
let e = de ?
|
|
20100
|
-
|
|
20094
|
+
let U = u || !je ? ke : Math.min(ke, je.w - Tv), Pe = u || !je ? Ae : Math.min(Ae, je.h - Ev), Fe = Y(yv(L)), Ie = (() => {
|
|
20095
|
+
let e = yv(L), t = Fe.current;
|
|
20096
|
+
return Fe.current = e, e === t ? 0 : e > t ? 1 : -1;
|
|
20097
|
+
})(), W = Y(r.onResize);
|
|
20098
|
+
W.current = r.onResize, J(() => {
|
|
20099
|
+
let e = de ? ke : 72, t = de ? Ae : 72;
|
|
20100
|
+
W.current(e, t);
|
|
20101
20101
|
}, [
|
|
20102
20102
|
de,
|
|
20103
|
-
|
|
20104
|
-
|
|
20103
|
+
ke,
|
|
20104
|
+
Ae
|
|
20105
20105
|
]);
|
|
20106
20106
|
let Le = () => {
|
|
20107
20107
|
z(!1), i === "production" && r.onClose();
|
|
20108
20108
|
}, Re = async (e, t) => {
|
|
20109
|
-
if (o)
|
|
20109
|
+
if (o) Ce(t), _e.clear();
|
|
20110
20110
|
else if (M.chatId) try {
|
|
20111
|
-
await
|
|
20111
|
+
await De({ variables: { input: { text: t } } });
|
|
20112
20112
|
} catch {}
|
|
20113
20113
|
R({ kind: "messages" }), ae(), h();
|
|
20114
20114
|
}, ze = () => {
|
|
@@ -20130,15 +20130,15 @@ function jv() {
|
|
|
20130
20130
|
y: 0,
|
|
20131
20131
|
scale: 1,
|
|
20132
20132
|
pointerEvents: "auto",
|
|
20133
|
-
width:
|
|
20134
|
-
height:
|
|
20133
|
+
width: U,
|
|
20134
|
+
height: Pe
|
|
20135
20135
|
} : {
|
|
20136
20136
|
opacity: 0,
|
|
20137
20137
|
y: 16,
|
|
20138
20138
|
scale: .98,
|
|
20139
20139
|
pointerEvents: "none",
|
|
20140
|
-
width:
|
|
20141
|
-
height:
|
|
20140
|
+
width: U,
|
|
20141
|
+
height: Pe
|
|
20142
20142
|
},
|
|
20143
20143
|
transition: {
|
|
20144
20144
|
opacity: {
|
|
@@ -20168,7 +20168,7 @@ function jv() {
|
|
|
20168
20168
|
}
|
|
20169
20169
|
},
|
|
20170
20170
|
"data-wx-panel": !0,
|
|
20171
|
-
className:
|
|
20171
|
+
className: H("isolate flex flex-col overflow-hidden bg-wx-bg text-wx-fg", u ? "absolute" : "fixed", "bottom-24 z-2147483601 rounded-wx-xl", u ? "max-w-[calc(100%-2rem)] max-h-[calc(100%-7rem)]" : "max-w-[calc(100vw-2rem)] max-h-[calc(100dvh-7rem)]", l ? "left-4" : "right-4"),
|
|
20172
20172
|
children: [
|
|
20173
20173
|
We && /* @__PURE__ */ Z("div", {
|
|
20174
20174
|
"aria-hidden": "true",
|
|
@@ -20184,9 +20184,9 @@ function jv() {
|
|
|
20184
20184
|
children: he && /* @__PURE__ */ Z(ne, {
|
|
20185
20185
|
mode: "sync",
|
|
20186
20186
|
initial: !1,
|
|
20187
|
-
custom:
|
|
20187
|
+
custom: Ie,
|
|
20188
20188
|
children: /* @__PURE__ */ Q(n.div, {
|
|
20189
|
-
custom:
|
|
20189
|
+
custom: Ie,
|
|
20190
20190
|
variants: xv,
|
|
20191
20191
|
initial: "enter",
|
|
20192
20192
|
animate: "center",
|
|
@@ -20238,14 +20238,14 @@ function jv() {
|
|
|
20238
20238
|
isOpen: de,
|
|
20239
20239
|
onInbound: m,
|
|
20240
20240
|
onOutbound: h,
|
|
20241
|
-
registerRealtimeHandler:
|
|
20242
|
-
unreadCount:
|
|
20243
|
-
clearUnread:
|
|
20244
|
-
liveMessages:
|
|
20245
|
-
appendLiveMessage:
|
|
20246
|
-
replaceLiveMessage:
|
|
20247
|
-
initialVisitorMessage:
|
|
20248
|
-
onInitialVisitorMessageSent: () =>
|
|
20241
|
+
registerRealtimeHandler: Ee,
|
|
20242
|
+
unreadCount: _e.count,
|
|
20243
|
+
clearUnread: _e.clear,
|
|
20244
|
+
liveMessages: be,
|
|
20245
|
+
appendLiveMessage: we,
|
|
20246
|
+
replaceLiveMessage: Te,
|
|
20247
|
+
initialVisitorMessage: Se,
|
|
20248
|
+
onInitialVisitorMessageSent: () => Ce(null),
|
|
20249
20249
|
visitorIdentity: g,
|
|
20250
20250
|
visitorPrefill: _,
|
|
20251
20251
|
security: a.security,
|
|
@@ -20357,15 +20357,15 @@ function jv() {
|
|
|
20357
20357
|
active: Ge,
|
|
20358
20358
|
features: a.features,
|
|
20359
20359
|
onChange: Ke,
|
|
20360
|
-
unreadCount:
|
|
20360
|
+
unreadCount: _e.count
|
|
20361
20361
|
}),
|
|
20362
20362
|
Be && /* @__PURE__ */ Z(fi, {})
|
|
20363
20363
|
]
|
|
20364
20364
|
}),
|
|
20365
20365
|
/* @__PURE__ */ Z(Ei, {
|
|
20366
|
-
message: de ? null :
|
|
20366
|
+
message: de ? null : _e.lastMessage,
|
|
20367
20367
|
onOpen: ze,
|
|
20368
|
-
onDismiss:
|
|
20368
|
+
onDismiss: _e.clear,
|
|
20369
20369
|
onSendButton: Re,
|
|
20370
20370
|
position: l ? "left" : "right",
|
|
20371
20371
|
embedded: u
|
|
@@ -20381,7 +20381,7 @@ function jv() {
|
|
|
20381
20381
|
/* @__PURE__ */ Z(mv, {
|
|
20382
20382
|
isOpen: de,
|
|
20383
20383
|
onToggle: oe,
|
|
20384
|
-
unreadCount:
|
|
20384
|
+
unreadCount: _e.count,
|
|
20385
20385
|
position: l ? "left" : "right",
|
|
20386
20386
|
embedded: u,
|
|
20387
20387
|
loading: ee
|
|
@@ -20398,7 +20398,7 @@ function jv() {
|
|
|
20398
20398
|
onToggleMute: f,
|
|
20399
20399
|
onBack: t ? n : void 0,
|
|
20400
20400
|
onClose: r,
|
|
20401
|
-
expanded:
|
|
20401
|
+
expanded: Oe,
|
|
20402
20402
|
onToggleExpand: () => pe((e) => !e)
|
|
20403
20403
|
});
|
|
20404
20404
|
}
|
|
@@ -20413,7 +20413,7 @@ function jv() {
|
|
|
20413
20413
|
title: me ?? e("helpTitle"),
|
|
20414
20414
|
onBack: n,
|
|
20415
20415
|
onClose: r,
|
|
20416
|
-
expanded:
|
|
20416
|
+
expanded: Oe,
|
|
20417
20417
|
onToggleExpand: () => pe((e) => !e)
|
|
20418
20418
|
}) : t.kind === "news" ? /* @__PURE__ */ Z(ki, {
|
|
20419
20419
|
title: e("newsTitle"),
|
|
@@ -20422,7 +20422,7 @@ function jv() {
|
|
|
20422
20422
|
title: me ?? e("newsTitle"),
|
|
20423
20423
|
onBack: n,
|
|
20424
20424
|
onClose: r,
|
|
20425
|
-
expanded:
|
|
20425
|
+
expanded: Oe,
|
|
20426
20426
|
onToggleExpand: () => pe((e) => !e)
|
|
20427
20427
|
}) : null;
|
|
20428
20428
|
}
|
|
@@ -21642,10 +21642,10 @@ var Mv = (e, t, n) => {
|
|
|
21642
21642
|
return v;
|
|
21643
21643
|
},
|
|
21644
21644
|
getNavigationDisallowedDynamicReasons: function() {
|
|
21645
|
-
return
|
|
21645
|
+
return ye;
|
|
21646
21646
|
},
|
|
21647
21647
|
getStaticShellDisallowedDynamicReasons: function() {
|
|
21648
|
-
return
|
|
21648
|
+
return ve;
|
|
21649
21649
|
},
|
|
21650
21650
|
isDynamicPostpone: function() {
|
|
21651
21651
|
return O;
|
|
@@ -21663,7 +21663,7 @@ var Mv = (e, t, n) => {
|
|
|
21663
21663
|
return E;
|
|
21664
21664
|
},
|
|
21665
21665
|
throwIfDisallowedDynamic: function() {
|
|
21666
|
-
return
|
|
21666
|
+
return _e;
|
|
21667
21667
|
},
|
|
21668
21668
|
throwToInterruptStaticGeneration: function() {
|
|
21669
21669
|
return b;
|
|
@@ -22158,7 +22158,7 @@ var Mv = (e, t, n) => {
|
|
|
22158
22158
|
- Start the app in development mode by running \`next dev\`, then open "${e.route}" in your browser to investigate the error.
|
|
22159
22159
|
- Rerun the production build with \`next build --debug-prerender\` to generate better stack traces.`);
|
|
22160
22160
|
}
|
|
22161
|
-
function
|
|
22161
|
+
function _e(e, t, n, r) {
|
|
22162
22162
|
if (r.syncDynamicErrorWithStack) throw ge(e, r.syncDynamicErrorWithStack), new a.StaticGenBailoutError();
|
|
22163
22163
|
if (t !== 0) {
|
|
22164
22164
|
if (n.hasSuspenseAboveBody) return;
|
|
@@ -22171,7 +22171,7 @@ var Mv = (e, t, n) => {
|
|
|
22171
22171
|
if (t === 1) throw console.error(`Route "${e.route}" did not produce a static shell and Next.js was unable to determine a reason. This is a bug in Next.js.`), new a.StaticGenBailoutError();
|
|
22172
22172
|
} else if (n.hasAllowedDynamic === !1 && n.hasDynamicMetadata) throw console.error(`Route "${e.route}" has a \`generateMetadata\` that depends on Request data (\`cookies()\`, etc...) or uncached external data (\`fetch(...)\`, etc...) when the rest of the route does not. See more info here: https://nextjs.org/docs/messages/next-prerender-dynamic-metadata`), new a.StaticGenBailoutError();
|
|
22173
22173
|
}
|
|
22174
|
-
function
|
|
22174
|
+
function ve(e, t, n, r) {
|
|
22175
22175
|
if (r || n.hasSuspenseAboveBody) return [];
|
|
22176
22176
|
if (t !== 0) {
|
|
22177
22177
|
let r = n.dynamicErrors;
|
|
@@ -22184,7 +22184,7 @@ var Mv = (e, t, n) => {
|
|
|
22184
22184
|
} else if (n.hasAllowedDynamic === !1 && n.dynamicErrors.length === 0 && n.dynamicMetadata) return [n.dynamicMetadata];
|
|
22185
22185
|
return [];
|
|
22186
22186
|
}
|
|
22187
|
-
function
|
|
22187
|
+
function ye(e, t, n, r, i) {
|
|
22188
22188
|
if (r) {
|
|
22189
22189
|
let { missingSampleErrors: e } = r;
|
|
22190
22190
|
if (e.length > 0) return e;
|
|
@@ -23003,7 +23003,7 @@ function xy({ publicKey: e, user: t, mode: n, configOverride: r, config: i, prev
|
|
|
23003
23003
|
s,
|
|
23004
23004
|
c
|
|
23005
23005
|
]), J(() => {
|
|
23006
|
-
|
|
23006
|
+
Ae(e ?? null);
|
|
23007
23007
|
}, [e]), J(() => {
|
|
23008
23008
|
let e = d.current;
|
|
23009
23009
|
if (!e) return;
|
|
@@ -23073,7 +23073,7 @@ function xy({ publicKey: e, user: t, mode: n, configOverride: r, config: i, prev
|
|
|
23073
23073
|
function Sy({ env: e, locale: t, children: n }) {
|
|
23074
23074
|
let r = by[t];
|
|
23075
23075
|
return /* @__PURE__ */ Z(zt, {
|
|
23076
|
-
client: Nt(() =>
|
|
23076
|
+
client: Nt(() => Ce(), []),
|
|
23077
23077
|
children: /* @__PURE__ */ Z(Jt, {
|
|
23078
23078
|
locale: t,
|
|
23079
23079
|
messages: r,
|
|
@@ -23086,6 +23086,6 @@ function Sy({ env: e, locale: t, children: n }) {
|
|
|
23086
23086
|
});
|
|
23087
23087
|
}
|
|
23088
23088
|
//#endregion
|
|
23089
|
-
export { xy as WexioWidget,
|
|
23089
|
+
export { xy as WexioWidget, Ae as setWexioPublicKey };
|
|
23090
23090
|
|
|
23091
23091
|
//# sourceMappingURL=widget-react.js.map
|