isometrik-plugin-chat-sdk 2.0.5 → 2.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (282) hide show
  1. package/dist/cjs/admin-transfer-dialog.cjs.entry.js +44 -0
  2. package/dist/cjs/admin-transfer-dialog.cjs.entry.js.map +1 -0
  3. package/dist/cjs/{app-globals-dba84d07.js → app-globals-c433d8a6.js} +2 -2
  4. package/dist/cjs/{app-globals-dba84d07.js.map → app-globals-c433d8a6.js.map} +1 -1
  5. package/dist/cjs/attachment-preview_22.cjs.entry.js +201 -61
  6. package/dist/cjs/attachment-preview_22.cjs.entry.js.map +1 -1
  7. package/dist/cjs/audio-bubble_4.cjs.entry.js +9 -9
  8. package/dist/cjs/chat-app.cjs.entry.js +1 -1
  9. package/dist/cjs/chat-document-message-bubble.cjs.entry.js +1 -1
  10. package/dist/cjs/chat-image-message-bubble.cjs.entry.js +1 -1
  11. package/dist/cjs/chat-video-message-bubble.cjs.entry.js +1 -1
  12. package/dist/cjs/delete-message.cjs.entry.js +1 -1
  13. package/dist/cjs/{drawer-811d2ce8.js → drawer-960b3f5d.js} +3 -1
  14. package/dist/cjs/drawer-960b3f5d.js.map +1 -0
  15. package/dist/cjs/forward-memebers.cjs.entry.js +3 -3
  16. package/dist/cjs/forward-message.cjs.entry.js +2 -2
  17. package/dist/cjs/group-admin-leave-b5cfdb33.js +55 -0
  18. package/dist/cjs/group-admin-leave-b5cfdb33.js.map +1 -0
  19. package/dist/cjs/index.cjs.js +2 -2
  20. package/dist/cjs/isometrik-webchat.cjs.js +4 -4
  21. package/dist/cjs/link-preview.cjs.entry.js +1 -1
  22. package/dist/cjs/loader.cjs.js +4 -4
  23. package/dist/cjs/login-page_3.cjs.entry.js +30 -11
  24. package/dist/cjs/login-page_3.cjs.entry.js.map +1 -1
  25. package/dist/cjs/member-add.cjs.entry.js +4 -4
  26. package/dist/cjs/message-bubble.cjs.entry.js +2 -2
  27. package/dist/cjs/my-component.cjs.entry.js +1 -1
  28. package/dist/cjs/{profile-avatar_2.cjs.entry.js → profile-avatar.cjs.entry.js} +1 -25
  29. package/dist/cjs/profile-avatar.cjs.entry.js.map +1 -0
  30. package/dist/cjs/reaction-container.cjs.entry.js +2 -2
  31. package/dist/cjs/{runtime-controls-b5a3836e.js → runtime-controls-95f6cb3b.js} +4 -2
  32. package/dist/cjs/runtime-controls-95f6cb3b.js.map +1 -0
  33. package/dist/cjs/{send-media-2c02bba7.js → send-media-37e09e83.js} +39 -1
  34. package/dist/cjs/send-media-37e09e83.js.map +1 -0
  35. package/dist/cjs/share-popup.cjs.entry.js +1 -1
  36. package/dist/cjs/spinner-loader.cjs.entry.js +32 -0
  37. package/dist/cjs/spinner-loader.cjs.entry.js.map +1 -0
  38. package/dist/collection/collection-manifest.json +1 -0
  39. package/dist/collection/components/ChatUIComponent/AddMember.js +3 -3
  40. package/dist/collection/components/ChatUIComponent/ChatDocumentMessageBubble.js +1 -1
  41. package/dist/collection/components/ChatUIComponent/ChatImageMessageBubble.js +1 -1
  42. package/dist/collection/components/ChatUIComponent/ChatSidebar/ChatSidebar.js +20 -0
  43. package/dist/collection/components/ChatUIComponent/ChatSidebar/ChatSidebar.js.map +1 -1
  44. package/dist/collection/components/ChatUIComponent/ChatVideoMessageBubble.js +1 -1
  45. package/dist/collection/components/ChatUIComponent/Footer/ChatFooter.js +1 -1
  46. package/dist/collection/components/ChatUIComponent/Header/WebChatHeader.js +41 -8
  47. package/dist/collection/components/ChatUIComponent/Header/WebChatHeader.js.map +1 -1
  48. package/dist/collection/components/ChatUIComponent/ReactionContainer.js +2 -2
  49. package/dist/collection/components/ChatUIComponent/WebChatBody/WebChatBody.js +44 -23
  50. package/dist/collection/components/ChatUIComponent/WebChatBody/WebChatBody.js.map +1 -1
  51. package/dist/collection/components/ChatUIComponent/shared/AudioBubble/AudioBubble.js +3 -3
  52. package/dist/collection/components/ChatUIComponent/shared/ForwardMessageList/ForwardMessageList.js +2 -2
  53. package/dist/collection/components/ChatUIComponent/shared/admin-transfer-dialog/admin-transfer-dialog.js +101 -0
  54. package/dist/collection/components/ChatUIComponent/shared/admin-transfer-dialog/admin-transfer-dialog.js.map +1 -0
  55. package/dist/collection/components/ChatUIComponent/shared/attachment-preview/attachment-preview.js +1 -1
  56. package/dist/collection/components/ChatUIComponent/shared/block chatlist/BlockChatList.js +1 -1
  57. package/dist/collection/components/ChatUIComponent/shared/chat-loading-placeholder/chat-loading-placeholder.js +1 -1
  58. package/dist/collection/components/ChatUIComponent/shared/contact-info/contact-info.js +20 -5
  59. package/dist/collection/components/ChatUIComponent/shared/contact-info/contact-info.js.map +1 -1
  60. package/dist/collection/components/ChatUIComponent/shared/delete-message/delete-message.js +1 -1
  61. package/dist/collection/components/ChatUIComponent/shared/document-message/document-message.js +3 -3
  62. package/dist/collection/components/ChatUIComponent/shared/forward-message/forward-message.js +2 -2
  63. package/dist/collection/components/ChatUIComponent/shared/image-message/image-message.js +1 -1
  64. package/dist/collection/components/ChatUIComponent/shared/incoming-text-message-bubble/incoming-text-message-bubble.js +1 -1
  65. package/dist/collection/components/ChatUIComponent/shared/index.js +1 -0
  66. package/dist/collection/components/ChatUIComponent/shared/index.js.map +1 -1
  67. package/dist/collection/components/ChatUIComponent/shared/link-preview/link-preview.js +1 -1
  68. package/dist/collection/components/ChatUIComponent/shared/message-bubble/message-bubble.js +2 -2
  69. package/dist/collection/components/ChatUIComponent/shared/message-date-pill/message-date-pill.js +1 -1
  70. package/dist/collection/components/ChatUIComponent/shared/message-info/message-info.js +1 -1
  71. package/dist/collection/components/ChatUIComponent/shared/message-search/message-search.js +1 -1
  72. package/dist/collection/components/ChatUIComponent/shared/outgoing-text-message-bubble/outgoing-text-message-bubble.js +1 -1
  73. package/dist/collection/components/ChatUIComponent/shared/profile sidebar/profile-sidebar.js +1 -1
  74. package/dist/collection/components/ChatUIComponent/shared/profile-info/profile-info.js +2 -2
  75. package/dist/collection/components/ChatUIComponent/shared/reply-block/reply-block.js +1 -1
  76. package/dist/collection/components/ChatUIComponent/shared/reply-message-container/reply-message-container.js +1 -1
  77. package/dist/collection/components/ChatUIComponent/shared/share-popup/share-popup.js +1 -1
  78. package/dist/collection/components/ChatUIComponent/shared/video-message/video-message.js +2 -2
  79. package/dist/collection/components/chat-main.js +1 -1
  80. package/dist/collection/components/my-component/my-component.js +1 -1
  81. package/dist/collection/components/my-component/web-chat/event-handlers.js +5 -0
  82. package/dist/collection/components/my-component/web-chat/event-handlers.js.map +1 -1
  83. package/dist/collection/components/my-component/web-chat/mqtt-host.js +24 -9
  84. package/dist/collection/components/my-component/web-chat/mqtt-host.js.map +1 -1
  85. package/dist/collection/lib/chat/index.js +1 -1
  86. package/dist/collection/lib/chat/index.js.map +1 -1
  87. package/dist/collection/lib/chat/messages.js +36 -0
  88. package/dist/collection/lib/chat/messages.js.map +1 -1
  89. package/dist/collection/lib/drawer.js +3 -0
  90. package/dist/collection/lib/drawer.js.map +1 -1
  91. package/dist/collection/lib/group-admin-leave.js +47 -0
  92. package/dist/collection/lib/group-admin-leave.js.map +1 -0
  93. package/dist/collection/lib/prompt-exit-group.js +59 -0
  94. package/dist/collection/lib/prompt-exit-group.js.map +1 -0
  95. package/dist/collection/sdk/headless-api.js +3 -1
  96. package/dist/collection/sdk/headless-api.js.map +1 -1
  97. package/dist/components/AudioBubble.js +3 -3
  98. package/dist/components/BlockChatList.js +1 -1
  99. package/dist/components/ChatFooter.js +1 -1
  100. package/dist/components/ChatSidebar.js +21 -1
  101. package/dist/components/ChatSidebar.js.map +1 -1
  102. package/dist/components/WebChat.js +32 -13
  103. package/dist/components/WebChat.js.map +1 -1
  104. package/dist/components/WebChatBody.js +44 -23
  105. package/dist/components/WebChatBody.js.map +1 -1
  106. package/dist/components/WebChatHeader.js +42 -9
  107. package/dist/components/WebChatHeader.js.map +1 -1
  108. package/dist/components/WebchatRightSide.js +4 -35
  109. package/dist/components/WebchatRightSide.js.map +1 -1
  110. package/dist/components/admin-transfer-dialog.d.ts +11 -0
  111. package/dist/components/admin-transfer-dialog.js +69 -0
  112. package/dist/components/admin-transfer-dialog.js.map +1 -0
  113. package/dist/components/attachment-preview2.js +1 -1
  114. package/dist/components/chat-app.js +1 -1
  115. package/dist/components/chat-document-message-bubble.js +1 -1
  116. package/dist/components/chat-image-message-bubble.js +1 -1
  117. package/dist/components/chat-loading-placeholder2.js +1 -1
  118. package/dist/components/chat-video-message-bubble.js +1 -1
  119. package/dist/components/contact-info2.js +22 -6
  120. package/dist/components/contact-info2.js.map +1 -1
  121. package/dist/components/conversation.js +2 -283
  122. package/dist/components/conversation.js.map +1 -1
  123. package/dist/components/delete-message.js +1 -1
  124. package/dist/components/document-message2.js +3 -3
  125. package/dist/components/drawer.js +2 -0
  126. package/dist/components/drawer.js.map +1 -1
  127. package/dist/components/forward-memebers.js +2 -2
  128. package/dist/components/forward-message.js +2 -2
  129. package/dist/components/group-admin-leave.js +50 -0
  130. package/dist/components/group-admin-leave.js.map +1 -0
  131. package/dist/components/group-members.js +298 -26
  132. package/dist/components/group-members.js.map +1 -1
  133. package/dist/components/group-members2.js +37 -0
  134. package/dist/components/group-members2.js.map +1 -0
  135. package/dist/components/image-message2.js +1 -1
  136. package/dist/components/incoming-text-message-bubble2.js +1 -1
  137. package/dist/components/index.js +3 -1
  138. package/dist/components/index.js.map +1 -1
  139. package/dist/components/link-preview2.js +1 -1
  140. package/dist/components/member-add.js +4 -4
  141. package/dist/components/message-bubble2.js +2 -2
  142. package/dist/components/message-date-pill2.js +1 -1
  143. package/dist/components/message-info2.js +1 -1
  144. package/dist/components/message-search2.js +1 -1
  145. package/dist/components/messages.js +37 -1
  146. package/dist/components/messages.js.map +1 -1
  147. package/dist/components/my-component.js +1 -1
  148. package/dist/components/outgoing-text-message-bubble2.js +1 -1
  149. package/dist/components/profile-info2.js +2 -2
  150. package/dist/components/profile-sidebar2.js +1 -1
  151. package/dist/components/prompt-exit-group.js +73 -0
  152. package/dist/components/prompt-exit-group.js.map +1 -0
  153. package/dist/components/reaction-container.js +2 -2
  154. package/dist/components/reply-block2.js +1 -1
  155. package/dist/components/reply-message-container2.js +1 -1
  156. package/dist/components/share-popup.js +1 -1
  157. package/dist/components/video-message2.js +2 -2
  158. package/dist/esm/admin-transfer-dialog.entry.js +40 -0
  159. package/dist/esm/admin-transfer-dialog.entry.js.map +1 -0
  160. package/dist/esm/{app-globals-8fea092d.js → app-globals-dfce8a5b.js} +2 -2
  161. package/dist/esm/{app-globals-8fea092d.js.map → app-globals-dfce8a5b.js.map} +1 -1
  162. package/dist/esm/attachment-preview_22.entry.js +202 -62
  163. package/dist/esm/attachment-preview_22.entry.js.map +1 -1
  164. package/dist/esm/audio-bubble_4.entry.js +9 -9
  165. package/dist/esm/chat-app.entry.js +1 -1
  166. package/dist/esm/chat-document-message-bubble.entry.js +1 -1
  167. package/dist/esm/chat-image-message-bubble.entry.js +1 -1
  168. package/dist/esm/chat-video-message-bubble.entry.js +1 -1
  169. package/dist/esm/delete-message.entry.js +1 -1
  170. package/dist/esm/{drawer-74c188f1.js → drawer-d54c2f10.js} +3 -1
  171. package/dist/esm/drawer-d54c2f10.js.map +1 -0
  172. package/dist/esm/forward-memebers.entry.js +3 -3
  173. package/dist/esm/forward-message.entry.js +2 -2
  174. package/dist/esm/group-admin-leave-a60b9b1a.js +50 -0
  175. package/dist/esm/group-admin-leave-a60b9b1a.js.map +1 -0
  176. package/dist/esm/index.js +3 -3
  177. package/dist/esm/isometrik-webchat.js +4 -4
  178. package/dist/esm/link-preview.entry.js +1 -1
  179. package/dist/esm/loader.js +4 -4
  180. package/dist/esm/login-page_3.entry.js +30 -11
  181. package/dist/esm/login-page_3.entry.js.map +1 -1
  182. package/dist/esm/member-add.entry.js +4 -4
  183. package/dist/esm/message-bubble.entry.js +2 -2
  184. package/dist/esm/my-component.entry.js +1 -1
  185. package/dist/esm/{profile-avatar_2.entry.js → profile-avatar.entry.js} +2 -25
  186. package/dist/esm/profile-avatar.entry.js.map +1 -0
  187. package/dist/esm/reaction-container.entry.js +2 -2
  188. package/dist/esm/{runtime-controls-c5ba5009.js → runtime-controls-ec6d5c75.js} +4 -2
  189. package/dist/esm/runtime-controls-ec6d5c75.js.map +1 -0
  190. package/dist/esm/{send-media-588837c7.js → send-media-a946c6dd.js} +38 -2
  191. package/dist/esm/send-media-a946c6dd.js.map +1 -0
  192. package/dist/esm/share-popup.entry.js +1 -1
  193. package/dist/esm/spinner-loader.entry.js +28 -0
  194. package/dist/esm/spinner-loader.entry.js.map +1 -0
  195. package/dist/isometrik-webchat/index.esm.js +1 -1
  196. package/dist/isometrik-webchat/isometrik-webchat.esm.js +1 -1
  197. package/dist/isometrik-webchat/isometrik-webchat.esm.js.map +1 -1
  198. package/dist/isometrik-webchat/{p-a876991d.entry.js → p-0ccfbe90.entry.js} +2 -2
  199. package/dist/isometrik-webchat/{p-1854b156.entry.js → p-161fcb35.entry.js} +2 -2
  200. package/dist/isometrik-webchat/{p-a43ad157.entry.js → p-1eecc7c5.entry.js} +2 -2
  201. package/dist/isometrik-webchat/{p-fdd327f5.entry.js → p-2195b0c0.entry.js} +2 -2
  202. package/dist/isometrik-webchat/p-2e9974e1.entry.js +2 -0
  203. package/dist/isometrik-webchat/p-30dc94e0.js +2 -0
  204. package/dist/isometrik-webchat/p-30dc94e0.js.map +1 -0
  205. package/dist/isometrik-webchat/p-35d9ecdc.entry.js +2 -0
  206. package/dist/isometrik-webchat/p-35d9ecdc.entry.js.map +1 -0
  207. package/dist/isometrik-webchat/{p-c1e8c38e.entry.js → p-3664e0ad.entry.js} +2 -2
  208. package/dist/isometrik-webchat/p-3f355f9e.js +2 -0
  209. package/dist/isometrik-webchat/p-3f355f9e.js.map +1 -0
  210. package/dist/isometrik-webchat/p-46dcd38f.js +2 -0
  211. package/dist/isometrik-webchat/p-46dcd38f.js.map +1 -0
  212. package/dist/isometrik-webchat/p-46e0048e.js +2 -0
  213. package/dist/isometrik-webchat/p-46e0048e.js.map +1 -0
  214. package/dist/isometrik-webchat/p-48ce4dca.entry.js +2 -0
  215. package/dist/isometrik-webchat/{p-d720cf14.entry.js → p-76341adb.entry.js} +2 -2
  216. package/dist/isometrik-webchat/{p-2d3e8cd4.entry.js → p-7af9a7f3.entry.js} +2 -2
  217. package/dist/isometrik-webchat/p-7b25f234.entry.js +2 -0
  218. package/dist/isometrik-webchat/p-7b25f234.entry.js.map +1 -0
  219. package/dist/isometrik-webchat/p-86be30fe.js +2 -0
  220. package/dist/isometrik-webchat/p-9db196a4.entry.js +2 -0
  221. package/dist/isometrik-webchat/p-9db196a4.entry.js.map +1 -0
  222. package/dist/isometrik-webchat/p-a119be75.entry.js +2 -0
  223. package/dist/isometrik-webchat/p-a119be75.entry.js.map +1 -0
  224. package/dist/isometrik-webchat/p-ad02a8ca.entry.js +2 -0
  225. package/dist/isometrik-webchat/p-c5bff6a1.entry.js +2 -0
  226. package/dist/isometrik-webchat/p-c5bff6a1.entry.js.map +1 -0
  227. package/dist/isometrik-webchat/p-c83e2d5d.entry.js +2 -0
  228. package/dist/isometrik-webchat/{p-fb705915.entry.js → p-cc5b86e6.entry.js} +2 -2
  229. package/dist/isometrik-webchat/{p-f1fbf3be.entry.js → p-d8b65cf4.entry.js} +2 -2
  230. package/dist/isometrik-webchat/p-e48a1217.entry.js +2 -0
  231. package/dist/types/components/ChatUIComponent/Header/WebChatHeader.d.ts +1 -0
  232. package/dist/types/components/ChatUIComponent/shared/admin-transfer-dialog/admin-transfer-dialog.d.ts +13 -0
  233. package/dist/types/components/ChatUIComponent/shared/contact-info/contact-info.d.ts +1 -0
  234. package/dist/types/components/ChatUIComponent/shared/index.d.ts +1 -0
  235. package/dist/types/components.d.ts +27 -0
  236. package/dist/types/lib/chat/index.d.ts +1 -1
  237. package/dist/types/lib/drawer.d.ts +1 -0
  238. package/dist/types/lib/group-admin-leave.d.ts +20 -0
  239. package/dist/types/lib/prompt-exit-group.d.ts +9 -0
  240. package/dist/types/sdk/headless-api.d.ts +3 -1
  241. package/package.json +1 -1
  242. package/dist/cjs/drawer-811d2ce8.js.map +0 -1
  243. package/dist/cjs/profile-avatar_2.cjs.entry.js.map +0 -1
  244. package/dist/cjs/runtime-controls-b5a3836e.js.map +0 -1
  245. package/dist/cjs/send-media-2c02bba7.js.map +0 -1
  246. package/dist/esm/drawer-74c188f1.js.map +0 -1
  247. package/dist/esm/profile-avatar_2.entry.js.map +0 -1
  248. package/dist/esm/runtime-controls-c5ba5009.js.map +0 -1
  249. package/dist/esm/send-media-588837c7.js.map +0 -1
  250. package/dist/isometrik-webchat/p-0392c7be.entry.js +0 -2
  251. package/dist/isometrik-webchat/p-1a6e6524.js +0 -2
  252. package/dist/isometrik-webchat/p-1a6e6524.js.map +0 -1
  253. package/dist/isometrik-webchat/p-3c70c22c.entry.js +0 -2
  254. package/dist/isometrik-webchat/p-5d243250.entry.js +0 -2
  255. package/dist/isometrik-webchat/p-70f66001.js +0 -2
  256. package/dist/isometrik-webchat/p-70f66001.js.map +0 -1
  257. package/dist/isometrik-webchat/p-8816acc1.js +0 -2
  258. package/dist/isometrik-webchat/p-92eec03b.entry.js +0 -2
  259. package/dist/isometrik-webchat/p-92eec03b.entry.js.map +0 -1
  260. package/dist/isometrik-webchat/p-b16c3db0.entry.js +0 -2
  261. package/dist/isometrik-webchat/p-b16c3db0.entry.js.map +0 -1
  262. package/dist/isometrik-webchat/p-b857775d.entry.js +0 -2
  263. package/dist/isometrik-webchat/p-c0c19621.entry.js +0 -2
  264. package/dist/isometrik-webchat/p-dd62bd69.js +0 -2
  265. package/dist/isometrik-webchat/p-dd62bd69.js.map +0 -1
  266. package/dist/isometrik-webchat/p-ed4699a0.entry.js +0 -2
  267. package/dist/isometrik-webchat/p-ed4699a0.entry.js.map +0 -1
  268. /package/dist/isometrik-webchat/{p-a876991d.entry.js.map → p-0ccfbe90.entry.js.map} +0 -0
  269. /package/dist/isometrik-webchat/{p-1854b156.entry.js.map → p-161fcb35.entry.js.map} +0 -0
  270. /package/dist/isometrik-webchat/{p-a43ad157.entry.js.map → p-1eecc7c5.entry.js.map} +0 -0
  271. /package/dist/isometrik-webchat/{p-fdd327f5.entry.js.map → p-2195b0c0.entry.js.map} +0 -0
  272. /package/dist/isometrik-webchat/{p-3c70c22c.entry.js.map → p-2e9974e1.entry.js.map} +0 -0
  273. /package/dist/isometrik-webchat/{p-c1e8c38e.entry.js.map → p-3664e0ad.entry.js.map} +0 -0
  274. /package/dist/isometrik-webchat/{p-b857775d.entry.js.map → p-48ce4dca.entry.js.map} +0 -0
  275. /package/dist/isometrik-webchat/{p-d720cf14.entry.js.map → p-76341adb.entry.js.map} +0 -0
  276. /package/dist/isometrik-webchat/{p-2d3e8cd4.entry.js.map → p-7af9a7f3.entry.js.map} +0 -0
  277. /package/dist/isometrik-webchat/{p-8816acc1.js.map → p-86be30fe.js.map} +0 -0
  278. /package/dist/isometrik-webchat/{p-5d243250.entry.js.map → p-ad02a8ca.entry.js.map} +0 -0
  279. /package/dist/isometrik-webchat/{p-c0c19621.entry.js.map → p-c83e2d5d.entry.js.map} +0 -0
  280. /package/dist/isometrik-webchat/{p-fb705915.entry.js.map → p-cc5b86e6.entry.js.map} +0 -0
  281. /package/dist/isometrik-webchat/{p-f1fbf3be.entry.js.map → p-d8b65cf4.entry.js.map} +0 -0
  282. /package/dist/isometrik-webchat/{p-0392c7be.entry.js.map → p-e48a1217.entry.js.map} +0 -0
