@zenify-omni/chat-ui-react-js 0.1.0

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 (403) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +92 -0
  3. package/assets/asset-url.js +6 -0
  4. package/assets/icons/chatter_agent.js +27 -0
  5. package/assets/icons/chatter_chatbot.js +43 -0
  6. package/assets/icons/chatter_contact.js +36 -0
  7. package/assets/icons/email_icon.png +0 -0
  8. package/assets/icons/emoji/angry.svg +56 -0
  9. package/assets/icons/emoji/haha.svg +20 -0
  10. package/assets/icons/emoji/like.svg +10 -0
  11. package/assets/icons/emoji/like_out_line.png +0 -0
  12. package/assets/icons/emoji/love.svg +10 -0
  13. package/assets/icons/emoji/sad.svg +46 -0
  14. package/assets/icons/emoji/wow.svg +51 -0
  15. package/assets/icons/instagram.js +29 -0
  16. package/assets/icons/not_found.png +0 -0
  17. package/assets/icons/not_found_template.svg +9 -0
  18. package/assets/icons/phone_icon.png +0 -0
  19. package/assets/icons/shopee.js +17 -0
  20. package/assets/icons/sms_icon.png +0 -0
  21. package/assets/icons/tiktok.js +17 -0
  22. package/assets/icons/whatsapp.js +28 -0
  23. package/assets/icons/zalo.js +17 -0
  24. package/assets/icons/zalo_icon.png +0 -0
  25. package/assets/icons/zns_icon.png +0 -0
  26. package/assets/images/emoji.webp +0 -0
  27. package/assets/images/error.png +0 -0
  28. package/assets/images/menu.png +0 -0
  29. package/assets/images/money.png +0 -0
  30. package/assets/images/success.png +0 -0
  31. package/assets/public-urls.js +78 -0
  32. package/components/campaign-detail-route/select/group.js +38 -0
  33. package/components/campaign-detail-route/select/multi-groups.js +43 -0
  34. package/components/chat-route/chat-box/ads-context-card.js +143 -0
  35. package/components/chat-route/chat-box/chat-drop-file.js +18 -0
  36. package/components/chat-route/chat-box/chat-feedback/chat-insight.js +214 -0
  37. package/components/chat-route/chat-box/chat-feedback/index.js +127 -0
  38. package/components/chat-route/chat-box/chat-header-actions-inline.js +1055 -0
  39. package/components/chat-route/chat-box/chat-header.js +465 -0
  40. package/components/chat-route/chat-box/chat-input.js +1164 -0
  41. package/components/chat-route/chat-box/chat-message-action.js +399 -0
  42. package/components/chat-route/chat-box/chat-message-list.js +995 -0
  43. package/components/chat-route/chat-box/chat-message.js +2099 -0
  44. package/components/chat-route/chat-box/chat-reply-preview.js +317 -0
  45. package/components/chat-route/chat-box/common-groups-modal.js +430 -0
  46. package/components/chat-route/chat-box/constants.js +29 -0
  47. package/components/chat-route/chat-box/contact-card/index.js +87 -0
  48. package/components/chat-route/chat-box/edit-customer-alias-dialog.js +197 -0
  49. package/components/chat-route/chat-box/emoji-picker-combined.js +91 -0
  50. package/components/chat-route/chat-box/emoji-sprite.js +45 -0
  51. package/components/chat-route/chat-box/emojiMap.js +92 -0
  52. package/components/chat-route/chat-box/facebook-reconnect-notice.js +49 -0
  53. package/components/chat-route/chat-box/forward-message-modal.js +659 -0
  54. package/components/chat-route/chat-box/index.js +165 -0
  55. package/components/chat-route/chat-box/message-time.js +44 -0
  56. package/components/chat-route/chat-box/message-viewers.js +114 -0
  57. package/components/chat-route/chat-box/pasted-file-preview.js +138 -0
  58. package/components/chat-route/chat-box/pinned-messages.js +255 -0
  59. package/components/chat-route/chat-box/react-message/react-preview.js +83 -0
  60. package/components/chat-route/chat-box/react-message/reaction-button.js +200 -0
  61. package/components/chat-route/chat-box/right-side/chat-history.js +142 -0
  62. package/components/chat-route/chat-box/right-side/chat-tag-selector.js +232 -0
  63. package/components/chat-route/chat-box/right-side/create-personal-tag-modal.js +458 -0
  64. package/components/chat-route/chat-box/right-side/customer/customer-info-item.js +60 -0
  65. package/components/chat-route/chat-box/right-side/in-room-dialog.js +225 -0
  66. package/components/chat-route/chat-box/right-side/zalo-group/add-friend-dialog.js +154 -0
  67. package/components/chat-route/chat-box/right-side/zalo-group/send-message-dialog.js +165 -0
  68. package/components/chat-route/chat-box/send-contact-card-modal.js +102 -0
  69. package/components/chat-route/chat-box/send-contact-card.js +80 -0
  70. package/components/chat-route/chat-box/text-content.js +400 -0
  71. package/components/chat-route/chat-box/use-facebook-page-invalid.js +22 -0
  72. package/components/chat-route/chat-box/zalo-emoji-decoration.js +98 -0
  73. package/components/chat-route/chat-box/zalo-emoji-picker.js +74 -0
  74. package/components/chat-route/chat-box/zalo-personal-editor.js +590 -0
  75. package/components/chat-route/chat-box/zalo-reminder/create-zalo-reminder.js +868 -0
  76. package/components/chat-route/chat-box/zalo-reminder/use-send-zalo-reminder.js +98 -0
  77. package/components/chat-route/chat-box/zalo-reminder/zalo-reminder-content.js +294 -0
  78. package/components/chat-route/chat-box/zalo-rtf-utils.js +422 -0
  79. package/components/chat-route/chat-list/action-chat-item.js +116 -0
  80. package/components/chat-route/chat-list/assign-agent-dialog.js +170 -0
  81. package/components/chat-route/chat-list/assign-tag-dialog.js +242 -0
  82. package/components/chat-route/chat-list/chat-item-tags.js +105 -0
  83. package/components/chat-route/chat-list/chat-item.js +749 -0
  84. package/components/chat-route/chat-list/chat-list-item.js +370 -0
  85. package/components/chat-route/chat-list/chat-list-selection-bar.js +426 -0
  86. package/components/chat-route/chat-list/chat-search-preview.js +48 -0
  87. package/components/chat-route/chat-list/chat-sort-menu.js +89 -0
  88. package/components/chat-route/chat-list/edit-filter-modal.js +468 -0
  89. package/components/chat-route/chat-list/filter-chat-sources.js +222 -0
  90. package/components/chat-route/chat-list/filter-chat.js +501 -0
  91. package/components/chat-route/chat-list/filter-criteria-rows.js +845 -0
  92. package/components/chat-route/chat-list/filter-group-select.js +66 -0
  93. package/components/chat-route/chat-list/filter-pin-menu.js +165 -0
  94. package/components/chat-route/chat-list/friend-request/list-friend-request.js +287 -0
  95. package/components/chat-route/chat-list/index.js +243 -0
  96. package/components/chat-route/chat-list/inline-search-results.js +178 -0
  97. package/components/chat-route/chat-list/post-ids-field.js +104 -0
  98. package/components/chat-route/chat-list/quick-filter-bar.js +391 -0
  99. package/components/chat-route/chat-list/save-filter-popover.js +258 -0
  100. package/components/chat-route/chat-list/search-messages/index.js +225 -0
  101. package/components/chat-route/chat-list/search-result-header.js +51 -0
  102. package/components/chat-route/chat-list/util.js +604 -0
  103. package/components/chat-route/chat-toolbar.js +108 -0
  104. package/components/chat-route/hooks/use-reassign.js +111 -0
  105. package/components/chat-route/shared/close-conversation-dialog.js +111 -0
  106. package/components/chat-route/shared/force-transfer-dialog.js +109 -0
  107. package/components/chat-route/shared/in-queue-confirm-dialog.js +40 -0
  108. package/components/chat-route/util.js +146 -0
  109. package/components/chat-route/zalo/modal-action-zalo.js +76 -0
  110. package/components/chat-route/zalo/modal-add-friend-zalo.js +277 -0
  111. package/components/custom/SafeHTML.js +45 -0
  112. package/components/custom/audio-player.js +81 -0
  113. package/components/custom/avatar.js +95 -0
  114. package/components/custom/between-date-picker/index.js +86 -0
  115. package/components/custom/button-close.js +28 -0
  116. package/components/custom/button.js +80 -0
  117. package/components/custom/color-picker.js +81 -0
  118. package/components/custom/combobox.js +168 -0
  119. package/components/custom/custom-dialog.js +44 -0
  120. package/components/custom/custom-select.js +256 -0
  121. package/components/custom/cycle-value-helpers.js +11 -0
  122. package/components/custom/cycle-value.js +93 -0
  123. package/components/custom/date-time-picker/components/date-time-group.js +44 -0
  124. package/components/custom/date-time-picker/components/date-time-input.js +383 -0
  125. package/components/custom/date-time-picker/components/date-time-unit-input.js +138 -0
  126. package/components/custom/date-time-picker/components/month-year-picker.js +232 -0
  127. package/components/custom/date-time-picker/hooks/use-merge-refs.js +18 -0
  128. package/components/custom/date-time-picker/hooks/use-scroll-to-center.js +18 -0
  129. package/components/custom/date-time-picker/index.js +348 -0
  130. package/components/custom/field-file-upload/files-upload.js +87 -0
  131. package/components/custom/field-file-upload/image-upload.js +115 -0
  132. package/components/custom/field-file-upload/preview-images-modal.js +284 -0
  133. package/components/custom/field-file-upload/preview-list-file.js +134 -0
  134. package/components/custom/field-file-upload/preview-list-image.js +108 -0
  135. package/components/custom/field-file-upload/upload-custom.js +222 -0
  136. package/components/custom/field-generator.js +639 -0
  137. package/components/custom/field-layout-popover.js +304 -0
  138. package/components/custom/file-preview-modal.js +351 -0
  139. package/components/custom/html-edtior.js +100 -0
  140. package/components/custom/icon.js +49 -0
  141. package/components/custom/infinite-scroll-combobox.js +253 -0
  142. package/components/custom/inline-edit-popover.js +90 -0
  143. package/components/custom/inputs/calendar-input.js +0 -0
  144. package/components/custom/inputs/chip-input.js +136 -0
  145. package/components/custom/inputs/file-input.js +71 -0
  146. package/components/custom/inputs/mask-data/mask-data-input.js +80 -0
  147. package/components/custom/inputs/mask-data/mask-data-select.js +78 -0
  148. package/components/custom/inputs/mask-data/mask-data-textarea.js +75 -0
  149. package/components/custom/inputs/mask-data/reconcile-masked-edit.js +20 -0
  150. package/components/custom/jxl-decode.js +34 -0
  151. package/components/custom/jxl-image.js +68 -0
  152. package/components/custom/jxl-worker.js +12 -0
  153. package/components/custom/label.js +55 -0
  154. package/components/custom/layout.js +30 -0
  155. package/components/custom/multi-select-search-cc.js +179 -0
  156. package/components/custom/multiple-select-setting-tags.js +404 -0
  157. package/components/custom/multiple-selector.js +821 -0
  158. package/components/custom/pagination.js +95 -0
  159. package/components/custom/popup-confirm.js +120 -0
  160. package/components/custom/previews/facebook/facebook-appointment-booking-preview.js +83 -0
  161. package/components/custom/previews/facebook/facebook-audio-preview.js +130 -0
  162. package/components/custom/previews/facebook/facebook-event-preview.js +72 -0
  163. package/components/custom/previews/facebook/facebook-file-preview.js +95 -0
  164. package/components/custom/previews/facebook/facebook-group-preview.js +103 -0
  165. package/components/custom/previews/facebook/facebook-image-preview.js +81 -0
  166. package/components/custom/previews/facebook/facebook-page-preview.js +85 -0
  167. package/components/custom/previews/facebook/facebook-post-preview.js +77 -0
  168. package/components/custom/previews/facebook/facebook-reel-preview.js +83 -0
  169. package/components/custom/previews/facebook/facebook-sticker-preview.js +23 -0
  170. package/components/custom/previews/facebook/facebook-video-preview.js +114 -0
  171. package/components/custom/previews/facebook/index.js +24 -0
  172. package/components/custom/previews/file-preview.js +747 -0
  173. package/components/custom/previews/image-preview.js +288 -0
  174. package/components/custom/previews/instagram/index.js +4 -0
  175. package/components/custom/previews/instagram/instagram-share-post-preview.js +77 -0
  176. package/components/custom/previews/link-preview.js +166 -0
  177. package/components/custom/previews/product-preview.js +334 -0
  178. package/components/custom/previews/tiktok-order-preview.js +278 -0
  179. package/components/custom/previews/tiktok-product-preview.js +321 -0
  180. package/components/custom/previews/tiktok-voucher-preview.js +151 -0
  181. package/components/custom/previews/whatsapp/index.js +10 -0
  182. package/components/custom/previews/whatsapp/whatsapp-contact-card-preview.js +150 -0
  183. package/components/custom/previews/whatsapp/whatsapp-order-preview.js +38 -0
  184. package/components/custom/previews/whatsapp/whatsapp-poll-preview.js +29 -0
  185. package/components/custom/previews/whatsapp/whatsapp-product-preview.js +29 -0
  186. package/components/custom/retry-image.js +44 -0
  187. package/components/custom/search-input.js +26 -0
  188. package/components/custom/separator-with-text.js +14 -0
  189. package/components/custom/showToast.js +21 -0
  190. package/components/custom/sortable-header.js +62 -0
  191. package/components/custom/table-resize-line.js +92 -0
  192. package/components/custom/time-picker/index.js +73 -0
  193. package/components/custom/time-picker/time-picker-input.js +159 -0
  194. package/components/custom/time-picker/time-picker-utils.js +152 -0
  195. package/components/custom/viewers/audio-player.js +192 -0
  196. package/components/custom/viewers/code-viewer.js +140 -0
  197. package/components/custom/viewers/csv-viewer.js +174 -0
  198. package/components/custom/viewers/docx-viewer.js +145 -0
  199. package/components/custom/viewers/image-viewer.js +104 -0
  200. package/components/custom/viewers/markdown-viewer.js +124 -0
  201. package/components/custom/viewers/pdf-viewer.js +333 -0
  202. package/components/custom/viewers/spreadsheet-viewer.js +232 -0
  203. package/components/custom/viewers/unsupported-viewer.js +85 -0
  204. package/components/custom/viewers/video-player.js +241 -0
  205. package/components/customers-route/change-owner-modal.js +430 -0
  206. package/components/customers-route/contact-note-button.js +212 -0
  207. package/components/customers-route/customer-source.js +37 -0
  208. package/components/customers-route/table/columns.js +675 -0
  209. package/components/customers-route/table/edit-fields.js +125 -0
  210. package/components/customers-route/table/editable-cell.js +218 -0
  211. package/components/customers-route/table/note-cell.js +77 -0
  212. package/components/dialogs/invite-agent.js +677 -0
  213. package/components/error-boundary.js +53 -0
  214. package/components/leads-route/duplicate-phone-warning-toast.js +96 -0
  215. package/components/leads-route/table/columns.js +523 -0
  216. package/components/leads-route/table/contact-cell-name.js +82 -0
  217. package/components/leads-route/table/edit-fields.js +142 -0
  218. package/components/leads-route/table/editable-cell.js +228 -0
  219. package/components/org-tree/group-name-display.js +36 -0
  220. package/components/org-tree/group-tree-multi-select.js +208 -0
  221. package/components/org-tree/group-tree-select.js +220 -0
  222. package/components/posts-route/dialog-select-posts.js +284 -0
  223. package/components/reports-route/agents/multi-select-agents.js +55 -0
  224. package/components/reports-route/agents/multi-select-search-agents.js +43 -0
  225. package/components/settings-route/chat-layout/detail/constants.js +353 -0
  226. package/components/settings-route/chat-layout/detail/form.js +43 -0
  227. package/components/settings-route/chat-timeout/channel-multi-select.js +119 -0
  228. package/components/settings-route/multi-channel/facebook/hooks/use-facebook-sdk.js +3 -0
  229. package/components/settings-route/object-rule/util.js +79 -0
  230. package/components/settings-route/routing/settings-dialog.js +561 -0
  231. package/components/settings-route/switchboard/queue-new/constant.js +9 -0
  232. package/components/shared/linked-customer-fields/LinkedCustomerFields.js +91 -0
  233. package/components/shared/linked-customer-fields/use-linked-customer-fields.js +123 -0
  234. package/components/smartqc-route/qc-form/controls/multi-select-search-agents.js +50 -0
  235. package/components/ui/alert-dialog.js +112 -0
  236. package/components/ui/avatar.js +44 -0
  237. package/components/ui/badge.js +54 -0
  238. package/components/ui/button.js +48 -0
  239. package/components/ui/calendar.js +70 -0
  240. package/components/ui/card.js +58 -0
  241. package/components/ui/carousel.js +238 -0
  242. package/components/ui/checkbox.js +27 -0
  243. package/components/ui/command.js +111 -0
  244. package/components/ui/context-menu.js +154 -0
  245. package/components/ui/dialog.js +104 -0
  246. package/components/ui/dropdown-menu.js +169 -0
  247. package/components/ui/form.js +104 -0
  248. package/components/ui/input.js +115 -0
  249. package/components/ui/label.js +20 -0
  250. package/components/ui/popover.js +29 -0
  251. package/components/ui/radio-group.js +53 -0
  252. package/components/ui/scroll-area.js +38 -0
  253. package/components/ui/select.js +147 -0
  254. package/components/ui/separator.js +24 -0
  255. package/components/ui/sheet.js +113 -0
  256. package/components/ui/skeleton.js +17 -0
  257. package/components/ui/slider.js +26 -0
  258. package/components/ui/sonner.js +76 -0
  259. package/components/ui/switch.js +54 -0
  260. package/components/ui/table-v2.js +269 -0
  261. package/components/ui/table.js +245 -0
  262. package/components/ui/tabs.js +89 -0
  263. package/components/ui/textarea.js +33 -0
  264. package/components/ui/tooltip.js +40 -0
  265. package/components/workflow-editor/nodes/ticket/picker-field.js +233 -0
  266. package/components/zalo-login-qr.js +237 -0
  267. package/components/zalo-login-status-modal.js +45 -0
  268. package/config/env.js +27 -0
  269. package/config/hmr.js +8 -0
  270. package/config/navigation.js +54 -0
  271. package/config/runtime.js +46 -0
  272. package/config/theme.js +274 -0
  273. package/constants/brand-colors.js +32 -0
  274. package/constants/chat-icon.js +34 -0
  275. package/dist/chat.css +1 -0
  276. package/exceptions/throw-exception.js +15 -0
  277. package/hooks/use-chat-attachments.js +106 -0
  278. package/hooks/use-chat-configs.js +62 -0
  279. package/hooks/use-chat-customer.js +33 -0
  280. package/hooks/use-chat-display-config-sync.js +72 -0
  281. package/hooks/use-chat-permission.js +68 -0
  282. package/hooks/use-chat-room-detail.js +44 -0
  283. package/hooks/use-chat-selection.js +26 -0
  284. package/hooks/use-chat-sort.js +69 -0
  285. package/hooks/use-chat-surface.js +8 -0
  286. package/hooks/use-common-filter-options.js +70 -0
  287. package/hooks/use-crm-organization-filter-options.js +0 -0
  288. package/hooks/use-crm-organizations-data.js +23 -0
  289. package/hooks/use-debounce.js +14 -0
  290. package/hooks/use-dynamic-fields.js +7 -0
  291. package/hooks/use-facebook-notice.js +24 -0
  292. package/hooks/use-feature-flags.js +6 -0
  293. package/hooks/use-field-layout-override.js +46 -0
  294. package/hooks/use-file-upload.js +119 -0
  295. package/hooks/use-file-viewer.js +93 -0
  296. package/hooks/use-frozen-columns.js +29 -0
  297. package/hooks/use-horizontal-scroll.js +41 -0
  298. package/hooks/use-image-preview-queue.js +101 -0
  299. package/hooks/use-inline-editable-cell.js +97 -0
  300. package/hooks/use-intersection-observer.js +24 -0
  301. package/hooks/use-interval.js +20 -0
  302. package/hooks/use-latest-message-id.js +13 -0
  303. package/hooks/use-lead-filter-options.js +0 -0
  304. package/hooks/use-logout-listener.js +43 -0
  305. package/hooks/use-org-tree.js +43 -0
  306. package/hooks/use-permission.js +33 -0
  307. package/hooks/use-quick-filters.js +175 -0
  308. package/hooks/use-resizable-table.js +0 -0
  309. package/hooks/use-setting-common.js +389 -0
  310. package/hooks/use-settings.js +41 -0
  311. package/hooks/use-sort-bindings.js +24 -0
  312. package/hooks/use-table-display-config.js +0 -0
  313. package/hooks/use-tenant-config.js +99 -0
  314. package/hooks/use-update-user-config.js +150 -0
  315. package/hooks/use-zalo-connection.js +57 -0
  316. package/hooks/use-zalo-mention-list.js +31 -0
  317. package/index.css +624 -0
  318. package/index.js +100 -0
  319. package/lib/deal-name.js +27 -0
  320. package/lib/i18n/react.js +7 -0
  321. package/lib/i18n/use-language.js +0 -0
  322. package/lib/query-client.js +34 -0
  323. package/lib/utils.js +25 -0
  324. package/package.json +108 -0
  325. package/provider/chat-context.js +9 -0
  326. package/provider/chat-provider.js +177 -0
  327. package/provider/chat-room-context.js +9 -0
  328. package/provider/chat-room-hooks.js +8 -0
  329. package/provider/chat-room-provider.js +84 -0
  330. package/provider/hooks.js +22 -0
  331. package/provider/index.js +42 -0
  332. package/public/contact-card-user.svg +25 -0
  333. package/public/images/icons/facebook.svg +1 -0
  334. package/public/images/icons/instagram.svg +1 -0
  335. package/public/images/icons/shopee.svg +1 -0
  336. package/public/images/icons/whatsapp.svg +1 -0
  337. package/public/images/icons/zalo.png +0 -0
  338. package/public/images/images.jpg +0 -0
  339. package/public/images/ticket_sources/api.png +0 -0
  340. package/public/images/ticket_sources/email.png +0 -0
  341. package/public/images/ticket_sources/facebook.png +0 -0
  342. package/public/images/ticket_sources/hand.png +0 -0
  343. package/public/images/ticket_sources/instagram.png +0 -0
  344. package/public/images/ticket_sources/livechat.png +0 -0
  345. package/public/images/ticket_sources/shopee.svg +1 -0
  346. package/public/images/ticket_sources/sms.png +0 -0
  347. package/public/images/ticket_sources/telephone-call-in.png +0 -0
  348. package/public/images/ticket_sources/telephone-call-out.png +0 -0
  349. package/public/images/ticket_sources/tiktok.png +0 -0
  350. package/public/images/ticket_sources/tiktok_shop.png +0 -0
  351. package/public/images/ticket_sources/whatsapp.png +0 -0
  352. package/public/images/ticket_sources/whatsapp.svg +1 -0
  353. package/public/images/ticket_sources/zalo.png +0 -0
  354. package/public/placeholder.svg +13 -0
  355. package/store/app-status-store.js +17 -0
  356. package/store/chat-display-config-store.js +182 -0
  357. package/store/chat-display-config.resolvers.js +88 -0
  358. package/store/chat-store-helpers.js +62 -0
  359. package/store/chat-store.js +931 -0
  360. package/store/crm-organization-list-filter-store.js +126 -0
  361. package/store/customer-list-filter-store.js +139 -0
  362. package/store/devtools.js +9 -0
  363. package/store/duplicate-phone-warning-store.js +18 -0
  364. package/store/entity-extract-store.js +72 -0
  365. package/store/file-preview-store.js +27 -0
  366. package/store/filter-store.js +289 -0
  367. package/store/index.js +22 -0
  368. package/store/knowledge-crawl-store.js +53 -0
  369. package/store/lead-list-filter-store.js +142 -0
  370. package/store/list-pagination-state.js +44 -0
  371. package/store/lumi-learn-from-chat-store.js +69 -0
  372. package/store/merge-suggestion-store.js +27 -0
  373. package/store/notification-store.js +63 -0
  374. package/store/preview-image-store.js +22 -0
  375. package/store/settings-store/multi-channel/email-list-store.js +20 -0
  376. package/store/settings-store/multi-channel/facebook-list-store.js +22 -0
  377. package/store/settings-store/multi-channel/google-list-store.js +20 -0
  378. package/store/settings-store/multi-channel/instagram-list-store.js +20 -0
  379. package/store/settings-store/multi-channel/misa-list-store.js +20 -0
  380. package/store/settings-store/multi-channel/nhanhvn-list-store.js +20 -0
  381. package/store/settings-store/multi-channel/shopee-list-store.js +20 -0
  382. package/store/settings-store/multi-channel/shopee-order-list-store.js +20 -0
  383. package/store/settings-store/multi-channel/sms-list-store.js +20 -0
  384. package/store/settings-store/multi-channel/tiktok-business-list-store.js +20 -0
  385. package/store/settings-store/multi-channel/tiktok-list-store.js +20 -0
  386. package/store/settings-store/multi-channel/zalo-list-store.js +22 -0
  387. package/store/settings-store/multi-channel/zalo-user-list-store.js +25 -0
  388. package/store/smart-qc-store/smart-qc-list-filter-store.js +70 -0
  389. package/store/tenant-config-store.js +21 -0
  390. package/store/user-detail-store.js +17 -0
  391. package/store/user-status-store.js +33 -0
  392. package/store/workflow-store.js +24 -0
  393. package/store/workspace-store.js +32 -0
  394. package/tailwind-preset.js +129 -0
  395. package/utils/chat-actions.js +414 -0
  396. package/utils/chat_socket.js +1225 -0
  397. package/utils/extra-columns.js +108 -0
  398. package/utils/file.js +316 -0
  399. package/utils/html-to-plain-text.js +12 -0
  400. package/utils/notification.js +71 -0
  401. package/utils/replaceZaloSprite.js +64 -0
  402. package/utils/show-be-error.js +17 -0
  403. package/utils/typing_socket.js +101 -0
