more-desk-one 0.0.7 → 0.0.8
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/index.cjs +5 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +87 -88
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "./index.css";
|
|
2
|
-
import { jsx as n, jsxs as
|
|
2
|
+
import { jsx as n, jsxs as p, Fragment as K } from "react/jsx-runtime";
|
|
3
3
|
import * as l from "react";
|
|
4
|
-
import _e, { createContext as ke, useState as
|
|
4
|
+
import _e, { createContext as ke, useState as _, useEffect as P, useContext as ve, forwardRef as Ne, useRef as I, useLayoutEffect as fe, useMemo as ge } from "react";
|
|
5
5
|
import { SSOAuthorization as G, Avatar as ce } from "more-sso-sdk";
|
|
6
6
|
import * as Z from "@radix-ui/react-popover";
|
|
7
7
|
let ye = null;
|
|
@@ -17,9 +17,9 @@ const Ce = ke(void 0), He = ({
|
|
|
17
17
|
apiKey: r,
|
|
18
18
|
token: a
|
|
19
19
|
}) => {
|
|
20
|
-
const [o, c] =
|
|
20
|
+
const [o, c] = _(!!a), [d, u] = _(a), [b, i] = _(!0), [w, k] = _(null);
|
|
21
21
|
return P(() => {
|
|
22
|
-
Se(
|
|
22
|
+
Se(u);
|
|
23
23
|
}, []), /* @__PURE__ */ n(
|
|
24
24
|
Ce.Provider,
|
|
25
25
|
{
|
|
@@ -29,9 +29,9 @@ const Ce = ke(void 0), He = ({
|
|
|
29
29
|
accessToken: d,
|
|
30
30
|
authorized: o,
|
|
31
31
|
setAuthorized: c,
|
|
32
|
-
isChatScreen:
|
|
33
|
-
setIsChatScreen:
|
|
34
|
-
profileInfo:
|
|
32
|
+
isChatScreen: b,
|
|
33
|
+
setIsChatScreen: i,
|
|
34
|
+
profileInfo: w,
|
|
35
35
|
setProfileInfo: k
|
|
36
36
|
},
|
|
37
37
|
children: e
|
|
@@ -51,7 +51,7 @@ function Pe({
|
|
|
51
51
|
const { setIsChatScreen: a, isChatScreen: o } = O(), c = () => {
|
|
52
52
|
o || a(!0);
|
|
53
53
|
};
|
|
54
|
-
return /* @__PURE__ */
|
|
54
|
+
return /* @__PURE__ */ p(Z.Root, { children: [
|
|
55
55
|
/* @__PURE__ */ n(
|
|
56
56
|
Z.Trigger,
|
|
57
57
|
{
|
|
@@ -88,7 +88,7 @@ function Pe({
|
|
|
88
88
|
) })
|
|
89
89
|
] });
|
|
90
90
|
}
|
|
91
|
-
const Re = ({ forwardedRef: e, onChangeHandler: t }) => /* @__PURE__ */
|
|
91
|
+
const Re = ({ forwardedRef: e, onChangeHandler: t }) => /* @__PURE__ */ p("div", { className: "mhb-h-[48px] mhb-flex mhb-rounded-[9999px] mhb-bg-neutral-10 mhb-items-center mhb-gap-3 mhb-px-3", children: [
|
|
92
92
|
/* @__PURE__ */ n(Le, { className: "mhb-h-4 mhb-w-4" }),
|
|
93
93
|
/* @__PURE__ */ n(
|
|
94
94
|
"input",
|
|
@@ -191,10 +191,10 @@ const Ue = (e) => {
|
|
|
191
191
|
...o ? { Authorization: `Bearer ${o}` } : {}
|
|
192
192
|
},
|
|
193
193
|
body: JSON.stringify({ query: r, variables: a })
|
|
194
|
-
})).json();
|
|
195
|
-
if (
|
|
196
|
-
const
|
|
197
|
-
return
|
|
194
|
+
})).json(), u = Array.isArray(d.errors) ? d.errors : [];
|
|
195
|
+
if (u.some((i) => {
|
|
196
|
+
const w = i.message?.toLowerCase() ?? "";
|
|
197
|
+
return w.includes("unauthorized") || w.includes("jwt") || w.includes("expired");
|
|
198
198
|
})) {
|
|
199
199
|
if (W) {
|
|
200
200
|
const i = await Fe();
|
|
@@ -206,8 +206,8 @@ const Ue = (e) => {
|
|
|
206
206
|
if (process.env.NODE_ENV === "development")
|
|
207
207
|
i = await G.getDevToken("432896");
|
|
208
208
|
else {
|
|
209
|
-
const
|
|
210
|
-
i = G.getToken(
|
|
209
|
+
const w = window.location.href, k = encodeURIComponent(w);
|
|
210
|
+
i = G.getToken(k);
|
|
211
211
|
}
|
|
212
212
|
if (!i?.token)
|
|
213
213
|
throw new Error("Refresh did not return an access token");
|
|
@@ -218,8 +218,8 @@ const Ue = (e) => {
|
|
|
218
218
|
W = !1;
|
|
219
219
|
}
|
|
220
220
|
}
|
|
221
|
-
if (
|
|
222
|
-
throw new Error(
|
|
221
|
+
if (u.length > 0)
|
|
222
|
+
throw new Error(u.map((i) => i.message).join(", "));
|
|
223
223
|
return d.data;
|
|
224
224
|
};
|
|
225
225
|
return {
|
|
@@ -311,10 +311,10 @@ const Be = (e) => {
|
|
|
311
311
|
is_new
|
|
312
312
|
}
|
|
313
313
|
}`, ue = 10, Ge = () => {
|
|
314
|
-
const [e, t] =
|
|
314
|
+
const [e, t] = _([]), [r, a] = _(!0), [o, c] = _(null), [d, u] = _(!1), [b, i] = _(""), w = I(!0), { accessToken: k } = O(), v = () => {
|
|
315
315
|
z(
|
|
316
316
|
de,
|
|
317
|
-
{ limit: ue, search_key:
|
|
317
|
+
{ limit: ue, search_key: b },
|
|
318
318
|
k
|
|
319
319
|
).then(async (g) => {
|
|
320
320
|
t(g?.EmployeeAssistTickets ?? []);
|
|
@@ -325,30 +325,30 @@ const Be = (e) => {
|
|
|
325
325
|
});
|
|
326
326
|
};
|
|
327
327
|
return P(() => {
|
|
328
|
-
if (
|
|
329
|
-
|
|
328
|
+
if (w.current) {
|
|
329
|
+
w.current = !1, v();
|
|
330
330
|
return;
|
|
331
331
|
}
|
|
332
332
|
const g = setTimeout(() => {
|
|
333
333
|
v();
|
|
334
334
|
}, 400);
|
|
335
335
|
return () => clearTimeout(g);
|
|
336
|
-
}, [
|
|
336
|
+
}, [b]), {
|
|
337
337
|
ticketData: e,
|
|
338
338
|
loading: r,
|
|
339
339
|
error: o,
|
|
340
340
|
getNextPageTicketData: (g) => {
|
|
341
|
-
k && (d || (
|
|
341
|
+
k && (d || (u(!0), z(de, { limit: ue, offset: g }, k).then(async (S) => {
|
|
342
342
|
const { EmployeeAssistTickets: E } = S;
|
|
343
343
|
t((M) => [...M, ...E]);
|
|
344
344
|
}).catch((S) => {
|
|
345
345
|
c(S);
|
|
346
346
|
}).finally(() => {
|
|
347
|
-
|
|
347
|
+
u(!1);
|
|
348
348
|
})));
|
|
349
349
|
},
|
|
350
350
|
isLoadingMore: d,
|
|
351
|
-
setSearchText:
|
|
351
|
+
setSearchText: i
|
|
352
352
|
};
|
|
353
353
|
};
|
|
354
354
|
function Q(e) {
|
|
@@ -366,13 +366,13 @@ function ze(e, t = "Asia/Kolkata", r = "en-GB") {
|
|
|
366
366
|
month: "short",
|
|
367
367
|
year: "2-digit",
|
|
368
368
|
timeZone: t
|
|
369
|
-
}).formatToParts(a), c = o.find((
|
|
369
|
+
}).formatToParts(a), c = o.find((i) => i.type === "day")?.value ?? "", d = o.find((i) => i.type === "month")?.value ?? "", u = o.find((i) => i.type === "year")?.value ?? "", b = new Intl.DateTimeFormat(r, {
|
|
370
370
|
hour: "2-digit",
|
|
371
371
|
minute: "2-digit",
|
|
372
372
|
hour12: !1,
|
|
373
373
|
timeZone: t
|
|
374
374
|
}).format(a);
|
|
375
|
-
return `${c} ${d} ‘${
|
|
375
|
+
return `${c} ${d} ‘${u}, ${b}`;
|
|
376
376
|
}
|
|
377
377
|
const se = (e, t) => {
|
|
378
378
|
sessionStorage.setItem(e, JSON.stringify(t));
|
|
@@ -385,12 +385,12 @@ const se = (e, t) => {
|
|
|
385
385
|
loading: o,
|
|
386
386
|
getNextPageTicketData: c,
|
|
387
387
|
isLoadingMore: d,
|
|
388
|
-
setSearchText:
|
|
389
|
-
} = Ge(), { setIsChatScreen:
|
|
388
|
+
setSearchText: u
|
|
389
|
+
} = Ge(), { setIsChatScreen: b, profileInfo: i } = O();
|
|
390
390
|
fe(() => {
|
|
391
391
|
e.current;
|
|
392
392
|
}, [a.length]);
|
|
393
|
-
const
|
|
393
|
+
const w = (h) => {
|
|
394
394
|
const g = h.currentTarget;
|
|
395
395
|
if (r.current?.blur(), g.scrollHeight <= g.clientHeight) return;
|
|
396
396
|
const S = g.scrollHeight - g.scrollTop - g.clientHeight, E = a.length;
|
|
@@ -398,23 +398,23 @@ const se = (e, t) => {
|
|
|
398
398
|
}, k = (h) => {
|
|
399
399
|
se("userAndTicket", {
|
|
400
400
|
ticket_id: h,
|
|
401
|
-
employee_id:
|
|
402
|
-
}),
|
|
401
|
+
employee_id: i?.employee_id
|
|
402
|
+
}), b((g) => !g);
|
|
403
403
|
};
|
|
404
|
-
return /* @__PURE__ */
|
|
404
|
+
return /* @__PURE__ */ p("div", { className: "mhb-flex mhb-flex-col mhb-h-full mhb-min-h-0", children: [
|
|
405
405
|
/* @__PURE__ */ n("div", { className: "mhb-searchbarContainer mhb-flex mhb-flex-col mhb-border-b mhb-border-neutral-20", children: /* @__PURE__ */ n(Oe, { ref: r, onChangeHandler: (h) => {
|
|
406
406
|
h.preventDefault();
|
|
407
407
|
const g = r.current?.value?.trim();
|
|
408
|
-
|
|
408
|
+
u(g ?? null);
|
|
409
409
|
} }) }),
|
|
410
410
|
/* @__PURE__ */ n(
|
|
411
411
|
"div",
|
|
412
412
|
{
|
|
413
413
|
ref: e,
|
|
414
|
-
onScroll:
|
|
414
|
+
onScroll: w,
|
|
415
415
|
className: "mhb-history-main-container mhb-no-scrollbar mhb-py-3 mhb-flex mhb-flex-col mhb-gap-1 mhb-overflow-y-auto mhb-flex-1 mhb-min-h-0",
|
|
416
|
-
children: o ? /* @__PURE__ */ n(ee, {}) : /* @__PURE__ */
|
|
417
|
-
a.map((h) => /* @__PURE__ */
|
|
416
|
+
children: o ? /* @__PURE__ */ n(ee, {}) : /* @__PURE__ */ p(K, { children: [
|
|
417
|
+
a.map((h) => /* @__PURE__ */ p(
|
|
418
418
|
"button",
|
|
419
419
|
{
|
|
420
420
|
type: "button",
|
|
@@ -432,9 +432,9 @@ const se = (e, t) => {
|
|
|
432
432
|
}
|
|
433
433
|
)
|
|
434
434
|
] });
|
|
435
|
-
}, Je = ({ isChatScreen: e, setIsChatScreen: t }) => /* @__PURE__ */
|
|
435
|
+
}, Je = ({ isChatScreen: e, setIsChatScreen: t }) => /* @__PURE__ */ p("div", { className: "mhb-header mhb-border-b mhb-border-neutral-20 mhb-flex mhb-items-center mhb-justify-between", children: [
|
|
436
436
|
/* @__PURE__ */ n(Ee, { className: "h-[36px] w-[36px] fill-current" }),
|
|
437
|
-
/* @__PURE__ */
|
|
437
|
+
/* @__PURE__ */ p("div", { className: "mhb-flex mhb-gap-2 mhb-items-center", children: [
|
|
438
438
|
e ? /* @__PURE__ */ n("div", { className: "mhb-btn-reset mhb-p-3 mhb-invisible mhb-typography-para-thick-30", children: "new chat" }) : /* @__PURE__ */ n(
|
|
439
439
|
"button",
|
|
440
440
|
{
|
|
@@ -516,7 +516,7 @@ mutation AssistChat(
|
|
|
516
516
|
}
|
|
517
517
|
}
|
|
518
518
|
}`, X = 10, Qe = () => {
|
|
519
|
-
const [e, t] =
|
|
519
|
+
const [e, t] = _([]), [r, a] = _(!0), [o, c] = _(null), [d, u] = _(!1), [b, i] = _(!1), [w, k] = _(!0), { accessToken: v, profileInfo: h } = O(), g = R("userAndTicket")?.ticket_id, S = R("userAndTicket")?.employee_id, E = ge(() => e.find((f) => f.ticket_id != null)?.ticket_id ?? null, [e]);
|
|
520
520
|
let M = g ?? E ?? null;
|
|
521
521
|
return P(() => {
|
|
522
522
|
if (!M || !h) return;
|
|
@@ -551,7 +551,7 @@ mutation AssistChat(
|
|
|
551
551
|
historyData: e,
|
|
552
552
|
msgLoading: r,
|
|
553
553
|
msgError: o,
|
|
554
|
-
isSending:
|
|
554
|
+
isSending: b,
|
|
555
555
|
sendMessage: (f) => {
|
|
556
556
|
const s = e.find((C) => C.ticket_id != null)?.ticket_id ?? null, m = e.find((C) => C.handover == !0)?.handover ?? !1, y = {
|
|
557
557
|
...s && { ticket_id: s },
|
|
@@ -566,13 +566,13 @@ mutation AssistChat(
|
|
|
566
566
|
user_type: "employee"
|
|
567
567
|
}
|
|
568
568
|
};
|
|
569
|
-
|
|
569
|
+
i(!0), t((C) => [...C, y]), Y(be, y, v).then(async (C) => {
|
|
570
570
|
const x = C;
|
|
571
571
|
x.assistChat.user.user_type !== "employee" && t((H) => [...H, x.assistChat]), !R("userAndTicket") && x.assistChat?.ticket_id && h && se("userAndTicket", {
|
|
572
572
|
ticket_id: x.assistChat?.ticket_id,
|
|
573
573
|
employee_id: h.employee_id
|
|
574
574
|
});
|
|
575
|
-
}).catch(() => t((C) => C.slice(0, -1))).finally(() =>
|
|
575
|
+
}).catch(() => t((C) => C.slice(0, -1))).finally(() => i(!1));
|
|
576
576
|
},
|
|
577
577
|
getNextPageData: (f) => {
|
|
578
578
|
if (!v || d) return;
|
|
@@ -581,18 +581,18 @@ mutation AssistChat(
|
|
|
581
581
|
limit: X,
|
|
582
582
|
offset: f
|
|
583
583
|
};
|
|
584
|
-
|
|
584
|
+
u(!0), z(me, m, v).then(async (y) => {
|
|
585
585
|
const x = y?.assistHistory ?? [];
|
|
586
586
|
t((H) => [...x, ...H]), x.length < X && k(!1);
|
|
587
587
|
}).catch((y) => {
|
|
588
588
|
c(y);
|
|
589
589
|
}).finally(() => {
|
|
590
|
-
|
|
590
|
+
u(!1);
|
|
591
591
|
});
|
|
592
592
|
},
|
|
593
593
|
isLoadingMore: d,
|
|
594
594
|
upload: async (f) => {
|
|
595
|
-
|
|
595
|
+
i(!0);
|
|
596
596
|
const s = {
|
|
597
597
|
files: f.files.map(
|
|
598
598
|
(m) => `${f.ticketId}/${m.name}`
|
|
@@ -645,12 +645,12 @@ mutation AssistChat(
|
|
|
645
645
|
} catch {
|
|
646
646
|
t((y) => y.slice(0, -1));
|
|
647
647
|
} finally {
|
|
648
|
-
|
|
648
|
+
i(!1);
|
|
649
649
|
}
|
|
650
650
|
},
|
|
651
|
-
hasMore:
|
|
651
|
+
hasMore: w
|
|
652
652
|
};
|
|
653
|
-
}, Xe = ({ toastMsg: e }) => /* @__PURE__ */
|
|
653
|
+
}, Xe = ({ toastMsg: e }) => /* @__PURE__ */ p(
|
|
654
654
|
"div",
|
|
655
655
|
{
|
|
656
656
|
id: "toast-simple",
|
|
@@ -673,11 +673,11 @@ mutation AssistChat(
|
|
|
673
673
|
}
|
|
674
674
|
), et = _e.memo(
|
|
675
675
|
({ url: e, msg: t, isFirstInGroup: r, fileType: a }) => {
|
|
676
|
-
const [o, c] =
|
|
677
|
-
const
|
|
678
|
-
k.href =
|
|
676
|
+
const [o, c] = _(!1), d = async () => {
|
|
677
|
+
const u = t.attachments[0], i = await (await fetch(u.url)).blob(), w = URL.createObjectURL(i), k = document.createElement("a");
|
|
678
|
+
k.href = w, k.download = u.filename || "download.pdf", k.click(), URL.revokeObjectURL(w);
|
|
679
679
|
};
|
|
680
|
-
return /* @__PURE__ */
|
|
680
|
+
return /* @__PURE__ */ p(K, { children: [
|
|
681
681
|
(a === "jpg" || a === "jpeg" || a === "png") && /* @__PURE__ */ n("div", { className: "mhb-flex", children: /* @__PURE__ */ n(
|
|
682
682
|
"div",
|
|
683
683
|
{
|
|
@@ -693,7 +693,7 @@ mutation AssistChat(
|
|
|
693
693
|
) }) }) })
|
|
694
694
|
}
|
|
695
695
|
) }),
|
|
696
|
-
a === "pdf" && /* @__PURE__ */
|
|
696
|
+
a === "pdf" && /* @__PURE__ */ p(
|
|
697
697
|
"button",
|
|
698
698
|
{
|
|
699
699
|
className: "mhb-flex mhb-w-full mhb-items-center mhb-justify-between mhb-gap-3 mhb-rounded-[20px] mhb-mhb-border mhb-border-neutral-10 mhb-bg-white p-3 focus:mhb-outline-none",
|
|
@@ -713,10 +713,10 @@ mutation AssistChat(
|
|
|
713
713
|
"image/png",
|
|
714
714
|
"application/pdf"
|
|
715
715
|
], tt = () => {
|
|
716
|
-
const [e, t] =
|
|
717
|
-
historyData:
|
|
718
|
-
sendMessage:
|
|
719
|
-
getNextPageData:
|
|
716
|
+
const [e, t] = _(""), r = I(null), a = I(null), o = I(null), c = I(0), d = I(0), u = I(!1), {
|
|
717
|
+
historyData: b,
|
|
718
|
+
sendMessage: i,
|
|
719
|
+
getNextPageData: w,
|
|
720
720
|
isLoadingMore: k,
|
|
721
721
|
isSending: v,
|
|
722
722
|
upload: h,
|
|
@@ -726,22 +726,22 @@ mutation AssistChat(
|
|
|
726
726
|
fe(() => {
|
|
727
727
|
const s = r.current;
|
|
728
728
|
if (s)
|
|
729
|
-
if (
|
|
729
|
+
if (u.current) {
|
|
730
730
|
const m = c.current, y = d.current, x = s.scrollHeight - m;
|
|
731
|
-
s.scrollTop = y + x,
|
|
731
|
+
s.scrollTop = y + x, u.current = !1;
|
|
732
732
|
} else
|
|
733
733
|
s.scrollTop = s.scrollHeight;
|
|
734
|
-
}, [
|
|
734
|
+
}, [b?.length]);
|
|
735
735
|
const E = () => {
|
|
736
736
|
const s = a.current?.value?.trim();
|
|
737
|
-
S || (
|
|
737
|
+
S || (u.current = !1), s && (i(s), a.current && (a.current.value = ""));
|
|
738
738
|
}, M = (s) => {
|
|
739
739
|
v || s.key === "Enter" && (s.preventDefault(), E());
|
|
740
740
|
}, ae = (s) => {
|
|
741
741
|
const m = s.currentTarget;
|
|
742
742
|
if (m.scrollHeight > m.clientHeight && m.scrollTop <= 20 && !k) {
|
|
743
|
-
const C =
|
|
744
|
-
c.current = m.scrollHeight, d.current = m.scrollTop,
|
|
743
|
+
const C = b.length;
|
|
744
|
+
c.current = m.scrollHeight, d.current = m.scrollTop, u.current = !0, w(C);
|
|
745
745
|
}
|
|
746
746
|
}, ie = (s) => {
|
|
747
747
|
const m = Array.from(s.target.files || []), y = m.filter(
|
|
@@ -755,7 +755,7 @@ mutation AssistChat(
|
|
|
755
755
|
), setTimeout(() => t(null), 3e3), s.target.value = "";
|
|
756
756
|
return;
|
|
757
757
|
}
|
|
758
|
-
const x =
|
|
758
|
+
const x = b[b?.length - 1]?.ticket_id;
|
|
759
759
|
y.length > 0 && x && h({
|
|
760
760
|
files: y,
|
|
761
761
|
signature_type: "upload",
|
|
@@ -763,17 +763,17 @@ mutation AssistChat(
|
|
|
763
763
|
});
|
|
764
764
|
}, le = () => {
|
|
765
765
|
o.current?.click();
|
|
766
|
-
}, f = ge(() =>
|
|
767
|
-
return console.log(
|
|
768
|
-
/* @__PURE__ */ n(K, { children: g ? /* @__PURE__ */ n("div", { className: "mhb-py-3", children: /* @__PURE__ */ n(ee, {}) }) : /* @__PURE__ */
|
|
766
|
+
}, f = ge(() => b?.some((s) => s.handover == !0), [b]);
|
|
767
|
+
return console.log(b, "historyData"), /* @__PURE__ */ p("div", { className: "mhb-flex mhb-h-full mhb-flex-col mhb-overflow-hidden mhb-bg-white", children: [
|
|
768
|
+
/* @__PURE__ */ n(K, { children: g ? /* @__PURE__ */ n("div", { className: "mhb-py-3", children: /* @__PURE__ */ n(ee, {}) }) : /* @__PURE__ */ p(K, { children: [
|
|
769
769
|
/* @__PURE__ */ n(
|
|
770
770
|
"div",
|
|
771
771
|
{
|
|
772
772
|
ref: r,
|
|
773
773
|
className: "mhb-flex-grow mhb-overflow-y-auto mhb-py-3 [&>*]:[mhb-overflow-anchor:none]",
|
|
774
774
|
onScroll: ae,
|
|
775
|
-
children: /* @__PURE__ */ n("div", { className: "mhb-flex mhb-min-h-full mhb-flex-col mhb-justify-end mhb-gap-1", children:
|
|
776
|
-
const y = "user" in s && m === 0 ||
|
|
775
|
+
children: /* @__PURE__ */ n("div", { className: "mhb-flex mhb-min-h-full mhb-flex-col mhb-justify-end mhb-gap-1", children: b?.map((s, m) => {
|
|
776
|
+
const y = "user" in s && m === 0 || b[m - 1]?.user?.user_type !== s?.user?.user_type, C = new Date(s.created_at ?? ""), x = m > 0 ? new Date(b[m - 1].created_at ?? "") : null, H = !x || C.getDate() !== x.getDate() || C.getMonth() !== x.getMonth() || C.getFullYear() !== x.getFullYear(), oe = x && C.getTime() - x.getTime() > 120 * 1e3, L = s.hasOwnProperty("user") && (y || H || oe), N = s?.attachments?.some(($) => {
|
|
777
777
|
const D = $.filename.match(/\.([a-zA-Z0-9]+)(?:\?|$)/)?.[1]?.toLowerCase();
|
|
778
778
|
return ["jpg", "jpeg", "png"].includes(D || "");
|
|
779
779
|
});
|
|
@@ -781,22 +781,22 @@ mutation AssistChat(
|
|
|
781
781
|
"div",
|
|
782
782
|
{
|
|
783
783
|
className: `mhb-flex ${s.user.user_type === "bot" || s.user.user_type === "agent" ? "mhb-justify-start" : "mhb-justify-end"}`,
|
|
784
|
-
children: /* @__PURE__ */
|
|
784
|
+
children: /* @__PURE__ */ p("div", { className: "mhb-max-w-[75%", children: [
|
|
785
785
|
L && /* @__PURE__ */ n(
|
|
786
786
|
"div",
|
|
787
787
|
{
|
|
788
788
|
className: `mhb-mb-1 mhb-flex mhb-items-center ${s.user.user_type === "bot" || s.user.user_type === "agent" ? "mhb-justify-start" : "mhb-justify-end"}`,
|
|
789
|
-
children: s.user.user_type === "bot" ? /* @__PURE__ */
|
|
790
|
-
/* @__PURE__ */
|
|
789
|
+
children: s.user.user_type === "bot" ? /* @__PURE__ */ p("div", { className: "mhb-flex mhb-gap-2 mhb-items-center", children: [
|
|
790
|
+
/* @__PURE__ */ p("div", { className: "mhb-flex mhb-items-center mhb-gap-1", children: [
|
|
791
791
|
/* @__PURE__ */ n(De, {}),
|
|
792
792
|
/* @__PURE__ */ n("div", { className: "mhb-mb-1", children: /* @__PURE__ */ n($e, {}) })
|
|
793
793
|
] }),
|
|
794
|
-
/* @__PURE__ */
|
|
794
|
+
/* @__PURE__ */ p("div", { className: "mhb-flex mhb-gap-1 mhb-mt-[2px] mhb-items-center", children: [
|
|
795
795
|
/* @__PURE__ */ n("div", { className: "mhb-h-[2px] mhb-w-[2px] mhb-rounded-full mhb-bg-neutral-60" }),
|
|
796
796
|
/* @__PURE__ */ n("p", { className: "mhb-typography-para-40 mhb-text-neutral-60", children: Q(s.created_at) })
|
|
797
797
|
] })
|
|
798
|
-
] }) : s.user.user_type === "employee" ? /* @__PURE__ */
|
|
799
|
-
/* @__PURE__ */
|
|
798
|
+
] }) : s.user.user_type === "employee" ? /* @__PURE__ */ p("div", { className: "mhb-flex mhb-gap-2 mhb-items-center", children: [
|
|
799
|
+
/* @__PURE__ */ p("div", { className: "mhb-flex mhb-gap-1", children: [
|
|
800
800
|
/* @__PURE__ */ n("p", { className: "mhb-typography-para-40 mhb-text-neutral-60", children: Q(s.created_at) }),
|
|
801
801
|
/* @__PURE__ */ n("div", { className: "mhb-h-[2px] mhb-w-[2px] mhb-rounded-full mhb-bg-neutral-60 mhb-flex mhb-self-center" })
|
|
802
802
|
] }),
|
|
@@ -808,7 +808,7 @@ mutation AssistChat(
|
|
|
808
808
|
className: "mhb-size-4 mhb-shrink-0 mhb-rounded-full mhb-select-none"
|
|
809
809
|
}
|
|
810
810
|
)
|
|
811
|
-
] }) : s.user.user_type === "agent" ? /* @__PURE__ */
|
|
811
|
+
] }) : s.user.user_type === "agent" ? /* @__PURE__ */ p("div", { className: "mhb-flex mhb-gap-2 mhb-items-center", children: [
|
|
812
812
|
/* @__PURE__ */ n(
|
|
813
813
|
ce,
|
|
814
814
|
{
|
|
@@ -817,7 +817,7 @@ mutation AssistChat(
|
|
|
817
817
|
className: "mhb-size-4 mhb-shrink-0 mhb-rounded-full mhb-select-none"
|
|
818
818
|
}
|
|
819
819
|
),
|
|
820
|
-
/* @__PURE__ */
|
|
820
|
+
/* @__PURE__ */ p("div", { className: "mhb-flex mhb-gap-1 mhb-mt-1 mhb-items-center", children: [
|
|
821
821
|
/* @__PURE__ */ n("div", { className: "mhb-h-[2px] mhb-w-[2px] mhb-rounded-full mhb-bg-neutral-60" }),
|
|
822
822
|
/* @__PURE__ */ n("p", { className: "mhb-typography-para-40 mhb-text-neutral-60", children: Q(s.created_at) })
|
|
823
823
|
] })
|
|
@@ -854,7 +854,7 @@ mutation AssistChat(
|
|
|
854
854
|
}) })
|
|
855
855
|
}
|
|
856
856
|
),
|
|
857
|
-
/* @__PURE__ */ n("div", { className: "mhb-chat-input-container mhb-sticky mhb-bottom-0 mhb-bg-white mhb-py-3 mhb-flex mhb-items-center mhb-gap-2", children: /* @__PURE__ */
|
|
857
|
+
/* @__PURE__ */ n("div", { className: "mhb-chat-input-container mhb-sticky mhb-bottom-0 mhb-bg-white mhb-py-3 mhb-flex mhb-items-center mhb-gap-2", children: /* @__PURE__ */ p("div", { className: "mhb-bg-neutral-10 mhb-flex mhb-h-[80px] mhb-flex-1 mhb-rounded-xl mhb-p-3", children: [
|
|
858
858
|
/* @__PURE__ */ n("div", { className: "mhb-flex mhb-flex-1", children: /* @__PURE__ */ n(
|
|
859
859
|
"textarea",
|
|
860
860
|
{
|
|
@@ -864,8 +864,8 @@ mutation AssistChat(
|
|
|
864
864
|
onKeyDown: M
|
|
865
865
|
}
|
|
866
866
|
) }),
|
|
867
|
-
/* @__PURE__ */
|
|
868
|
-
f && /* @__PURE__ */
|
|
867
|
+
/* @__PURE__ */ p("div", { className: "mhb-flex mhb-gap-1 mhb-justify-end mhb-items-end", children: [
|
|
868
|
+
f && /* @__PURE__ */ p(
|
|
869
869
|
"button",
|
|
870
870
|
{
|
|
871
871
|
type: "button",
|
|
@@ -878,7 +878,6 @@ mutation AssistChat(
|
|
|
878
878
|
"input",
|
|
879
879
|
{
|
|
880
880
|
type: "file",
|
|
881
|
-
multiple: !0,
|
|
882
881
|
accept: ".jpg,.jpeg,.png,.pdf",
|
|
883
882
|
ref: o,
|
|
884
883
|
onChange: ie,
|
|
@@ -914,13 +913,13 @@ function nt({
|
|
|
914
913
|
setIsChatScreen: o,
|
|
915
914
|
accessToken: c,
|
|
916
915
|
setProfileInfo: d
|
|
917
|
-
} = O(),
|
|
918
|
-
const
|
|
919
|
-
d(
|
|
916
|
+
} = O(), u = async () => {
|
|
917
|
+
const b = await G.getProfileDetails();
|
|
918
|
+
d(b);
|
|
920
919
|
};
|
|
921
920
|
return P(() => {
|
|
922
|
-
c &&
|
|
923
|
-
}, []), /* @__PURE__ */ n("div", { className: "mhb-root", children: /* @__PURE__ */ n(Pe, { side: e, align: t, children: /* @__PURE__ */
|
|
921
|
+
c && u();
|
|
922
|
+
}, []), /* @__PURE__ */ n("div", { className: "mhb-root", children: /* @__PURE__ */ n(Pe, { side: e, align: t, children: /* @__PURE__ */ p("div", { className: "mhb-h-full mhb-w-full mhb-flex mhb-flex-col mhb-min-h-0", children: [
|
|
924
923
|
/* @__PURE__ */ n(
|
|
925
924
|
Je,
|
|
926
925
|
{
|
|
@@ -949,7 +948,7 @@ function ot(e) {
|
|
|
949
948
|
}), re = e, q = !0, rt(), Be({ apiKey: e.apiKey, apiURL: e.apiURL }));
|
|
950
949
|
}
|
|
951
950
|
function ct(e) {
|
|
952
|
-
const [t, r] =
|
|
951
|
+
const [t, r] = _({
|
|
953
952
|
initialized: q,
|
|
954
953
|
sdkOptions: re
|
|
955
954
|
});
|