@@ -202,21 +202,39 @@ const WebChatBody = /*@__PURE__*/ proxyCustomElement(class WebChatBody extends H
202
202
  };
203
203
  this.putReadAll = async () => {
204
204
  var _a, _b;
205
- const hasUnreadMessages = (_a = this.allMessages) === null || _a === void 0 ? void 0 : _a.some(message => { var _a, _b; return ((message === null || message === void 0 ? void 0 : message.senderId) || ((_a = message === null || message === void 0 ? void 0 : message.senderInfo) === null || _a === void 0 ? void 0 : _a.userId)) != ((_b = this.userMetaData) === null || _b === void 0 ? void 0 : _b.userId) && !(message === null || message === void 0 ? void 0 : message.readByAll); });
206
- if (hasUnreadMessages) {
205
+ if (!this.selectedConversationId)
206
+ return;
207
+ const hasUnreadMessages = (_a = this.allMessages) === null || _a === void 0 ? void 0 : _a.some(message => {
208
+ var _a, _b;
209
+ return ((message === null || message === void 0 ? void 0 : message.senderId) || ((_a = message === null || message === void 0 ? void 0 : message.senderInfo) === null || _a === void 0 ? void 0 : _a.userId)) != ((_b = this.userMetaData) === null || _b === void 0 ? void 0 : _b.userId) &&
210
+ !(message === null || message === void 0 ? void 0 : message.readByAll);
211
+ });
212
+ // Always hit the server on open/visible — unread flags on local rows race and miss.
213
+ try {
207
214
  await M.getInstance().message.putRead({ conversationId: this.selectedConversationId });
208
- const newUpdatedAllMessages = (_b = this.allMessages) === null || _b === void 0 ? void 0 : _b.map(message => { var _a, _b; return (message === null || message === void 0 ? void 0 : message.readByAll) != true && ((message === null || message === void 0 ? void 0 : message.senderId) || ((_a = message === null || message === void 0 ? void 0 : message.senderInfo) === null || _a === void 0 ? void 0 : _a.userId)) != ((_b = this.userMetaData) === null || _b === void 0 ? void 0 : _b.userId) ? Object.assign(Object.assign({}, message), { readByAll: true }) : message; });
215
+ }
216
+ catch (err) {
217
+ console.warn('[webchat] putRead failed', err);
218
+ return;
219
+ }
220
+ if (hasUnreadMessages) {
221
+ const newUpdatedAllMessages = (_b = this.allMessages) === null || _b === void 0 ? void 0 : _b.map(message => {
222
+ var _a, _b;
223
+ return (message === null || message === void 0 ? void 0 : message.readByAll) != true &&
224
+ ((message === null || message === void 0 ? void 0 : message.senderId) || ((_a = message === null || message === void 0 ? void 0 : message.senderInfo) === null || _a === void 0 ? void 0 : _a.userId)) != ((_b = this.userMetaData) === null || _b === void 0 ? void 0 : _b.userId)
225
+ ? Object.assign(Object.assign({}, message), { readByAll: true }) : message;
226
+ });
209
227
  this.updateAllMessages(newUpdatedAllMessages);
210
- this.el.dispatchEvent(new CustomEvent('message-read-status-updated', {
211
- bubbles: true,
212
- composed: true,
213
- detail: {
214
- conversationId: this.selectedConversationId,
215
- isRead: true,
216
- isDelivered: true,
217
- },
218
- }));
219
228
  }
229
+ this.el.dispatchEvent(new CustomEvent('message-read-status-updated', {
230
+ bubbles: true,
231
+ composed: true,
232
+ detail: {
233
+ conversationId: this.selectedConversationId,
234
+ isRead: true,
235
+ isDelivered: true,
236
+ },
237
+ }));
220
238
  };
221
239
  this.handleVisibilityChange = async () => {
222
240
  if (document.visibilityState === 'visible') {
@@ -490,7 +508,7 @@ const WebChatBody = /*@__PURE__*/ proxyCustomElement(class WebChatBody extends H
490
508
  this.messageDate = '';
491
509
  this.messageDeliveryTime = 0;
492
510
  this.messageReadTime = 0;
493
- this.showScrollButton = true;
511
+ this.showScrollButton = false;
494
512
  this.isScrolling = false;
495
513
  this.unreadMessageCount = 0;
496
514
  this.isChatBodyUnscrollable = false;
@@ -832,21 +850,24 @@ const WebChatBody = /*@__PURE__*/ proxyCustomElement(class WebChatBody extends H
832
850
  var _a, _b, _c, _d, _e, _f, _g, _h;
833
851
  const currentConversation = (_a = this.conversationList) === null || _a === void 0 ? void 0 : _a.find(conversation => (conversation === null || conversation === void 0 ? void 0 : conversation.conversationId) === this.selectedConversationId);
834
852
  const shouldShowPlaceholder = ((_b = this.allMessages) === null || _b === void 0 ? void 0 : _b.length) === 1 && ((_d = (_c = this.allMessages) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.action) !== 'clearConversation' && ((_e = this.allMessages) === null || _e === void 0 ? void 0 : _e.some(message => (message === null || message === void 0 ? void 0 : message.action) === 'clearConversation'));
835
- return (h("div", { key: 'fcb897b1540131642caba826fe6551d06a7ac9c9', class: `chat-body ${this.isChatBodyUnscrollable ? 'unscrollable' : null}` }, this.showScrollButton || this.newMessageNotification && (h("div", { key: '1232ce848507a42e5dbd73708f57b10966511f6c', onClick: this.scrollToBottom, style: {
853
+ return (h("div", { key: '04d498fc21493a71497a28f855d184eb14e32763', class: `chat-body ${this.isChatBodyUnscrollable ? 'unscrollable' : null}` }, (this.showScrollButton || this.newMessageNotification) && (h("div", { key: '42c9a73991cfb913403d104dce510ba6ca9eb5bb', class: "jump-latest", onClick: this.scrollToBottom, role: "button", "aria-label": "Jump to latest messages", style: {
836
854
  position: 'sticky',
837
- top: '90%',
838
- left: '95%',
839
- backgroundColor: 'var(--bg-secondary-color)',
855
+ bottom: '1rem',
856
+ marginLeft: 'auto',
857
+ marginRight: '1rem',
858
+ marginTop: '-2.5rem',
859
+ backgroundColor: 'var(--bg-primary, #fff)',
860
+ border: '1px solid var(--border, #e4e4e7)',
840
861
  borderRadius: '50%',
841
- width: '30px',
842
- height: '30px',
862
+ width: '2.5rem',
863
+ height: '2.5rem',
843
864
  display: 'flex',
844
865
  alignItems: 'center',
845
866
  justifyContent: 'center',
846
867
  cursor: 'pointer',
847
- boxShadow: '0 2px 5px rgba(0,0,0,0.2)',
868
+ boxShadow: '0 2px 8px rgba(0,0,0,0.14)',
848
869
  zIndex: '100',
849
- } }, ((_f = this.newMessageNotification) === null || _f === void 0 ? void 0 : _f.count) > 0 && (h("div", { key: 'f37caffdf257d82abefde7490978fc107d8befb5', style: {
870
+ } }, ((_f = this.newMessageNotification) === null || _f === void 0 ? void 0 : _f.count) > 0 && (h("div", { key: '2004cdee625a06da51879110339379878072d93f', style: {
850
871
  position: 'absolute',
851
872
  bottom: '22px',
852
873
  right: '-2px',
@@ -860,7 +881,7 @@ const WebChatBody = /*@__PURE__*/ proxyCustomElement(class WebChatBody extends H
860
881
  justifyContent: 'center',
861
882
  fontSize: '12px',
862
883
  padding: '0 4px',
863
- } })), h("svg", { key: '07567e171c2f415dab0e3c87b1e42cb9ae994c9d', width: "20px", height: "30px", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { key: '919b12ffce28266d6f7a1de58876488f2b4cec59', d: "M12 5V19M12 19L19 12M12 19L5 12", stroke: "var(--text-primary-color)", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" })))), shouldShowPlaceholder && (h("div", { key: 'dd06f9a496736731adf73db4eb68ed9bffdaf7a4', style: {
884
+ } })), h("svg", { key: '12e09d0c2ac7327e64ae671ebb1ce406ca0a5538', width: "20px", height: "30px", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { key: 'e67f759077573794ea5923aeaff2a18143ec1887', d: "M12 5V19M12 19L19 12M12 19L5 12", stroke: "var(--text-primary-color)", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" })))), shouldShowPlaceholder && (h("div", { key: 'ad56d354279bc44df4e53a583976cb02f208bdc8', style: {
864
885
  display: 'flex',
865
886
  flexDirection: 'column',
866
887
  alignItems: 'center',
@@ -870,7 +891,7 @@ const WebChatBody = /*@__PURE__*/ proxyCustomElement(class WebChatBody extends H
870
891
  textAlign: 'center',
871
892
  color: 'var(--text-secondary-color)',
872
893
  marginTop: '20px',
873
- } }, h("img", { key: '7a3a75d2fd64671ce5384180794169356d524d07', src: NoMessagePlaceholder, alt: "No messages", style: { width: '200px', height: '200px' } }), h("div", { key: '3cc5745e16a98a047c4633e4fc5c5b0bfcfc1b5c', style: { display: 'flex', flexDirection: 'column', alignItems: 'center', gap: '10px' } }, h("span", { key: 'febc50bf7352f62d97443f8518611a662712b9c3', style: { fontSize: '24px', color: 'var(--text-primary-color)' } }, "No messages"), h("span", { key: '80e42faea0eb8ea092b8499ba3d9833033de45e5', style: { fontSize: '16px', color: 'var(--text-secondary-color)' } }, "Send a \"Hi\" and make someone's day brighter!")))), this.isMessagesLoading && (h("spinner-loader", { key: '31c0a6c01075d2cc291a8f26cb59cacdf4c05f7d', height: "20px", width: "20px", spinTime: "1s", spinnerPrimaryColor: "#000", spinnerSecondaryColor: "var(--bg-grey-color)", spinnerBorderWidth: "3px" })), ((_g = this.allMessages) === null || _g === void 0 ? void 0 : _g.length) > 0 &&
894
+ } }, h("img", { key: 'bd08d76f2db678ee4af1aae5d39bf0ae3c083b6f', src: NoMessagePlaceholder, alt: "No messages", style: { width: '200px', height: '200px' } }), h("div", { key: '1fbb6c63dbc25065bf7248c4e03503b6693901d4', style: { display: 'flex', flexDirection: 'column', alignItems: 'center', gap: '10px' } }, h("span", { key: 'ffdfd34864bfa277e433ced72e0de8670301b86b', style: { fontSize: '24px', color: 'var(--text-primary-color)' } }, "No messages"), h("span", { key: '5c3827cbd2ab1dacb9f75f248d7bbf4c83b33e89', style: { fontSize: '16px', color: 'var(--text-secondary-color)' } }, "Send a \"Hi\" and make someone's day brighter!")))), this.isMessagesLoading && (h("spinner-loader", { key: '88169d80e7d17419beb4094b3ce89f91927d8784', height: "20px", width: "20px", spinTime: "1s", spinnerPrimaryColor: "#000", spinnerSecondaryColor: "var(--bg-grey-color)", spinnerBorderWidth: "3px" })), ((_g = this.allMessages) === null || _g === void 0 ? void 0 : _g.length) > 0 &&
874
895
  ((_h = this.userMetaData) === null || _h === void 0 ? void 0 : _h.userId) &&
875
896
  (() => {
876
897
  const total = this.allMessages.length;