@droppii-org/chat-sdk 0.0.38 → 0.0.40

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.
Files changed (53) hide show
  1. package/dist/assets/svg/document.js +1 -1
  2. package/dist/assets/svg/document.tsx +2 -2
  3. package/dist/components/conversation/ConversationBySessionItem.js +1 -1
  4. package/dist/components/conversation/DeskConversationList.d.ts.map +1 -1
  5. package/dist/components/conversation/DeskConversationList.js +3 -1
  6. package/dist/components/mediaCollection/FileCollection.d.ts.map +1 -1
  7. package/dist/components/mediaCollection/ImageCollection.d.ts.map +1 -1
  8. package/dist/components/mediaCollection/VideoCollection.d.ts.map +1 -1
  9. package/dist/components/mediaCollection/index.d.ts +0 -1
  10. package/dist/components/mediaCollection/index.d.ts.map +1 -1
  11. package/dist/components/mediaCollection/index.js +0 -1
  12. package/dist/components/message/MessageHeader.d.ts +3 -1
  13. package/dist/components/message/MessageHeader.d.ts.map +1 -1
  14. package/dist/components/message/MessageHeader.js +4 -28
  15. package/dist/components/message/MessageList.d.ts.map +1 -1
  16. package/dist/components/message/MessageList.js +26 -4
  17. package/dist/components/message/footer/ActionBar.d.ts.map +1 -1
  18. package/dist/components/message/footer/ActionBar.js +32 -16
  19. package/dist/components/message/footer/FilePreview.js +2 -1
  20. package/dist/components/message/footer/ToolbarPlugin.js +1 -1
  21. package/dist/components/message/footer/index.d.ts +5 -1
  22. package/dist/components/message/footer/index.d.ts.map +1 -1
  23. package/dist/components/message/footer/index.js +11 -6
  24. package/dist/components/message/item/index.d.ts.map +1 -1
  25. package/dist/components/message/item/index.js +6 -4
  26. package/dist/components/searchConversation/SearchAll.js +5 -2
  27. package/dist/components/searchConversation/SearchConversationAsUsers.d.ts.map +1 -1
  28. package/dist/components/searchConversation/SearchConversationAsUsers.js +3 -1
  29. package/dist/components/searchConversation/item/SearchItemAsMessage.js +1 -1
  30. package/dist/constants/index.d.ts +0 -1
  31. package/dist/constants/index.d.ts.map +1 -1
  32. package/dist/constants/index.js +0 -1
  33. package/dist/hooks/global/useGlobalEvent.js +2 -1
  34. package/dist/hooks/message/useSendMessage.d.ts +7 -3
  35. package/dist/hooks/message/useSendMessage.d.ts.map +1 -1
  36. package/dist/hooks/message/useSendMessage.js +12 -9
  37. package/dist/hooks/search/useSearchMessage.js +2 -1
  38. package/dist/hooks/session/useGetSession.d.ts +9 -3
  39. package/dist/hooks/session/useGetSession.d.ts.map +1 -1
  40. package/dist/hooks/session/useGetSession.js +11 -9
  41. package/dist/hooks/user/useAuth.d.ts.map +1 -1
  42. package/dist/hooks/user/useAuth.js +10 -13
  43. package/dist/store/auth.d.ts.map +1 -1
  44. package/dist/store/auth.js +9 -1
  45. package/dist/styles/global.css +1 -1
  46. package/dist/types/chat.d.ts +2 -7
  47. package/dist/types/chat.d.ts.map +1 -1
  48. package/dist/utils/common.d.ts +1 -0
  49. package/dist/utils/common.d.ts.map +1 -1
  50. package/dist/utils/common.js +8 -4
  51. package/dist/utils/imCommon.d.ts.map +1 -1
  52. package/dist/utils/imCommon.js +2 -2
  53. package/package.json +2 -1