@@ -0,0 +1,17 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ const TikTokIcon = ({ size = 24, color = "currentColor", className = "" }) => /* @__PURE__ */ jsx(
3
+ "svg",
4
+ {
5
+ xmlns: "http://www.w3.org/2000/svg",
6
+ width: size,
7
+ height: size,
8
+ fill: color,
9
+ className,
10
+ viewBox: "0 0 640 640",
11
+ children: /* @__PURE__ */ jsx("path", { d: "M544.5 273.9C500.5 274 457.5 260.3 421.7 234.7L421.7 413.4C421.7 446.5 411.6 478.8 392.7 506C373.8 533.2 347.1 554 316.1 565.6C285.1 577.2 251.3 579.1 219.2 570.9C187.1 562.7 158.3 545 136.5 520.1C114.7 495.2 101.2 464.1 97.5 431.2C93.8 398.3 100.4 365.1 116.1 336C131.8 306.9 156.1 283.3 185.7 268.3C215.3 253.3 248.6 247.8 281.4 252.3L281.4 342.2C266.4 337.5 250.3 337.6 235.4 342.6C220.5 347.6 207.5 357.2 198.4 369.9C189.3 382.6 184.4 398 184.5 413.8C184.6 429.6 189.7 444.8 199 457.5C208.3 470.2 221.4 479.6 236.4 484.4C251.4 489.2 267.5 489.2 282.4 484.3C297.3 479.4 310.4 469.9 319.6 457.2C328.8 444.5 333.8 429.1 333.8 413.4L333.8 64L421.8 64C421.7 71.4 422.4 78.9 423.7 86.2C426.8 102.5 433.1 118.1 442.4 131.9C451.7 145.7 463.7 157.5 477.6 166.5C497.5 179.6 520.8 186.6 544.6 186.6L544.6 274z" })
12
+ }
13
+ );
14
+ var tiktok_default = TikTokIcon;
15
+ export {
16
+ tiktok_default as default
17
+ };
@@ -0,0 +1,28 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ const DEFAULT_WHATSAPP_COLOR = "#72757E";
3
+ const WhatsappIcon = ({
4
+ size = 24,
5
+ color = DEFAULT_WHATSAPP_COLOR,
6
+ className = ""
7
+ }) => /* @__PURE__ */ jsx(
8
+ "svg",
9
+ {
10
+ width: size,
11
+ height: size,
12
+ viewBox: "0 0 16 16",
13
+ fill: color,
14
+ className,
15
+ xmlns: "http://www.w3.org/2000/svg",
16
+ children: /* @__PURE__ */ jsx(
17
+ "path",
18
+ {
19
+ d: "M13.6013 2.32644C12.1074 0.824899 10.1154 0 7.99428 0C3.62651 0 0.0684247 3.55809 0.0646233 7.92587C0.0646233 9.32478 0.429555 10.6857 1.1214 11.8907L0 16L4.20432 14.8976C5.36373 15.5286 6.6676 15.8632 7.99428 15.8632H7.99808C12.3659 15.8632 15.9239 12.3051 15.9277 7.93348C15.9239 5.81611 15.099 3.82419 13.6013 2.32644ZM7.99428 14.5213C6.80826 14.5213 5.64884 14.2019 4.63767 13.6013L4.39819 13.4569L1.90449 14.1107L2.56973 11.6778L2.41387 11.4269C1.75243 10.3778 1.40651 9.16512 1.40651 7.92207C1.40651 4.29556 4.36397 1.33809 7.99808 1.33809C9.75812 1.33809 11.4117 2.02613 12.6586 3.26919C13.9016 4.51604 14.5859 6.16964 14.5859 7.92968C14.5821 11.5676 11.6246 14.5213 7.99428 14.5213ZM11.6094 9.58708C11.4117 9.48824 10.4386 9.00927 10.2561 8.94084C10.0736 8.87622 9.94059 8.84201 9.81134 9.03968C9.67829 9.23735 9.29815 9.68591 9.18411 9.81516C9.07007 9.94821 8.95223 9.96341 8.75456 9.86458C8.55689 9.76574 7.91825 9.55667 7.16178 8.88002C6.57257 8.35543 6.17723 7.70539 6.05938 7.50772C5.94534 7.31005 6.04798 7.20361 6.14682 7.10478C6.23425 7.01734 6.34449 6.87289 6.44332 6.75885C6.54216 6.64481 6.57637 6.56118 6.64099 6.42813C6.70562 6.29508 6.67521 6.18104 6.62579 6.08221C6.57637 5.98337 6.18103 5.00642 6.01377 4.61107C5.85411 4.22333 5.69065 4.27655 5.56901 4.27275C5.45497 4.26515 5.32192 4.26515 5.18887 4.26515C5.05582 4.26515 4.84295 4.31456 4.66048 4.51224C4.47801 4.70991 3.96863 5.18888 3.96863 6.16584C3.96863 7.14279 4.67949 8.08173 4.77832 8.21478C4.87716 8.34783 6.17343 10.3474 8.16154 11.2065C8.63291 11.4117 9.00165 11.5334 9.29055 11.6246C9.76572 11.7767 10.1953 11.7539 10.5374 11.7044C10.9175 11.6474 11.7082 11.2255 11.8755 10.7617C12.0389 10.2979 12.0389 9.90259 11.9895 9.81896C11.9401 9.73533 11.8071 9.68591 11.6094 9.58708Z",
20
+ fill: color
21
+ }
22
+ )
23
+ }
24
+ );
25
+ var whatsapp_default = WhatsappIcon;
26
+ export {
27
+ whatsapp_default as default
28
+ };
@@ -0,0 +1,17 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ const ZaloIcon = ({ size = 24, color = "currentColor", className = "" }) => /* @__PURE__ */ jsx(
3
+ "svg",
4
+ {
5
+ xmlns: "http://www.w3.org/2000/svg",
6
+ width: size,
7
+ height: size,
8
+ viewBox: "0 0 50 50",
9
+ fill: color,
10
+ className,
11
+ children: /* @__PURE__ */ jsx("path", { d: "M 9 4 C 6.2504839 4 4 6.2504839 4 9 L 4 41 C 4 43.749516 6.2504839 46 9 46 L 41 46 C 43.749516 46 46 43.749516 46 41 L 46 9 C 46 6.2504839 43.749516 4 41 4 L 9 4 z M 9 6 L 15.580078 6 C 12.00899 9.7156859 10 14.518083 10 19.5 C 10 24.66 12.110156 29.599844 15.910156 33.339844 C 16.030156 33.549844 16.129922 34.579531 15.669922 35.769531 C 15.379922 36.519531 14.799687 37.499141 13.679688 37.869141 C 13.249688 38.009141 12.97 38.430859 13 38.880859 C 13.03 39.330859 13.360781 39.710781 13.800781 39.800781 C 16.670781 40.370781 18.529297 39.510078 20.029297 38.830078 C 21.379297 38.210078 22.270625 37.789609 23.640625 38.349609 C 26.440625 39.439609 29.42 40 32.5 40 C 36.593685 40 40.531459 39.000731 44 37.113281 L 44 41 C 44 42.668484 42.668484 44 41 44 L 9 44 C 7.3315161 44 6 42.668484 6 41 L 6 9 C 6 7.3315161 7.3315161 6 9 6 z M 33 15 C 33.55 15 34 15.45 34 16 L 34 25 C 34 25.55 33.55 26 33 26 C 32.45 26 32 25.55 32 25 L 32 16 C 32 15.45 32.45 15 33 15 z M 18 16 L 23 16 C 23.36 16 23.700859 16.199531 23.880859 16.519531 C 24.050859 16.829531 24.039609 17.219297 23.849609 17.529297 L 19.800781 24 L 23 24 C 23.55 24 24 24.45 24 25 C 24 25.55 23.55 26 23 26 L 18 26 C 17.64 26 17.299141 25.800469 17.119141 25.480469 C 16.949141 25.170469 16.960391 24.780703 17.150391 24.470703 L 21.199219 18 L 18 18 C 17.45 18 17 17.55 17 17 C 17 16.45 17.45 16 18 16 z M 27.5 19 C 28.11 19 28.679453 19.169219 29.189453 19.449219 C 29.369453 19.189219 29.65 19 30 19 C 30.55 19 31 19.45 31 20 L 31 25 C 31 25.55 30.55 26 30 26 C 29.65 26 29.369453 25.810781 29.189453 25.550781 C 28.679453 25.830781 28.11 26 27.5 26 C 25.57 26 24 24.43 24 22.5 C 24 20.57 25.57 19 27.5 19 z M 38.5 19 C 40.43 19 42 20.57 42 22.5 C 42 24.43 40.43 26 38.5 26 C 36.57 26 35 24.43 35 22.5 C 35 20.57 36.57 19 38.5 19 z M 27.5 21 C 27.39625 21 27.29502 21.011309 27.197266 21.03125 C 27.001758 21.071133 26.819727 21.148164 26.660156 21.255859 C 26.500586 21.363555 26.363555 21.500586 26.255859 21.660156 C 26.148164 21.819727 26.071133 22.001758 26.03125 22.197266 C 26.011309 22.29502 26 22.39625 26 22.5 C 26 22.60375 26.011309 22.70498 26.03125 22.802734 C 26.051191 22.900488 26.079297 22.994219 26.117188 23.083984 C 26.155078 23.17375 26.202012 23.260059 26.255859 23.339844 C 26.309707 23.419629 26.371641 23.492734 26.439453 23.560547 C 26.507266 23.628359 26.580371 23.690293 26.660156 23.744141 C 26.819727 23.851836 27.001758 23.928867 27.197266 23.96875 C 27.29502 23.988691 27.39625 24 27.5 24 C 27.60375 24 27.70498 23.988691 27.802734 23.96875 C 28.487012 23.82916 29 23.22625 29 22.5 C 29 21.67 28.33 21 27.5 21 z M 38.5 21 C 38.39625 21 38.29502 21.011309 38.197266 21.03125 C 38.099512 21.051191 38.005781 21.079297 37.916016 21.117188 C 37.82625 21.155078 37.739941 21.202012 37.660156 21.255859 C 37.580371 21.309707 37.507266 21.371641 37.439453 21.439453 C 37.303828 21.575078 37.192969 21.736484 37.117188 21.916016 C 37.079297 22.005781 37.051191 22.099512 37.03125 22.197266 C 37.011309 22.29502 37 22.39625 37 22.5 C 37 22.60375 37.011309 22.70498 37.03125 22.802734 C 37.051191 22.900488 37.079297 22.994219 37.117188 23.083984 C 37.155078 23.17375 37.202012 23.260059 37.255859 23.339844 C 37.309707 23.419629 37.371641 23.492734 37.439453 23.560547 C 37.507266 23.628359 37.580371 23.690293 37.660156 23.744141 C 37.739941 23.797988 37.82625 23.844922 37.916016 23.882812 C 38.005781 23.920703 38.099512 23.948809 38.197266 23.96875 C 38.29502 23.988691 38.39625 24 38.5 24 C 38.60375 24 38.70498 23.988691 38.802734 23.96875 C 39.487012 23.82916 40 23.22625 40 22.5 C 40 21.67 39.33 21 38.5 21 z" })
12
+ }
13
+ );
14
+ var zalo_default = ZaloIcon;
15
+ export {
16
+ zalo_default as default
17
+ };
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,78 @@
1
+ import apiPng__asset from "../public/images/ticket_sources/api.png";
2
+ import emailPng__asset from "../public/images/ticket_sources/email.png";
3
+ import facebookPng__asset from "../public/images/ticket_sources/facebook.png";
4
+ import handPng__asset from "../public/images/ticket_sources/hand.png";
5
+ import instagramPng__asset from "../public/images/ticket_sources/instagram.png";
6
+ import livechatPng__asset from "../public/images/ticket_sources/livechat.png";
7
+ import shopeeSvg__asset from "../public/images/ticket_sources/shopee.svg";
8
+ import smsPng__asset from "../public/images/ticket_sources/sms.png";
9
+ import telephoneCallInPng__asset from "../public/images/ticket_sources/telephone-call-in.png";
10
+ import telephoneCallOutPng__asset from "../public/images/ticket_sources/telephone-call-out.png";
11
+ import tiktokPng__asset from "../public/images/ticket_sources/tiktok.png";
12
+ import tiktokShopPng__asset from "../public/images/ticket_sources/tiktok_shop.png";
13
+ import whatsappPng__asset from "../public/images/ticket_sources/whatsapp.png";
14
+ import whatsappSvg__asset from "../public/images/ticket_sources/whatsapp.svg";
15
+ import zaloPng__asset from "../public/images/ticket_sources/zalo.png";
16
+ import iconFacebookSvg__asset from "../public/images/icons/facebook.svg";
17
+ import iconInstagramSvg__asset from "../public/images/icons/instagram.svg";
18
+ import iconShopeeSvg__asset from "../public/images/icons/shopee.svg";
19
+ import iconWhatsappSvg__asset from "../public/images/icons/whatsapp.svg";
20
+ import iconZaloPng__asset from "../public/images/icons/zalo.png";
21
+ import contactCardUserSvg__asset from "../public/contact-card-user.svg";
22
+ import placeholderSvg__asset from "../public/placeholder.svg";
23
+ import imagesFallbackJpg__asset from "../public/images/images.jpg";
24
+ import { assetUrl } from "./asset-url.js";
25
+ const apiPng = assetUrl(apiPng__asset);
26
+ const emailPng = assetUrl(emailPng__asset);
27
+ const facebookPng = assetUrl(facebookPng__asset);
28
+ const handPng = assetUrl(handPng__asset);
29
+ const instagramPng = assetUrl(instagramPng__asset);
30
+ const livechatPng = assetUrl(livechatPng__asset);
31
+ const shopeeSvg = assetUrl(shopeeSvg__asset);
32
+ const smsPng = assetUrl(smsPng__asset);
33
+ const telephoneCallInPng = assetUrl(telephoneCallInPng__asset);
34
+ const telephoneCallOutPng = assetUrl(telephoneCallOutPng__asset);
35
+ const tiktokPng = assetUrl(tiktokPng__asset);
36
+ const tiktokShopPng = assetUrl(tiktokShopPng__asset);
37
+ const whatsappPng = assetUrl(whatsappPng__asset);
38
+ const whatsappSvg = assetUrl(whatsappSvg__asset);
39
+ const zaloPng = assetUrl(zaloPng__asset);
40
+ const iconFacebookSvg = assetUrl(iconFacebookSvg__asset);
41
+ const iconInstagramSvg = assetUrl(iconInstagramSvg__asset);
42
+ const iconShopeeSvg = assetUrl(iconShopeeSvg__asset);
43
+ const iconWhatsappSvg = assetUrl(iconWhatsappSvg__asset);
44
+ const iconZaloPng = assetUrl(iconZaloPng__asset);
45
+ const contactCardUserSvg = assetUrl(contactCardUserSvg__asset);
46
+ const placeholderSvg = assetUrl(placeholderSvg__asset);
47
+ const imagesFallbackJpg = assetUrl(imagesFallbackJpg__asset);
48
+ const TicketSourceIconUrl = Object.freeze({
49
+ "api.png": apiPng,
50
+ "email.png": emailPng,
51
+ "facebook.png": facebookPng,
52
+ "hand.png": handPng,
53
+ "instagram.png": instagramPng,
54
+ "livechat.png": livechatPng,
55
+ "shopee.svg": shopeeSvg,
56
+ "sms.png": smsPng,
57
+ "telephone-call-in.png": telephoneCallInPng,
58
+ "telephone-call-out.png": telephoneCallOutPng,
59
+ "tiktok.png": tiktokPng,
60
+ "tiktok_shop.png": tiktokShopPng,
61
+ "whatsapp.png": whatsappPng,
62
+ "whatsapp.svg": whatsappSvg,
63
+ "zalo.png": zaloPng
64
+ });
65
+ const ChannelIconUrl = Object.freeze({
66
+ facebook: iconFacebookSvg,
67
+ instagram: iconInstagramSvg,
68
+ shopee: iconShopeeSvg,
69
+ whatsapp: iconWhatsappSvg,
70
+ zalo: iconZaloPng
71
+ });
72
+ export {
73
+ ChannelIconUrl,
74
+ TicketSourceIconUrl,
75
+ contactCardUserSvg,
76
+ imagesFallbackJpg,
77
+ placeholderSvg
78
+ };
@@ -0,0 +1,38 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import React from "react";
3
+ import { getAllGroups } from "@zenify-omni/chat-js/api/group.js";
4
+ import { useQuery } from "@tanstack/react-query";
5
+ import QUERY_KEY from "@zenify-omni/chat-js/constants/use-query-key.js";
6
+ import { CustomSelect } from "../../custom/custom-select.js";
7
+ const SelectGroup = React.forwardRef(
8
+ ({ target, onChange, placeholder, value, ...props }, ref) => {
9
+ const { isLoading, data: groups } = useQuery({
10
+ queryKey: [QUERY_KEY.GET_ALL_GROUPS, { target }],
11
+ queryFn: async () => {
12
+ const { data } = await getAllGroups({ target });
13
+ return data;
14
+ }
15
+ });
16
+ const groupOptions = (groups ?? [])?.map((option) => ({
17
+ label: option.name,
18
+ value: option.id.toString()
19
+ }));
20
+ return /* @__PURE__ */ jsx(
21
+ CustomSelect,
22
+ {
23
+ ref,
24
+ isLoading,
25
+ value,
26
+ onChange,
27
+ options: groupOptions,
28
+ placeholder: placeholder ?? "Ch\u1ECDn b\u1ED9 ph\u1EADn",
29
+ ...props
30
+ }
31
+ );
32
+ }
33
+ );
34
+ SelectGroup.displayName = "SelectGroup";
35
+ var group_default = SelectGroup;
36
+ export {
37
+ group_default as default
38
+ };
@@ -0,0 +1,43 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import React from "react";
3
+ import MultipleSelector from "../../custom/multiple-selector.js";
4
+ import { getAllGroups } from "@zenify-omni/chat-js/api/group.js";
5
+ import { useQuery } from "@tanstack/react-query";
6
+ import QUERY_KEY from "@zenify-omni/chat-js/constants/use-query-key.js";
7
+ import { useTranslation } from "react-i18next";
8
+ const MultiSelectGroups = React.forwardRef(
9
+ ({ target, onChange, ...props }, ref) => {
10
+ const { t } = useTranslation();
11
+ const { data: groupOptions } = useQuery({
12
+ queryKey: [QUERY_KEY.GET_ALL_GROUPS, { target }],
13
+ queryFn: async () => {
14
+ const params = {};
15
+ if (target) {
16
+ params.target = target;
17
+ }
18
+ const { data } = await getAllGroups(params);
19
+ return data?.map((g) => ({
20
+ label: g.name,
21
+ value: g.id.toString()
22
+ }));
23
+ }
24
+ });
25
+ return /* @__PURE__ */ jsx(
26
+ MultipleSelector,
27
+ {
28
+ ref,
29
+ ...props,
30
+ placeholder: t("common:placeholder.selectDepartment", {
31
+ defaultValue: "Ch\u1ECDn b\u1ED9 ph\u1EADn"
32
+ }),
33
+ options: groupOptions || [],
34
+ onChange: (options) => onChange(options)
35
+ }
36
+ );
37
+ }
38
+ );
39
+ MultiSelectGroups.displayName = "SelectGroups";
40
+ var multi_groups_default = MultiSelectGroups;
41
+ export {
42
+ multi_groups_default as default
43
+ };
@@ -0,0 +1,143 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { useState } from "react";
3
+ import { ExternalLink } from "lucide-react";
4
+ import { cn } from "../../../lib/utils.js";
5
+ import { useTranslation } from "react-i18next";
6
+ const MetaIcon = ({ className }) => /* @__PURE__ */ jsx(
7
+ "svg",
8
+ {
9
+ xmlns: "http://www.w3.org/2000/svg",
10
+ viewBox: "0 0 20 14",
11
+ fill: "none",
12
+ className,
13
+ "aria-hidden": "true",
14
+ children: /* @__PURE__ */ jsx(
15
+ "path",
16
+ {
17
+ d: "M14.3525 0C17.449 0 19.9988 3.94106 20 8.63379C20 11.4967 18.7676 13.29 16.5537 13.29C14.6247 13.29 13.5606 12.2062 11.6504 9.00977L10.8154 7.60645L10.668 7.35938C10.5987 7.24274 10.5291 7.12941 10.4619 7.01758C10.355 6.83963 10.2513 6.66717 10.1494 6.50098C10.1002 6.4207 10.051 6.34221 10.0029 6.26465C9.40333 7.3251 8.5332 8.86328 8.5332 8.86328C6.44171 12.5187 5.26529 13.2899 3.62988 13.29C1.35734 13.29 0 11.5205 0 8.71582C0.000140673 4.23482 2.49235 0.00129581 5.74512 0H5.74805C5.83407 3.29673e-05 5.91933 0.00222981 6.00391 0.00683594C6.03364 0.00845225 6.06321 0.0114778 6.09277 0.0136719C6.16252 0.0188544 6.23188 0.0247442 6.30078 0.0332031C6.31381 0.0348017 6.32684 0.0363683 6.33984 0.0380859C6.42641 0.0495301 6.51224 0.064235 6.59766 0.0810547C6.61363 0.0841985 6.62957 0.0874849 6.64551 0.0908203C6.71745 0.105884 6.78908 0.122571 6.86035 0.141602C6.88056 0.146994 6.90074 0.152487 6.9209 0.158203C7.00034 0.180742 7.07942 0.205735 7.1582 0.233398C7.18138 0.241533 7.20441 0.250202 7.22754 0.258789C7.28633 0.280623 7.34479 0.304308 7.40332 0.329102C7.42929 0.3401 7.45552 0.350715 7.48145 0.362305C7.55844 0.39673 7.63519 0.4339 7.71191 0.473633C7.73254 0.48431 7.75283 0.495769 7.77344 0.506836C7.83914 0.542126 7.90506 0.578856 7.9707 0.618164C7.99254 0.631241 8.01429 0.644674 8.03613 0.658203C8.11221 0.705339 8.18848 0.754917 8.26465 0.807617C8.29115 0.825953 8.31722 0.845238 8.34375 0.864258C8.39511 0.901088 8.44657 0.939087 8.49805 0.978516C8.53183 1.00438 8.56576 1.03062 8.59961 1.05762C8.67575 1.11837 8.75252 1.18146 8.8291 1.24805C8.83639 1.25438 8.84329 1.26119 8.85059 1.26758C8.92876 1.33608 9.00713 1.4077 9.08594 1.48242C9.10422 1.49976 9.1223 1.51748 9.14062 1.53516C9.30087 1.68975 9.46204 1.85783 9.62598 2.03906C9.83631 2.27157 10.0517 2.52513 10.2705 2.80371C11.4307 1.2349 12.7129 0.000183961 14.3525 0ZM5.71875 2.17188C3.78512 2.17228 2.16309 5.4994 2.16309 8.75293C2.1631 10.2738 2.74047 11.1269 3.71191 11.127C4.65588 11.127 5.24284 10.531 6.93848 7.87305C6.9457 7.86158 7.71447 6.6401 8.98047 4.69824C8.7922 4.42871 8.61405 4.18451 8.44238 3.96484C7.39143 2.62013 6.61915 2.17188 5.71875 2.17188ZM14.2158 1.71484C13.179 1.71484 12.3068 2.52702 11.25 4.1582C11.5425 4.59219 11.8477 5.06709 12.165 5.58301L13.3379 7.53809C15.1716 10.4885 15.6327 11.1266 16.5986 11.127C17.606 11.1269 18.0927 10.2656 18.0928 8.78125C18.0928 4.88623 16.3694 1.71517 14.2158 1.71484Z",
18
+ fill: "hsl(var(--primary))"
19
+ }
20
+ )
21
+ }
22
+ );
23
+ const HASHTAG_RE = /(#[\p{L}\p{N}_]+)/gu;
24
+ function renderWithHashtags(text) {
25
+ if (!text) return null;
26
+ return text.split(HASHTAG_RE).map(
27
+ (part, i) => part.startsWith("#") ? /* @__PURE__ */ jsx("span", { style: { color: "rgb(33, 111, 219)" }, children: part }, i) : part
28
+ );
29
+ }
30
+ function AdsContextCard({ payload, postLinkUrl }) {
31
+ const { t } = useTranslation();
32
+ const [expanded, setExpanded] = useState(false);
33
+ const [footerOpen, setFooterOpen] = useState(false);
34
+ const [imgError, setImgError] = useState(false);
35
+ if (!payload) return null;
36
+ const { ad_id, ad_name, image_url, title, body, footer } = payload;
37
+ const openPostLink = () => {
38
+ if (!postLinkUrl) return;
39
+ window.open(postLinkUrl, "_blank", "noopener,noreferrer");
40
+ };
41
+ const showSeeMore = !expanded && body && body.length > 120;
42
+ return /* @__PURE__ */ jsxs(
43
+ "div",
44
+ {
45
+ className: cn(
46
+ "overflow-hidden rounded-2xl border border-muted bg-muted shadow-sm",
47
+ postLinkUrl && "cursor-pointer"
48
+ ),
49
+ onClick: openPostLink,
50
+ children: [
51
+ /* @__PURE__ */ jsxs(
52
+ "div",
53
+ {
54
+ className: cn(
55
+ "flex items-start justify-between gap-2 px-4 pt-3",
56
+ (!image_url || imgError) && "pb-3"
57
+ ),
58
+ children: [
59
+ /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 items-start gap-2", children: [
60
+ /* @__PURE__ */ jsx(MetaIcon, { className: "mt-1.5 h-3.5 w-5 shrink-0" }),
61
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
62
+ /* @__PURE__ */ jsx("div", { className: "truncate text-[15px] font-semibold text-foreground", children: ad_name || "Facebook Ads" }),
63
+ ad_id && /* @__PURE__ */ jsxs("div", { className: "mt-0.5 truncate text-xs text-muted-foreground", children: [
64
+ "Ad ID: ",
65
+ ad_id
66
+ ] })
67
+ ] })
68
+ ] }),
69
+ postLinkUrl && /* @__PURE__ */ jsx(
70
+ "button",
71
+ {
72
+ type: "button",
73
+ className: "shrink-0 rounded p-1 text-muted-foreground hover:bg-black/5 hover:text-foreground",
74
+ "aria-label": t("chat:action.openAd", {
75
+ defaultValue: "M\u1EDF qu\u1EA3ng c\xE1o"
76
+ }),
77
+ children: /* @__PURE__ */ jsx(ExternalLink, { size: 18 })
78
+ }
79
+ )
80
+ ]
81
+ }
82
+ ),
83
+ image_url && !imgError && /* @__PURE__ */ jsx("div", { className: cn("mt-3 px-2", !title && !body && "pb-2"), children: /* @__PURE__ */ jsx(
84
+ "img",
85
+ {
86
+ src: image_url,
87
+ alt: ad_name || "ad image",
88
+ className: "h-[200px] w-full rounded-md object-cover",
89
+ onError: () => setImgError(true)
90
+ }
91
+ ) }),
92
+ (title || body) && /* @__PURE__ */ jsxs("div", { className: "px-4 pb-3 pt-3", children: [
93
+ title && /* @__PURE__ */ jsx("p", { className: "text-[14px] font-semibold leading-snug text-foreground", children: title }),
94
+ body && /* @__PURE__ */ jsx(
95
+ "p",
96
+ {
97
+ className: cn(
98
+ "whitespace-pre-wrap text-[14px] leading-snug text-foreground",
99
+ title && "mt-1",
100
+ !expanded && "line-clamp-3"
101
+ ),
102
+ children: renderWithHashtags(body)
103
+ }
104
+ ),
105
+ showSeeMore && /* @__PURE__ */ jsx(
106
+ "button",
107
+ {
108
+ type: "button",
109
+ onClick: (e) => {
110
+ e.stopPropagation();
111
+ setExpanded(true);
112
+ },
113
+ className: "mt-1 text-[13px] font-medium text-primary hover:underline",
114
+ children: t("chat:action.viewMore", { defaultValue: "Xem th\xEAm" })
115
+ }
116
+ )
117
+ ] }),
118
+ footer && /* @__PURE__ */ jsxs("div", { className: "border-t border-muted bg-muted px-4 py-2", children: [
119
+ /* @__PURE__ */ jsx(
120
+ "button",
121
+ {
122
+ type: "button",
123
+ onClick: (e) => {
124
+ e.stopPropagation();
125
+ setFooterOpen((o) => !o);
126
+ },
127
+ className: "text-xs text-muted-foreground hover:underline",
128
+ children: footerOpen ? t("chat:action.hideDetails", {
129
+ defaultValue: "\u1EA8n th\xF4ng tin chi ti\u1EBFt"
130
+ }) : t("chat:action.viewDetail", {
131
+ defaultValue: "Xem th\xF4ng tin chi ti\u1EBFt"
132
+ })
133
+ }
134
+ ),
135
+ footerOpen && /* @__PURE__ */ jsx("p", { className: "mt-2 whitespace-pre-wrap text-xs leading-snug text-muted-foreground", children: footer })
136
+ ] })
137
+ ]
138
+ }
139
+ );
140
+ }
141
+ export {
142
+ AdsContextCard as default
143
+ };
@@ -0,0 +1,18 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { forwardRef } from "react";
3
+ import { useTranslation } from "react-i18next";
4
+ import { cn } from "../../../lib/utils.js";
5
+ const ChatDropFile = forwardRef(function ChatDropFile2({ className, children, dropZoneProps, showDragBlur, overlay, label, ...rest }, ref) {
6
+ const { t } = useTranslation();
7
+ return /* @__PURE__ */ jsxs("div", { ref, className: cn("relative", className), ...dropZoneProps, ...rest, children: [
8
+ showDragBlur && (overlay ?? /* @__PURE__ */ jsx("div", { className: "pointer-events-none absolute inset-0 z-50 flex items-center justify-center border-4 border-dashed border-primary/40 bg-primary/20", children: /* @__PURE__ */ jsx("div", { className: "rounded-lg bg-card/90 p-8 text-center text-lg font-medium text-foreground", children: label ?? t("chat:message.dropFileToUpload", {
9
+ defaultValue: "Th\u1EA3 t\u1EC7p v\xE0o \u0111\xE2y \u0111\u1EC3 t\u1EA3i l\xEAn"
10
+ }) }) })),
11
+ children
12
+ ] });
13
+ });
14
+ var chat_drop_file_default = ChatDropFile;
15
+ export {
16
+ ChatDropFile,
17
+ chat_drop_file_default as default
18
+ };
@@ -0,0 +1,214 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import i18n from "@zenify-omni/chat-js/lib/i18n/index.js";
3
+ import { useMemo, useState } from "react";
4
+ import {
5
+ Dialog,
6
+ DialogContent,
7
+ DialogHeader,
8
+ DialogTitle
9
+ } from "../../../ui/dialog.js";
10
+ import { ChevronLeft, ChevronRight } from "lucide-react";
11
+ import { cn } from "../../../../lib/utils.js";
12
+ import { useTranslation } from "react-i18next";
13
+ const MAX_VISIBLE_ITEMS = 3;
14
+ const getItemLabel = (item, fallback = "-") => {
15
+ if (typeof item === "string") return item;
16
+ if (!item || typeof item !== "object") return fallback;
17
+ return item.title || item.name || item.question || item.label || fallback;
18
+ };
19
+ const SECTIONS = [
20
+ {
21
+ key: "documents",
22
+ get label() {
23
+ return i18n.t("chat:label.knowledgeUsed", {
24
+ defaultValue: "Tri th\u1EE9c s\u1EED d\u1EE5ng"
25
+ });
26
+ }
27
+ },
28
+ {
29
+ key: "instructions",
30
+ get label() {
31
+ return i18n.t("lumi:field.answerInstructions", {
32
+ defaultValue: "H\u01B0\u1EDBng d\u1EABn tr\u1EA3 l\u1EDDi"
33
+ });
34
+ }
35
+ },
36
+ {
37
+ key: "goals",
38
+ get label() {
39
+ return i18n.t("common:label.goal", {
40
+ defaultValue: "M\u1EE5c ti\xEAu"
41
+ });
42
+ }
43
+ },
44
+ {
45
+ key: "skills",
46
+ get label() {
47
+ return i18n.t("common:label.skill", {
48
+ defaultValue: "K\u1EF9 n\u0103ng"
49
+ });
50
+ }
51
+ }
52
+ ];
53
+ const getMessageInsightData = (message) => {
54
+ const reference = message?.extra_data?.reference || message || {};
55
+ const documents = reference?.reference_documents || [];
56
+ const instructions = reference?.reference_instructions || [];
57
+ const goals = reference?.reference_goals || [];
58
+ const skills = reference?.reference_skills || [];
59
+ const intentCandidates = reference?.intent_candidates || message?.extra_data?.intent_candidates || [];
60
+ return {
61
+ documents,
62
+ instructions,
63
+ goals,
64
+ skills,
65
+ intentCandidates,
66
+ hasAny: documents.length > 0 || instructions.length > 0 || goals.length > 0 || skills.length > 0 || intentCandidates.length > 0
67
+ };
68
+ };
69
+ const InsightItem = ({ label }) => /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between rounded-lg border px-3 py-2", children: [
70
+ /* @__PURE__ */ jsx("span", { className: "text-foreground", children: label }),
71
+ /* @__PURE__ */ jsx(ChevronRight, { className: "h-4 w-4 text-muted-foreground" })
72
+ ] });
73
+ const ChatInsight = ({ open, onOpenChange, message }) => {
74
+ const { t } = useTranslation();
75
+ const [expandedSection, setExpandedSection] = useState(null);
76
+ const insightDetails = useMemo(
77
+ () => getMessageInsightData(message),
78
+ [message]
79
+ );
80
+ const messageText = message?.content?.text || "";
81
+ const handleOpenChange = (value) => {
82
+ if (!value) setExpandedSection(null);
83
+ onOpenChange(value);
84
+ };
85
+ if (expandedSection) {
86
+ const section = SECTIONS.find((s) => s.key === expandedSection);
87
+ const items = insightDetails[expandedSection] || [];
88
+ return /* @__PURE__ */ jsx(Dialog, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ jsxs(DialogContent, { className: "max-h-[90vh] overflow-auto md:max-w-2xl", children: [
89
+ /* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsx(DialogTitle, { children: t("chat:title.messageInsight", {
90
+ defaultValue: "Insight tin nh\u1EAFn"
91
+ }) }) }),
92
+ /* @__PURE__ */ jsxs(
93
+ "button",
94
+ {
95
+ type: "button",
96
+ className: "flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground",
97
+ onClick: () => setExpandedSection(null),
98
+ children: [
99
+ /* @__PURE__ */ jsx(ChevronLeft, { className: "h-4 w-4" }),
100
+ section?.label
101
+ ]
102
+ }
103
+ ),
104
+ /* @__PURE__ */ jsx("div", { className: "space-y-2", children: items.map((item, idx) => /* @__PURE__ */ jsx(
105
+ InsightItem,
106
+ {
107
+ label: getItemLabel(item)
108
+ },
109
+ `${expandedSection}_${idx}`
110
+ )) })
111
+ ] }) });
112
+ }
113
+ return /* @__PURE__ */ jsx(Dialog, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ jsxs(DialogContent, { className: "max-h-[90vh] overflow-auto md:max-w-2xl", children: [
114
+ /* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsx(DialogTitle, { children: t("chat:title.messageInsight", {
115
+ defaultValue: "Insight tin nh\u1EAFn"
116
+ }) }) }),
117
+ /* @__PURE__ */ jsxs("div", { className: "mb-4", children: [
118
+ /* @__PURE__ */ jsx("p", { className: "mb-2 font-semibold text-foreground", children: t("common:label.message", { defaultValue: "Tin nh\u1EAFn" }) }),
119
+ /* @__PURE__ */ jsx("div", { className: "rounded-lg border p-3 text-foreground", children: messageText })
120
+ ] }),
121
+ insightDetails.intentCandidates.length > 0 && /* @__PURE__ */ jsxs("div", { className: "mb-4", children: [
122
+ /* @__PURE__ */ jsx("p", { className: "mb-3 text-xs font-semibold uppercase tracking-wider text-muted-foreground", children: t("chat:label.intentDetected", {
123
+ defaultValue: "Ph\xE1t hi\u1EC7n \xFD \u0111\u1ECBnh"
124
+ }) }),
125
+ /* @__PURE__ */ jsx("div", { className: "space-y-2", children: insightDetails.intentCandidates.map((candidate, idx) => {
126
+ const intent = candidate?.intent || {};
127
+ const name = intent?.name || intent?.code || candidate?.intent_name || "-";
128
+ const confidence = Number(candidate?.confidence) || 0;
129
+ const isSelected = candidate?.is_selected;
130
+ const widthPercent = Math.max(0, Math.min(confidence, 100));
131
+ return /* @__PURE__ */ jsxs(
132
+ "div",
133
+ {
134
+ className: "flex items-center gap-3",
135
+ children: [
136
+ /* @__PURE__ */ jsx(
137
+ "div",
138
+ {
139
+ className: cn(
140
+ "w-40 truncate text-sm",
141
+ isSelected ? "font-semibold text-foreground" : "text-foreground"
142
+ ),
143
+ title: name,
144
+ children: name
145
+ }
146
+ ),
147
+ /* @__PURE__ */ jsx("div", { className: "relative h-2 flex-1 overflow-hidden rounded-full bg-muted", children: /* @__PURE__ */ jsx(
148
+ "div",
149
+ {
150
+ className: cn(
151
+ "h-full rounded-full",
152
+ isSelected ? "bg-primary" : "bg-muted"
153
+ ),
154
+ style: { width: `${widthPercent}%` }
155
+ }
156
+ ) }),
157
+ /* @__PURE__ */ jsxs(
158
+ "div",
159
+ {
160
+ className: cn(
161
+ "min-w-[40px] text-right text-sm tabular-nums",
162
+ isSelected ? "text-foreground" : "text-muted-foreground"
163
+ ),
164
+ children: [
165
+ confidence.toFixed(0),
166
+ "%"
167
+ ]
168
+ }
169
+ )
170
+ ]
171
+ },
172
+ candidate?.intent_id || intent?._id || idx
173
+ );
174
+ }) })
175
+ ] }),
176
+ SECTIONS.map(({ key, label }) => {
177
+ const items = insightDetails[key] || [];
178
+ const count = items.length;
179
+ const visibleItems = items.slice(0, MAX_VISIBLE_ITEMS);
180
+ return /* @__PURE__ */ jsxs("div", { className: "mb-4", children: [
181
+ /* @__PURE__ */ jsxs("div", { className: "mb-2 flex items-center justify-between", children: [
182
+ /* @__PURE__ */ jsxs("p", { className: "font-semibold text-foreground", children: [
183
+ label,
184
+ " (",
185
+ count,
186
+ ")"
187
+ ] }),
188
+ count > MAX_VISIBLE_ITEMS && /* @__PURE__ */ jsx(
189
+ "button",
190
+ {
191
+ type: "button",
192
+ className: "text-sm text-primary hover:text-primary",
193
+ onClick: () => setExpandedSection(key),
194
+ children: t("chat:action.viewMore", { defaultValue: "Xem th\xEAm" })
195
+ }
196
+ )
197
+ ] }),
198
+ count > 0 ? /* @__PURE__ */ jsx("div", { className: "space-y-2", children: visibleItems.map((item, idx) => /* @__PURE__ */ jsx(
199
+ InsightItem,
200
+ {
201
+ label: getItemLabel(item)
202
+ },
203
+ `${key}_${idx}`
204
+ )) }) : /* @__PURE__ */ jsx("div", { className: "text-sm text-muted-foreground", children: t("common:empty.noData", {
205
+ defaultValue: "Kh\xF4ng c\xF3 d\u1EEF li\u1EC7u"
206
+ }) })
207
+ ] }, key);
208
+ })
209
+ ] }) });
210
+ };
211
+ export {
212
+ ChatInsight,
213
+ getMessageInsightData
214
+ };