@phonghq/go-chat 1.0.25 → 1.0.26
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/components/chat/ScrollEvent/ScrollEvent.vue.d.ts +1 -0
- package/dist/components/common/button/ButtonBase.vue.d.ts +1 -1
- package/dist/go-chat.es.js +76 -75
- package/dist/go-chat.umd.js +2 -2
- package/dist/style.css +1 -1
- package/dist/test/chat/App.vue.js +2 -1
- package/dist/test/chat/page/home/ChatMessage.vue.js +2 -1
- package/dist/test/chat/page/home/Home.vue.js +2 -4
- package/dist/test/components/chat/call/Calling.vue.js +1 -0
- package/package.json +1 -1
|
@@ -11,8 +11,8 @@ type __VLS_Slots = {} & {
|
|
|
11
11
|
default?: (props: typeof __VLS_12) => any;
|
|
12
12
|
};
|
|
13
13
|
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
14
|
-
loading: boolean;
|
|
15
14
|
disabled: boolean;
|
|
15
|
+
loading: boolean;
|
|
16
16
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, __VLS_Slots>;
|
|
17
17
|
export default _default;
|
|
18
18
|
type __VLS_WithSlots<T, S> = T & {
|
package/dist/go-chat.es.js
CHANGED
|
@@ -105,7 +105,7 @@ const fm = /* @__PURE__ */ Ut(yN, [["render", EN]]), TN = "data:image/png;base64
|
|
|
105
105
|
id: -98,
|
|
106
106
|
receiver_id: 101,
|
|
107
107
|
username: "Gocheckin AI",
|
|
108
|
-
|
|
108
|
+
phone: "",
|
|
109
109
|
avatar: "",
|
|
110
110
|
last_message: "",
|
|
111
111
|
last_message_time: "",
|
|
@@ -113,7 +113,8 @@ const fm = /* @__PURE__ */ Ut(yN, [["render", EN]]), TN = "data:image/png;base64
|
|
|
113
113
|
updated_at: "",
|
|
114
114
|
unread_count: 0,
|
|
115
115
|
status: 1,
|
|
116
|
-
color: "#4F46E5"
|
|
116
|
+
color: "#4F46E5",
|
|
117
|
+
is_unknown: 0
|
|
117
118
|
}, Ps = -98;
|
|
118
119
|
function pm() {
|
|
119
120
|
return {
|
|
@@ -173,7 +174,8 @@ const bN = {
|
|
|
173
174
|
__name: "ScrollEvent",
|
|
174
175
|
props: {
|
|
175
176
|
top: { type: Boolean },
|
|
176
|
-
bottom: { type: Boolean }
|
|
177
|
+
bottom: { type: Boolean },
|
|
178
|
+
disabled: { type: Boolean }
|
|
177
179
|
},
|
|
178
180
|
emits: ["getDataBottom", "getDataTop"],
|
|
179
181
|
setup(e, { expose: n, emit: t }) {
|
|
@@ -236,7 +238,7 @@ const bN = {
|
|
|
236
238
|
])
|
|
237
239
|
], 544));
|
|
238
240
|
}
|
|
239
|
-
}), am = /* @__PURE__ */ Ut(ON, [["__scopeId", "data-v-
|
|
241
|
+
}), am = /* @__PURE__ */ Ut(ON, [["__scopeId", "data-v-910cd231"]]);
|
|
240
242
|
function vm(e, n) {
|
|
241
243
|
return function() {
|
|
242
244
|
return e.apply(n, arguments);
|
|
@@ -471,10 +473,10 @@ const _x = (e) => {
|
|
|
471
473
|
setImmediate: Sm,
|
|
472
474
|
asap: ax
|
|
473
475
|
};
|
|
474
|
-
function
|
|
476
|
+
function ut(e, n, t, i, o) {
|
|
475
477
|
Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message = e, this.name = "AxiosError", n && (this.code = n), t && (this.config = t), i && (this.request = i), o && (this.response = o, this.status = o.status ? o.status : null);
|
|
476
478
|
}
|
|
477
|
-
ue.inherits(
|
|
479
|
+
ue.inherits(ut, Error, {
|
|
478
480
|
toJSON: function() {
|
|
479
481
|
return {
|
|
480
482
|
// Standard
|
|
@@ -495,7 +497,7 @@ ue.inherits(lt, Error, {
|
|
|
495
497
|
};
|
|
496
498
|
}
|
|
497
499
|
});
|
|
498
|
-
const bm =
|
|
500
|
+
const bm = ut.prototype, Im = {};
|
|
499
501
|
[
|
|
500
502
|
"ERR_BAD_OPTION_VALUE",
|
|
501
503
|
"ERR_BAD_OPTION",
|
|
@@ -513,13 +515,13 @@ const bm = lt.prototype, Im = {};
|
|
|
513
515
|
].forEach((e) => {
|
|
514
516
|
Im[e] = { value: e };
|
|
515
517
|
});
|
|
516
|
-
Object.defineProperties(
|
|
518
|
+
Object.defineProperties(ut, Im);
|
|
517
519
|
Object.defineProperty(bm, "isAxiosError", { value: !0 });
|
|
518
|
-
|
|
520
|
+
ut.from = (e, n, t, i, o, r) => {
|
|
519
521
|
const s = Object.create(bm);
|
|
520
522
|
return ue.toFlatObject(e, s, function(l) {
|
|
521
523
|
return l !== Error.prototype;
|
|
522
|
-
}, (u) => u !== "isAxiosError"),
|
|
524
|
+
}, (u) => u !== "isAxiosError"), ut.call(s, e.message, n, t, i, o), s.cause = e, s.name = e.name, r && Object.assign(s, r), s;
|
|
523
525
|
};
|
|
524
526
|
const vx = null;
|
|
525
527
|
function Jc(e) {
|
|
@@ -557,7 +559,7 @@ function vu(e, n, t) {
|
|
|
557
559
|
if (ue.isDate(a))
|
|
558
560
|
return a.toISOString();
|
|
559
561
|
if (!l && ue.isBlob(a))
|
|
560
|
-
throw new
|
|
562
|
+
throw new ut("Blob is not supported. Use a Buffer instead.");
|
|
561
563
|
return ue.isArrayBuffer(a) || ue.isTypedArray(a) ? l && typeof Blob == "function" ? new Blob([a]) : Buffer.from(a) : a;
|
|
562
564
|
}
|
|
563
565
|
function c(a, v, m) {
|
|
@@ -803,7 +805,7 @@ const zs = {
|
|
|
803
805
|
return JSON.parse(n);
|
|
804
806
|
} catch (u) {
|
|
805
807
|
if (s)
|
|
806
|
-
throw u.name === "SyntaxError" ?
|
|
808
|
+
throw u.name === "SyntaxError" ? ut.from(u, ut.ERR_BAD_RESPONSE, this, null, this.response) : u;
|
|
807
809
|
}
|
|
808
810
|
}
|
|
809
811
|
return n;
|
|
@@ -1038,16 +1040,16 @@ function Nm(e) {
|
|
|
1038
1040
|
return !!(e && e.__CANCEL__);
|
|
1039
1041
|
}
|
|
1040
1042
|
function es(e, n, t) {
|
|
1041
|
-
|
|
1043
|
+
ut.call(this, e ?? "canceled", ut.ERR_CANCELED, n, t), this.name = "CanceledError";
|
|
1042
1044
|
}
|
|
1043
|
-
ue.inherits(es,
|
|
1045
|
+
ue.inherits(es, ut, {
|
|
1044
1046
|
__CANCEL__: !0
|
|
1045
1047
|
});
|
|
1046
1048
|
function xm(e, n, t) {
|
|
1047
1049
|
const i = t.config.validateStatus;
|
|
1048
|
-
!t.status || !i || i(t.status) ? e(t) : n(new
|
|
1050
|
+
!t.status || !i || i(t.status) ? e(t) : n(new ut(
|
|
1049
1051
|
"Request failed with status code " + t.status,
|
|
1050
|
-
[
|
|
1052
|
+
[ut.ERR_BAD_REQUEST, ut.ERR_BAD_RESPONSE][Math.floor(t.status / 100) - 4],
|
|
1051
1053
|
t.config,
|
|
1052
1054
|
t.request,
|
|
1053
1055
|
t
|
|
@@ -1297,15 +1299,15 @@ const wm = (e) => {
|
|
|
1297
1299
|
"onloadend" in m ? m.onloadend = y : m.onreadystatechange = function() {
|
|
1298
1300
|
!m || m.readyState !== 4 || m.status === 0 && !(m.responseURL && m.responseURL.indexOf("file:") === 0) || setTimeout(y);
|
|
1299
1301
|
}, m.onabort = function() {
|
|
1300
|
-
m && (i(new
|
|
1302
|
+
m && (i(new ut("Request aborted", ut.ECONNABORTED, e, m)), m = null);
|
|
1301
1303
|
}, m.onerror = function() {
|
|
1302
|
-
i(new
|
|
1304
|
+
i(new ut("Network Error", ut.ERR_NETWORK, e, m)), m = null;
|
|
1303
1305
|
}, m.ontimeout = function() {
|
|
1304
1306
|
let T = o.timeout ? "timeout of " + o.timeout + "ms exceeded" : "timeout exceeded";
|
|
1305
1307
|
const S = o.transitional || Mm;
|
|
1306
|
-
o.timeoutErrorMessage && (T = o.timeoutErrorMessage), i(new
|
|
1308
|
+
o.timeoutErrorMessage && (T = o.timeoutErrorMessage), i(new ut(
|
|
1307
1309
|
T,
|
|
1308
|
-
S.clarifyTimeoutError ?
|
|
1310
|
+
S.clarifyTimeoutError ? ut.ETIMEDOUT : ut.ECONNABORTED,
|
|
1309
1311
|
e,
|
|
1310
1312
|
m
|
|
1311
1313
|
)), m = null;
|
|
@@ -1316,7 +1318,7 @@ const wm = (e) => {
|
|
|
1316
1318
|
}, o.cancelToken && o.cancelToken.subscribe(c), o.signal && (o.signal.aborted ? c() : o.signal.addEventListener("abort", c)));
|
|
1317
1319
|
const g = Bx(o.url);
|
|
1318
1320
|
if (g && Zn.protocols.indexOf(g) === -1) {
|
|
1319
|
-
i(new
|
|
1321
|
+
i(new ut("Unsupported protocol " + g + ":", ut.ERR_BAD_REQUEST, e));
|
|
1320
1322
|
return;
|
|
1321
1323
|
}
|
|
1322
1324
|
m.send(r || null);
|
|
@@ -1329,11 +1331,11 @@ const wm = (e) => {
|
|
|
1329
1331
|
if (!o) {
|
|
1330
1332
|
o = !0, u();
|
|
1331
1333
|
const c = d instanceof Error ? d : this.reason;
|
|
1332
|
-
i.abort(c instanceof
|
|
1334
|
+
i.abort(c instanceof ut ? c : new es(c instanceof Error ? c.message : c));
|
|
1333
1335
|
}
|
|
1334
1336
|
};
|
|
1335
1337
|
let s = n && setTimeout(() => {
|
|
1336
|
-
s = null, r(new
|
|
1338
|
+
s = null, r(new ut(`timeout ${n} of ms exceeded`, ut.ETIMEDOUT));
|
|
1337
1339
|
}, n);
|
|
1338
1340
|
const u = () => {
|
|
1339
1341
|
e && (s && clearTimeout(s), s = null, e.forEach((d) => {
|
|
@@ -1423,7 +1425,7 @@ const wm = (e) => {
|
|
|
1423
1425
|
mu && ((e) => {
|
|
1424
1426
|
["text", "arrayBuffer", "blob", "formData", "stream"].forEach((n) => {
|
|
1425
1427
|
!zl[n] && (zl[n] = ue.isFunction(e[n]) ? (t) => t[n]() : (t, i) => {
|
|
1426
|
-
throw new
|
|
1428
|
+
throw new ut(`Response type '${n}' is not supported`, ut.ERR_NOT_SUPPORT, i);
|
|
1427
1429
|
});
|
|
1428
1430
|
});
|
|
1429
1431
|
})(new Response());
|
|
@@ -1523,11 +1525,11 @@ const Zx = async (e) => {
|
|
|
1523
1525
|
});
|
|
1524
1526
|
} catch (y) {
|
|
1525
1527
|
throw v && v(), y && y.name === "TypeError" && /fetch/i.test(y.message) ? Object.assign(
|
|
1526
|
-
new
|
|
1528
|
+
new ut("Network Error", ut.ERR_NETWORK, e, a),
|
|
1527
1529
|
{
|
|
1528
1530
|
cause: y.cause || y
|
|
1529
1531
|
}
|
|
1530
|
-
) :
|
|
1532
|
+
) : ut.from(y, y && y.code, e, a);
|
|
1531
1533
|
}
|
|
1532
1534
|
}), e_ = {
|
|
1533
1535
|
http: vx,
|
|
@@ -1553,7 +1555,7 @@ const Rp = (e) => `- ${e}`, nP = (e) => ue.isFunction(e) || e === null || e ===
|
|
|
1553
1555
|
t = e[r];
|
|
1554
1556
|
let s;
|
|
1555
1557
|
if (i = t, !nP(t) && (i = e_[(s = String(t)).toLowerCase()], i === void 0))
|
|
1556
|
-
throw new
|
|
1558
|
+
throw new ut(`Unknown adapter '${s}'`);
|
|
1557
1559
|
if (i)
|
|
1558
1560
|
break;
|
|
1559
1561
|
o[s || "#" + r] = i;
|
|
@@ -1565,7 +1567,7 @@ const Rp = (e) => `- ${e}`, nP = (e) => ue.isFunction(e) || e === null || e ===
|
|
|
1565
1567
|
let s = n ? r.length > 1 ? `since :
|
|
1566
1568
|
` + r.map(Rp).join(`
|
|
1567
1569
|
`) : " " + Rp(r[0]) : "as no adapter specified";
|
|
1568
|
-
throw new
|
|
1570
|
+
throw new ut(
|
|
1569
1571
|
"There is no suitable adapter to dispatch the request " + s,
|
|
1570
1572
|
"ERR_NOT_SUPPORT"
|
|
1571
1573
|
);
|
|
@@ -1609,9 +1611,9 @@ w_.transitional = function(n, t, i) {
|
|
|
1609
1611
|
}
|
|
1610
1612
|
return (r, s, u) => {
|
|
1611
1613
|
if (n === !1)
|
|
1612
|
-
throw new
|
|
1614
|
+
throw new ut(
|
|
1613
1615
|
o(s, " has been removed" + (t ? " in " + t : "")),
|
|
1614
|
-
|
|
1616
|
+
ut.ERR_DEPRECATED
|
|
1615
1617
|
);
|
|
1616
1618
|
return t && !Op[s] && (Op[s] = !0, console.warn(
|
|
1617
1619
|
o(
|
|
@@ -1623,7 +1625,7 @@ w_.transitional = function(n, t, i) {
|
|
|
1623
1625
|
};
|
|
1624
1626
|
function iP(e, n, t) {
|
|
1625
1627
|
if (typeof e != "object")
|
|
1626
|
-
throw new
|
|
1628
|
+
throw new ut("options must be an object", ut.ERR_BAD_OPTION_VALUE);
|
|
1627
1629
|
const i = Object.keys(e);
|
|
1628
1630
|
let o = i.length;
|
|
1629
1631
|
for (; o-- > 0; ) {
|
|
@@ -1631,11 +1633,11 @@ function iP(e, n, t) {
|
|
|
1631
1633
|
if (s) {
|
|
1632
1634
|
const u = e[r], l = u === void 0 || s(u, r, e);
|
|
1633
1635
|
if (l !== !0)
|
|
1634
|
-
throw new
|
|
1636
|
+
throw new ut("option " + r + " must be " + l, ut.ERR_BAD_OPTION_VALUE);
|
|
1635
1637
|
continue;
|
|
1636
1638
|
}
|
|
1637
1639
|
if (t !== !0)
|
|
1638
|
-
throw new
|
|
1640
|
+
throw new ut("Unknown option " + r, ut.ERR_BAD_OPTION);
|
|
1639
1641
|
}
|
|
1640
1642
|
}
|
|
1641
1643
|
const t_ = {
|
|
@@ -1925,7 +1927,7 @@ rn.CancelToken = D_;
|
|
|
1925
1927
|
rn.isCancel = Nm;
|
|
1926
1928
|
rn.VERSION = Um;
|
|
1927
1929
|
rn.toFormData = vu;
|
|
1928
|
-
rn.AxiosError =
|
|
1930
|
+
rn.AxiosError = ut;
|
|
1929
1931
|
rn.Cancel = rn.CanceledError;
|
|
1930
1932
|
rn.all = function(n) {
|
|
1931
1933
|
return Promise.all(n);
|
|
@@ -43043,7 +43045,7 @@ const x9 = 5, HM = () => new Promise((e, n) => {
|
|
|
43043
43045
|
"chat/conversation/update/",
|
|
43044
43046
|
"chat/conversation/read_message/",
|
|
43045
43047
|
"chat/conversation/update_list/"
|
|
43046
|
-
], br = "user/status/",
|
|
43048
|
+
], br = "user/status/", lt = ye(null), P9 = ye(null);
|
|
43047
43049
|
let Fr = {
|
|
43048
43050
|
id: "",
|
|
43049
43051
|
token: "",
|
|
@@ -43053,21 +43055,21 @@ const w9 = (e, n, t) => {
|
|
|
43053
43055
|
Fr = { id: e, token: n, domain: t };
|
|
43054
43056
|
}, D9 = async (e) => {
|
|
43055
43057
|
const n = await Un.post("/api/v1/message/tenant/login", e);
|
|
43056
|
-
return localStorage.setItem("chat_token", n == null ? void 0 : n.token), localStorage.setItem("refresh_token", n == null ? void 0 : n.refresh_token), Fr.id = e.tenant_id, Fr.token = n == null ? void 0 : n.token,
|
|
43058
|
+
return localStorage.setItem("chat_token", n == null ? void 0 : n.token), localStorage.setItem("refresh_token", n == null ? void 0 : n.refresh_token), Fr.id = e.tenant_id, Fr.token = n == null ? void 0 : n.token, lt.value = n, n;
|
|
43057
43059
|
}, k9 = async (e) => {
|
|
43058
43060
|
const n = await Un.get("/api/v1/message/tenant/gci-link", { params: e });
|
|
43059
43061
|
return localStorage.setItem("chat_token", n == null ? void 0 : n.token), localStorage.setItem("refresh_token", n == null ? void 0 : n.refresh_token), Fr.id = e.tenant_id, Fr.token = n == null ? void 0 : n.token, P9.value = n, n;
|
|
43060
43062
|
}, L9 = async () => {
|
|
43061
43063
|
const e = await Un.get("/api/v1/message/user/me");
|
|
43062
|
-
return localStorage.setItem("chat_user", JSON.stringify(e)),
|
|
43064
|
+
return localStorage.setItem("chat_user", JSON.stringify(e)), lt.value = e, e;
|
|
43063
43065
|
}, U9 = async () => {
|
|
43064
43066
|
var t, i;
|
|
43065
43067
|
const e = localStorage.getItem("chat_id"), n = await Un.get(`/api/v1/message/tenant/get-info?tenant_name=${e}`);
|
|
43066
43068
|
if (n.error || !(n != null && n.data)) throw new Error(n.error);
|
|
43067
|
-
return
|
|
43069
|
+
return lt.value && (lt.value.tenant_phone = ((t = n == null ? void 0 : n.data) == null ? void 0 : t.go_chat_phone) ?? ""), lt.value && (lt.value.tenant_phone_limit = Number(((i = n == null ? void 0 : n.data) == null ? void 0 : i.go_chat_phone_limit) ?? 0)), n;
|
|
43068
43070
|
}, zM = async () => {
|
|
43069
43071
|
var e, n, t, i;
|
|
43070
|
-
Fr = { id: "", token: "", domain: "" },
|
|
43072
|
+
Fr = { id: "", token: "", domain: "" }, lt.value = null, localStorage.removeItem("chat_accessToken"), localStorage.removeItem("chat_domain"), localStorage.removeItem("chat_id");
|
|
43071
43073
|
try {
|
|
43072
43074
|
(n = (e = Qn == null ? void 0 : Qn.getInstance()) == null ? void 0 : e.closeApp) == null || n.call(e), (t = Qn == null ? void 0 : Qn.getInstance()) != null && t.getBridge() ? (i = Qn == null ? void 0 : Qn.getInstance()) == null || i.closeApp() : window.location.href = "/login";
|
|
43073
43075
|
} catch {
|
|
@@ -43364,18 +43366,18 @@ const W9 = /* @__PURE__ */ Ut(Y9, [["render", K9]]), Q9 = { class: "w-full" }, J
|
|
|
43364
43366
|
e.isSendImg ? t = "You sent images" : e.isCall != null && (e.isCall == "call" ? t = "You sent call" : t = `${((l = e.infoUser) == null ? void 0 : l.username) ?? ""} sent call`);
|
|
43365
43367
|
const i = Bt().tz(Yf).format(Vr.DATE_FORMAT_FULL), o = {
|
|
43366
43368
|
id: ((d = e.infoUser) == null ? void 0 : d.conversation_id) ?? 0,
|
|
43367
|
-
receiver_id: Number(((c =
|
|
43368
|
-
username: ((_ =
|
|
43369
|
-
phone: ((f =
|
|
43370
|
-
avatar: ((p =
|
|
43369
|
+
receiver_id: Number(((c = lt.value) == null ? void 0 : c.id) ?? 0),
|
|
43370
|
+
username: ((_ = lt.value) == null ? void 0 : _.username) ?? "",
|
|
43371
|
+
phone: ((f = lt.value) == null ? void 0 : f.phone) ?? "",
|
|
43372
|
+
avatar: ((p = lt.value) == null ? void 0 : p.avatar) ?? "",
|
|
43371
43373
|
last_message: t,
|
|
43372
43374
|
last_message_time: i,
|
|
43373
43375
|
created_at: i,
|
|
43374
43376
|
updated_at: i,
|
|
43375
43377
|
unread_count: ((n == null ? void 0 : n.unread_count) ?? 0) + 1,
|
|
43376
43378
|
status: 1,
|
|
43377
|
-
color: ((a =
|
|
43378
|
-
is_call: ((v =
|
|
43379
|
+
color: ((a = lt.value) == null ? void 0 : a.color) ?? "",
|
|
43380
|
+
is_call: ((v = lt.value) == null ? void 0 : v.color) ?? "",
|
|
43379
43381
|
is_unknown: 0
|
|
43380
43382
|
};
|
|
43381
43383
|
nu(
|
|
@@ -43384,7 +43386,7 @@ const W9 = /* @__PURE__ */ Ut(Y9, [["render", K9]]), Q9 = { class: "w-full" }, J
|
|
|
43384
43386
|
);
|
|
43385
43387
|
const r = {
|
|
43386
43388
|
id: ((y = e.infoUser) == null ? void 0 : y.conversation_id) ?? 0,
|
|
43387
|
-
receiver_id: Number(((g =
|
|
43389
|
+
receiver_id: Number(((g = lt.value) == null ? void 0 : g.id) ?? 0),
|
|
43388
43390
|
username: ((h = e.infoUser) == null ? void 0 : h.username) ?? "",
|
|
43389
43391
|
phone: ((T = e.infoUser) == null ? void 0 : T.phone) ?? "",
|
|
43390
43392
|
avatar: ((S = e.infoUser) == null ? void 0 : S.avatar) ?? "",
|
|
@@ -43398,7 +43400,7 @@ const W9 = /* @__PURE__ */ Ut(Y9, [["render", K9]]), Q9 = { class: "w-full" }, J
|
|
|
43398
43400
|
is_unknown: ((A = e.infoUser) == null ? void 0 : A.is_unknown) ?? 0
|
|
43399
43401
|
};
|
|
43400
43402
|
nu(
|
|
43401
|
-
`${Xo[0] + Number((M =
|
|
43403
|
+
`${Xo[0] + Number((M = lt.value) == null ? void 0 : M.id)}`,
|
|
43402
43404
|
JSON.stringify(r)
|
|
43403
43405
|
);
|
|
43404
43406
|
}, { digibotData: uF, digibotId: dF } = pm(), fv = (e) => {
|
|
@@ -43415,21 +43417,21 @@ const W9 = /* @__PURE__ */ Ut(Y9, [["render", K9]]), Q9 = { class: "w-full" }, J
|
|
|
43415
43417
|
var c, _;
|
|
43416
43418
|
Xo.forEach((f) => {
|
|
43417
43419
|
var p;
|
|
43418
|
-
zf(f + ((p =
|
|
43419
|
-
}), ((c =
|
|
43420
|
+
zf(f + ((p = lt.value) == null ? void 0 : p.id)), iu("chat-list-" + f + "-" + e);
|
|
43421
|
+
}), ((c = lt.value) == null ? void 0 : c.user_type) == "tenant" && (Ms(br + ((_ = lt.value) == null ? void 0 : _.id)), iu("chat-list-" + br + "-" + e));
|
|
43420
43422
|
}, r = async () => {
|
|
43421
43423
|
var c, _;
|
|
43422
43424
|
try {
|
|
43423
|
-
|
|
43425
|
+
lt.value && (await HM(), Xo.forEach((f) => {
|
|
43424
43426
|
var p, a;
|
|
43425
|
-
Ms(f + ((p =
|
|
43427
|
+
Ms(f + ((p = lt.value) == null ? void 0 : p.id)), m_(
|
|
43426
43428
|
"chat-list-" + f + "-" + e,
|
|
43427
|
-
f + ((a =
|
|
43429
|
+
f + ((a = lt.value) == null ? void 0 : a.id),
|
|
43428
43430
|
s
|
|
43429
43431
|
);
|
|
43430
|
-
}), Ms(br + ((c =
|
|
43432
|
+
}), Ms(br + ((c = lt.value) == null ? void 0 : c.id)), m_(
|
|
43431
43433
|
"chat-list-" + br + "-" + e,
|
|
43432
|
-
br + ((_ =
|
|
43434
|
+
br + ((_ = lt.value) == null ? void 0 : _.id),
|
|
43433
43435
|
s
|
|
43434
43436
|
));
|
|
43435
43437
|
} catch (f) {
|
|
@@ -43438,15 +43440,15 @@ const W9 = /* @__PURE__ */ Ut(Y9, [["render", K9]]), Q9 = { class: "w-full" }, J
|
|
|
43438
43440
|
}, s = (c, _) => {
|
|
43439
43441
|
var f, p, a, v;
|
|
43440
43442
|
if ((_.is_unknown ?? 0) == e) {
|
|
43441
|
-
if (u(), c === Xo[0] + ((f =
|
|
43443
|
+
if (u(), c === Xo[0] + ((f = lt.value) == null ? void 0 : f.id)) {
|
|
43442
43444
|
const m = t.value.findIndex((g) => g.id === _.id), y = t.value.findIndex((g) => g.id === dF);
|
|
43443
43445
|
m != -1 && t.value.splice(m, 1), y > -1 ? t.value.splice(1, 0, _) : t.value.unshift(_);
|
|
43444
43446
|
}
|
|
43445
|
-
if (c === Xo[1] + ((p =
|
|
43447
|
+
if (c === Xo[1] + ((p = lt.value) == null ? void 0 : p.id)) {
|
|
43446
43448
|
const m = t.value.findIndex((y) => y.id === _.id);
|
|
43447
43449
|
m != -1 && (t.value[m].unread_count = 0);
|
|
43448
43450
|
}
|
|
43449
|
-
if (c === Xo[2] + ((a =
|
|
43451
|
+
if (c === Xo[2] + ((a = lt.value) == null ? void 0 : a.id) && t.value.unshift(_ == null ? void 0 : _.conversations), c === br + ((v = lt.value) == null ? void 0 : v.id)) {
|
|
43450
43452
|
const m = t.value.findIndex(
|
|
43451
43453
|
(y) => y.receiver_id == Number(_ == null ? void 0 : _.customer_id)
|
|
43452
43454
|
);
|
|
@@ -43600,7 +43602,7 @@ const W9 = /* @__PURE__ */ Ut(Y9, [["render", K9]]), Q9 = { class: "w-full" }, J
|
|
|
43600
43602
|
je(fm, { class: "text-[#004AB3]" })
|
|
43601
43603
|
])
|
|
43602
43604
|
]),
|
|
43603
|
-
((q = re(
|
|
43605
|
+
((q = re(lt)) == null ? void 0 : q.user_type) == "tenant" ? (oe(), tt(eF, {
|
|
43604
43606
|
key: 0,
|
|
43605
43607
|
class: "shrink-0 px-6",
|
|
43606
43608
|
tabs: s.value,
|
|
@@ -43715,14 +43717,14 @@ const MF = { class: "px-8 pb-4 border-b border-chat-gray-5" }, OF = { class: "fl
|
|
|
43715
43717
|
setup(e, { emit: n }) {
|
|
43716
43718
|
const t = e, i = n, o = () => {
|
|
43717
43719
|
var r, s;
|
|
43718
|
-
((r = t.data) == null ? void 0 : r.id) != Ps.toString() && ((s =
|
|
43720
|
+
((r = t.data) == null ? void 0 : r.id) != Ps.toString() && ((s = lt.value) == null ? void 0 : s.user_type) == "tenant" && (Qo.value = t.data, Jn(rt.CUSTOMER_DETAIL));
|
|
43719
43721
|
};
|
|
43720
43722
|
return (r, s) => {
|
|
43721
43723
|
var u, l, d, c, _, f, p, a, v, m;
|
|
43722
43724
|
return oe(), de("div", MF, [
|
|
43723
43725
|
te("div", OF, [
|
|
43724
43726
|
je(Xr, {
|
|
43725
|
-
class: at({ "cursor-pointer": ((u = re(
|
|
43727
|
+
class: at({ "cursor-pointer": ((u = re(lt)) == null ? void 0 : u.user_type) == "tenant" }),
|
|
43726
43728
|
src: ((l = r.data) == null ? void 0 : l.avatar) ?? "",
|
|
43727
43729
|
id: ((d = r.data) == null ? void 0 : d.id) ?? "",
|
|
43728
43730
|
color: (c = r.data) == null ? void 0 : c.color,
|
|
@@ -43732,14 +43734,14 @@ const MF = { class: "px-8 pb-4 border-b border-chat-gray-5" }, OF = { class: "fl
|
|
|
43732
43734
|
te("div", NF, [
|
|
43733
43735
|
te("div", xF, [
|
|
43734
43736
|
te("div", {
|
|
43735
|
-
class: at({ "cursor-pointer": ((f = re(
|
|
43737
|
+
class: at({ "cursor-pointer": ((f = re(lt)) == null ? void 0 : f.user_type) == "tenant" }),
|
|
43736
43738
|
onClick: o
|
|
43737
43739
|
}, [
|
|
43738
43740
|
te("div", PF, [
|
|
43739
43741
|
te("p", wF, nt(((p = r.data) == null ? void 0 : p.username) ?? "n/a"), 1)
|
|
43740
43742
|
])
|
|
43741
43743
|
], 2),
|
|
43742
|
-
(a = r.data) != null && a.id && ((v = r.data) == null ? void 0 : v.id) != re(Ps).toString() && ((m = re(
|
|
43744
|
+
(a = r.data) != null && a.id && ((v = r.data) == null ? void 0 : v.id) != re(Ps).toString() && ((m = re(lt)) == null ? void 0 : m.user_type) == "tenant" ? (oe(), de("button", {
|
|
43743
43745
|
key: 0,
|
|
43744
43746
|
class: "flex-center text-[#0051E6] bg-chat-haze-200 w-9 h-9 rounded-lg",
|
|
43745
43747
|
onClick: s[0] || (s[0] = (y) => i("call"))
|
|
@@ -63730,7 +63732,7 @@ const FH = /* @__PURE__ */ Ge({
|
|
|
63730
63732
|
id: h,
|
|
63731
63733
|
message: y,
|
|
63732
63734
|
receiver_id: ((E = t.data) == null ? void 0 : E.id) || 0,
|
|
63733
|
-
sender_id: (A =
|
|
63735
|
+
sender_id: (A = lt.value) == null ? void 0 : A.id,
|
|
63734
63736
|
status: "read",
|
|
63735
63737
|
attachments: g
|
|
63736
63738
|
};
|
|
@@ -63744,7 +63746,7 @@ const FH = /* @__PURE__ */ Ge({
|
|
|
63744
63746
|
return (v, m) => {
|
|
63745
63747
|
var y;
|
|
63746
63748
|
return oe(), de("div", zH, [
|
|
63747
|
-
((y = re(
|
|
63749
|
+
((y = re(lt)) == null ? void 0 : y.user_type) == "tenant" ? (oe(), de("div", YH, [
|
|
63748
63750
|
je(HH, { label: "Active sms" })
|
|
63749
63751
|
])) : _t("", !0),
|
|
63750
63752
|
te("div", $H, [
|
|
@@ -64029,7 +64031,7 @@ const JO = /* @__PURE__ */ Ut(nz, [["render", oz]]), rz = {
|
|
|
64029
64031
|
}
|
|
64030
64032
|
}), mz = { class: "relative overflow-hidden" }, hz = {
|
|
64031
64033
|
key: 0,
|
|
64032
|
-
class: "shrink-0 h-[500px]"
|
|
64034
|
+
class: "shrink-0 h-[500px] chat-padding-page"
|
|
64033
64035
|
}, yz = { class: "chat-padding-page" }, gz = /* @__PURE__ */ Ge({
|
|
64034
64036
|
__name: "ChatMessage",
|
|
64035
64037
|
props: {
|
|
@@ -64087,7 +64089,7 @@ const JO = /* @__PURE__ */ Ut(nz, [["render", oz]]), rz = {
|
|
|
64087
64089
|
index: m,
|
|
64088
64090
|
"list-message": p.message,
|
|
64089
64091
|
responsive: p.responsive,
|
|
64090
|
-
"is-my-message": v.sender_id == ((y = re(
|
|
64092
|
+
"is-my-message": v.sender_id == ((y = re(lt)) == null ? void 0 : y.id),
|
|
64091
64093
|
data: p.data,
|
|
64092
64094
|
"should-show-avatar": u(m),
|
|
64093
64095
|
"is-last-message": m == p.message.length - 1,
|
|
@@ -64132,15 +64134,14 @@ const JO = /* @__PURE__ */ Ut(nz, [["render", oz]]), rz = {
|
|
|
64132
64134
|
zf(A), iu("chat-home");
|
|
64133
64135
|
}, a = (A, M) => {
|
|
64134
64136
|
var L, j, C, I, O;
|
|
64135
|
-
if (
|
|
64137
|
+
if ((L = d.value) != null && L.id && ((j = M == null ? void 0 : M.sender_id) == null ? void 0 : j.toString()) == ((I = (C = d.value) == null ? void 0 : C.id) == null ? void 0 : I.toString())) {
|
|
64136
64138
|
const N = c.value.findIndex((x) => x.id === (M == null ? void 0 : M.id));
|
|
64137
64139
|
N < 0 ? c.value.push(M) : c.value[N] = M, (O = _.value) == null || O.scrollBottom();
|
|
64138
64140
|
}
|
|
64139
|
-
console.log(c.value);
|
|
64140
64141
|
}, v = async (A) => {
|
|
64141
64142
|
var M, L, j;
|
|
64142
64143
|
try {
|
|
64143
|
-
const C = i.receiverId, I = { page: r, receiver_id: i.receiverId };
|
|
64144
|
+
const C = i.receiverId, I = { page: A != null && A.resetList ? 1 : r, receiver_id: i.receiverId };
|
|
64144
64145
|
let O = await tF(I);
|
|
64145
64146
|
O.items = O.items.reverse(), r = ((M = O._meta) == null ? void 0 : M.currentPage) || 1, s = ((L = O._meta) == null ? void 0 : L.pageCount) || 1, C == i.receiverId && (A != null && A.resetList ? (c.value = O.items, (j = _.value) == null || j.scrollBottom()) : c.value.unshift(...O.items));
|
|
64146
64147
|
} catch (C) {
|
|
@@ -64161,7 +64162,7 @@ const JO = /* @__PURE__ */ Ut(nz, [["render", oz]]), rz = {
|
|
|
64161
64162
|
}, g = async (A) => {
|
|
64162
64163
|
var M;
|
|
64163
64164
|
try {
|
|
64164
|
-
l.value = !0, c.value = [], y(A), await Promise.allSettled([v()]), await vi(), (M = _.value) == null || M.scrollBottom();
|
|
64165
|
+
l.value = !0, c.value = [], y(A), await Promise.allSettled([v({ resetList: !0 })]), await vi(), (M = _.value) == null || M.scrollBottom();
|
|
64165
64166
|
} catch (L) {
|
|
64166
64167
|
console.error(L);
|
|
64167
64168
|
} finally {
|
|
@@ -64880,7 +64881,7 @@ function ZY() {
|
|
|
64880
64881
|
}
|
|
64881
64882
|
}, t = async (r, s) => {
|
|
64882
64883
|
var u, l, d;
|
|
64883
|
-
await L9(), ((u =
|
|
64884
|
+
await L9(), ((u = lt.value) == null ? void 0 : u.user_type) == "tenant" && await U9(), zf(_v + ((l = lt.value) == null ? void 0 : l.id)), Ms(_v + ((d = lt.value) == null ? void 0 : d.id)), s == "mobile" ? Jn(rt.CHAT_LIST) : Jn(rt.HOME);
|
|
64884
64885
|
}, i = async () => {
|
|
64885
64886
|
try {
|
|
64886
64887
|
const r = window.location.search, s = new URLSearchParams(r), u = s.get("tenant_id") || "", l = s.get("phone") || "", d = s.get("message") || "", c = s.get("customer_name") || "", _ = s.get("business_name") || "";
|
|
@@ -65253,7 +65254,7 @@ const A$ = {
|
|
|
65253
65254
|
let S = null, E = "call";
|
|
65254
65255
|
lo(async () => {
|
|
65255
65256
|
var D;
|
|
65256
|
-
(D =
|
|
65257
|
+
console.log(lt.value), (D = lt.value) != null && D.tenant_phone && await r("");
|
|
65257
65258
|
}), Jr(() => {
|
|
65258
65259
|
S && clearInterval(S), m.value = "";
|
|
65259
65260
|
});
|
|
@@ -65293,7 +65294,7 @@ const A$ = {
|
|
|
65293
65294
|
h.value = null;
|
|
65294
65295
|
let B = {
|
|
65295
65296
|
phone: Xv(D, "1"),
|
|
65296
|
-
client_id: ((w =
|
|
65297
|
+
client_id: ((w = lt.value) == null ? void 0 : w.tenant_id) ?? ""
|
|
65297
65298
|
};
|
|
65298
65299
|
V = await RF(B);
|
|
65299
65300
|
} catch (B) {
|
|
@@ -65694,7 +65695,7 @@ const X$ = /* @__PURE__ */ Ut(W$, [["render", J$]]), Z$ = ["onClick"], eK = { cl
|
|
|
65694
65695
|
A();
|
|
65695
65696
|
}, 50), L = async () => {
|
|
65696
65697
|
var I;
|
|
65697
|
-
await u({ props: r, response: d.value }), (I =
|
|
65698
|
+
await u({ props: r, response: d.value }), (I = lt.value) != null && I.tenant_phone || s("error:noPhoneTenant");
|
|
65698
65699
|
}, j = (I, O) => {
|
|
65699
65700
|
setTimeout(() => {
|
|
65700
65701
|
var N, x, D, V;
|
|
@@ -65734,7 +65735,7 @@ const X$ = /* @__PURE__ */ Ut(W$, [["render", J$]]), Z$ = ["onClick"], eK = { cl
|
|
|
65734
65735
|
}), (I, O) => {
|
|
65735
65736
|
var N, x;
|
|
65736
65737
|
return oe(), de("div", {
|
|
65737
|
-
class: at(["go-chat-main max-w-full p-0", { "md:p-8": !I.isLib }]),
|
|
65738
|
+
class: at(["go-chat-main max-w-full p-0 overscroll-x-none", { "md:p-8": !I.isLib }]),
|
|
65738
65739
|
id: "appChatMain",
|
|
65739
65740
|
ref_key: "appChatRef",
|
|
65740
65741
|
ref: a
|