@@ -1,2 +1,2 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- export const documentIcon = (_jsxs("svg", { width: "40", height: "40", viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("path", { d: "M10.1923 5.83301L23.4363 5.83301L34.1656 14.2054V29.8639C34.1656 31.8997 32.5286 34.1663 29.8068 34.1663C27.0849 34.1663 10.1923 34.1663 10.1923 34.1663C7.4704 34.1663 5.8335 31.8997 5.8335 29.8639V10.0305C5.8335 7.99475 7.4704 5.83301 10.1923 5.83301Z", fill: "#24B0FF" }), _jsx("path", { d: "M10.8335 28.1394V20.833H16.0309V22.4222H12.7026V23.5916H15.3612V25.1708H12.7026V28.1394H10.8335Z", fill: "#edf6ff" }), _jsx("path", { d: "M19.0073 28.0885V20.833H20.8613V26.5118H24.0146V28.0885L19.0073 28.0885Z", fill: "#edf6ff" }), _jsx("path", { d: "M16.5918 28.1001V20.833H18.4485V28.1001H16.5918Z", fill: "#edf6ff" }), _jsx("path", { d: "M24.5737 20.833V28.1393H29.7723V26.5573H26.439L26.4422 25.1708H29.1017V23.5916H26.4422V22.4222H29.7723V20.833H24.5737Z", fill: "#edf6ff" }), _jsx("path", { opacity: "0.302", "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M23.2686 5.83301V14.2281H34.1655L23.2686 5.83301Z", fill: "#edf6ff" })] }));
2
+ export const documentIcon = (_jsxs("svg", { width: "40", height: "40", viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("path", { d: "M10.1923 5.83301L23.4363 5.83301L34.1656 14.2054V29.8639C34.1656 31.8997 32.5286 34.1663 29.8068 34.1663C27.0849 34.1663 10.1923 34.1663 10.1923 34.1663C7.4704 34.1663 5.8335 31.8997 5.8335 29.8639V10.0305C5.8335 7.99475 7.4704 5.83301 10.1923 5.83301Z", fill: "#24B0FF" }), _jsx("path", { d: "M10.8335 28.1394V20.833H16.0309V22.4222H12.7026V23.5916H15.3612V25.1708H12.7026V28.1394H10.8335Z", fill: "#edf6ff" }), _jsx("path", { d: "M19.0073 28.0885V20.833H20.8613V26.5118H24.0146V28.0885L19.0073 28.0885Z", fill: "#edf6ff" }), _jsx("path", { d: "M16.5918 28.1001V20.833H18.4485V28.1001H16.5918Z", fill: "#edf6ff" }), _jsx("path", { d: "M24.5737 20.833V28.1393H29.7723V26.5573H26.439L26.4422 25.1708H29.1017V23.5916H26.4422V22.4222H29.7723V20.833H24.5737Z", fill: "#edf6ff" }), _jsx("path", { opacity: "0.302", fillRule: "evenodd", clipRule: "evenodd", d: "M23.2686 5.83301V14.2281H34.1655L23.2686 5.83301Z", fill: "#edf6ff" })] }));
@@ -28,8 +28,8 @@ export const documentIcon = (
28
28
  ></path>
29
29
  <path
30
30
  opacity="0.302"
31
- fill-rule="evenodd"
32
- clip-rule="evenodd"
31
+ fillRule="evenodd"
32
+ clipRule="evenodd"
33
33
  d="M23.2686 5.83301V14.2281H34.1655L23.2686 5.83301Z"
34
34
  fill="#edf6ff"
35
35
  ></path>
@@ -29,7 +29,7 @@ const ConversationBySessionItem = ({ sessionItem, }) => {
29
29
  if (!conversation)
30
30
  return null;
31
31
  return (_jsxs("div", { onClick: () => handleConversationClick(conversation), className: `relative p-3 border-b border-gray-100 hover:bg-gray-100 cursor-pointer transition-colors ${isSelected ? "bg-blue-50" : "bg-white"}`, children: [isSelected && (_jsx("div", { className: "absolute left-0 top-0 bottom-0 w-1 bg-blue-500" })), _jsxs("div", { className: "flex items-start gap-3", children: [_jsx("div", { className: "relative flex-shrink-0", children: _jsx(Badge, { dot: true, status: "success", offset: [-2, 36], children: _jsx(Avatar, { size: 48, src: avatar, children: ((_a = displayName === null || displayName === void 0 ? void 0 : displayName.charAt) === null || _a === void 0 ? void 0 : _a.call(displayName, 0)) || "A" }) }) }), _jsx("div", { className: "flex-1 min-w-0", children: _jsxs("div", { className: "flex items-start justify-between", children: [_jsxs("div", { className: "flex-1 min-w-0", children: [_jsx("h3", { className: "font-semibold text-gray-900 text-sm truncate", children: displayName }), _jsx("p", { className: "text-xs text-gray-500 truncate mt-0.5", children: parseLatestMessage(conversation.latestMsg, user === null || user === void 0 ? void 0 : user.userID, t) })] }), _jsxs("div", { className: "flex flex-col items-end gap-1 ml-2", children: [_jsx("span", { className: "text-xs text-gray-400", children: formatTimestamp(conversation.latestMsgSendTime, {
32
- hasTime: false,
32
+ hasTime: true,
33
33
  }) }), _jsx("div", { className: "flex items-center gap-1", children: conversation.unreadCount > 0 && (_jsx(Badge, { count: conversation.unreadCount })) })] })] }) })] })] }, conversation.conversationID));
34
34
  };
35
35
  export default ConversationBySessionItem;
@@ -1 +1 @@
1
- {"version":3,"file":"DeskConversationList.d.ts","sourceRoot":"","sources":["../../../src/components/conversation/DeskConversationList.tsx"],"names":[],"mappings":"AAkBA,QAAA,MAAM,oBAAoB,+CAsLzB,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
1
+ {"version":3,"file":"DeskConversationList.d.ts","sourceRoot":"","sources":["../../../src/components/conversation/DeskConversationList.tsx"],"names":[],"mappings":"AAkBA,QAAA,MAAM,oBAAoB,+CAwLzB,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
@@ -26,7 +26,9 @@ const DeskConversationList = () => {
26
26
  const conversationList = useConversationStore((state) => state.conversationList);
27
27
  const updateConversationList = useConversationStore((state) => state.updateConversationList);
28
28
  const filterSummary = useSessionStore((state) => state.filterSummary);
29
- const { dataFlatten: sessions, hasNextPage, fetchNextPage, refetch, } = useGetSession(filterSummary);
29
+ const { dataFlatten: sessions, hasNextPage, fetchNextPage, refetch, } = useGetSession({
30
+ filter: filterSummary,
31
+ });
30
32
  const debouncedSearch = useDebounce(search, { wait: 500 });
31
33
  const onCloseSearch = () => {
32
34
  setSearch("");
@@ -1 +1 @@
1
- {"version":3,"file":"FileCollection.d.ts","sourceRoot":"","sources":["../../../src/components/mediaCollection/FileCollection.tsx"],"names":[],"mappings":"AAcA,QAAA,MAAM,cAAc,+CAqGnB,CAAC;AAEF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"FileCollection.d.ts","sourceRoot":"","sources":["../../../src/components/mediaCollection/FileCollection.tsx"],"names":[],"mappings":"AAaA,QAAA,MAAM,cAAc,+CAqGnB,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ImageCollection.d.ts","sourceRoot":"","sources":["../../../src/components/mediaCollection/ImageCollection.tsx"],"names":[],"mappings":"AAaA,QAAA,MAAM,eAAe,+CA+GpB,CAAC;AAEF,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"ImageCollection.d.ts","sourceRoot":"","sources":["../../../src/components/mediaCollection/ImageCollection.tsx"],"names":[],"mappings":"AAYA,QAAA,MAAM,eAAe,+CA+GpB,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"VideoCollection.d.ts","sourceRoot":"","sources":["../../../src/components/mediaCollection/VideoCollection.tsx"],"names":[],"mappings":"AAcA,QAAA,MAAM,eAAe,+CAyHpB,CAAC;AAEF,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"VideoCollection.d.ts","sourceRoot":"","sources":["../../../src/components/mediaCollection/VideoCollection.tsx"],"names":[],"mappings":"AAaA,QAAA,MAAM,eAAe,+CAyHpB,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -4,7 +4,6 @@ export declare enum MediaCollectionTabKey {
4
4
  File = "file",
5
5
  Link = "link"
6
6
  }
7
- export declare const TOP_OFFSET = 128;
8
7
  declare const MediaCollection: () => import("react/jsx-runtime").JSX.Element;
9
8
  export default MediaCollection;
10
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/mediaCollection/index.tsx"],"names":[],"mappings":"AAaA,oBAAY,qBAAqB;IAC/B,KAAK,UAAU;IACf,KAAK,UAAU;IACf,IAAI,SAAS;IACb,IAAI,SAAS;CACd;AAED,eAAO,MAAM,UAAU,MAAM,CAAC;AAE9B,QAAA,MAAM,eAAe,+CA8EpB,CAAC;AAEF,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/mediaCollection/index.tsx"],"names":[],"mappings":"AAaA,oBAAY,qBAAqB;IAC/B,KAAK,UAAU;IACf,KAAK,UAAU;IACf,IAAI,SAAS;IACb,IAAI,SAAS;CACd;AAED,QAAA,MAAM,eAAe,+CA8EpB,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -17,7 +17,6 @@ export var MediaCollectionTabKey;
17
17
  MediaCollectionTabKey["File"] = "file";
18
18
  MediaCollectionTabKey["Link"] = "link";
19
19
  })(MediaCollectionTabKey || (MediaCollectionTabKey = {}));
20
- export const TOP_OFFSET = 128; /// HEADER + TAB HEIGHT
21
20
  const MediaCollection = () => {
22
21
  const { t } = useTranslation();
23
22
  const [isOpen, { toggle }] = useBoolean(false);
@@ -1,6 +1,8 @@
1
1
  import { SessionStatus, SessionTag } from "../../types/chat";
2
+ import { ISessionByStatus } from "../../store/type";
2
3
  interface MessageHeaderProps {
3
4
  onClose?: () => void;
5
+ currentSession?: ISessionByStatus;
4
6
  }
5
7
  type SelectSessionValueType = SessionStatus | SessionTag;
6
8
  export interface SelectSessionOption {
@@ -10,6 +12,6 @@ export interface SelectSessionOption {
10
12
  tintColorClassnameBg: string;
11
13
  bgTintColorClassname: string;
12
14
  }
13
- declare const MessageHeader: ({ onClose }: MessageHeaderProps) => import("react/jsx-runtime").JSX.Element;
15
+ declare const MessageHeader: ({ onClose, currentSession }: MessageHeaderProps) => import("react/jsx-runtime").JSX.Element;
14
16
  export default MessageHeader;
15
17
  //# sourceMappingURL=MessageHeader.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"MessageHeader.d.ts","sourceRoot":"","sources":["../../../src/components/message/MessageHeader.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAQ7D,UAAU,kBAAkB;IAC1B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,KAAK,sBAAsB,GAAG,aAAa,GAAG,UAAU,CAAC;AAEzD,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,sBAAsB,CAAC;IAC9B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,oBAAoB,EAAE,MAAM,CAAC;CAC9B;AAED,QAAA,MAAM,aAAa,GAAI,aAAa,kBAAkB,4CA2LrD,CAAC;AAEF,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"MessageHeader.d.ts","sourceRoot":"","sources":["../../../src/components/message/MessageHeader.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAG7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAGpD,UAAU,kBAAkB;IAC1B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,cAAc,CAAC,EAAE,gBAAgB,CAAC;CACnC;AAED,KAAK,sBAAsB,GAAG,aAAa,GAAG,UAAU,CAAC;AAEzD,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,sBAAsB,CAAC;IAC9B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,oBAAoB,EAAE,MAAM,CAAC;CAC9B;AAED,QAAA,MAAM,aAAa,GAAI,6BAA6B,kBAAkB,4CAkKrE,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -5,32 +5,21 @@ import { Icon } from "../icon";
5
5
  import { useConversationDisplayData } from "../../hooks/conversation/useConversation";
6
6
  import useConversationStore from "../../store/conversation";
7
7
  import MediaCollection from "../mediaCollection";
8
- import { useGetSession } from "../../hooks/session/useGetSession";
9
8
  import { useEffect, useMemo, useState } from "react";
10
9
  import { useTranslation } from "react-i18next";
11
10
  import { SessionStatus, SessionTag } from "../../types/chat";
12
11
  import SelectSession from "./SelectSession";
13
12
  import { useUpdateSession } from "../../hooks/session/useUpdateSession";
14
- import emitter from "../../utils/events";
15
- import { useChatContext } from "../../context/ChatContext";
16
- import { adminUserId } from "../../constants";
17
- const MessageHeader = ({ onClose }) => {
13
+ import useAuthStore from "../../store/auth";
14
+ const MessageHeader = ({ onClose, currentSession }) => {
18
15
  var _a;
19
16
  const { t } = useTranslation();
20
- const { user } = useChatContext();
17
+ const isCx = useAuthStore((state) => state.isCx);
21
18
  const conversationData = useConversationStore((state) => state.conversationData);
22
- const { dataFlatten: sessions, refetch: refetchSession } = useGetSession({
23
- conversationIds: (conversationData === null || conversationData === void 0 ? void 0 : conversationData.conversationID)
24
- ? [conversationData.conversationID]
25
- : [],
26
- });
27
19
  const { mutate: updateSession } = useUpdateSession();
28
20
  const { avatar, displayName } = useConversationDisplayData(conversationData);
29
21
  const [currentSessionStatus, setCurrentSessionStatus] = useState(SessionStatus.UNASSIGNED);
30
22
  const [currentSessionTag, setCurrentSessionTag] = useState(SessionTag.NONE);
31
- const currentSession = useMemo(() => {
32
- return sessions === null || sessions === void 0 ? void 0 : sessions.find((session) => session.conversationId === (conversationData === null || conversationData === void 0 ? void 0 : conversationData.conversationID));
33
- }, [sessions, conversationData]);
34
23
  const statusOptions = useMemo(() => {
35
24
  return [
36
25
  {
@@ -116,19 +105,6 @@ const MessageHeader = ({ onClose }) => {
116
105
  setCurrentSessionStatus(currentSession.status);
117
106
  }
118
107
  }, [currentSession]);
119
- useEffect(() => {
120
- emitter.on("UPDATE_SESSION", (sessionUpdated) => {
121
- if (sessionUpdated.conversationId === (conversationData === null || conversationData === void 0 ? void 0 : conversationData.conversationID)) {
122
- refetchSession();
123
- }
124
- });
125
- return () => {
126
- emitter.off("UPDATE_SESSION", () => {
127
- refetchSession();
128
- });
129
- };
130
- }, [conversationData === null || conversationData === void 0 ? void 0 : conversationData.conversationID]);
131
- return (_jsxs("div", { className: "px-4 py-3 flex items-center border-b gap-3 bg-white no-transform", children: [_jsx(Avatar, { src: avatar, size: "large", children: ((_a = displayName === null || displayName === void 0 ? void 0 : displayName.charAt) === null || _a === void 0 ? void 0 : _a.call(displayName, 0)) || "A" }), _jsxs("div", { className: "flex flex-col", children: [_jsx("p", { className: "text-base truncate", children: displayName || "" }), _jsx("p", { className: "text-xs text-gray-500", children: "2 thành viên" })] }), _jsxs("div", { className: "flex items-center gap-2 flex-1 justify-end", children: [currentSessionTag !== SessionTag.NONE &&
132
- (user === null || user === void 0 ? void 0 : user.userID) === adminUserId && (_jsx(SelectSession, { options: tagOptions, value: currentSessionTag, onChange: (value) => handleUpdateSession(value, "tag") })), (user === null || user === void 0 ? void 0 : user.userID) === adminUserId && (_jsx(SelectSession, { options: statusOptions, value: currentSessionStatus, onChange: (value) => handleUpdateSession(value, "status") })), _jsx(Button, { type: "text", shape: "default", className: "text-gray-500 w-8 h-8 p-0", children: _jsx(Icon, { icon: "search-o", size: 22 }) }), _jsx(MediaCollection, {}), _jsx(Button, { type: "text", shape: "default", className: "text-gray-500 w-8 h-8 p-0", children: _jsx(Icon, { icon: "align-justify-o", size: 22 }) }), !!onClose && (_jsx(Button, { type: "text", shape: "default", className: "text-gray-500 w-8 h-8 p-0", onClick: onClose, children: _jsx(Icon, { icon: "close-b", size: 22 }) }))] })] }));
108
+ return (_jsxs("div", { className: "px-4 py-3 flex items-center border-b gap-3 bg-white no-transform", children: [_jsx(Avatar, { src: avatar, size: "large", className: "min-w-10 min-h-10", children: ((_a = displayName === null || displayName === void 0 ? void 0 : displayName.charAt) === null || _a === void 0 ? void 0 : _a.call(displayName, 0)) || "A" }), _jsxs("div", { className: "flex flex-col overflow-hidden flex-1", children: [_jsx("p", { className: "text-base truncate", children: displayName || "" }), _jsx("p", { className: "text-xs text-gray-500 truncate", children: "2 thành viên" })] }), _jsxs("div", { className: "flex items-center gap-2 justify-end overflow-hidden", children: [isCx && (_jsx(SelectSession, { options: tagOptions, value: currentSessionTag, onChange: (value) => handleUpdateSession(value, "tag") })), isCx && (_jsx(SelectSession, { options: statusOptions, value: currentSessionStatus, onChange: (value) => handleUpdateSession(value, "status") })), _jsx(Button, { type: "text", shape: "default", className: "text-gray-500 w-8 h-8 p-0", children: _jsx(Icon, { icon: "search-o", size: 22 }) }), _jsx(MediaCollection, {}), _jsx(Button, { type: "text", shape: "default", className: "text-gray-500 w-8 h-8 p-0", children: _jsx(Icon, { icon: "align-justify-o", size: 22 }) }), !!onClose && (_jsx(Button, { type: "text", shape: "default", className: "text-gray-500 w-8 h-8 p-0", onClick: onClose, children: _jsx(Icon, { icon: "close-b", size: 22 }) }))] })] }));
133
109
  };
134
110
  export default MessageHeader;
@@ -1 +1 @@
1
- {"version":3,"file":"MessageList.d.ts","sourceRoot":"","sources":["../../../src/components/message/MessageList.tsx"],"names":[],"mappings":"AAsBA,UAAU,gBAAgB;IACxB,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAGD,QAAA,MAAM,WAAW,GAAI,OAAO,gBAAgB,4CA0K3C,CAAC;AAEF,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"MessageList.d.ts","sourceRoot":"","sources":["../../../src/components/message/MessageList.tsx"],"names":[],"mappings":"AAwBA,UAAU,gBAAgB;IACxB,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAGD,QAAA,MAAM,WAAW,GAAI,OAAO,gBAAgB,4CAmM3C,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -2,7 +2,7 @@
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { useMessage } from "../../hooks/message/useMessage";
4
4
  import { Empty, Spin } from "antd";
5
- import { useEffect, useRef } from "react";
5
+ import { useEffect, useMemo, useRef } from "react";
6
6
  import dayjs from "dayjs";
7
7
  import isToday from "dayjs/plugin/isToday";
8
8
  import emitter from "../../utils/events";
@@ -18,6 +18,7 @@ import { useDebounceFn } from "ahooks";
18
18
  import { MSG_ITEM_CONTENT_PREFIX, MSG_ITEM_PREFIX } from "../../constants";
19
19
  import { markConversationMessageAsRead } from "../../hooks/conversation/useConversation";
20
20
  import { useChatContext } from "../../context/ChatContext";
21
+ import { useGetSession } from "../../hooks/session/useGetSession";
21
22
  dayjs.extend(isToday);
22
23
  const BOTTOM_THRESHOLD = -5;
23
24
  const MessageList = (props) => {
@@ -28,6 +29,14 @@ const MessageList = (props) => {
28
29
  const scrollRef = useRef(null);
29
30
  const { getMoreOldMessages, moreOldLoading, loadState, getMoreNewMessages, moreNewLoading, latestLoadState, } = useMessage(conversationId, searchClientMsgID);
30
31
  const conversationData = useConversationStore((state) => state.conversationData);
32
+ const { dataFlatten: sessions, refetch: refetchSession } = useGetSession({
33
+ filter: {
34
+ conversationIds: !!conversationId ? [conversationId] : [],
35
+ },
36
+ });
37
+ const currentSession = useMemo(() => {
38
+ return sessions === null || sessions === void 0 ? void 0 : sessions.find((session) => session.conversationId === conversationId);
39
+ }, [sessions, conversationId]);
31
40
  const handleMarkConversationMessageAsRead = () => {
32
41
  var _a, _b, _c;
33
42
  const lastMessage = (_b = (_a = latestLoadState === null || latestLoadState === void 0 ? void 0 : latestLoadState.current) === null || _a === void 0 ? void 0 : _a.messageList) === null || _b === void 0 ? void 0 : _b[0];
@@ -91,6 +100,18 @@ const MessageList = (props) => {
91
100
  emitter.off("CHAT_LIST_SCROLL_TO_MESSAGE", scrollToMessage);
92
101
  };
93
102
  }, []);
103
+ useEffect(() => {
104
+ emitter.on("UPDATE_SESSION", (sessionUpdated) => {
105
+ if (sessionUpdated.conversationId === conversationId) {
106
+ refetchSession();
107
+ }
108
+ });
109
+ return () => {
110
+ emitter.off("UPDATE_SESSION", () => {
111
+ refetchSession();
112
+ });
113
+ };
114
+ }, [conversationId]);
94
115
  if (!conversationData) {
95
116
  return (_jsx("div", { className: "flex flex-1 items-center justify-center h-full", children: _jsx(Empty, { description: t("no_conversation_data") }) }));
96
117
  }
@@ -98,9 +119,10 @@ const MessageList = (props) => {
98
119
  backgroundImage: `url(${images.conversationBg})`,
99
120
  backgroundSize: "cover",
100
121
  backgroundPosition: "center",
101
- }, children: [_jsx(MessageHeader, { onClose: onClose }), _jsx("div", { id: "scrollableMessagesDiv", ref: scrollRef, style: {
122
+ }, children: [_jsx(MessageHeader, { onClose: onClose, currentSession: currentSession }), _jsx("div", { id: "scrollableMessagesDiv", ref: scrollRef, style: {
102
123
  height: "100%",
103
- overflow: "auto",
124
+ overflowY: "auto",
125
+ overflowX: "hidden",
104
126
  display: "flex",
105
127
  flexDirection: "column-reverse",
106
128
  paddingBottom: 12,
@@ -110,6 +132,6 @@ const MessageList = (props) => {
110
132
  handleMarkConversationMessageAsRead();
111
133
  loadMoreNewMessage();
112
134
  }
113
- }, children: loadState.messageList.map((message, _, array) => (_jsx(MessageItem, { message: message, allMessages: array }, message.clientMsgID))) }) }), moreNewLoading && (_jsx("div", { className: "flex items-center justify-center py-2", children: _jsx(Spin, {}) })), _jsx(MessageFooter, {})] }));
135
+ }, children: loadState.messageList.map((message, _, array) => (_jsx(MessageItem, { message: message, allMessages: array }, message.clientMsgID))) }) }), moreNewLoading && (_jsx("div", { className: "flex items-center justify-center py-2", children: _jsx(Spin, {}) })), _jsx(MessageFooter, { currentSession: currentSession })] }));
114
136
  };
115
137
  export default MessageList;
@@ -1 +1 @@
1
- {"version":3,"file":"ActionBar.d.ts","sourceRoot":"","sources":["../../../../src/components/message/footer/ActionBar.tsx"],"names":[],"mappings":"AAgEA,QAAA,MAAM,SAAS,+CAiOd,CAAC;AAEF,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"ActionBar.d.ts","sourceRoot":"","sources":["../../../../src/components/message/footer/ActionBar.tsx"],"names":[],"mappings":"AAkFA,QAAA,MAAM,SAAS,+CAyPd,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -16,13 +16,16 @@ const documentTypes = [
16
16
  "application/msword",
17
17
  "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
18
18
  ];
19
- const EmojiIcon = (_jsxs("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("path", { d: "M14 8.39997C14 8.8418 13.6418 9.19997 13.2 9.19997C12.7581 9.19997 12.4 8.8418 12.4 8.39997C12.4 7.95814 12.7581 7.59997 13.2 7.59997C13.6418 7.59997 14 7.95814 14 8.39997Z", fill: "white" }), _jsx("path", { d: "M7.59997 8.39997C7.59997 8.8418 7.2418 9.19997 6.79997 9.19997C6.35814 9.19997 5.99997 8.8418 5.99997 8.39997C5.99997 7.95814 6.35814 7.59997 6.79997 7.59997C7.2418 7.59997 7.59997 7.95814 7.59997 8.39997Z", fill: "white" }), _jsx("path", { d: "M7.59997 12.4C7.59997 12.4 8.49997 13.2 9.99997 13.2C11.5 13.2 12.4 12.4 12.4 12.4M14 8.39997C14 8.8418 13.6418 9.19997 13.2 9.19997C12.7581 9.19997 12.4 8.8418 12.4 8.39997C12.4 7.95814 12.7581 7.59997 13.2 7.59997C13.6418 7.59997 14 7.95814 14 8.39997ZM18 9.99997C18 14.4182 14.4182 18 9.99997 18C5.58169 18 1.99997 14.4182 1.99997 9.99997C1.99997 5.58169 5.58169 1.99997 9.99997 1.99997C14.4182 1.99997 18 5.58169 18 9.99997ZM7.59997 8.39997C7.59997 8.8418 7.2418 9.19997 6.79997 9.19997C6.35814 9.19997 5.99997 8.8418 5.99997 8.39997C5.99997 7.95814 6.35814 7.59997 6.79997 7.59997C7.2418 7.59997 7.59997 7.95814 7.59997 8.39997Z", stroke: "currentColor", "stroke-width": "1.5", "stroke-linecap": "round", "stroke-linejoin": "round" })] }));
19
+ const EmojiIcon = (_jsxs("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("path", { d: "M14 8.39997C14 8.8418 13.6418 9.19997 13.2 9.19997C12.7581 9.19997 12.4 8.8418 12.4 8.39997C12.4 7.95814 12.7581 7.59997 13.2 7.59997C13.6418 7.59997 14 7.95814 14 8.39997Z", fill: "white" }), _jsx("path", { d: "M7.59997 8.39997C7.59997 8.8418 7.2418 9.19997 6.79997 9.19997C6.35814 9.19997 5.99997 8.8418 5.99997 8.39997C5.99997 7.95814 6.35814 7.59997 6.79997 7.59997C7.2418 7.59997 7.59997 7.95814 7.59997 8.39997Z", fill: "white" }), _jsx("path", { d: "M7.59997 12.4C7.59997 12.4 8.49997 13.2 9.99997 13.2C11.5 13.2 12.4 12.4 12.4 12.4M14 8.39997C14 8.8418 13.6418 9.19997 13.2 9.19997C12.7581 9.19997 12.4 8.8418 12.4 8.39997C12.4 7.95814 12.7581 7.59997 13.2 7.59997C13.6418 7.59997 14 7.95814 14 8.39997ZM18 9.99997C18 14.4182 14.4182 18 9.99997 18C5.58169 18 1.99997 14.4182 1.99997 9.99997C1.99997 5.58169 5.58169 1.99997 9.99997 1.99997C14.4182 1.99997 18 5.58169 18 9.99997ZM7.59997 8.39997C7.59997 8.8418 7.2418 9.19997 6.79997 9.19997C6.35814 9.19997 5.99997 8.8418 5.99997 8.39997C5.99997 7.95814 6.35814 7.59997 6.79997 7.59997C7.2418 7.59997 7.59997 7.95814 7.59997 8.39997Z", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })] }));
20
+ const AttachIcon = (_jsx("svg", { width: "22", height: "22", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M15.6 10.0001V11.2001C15.6 14.5137 12.9137 17.2001 9.59998 17.2001C6.28626 17.2001 3.59998 14.5137 3.59998 11.2001V6.79999C3.59998 4.59085 5.39084 2.79999 7.59998 2.79999C9.8091 2.79999 11.6 4.59085 11.6 6.79999V11.2C11.6 12.3045 10.7045 13.2 9.59998 13.2C8.49542 13.2 7.59998 12.3045 7.59998 11.2V7.99999", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }));
20
21
  const ActionBar = () => {
21
22
  const [editor] = useLexicalComposerContext();
22
23
  const { onSendMessage, setListUploadFiles } = useMessageFooterContext();
23
24
  const containerRef = useRef(null);
24
25
  const [showEmojiPicker, setShowEmojiPicker] = useState(false);
25
26
  const { listUploadFiles } = useMessageFooterContext();
27
+ const [isEmptyInput, setIsEmptyInput] = useState(true);
28
+ const canSend = !isEmptyInput || listUploadFiles.length > 0;
26
29
  const handleSend = useCallback(() => {
27
30
  let plainText = "";
28
31
  let richText = "";
@@ -90,25 +93,29 @@ const ActionBar = () => {
90
93
  file.type === "image/png" ||
91
94
  file.type === "image/jpg";
92
95
  const isVideo = file.type.startsWith("video/");
96
+ const maxSize = isVideo ? 200 : 5; // MB
97
+ const isErrorSize = file.size / 1024 / 1024 > maxSize;
93
98
  // check format
94
- if (!isImage && !isVideo) {
95
- message.error(`${file.name} không đúng định dạng JPG, JPEG, PNG hoặc VIDEO`);
99
+ if ((!isImage && !isVideo) || isErrorSize) {
100
+ if (!isImage && !isVideo) {
101
+ message.error(`${file.name} không đúng định dạng JPG, JPEG, PNG hoặc VIDEO`);
102
+ }
103
+ if (isErrorSize) {
104
+ if (isVideo) {
105
+ message.error(`Tệp không được vượt quá ${maxSize}MB`);
106
+ }
107
+ if (isImage) {
108
+ message.error(`${file.name} có kích thước tập tin vượt quá ${maxSize}MB`);
109
+ }
110
+ }
96
111
  return Upload.LIST_IGNORE;
97
112
  }
98
- // check size
99
- const maxSize = isImage ? 5 : 200; // MB
100
- if (file.size / 1024 / 1024 > maxSize) {
101
- message.error(`${file.name} kích thước tập tin vượt quá ${maxSize}MB`);
113
+ const newVideos = fileList.filter((f) => { var _a; return (_a = f.type) === null || _a === void 0 ? void 0 : _a.startsWith("video/"); });
114
+ const currentVideos = listUploadFiles.filter((f) => { var _a; return (_a = f.type) === null || _a === void 0 ? void 0 : _a.startsWith("video/"); });
115
+ if (newVideos.length > 1 || currentVideos.length + newVideos.length > 1) {
116
+ message.error("Chỉ được phép tải lên 1 video duy nhất");
102
117
  return Upload.LIST_IGNORE;
103
118
  }
104
- // nếu là video thì chỉ cho 1 cái duy nhất
105
- if (isVideo) {
106
- const hasVideo = listUploadFiles.some((f) => { var _a; return (_a = f.type) === null || _a === void 0 ? void 0 : _a.startsWith("video/"); });
107
- if (hasVideo) {
108
- message.error("Chỉ được phép tải lên 1 video duy nhất");
109
- return Upload.LIST_IGNORE;
110
- }
111
- }
112
119
  return false;
113
120
  };
114
121
  const beforeUploadFile = (file) => {
@@ -140,6 +147,15 @@ const ActionBar = () => {
140
147
  document.addEventListener("mousedown", handleClickOutside);
141
148
  return () => document.removeEventListener("mousedown", handleClickOutside);
142
149
  }, []);
143
- return (_jsxs("div", { className: "flex items-center justify-between px-4", ref: containerRef, children: [_jsxs("div", { className: "flex items-center gap-3 relative", children: [_jsx(Button, { type: "text", shape: "default", className: clsx("text-gray-500 w-8 h-8 p-0", showEmojiPicker ? "bg-blue-100 text-blue-600" : "text-gray-500"), onClick: () => setShowEmojiPicker(!showEmojiPicker), children: EmojiIcon }), _jsx(Upload, { accept: "image/jpeg, image/png, image/jpg, video/*", beforeUpload: beforeUploadImagesAndVideo, multiple: true, onChange: handleChange, showUploadList: false, fileList: listUploadFiles, children: _jsx(Button, { type: "text", shape: "default", className: "text-gray-500 w-8 h-8 p-0 text-gray-500", children: _jsx(Icon, { icon: "image-02-o", size: 22 }) }) }), _jsx(Upload, { accept: ".doc,.docx,.pdf", beforeUpload: beforeUploadFile, onChange: handleChange, showUploadList: false, fileList: listUploadFiles, children: _jsx(Button, { type: "text", shape: "default", className: "text-gray-500 w-8 h-8 p-0 text-gray-500", children: _jsx(Icon, { icon: "link-o", size: 22 }) }) }), showEmojiPicker && (_jsx(EmojiPicker, { onEmojiSelect: handleEmojiSelect, onClose: () => setShowEmojiPicker(false) }))] }), _jsx(Button, { type: "text", shape: "default", className: "text-gray-500 w-8 h-8 p-0", onClick: handleSend, children: _jsx(Icon, { icon: "send-b", size: 28, className: "text-blue-500" }) })] }));
150
+ useEffect(() => {
151
+ return editor.registerUpdateListener(({ editorState }) => {
152
+ editorState.read(() => {
153
+ const root = $getRoot();
154
+ const textContent = root.getTextContent().trim();
155
+ setIsEmptyInput(textContent.length <= 0);
156
+ });
157
+ });
158
+ }, [editor]);
159
+ return (_jsxs("div", { className: "flex items-center justify-between px-4", ref: containerRef, children: [_jsxs("div", { className: "flex items-center gap-3 relative", children: [_jsx(Button, { type: "text", shape: "default", className: clsx("text-gray-500 w-8 h-8 p-0", showEmojiPicker ? "bg-blue-100 text-blue-600" : "text-gray-500"), onClick: () => setShowEmojiPicker(!showEmojiPicker), children: EmojiIcon }), _jsx(Upload, { accept: "image/jpeg, image/png, image/jpg, video/*", beforeUpload: beforeUploadImagesAndVideo, multiple: true, onChange: handleChange, showUploadList: false, fileList: listUploadFiles, children: _jsx(Button, { type: "text", shape: "default", className: "text-gray-500 w-8 h-8 p-0 text-gray-500", children: _jsx(Icon, { icon: "image-02-o", size: 22 }) }) }), _jsx(Upload, { accept: ".doc,.docx,.pdf", beforeUpload: beforeUploadFile, onChange: handleChange, showUploadList: false, fileList: listUploadFiles, children: _jsx(Button, { type: "text", shape: "default", className: "text-gray-500 w-8 h-8 p-0 text-gray-500", children: AttachIcon }) }), showEmojiPicker && (_jsx(EmojiPicker, { onEmojiSelect: handleEmojiSelect, onClose: () => setShowEmojiPicker(false) }))] }), _jsx(Button, { type: "text", shape: "default", className: "text-gray-500 w-8 h-8 p-0", onClick: handleSend, disabled: !canSend, children: _jsx(Icon, { icon: "send-b", size: 28, className: `${canSend ? "text-blue-500" : "text-gray-400"}` }) })] }));
144
160
  };
145
161
  export default ActionBar;
@@ -26,6 +26,7 @@ export const shortenFileName = (name, options = {}) => {
26
26
  return `${start}...${end}${ext}`;
27
27
  };
28
28
  const FilePreview = () => {
29
+ var _a;
29
30
  const { listUploadFiles, setListUploadFiles } = useMessageFooterContext();
30
31
  const onRemoveFile = (file) => {
31
32
  setListUploadFiles(listUploadFiles.filter((f) => f.uid !== file.uid));
@@ -43,6 +44,6 @@ const FilePreview = () => {
43
44
  }
44
45
  return (_jsxs("div", { className: "relative rounded-md border", children: [isVideo ? (_jsx("video", { src: src, className: "w-[48px] h-[48px] object-cover rounded-lg", autoPlay: false })) : (_jsx("img", { src: src, alt: file.name, className: "w-[48px] h-[48px] object-cover rounded-lg" })), _jsx(Button, { className: "absolute top-[-8px] right-[-8px] w-5 h-5 rounded-full p-0 bg-gray-500 hover:bg-gray-600", type: "primary", onClick: () => onRemoveFile(file), children: _jsx(Icon, { icon: "close-b", size: 12, color: "white" }) }), isVideo && (_jsx(Icon, { className: "absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2", icon: "play-b", size: 20, color: "white" }))] }, file.uid));
45
46
  }, [listUploadFiles]);
46
- return (_jsx("div", { className: "overflow-x-auto mb-[-4px]", children: _jsx("div", { className: "border-b py-2 px-4", children: _jsx("div", { className: "flex items-center gap-2", children: listUploadFiles.map((file) => renderFilePreview(file)) }) }) }));
47
+ return (_jsx("div", { className: "overflow-x-auto mb-[-4px]", children: _jsx("div", { className: "border-b py-2 px-4", children: _jsx("div", { className: "flex items-center gap-2", children: (_a = listUploadFiles === null || listUploadFiles === void 0 ? void 0 : listUploadFiles.map) === null || _a === void 0 ? void 0 : _a.call(listUploadFiles, (file) => renderFilePreview(file)) }) }) }));
47
48
  };
48
49
  export default FilePreview;
@@ -8,7 +8,7 @@ import { TOGGLE_LINK_COMMAND } from "@lexical/link";
8
8
  import { useCallback, useEffect, useMemo, useState } from "react";
9
9
  import { BoldOutlined, ItalicOutlined, StrikethroughOutlined, OrderedListOutlined, UnorderedListOutlined, } from "@ant-design/icons";
10
10
  import { Button } from "antd";
11
- const quoteIcon = (_jsxs("svg", { width: "16", height: "16", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("path", { d: "M5.24615 10.5714C4.5616 10.5714 3.99078 10.5715 3.53762 10.5105C3.0593 10.4462 2.62745 10.3047 2.28042 9.95769C1.9334 9.61072 1.79194 9.17887 1.72763 8.70055C1.6667 8.24737 1.66673 7.67654 1.66675 6.99199V6.91274C1.66673 6.22819 1.6667 5.65734 1.72763 5.20419C1.79194 4.72586 1.9334 4.29401 2.28043 3.94699C2.62746 3.59997 3.0593 3.4585 3.53762 3.3942C3.99078 3.33327 4.56161 3.33329 5.24615 3.33331H5.32541C6.00995 3.33329 6.5808 3.33327 7.03397 3.3942C7.51228 3.4585 7.94413 3.59997 8.29116 3.94699C8.63817 4.29401 8.77966 4.72586 8.84396 5.20419C8.90491 5.65734 8.90484 6.22817 8.90484 6.91272V6.99198C8.90484 7.67652 8.90491 8.24737 8.84396 8.70055C8.77966 9.17887 8.63817 9.61072 8.29116 9.95769C7.94413 10.3047 7.51228 10.4462 7.03397 10.5105C6.5808 10.5715 6.00998 10.5714 5.32544 10.5714H5.24615Z", fill: "currentColor" }), _jsx("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M2.84403 16.1313C2.71884 15.7295 2.94301 15.3023 3.34474 15.1772C5.71249 14.4393 7.38095 12.3426 7.38095 9.914V6.76172C7.38095 6.34094 7.72207 5.99982 8.14286 5.99982C8.56366 5.99982 8.90476 6.34094 8.90476 6.76172V9.914C8.90476 13.0731 6.73976 15.7152 3.79812 16.6319C3.39638 16.7572 2.96923 16.533 2.84403 16.1313Z", fill: "currentColor" }), _jsx("path", { d: "M14.389 10.5714C13.7044 10.5714 13.1336 10.5715 12.6804 10.5105C12.2021 10.4462 11.7703 10.3047 11.4233 9.95769C11.0762 9.61072 10.9348 9.17887 10.8704 8.70055C10.8095 8.24737 10.8096 7.67654 10.8096 6.99199V6.91274C10.8096 6.22819 10.8095 5.65734 10.8704 5.20419C10.9348 4.72586 11.0762 4.29401 11.4233 3.94699C11.7703 3.59997 12.2021 3.4585 12.6804 3.3942C13.1336 3.33327 13.7044 3.33329 14.389 3.33331H14.4682C15.1528 3.33329 15.7236 3.33327 16.1768 3.3942C16.6551 3.4585 17.087 3.59997 17.4339 3.94699C17.781 4.29401 17.9225 4.72586 17.9868 5.20419C18.0477 5.65734 18.0477 6.22817 18.0477 6.91272V6.99198C18.0477 7.67652 18.0477 8.24737 17.9868 8.70055C17.9225 9.17887 17.781 9.61072 17.4339 9.95769C17.087 10.3047 16.6551 10.4462 16.1768 10.5105C15.7236 10.5715 15.1528 10.5714 14.4682 10.5714H14.389Z", fill: "currentColor" }), _jsx("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M11.9869 16.1313C11.8617 15.7295 12.0858 15.3023 12.4876 15.1772C14.8553 14.4393 16.5238 12.3426 16.5238 9.914V6.76172C16.5238 6.34094 16.8649 5.99982 17.2857 5.99982C17.7065 5.99982 18.0476 6.34094 18.0476 6.76172V9.914C18.0476 13.0731 15.8825 15.7152 12.9409 16.6319C12.5392 16.7572 12.112 16.533 11.9869 16.1313Z", fill: "currentColor" })] }));
11
+ const quoteIcon = (_jsxs("svg", { width: "16", height: "16", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("path", { d: "M5.24615 10.5714C4.5616 10.5714 3.99078 10.5715 3.53762 10.5105C3.0593 10.4462 2.62745 10.3047 2.28042 9.95769C1.9334 9.61072 1.79194 9.17887 1.72763 8.70055C1.6667 8.24737 1.66673 7.67654 1.66675 6.99199V6.91274C1.66673 6.22819 1.6667 5.65734 1.72763 5.20419C1.79194 4.72586 1.9334 4.29401 2.28043 3.94699C2.62746 3.59997 3.0593 3.4585 3.53762 3.3942C3.99078 3.33327 4.56161 3.33329 5.24615 3.33331H5.32541C6.00995 3.33329 6.5808 3.33327 7.03397 3.3942C7.51228 3.4585 7.94413 3.59997 8.29116 3.94699C8.63817 4.29401 8.77966 4.72586 8.84396 5.20419C8.90491 5.65734 8.90484 6.22817 8.90484 6.91272V6.99198C8.90484 7.67652 8.90491 8.24737 8.84396 8.70055C8.77966 9.17887 8.63817 9.61072 8.29116 9.95769C7.94413 10.3047 7.51228 10.4462 7.03397 10.5105C6.5808 10.5715 6.00998 10.5714 5.32544 10.5714H5.24615Z", fill: "currentColor" }), _jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M2.84403 16.1313C2.71884 15.7295 2.94301 15.3023 3.34474 15.1772C5.71249 14.4393 7.38095 12.3426 7.38095 9.914V6.76172C7.38095 6.34094 7.72207 5.99982 8.14286 5.99982C8.56366 5.99982 8.90476 6.34094 8.90476 6.76172V9.914C8.90476 13.0731 6.73976 15.7152 3.79812 16.6319C3.39638 16.7572 2.96923 16.533 2.84403 16.1313Z", fill: "currentColor" }), _jsx("path", { d: "M14.389 10.5714C13.7044 10.5714 13.1336 10.5715 12.6804 10.5105C12.2021 10.4462 11.7703 10.3047 11.4233 9.95769C11.0762 9.61072 10.9348 9.17887 10.8704 8.70055C10.8095 8.24737 10.8096 7.67654 10.8096 6.99199V6.91274C10.8096 6.22819 10.8095 5.65734 10.8704 5.20419C10.9348 4.72586 11.0762 4.29401 11.4233 3.94699C11.7703 3.59997 12.2021 3.4585 12.6804 3.3942C13.1336 3.33327 13.7044 3.33329 14.389 3.33331H14.4682C15.1528 3.33329 15.7236 3.33327 16.1768 3.3942C16.6551 3.4585 17.087 3.59997 17.4339 3.94699C17.781 4.29401 17.9225 4.72586 17.9868 5.20419C18.0477 5.65734 18.0477 6.22817 18.0477 6.91272V6.99198C18.0477 7.67652 18.0477 8.24737 17.9868 8.70055C17.9225 9.17887 17.781 9.61072 17.4339 9.95769C17.087 10.3047 16.6551 10.4462 16.1768 10.5105C15.7236 10.5715 15.1528 10.5714 14.4682 10.5714H14.389Z", fill: "currentColor" }), _jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M11.9869 16.1313C11.8617 15.7295 12.0858 15.3023 12.4876 15.1772C14.8553 14.4393 16.5238 12.3426 16.5238 9.914V6.76172C16.5238 6.34094 16.8649 5.99982 17.2857 5.99982C17.7065 5.99982 18.0476 6.34094 18.0476 6.76172V9.914C18.0476 13.0731 15.8825 15.7152 12.9409 16.6319C12.5392 16.7572 12.112 16.533 11.9869 16.1313Z", fill: "currentColor" })] }));
12
12
  export const ToolbarPlugin = () => {
13
13
  const [editor] = useLexicalComposerContext();
14
14
  const [activeMarks, setActiveMarks] = useState([]);
@@ -1,6 +1,10 @@
1
1
  import { MessageFooterContextType } from "../../../types/chat";
2
+ import { ISessionByStatus } from "../../../store/type";
3
+ interface MessageFooterProps {
4
+ currentSession?: ISessionByStatus;
5
+ }
2
6
  export declare const MessageFooterContext: import("react").Context<MessageFooterContextType>;
3
7
  export declare const useMessageFooterContext: () => MessageFooterContextType;
4
- declare const MessageFooterProvider: () => import("react/jsx-runtime").JSX.Element;
8
+ declare const MessageFooterProvider: ({ currentSession }: MessageFooterProps) => import("react/jsx-runtime").JSX.Element;
5
9
  export default MessageFooterProvider;
6
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/message/footer/index.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAmC/D,eAAO,MAAM,oBAAoB,mDAI/B,CAAC;AAEH,eAAO,MAAM,uBAAuB,gCAAyC,CAAC;AAE9E,QAAA,MAAM,qBAAqB,+CAuD1B,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/message/footer/index.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAK/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,UAAU,kBAAkB;IAC1B,cAAc,CAAC,EAAE,gBAAgB,CAAC;CACnC;AA+BD,eAAO,MAAM,oBAAoB,mDAI/B,CAAC;AAEH,eAAO,MAAM,uBAAuB,gCAAyC,CAAC;AAE9E,QAAA,MAAM,qBAAqB,GAAI,oBAAoB,kBAAkB,4CA4DpE,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
@@ -11,7 +11,7 @@ import { LinkNode } from "@lexical/link";
11
11
  import { HeadingNode, QuoteNode } from "@lexical/rich-text";
12
12
  import { ListItemNode, ListNode } from "@lexical/list";
13
13
  import { createContext, useCallback, useContext, useState } from "react";
14
- import EnterHandler from "./EnterHandler";
14
+ // import EnterHandler from "./EnterHandler";
15
15
  import ActionBar from "./ActionBar";
16
16
  import { useSendMessage } from "../../../hooks/message/useSendMessage";
17
17
  import FilePreview from "./FilePreview";
@@ -48,19 +48,24 @@ export const MessageFooterContext = createContext({
48
48
  setListUploadFiles: () => { },
49
49
  });
50
50
  export const useMessageFooterContext = () => useContext(MessageFooterContext);
51
- const MessageFooterProvider = () => {
51
+ const MessageFooterProvider = ({ currentSession }) => {
52
52
  const { t } = useTranslation();
53
53
  const { sendTextMessage, sendMergeMessage } = useSendMessage();
54
54
  const [listUploadFiles, setListUploadFiles] = useState([]);
55
55
  const onSendMessage = useCallback(async ({ plainText, richText, type, }) => {
56
56
  if (type === "text") {
57
- sendTextMessage({ plainText, richText });
57
+ sendTextMessage({ plainText, richText, currentSession });
58
58
  }
59
59
  else {
60
- sendMergeMessage({ plainText, richText, files: listUploadFiles });
60
+ sendMergeMessage({
61
+ plainText,
62
+ richText,
63
+ files: listUploadFiles,
64
+ currentSession,
65
+ });
61
66
  }
62
67
  setListUploadFiles([]);
63
- }, [sendMergeMessage, sendTextMessage, listUploadFiles]);
64
- return (_jsx(MessageFooterContext.Provider, { value: { onSendMessage, listUploadFiles, setListUploadFiles }, children: _jsxs(LexicalComposer, { initialConfig: initialConfig, children: [_jsxs("div", { className: "border-t pb-2 flex flex-col gap-1 bg-white", children: [listUploadFiles.length > 0 && _jsx(FilePreview, {}), _jsx(ToolbarPlugin, {}), _jsx("div", { className: "relative px-4", children: _jsx(RichTextPlugin, { contentEditable: _jsx(ContentEditable, { className: "border border-indigo-500 rounded-md bg-blue-100 min-h-[64px] max-h-[140px] overflow-y-auto px-3 py-2 text-sm" }), ErrorBoundary: LexicalErrorBoundary, "aria-placeholder": t("enter_message"), placeholder: _jsx("div", { className: "absolute top-2 left-7 pointer-events-none", children: _jsx("p", { className: "text-gray-500 text-sm", children: t("enter_message") }) }) }) }), _jsx(ActionBar, {})] }), _jsx(LinkPlugin, {}), _jsx(ListPlugin, {}), _jsx(EnterHandler, {})] }) }));
68
+ }, [sendMergeMessage, sendTextMessage, listUploadFiles, currentSession]);
69
+ return (_jsx(MessageFooterContext.Provider, { value: { onSendMessage, listUploadFiles, setListUploadFiles }, children: _jsxs(LexicalComposer, { initialConfig: initialConfig, children: [_jsxs("div", { className: "border-t pb-2 flex flex-col gap-1 bg-white", children: [listUploadFiles.length > 0 && _jsx(FilePreview, {}), _jsx(ToolbarPlugin, {}), _jsx("div", { className: "relative px-4", children: _jsx(RichTextPlugin, { contentEditable: _jsx(ContentEditable, { className: "border border-indigo-500 rounded-md bg-blue-100 min-h-[64px] max-h-[140px] overflow-y-auto px-3 py-2 text-sm" }), ErrorBoundary: LexicalErrorBoundary, "aria-placeholder": t("enter_message"), placeholder: _jsx("div", { className: "absolute top-2 left-7 pointer-events-none", children: _jsx("p", { className: "text-gray-500 text-sm", children: t("enter_message") }) }) }) }), _jsx(ActionBar, {})] }), _jsx(LinkPlugin, {}), _jsx(ListPlugin, {})] }) }));
65
70
  };
66
71
  export default MessageFooterProvider;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/message/item/index.tsx"],"names":[],"mappings":"AAIA,OAAO,EACL,WAAW,IAAI,eAAe,EAE/B,MAAM,yBAAyB,CAAC;AAYjC,UAAU,gBAAgB;IACxB,OAAO,EAAE,eAAe,CAAC;IACzB,WAAW,EAAE,eAAe,EAAE,CAAC;CAChC;AAID,QAAA,MAAM,WAAW,GAAI,0BAA0B,gBAAgB,mDAiH9D,CAAC;AAEF,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/message/item/index.tsx"],"names":[],"mappings":"AAIA,OAAO,EACL,WAAW,IAAI,eAAe,EAE/B,MAAM,yBAAyB,CAAC;AAajC,UAAU,gBAAgB;IACxB,OAAO,EAAE,eAAe,CAAC;IACzB,WAAW,EAAE,eAAe,EAAE,CAAC;CAChC;AAED,QAAA,MAAM,WAAW,GAAI,0BAA0B,gBAAgB,mDAmH9D,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -11,10 +11,11 @@ import VideoMessageItem from "./VideoMessage";
11
11
  import { getVisibleNeighbor, visibleTypeMessage, } from "../../../hooks/message/useMessage";
12
12
  import { MSG_ITEM_CONTENT_PREFIX, MSG_ITEM_PREFIX } from "../../../constants";
13
13
  import { formatTimestamp } from "../../../utils/common";
14
- const BREAK_TIME = 5;
14
+ import useAuthStore from "../../../store/auth";
15
15
  const MessageItem = ({ message, allMessages }) => {
16
16
  var _a, _b, _c, _d;
17
17
  const { user } = useChatContext();
18
+ const isCx = useAuthStore((state) => state.isCx);
18
19
  const isVisibleGroup = visibleTypeMessage.includes(message === null || message === void 0 ? void 0 : message.contentType);
19
20
  const renderMessageByType = (message) => {
20
21
  switch (message === null || message === void 0 ? void 0 : message.contentType) {
@@ -40,12 +41,13 @@ const MessageItem = ({ message, allMessages }) => {
40
41
  const prevSameUser = (previousMessage === null || previousMessage === void 0 ? void 0 : previousMessage.sendID) === (message === null || message === void 0 ? void 0 : message.sendID);
41
42
  const nextSameUser = (nextMessage === null || nextMessage === void 0 ? void 0 : nextMessage.sendID) === (message === null || message === void 0 ? void 0 : message.sendID);
42
43
  const prevTimeBreak = !previousMessage ||
43
- dayjs(message.sendTime).diff(previousMessage.sendTime, "minute") >
44
- BREAK_TIME;
44
+ !dayjs(message.sendTime).isSame(previousMessage.sendTime, "days");
45
45
  const showTimeBreak = prevTimeBreak;
46
46
  const showSenderAvatar = !nextSameUser;
47
47
  const showSenderName = !prevSameUser && !isMine;
48
- return (_jsxs("div", { className: "flex flex-col gap-2 py-1 px-3 sm:p x-4", id: `${MSG_ITEM_PREFIX}${message === null || message === void 0 ? void 0 : message.clientMsgID}`, children: [showTimeBreak && (_jsx("div", { className: "flex justify-center", children: _jsx("span", { className: "text-xs text-gray-600 text-center bg-neutral-100 px-2 py-1 rounded-full", children: formatTimestamp(message.sendTime) }) })), _jsx("div", { className: clsx("flex", isMine ? "justify-end" : "justify-start"), children: _jsxs("div", { className: clsx("flex flex-1 items-end gap-2", isMine ? "justify-end" : "justify-start"), children: [!isMine && (_jsx("div", { className: "flex items-center justify-center w-[32px] h-[32px]", children: showSenderAvatar && (_jsx(Avatar, { src: message === null || message === void 0 ? void 0 : message.senderFaceUrl, children: ((_b = (_a = message === null || message === void 0 ? void 0 : message.senderNickname) === null || _a === void 0 ? void 0 : _a.charAt) === null || _b === void 0 ? void 0 : _b.call(_a, 0)) || "A" })) })), _jsxs("div", { className: clsx("flex flex-col flex-[0.8]", isMine ? "items-end" : "items-start"), children: [showSenderName && (_jsx("span", { className: "text-xs text-gray-500 mb-1 px-3", children: message === null || message === void 0 ? void 0 : message.senderNickname })), _jsxs("div", { className: clsx("px-3 py-2 rounded-2xl max-w-full break-words flex flex-col flex-1 text-gray-900 gap-1", isMine ? "bg-blue-100" : "bg-white"), id: `${MSG_ITEM_CONTENT_PREFIX}${message === null || message === void 0 ? void 0 : message.clientMsgID}`, children: [(message === null || message === void 0 ? void 0 : message.contentType) === MessageType.MergeMessage ? (_jsxs("div", { children: [(_d = (_c = message === null || message === void 0 ? void 0 : message.mergeElem) === null || _c === void 0 ? void 0 : _c.multiMessage) === null || _d === void 0 ? void 0 : _d.map((item) => {
48
+ return (_jsxs("div", { className: "flex flex-col gap-2 py-1 px-3 sm:p x-4", id: `${MSG_ITEM_PREFIX}${message === null || message === void 0 ? void 0 : message.clientMsgID}`, children: [showTimeBreak && (_jsx("div", { className: "flex justify-center", children: _jsx("span", { className: "text-xs text-gray-600 text-center bg-neutral-100 px-2 py-1 rounded-full", children: formatTimestamp(message.sendTime, {
49
+ dateMonthFormat: "DD MMMM",
50
+ }) }) })), _jsx("div", { className: clsx("flex", isMine ? "justify-end" : "justify-start"), children: _jsxs("div", { className: clsx("flex flex-1 items-end gap-2", isMine ? "justify-end" : "justify-start"), children: [!isMine && (_jsx("div", { className: "flex items-center justify-center w-[32px] h-[32px]", children: showSenderAvatar && (_jsx(Avatar, { src: message === null || message === void 0 ? void 0 : message.senderFaceUrl, children: ((_b = (_a = message === null || message === void 0 ? void 0 : message.senderNickname) === null || _a === void 0 ? void 0 : _a.charAt) === null || _b === void 0 ? void 0 : _b.call(_a, 0)) || "A" })) })), _jsxs("div", { className: clsx("flex flex-col flex-[0.8]", isMine ? "items-end" : "items-start"), children: [showSenderName && (_jsx("span", { className: "text-xs text-gray-500 mb-1 px-3", children: message === null || message === void 0 ? void 0 : message.senderNickname })), _jsxs("div", { className: clsx("px-3 py-2 rounded-2xl max-w-full break-words flex flex-col flex-1 text-gray-900 gap-1", isMine ? "bg-blue-100" : "bg-white"), id: `${MSG_ITEM_CONTENT_PREFIX}${message === null || message === void 0 ? void 0 : message.clientMsgID}`, children: [(message === null || message === void 0 ? void 0 : message.contentType) === MessageType.MergeMessage ? (_jsxs("div", { children: [(_d = (_c = message === null || message === void 0 ? void 0 : message.mergeElem) === null || _c === void 0 ? void 0 : _c.multiMessage) === null || _d === void 0 ? void 0 : _d.map((item) => {
49
51
  return renderMessageByType(item);
50
52
  }), (message === null || message === void 0 ? void 0 : message.textElem) && _jsx(TextMessageItem, { message: message })] })) : (renderMessageByType(message)), _jsx("span", { className: clsx("text-xs text-gray-500 text-right text-gray-500"), children: dayjs(message === null || message === void 0 ? void 0 : message.sendTime).format("HH:mm") })] })] })] }) }, message === null || message === void 0 ? void 0 : message.clientMsgID)] }, message === null || message === void 0 ? void 0 : message.clientMsgID));
51
53
  };
@@ -18,8 +18,11 @@ const SearchConversationAll = ({ searchTerm = "", setActiveKey, }) => {
18
18
  options: { pageSize: 5 },
19
19
  });
20
20
  const { dataFlatten: sessions, isLoading: isLoadingSession, hasNextPage: hasNextPageSession, } = useGetSession({
21
- searchTerm: searchTerm.trim(),
22
- }, { pageSize: 5 });
21
+ filter: {
22
+ searchTerm: searchTerm.trim(),
23
+ },
24
+ options: { pageSize: 5 },
25
+ });
23
26
  if (searchTerm.trim() === "" ||
24
27
  (messages.length === 0 && sessions.length === 0)) {
25
28
  return (_jsx("div", { className: "h-full overflow-auto", children: _jsx(Empty, { description: t("no_conversation") }) }));
@@ -1 +1 @@
1
- {"version":3,"file":"SearchConversationAsUsers.d.ts","sourceRoot":"","sources":["../../../src/components/searchConversation/SearchConversationAsUsers.tsx"],"names":[],"mappings":"AAMA,UAAU,8BAA8B;IACtC,UAAU,EAAE,MAAM,CAAC;CACpB;AACD,QAAA,MAAM,yBAAyB,GAAI,OAAO,8BAA8B,4CAkCvE,CAAC;AAEF,eAAe,yBAAyB,CAAC"}
1
+ {"version":3,"file":"SearchConversationAsUsers.d.ts","sourceRoot":"","sources":["../../../src/components/searchConversation/SearchConversationAsUsers.tsx"],"names":[],"mappings":"AAMA,UAAU,8BAA8B;IACtC,UAAU,EAAE,MAAM,CAAC;CACpB;AACD,QAAA,MAAM,yBAAyB,GAAI,OAAO,8BAA8B,4CAoCvE,CAAC;AAEF,eAAe,yBAAyB,CAAC"}
@@ -8,7 +8,9 @@ const SearchConversationAsUsers = (props) => {
8
8
  const { searchTerm = "" } = props;
9
9
  const { t } = useTranslation();
10
10
  const { dataFlatten, hasNextPage, fetchNextPage, isLoading } = useGetSession({
11
- searchTerm: searchTerm.trim(),
11
+ filter: {
12
+ searchTerm: searchTerm.trim(),
13
+ },
12
14
  });
13
15
  if ((dataFlatten.length === 0 && !isLoading) || searchTerm.trim() === "")
14
16
  return _jsx(Empty, { description: t("no_conversation") });
@@ -43,7 +43,7 @@ const SearchItemAsMessage = (props) => {
43
43
  }
44
44
  }
45
45
  return (_jsxs("div", { className: "py-3 px-2 flex items-center gap-3 hover:bg-gray-100 hover:rounded-sm cursor-pointer border-b mx-1", onClick: onPressItem, children: [_jsx("div", { children: _jsx(Avatar, { size: "large", src: message.senderFaceUrl, alt: message.senderNickname, children: message.senderNickname.charAt(0).toUpperCase() }) }), _jsxs("div", { className: "flex flex-col flex-1 min-w-0 gap-1", children: [_jsxs("div", { className: "flex flex-1 items-center justify-between", children: [_jsx("span", { className: "text-sm flex-1 font-semibold truncate", children: message.senderNickname }), _jsx("span", { className: "text-xs text-gray-500", children: formatTimestamp(message.sendTime, {
46
- hasTime: false,
46
+ hasTime: true,
47
47
  }) })] }), _jsx("div", { className: "flex flex-col flex-1 min-w-0", children: _jsx("span", { className: "text-xs flex-1 text-gray-500 truncate", dangerouslySetInnerHTML: {
48
48
  __html: highlightSearch(msgContent, searchTerm),
49
49
  } }) })] })] }, message.clientMsgID));
@@ -2,5 +2,4 @@ export declare const coreWasmPath = "https://droppiistg.blob.core.windows.net/dr
2
2
  export declare const PAGE_SIZE = 50;
3
3
  export declare const MSG_ITEM_PREFIX = "msg-item-";
4
4
  export declare const MSG_ITEM_CONTENT_PREFIX = "msg-item-content-";
5
- export declare const adminUserId = "2c0388c5-787d-453c-830c-603d17b85393";
6
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,0GACgF,CAAC;AAE1G,eAAO,MAAM,SAAS,KAAK,CAAC;AAE5B,eAAO,MAAM,eAAe,cAAc,CAAC;AAC3C,eAAO,MAAM,uBAAuB,sBAAsB,CAAC;AAE3D,eAAO,MAAM,WAAW,yCAAyC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,0GACgF,CAAC;AAE1G,eAAO,MAAM,SAAS,KAAK,CAAC;AAE5B,eAAO,MAAM,eAAe,cAAc,CAAC;AAC3C,eAAO,MAAM,uBAAuB,sBAAsB,CAAC"}
@@ -2,4 +2,3 @@ export const coreWasmPath = "https://droppiistg.blob.core.windows.net/droppii-st
2
2
  export const PAGE_SIZE = 50;
3
3
  export const MSG_ITEM_PREFIX = "msg-item-";
4
4
  export const MSG_ITEM_CONTENT_PREFIX = "msg-item-content-";
5
- export const adminUserId = "2c0388c5-787d-453c-830c-603d17b85393";
@@ -56,7 +56,8 @@ export const useGlobalEvent = () => {
56
56
  }
57
57
  };
58
58
  const newMessageHandler = ({ data }) => {
59
- data.map((message) => handleNewMessage(message));
59
+ var _a;
60
+ (_a = data === null || data === void 0 ? void 0 : data.map) === null || _a === void 0 ? void 0 : _a.call(data, (message) => handleNewMessage(message));
60
61
  };
61
62
  const userTokenHandler = () => {
62
63
  refetchChatToken(undefined, {
@@ -1,6 +1,7 @@
1
1
  import { MergerMsgParams, MessageItem } from "@openim/wasm-client-sdk";
2
2
  import { ExtendMessageInfo, FileMsgParamsByFile, ImageMsgParamsByFile, VideoMsgParamsByFile } from "../../types/chat";
3
3
  import { UploadFile } from "antd";
4
+ import { ISessionByStatus } from "../../store/type";
4
5
  export declare const createTextMessage: (text: string) => Promise<MessageItem | null>;
5
6
  export declare const createImageMessageByFile: (file: ImageMsgParamsByFile) => Promise<MessageItem | null>;
6
7
  export declare const createMergerMessage: (mergerMsgParams: MergerMsgParams) => Promise<MessageItem | null>;
@@ -8,17 +9,20 @@ export declare const createVideoMessageByFile: (file: VideoMsgParamsByFile) => P
8
9
  export declare const createFileMessageByFile: (file: FileMsgParamsByFile) => Promise<MessageItem | null>;
9
10
  export declare const createUrlTextMessage: (text: string, urls: string[]) => Promise<MessageItem | null>;
10
11
  export declare const useSendMessage: () => {
11
- sendTextMessage: ({ plainText, richText, }: {
12
+ sendTextMessage: ({ plainText, richText, currentSession, }: {
12
13
  plainText: string;
13
14
  richText: string;
15
+ currentSession?: ISessionByStatus;
14
16
  }) => Promise<void>;
15
- sendMergeMessage: ({ richText, plainText, files, }: {
17
+ sendMergeMessage: ({ richText, plainText, files, currentSession, }: {
16
18
  richText: string;
17
19
  plainText: string;
18
20
  files: UploadFile[];
21
+ currentSession?: ISessionByStatus;
19
22
  }) => Promise<void>;
20
23
  };
21
- export declare const generateExtendMessageInfo: ({ richText, }: {
24
+ export declare const generateExtendMessageInfo: ({ richText, currentSession, }: {
22
25
  richText?: string;
26
+ currentSession?: ISessionByStatus;
23
27
  }) => ExtendMessageInfo;
24
28
  //# sourceMappingURL=useSendMessage.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useSendMessage.d.ts","sourceRoot":"","sources":["../../../src/hooks/message/useSendMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,WAAW,EAIZ,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAEL,iBAAiB,EACjB,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,kBAAkB,CAAC;AAO1B,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAMlC,eAAO,MAAM,iBAAiB,GAAU,MAAM,MAAM,gCAanD,CAAC;AAEF,eAAO,MAAM,wBAAwB,GAAU,MAAM,oBAAoB,gCAaxE,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAU,iBAAiB,eAAe,gCAazE,CAAC;AAEF,eAAO,MAAM,wBAAwB,GAAU,MAAM,oBAAoB,gCAaxE,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAAU,MAAM,mBAAmB,gCAatE,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAU,MAAM,MAAM,EAAE,MAAM,MAAM,EAAE,gCActE,CAAC;AAEF,eAAO,MAAM,cAAc;gDAiCpB;QACD,SAAS,EAAE,MAAM,CAAC;QAClB,QAAQ,EAAE,MAAM,CAAC;KAClB;wDA6BE;QACD,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,EAAE,MAAM,CAAC;QAClB,KAAK,EAAE,UAAU,EAAE,CAAC;KACrB;CAyGJ,CAAC;AAEF,eAAO,MAAM,yBAAyB,GAAI,eAEvC;IACD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,KAUM,iBACN,CAAC"}
1
+ {"version":3,"file":"useSendMessage.d.ts","sourceRoot":"","sources":["../../../src/hooks/message/useSendMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,WAAW,EAIZ,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAEL,iBAAiB,EACjB,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,kBAAkB,CAAC;AAO1B,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAKlC,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD,eAAO,MAAM,iBAAiB,GAAU,MAAM,MAAM,gCAanD,CAAC;AAEF,eAAO,MAAM,wBAAwB,GAAU,MAAM,oBAAoB,gCAaxE,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAU,iBAAiB,eAAe,gCAazE,CAAC;AAEF,eAAO,MAAM,wBAAwB,GAAU,MAAM,oBAAoB,gCAaxE,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAAU,MAAM,mBAAmB,gCAatE,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAU,MAAM,MAAM,EAAE,MAAM,MAAM,EAAE,gCActE,CAAC;AAEF,eAAO,MAAM,cAAc;gEAkCpB;QACD,SAAS,EAAE,MAAM,CAAC;QAClB,QAAQ,EAAE,MAAM,CAAC;QACjB,cAAc,CAAC,EAAE,gBAAgB,CAAC;KACnC;wEA+BE;QACD,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,EAAE,MAAM,CAAC;QAClB,KAAK,EAAE,UAAU,EAAE,CAAC;QACpB,cAAc,CAAC,EAAE,gBAAgB,CAAC;KACnC;CA0GJ,CAAC;AAEF,eAAO,MAAM,yBAAyB,GAAI,+BAGvC;IACD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,gBAAgB,CAAC;CACnC,KAWM,iBACN,CAAC"}
@@ -93,7 +93,7 @@ export const useSendMessage = () => {
93
93
  updateOneMessage(Object.assign(Object.assign({}, message), { status: MessageStatus.Failed }));
94
94
  }
95
95
  }, [recvID, groupID]);
96
- const sendTextMessage = useCallback(async ({ plainText, richText, }) => {
96
+ const sendTextMessage = useCallback(async ({ plainText, richText, currentSession, }) => {
97
97
  if (!recvID && !groupID)
98
98
  return;
99
99
  const urls = extractLinks(plainText);
@@ -109,11 +109,12 @@ export const useSendMessage = () => {
109
109
  return;
110
110
  const extendMessageInfo = generateExtendMessageInfo({
111
111
  richText,
112
+ currentSession,
112
113
  });
113
114
  let messageItem = Object.assign(Object.assign({}, message), { ex: JSON.stringify(extendMessageInfo) || "{}" });
114
115
  sendMessage(messageItem);
115
116
  }, [recvID, groupID, user, sendMessage]);
116
- const sendMergeMessage = useCallback(async ({ richText, plainText, files, }) => {
117
+ const sendMergeMessage = useCallback(async ({ richText, plainText, files, currentSession, }) => {
117
118
  if (!recvID && !groupID)
118
119
  return;
119
120
  const messageList = [];
@@ -193,17 +194,18 @@ export const useSendMessage = () => {
193
194
  }
194
195
  }
195
196
  if (!!plainText && plainText.trim() !== "") {
196
- const extendMessageInfo = generateExtendMessageInfo({
197
- richText,
198
- });
199
197
  const textMessage = await createTextMessage(plainText);
200
198
  if (!textMessage)
201
199
  return;
202
- const messageItem = Object.assign(Object.assign({}, textMessage), { ex: JSON.stringify(extendMessageInfo) || "{}" });
203
- messageList.push(messageItem);
200
+ messageList.push(textMessage);
204
201
  }
205
202
  for (const message of messageList) {
206
- await sendMessage(message);
203
+ const extendMessageInfo = generateExtendMessageInfo({
204
+ richText,
205
+ currentSession,
206
+ });
207
+ const mMessage = Object.assign(Object.assign({}, message), { ex: JSON.stringify(extendMessageInfo) || "{}" });
208
+ await sendMessage(mMessage);
207
209
  }
208
210
  }, [recvID, groupID, sendMessage]);
209
211
  return {
@@ -211,7 +213,7 @@ export const useSendMessage = () => {
211
213
  sendMergeMessage,
212
214
  };
213
215
  };
214
- export const generateExtendMessageInfo = ({ richText, }) => {
216
+ export const generateExtendMessageInfo = ({ richText, currentSession, }) => {
215
217
  return {
216
218
  messageInfo: {
217
219
  type: "MESSAGE_INFO",
@@ -220,6 +222,7 @@ export const generateExtendMessageInfo = ({ richText, }) => {
220
222
  content: richText || "",
221
223
  },
222
224
  },
225
+ sessionId: (currentSession === null || currentSession === void 0 ? void 0 : currentSession.id) || "",
223
226
  applicationType: useAuthStore.getState().applicationType,
224
227
  };
225
228
  };
@@ -36,12 +36,13 @@ export const useSearchMessage = ({ payload, options, }) => {
36
36
  enabled: hasValidFilter(payload),
37
37
  }), { data, fetchNextPage, hasNextPage, isFetchingNextPage, isLoading } = _a, rest = __rest(_a, ["data", "fetchNextPage", "hasNextPage", "isFetchingNextPage", "isLoading"]);
38
38
  const { groupedData, dataFlatten } = useMemo(() => {
39
+ var _a, _b;
39
40
  if (!data)
40
41
  return {
41
42
  groupedData: {},
42
43
  dataFlatten: [],
43
44
  };
44
- const allItems = data.pages.flatMap((page) => page.data);
45
+ const allItems = ((_b = (_a = data === null || data === void 0 ? void 0 : data.pages) === null || _a === void 0 ? void 0 : _a.flatMap) === null || _b === void 0 ? void 0 : _b.call(_a, (page) => page.data)) || [];
45
46
  const mGroupeddata = allItems.reduce((acc, item) => {
46
47
  const dateKey = dayjs(item.chatLog.sendTime).format("YYYY-MM-DD");
47
48
  if (!acc[dateKey])
@@ -1,8 +1,13 @@
1
1
  import { BaseResponse } from "../../types/dto";
2
2
  import { IFilterSummary, ISessionByStatus } from "../../store/type";
3
- export declare const useGetSession: (filter: IFilterSummary, options?: {
4
- pageSize?: number;
5
- }) => {
3
+ interface UseGetSessionProps {
4
+ filter: IFilterSummary;
5
+ options?: {
6
+ pageSize?: number;
7
+ isEnabled?: boolean;
8
+ };
9
+ }
10
+ export declare const useGetSession: ({ filter, options, }: UseGetSessionProps) => {
6
11
  error: Error;
7
12
  isError: true;
8
13
  isPending: false;
@@ -219,4 +224,5 @@ export declare const useGetSession: (filter: IFilterSummary, options?: {
219
224
  isLoading: boolean;
220
225
  dataFlatten: ISessionByStatus[];
221
226
  };
227
+ export {};
222
228
  //# sourceMappingURL=useGetSession.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useGetSession.d.ts","sourceRoot":"","sources":["../../../src/hooks/session/useGetSession.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAA+B,MAAM,iBAAiB,CAAC;AAE5E,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAOpE,eAAO,MAAM,aAAa,GACxB,QAAQ,cAAc,EACtB,UAAU;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6FhC,CAAC"}
1
+ {"version":3,"file":"useGetSession.d.ts","sourceRoot":"","sources":["../../../src/hooks/session/useGetSession.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAA+B,MAAM,iBAAiB,CAAC;AAE5E,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAOpE,UAAU,kBAAkB;IAC1B,MAAM,EAAE,cAAc,CAAC;IACvB,OAAO,CAAC,EAAE;QACR,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,SAAS,CAAC,EAAE,OAAO,CAAC;KACrB,CAAC;CACH;AACD,eAAO,MAAM,aAAa,GAAI,sBAM3B,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8FpB,CAAC"}
@@ -19,13 +19,16 @@ import useConversationStore from "../../store/conversation";
19
19
  import { DChatSDK } from "../../constants/sdk";
20
20
  import useAuthStore from "../../store/auth";
21
21
  import { PAGE_SIZE } from "../../constants";
22
- export const useGetSession = (filter, options) => {
22
+ export const useGetSession = ({ filter, options = {
23
+ pageSize: undefined,
24
+ isEnabled: true,
25
+ }, }) => {
23
26
  const conversationList = useConversationStore((state) => state.conversationList);
24
27
  const _a = useInfiniteQuery({
25
28
  initialPageParam: 1,
26
29
  queryKey: [QUERY_KEYS.GET_SESSION_BY_TAG_OR_STATUS, filter, options],
27
30
  queryFn: async ({ pageParam = 1 }) => {
28
- var _a, _b;
31
+ var _a, _b, _c;
29
32
  const params = {
30
33
  applicationType: useAuthStore.getState().applicationType,
31
34
  tag: filter.tag,
@@ -38,9 +41,9 @@ export const useGetSession = (filter, options) => {
38
41
  const res = await apiInstance.post(ENDPOINTS.chatService.getSessionsByTagOrStatus, params);
39
42
  //FIND NEW CONVERSATIONS
40
43
  const conversationList = useConversationStore.getState().conversationList;
41
- const newConversations = (_b = (_a = res === null || res === void 0 ? void 0 : res.data) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.filter((session) => {
44
+ const newConversations = ((_c = (_b = (_a = res === null || res === void 0 ? void 0 : res.data) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.filter) === null || _c === void 0 ? void 0 : _c.call(_b, (session) => {
42
45
  return !conversationList.some((conversation) => conversation.conversationID === session.conversationId);
43
- });
46
+ })) || [];
44
47
  if (newConversations === null || newConversations === void 0 ? void 0 : newConversations.length) {
45
48
  DChatSDK.getMultipleConversation(newConversations.map((session) => session.conversationId)).then((res) => {
46
49
  useConversationStore
@@ -57,23 +60,22 @@ export const useGetSession = (filter, options) => {
57
60
  const currentPage = ((_b = lastPage === null || lastPage === void 0 ? void 0 : lastPage.pageable) === null || _b === void 0 ? void 0 : _b.pageNumber) || 1;
58
61
  return dataLength < pageSize ? undefined : currentPage + 1;
59
62
  },
60
- enabled: hasValidFilter(filter),
63
+ enabled: (options === null || options === void 0 ? void 0 : options.isEnabled) && hasValidFilter(filter),
61
64
  }), { data, fetchNextPage, hasNextPage, isFetchingNextPage, isLoading } = _a, rest = __rest(_a, ["data", "fetchNextPage", "hasNextPage", "isFetchingNextPage", "isLoading"]);
62
65
  const { dataFlatten } = useMemo(() => {
66
+ var _a, _b, _c;
63
67
  if (!data) {
64
68
  return { dataFlatten: [] };
65
69
  }
66
70
  const allItems = data.pages.flatMap((page) => page.data);
67
71
  // Map session theo conversationId
68
72
  const sessionMap = new Map(allItems.map((s) => [s.conversationId, s]));
69
- const merged = conversationList
70
- .map((conv) => {
73
+ const merged = ((_c = (_b = (_a = conversationList === null || conversationList === void 0 ? void 0 : conversationList.map) === null || _a === void 0 ? void 0 : _a.call(conversationList, (conv) => {
71
74
  const session = sessionMap.get(conv.conversationID);
72
75
  if (!session)
73
76
  return null;
74
77
  return Object.assign(Object.assign({}, session), { conversation: conv });
75
- })
76
- .filter((x) => Boolean(x));
78
+ })) === null || _b === void 0 ? void 0 : _b.filter) === null || _c === void 0 ? void 0 : _c.call(_b, (x) => Boolean(x))) || [];
77
79
  return { dataFlatten: merged };
78
80
  }, [data, conversationList]);
79
81
  return Object.assign({ data,
@@ -1 +1 @@
1
- {"version":3,"file":"useAuth.d.ts","sourceRoot":"","sources":["../../../src/hooks/user/useAuth.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,YAAY;;CAyBxB,CAAC"}
1
+ {"version":3,"file":"useAuth.d.ts","sourceRoot":"","sources":["../../../src/hooks/user/useAuth.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,YAAY;;CAuBxB,CAAC"}
@@ -7,20 +7,17 @@ export const useDChatAuth = () => {
7
7
  const initAuthStore = useAuthStore((state) => state.initAuthStore);
8
8
  const resetConversationStore = useConversationStore((state) => state.resetConversationStore);
9
9
  const logout = async () => {
10
- const results = await Promise.allSettled([
11
- DChatSDK.deleteAllMsgFromLocal(),
12
- resetConversationStore(),
13
- initAuthStore({
14
- chatToken: "",
15
- accessToken: "",
16
- apiAddress: "",
17
- wsAddress: "",
18
- platformID: Platform.Web,
19
- userID: "",
20
- applicationType: DChatApplicationType.OBEFE,
21
- }),
22
- ]);
23
10
  const res = await DChatSDK.logout();
11
+ resetConversationStore();
12
+ initAuthStore({
13
+ chatToken: "",
14
+ accessToken: "",
15
+ apiAddress: "",
16
+ wsAddress: "",
17
+ platformID: Platform.Web,
18
+ userID: "",
19
+ applicationType: DChatApplicationType.OBEFE,
20
+ });
24
21
  return res;
25
22
  };
26
23
  return { logout };
@@ -1 +1 @@
1
- {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/store/auth.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAInC,QAAA,MAAM,YAAY,wEA6Bf,CAAC;AAEJ,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/store/auth.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAKnC,QAAA,MAAM,YAAY,wEAoCf,CAAC;AAEJ,eAAe,YAAY,CAAC"}
@@ -1,6 +1,7 @@
1
1
  import { create } from "zustand";
2
2
  import { Platform } from "@openim/wasm-client-sdk";
3
3
  import { DChatApplicationType } from "../types/chat";
4
+ import { jwtDecode } from "jwt-decode";
4
5
  const useAuthStore = create((set, get) => ({
5
6
  accessToken: "",
6
7
  chatToken: "",
@@ -9,9 +10,14 @@ const useAuthStore = create((set, get) => ({
9
10
  platformID: Platform.Web,
10
11
  userID: "",
11
12
  applicationType: DChatApplicationType.OBEFE,
13
+ isCx: false,
14
+ isCrm: false,
12
15
  setAccessToken: (token) => set({ accessToken: token }),
13
16
  setChatToken: (token) => set({ chatToken: token }),
14
- initAuthStore: ({ accessToken, chatToken, apiAddress, wsAddress, platformID, userID, applicationType, }) => {
17
+ initAuthStore: ({ accessToken, chatToken, apiAddress, wsAddress, platformID, userID, applicationType, isCrm, }) => {
18
+ var _a;
19
+ const jwtParser = !!accessToken ? jwtDecode(accessToken) : null;
20
+ const isCx = isCrm && ((_a = jwtParser === null || jwtParser === void 0 ? void 0 : jwtParser.role) === null || _a === void 0 ? void 0 : _a.includes("CRM_LIVE_CHAT"));
15
21
  set({
16
22
  accessToken,
17
23
  chatToken,
@@ -20,6 +26,8 @@ const useAuthStore = create((set, get) => ({
20
26
  platformID,
21
27
  userID,
22
28
  applicationType,
29
+ isCx,
30
+ isCrm: !!isCrm,
23
31
  });
24
32
  },
25
33
  }));
@@ -1 +1 @@
1
- *,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }/*! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com*/*,:after,:before{box-sizing:border-box;border:0 solid #e5e7eb}:after,:before{--tw-content:""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.pointer-events-none{pointer-events:none}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.bottom-0{bottom:0}.bottom-full{bottom:100%}.left-0{left:0}.left-1\/2{left:50%}.left-7{left:1.75rem}.right-\[-8px\]{right:-8px}.top-0{top:0}.top-1\/2{top:50%}.top-2{top:.5rem}.top-\[-8px\]{top:-8px}.\!z-\[9999\]{z-index:9999!important}.z-50{z-index:50}.mx-1{margin-left:.25rem;margin-right:.25rem}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-\[-4px\]{margin-bottom:-4px}.ml-2{margin-left:.5rem}.mt-0\.5{margin-top:.125rem}.mt-2{margin-top:.5rem}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.grid{display:grid}.aspect-square{aspect-ratio:1/1}.\!h-full{height:100%!important}.h-2{height:.5rem}.h-5{height:1.25rem}.h-8{height:2rem}.h-\[32px\]{height:32px}.h-\[36px\]{height:36px}.h-\[48px\]{height:48px}.h-\[600px\]{height:600px}.h-full{height:100%}.h-screen{height:100vh}.max-h-48{max-height:12rem}.max-h-\[140px\]{max-height:140px}.min-h-\[64px\]{min-height:64px}.w-1{width:.25rem}.w-2{width:.5rem}.w-5{width:1.25rem}.w-8{width:2rem}.w-80{width:20rem}.w-\[320px\]{width:320px}.w-\[32px\]{width:32px}.w-\[36px\]{width:36px}.w-\[400px\]{width:400px}.w-\[48px\]{width:48px}.w-full{width:100%}.min-w-0{min-width:0}.min-w-\[64px\]{min-width:64px}.max-w-\[200px\]{max-width:200px}.max-w-full{max-width:100%}.flex-1{flex:1 1 0%}.flex-\[0\.8\]{flex:0.8}.flex-shrink-0{flex-shrink:0}.-translate-x-1\/2{--tw-translate-x:-50%}.-translate-x-1\/2,.-translate-y-1\/2{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\/2{--tw-translate-y:-50%}.cursor-pointer{cursor:pointer}.resize{resize:both}.list-inside{list-style-position:inside}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.list-none{list-style-type:none}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-8{grid-template-columns:repeat(8,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-px{gap:1px}.self-center{align-self:center}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-pre-line{white-space:pre-line}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.rounded-2xl{border-radius:1rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-sm{border-radius:.125rem}.rounded-xl{border-radius:.75rem}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-l-4{border-left-width:4px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-blue-500{--tw-border-opacity:1;border-color:rgb(59 130 246/var(--tw-border-opacity,1))}.border-gray-100{--tw-border-opacity:1;border-color:rgb(243 244 246/var(--tw-border-opacity,1))}.border-gray-200{--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity,1))}.border-gray-300{--tw-border-opacity:1;border-color:rgb(209 213 219/var(--tw-border-opacity,1))}.border-indigo-500{--tw-border-opacity:1;border-color:rgb(99 102 241/var(--tw-border-opacity,1))}.bg-amber-100{--tw-bg-opacity:1;background-color:rgb(254 243 199/var(--tw-bg-opacity,1))}.bg-amber-500{--tw-bg-opacity:1;background-color:rgb(245 158 11/var(--tw-bg-opacity,1))}.bg-black\/30{background-color:rgba(0,0,0,.3)}.bg-blue-100{--tw-bg-opacity:1;background-color:rgb(219 234 254/var(--tw-bg-opacity,1))}.bg-blue-50{--tw-bg-opacity:1;background-color:rgb(239 246 255/var(--tw-bg-opacity,1))}.bg-blue-500{--tw-bg-opacity:1;background-color:rgb(59 130 246/var(--tw-bg-opacity,1))}.bg-gray-100{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity,1))}.bg-gray-50{--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity,1))}.bg-gray-500{--tw-bg-opacity:1;background-color:rgb(107 114 128/var(--tw-bg-opacity,1))}.bg-green-100{--tw-bg-opacity:1;background-color:rgb(220 252 231/var(--tw-bg-opacity,1))}.bg-green-500{--tw-bg-opacity:1;background-color:rgb(34 197 94/var(--tw-bg-opacity,1))}.bg-neutral-100{--tw-bg-opacity:1;background-color:rgb(245 245 245/var(--tw-bg-opacity,1))}.bg-orange-100{--tw-bg-opacity:1;background-color:rgb(255 237 213/var(--tw-bg-opacity,1))}.bg-orange-500{--tw-bg-opacity:1;background-color:rgb(249 115 22/var(--tw-bg-opacity,1))}.bg-purple-100{--tw-bg-opacity:1;background-color:rgb(243 232 255/var(--tw-bg-opacity,1))}.bg-purple-500{--tw-bg-opacity:1;background-color:rgb(168 85 247/var(--tw-bg-opacity,1))}.bg-red-100{--tw-bg-opacity:1;background-color:rgb(254 226 226/var(--tw-bg-opacity,1))}.bg-red-500{--tw-bg-opacity:1;background-color:rgb(239 68 68/var(--tw-bg-opacity,1))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.pb-2{padding-bottom:.5rem}.pl-4{padding-left:1rem}.pr-2{padding-right:.5rem}.pt-1{padding-top:.25rem}.text-center{text-align:center}.text-right{text-align:right}.\!align-\[-4px\]{vertical-align:-4px!important}.\!text-sm{font-size:.875rem!important;line-height:1.25rem!important}.text-2xl{font-size:1.5rem;line-height:2rem}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.italic{font-style:italic}.\!text-amber-500{--tw-text-opacity:1!important;color:rgb(245 158 11/var(--tw-text-opacity,1))!important}.\!text-orange-400{--tw-text-opacity:1!important;color:rgb(251 146 60/var(--tw-text-opacity,1))!important}.\!text-purple-500{--tw-text-opacity:1!important;color:rgb(168 85 247/var(--tw-text-opacity,1))!important}.\!text-red-500{--tw-text-opacity:1!important;color:rgb(239 68 68/var(--tw-text-opacity,1))!important}.text-amber-500{--tw-text-opacity:1;color:rgb(245 158 11/var(--tw-text-opacity,1))}.text-blue-500{--tw-text-opacity:1;color:rgb(59 130 246/var(--tw-text-opacity,1))}.text-blue-600{--tw-text-opacity:1;color:rgb(37 99 235/var(--tw-text-opacity,1))}.text-gray-300{--tw-text-opacity:1;color:rgb(209 213 219/var(--tw-text-opacity,1))}.text-gray-400{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity,1))}.text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity,1))}.text-gray-600{--tw-text-opacity:1;color:rgb(75 85 99/var(--tw-text-opacity,1))}.text-gray-900{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity,1))}.text-green-500{--tw-text-opacity:1;color:rgb(34 197 94/var(--tw-text-opacity,1))}.text-orange-500{--tw-text-opacity:1;color:rgb(249 115 22/var(--tw-text-opacity,1))}.text-purple-500{--tw-text-opacity:1;color:rgb(168 85 247/var(--tw-text-opacity,1))}.text-red-500{--tw-text-opacity:1;color:rgb(239 68 68/var(--tw-text-opacity,1))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.underline{text-decoration-line:underline}.line-through{text-decoration-line:line-through}.shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.blur{--tw-blur:blur(8px)}.blur,.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.ant-tabs-tab{margin:0!important;min-width:80px!important;justify-content:center!important;align-items:center!important}.ant-tabs-content,.ant-tabs-content-holder,.ant-tabs-tabpane{height:100%}.zoom-in-out-element{animation:zoom-in-zoom-out 1.5s ease none}@keyframes zoom-in-zoom-out{0%{scale:100%}25%{scale:125%}50%{scale:100%}75%{scale:125%}to{scale:100%}}.no-transform{transform:none!important;perspective:none!important;filter:none!important}.hover\:rounded-sm:hover{border-radius:.125rem}.hover\:bg-gray-100:hover{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity,1))}.hover\:bg-gray-600:hover{--tw-bg-opacity:1;background-color:rgb(75 85 99/var(--tw-bg-opacity,1))}.hover\:text-blue-700:hover{--tw-text-opacity:1;color:rgb(29 78 216/var(--tw-text-opacity,1))}.hover\:text-gray-600:hover{--tw-text-opacity:1;color:rgb(75 85 99/var(--tw-text-opacity,1))}.hover\:text-gray-700:hover{--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity,1))}@media (min-width:640px){.sm\:text-base{font-size:1rem;line-height:1.5rem}}
1
+ *,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }/*! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com*/*,:after,:before{box-sizing:border-box;border:0 solid #e5e7eb}:after,:before{--tw-content:""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.pointer-events-none{pointer-events:none}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.bottom-0{bottom:0}.bottom-full{bottom:100%}.left-0{left:0}.left-1\/2{left:50%}.left-7{left:1.75rem}.right-\[-8px\]{right:-8px}.top-0{top:0}.top-1\/2{top:50%}.top-2{top:.5rem}.top-\[-8px\]{top:-8px}.\!z-\[9999\]{z-index:9999!important}.z-50{z-index:50}.mx-1{margin-left:.25rem;margin-right:.25rem}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-\[-4px\]{margin-bottom:-4px}.ml-2{margin-left:.5rem}.mt-0\.5{margin-top:.125rem}.mt-2{margin-top:.5rem}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.grid{display:grid}.hidden{display:none}.aspect-square{aspect-ratio:1/1}.\!h-full{height:100%!important}.h-2{height:.5rem}.h-5{height:1.25rem}.h-8{height:2rem}.h-\[32px\]{height:32px}.h-\[36px\]{height:36px}.h-\[48px\]{height:48px}.h-\[600px\]{height:600px}.h-full{height:100%}.h-screen{height:100vh}.max-h-48{max-height:12rem}.max-h-\[140px\]{max-height:140px}.min-h-10{min-height:2.5rem}.min-h-\[64px\]{min-height:64px}.w-1{width:.25rem}.w-2{width:.5rem}.w-5{width:1.25rem}.w-8{width:2rem}.w-80{width:20rem}.w-\[320px\]{width:320px}.w-\[32px\]{width:32px}.w-\[36px\]{width:36px}.w-\[400px\]{width:400px}.w-\[48px\]{width:48px}.w-full{width:100%}.min-w-0{min-width:0}.min-w-10{min-width:2.5rem}.min-w-\[64px\]{min-width:64px}.max-w-\[200px\]{max-width:200px}.max-w-full{max-width:100%}.flex-1{flex:1 1 0%}.flex-\[0\.8\]{flex:0.8}.flex-shrink-0{flex-shrink:0}.-translate-x-1\/2{--tw-translate-x:-50%}.-translate-x-1\/2,.-translate-y-1\/2{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\/2{--tw-translate-y:-50%}.cursor-pointer{cursor:pointer}.resize{resize:both}.list-inside{list-style-position:inside}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.list-none{list-style-type:none}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-8{grid-template-columns:repeat(8,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-px{gap:1px}.self-center{align-self:center}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-pre-line{white-space:pre-line}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.rounded-2xl{border-radius:1rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-sm{border-radius:.125rem}.rounded-xl{border-radius:.75rem}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-l-4{border-left-width:4px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-blue-500{--tw-border-opacity:1;border-color:rgb(59 130 246/var(--tw-border-opacity,1))}.border-gray-100{--tw-border-opacity:1;border-color:rgb(243 244 246/var(--tw-border-opacity,1))}.border-gray-200{--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity,1))}.border-gray-300{--tw-border-opacity:1;border-color:rgb(209 213 219/var(--tw-border-opacity,1))}.border-indigo-500{--tw-border-opacity:1;border-color:rgb(99 102 241/var(--tw-border-opacity,1))}.bg-amber-100{--tw-bg-opacity:1;background-color:rgb(254 243 199/var(--tw-bg-opacity,1))}.bg-amber-500{--tw-bg-opacity:1;background-color:rgb(245 158 11/var(--tw-bg-opacity,1))}.bg-black\/30{background-color:rgba(0,0,0,.3)}.bg-blue-100{--tw-bg-opacity:1;background-color:rgb(219 234 254/var(--tw-bg-opacity,1))}.bg-blue-50{--tw-bg-opacity:1;background-color:rgb(239 246 255/var(--tw-bg-opacity,1))}.bg-blue-500{--tw-bg-opacity:1;background-color:rgb(59 130 246/var(--tw-bg-opacity,1))}.bg-gray-100{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity,1))}.bg-gray-50{--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity,1))}.bg-gray-500{--tw-bg-opacity:1;background-color:rgb(107 114 128/var(--tw-bg-opacity,1))}.bg-green-100{--tw-bg-opacity:1;background-color:rgb(220 252 231/var(--tw-bg-opacity,1))}.bg-green-500{--tw-bg-opacity:1;background-color:rgb(34 197 94/var(--tw-bg-opacity,1))}.bg-neutral-100{--tw-bg-opacity:1;background-color:rgb(245 245 245/var(--tw-bg-opacity,1))}.bg-orange-100{--tw-bg-opacity:1;background-color:rgb(255 237 213/var(--tw-bg-opacity,1))}.bg-orange-500{--tw-bg-opacity:1;background-color:rgb(249 115 22/var(--tw-bg-opacity,1))}.bg-purple-100{--tw-bg-opacity:1;background-color:rgb(243 232 255/var(--tw-bg-opacity,1))}.bg-purple-500{--tw-bg-opacity:1;background-color:rgb(168 85 247/var(--tw-bg-opacity,1))}.bg-red-100{--tw-bg-opacity:1;background-color:rgb(254 226 226/var(--tw-bg-opacity,1))}.bg-red-500{--tw-bg-opacity:1;background-color:rgb(239 68 68/var(--tw-bg-opacity,1))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.pb-2{padding-bottom:.5rem}.pl-4{padding-left:1rem}.pr-2{padding-right:.5rem}.pt-1{padding-top:.25rem}.text-center{text-align:center}.text-right{text-align:right}.\!align-\[-4px\]{vertical-align:-4px!important}.\!text-sm{font-size:.875rem!important;line-height:1.25rem!important}.text-2xl{font-size:1.5rem;line-height:2rem}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.italic{font-style:italic}.\!text-amber-500{--tw-text-opacity:1!important;color:rgb(245 158 11/var(--tw-text-opacity,1))!important}.\!text-orange-400{--tw-text-opacity:1!important;color:rgb(251 146 60/var(--tw-text-opacity,1))!important}.\!text-purple-500{--tw-text-opacity:1!important;color:rgb(168 85 247/var(--tw-text-opacity,1))!important}.\!text-red-500{--tw-text-opacity:1!important;color:rgb(239 68 68/var(--tw-text-opacity,1))!important}.text-amber-500{--tw-text-opacity:1;color:rgb(245 158 11/var(--tw-text-opacity,1))}.text-blue-500{--tw-text-opacity:1;color:rgb(59 130 246/var(--tw-text-opacity,1))}.text-blue-600{--tw-text-opacity:1;color:rgb(37 99 235/var(--tw-text-opacity,1))}.text-gray-300{--tw-text-opacity:1;color:rgb(209 213 219/var(--tw-text-opacity,1))}.text-gray-400{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity,1))}.text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity,1))}.text-gray-600{--tw-text-opacity:1;color:rgb(75 85 99/var(--tw-text-opacity,1))}.text-gray-900{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity,1))}.text-green-500{--tw-text-opacity:1;color:rgb(34 197 94/var(--tw-text-opacity,1))}.text-orange-500{--tw-text-opacity:1;color:rgb(249 115 22/var(--tw-text-opacity,1))}.text-purple-500{--tw-text-opacity:1;color:rgb(168 85 247/var(--tw-text-opacity,1))}.text-red-500{--tw-text-opacity:1;color:rgb(239 68 68/var(--tw-text-opacity,1))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.underline{text-decoration-line:underline}.line-through{text-decoration-line:line-through}.shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.blur{--tw-blur:blur(8px)}.blur,.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.ant-tabs-tab{margin:0!important;min-width:80px!important;justify-content:center!important;align-items:center!important}.ant-tabs-content,.ant-tabs-content-holder,.ant-tabs-tabpane{height:100%}.zoom-in-out-element{animation:zoom-in-zoom-out 1.5s ease none}@keyframes zoom-in-zoom-out{0%{scale:100%}25%{scale:125%}50%{scale:100%}75%{scale:125%}to{scale:100%}}.no-transform{transform:none!important;perspective:none!important;filter:none!important}.hover\:rounded-sm:hover{border-radius:.125rem}.hover\:bg-gray-100:hover{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity,1))}.hover\:bg-gray-600:hover{--tw-bg-opacity:1;background-color:rgb(75 85 99/var(--tw-bg-opacity,1))}.hover\:text-blue-700:hover{--tw-text-opacity:1;color:rgb(29 78 216/var(--tw-text-opacity,1))}.hover\:text-gray-600:hover{--tw-text-opacity:1;color:rgb(75 85 99/var(--tw-text-opacity,1))}.hover\:text-gray-700:hover{--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity,1))}@media (min-width:640px){.sm\:text-base{font-size:1rem;line-height:1.5rem}}
@@ -44,13 +44,7 @@ export interface ExtendMessageInfo {
44
44
  content: string;
45
45
  };
46
46
  };
47
- sessionInfo?: {
48
- type: "SESSION_INFO";
49
- data: {
50
- sessionId: string;
51
- applicationType: DChatApplicationType;
52
- };
53
- };
47
+ sessionId: string;
54
48
  applicationType: DChatApplicationType;
55
49
  }
56
50
  export interface MessageFooterContextType {
@@ -97,6 +91,7 @@ export interface DChatInitAndLoginConfig {
97
91
  accessToken: string;
98
92
  userID: string;
99
93
  applicationType: DChatApplicationType;
94
+ isCrm?: boolean;
100
95
  }
101
96
  export declare enum SessionStatus {
102
97
  UNASSIGNED = "UNASSIGNED",
@@ -1 +1 @@
1
- {"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../../src/types/chat.ts"],"names":[],"mappings":"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"}
1
+ {"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../../src/types/chat.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,mBAAmB,EACpB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAElC,oBAAY,oBAAoB;IAC9B,KAAK,UAAU;CAChB;AAED,oBAAY,aAAa;IACvB,YAAY,IAAI;IAChB,SAAS,IAAI;IACb,UAAU,IAAI;CACf;AAED,oBAAY,UAAU;IACpB,OAAO,IAAI;IACX,OAAO,IAAI;IACX,MAAM,IAAI;CACX;AAED,oBAAY,UAAU;IACpB,aAAa,MAAM;IACnB,aAAa,MAAM;IACnB,aAAa,MAAM;IACnB,aAAa,MAAM;IACnB,aAAa,MAAM;CACpB;AAED,oBAAY,iBAAiB;IAC3B,GAAG,MAAM;CACV;AAED,MAAM,MAAM,gBAAgB,GAAG,iBAAiB,GAAG,WAAW,CAAC;AAE/D,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,YAAY,GAAG,IAAI,CAAC;IAC1B,aAAa,EAAE,aAAa,CAAC;IAC7B,UAAU,EAAE,UAAU,CAAC;IACvB,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,mBAAmB,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,IAAI,CAAC;IACrD,gBAAgB,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;CAChD;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,MAAM,EAAE,uBAAuB,GAAG,IAAI,CAAC;CACxC;AAED,MAAM,WAAW,iBAAiB;IAChC,WAAW,CAAC,EAAE;QACZ,IAAI,EAAE,cAAc,CAAC;QACrB,IAAI,EAAE;YACJ,IAAI,EAAE,WAAW,CAAC;YAClB,OAAO,EAAE,MAAM,CAAC;SACjB,CAAC;KACH,CAAC;IACF,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,oBAAoB,CAAC;CACvC;AAED,MAAM,WAAW,wBAAwB;IACvC,aAAa,EAAE,CAAC,EACd,SAAS,EACT,QAAQ,EACR,IAAI,GACL,EAAE;QACD,SAAS,EAAE,MAAM,CAAC;QAClB,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;KACvB,KAAK,IAAI,CAAC;IACX,eAAe,EAAE,UAAU,EAAE,CAAC;IAC9B,kBAAkB,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,KAAK,IAAI,CAAC;CACnD;AAED,MAAM,WAAW,oBAAqB,SAAQ,mBAAmB;IAC/D,IAAI,EAAE,IAAI,CAAC;CACZ;AAED,MAAM,WAAW,oBAAqB,SAAQ,mBAAmB;IAC/D,SAAS,EAAE,IAAI,CAAC;IAChB,YAAY,EAAE,IAAI,CAAC;CACpB;AAED,MAAM,WAAW,mBAAoB,SAAQ,kBAAkB;IAC7D,IAAI,EAAE,IAAI,CAAC;CACZ;AAED,MAAM,WAAW,sBAAsB;IACrC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,WAAW,CAAC,EAAE;QACZ,IAAI,EAAE,cAAc,CAAC;QACrB,IAAI,EAAE;YACJ,OAAO,EAAE,MAAM,CAAC;YAChB,KAAK,EAAE,MAAM,CAAC;SACf,CAAC;KACH,CAAC;CACH;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,EAAE;QACT,IAAI,EAAE,WAAW,CAAC;QAClB,IAAI,EAAE;YACJ,QAAQ,CAAC,EAAE,MAAM,CAAC;SACnB,CAAC;KACH,CAAC;CACH;AAED,MAAM,WAAW,uBAAuB;IACtC,UAAU,EAAE,QAAQ,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,oBAAoB,CAAC;IACtC,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,oBAAY,aAAa;IACvB,UAAU,eAAe;IACzB,eAAe,oBAAoB;IACnC,UAAU,eAAe;IACzB,SAAS,cAAc;CACxB;AAED,oBAAY,UAAU;IACpB,IAAI,SAAS;IACb,eAAe,oBAAoB;IACnC,cAAc,mBAAmB;IACjC,kBAAkB,uBAAuB;CAC1C;AAED,oBAAY,wBAAwB;IAClC,qBAAqB,0BAA0B;CAChD"}
@@ -3,6 +3,7 @@ export declare const parseLatestMessage: (latestMsg: string, currentUserId?: str
3
3
  export declare const highlightSearch: (text: string, keyword: string, maxLength?: number) => string;
4
4
  interface FormatOptions {
5
5
  hasTime?: boolean;
6
+ dateMonthFormat?: string;
6
7
  }
7
8
  export declare function formatTimestamp(timestamp: number, options?: FormatOptions): string;
8
9
  export declare function extractLinks(text: string): string[];
@@ -1 +1 @@
1
- {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/utils/common.ts"],"names":[],"mappings":"AAGA,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAapD;AAED,eAAO,MAAM,kBAAkB,GAC7B,WAAW,MAAM,EACjB,gBAAgB,MAAM,EACtB,IAAI,GAAG,WAgCR,CAAC;AAEF,eAAO,MAAM,eAAe,GAC1B,MAAM,MAAM,EACZ,SAAS,MAAM,EACf,kBAAc,WA2Cf,CAAC;AAEF,UAAU,aAAa;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,wBAAgB,eAAe,CAC7B,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,aAAa,GACtB,MAAM,CAiBR;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAKnD"}
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/utils/common.ts"],"names":[],"mappings":"AAGA,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAapD;AAED,eAAO,MAAM,kBAAkB,GAC7B,WAAW,MAAM,EACjB,gBAAgB,MAAM,EACtB,IAAI,GAAG,WAgCR,CAAC;AAEF,eAAO,MAAM,eAAe,GAC1B,MAAM,MAAM,EACZ,SAAS,MAAM,EACf,kBAAc,WA2Cf,CAAC;AAEF,UAAU,aAAa;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,wBAAgB,eAAe,CAC7B,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,aAAa,GACtB,MAAM,CAqBR;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAKnD"}
@@ -79,19 +79,23 @@ export const highlightSearch = (text, keyword, maxLength = 30) => {
79
79
  return `${displayedBefore}<mark>${match}</mark>${displayedAfter}`;
80
80
  };
81
81
  export function formatTimestamp(timestamp, options) {
82
- const { hasTime = true } = options || {};
82
+ const { hasTime = false, dateMonthFormat = "DD/MM" } = options || {};
83
83
  const date = dayjs(timestamp);
84
84
  const now = dayjs();
85
85
  if (date.isSame(now, "day")) {
86
86
  // hôm nay
87
- return date.format("HH:mm");
87
+ return hasTime ? date.format("HH:mm") : date.format(dateMonthFormat);
88
88
  }
89
89
  if (date.isSame(now, "year")) {
90
90
  // cùng năm
91
- return hasTime ? date.format(`HH:mm DD/MM`) : date.format("DD/MM");
91
+ return hasTime
92
+ ? date.format(`HH:mm ${dateMonthFormat}`)
93
+ : date.format(dateMonthFormat);
92
94
  }
93
95
  // khác năm
94
- return hasTime ? date.format(`HH:mm DD/MM YYYY`) : date.format("DD/MM YYYY");
96
+ return hasTime
97
+ ? date.format(`HH:mm ${dateMonthFormat} YYYY`)
98
+ : date.format(`${dateMonthFormat} YYYY`);
95
99
  }
96
100
  export function extractLinks(text) {
97
101
  // Regex match http:// hoặc https:// và domain
@@ -1 +1 @@
1
- {"version":3,"file":"imCommon.d.ts","sourceRoot":"","sources":["../../src/utils/imCommon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAGxE,eAAO,MAAM,cAAc,GAAI,cAAc,WAAW,YACO,CAAC;AAEhE,eAAO,MAAM,gBAAgB,GAC3B,kBAAkB,gBAAgB,EAAE,EACpC,eAAe,gBAAgB,EAAE;;;;;;;;;;;;;;;;;;;;;;GA8ClC,CAAC"}
1
+ {"version":3,"file":"imCommon.d.ts","sourceRoot":"","sources":["../../src/utils/imCommon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAGxE,eAAO,MAAM,cAAc,GAAI,cAAc,WAAW,YACO,CAAC;AAEhE,eAAO,MAAM,gBAAgB,GAC3B,kBAAkB,gBAAgB,EAAE,EACpC,eAAe,gBAAgB,EAAE;;;;;;;;;;;;;;;;;;;;;;GA+ClC,CAAC"}
@@ -12,10 +12,10 @@ var __rest = (this && this.__rest) || function (s, e) {
12
12
  import { GroupSessionTypes } from "../constants/im";
13
13
  export const isGroupSession = (sessionType) => sessionType ? GroupSessionTypes.includes(sessionType) : false;
14
14
  export const conversationSort = (conversationList, originalList) => {
15
- const listWithIndex = conversationList.map((item, index) => {
15
+ const listWithIndex = (conversationList === null || conversationList === void 0 ? void 0 : conversationList.map((item, index) => {
16
16
  var _a;
17
17
  return (Object.assign(Object.assign({}, item), { originalIndex: (_a = originalList === null || originalList === void 0 ? void 0 : originalList.findIndex((c) => c.conversationID === item.conversationID)) !== null && _a !== void 0 ? _a : index }));
18
- });
18
+ })) || [];
19
19
  const arr = [];
20
20
  const filterArr = listWithIndex.filter((c) => {
21
21
  if (!arr.includes(c.conversationID)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@droppii-org/chat-sdk",
3
- "version": "0.0.38",
3
+ "version": "0.0.40",
4
4
  "description": "Droppii React Chat SDK",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -92,6 +92,7 @@
92
92
  "clsx": "^2.0.0",
93
93
  "dayjs": "^1.11.13",
94
94
  "i18next": "^25.5.2",
95
+ "jwt-decode": "^4.0.0",
95
96
  "lexical": "^0.34.0",
96
97
  "lodash": "^4.17.21",
97
98
  "lucide-react": "^0.263.1",