@sendbird/uikit-react 3.0.0 → 3.0.2-beta.1

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 (422) hide show
  1. package/App.js +40 -32
  2. package/App.js.map +1 -1
  3. package/CHANGELOG.md +28 -0
  4. package/Channel/components/ChannelHeader.js +17 -17
  5. package/Channel/components/ChannelUI.js +29 -25
  6. package/Channel/components/ChannelUI.js.map +1 -1
  7. package/Channel/components/FileViewer.js +16 -16
  8. package/Channel/components/FrozenNotification.js +5 -5
  9. package/Channel/components/Message.js +21 -21
  10. package/Channel/components/MessageInput.js +18 -18
  11. package/Channel/components/MessageList.js +28 -24
  12. package/Channel/components/MessageList.js.map +1 -1
  13. package/Channel/components/RemoveMessageModal.js +19 -19
  14. package/Channel/components/SuggestedMentionList.js +17 -17
  15. package/Channel/components/TypingIndicator.js +19 -17
  16. package/Channel/components/TypingIndicator.js.map +1 -1
  17. package/Channel/components/UnreadCount.js +5 -5
  18. package/Channel/context.js +15 -15
  19. package/Channel.js +24 -24
  20. package/ChannelList/components/AddChannel.js +14 -14
  21. package/ChannelList/components/ChannelListHeader.js +7 -7
  22. package/ChannelList/components/ChannelListUI.js +54 -35
  23. package/ChannelList/components/ChannelListUI.js.map +1 -1
  24. package/ChannelList/components/ChannelPreview.js +21 -21
  25. package/ChannelList/components/ChannelPreviewAction.js +16 -16
  26. package/ChannelList/context.js +10 -10
  27. package/ChannelList.js +28 -28
  28. package/ChannelList.js.map +1 -1
  29. package/{ChannelListProvider-bc1f14ac.js → ChannelListProvider-551b956e.js} +43 -29
  30. package/ChannelListProvider-551b956e.js.map +1 -0
  31. package/{ChannelProvider-3d7434a2.js → ChannelProvider-f2229414.js} +21 -15
  32. package/ChannelProvider-f2229414.js.map +1 -0
  33. package/ChannelSettings/components/ChannelProfile.js +13 -13
  34. package/ChannelSettings/components/ChannelSettingsUI.js +18 -18
  35. package/ChannelSettings/components/EditDetailsModal.js +13 -13
  36. package/ChannelSettings/components/LeaveChannel.js +10 -10
  37. package/ChannelSettings/components/ModerationPanel.js +15 -15
  38. package/ChannelSettings/components/UserListItem.js +12 -12
  39. package/ChannelSettings/components/UserPanel.js +14 -14
  40. package/ChannelSettings/context.js +3 -3
  41. package/ChannelSettings/context.js.map +1 -1
  42. package/ChannelSettings.js +18 -18
  43. package/CreateChannel/components/CreateChannelUI.js +21 -17
  44. package/CreateChannel/components/CreateChannelUI.js.map +1 -1
  45. package/CreateChannel/components/InviteUsers.js +51 -41
  46. package/CreateChannel/components/InviteUsers.js.map +1 -1
  47. package/CreateChannel/components/SelectChannelType.js +10 -10
  48. package/CreateChannel/context.js +4 -4
  49. package/CreateChannel.js +14 -14
  50. package/{CreateChannelProvider-8464145a.js → CreateChannelProvider-15dfa1af.js} +1 -1
  51. package/CreateChannelProvider-15dfa1af.js.map +1 -0
  52. package/EditUserProfile/components/EditUserProfileUI.js +13 -13
  53. package/EditUserProfile.js +13 -13
  54. package/{LocalizationContext-4b1ec8b9.js → LocalizationContext-cf80416c.js} +3 -3
  55. package/{LocalizationContext-4b1ec8b9.js.map → LocalizationContext-cf80416c.js.map} +1 -1
  56. package/{MemberList-0f94f1c7.js → MemberList-f79c33ff.js} +24 -20
  57. package/MemberList-f79c33ff.js.map +1 -0
  58. package/MessageSearch/components/MessageSearchUI.js +11 -11
  59. package/MessageSearch/context.js +2 -2
  60. package/MessageSearch.js +11 -11
  61. package/OpenChannel/components/FrozenChannelNotification.js +5 -5
  62. package/OpenChannel/components/OpenChannelHeader.js +14 -14
  63. package/OpenChannel/components/OpenChannelInput.js +18 -18
  64. package/OpenChannel/components/OpenChannelMessage.js +23 -23
  65. package/OpenChannel/components/OpenChannelMessageList.js +25 -25
  66. package/OpenChannel/components/OpenChannelUI.js +25 -25
  67. package/OpenChannel/context.js +11 -11
  68. package/OpenChannel.js +25 -25
  69. package/{OpenChannelProvider-c9d83594.js → OpenChannelProvider-e5364b83.js} +9 -9
  70. package/{OpenChannelProvider-c9d83594.js.map → OpenChannelProvider-e5364b83.js.map} +1 -1
  71. package/OpenChannelSettings/components/EditDetailsModal.js +13 -13
  72. package/OpenChannelSettings/components/OpenChannelProfile.js +13 -13
  73. package/OpenChannelSettings/components/OpenChannelSettingsUI.js +17 -17
  74. package/OpenChannelSettings/components/OperatorUI.js +16 -16
  75. package/OpenChannelSettings/components/ParticipantUI.js +14 -14
  76. package/OpenChannelSettings/context.js +2 -2
  77. package/OpenChannelSettings.js +17 -17
  78. package/SendbirdProvider.js +67 -37
  79. package/SendbirdProvider.js.map +1 -1
  80. package/{UserProfileContext-d0287bb6.js → UserProfileContext-977db3ff.js} +1 -1
  81. package/{UserProfileContext-d0287bb6.js.map → UserProfileContext-977db3ff.js.map} +1 -1
  82. package/__bundle-7dfccc8c-db2ded0f.js +4396 -0
  83. package/__bundle-7dfccc8c-db2ded0f.js.map +1 -0
  84. package/{_rollupPluginBabelHelpers-abbcef5e.js → _rollupPluginBabelHelpers-fdcfbfcc.js} +1 -1
  85. package/{_rollupPluginBabelHelpers-abbcef5e.js.map → _rollupPluginBabelHelpers-fdcfbfcc.js.map} +1 -1
  86. package/{actionTypes-d0ccd7e4.js → actionTypes-6075fcef.js} +1 -1
  87. package/{actionTypes-d0ccd7e4.js.map → actionTypes-6075fcef.js.map} +1 -1
  88. package/cjs/App.js +40 -32
  89. package/cjs/App.js.map +1 -1
  90. package/cjs/Channel/components/ChannelHeader.js +17 -17
  91. package/cjs/Channel/components/ChannelUI.js +29 -25
  92. package/cjs/Channel/components/ChannelUI.js.map +1 -1
  93. package/cjs/Channel/components/FileViewer.js +16 -16
  94. package/cjs/Channel/components/FrozenNotification.js +5 -5
  95. package/cjs/Channel/components/Message.js +21 -21
  96. package/cjs/Channel/components/MessageInput.js +18 -18
  97. package/cjs/Channel/components/MessageList.js +28 -24
  98. package/cjs/Channel/components/MessageList.js.map +1 -1
  99. package/cjs/Channel/components/RemoveMessageModal.js +19 -19
  100. package/cjs/Channel/components/SuggestedMentionList.js +17 -17
  101. package/cjs/Channel/components/TypingIndicator.js +19 -17
  102. package/cjs/Channel/components/TypingIndicator.js.map +1 -1
  103. package/cjs/Channel/components/UnreadCount.js +5 -5
  104. package/cjs/Channel/context.js +15 -15
  105. package/cjs/Channel.js +24 -24
  106. package/cjs/ChannelList/components/AddChannel.js +14 -14
  107. package/cjs/ChannelList/components/ChannelListHeader.js +7 -7
  108. package/cjs/ChannelList/components/ChannelListUI.js +53 -34
  109. package/cjs/ChannelList/components/ChannelListUI.js.map +1 -1
  110. package/cjs/ChannelList/components/ChannelPreview.js +21 -21
  111. package/cjs/ChannelList/components/ChannelPreviewAction.js +16 -16
  112. package/cjs/ChannelList/context.js +10 -10
  113. package/cjs/ChannelList.js +28 -28
  114. package/cjs/ChannelList.js.map +1 -1
  115. package/cjs/{ChannelListProvider-8157ae01.js → ChannelListProvider-a78dcace.js} +43 -29
  116. package/cjs/ChannelListProvider-a78dcace.js.map +1 -0
  117. package/cjs/{ChannelProvider-793fddf5.js → ChannelProvider-1c64ff8e.js} +21 -15
  118. package/cjs/ChannelProvider-1c64ff8e.js.map +1 -0
  119. package/cjs/ChannelSettings/components/ChannelProfile.js +13 -13
  120. package/cjs/ChannelSettings/components/ChannelSettingsUI.js +18 -18
  121. package/cjs/ChannelSettings/components/EditDetailsModal.js +13 -13
  122. package/cjs/ChannelSettings/components/LeaveChannel.js +10 -10
  123. package/cjs/ChannelSettings/components/ModerationPanel.js +15 -15
  124. package/cjs/ChannelSettings/components/UserListItem.js +12 -12
  125. package/cjs/ChannelSettings/components/UserPanel.js +14 -14
  126. package/cjs/ChannelSettings/context.js +3 -3
  127. package/cjs/ChannelSettings/context.js.map +1 -1
  128. package/cjs/ChannelSettings.js +18 -18
  129. package/cjs/CreateChannel/components/CreateChannelUI.js +21 -17
  130. package/cjs/CreateChannel/components/CreateChannelUI.js.map +1 -1
  131. package/cjs/CreateChannel/components/InviteUsers.js +51 -41
  132. package/cjs/CreateChannel/components/InviteUsers.js.map +1 -1
  133. package/cjs/CreateChannel/components/SelectChannelType.js +10 -10
  134. package/cjs/CreateChannel/context.js +4 -4
  135. package/cjs/CreateChannel.js +14 -14
  136. package/cjs/{CreateChannelProvider-b462ce84.js → CreateChannelProvider-d3305abc.js} +1 -1
  137. package/cjs/CreateChannelProvider-d3305abc.js.map +1 -0
  138. package/cjs/EditUserProfile/components/EditUserProfileUI.js +13 -13
  139. package/cjs/EditUserProfile.js +13 -13
  140. package/cjs/{LocalizationContext-855bfc31.js → LocalizationContext-baf1fe9b.js} +3 -3
  141. package/cjs/{LocalizationContext-855bfc31.js.map → LocalizationContext-baf1fe9b.js.map} +1 -1
  142. package/cjs/{MemberList-c446abed.js → MemberList-95fc8f1a.js} +24 -20
  143. package/cjs/MemberList-95fc8f1a.js.map +1 -0
  144. package/cjs/MessageSearch/components/MessageSearchUI.js +11 -11
  145. package/cjs/MessageSearch/context.js +2 -2
  146. package/cjs/MessageSearch.js +11 -11
  147. package/cjs/OpenChannel/components/FrozenChannelNotification.js +5 -5
  148. package/cjs/OpenChannel/components/OpenChannelHeader.js +14 -14
  149. package/cjs/OpenChannel/components/OpenChannelInput.js +18 -18
  150. package/cjs/OpenChannel/components/OpenChannelMessage.js +23 -23
  151. package/cjs/OpenChannel/components/OpenChannelMessageList.js +25 -25
  152. package/cjs/OpenChannel/components/OpenChannelUI.js +25 -25
  153. package/cjs/OpenChannel/context.js +11 -11
  154. package/cjs/OpenChannel.js +25 -25
  155. package/cjs/{OpenChannelProvider-2264dc27.js → OpenChannelProvider-cc9ee134.js} +9 -9
  156. package/cjs/{OpenChannelProvider-2264dc27.js.map → OpenChannelProvider-cc9ee134.js.map} +1 -1
  157. package/cjs/OpenChannelSettings/components/EditDetailsModal.js +13 -13
  158. package/cjs/OpenChannelSettings/components/OpenChannelProfile.js +13 -13
  159. package/cjs/OpenChannelSettings/components/OpenChannelSettingsUI.js +17 -17
  160. package/cjs/OpenChannelSettings/components/OperatorUI.js +16 -16
  161. package/cjs/OpenChannelSettings/components/ParticipantUI.js +14 -14
  162. package/cjs/OpenChannelSettings/context.js +2 -2
  163. package/cjs/OpenChannelSettings.js +17 -17
  164. package/cjs/SendbirdProvider.js +67 -37
  165. package/cjs/SendbirdProvider.js.map +1 -1
  166. package/cjs/{UserProfileContext-627c1f20.js → UserProfileContext-d4c230c3.js} +1 -1
  167. package/cjs/{UserProfileContext-627c1f20.js.map → UserProfileContext-d4c230c3.js.map} +1 -1
  168. package/cjs/__bundle-7dfccc8c-e40d0934.js +4523 -0
  169. package/cjs/__bundle-7dfccc8c-e40d0934.js.map +1 -0
  170. package/cjs/{_rollupPluginBabelHelpers-89a197f1.js → _rollupPluginBabelHelpers-29633c69.js} +1 -1
  171. package/cjs/{_rollupPluginBabelHelpers-89a197f1.js.map → _rollupPluginBabelHelpers-29633c69.js.map} +1 -1
  172. package/cjs/{actionTypes-3f5d873f.js → actionTypes-27fdf504.js} +1 -1
  173. package/cjs/{actionTypes-3f5d873f.js.map → actionTypes-27fdf504.js.map} +1 -1
  174. package/cjs/{color-894bd822.js → color-10db49db.js} +1 -1
  175. package/cjs/{color-894bd822.js.map → color-10db49db.js.map} +1 -1
  176. package/cjs/{compareIds-bc1f1524.js → compareIds-b6c1549b.js} +1 -1
  177. package/cjs/{compareIds-bc1f1524.js.map → compareIds-b6c1549b.js.map} +1 -1
  178. package/cjs/{const-8fdee18a.js → const-216f25a9.js} +1 -1
  179. package/cjs/{const-8fdee18a.js.map → const-216f25a9.js.map} +1 -1
  180. package/cjs/{const-bb23ef90.js → const-7cba20e4.js} +1 -1
  181. package/cjs/{const-bb23ef90.js.map → const-7cba20e4.js.map} +1 -1
  182. package/cjs/{context-f07caf29.js → context-1bb3f131.js} +2 -2
  183. package/cjs/{context-f07caf29.js.map → context-1bb3f131.js.map} +1 -1
  184. package/cjs/dist/index.css +93 -93
  185. package/cjs/dist/index.css.map +1 -1
  186. package/cjs/{groupChannel-64ff0a33.js → groupChannel-7c2201a9.js} +2 -2
  187. package/cjs/{groupChannel-64ff0a33.js.map → groupChannel-7c2201a9.js.map} +1 -1
  188. package/cjs/{index-a7643049.js → index-31de37a9.js} +3 -3
  189. package/cjs/{index-a7643049.js.map → index-31de37a9.js.map} +1 -1
  190. package/cjs/{index-2ce368ff.js → index-4aac2260.js} +4 -4
  191. package/cjs/{index-2ce368ff.js.map → index-4aac2260.js.map} +1 -1
  192. package/cjs/{index-47e86329.js → index-802a624a.js} +2 -2
  193. package/cjs/{index-47e86329.js.map → index-802a624a.js.map} +1 -1
  194. package/cjs/{index-3dd33e71.js → index-885e6586.js} +2 -2
  195. package/cjs/{index-3dd33e71.js.map → index-885e6586.js.map} +1 -1
  196. package/cjs/{index-9bc1ab0f.js → index-8a02c34e.js} +2 -2
  197. package/cjs/{index-9bc1ab0f.js.map → index-8a02c34e.js.map} +1 -1
  198. package/cjs/{index-3298ba2f.js → index-9f277fa2.js} +4 -4
  199. package/cjs/{index-3298ba2f.js.map → index-9f277fa2.js.map} +1 -1
  200. package/cjs/{index-c730dbc7.js → index-c5e7bc6f.js} +6 -6
  201. package/cjs/{index-c730dbc7.js.map → index-c5e7bc6f.js.map} +1 -1
  202. package/cjs/{index-d85e4159.js → index-d4396be3.js} +1 -1
  203. package/cjs/{index-d85e4159.js.map → index-d4396be3.js.map} +1 -1
  204. package/cjs/{index-3bc84b64.js → index-f457d792.js} +3 -3
  205. package/cjs/{index-3bc84b64.js.map → index-f457d792.js.map} +1 -1
  206. package/cjs/{index-e844a017.js → index-fdfc8df4.js} +1 -1
  207. package/cjs/{index-e844a017.js.map → index-fdfc8df4.js.map} +1 -1
  208. package/cjs/index.js +35 -35
  209. package/cjs/openChannel-1f1f5648.js +5251 -0
  210. package/cjs/openChannel-1f1f5648.js.map +1 -0
  211. package/cjs/{openChannelUtils-f64587d0.js → openChannelUtils-3b8eec58.js} +1 -1
  212. package/cjs/{openChannelUtils-f64587d0.js.map → openChannelUtils-3b8eec58.js.map} +1 -1
  213. package/cjs/sendbirdSelectors.js +2 -2
  214. package/cjs/{stringSet-46fdf7f6.js → stringSet-f932274f.js} +1 -1
  215. package/cjs/{stringSet-46fdf7f6.js.map → stringSet-f932274f.js.map} +1 -1
  216. package/cjs/{topics-8365570f.js → topics-e0269931.js} +1 -1
  217. package/cjs/{topics-8365570f.js.map → topics-e0269931.js.map} +1 -1
  218. package/cjs/{tslib.es6-e6723880.js → tslib.es6-592b36e8.js} +1 -1
  219. package/cjs/{tslib.es6-e6723880.js.map → tslib.es6-592b36e8.js.map} +1 -1
  220. package/cjs/ui/Accordion.js +4 -4
  221. package/cjs/ui/AccordionGroup.js +2 -2
  222. package/cjs/ui/AdminMessage.js +3 -3
  223. package/cjs/ui/Avatar.js +3 -3
  224. package/cjs/ui/Badge.js +5 -5
  225. package/cjs/ui/Button.js +4 -4
  226. package/cjs/ui/ChannelAvatar.js +4 -4
  227. package/cjs/ui/ChannelPreview.js +12 -12
  228. package/cjs/ui/ChatHeader.js +8 -8
  229. package/cjs/ui/Checkbox.js +1 -1
  230. package/cjs/ui/ConnectionStatus.js +5 -5
  231. package/cjs/ui/ContextMenu.js +5 -5
  232. package/cjs/ui/DateSeparator.js +4 -4
  233. package/cjs/ui/Dropdown.js +3 -3
  234. package/cjs/ui/EmojiReactions.js +7 -7
  235. package/cjs/ui/FileMessageItemBody.js +6 -6
  236. package/cjs/ui/FileViewer.js +7 -7
  237. package/cjs/ui/Icon.js +1 -1
  238. package/cjs/ui/IconButton.js +1 -1
  239. package/cjs/ui/ImageRenderer.js +1 -1
  240. package/cjs/ui/Input.js +3 -3
  241. package/cjs/ui/Label.js +3 -3
  242. package/cjs/ui/LinkLabel.js +3 -3
  243. package/cjs/ui/Loader.js +1 -1
  244. package/cjs/ui/MentionLabel.js +14 -13
  245. package/cjs/ui/MentionLabel.js.map +1 -1
  246. package/cjs/ui/MessageContent.js +14 -14
  247. package/cjs/ui/MessageInput.js +10 -10
  248. package/cjs/ui/MessageItemMenu.js +7 -7
  249. package/cjs/ui/MessageItemReactionMenu.js +5 -5
  250. package/cjs/ui/MessageSearchFileItem.js +10 -10
  251. package/cjs/ui/MessageSearchItem.js +10 -10
  252. package/cjs/ui/MessageStatus.js +8 -8
  253. package/cjs/ui/Modal.js +8 -8
  254. package/cjs/ui/MutedAvatarOverlay.js +1 -1
  255. package/cjs/ui/OGMessageItemBody.js +11 -11
  256. package/cjs/ui/OpenChannelAdminMessage.js +4 -4
  257. package/cjs/ui/OpenChannelAvatar.js +7 -7
  258. package/cjs/ui/OpenchannelConversationHeader.js +7 -7
  259. package/cjs/ui/OpenchannelFileMessage.js +15 -15
  260. package/cjs/ui/OpenchannelOGMessage.js +15 -15
  261. package/cjs/ui/OpenchannelThumbnailMessage.js +14 -14
  262. package/cjs/ui/OpenchannelUserMessage.js +15 -15
  263. package/cjs/ui/PlaceHolder.js +6 -6
  264. package/cjs/ui/QuoteMessage.js +7 -7
  265. package/cjs/ui/QuoteMessageInput.js +7 -7
  266. package/cjs/ui/ReactionBadge.js +3 -3
  267. package/cjs/ui/ReactionButton.js +1 -1
  268. package/cjs/ui/SortByRow.js +1 -1
  269. package/cjs/ui/TextButton.js +2 -2
  270. package/cjs/ui/TextMessageItemBody.js +11 -11
  271. package/cjs/ui/ThumbnailMessageItemBody.js +3 -3
  272. package/cjs/ui/Tooltip.js +3 -3
  273. package/cjs/ui/TooltipWrapper.js +1 -1
  274. package/cjs/ui/UnknownMessageItemBody.js +7 -7
  275. package/cjs/ui/UserListItem.js +12 -12
  276. package/cjs/ui/UserProfile.js +10 -10
  277. package/cjs/ui/Word.js +45 -11
  278. package/cjs/ui/Word.js.map +1 -1
  279. package/cjs/useSendbirdStateContext.js +1 -1
  280. package/cjs/{utils-a807e55b.js → utils-01d5bf79.js} +1 -1
  281. package/cjs/{utils-a807e55b.js.map → utils-01d5bf79.js.map} +1 -1
  282. package/cjs/{utils-d961e3ec.js → utils-352cb0a5.js} +1 -1
  283. package/cjs/{utils-d961e3ec.js.map → utils-352cb0a5.js.map} +1 -1
  284. package/cjs/{utils-896260ad.js → utils-762f2f61.js} +1 -1
  285. package/cjs/{utils-896260ad.js.map → utils-762f2f61.js.map} +1 -1
  286. package/cjs/{uuid-f50c28bd.js → uuid-5ffba0f8.js} +1 -1
  287. package/cjs/{uuid-f50c28bd.js.map → uuid-5ffba0f8.js.map} +1 -1
  288. package/cjs/withSendbird.js +1 -1
  289. package/{color-61b0f496.js → color-24138028.js} +1 -1
  290. package/{color-61b0f496.js.map → color-24138028.js.map} +1 -1
  291. package/{compareIds-e48fb1d0.js → compareIds-286831ea.js} +1 -1
  292. package/{compareIds-e48fb1d0.js.map → compareIds-286831ea.js.map} +1 -1
  293. package/{const-6fe536c0.js → const-725e6443.js} +1 -1
  294. package/{const-6fe536c0.js.map → const-725e6443.js.map} +1 -1
  295. package/{const-d3857731.js → const-9ccaba50.js} +1 -1
  296. package/{const-d3857731.js.map → const-9ccaba50.js.map} +1 -1
  297. package/{context-178f9029.js → context-482c87f7.js} +2 -2
  298. package/{context-178f9029.js.map → context-482c87f7.js.map} +1 -1
  299. package/dist/index.css +93 -93
  300. package/dist/index.css.map +1 -1
  301. package/{groupChannel-009a07f0.js → groupChannel-4ad208bd.js} +2 -2
  302. package/{groupChannel-009a07f0.js.map → groupChannel-4ad208bd.js.map} +1 -1
  303. package/{index-87af3e7d.js → index-072521c3.js} +1 -1
  304. package/{index-87af3e7d.js.map → index-072521c3.js.map} +1 -1
  305. package/{index-4eddd935.js → index-25339141.js} +4 -4
  306. package/{index-4eddd935.js.map → index-25339141.js.map} +1 -1
  307. package/{index-75f9b6fc.js → index-35ab7b97.js} +1 -1
  308. package/{index-75f9b6fc.js.map → index-35ab7b97.js.map} +1 -1
  309. package/{index-cff868a8.js → index-78302d10.js} +2 -2
  310. package/{index-cff868a8.js.map → index-78302d10.js.map} +1 -1
  311. package/{index-d6e33a8d.js → index-8a388ae7.js} +3 -3
  312. package/{index-d6e33a8d.js.map → index-8a388ae7.js.map} +1 -1
  313. package/{index-a5b58199.js → index-8d874712.js} +3 -3
  314. package/{index-a5b58199.js.map → index-8d874712.js.map} +1 -1
  315. package/{index-7b2f13ef.js → index-e53b04fa.js} +2 -2
  316. package/{index-7b2f13ef.js.map → index-e53b04fa.js.map} +1 -1
  317. package/{index-1b5914a8.js → index-e63d152e.js} +6 -6
  318. package/{index-1b5914a8.js.map → index-e63d152e.js.map} +1 -1
  319. package/{index-39d43f7e.js → index-e9e40be7.js} +4 -4
  320. package/{index-39d43f7e.js.map → index-e9e40be7.js.map} +1 -1
  321. package/{index-aa13fe48.js → index-f6b6701e.js} +2 -2
  322. package/{index-aa13fe48.js.map → index-f6b6701e.js.map} +1 -1
  323. package/index.d.ts +11 -5
  324. package/index.js +35 -35
  325. package/openChannel-6f350123.js +5246 -0
  326. package/openChannel-6f350123.js.map +1 -0
  327. package/{openChannelUtils-41763348.js → openChannelUtils-d9065b0b.js} +1 -1
  328. package/{openChannelUtils-41763348.js.map → openChannelUtils-d9065b0b.js.map} +1 -1
  329. package/package-lock.json +1 -1
  330. package/package.json +2 -1
  331. package/sendbirdSelectors.js +2 -2
  332. package/{stringSet-130b5cd9.js → stringSet-f697bfff.js} +1 -1
  333. package/{stringSet-130b5cd9.js.map → stringSet-f697bfff.js.map} +1 -1
  334. package/{topics-2773df5c.js → topics-b6afa630.js} +1 -1
  335. package/{topics-2773df5c.js.map → topics-b6afa630.js.map} +1 -1
  336. package/{tslib.es6-41c9b7f1.js → tslib.es6-42c9ba76.js} +1 -1
  337. package/{tslib.es6-41c9b7f1.js.map → tslib.es6-42c9ba76.js.map} +1 -1
  338. package/ui/Accordion.js +4 -4
  339. package/ui/AccordionGroup.js +2 -2
  340. package/ui/AdminMessage.js +3 -3
  341. package/ui/Avatar.js +3 -3
  342. package/ui/Badge.js +5 -5
  343. package/ui/Button.js +4 -4
  344. package/ui/ChannelAvatar.js +4 -4
  345. package/ui/ChannelPreview.js +12 -12
  346. package/ui/ChatHeader.js +8 -8
  347. package/ui/Checkbox.js +1 -1
  348. package/ui/ConnectionStatus.js +5 -5
  349. package/ui/ContextMenu.js +5 -5
  350. package/ui/DateSeparator.js +4 -4
  351. package/ui/Dropdown.js +3 -3
  352. package/ui/EmojiReactions.js +7 -7
  353. package/ui/FileMessageItemBody.js +6 -6
  354. package/ui/FileViewer.js +7 -7
  355. package/ui/Icon.js +1 -1
  356. package/ui/IconButton.js +1 -1
  357. package/ui/ImageRenderer.js +1 -1
  358. package/ui/Input.js +3 -3
  359. package/ui/Label.js +3 -3
  360. package/ui/LinkLabel.js +3 -3
  361. package/ui/Loader.js +1 -1
  362. package/ui/MentionLabel.js +14 -13
  363. package/ui/MentionLabel.js.map +1 -1
  364. package/ui/MessageContent.js +14 -14
  365. package/ui/MessageInput.js +10 -10
  366. package/ui/MessageItemMenu.js +7 -7
  367. package/ui/MessageItemReactionMenu.js +5 -5
  368. package/ui/MessageSearchFileItem.js +10 -10
  369. package/ui/MessageSearchItem.js +10 -10
  370. package/ui/MessageStatus.js +8 -8
  371. package/ui/Modal.js +8 -8
  372. package/ui/MutedAvatarOverlay.js +1 -1
  373. package/ui/OGMessageItemBody.js +11 -11
  374. package/ui/OpenChannelAdminMessage.js +4 -4
  375. package/ui/OpenChannelAvatar.js +7 -7
  376. package/ui/OpenchannelConversationHeader.js +7 -7
  377. package/ui/OpenchannelFileMessage.js +15 -15
  378. package/ui/OpenchannelOGMessage.js +15 -15
  379. package/ui/OpenchannelThumbnailMessage.js +14 -14
  380. package/ui/OpenchannelUserMessage.js +15 -15
  381. package/ui/PlaceHolder.js +6 -6
  382. package/ui/QuoteMessage.js +7 -7
  383. package/ui/QuoteMessageInput.js +7 -7
  384. package/ui/ReactionBadge.js +3 -3
  385. package/ui/ReactionButton.js +1 -1
  386. package/ui/SortByRow.js +1 -1
  387. package/ui/TextButton.js +2 -2
  388. package/ui/TextMessageItemBody.js +11 -11
  389. package/ui/ThumbnailMessageItemBody.js +3 -3
  390. package/ui/Tooltip.js +3 -3
  391. package/ui/TooltipWrapper.js +1 -1
  392. package/ui/UnknownMessageItemBody.js +7 -7
  393. package/ui/UserListItem.js +12 -12
  394. package/ui/UserProfile.js +10 -10
  395. package/ui/Word.js +45 -11
  396. package/ui/Word.js.map +1 -1
  397. package/useSendbirdStateContext.js +1 -1
  398. package/{utils-c2b6ba56.js → utils-02eaadb8.js} +1 -1
  399. package/{utils-c2b6ba56.js.map → utils-02eaadb8.js.map} +1 -1
  400. package/{utils-24f3af49.js → utils-78b45bd0.js} +1 -1
  401. package/{utils-24f3af49.js.map → utils-78b45bd0.js.map} +1 -1
  402. package/{utils-ce5e300e.js → utils-fb8d9bf1.js} +1 -1
  403. package/{utils-ce5e300e.js.map → utils-fb8d9bf1.js.map} +1 -1
  404. package/{uuid-cd809c2c.js → uuid-d61c5d2d.js} +1 -1
  405. package/{uuid-cd809c2c.js.map → uuid-d61c5d2d.js.map} +1 -1
  406. package/withSendbird.js +1 -1
  407. package/ChannelListProvider-bc1f14ac.js.map +0 -1
  408. package/ChannelProvider-3d7434a2.js.map +0 -1
  409. package/CreateChannelProvider-8464145a.js.map +0 -1
  410. package/MemberList-0f94f1c7.js.map +0 -1
  411. package/__bundle-7dfccc8c-36a58bd4.js +0 -24
  412. package/__bundle-7dfccc8c-36a58bd4.js.map +0 -1
  413. package/cjs/ChannelListProvider-8157ae01.js.map +0 -1
  414. package/cjs/ChannelProvider-793fddf5.js.map +0 -1
  415. package/cjs/CreateChannelProvider-b462ce84.js.map +0 -1
  416. package/cjs/MemberList-c446abed.js.map +0 -1
  417. package/cjs/__bundle-7dfccc8c-437d2fd3.js +0 -151
  418. package/cjs/__bundle-7dfccc8c-437d2fd3.js.map +0 -1
  419. package/cjs/openChannel-1fe2127a.js +0 -13
  420. package/cjs/openChannel-1fe2127a.js.map +0 -1
  421. package/openChannel-0d900561.js +0 -8
  422. package/openChannel-0d900561.js.map +0 -1
@@ -0,0 +1,4523 @@
1
+ 'use strict';
2
+
3
+ /*! *****************************************************************************
4
+ Copyright (c) Microsoft Corporation.
5
+
6
+ Permission to use, copy, modify, and/or distribute this software for any
7
+ purpose with or without fee is hereby granted.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
10
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
12
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
14
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15
+ PERFORMANCE OF THIS SOFTWARE.
16
+ ***************************************************************************** */
17
+ var e = function (t, n) {
18
+ return e = Object.setPrototypeOf || {
19
+ __proto__: []
20
+ }
21
+ instanceof Array && function (e, t) {
22
+ e.__proto__ = t;
23
+ } || function (e, t) {
24
+ for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
25
+ }, e(t, n)
26
+ };
27
+
28
+ function t(t, n) {
29
+ if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");
30
+
31
+ function r() {
32
+ this.constructor = t;
33
+ }
34
+ e(t, n), t.prototype = null === n ? Object.create(n) : (r.prototype = n.prototype, new r);
35
+ }
36
+ exports.n = function () {
37
+ return exports.n = Object.assign || function (e) {
38
+ for (var t, n = 1, r = arguments.length; n < r; n++)
39
+ for (var i in t = arguments[n]) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
40
+ return e
41
+ }, exports.n.apply(this, arguments)
42
+ };
43
+
44
+ function r(e, t, n, r) {
45
+ return new(n || (n = Promise))((function (i, s) {
46
+ function o(e) {
47
+ try {
48
+ u(r.next(e));
49
+ } catch (e) {
50
+ s(e);
51
+ }
52
+ }
53
+
54
+ function a(e) {
55
+ try {
56
+ u(r.throw(e));
57
+ } catch (e) {
58
+ s(e);
59
+ }
60
+ }
61
+
62
+ function u(e) {
63
+ var t;
64
+ e.done ? i(e.value) : (t = e.value, t instanceof n ? t : new n((function (e) {
65
+ e(t);
66
+ }))).then(o, a);
67
+ }
68
+ u((r = r.apply(e, t || [])).next());
69
+ }))
70
+ }
71
+
72
+ function i(e, t) {
73
+ var n, r, i, s, o = {
74
+ label: 0,
75
+ sent: function () {
76
+ if (1 & i[0]) throw i[1];
77
+ return i[1]
78
+ },
79
+ trys: [],
80
+ ops: []
81
+ };
82
+ return s = {
83
+ next: a(0),
84
+ throw: a(1),
85
+ return: a(2)
86
+ }, "function" == typeof Symbol && (s[Symbol.iterator] = function () {
87
+ return this
88
+ }), s;
89
+
90
+ function a(s) {
91
+ return function (a) {
92
+ return function (s) {
93
+ if (n) throw new TypeError("Generator is already executing.");
94
+ for (; o;) try {
95
+ if (n = 1, r && (i = 2 & s[0] ? r.return : s[0] ? r.throw || ((i = r.return) && i.call(r), 0) : r.next) && !(i = i.call(r, s[1])).done) return i;
96
+ switch (r = 0, i && (s = [2 & s[0], i.value]), s[0]) {
97
+ case 0:
98
+ case 1:
99
+ i = s;
100
+ break;
101
+ case 4:
102
+ return o.label++, {
103
+ value: s[1],
104
+ done: !1
105
+ };
106
+ case 5:
107
+ o.label++, r = s[1], s = [0];
108
+ continue;
109
+ case 7:
110
+ s = o.ops.pop(), o.trys.pop();
111
+ continue;
112
+ default:
113
+ if (!(i = o.trys, (i = i.length > 0 && i[i.length - 1]) || 6 !== s[0] && 2 !== s[0])) {
114
+ o = 0;
115
+ continue
116
+ }
117
+ if (3 === s[0] && (!i || s[1] > i[0] && s[1] < i[3])) {
118
+ o.label = s[1];
119
+ break
120
+ }
121
+ if (6 === s[0] && o.label < i[1]) {
122
+ o.label = i[1], i = s;
123
+ break
124
+ }
125
+ if (i && o.label < i[2]) {
126
+ o.label = i[2], o.ops.push(s);
127
+ break
128
+ }
129
+ i[2] && o.ops.pop(), o.trys.pop();
130
+ continue
131
+ }
132
+ s = t.call(e, o);
133
+ } catch (e) {
134
+ s = [6, e], r = 0;
135
+ } finally {
136
+ n = i = 0;
137
+ }
138
+ if (5 & s[0]) throw s[1];
139
+ return {
140
+ value: s[0] ? s[1] : void 0,
141
+ done: !0
142
+ }
143
+ }([s, a])
144
+ }
145
+ }
146
+ }
147
+
148
+ function s(e) {
149
+ var t = "function" == typeof Symbol && Symbol.iterator,
150
+ n = t && e[t],
151
+ r = 0;
152
+ if (n) return n.call(e);
153
+ if (e && "number" == typeof e.length) return {
154
+ next: function () {
155
+ return e && r >= e.length && (e = void 0), {
156
+ value: e && e[r++],
157
+ done: !e
158
+ }
159
+ }
160
+ };
161
+ throw new TypeError(t ? "Object is not iterable." : "Symbol.iterator is not defined.")
162
+ }
163
+
164
+ function o(e, t) {
165
+ var n = "function" == typeof Symbol && e[Symbol.iterator];
166
+ if (!n) return e;
167
+ var r, i, s = n.call(e),
168
+ o = [];
169
+ try {
170
+ for (;
171
+ (void 0 === t || t-- > 0) && !(r = s.next()).done;) o.push(r.value);
172
+ } catch (e) {
173
+ i = {
174
+ error: e
175
+ };
176
+ } finally {
177
+ try {
178
+ r && !r.done && (n = s.return) && n.call(s);
179
+ } finally {
180
+ if (i) throw i.error
181
+ }
182
+ }
183
+ return o
184
+ }
185
+
186
+ function a(e, t, n) {
187
+ if (n || 2 === arguments.length)
188
+ for (var r, i = 0, s = t.length; i < s; i++) !r && i in t || (r || (r = Array.prototype.slice.call(t, 0, i)), r[i] = t[i]);
189
+ return e.concat(r || Array.prototype.slice.call(t))
190
+ }
191
+ var u, c$1 = "4.0.4",
192
+ l$1 = function () {
193
+ function e() {}
194
+ return Object.defineProperty(e, "OS_VERSION", {
195
+ get: function () {
196
+ return "undefined" != typeof navigator && navigator.userAgent ? navigator.userAgent.replace(/,/g, ".") : "noAgent"
197
+ },
198
+ enumerable: !1,
199
+ configurable: !0
200
+ }), Object.defineProperty(e, "SDK_VERSION", {
201
+ get: function () {
202
+ return "4.0.4"
203
+ },
204
+ enumerable: !1,
205
+ configurable: !0
206
+ }), Object.defineProperty(e, "SDK_MAJOR_VERSION", {
207
+ get: function () {
208
+ return e.SDK_VERSION.split(".")[0]
209
+ },
210
+ enumerable: !1,
211
+ configurable: !0
212
+ }), Object.defineProperty(e, "DEFAULT_MAX_UNREAD_COUNT_OF_SUPER_GROUP_CHANNEL", {
213
+ get: function () {
214
+ return 100
215
+ },
216
+ enumerable: !1,
217
+ configurable: !0
218
+ }), Object.defineProperty(e, "INTERNAL_CALL", {
219
+ get: function () {
220
+ return "ic"
221
+ },
222
+ enumerable: !1,
223
+ configurable: !0
224
+ }), e
225
+ }();
226
+ ! function (e) {
227
+ e[e.INVALID_TOKEN = 400111] = "INVALID_TOKEN", e[e.SESSION_KEY_EXPIRED = 400302] = "SESSION_KEY_EXPIRED", e[e.SESSION_TOKEN_EXPIRED = 400309] = "SESSION_TOKEN_EXPIRED", e[e.INTERNAL_SERVER_ERROR = 500901] = "INTERNAL_SERVER_ERROR", e[e.RATE_LIMIT_EXCEEDED = 500910] = "RATE_LIMIT_EXCEEDED", e[e.UNKNOWN_SERVER_ERROR = 900200] = "UNKNOWN_SERVER_ERROR", e[e.DEBUG_MODE_REQUIRED = 7e5] = "DEBUG_MODE_REQUIRED", e[e.LOST_INSTANCE = 700100] = "LOST_INSTANCE", e[e.CONNECTION_RENEW = 700102] = "CONNECTION_RENEW", e[e.INVALID_CONNECTION_STATE_TRANSITION = 700200] = "INVALID_CONNECTION_STATE_TRANSITION", e[e.INVALID_INITIALIZATION = 800100] = "INVALID_INITIALIZATION", e[e.CONNECTION_REQUIRED = 800101] = "CONNECTION_REQUIRED", e[e.CONNECTION_CANCELED = 800102] = "CONNECTION_CANCELED", e[e.INVALID_PARAMETER = 800110] = "INVALID_PARAMETER", e[e.NETWORK_ERROR = 800120] = "NETWORK_ERROR", e[e.NETWORK_ROUTING_ERROR = 800121] = "NETWORK_ROUTING_ERROR", e[e.MALFORMED_DATA = 800130] = "MALFORMED_DATA", e[e.MALFORMED_ERROR_DATA = 800140] = "MALFORMED_ERROR_DATA", e[e.WRONG_CHANNEL_TYPE = 800150] = "WRONG_CHANNEL_TYPE", e[e.MARK_AS_READ_RATE_LIMIT_EXCEEDED = 800160] = "MARK_AS_READ_RATE_LIMIT_EXCEEDED", e[e.QUERY_IN_PROGRESS = 800170] = "QUERY_IN_PROGRESS", e[e.ACK_TIMEOUT = 800180] = "ACK_TIMEOUT", e[e.LOGIN_TIMEOUT = 800190] = "LOGIN_TIMEOUT", e[e.WEBSOCKET_CONNECTION_CLOSED = 800200] = "WEBSOCKET_CONNECTION_CLOSED", e[e.WEBSOCKET_CONNECTION_FAILED = 800210] = "WEBSOCKET_CONNECTION_FAILED", e[e.REQUEST_FAILED = 800220] = "REQUEST_FAILED", e[e.FILE_UPLOAD_CANCEL_FAILED = 800230] = "FILE_UPLOAD_CANCEL_FAILED", e[e.REQUEST_CANCELED = 800240] = "REQUEST_CANCELED", e[e.REQUEST_DUPLICATED = 800250] = "REQUEST_DUPLICATED", e[e.FILE_SIZE_LIMIT_EXCEEDED = 800260] = "FILE_SIZE_LIMIT_EXCEEDED", e[e.SESSION_TOKEN_REQUEST_FAILED = 800500] = "SESSION_TOKEN_REQUEST_FAILED", e[e.SESSION_TOKEN_REFRESHED = 800501] = "SESSION_TOKEN_REFRESHED", e[e.SESSION_TOKEN_REFRESH_FAILED = 800502] = "SESSION_TOKEN_REFRESH_FAILED";
228
+ }(u || (u = {}));
229
+ exports.d = void 0; var h$1 = function (e) {
230
+ return !(e instanceof p && !e.shouldThrowOutside)
231
+ },
232
+ p = function (e) {
233
+ function n(t) {
234
+ var r = t.code,
235
+ i = void 0 === r ? 0 : r,
236
+ s = t.message,
237
+ o = e.call(this, s) || this;
238
+ return o.shouldThrowOutside = !1, o.name = "SendbirdError", o.code = i, Object.setPrototypeOf(o, n.prototype), o
239
+ }
240
+ return t(n, e), Object.defineProperty(n.prototype, "isInvalidTokenError", {
241
+ get: function () {
242
+ return this.code === u.INVALID_TOKEN
243
+ },
244
+ enumerable: !1,
245
+ configurable: !0
246
+ }), Object.defineProperty(n.prototype, "isSessionTokenExpiredError", {
247
+ get: function () {
248
+ return this.code === u.SESSION_TOKEN_EXPIRED
249
+ },
250
+ enumerable: !1,
251
+ configurable: !0
252
+ }), Object.defineProperty(n.prototype, "isSessionKeyExpiredError", {
253
+ get: function () {
254
+ return this.code === u.SESSION_KEY_EXPIRED
255
+ },
256
+ enumerable: !1,
257
+ configurable: !0
258
+ }), Object.defineProperty(n, "debugModeRequired", {
259
+ get: function () {
260
+ return new n({
261
+ code: u.DEBUG_MODE_REQUIRED,
262
+ message: "Cannot run this operation in production mode."
263
+ })
264
+ },
265
+ enumerable: !1,
266
+ configurable: !0
267
+ }), Object.defineProperty(n, "lostInstance", {
268
+ get: function () {
269
+ return new n({
270
+ code: u.LOST_INSTANCE,
271
+ message: "Instance ID is missing. It should belong to an instance."
272
+ })
273
+ },
274
+ enumerable: !1,
275
+ configurable: !0
276
+ }), Object.defineProperty(n, "connectionRenew", {
277
+ get: function () {
278
+ return new n({
279
+ code: u.CONNECTION_RENEW,
280
+ message: "Connection restarts."
281
+ })
282
+ },
283
+ enumerable: !1,
284
+ configurable: !0
285
+ }), Object.defineProperty(n, "invalidConnectionStateTransition", {
286
+ get: function () {
287
+ return new n({
288
+ code: u.INVALID_CONNECTION_STATE_TRANSITION,
289
+ message: "Invalid connection state transition."
290
+ })
291
+ },
292
+ enumerable: !1,
293
+ configurable: !0
294
+ }), Object.defineProperty(n, "connectionRequired", {
295
+ get: function () {
296
+ return new n({
297
+ code: u.CONNECTION_REQUIRED,
298
+ message: "Connection is required."
299
+ })
300
+ },
301
+ enumerable: !1,
302
+ configurable: !0
303
+ }), Object.defineProperty(n, "connectionCanceled", {
304
+ get: function () {
305
+ return new n({
306
+ code: u.CONNECTION_CANCELED,
307
+ message: "Connection is canceled."
308
+ })
309
+ },
310
+ enumerable: !1,
311
+ configurable: !0
312
+ }), Object.defineProperty(n, "invalidParameters", {
313
+ get: function () {
314
+ return new n({
315
+ code: u.INVALID_PARAMETER,
316
+ message: "Invalid parameters."
317
+ })
318
+ },
319
+ enumerable: !1,
320
+ configurable: !0
321
+ }), Object.defineProperty(n, "networkError", {
322
+ get: function () {
323
+ return new n({
324
+ code: u.NETWORK_ERROR,
325
+ message: "There was a network error."
326
+ })
327
+ },
328
+ enumerable: !1,
329
+ configurable: !0
330
+ }), Object.defineProperty(n, "markAsReadAllRateLimitExceeded", {
331
+ get: function () {
332
+ return new n({
333
+ code: u.MARK_AS_READ_RATE_LIMIT_EXCEEDED,
334
+ message: "markAsRead rate limit exceeded."
335
+ })
336
+ },
337
+ enumerable: !1,
338
+ configurable: !0
339
+ }), Object.defineProperty(n, "queryInProgress", {
340
+ get: function () {
341
+ return new n({
342
+ code: u.QUERY_IN_PROGRESS,
343
+ message: "Query in progress."
344
+ })
345
+ },
346
+ enumerable: !1,
347
+ configurable: !0
348
+ }), Object.defineProperty(n, "noAckTimeout", {
349
+ get: function () {
350
+ return new n({
351
+ code: u.ACK_TIMEOUT,
352
+ message: "Command received no ack."
353
+ })
354
+ },
355
+ enumerable: !1,
356
+ configurable: !0
357
+ }), Object.defineProperty(n, "loginTimeout", {
358
+ get: function () {
359
+ return new n({
360
+ code: u.LOGIN_TIMEOUT,
361
+ message: "Connection timeout."
362
+ })
363
+ },
364
+ enumerable: !1,
365
+ configurable: !0
366
+ }), Object.defineProperty(n, "connectionClosed", {
367
+ get: function () {
368
+ return new n({
369
+ code: u.WEBSOCKET_CONNECTION_CLOSED,
370
+ message: "Connection is closed. Please reconnect."
371
+ })
372
+ },
373
+ enumerable: !1,
374
+ configurable: !0
375
+ }), Object.defineProperty(n, "requestFailed", {
376
+ get: function () {
377
+ return new n({
378
+ code: u.REQUEST_FAILED,
379
+ message: "Request failed."
380
+ })
381
+ },
382
+ enumerable: !1,
383
+ configurable: !0
384
+ }), Object.defineProperty(n, "fileUploadCanceled", {
385
+ get: function () {
386
+ return new n({
387
+ code: u.FILE_UPLOAD_CANCEL_FAILED,
388
+ message: "File upload has been canceled."
389
+ })
390
+ },
391
+ enumerable: !1,
392
+ configurable: !0
393
+ }), Object.defineProperty(n, "requestCanceled", {
394
+ get: function () {
395
+ return new n({
396
+ code: u.REQUEST_CANCELED,
397
+ message: "Request has been canceled."
398
+ })
399
+ },
400
+ enumerable: !1,
401
+ configurable: !0
402
+ }), Object.defineProperty(n, "sessionTokenRefreshFailed", {
403
+ get: function () {
404
+ return new n({
405
+ code: u.SESSION_TOKEN_REFRESH_FAILED,
406
+ message: "Failed to refresh the session key."
407
+ })
408
+ },
409
+ enumerable: !1,
410
+ configurable: !0
411
+ }), Object.defineProperty(n, "sessionTokenRequestFailed", {
412
+ get: function () {
413
+ return new n({
414
+ code: u.SESSION_TOKEN_REQUEST_FAILED,
415
+ message: "Failed to get the session token."
416
+ })
417
+ },
418
+ enumerable: !1,
419
+ configurable: !0
420
+ }), n.prototype.throwOutside = function () {
421
+ throw this.shouldThrowOutside = !0, this
422
+ }, n
423
+ }(Error),
424
+ f = [u.CONNECTION_REQUIRED, u.NETWORK_ERROR, u.ACK_TIMEOUT, u.WEBSOCKET_CONNECTION_CLOSED, u.WEBSOCKET_CONNECTION_FAILED, u.FILE_UPLOAD_CANCEL_FAILED, u.REQUEST_CANCELED, u.INTERNAL_SERVER_ERROR, u.RATE_LIMIT_EXCEEDED, u.UNKNOWN_SERVER_ERROR],
425
+ _ = [u.WEBSOCKET_CONNECTION_CLOSED, u.WEBSOCKET_CONNECTION_FAILED, u.CONNECTION_REQUIRED],
426
+ g = function (e, t) {
427
+ if (e !== t) {
428
+ var r = exports.n({}, e),
429
+ i = exports.n({}, t);
430
+ return (!r.hasOwnProperty("messageId") || !i.hasOwnProperty("messageId") || r.messageId === i.messageId) && ((!r.hasOwnProperty("reqId") || !i.hasOwnProperty("reqId") || r.reqId === i.reqId) && (r.hasOwnProperty("messageId") && delete r.messageId, r.hasOwnProperty("reqId") && delete r.reqId, i.hasOwnProperty("messageId") && delete i.messageId, i.hasOwnProperty("reqId") && delete i.reqId, JSON.stringify(r) === JSON.stringify(i)))
431
+ }
432
+ return !0
433
+ },
434
+ y = function (e, t, n) {
435
+ return void 0 === n && (n = !1), !(!n || null != t) || ("string" != typeof e ? "object" == typeof e ? m(e, t) : v(e, t) : typeof t === e)
436
+ },
437
+ m = function (e, t, n) {
438
+ return void 0 === n && (n = !1), !(!n || null != t) || Object.values(e).includes(t)
439
+ },
440
+ v = function (e, t) {
441
+ return t instanceof e
442
+ },
443
+ E = function (e, t, n) {
444
+ return void 0 === n && (n = !1), !(!n || null != t) || Array.isArray(t) && t.every((function (t) {
445
+ return y(e, t)
446
+ }))
447
+ },
448
+ I = function (e) {
449
+ return e > 0 && _.indexOf(e) >= 0
450
+ },
451
+ S = function (e, t) {
452
+ if (void 0 === t && (t = !1), t && null === e) return !0;
453
+ var n = y("object", e) && null !== e && e.hasOwnProperty("name") && "string" == typeof e.name && e.hasOwnProperty("uri") && "string" == typeof e.uri && e.hasOwnProperty("type") && "string" == typeof e.type;
454
+ if (!n) {
455
+ if ("undefined" != typeof Blob) return e instanceof Blob;
456
+ if ("undefined" != typeof File) return e instanceof File
457
+ }
458
+ return n
459
+ },
460
+ T$1 = function (e, t) {
461
+ if (e === t) return !0;
462
+ if (null == e || null == t) return !1;
463
+ if (e.length !== t.length) return !1;
464
+ for (var n = a([], o(e), !1).sort(), r = a([], o(t), !1).sort(), i = 0; i < n.length; ++i)
465
+ if (n[i] !== r[i]) return !1;
466
+ return !0
467
+ },
468
+ b = function () {
469
+ function e(e) {
470
+ var t = void 0 === e ? {} : e,
471
+ n = t.useMemberInfoInMessage,
472
+ r = void 0 !== n && n,
473
+ i = t.typingIndicatorInvalidateTime,
474
+ s = void 0 === i ? 1e4 : i,
475
+ o = t.typingIndicatorThrottle,
476
+ a = void 0 === o ? 1e3 : o,
477
+ u = t.websocketResponseTimeout,
478
+ c = void 0 === u ? 1e4 : u;
479
+ this._useMemberInfoInMessage = !1, this._typingIndicatorInvalidateTime = 1e4, this._typingIndicatorThrottle = 1e3, this._websocketResponseTimeout = 1e4, this._useMemberInfoInMessage = r, this._typingIndicatorInvalidateTime = s, this._typingIndicatorThrottle = a, this._websocketResponseTimeout = c;
480
+ }
481
+ return Object.defineProperty(e.prototype, "useMemberInfoInMessage", {
482
+ get: function () {
483
+ return this._useMemberInfoInMessage
484
+ },
485
+ set: function (e) {
486
+ y("boolean", e) && (this._useMemberInfoInMessage = e);
487
+ },
488
+ enumerable: !1,
489
+ configurable: !0
490
+ }), Object.defineProperty(e.prototype, "typingIndicatorInvalidateTime", {
491
+ get: function () {
492
+ return this._typingIndicatorInvalidateTime
493
+ },
494
+ set: function (e) {
495
+ y("number", e) && (this._typingIndicatorInvalidateTime = e);
496
+ },
497
+ enumerable: !1,
498
+ configurable: !0
499
+ }), Object.defineProperty(e.prototype, "typingIndicatorThrottle", {
500
+ get: function () {
501
+ return this._typingIndicatorThrottle
502
+ },
503
+ set: function (e) {
504
+ y("number", e) && e >= 1e3 && e <= 9e3 && (this._typingIndicatorThrottle = e);
505
+ },
506
+ enumerable: !1,
507
+ configurable: !0
508
+ }), Object.defineProperty(e.prototype, "websocketResponseTimeout", {
509
+ get: function () {
510
+ return this._websocketResponseTimeout
511
+ },
512
+ set: function (e) {
513
+ y("number", e) && e >= 5e3 && e <= 3e4 && (this._websocketResponseTimeout = e);
514
+ },
515
+ enumerable: !1,
516
+ configurable: !0
517
+ }), e
518
+ }(),
519
+ N = {
520
+ key: "__ev",
521
+ value: {
522
+ k: "__ev",
523
+ v: "scs"
524
+ },
525
+ generation: 1
526
+ },
527
+ A$1 = {
528
+ encrypt: function (e) {
529
+ return e
530
+ },
531
+ decrypt: function (e) {
532
+ return e
533
+ }
534
+ },
535
+ C$1 = function () {
536
+ function e(e) {
537
+ var t = e.store;
538
+ this._preference = new Map, this._store = t;
539
+ }
540
+ return e.prototype._savePreferenceKeys = function () {
541
+ return r(this, void 0, void 0, (function () {
542
+ return i(this, (function (e) {
543
+ switch (e.label) {
544
+ case 0:
545
+ return [4, this._store.set({
546
+ key: this._keysAddress,
547
+ value: a([], o(this._preference.keys()), !1),
548
+ generation: 1
549
+ })];
550
+ case 1:
551
+ return e.sent(), [2]
552
+ }
553
+ }))
554
+ }))
555
+ }, e.prototype.init = function (e) {
556
+ var t;
557
+ return r(this, void 0, void 0, (function () {
558
+ var n, r, o, a, u, c, l, d;
559
+ return i(this, (function (i) {
560
+ switch (i.label) {
561
+ case 0:
562
+ return this._keysAddress = e, [4, this._store.get(e)];
563
+ case 1:
564
+ n = null !== (t = i.sent()) && void 0 !== t ? t : [], i.label = 2;
565
+ case 2:
566
+ i.trys.push([2, 7, 8, 9]), r = s(n), o = r.next(), i.label = 3;
567
+ case 3:
568
+ return o.done ? [3, 6] : (a = o.value, [4, this._store.get(a)]);
569
+ case 4:
570
+ (u = i.sent()) && this._preference.set(a, u), i.label = 5;
571
+ case 5:
572
+ return o = r.next(), [3, 3];
573
+ case 6:
574
+ return [3, 9];
575
+ case 7:
576
+ return c = i.sent(), l = {
577
+ error: c
578
+ }, [3, 9];
579
+ case 8:
580
+ try {
581
+ o && !o.done && (d = r.return) && d.call(r);
582
+ } finally {
583
+ if (l) throw l.error
584
+ }
585
+ return [7];
586
+ case 9:
587
+ return [2]
588
+ }
589
+ }))
590
+ }))
591
+ }, e.prototype.get = function (e) {
592
+ var t;
593
+ return r(this, void 0, void 0, (function () {
594
+ return i(this, (function (n) {
595
+ return [2, null !== (t = this._preference.get(e)) && void 0 !== t ? t : null]
596
+ }))
597
+ }))
598
+ }, e.prototype.set = function (e, t) {
599
+ return r(this, void 0, void 0, (function () {
600
+ var n;
601
+ return i(this, (function (r) {
602
+ switch (r.label) {
603
+ case 0:
604
+ return n = !this._preference.has(e), [4, this._store.set({
605
+ key: e,
606
+ value: t,
607
+ generation: 1
608
+ })];
609
+ case 1:
610
+ return r.sent(), this._preference.set(e, t), n ? [4, this._savePreferenceKeys()] : [3, 3];
611
+ case 2:
612
+ r.sent(), r.label = 3;
613
+ case 3:
614
+ return [2]
615
+ }
616
+ }))
617
+ }))
618
+ }, e.prototype.remove = function (e) {
619
+ return r(this, void 0, void 0, (function () {
620
+ return i(this, (function (t) {
621
+ switch (t.label) {
622
+ case 0:
623
+ return [4, this._store.remove(e)];
624
+ case 1:
625
+ return t.sent(), this._preference.delete(e), [4, this._savePreferenceKeys()];
626
+ case 2:
627
+ return t.sent(), [2]
628
+ }
629
+ }))
630
+ }))
631
+ }, e.prototype.clear = function () {
632
+ return r(this, void 0, void 0, (function () {
633
+ return i(this, (function (e) {
634
+ switch (e.label) {
635
+ case 0:
636
+ return [4, this._store.removeMany(a([], o(this._preference.keys()), !1))];
637
+ case 1:
638
+ return e.sent(), this._preference.clear(), [4, this._savePreferenceKeys()];
639
+ case 2:
640
+ return e.sent(), [2]
641
+ }
642
+ }))
643
+ }))
644
+ }, e
645
+ }(),
646
+ O = function (e) {
647
+ var t = e.encryption,
648
+ n = void 0 === t ? null : t,
649
+ r = e.store,
650
+ i = void 0 === r ? null : r,
651
+ s = e.localCacheEnabled,
652
+ o = void 0 === s || s;
653
+ this.nestdb = null, this.store = i, this.preference = new C$1({
654
+ store: i
655
+ }), this.encryption = null != n ? n : A$1, this.localCacheEnabled = o;
656
+ },
657
+ w = function () {
658
+ function e() {
659
+ this.sessionKey = null, this.authToken = null;
660
+ }
661
+ return Object.defineProperty(e.prototype, "hasSession", {
662
+ get: function () {
663
+ return !!this.sessionKey
664
+ },
665
+ enumerable: !1,
666
+ configurable: !0
667
+ }), e.prototype.clear = function () {
668
+ this.authToken = null, this.sessionKey = null;
669
+ }, e
670
+ }(),
671
+ R = function () {
672
+ var e = (new Date).getTime();
673
+ return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (function (t) {
674
+ var n = (e + 16 * Math.random()) % 16 | 0;
675
+ return e = Math.floor(e / 16), ("x" === t ? n : 3 & n | 8).toString(16)
676
+ }))
677
+ },
678
+ D = function () {
679
+ function e(e) {
680
+ var t = e.container;
681
+ this._container = {}, this._container = t, this.key = R();
682
+ }
683
+ return e.prototype._register = function (e, t, n) {
684
+ return e in this._container || (this._container[e] = new Map), this._container[e].set(this.key, {
685
+ occurence: t,
686
+ handler: n
687
+ }), this
688
+ }, e.prototype.on = function (e, t) {
689
+ return this._register(e, -1, t)
690
+ }, e.prototype.once = function (e, t) {
691
+ return this._register(e, 1, t)
692
+ }, e.prototype.close = function () {
693
+ for (var e in this._container) this._container[e].delete(this.key);
694
+ }, e
695
+ }(),
696
+ M = function () {
697
+ function e() {
698
+ this._container = {};
699
+ }
700
+ return e.prototype.on = function (e, t) {
701
+ return new D({
702
+ container: this._container
703
+ }).on(e, t)
704
+ }, e.prototype.once = function (e, t) {
705
+ return new D({
706
+ container: this._container
707
+ }).once(e, t)
708
+ }, e.prototype.dispatch = function (e, t) {
709
+ var n, r, i = this._container[e];
710
+ if (i) {
711
+ var o = [];
712
+ try {
713
+ for (var a = s(i.keys()), u = a.next(); !u.done; u = a.next()) {
714
+ var c = u.value,
715
+ l = i.get(c);
716
+ l.handler(t), l.occurence > 0 && (l.occurence--, 0 === l.occurence && o.push(c));
717
+ }
718
+ } catch (e) {
719
+ n = {
720
+ error: e
721
+ };
722
+ } finally {
723
+ try {
724
+ u && !u.done && (r = a.return) && r.call(a);
725
+ } finally {
726
+ if (n) throw n.error
727
+ }
728
+ }
729
+ o.forEach((function (e) {
730
+ return i.delete(e)
731
+ }));
732
+ }
733
+ }, e
734
+ }(),
735
+ k = function () {
736
+ function e() {
737
+ this._dispatcher = new M;
738
+ }
739
+ return e.prototype.on = function (e) {
740
+ return this._dispatcher.on("event", e)
741
+ }, e.prototype.once = function (e) {
742
+ return this._dispatcher.once("event", e)
743
+ }, e.prototype.dispatch = function (e) {
744
+ this._dispatcher.dispatch("event", e);
745
+ }, e
746
+ }(),
747
+ L = function () {},
748
+ U$1 = function (e) {
749
+ var t = {};
750
+ return e && Object.keys(e).forEach((function (n) {
751
+ void 0 !== e[n] && NaN !== e[n] && null !== e[n] && (t[n] = e[n]);
752
+ })), t
753
+ };
754
+ ! function (e) {
755
+ e.GET = "GET", e.POST = "POST", e.PUT = "PUT", e.DELETE = "DELETE";
756
+ }(exports.d || (exports.d = {}));
757
+ var P, q = function (e) {
758
+ function n() {
759
+ var t = null !== e && e.apply(this, arguments) || this;
760
+ return t.params = {}, t.requireAuth = !0, t.headers = {}, t.requestId = R(), t
761
+ }
762
+ return t(n, e), n.prototype.stringifyParams = function (e) {
763
+ return "object" != typeof e || Array.isArray(e) ? String(e) : e ? JSON.stringify(e) : ""
764
+ }, Object.defineProperty(n.prototype, "query", {
765
+ get: function () {
766
+ var e = this,
767
+ t = U$1(this.params);
768
+ return "?".concat(Object.keys(t).map((function (n) {
769
+ return "".concat(encodeURIComponent(n), "=").concat(encodeURIComponent(e.stringifyParams(t[n])))
770
+ })).join("&"))
771
+ },
772
+ enumerable: !1,
773
+ configurable: !0
774
+ }), Object.defineProperty(n.prototype, "payload", {
775
+ get: function () {
776
+ var e = this,
777
+ t = U$1(this.params);
778
+ if (Object.keys(t).some((function (e) {
779
+ return S(t[e])
780
+ }))) {
781
+ var n = new FormData;
782
+ return Object.keys(t).forEach((function (r) {
783
+ var i, s = t[r];
784
+ if (S(s)) {
785
+ var o = s;
786
+ n.append(r, o, null !== (i = o.name) && void 0 !== i ? i : "filename");
787
+ } else n.append(r, e.stringifyParams(s));
788
+ })), n
789
+ }
790
+ return JSON.stringify(t)
791
+ },
792
+ enumerable: !1,
793
+ configurable: !0
794
+ }), n
795
+ }(L),
796
+ F = function (e) {
797
+ function r(t, n) {
798
+ var r = e.call(this) || this;
799
+ return r._iid = t, r._payload = n, r
800
+ }
801
+ return t(r, e), Object.defineProperty(r.prototype, "payload", {
802
+ get: function () {
803
+ return exports.n({}, this._payload)
804
+ },
805
+ enumerable: !1,
806
+ configurable: !0
807
+ }), r.prototype.as = function (e) {
808
+ return new e(this._iid, this.payload)
809
+ }, r
810
+ }(L),
811
+ x = function (e) {
812
+ function n(t) {
813
+ var n = e.call(this) || this;
814
+ return n.requestId = t, n
815
+ }
816
+ return t(n, e), n
817
+ }(L),
818
+ G = function (e) {
819
+ function n() {
820
+ return null !== e && e.apply(this, arguments) || this
821
+ }
822
+ return t(n, e), n
823
+ }(L),
824
+ Q = function (e) {
825
+ function n(t) {
826
+ var n = e.call(this) || this;
827
+ return n.statLog = t, n
828
+ }
829
+ return t(n, e), n
830
+ }(L);
831
+ ! function (e) {
832
+ e.WEBSOCKET_CONNECT = "ws:connect", e.API_RESULT = "api:result";
833
+ }(P || (P = {}));
834
+ exports.j = void 0; var K = function () {
835
+ function e(e) {
836
+ var t = e.type,
837
+ n = e.data,
838
+ r = e.ts,
839
+ i = void 0 === r ? Date.now() : r;
840
+ this.type = t, this.createdAt = i, this.data = n;
841
+ }
842
+ return e.payloadify = function (e) {
843
+ return U$1({
844
+ stat_type: e.type,
845
+ ts: e.createdAt,
846
+ data: U$1(e.data)
847
+ })
848
+ }, e
849
+ }(),
850
+ z = function () {
851
+ return "undefined" == typeof document && "undefined" != typeof navigator && "ReactNative" == navigator.product
852
+ },
853
+ V$1 = function () {
854
+ function e(e, t) {
855
+ var n = t.auth,
856
+ r = t.sdkState,
857
+ i = t.dispatcher,
858
+ s = t.logger,
859
+ o = this;
860
+ this._abortControl = new Map, this._iid = e, this._auth = n, this._sdkState = r, this._dispatcher = i, this._dispatcher.on((function (e) {
861
+ e instanceof x && o.cancel(e.requestId);
862
+ })), this._logger = s;
863
+ }
864
+ return Object.defineProperty(e.prototype, "_userAgentWithExtension", {
865
+ get: function () {
866
+ var e = this._sdkState.extensions,
867
+ t = z() ? "reactnative" : "JS",
868
+ n = e.sb_syncmanager ? "s".concat(e.sb_syncmanager) : "",
869
+ r = e.sb_uikit ? "u".concat(e.sb_uikit) : "",
870
+ i = e["device-os-platform"] ? "o".concat(e["device-os-platform"]) : "";
871
+ return "".concat(t, "/c").concat(l$1.SDK_VERSION, "/").concat(n, "/").concat(r, "/").concat(i)
872
+ },
873
+ enumerable: !1,
874
+ configurable: !0
875
+ }), e.prototype._createHeader = function (e, t) {
876
+ void 0 === t && (t = null);
877
+ var r = this._sdkState,
878
+ i = r.appId,
879
+ s = r.appVersion,
880
+ o = exports.n(exports.n({}, e.headers), {
881
+ SendBird: "JS,".concat(l$1.OS_VERSION, ",").concat(l$1.SDK_VERSION, ",").concat(i).concat(s ? ",".concat(s) : ""),
882
+ "SB-User-Agent": encodeURIComponent(this._userAgentWithExtension),
883
+ "Request-Sent-Timestamp": Date.now().toString()
884
+ });
885
+ return t || (o["Content-Type"] = "application/json; charset=utf-8"), e.requireAuth && this._auth.hasSession && (o["Session-Key"] = this._auth.sessionKey), this._auth && this._auth.authToken && (o["App-Id"] = i, o["Access-Token"] = this._auth.authToken), o
886
+ }, e.prototype._statLogApiResult = function (e, t, n) {
887
+ this._dispatcher.dispatch(new Q(new K({
888
+ type: P.API_RESULT,
889
+ data: {
890
+ endpoint: e.path,
891
+ method: e.method,
892
+ success: !n,
893
+ latency: Date.now() - t,
894
+ error_code: null == n ? void 0 : n.code,
895
+ error_description: null == n ? void 0 : n.message
896
+ }
897
+ })));
898
+ }, e.prototype.send = function (e) {
899
+ return r(this, void 0, void 0, (function () {
900
+ var t, n, r, s, o, a, u, c, l, h, f, _, g, y, m;
901
+ return i(this, (function (i) {
902
+ switch (i.label) {
903
+ case 0:
904
+ t = e.path, n = e.method, r = ![exports.d.GET, exports.d.DELETE].includes(n), s = this._sdkState.api, o = "".concat(s.host).concat(t).concat(r ? "" : e.query), a = r ? e.payload : null, u = this._createHeader(e, a instanceof FormData ? a : null), c = new AbortController, l = c.signal, this._abortControl.set(e.requestId, c), h = Date.now(), i.label = 1;
905
+ case 1:
906
+ return i.trys.push([1, 4, , 5]), [4, fetch(o, {
907
+ method: n,
908
+ body: a,
909
+ headers: u,
910
+ signal: l
911
+ })];
912
+ case 2:
913
+ return [4, (f = i.sent()).json()];
914
+ case 3:
915
+ if (_ = i.sent(), f.ok || f.redirected) return this._logger.debug("receive api response", e.requestId), this._statLogApiResult(e, h, null), [2, new F(this._iid, _)];
916
+ throw _ ? ((g = new p(_)).isSessionKeyExpiredError && this._dispatcher.dispatch(new G), this._statLogApiResult(e, h, g), g) : (g = p.requestFailed, this._statLogApiResult(e, h, g), g);
917
+ case 4:
918
+ throw y = i.sent(), this._statLogApiResult(e, h, y), y instanceof p ? (this._logger.debug("fail api request", y), y) : "AbortError" === y.name ? p.requestCanceled : (m = p.networkError, this._logger.debug("fail api request", m), m);
919
+ case 5:
920
+ return [2]
921
+ }
922
+ }))
923
+ }))
924
+ }, e.prototype.cancel = function (e) {
925
+ this._abortControl.has(e) && (this._abortControl.get(e).abort(), this._abortControl.delete(e));
926
+ }, e.prototype.cancelAll = function () {
927
+ var e, t;
928
+ try {
929
+ for (var n = s(this._abortControl.values()), r = n.next(); !r.done; r = n.next()) {
930
+ r.value.abort();
931
+ }
932
+ } catch (t) {
933
+ e = {
934
+ error: t
935
+ };
936
+ } finally {
937
+ try {
938
+ r && !r.done && (t = n.return) && t.call(n);
939
+ } finally {
940
+ if (e) throw e.error
941
+ }
942
+ }
943
+ this._abortControl.clear();
944
+ }, e
945
+ }(),
946
+ B = function (e) {
947
+ function n(t, n, r, i) {
948
+ void 0 === i && (i = "");
949
+ var s, o = this;
950
+ return (o = e.call(this) || this)._iid = t, o.code = n, o.payload = r, o.requestId = r ? null !== (s = r.req_id) && void 0 !== s ? s : i : "", o
951
+ }
952
+ return t(n, e), n.createFromRawMessage = function (e, t) {
953
+ var r = t.substring(0, 4),
954
+ i = null;
955
+ try {
956
+ i = JSON.parse(t.substring(4));
957
+ } catch (e) {
958
+ r = "NOOP";
959
+ } finally {
960
+ return new n(e, r, i)
961
+ }
962
+ }, n.prototype.convertToMessage = function () {
963
+ return "".concat(this.code).concat(JSON.stringify(this.payload), "\n")
964
+ }, n.prototype.as = function (e) {
965
+ return new e(this._iid, this.code, this.payload)
966
+ }, n
967
+ }(L),
968
+ H$1 = function (e) {
969
+ function n(t) {
970
+ var n, r = t.code,
971
+ i = t.ackRequired,
972
+ s = t.payload,
973
+ o = void 0 === s ? null : s,
974
+ a = this;
975
+ return (a = e.call(this) || this).code = r, a.payload = o, a.requestId = null !== (n = a.payload.req_id) && void 0 !== n ? n : R(), a.ackRequired = i, a.payload.req_id = a.requestId, a
976
+ }
977
+ return t(n, e), n.prototype.convertToMessage = function () {
978
+ return "".concat(this.code).concat(JSON.stringify(this.payload), "\n")
979
+ }, n
980
+ }(L),
981
+ W$1 = function (e) {
982
+ function n() {
983
+ return e.call(this, {
984
+ code: "PING",
985
+ payload: {
986
+ id: Date.now(),
987
+ active: 1
988
+ },
989
+ ackRequired: !1
990
+ }) || this
991
+ }
992
+ return t(n, e), n
993
+ }(H$1),
994
+ X$1 = function () {
995
+ function e(e) {
996
+ var t = e.pingDelegate,
997
+ n = e.sdkState,
998
+ r = e.logger;
999
+ this._pingTimer = null, this._pingTimeoutTimer = null, this.pingDelegate = t, this.sdkState = n, this._logger = r;
1000
+ }
1001
+ return Object.defineProperty(e.prototype, "isWaiting", {
1002
+ get: function () {
1003
+ return !!this._pingTimeoutTimer
1004
+ },
1005
+ enumerable: !1,
1006
+ configurable: !0
1007
+ }), e.prototype.ping = function () {
1008
+ var e, t = this,
1009
+ n = new W$1;
1010
+ try {
1011
+ var r = null !== (e = this.sdkState.websocket.pongTimeout) && void 0 !== e ? e : 5e3;
1012
+ this._pingTimeoutTimer = setTimeout((function () {
1013
+ t._logger.debug("pinger.ping() timeout"), t.pingDelegate.error(null);
1014
+ }), r), this.pingDelegate.send(n), this._logger.debug("pinger.ping()");
1015
+ } catch (e) {
1016
+ this._logger.debug("pinger.ping() error", e), this._pingTimeoutTimer && (clearTimeout(this._pingTimeoutTimer), this._pingTimeoutTimer = null), this.pingDelegate.error(null);
1017
+ }
1018
+ return n
1019
+ }, e.prototype.pong = function () {
1020
+ this._logger.debug("pinger.pong()"), this._pingTimeoutTimer && (clearTimeout(this._pingTimeoutTimer), this._pingTimeoutTimer = null);
1021
+ }, e.prototype.refreshTimer = function () {
1022
+ var e, t = this;
1023
+ this._logger.debug("pinger.refreshTimer()");
1024
+ var n = null !== (e = this.sdkState.websocket.pingInterval) && void 0 !== e ? e : 15e3;
1025
+ this.stop(), this._pingTimer = setInterval((function () {
1026
+ t.ping();
1027
+ }), n);
1028
+ }, e.prototype.start = function () {
1029
+ this._logger.debug("pinger.start()"), this.refreshTimer(), this.ping();
1030
+ }, e.prototype.stop = function () {
1031
+ this._logger.debug("pinger.stop()"), this._pingTimer && (clearInterval(this._pingTimer), this._pingTimer = null), this._pingTimeoutTimer && (clearTimeout(this._pingTimeoutTimer), this._pingTimeoutTimer = null);
1032
+ }, e
1033
+ }(),
1034
+ Y$1 = function () {};
1035
+ ! function (e) {
1036
+ e.CONNECTING = "CONNECTING", e.OPEN = "OPEN", e.CLOSED = "CLOSED";
1037
+ }(exports.j || (exports.j = {}));
1038
+ exports.J$1 = void 0; var Z = function (e) {
1039
+ function n(t, n) {
1040
+ var r = n.sdkState,
1041
+ i = n.dispatcher,
1042
+ s = n.logger,
1043
+ o = e.call(this) || this;
1044
+ return o._pinger = null, o.lastActive = 0, o._iid = t, o._sdkState = r, o._dispatcher = i, o._logger = s, o._sdkState.websocket.pingerDisabled || (o._pinger = new X$1({
1045
+ pingDelegate: {
1046
+ send: function (e) {
1047
+ return o.send(e)
1048
+ },
1049
+ error: function (e) {
1050
+ return o.error(e)
1051
+ }
1052
+ },
1053
+ sdkState: o._sdkState,
1054
+ logger: s
1055
+ })), o
1056
+ }
1057
+ return t(n, e), Object.defineProperty(n.prototype, "connectionState", {
1058
+ get: function () {
1059
+ if (this._ws) switch (this._ws.readyState) {
1060
+ case 0:
1061
+ return exports.j.CONNECTING;
1062
+ case 1:
1063
+ return exports.j.OPEN
1064
+ }
1065
+ return exports.j.CLOSED
1066
+ },
1067
+ enumerable: !1,
1068
+ configurable: !0
1069
+ }), n.prototype.connect = function (e) {
1070
+ var t = this;
1071
+ this._ws = new WebSocket(e), this._ws.onopen = function () {
1072
+ t._logger.debug("websocket open"), t.dispatch("open");
1073
+ }, this._ws.onmessage = function (e) {
1074
+ e.data.split("\n").forEach((function (e) {
1075
+ if (e && y("string", e)) {
1076
+ var n = B.createFromRawMessage(t._iid, e);
1077
+ t._logger.debug("receive websocket event", n), "LOGI" === n.code ? (n.payload && !n.payload.error && t._pinger && t._pinger.start(), t.dispatch("message", n)) : "PONG" === n.code ? t._pinger && t._pinger.pong() : "EXPR" === n.code ? n.payload && n.payload.expires_in > 0 && t._dispatcher.dispatch(new G) : "NOOP" === n.code || t.dispatch("message", n);
1078
+ }
1079
+ }));
1080
+ }, this._ws.onerror = function () {
1081
+ t._logger.debug("websocket error"), t._pinger && t._pinger.stop(), t.dispatch("error", p.networkError);
1082
+ }, this._ws.onclose = function () {
1083
+ t._logger.debug("websocket close"), t._pinger && t._pinger.stop(), t.dispatch("close");
1084
+ }, this.lastActive = Date.now();
1085
+ }, n.prototype.disconnect = function () {
1086
+ var e = this;
1087
+ this._logger.debug("websocket disconnect"), this._pinger && this._pinger.stop(), this._ws && (this._ws.onopen = Y$1, this._ws.onmessage = Y$1, this._ws.onerror = Y$1, this._ws.onclose = function () {
1088
+ e.dispatch("close");
1089
+ }, this._ws.close(), this._ws = null);
1090
+ }, n.prototype.send = function (e) {
1091
+ if (!this._ws) throw p.connectionClosed;
1092
+ "PING" !== e.code ? this._pinger && this._pinger.refreshTimer() : this._logger.debug("send ping", e), this._ws.send(e.convertToMessage());
1093
+ }, n.prototype.error = function (e) {
1094
+ this._logger.debug("websocket error", e), this._pinger && this._pinger.stop(), this.dispatch("error", e);
1095
+ }, n
1096
+ }(M),
1097
+ $$1 = function (e) {
1098
+ function n(t) {
1099
+ var n = t.all,
1100
+ r = t.custom_types,
1101
+ i = t.ts,
1102
+ s = e.call(this) || this;
1103
+ return s.all = n, s.customTypes = r, s.ts = i, s
1104
+ }
1105
+ return t(n, e), n
1106
+ }(L),
1107
+ ee$1 = function () {
1108
+ var e = this;
1109
+ this.promise = new Promise((function (t, n) {
1110
+ e.resolve = t, e.reject = n;
1111
+ }));
1112
+ },
1113
+ te = function () {
1114
+ function e(e, t) {
1115
+ var n = t.auth,
1116
+ r = t.sdkState,
1117
+ i = t.dispatcher,
1118
+ s = t.logger,
1119
+ o = this;
1120
+ this._ackStateMap = new Map, this._sdkState = r, this._dispatcher = i, this._logger = s, this.apiClient = new V$1(e, {
1121
+ auth: n,
1122
+ sdkState: r,
1123
+ dispatcher: i,
1124
+ logger: s
1125
+ }), this.websocketClient = new Z(e, {
1126
+ sdkState: r,
1127
+ dispatcher: i,
1128
+ logger: s
1129
+ }), this.websocketClient.on("message", (function (e) {
1130
+ if (e.payload.unread_cnt && o._dispatcher.dispatch(new $$1(e.payload.unread_cnt)), e.requestId) {
1131
+ if (o._ackStateMap.has(e.requestId)) {
1132
+ var t = o._ackStateMap.get(e.requestId);
1133
+ "EROR" !== e.code ? t.resolve(e) : t.reject(new p({
1134
+ code: e.payload.code,
1135
+ message: e.payload.message
1136
+ }));
1137
+ }
1138
+ } else o._dispatcher.dispatch(e);
1139
+ })).on("close", (function () {
1140
+ o._ackStateMap.forEach((function (e) {
1141
+ e.reject(p.connectionClosed);
1142
+ })), o._ackStateMap.clear();
1143
+ }));
1144
+ }
1145
+ return e.prototype._sendApiRequest = function (e) {
1146
+ return r(this, void 0, void 0, (function () {
1147
+ return i(this, (function (t) {
1148
+ switch (t.label) {
1149
+ case 0:
1150
+ return [4, this.apiClient.send(e)];
1151
+ case 1:
1152
+ return [2, t.sent()]
1153
+ }
1154
+ }))
1155
+ }))
1156
+ }, e.prototype._sendWebsocketRequest = function (e) {
1157
+ return r(this, void 0, void 0, (function () {
1158
+ var t, n, r, s = this;
1159
+ return i(this, (function (i) {
1160
+ if (t = new ee$1, e.ackRequired) {
1161
+ n = null, r = function (r, i) {
1162
+ void 0 === r && (r = null), void 0 === i && (i = null), s._ackStateMap.has(e.requestId) && (s._ackStateMap.delete(e.requestId), n && (clearTimeout(n), n = null), r ? (s._logger.debug("fail websocket request", r), t.reject(r)) : (s._logger.debug("receive websocket ack", e.requestId), t.resolve(i)));
1163
+ };
1164
+ try {
1165
+ n = setTimeout((function () {
1166
+ return r(p.noAckTimeout)
1167
+ }), this._sdkState.websocket.responseTimeout), this._ackStateMap.set(e.requestId, {
1168
+ resolve: function (e) {
1169
+ return r(null, e)
1170
+ },
1171
+ reject: function (e) {
1172
+ return r(e)
1173
+ }
1174
+ }), this.websocketClient.send(e);
1175
+ } catch (e) {
1176
+ r(e);
1177
+ }
1178
+ } else try {
1179
+ this.websocketClient.send(e), t.resolve(null);
1180
+ } catch (e) {
1181
+ t.reject(e);
1182
+ }
1183
+ return [2, t.promise]
1184
+ }))
1185
+ }))
1186
+ }, e.prototype.send = function (e) {
1187
+ return r(this, void 0, void 0, (function () {
1188
+ return i(this, (function (t) {
1189
+ switch (t.label) {
1190
+ case 0:
1191
+ return e instanceof q ? [4, this._sendApiRequest(e)] : [3, 2];
1192
+ case 1:
1193
+ case 3:
1194
+ return [2, t.sent()];
1195
+ case 2:
1196
+ return e instanceof H$1 ? [4, this._sendWebsocketRequest(e)] : [3, 4];
1197
+ case 4:
1198
+ throw p.invalidParameters
1199
+ }
1200
+ }))
1201
+ }))
1202
+ }, e.prototype.cancel = function (e) {
1203
+ this.apiClient.cancel(e);
1204
+ }, e.prototype.cancelAll = function () {
1205
+ this.apiClient.cancelAll();
1206
+ }, e
1207
+ }();
1208
+ ! function (e) {
1209
+ e[e.NONE = 0] = "NONE", e[e.INITIALIZED = 1] = "INITIALIZED", e[e.CONNECTING = 2] = "CONNECTING", e[e.CONNECTED = 3] = "CONNECTED", e[e.RECONNECTING = 4] = "RECONNECTING", e[e.DISCONNECTED = 5] = "DISCONNECTED", e[e.LOGOUT = 6] = "LOGOUT";
1210
+ }(exports.J$1 || (exports.J$1 = {}));
1211
+ exports.ne = void 0; exports.re$1 = void 0; var ie$1; exports.se$1 = void 0; exports.oe$1 = void 0; exports.ae$1 = void 0; exports.ue = void 0; var ce$2; exports.le = void 0; var de$2 = function (e) {
1212
+ function n(t) {
1213
+ var n = t.stateType,
1214
+ r = e.call(this) || this;
1215
+ return r.stateType = n, r
1216
+ }
1217
+ return t(n, e), n
1218
+ }(L),
1219
+ he$2 = function () {
1220
+ function e(e, t) {
1221
+ var n = t.auth,
1222
+ s = t.sdkState,
1223
+ o = t.dispatcher,
1224
+ a = t.logger,
1225
+ u = this;
1226
+ this._currentConnectionStateType = exports.J$1.INITIALIZED, this._lazyCallQueue = [], this.commandRouter = new te(e, {
1227
+ auth: n,
1228
+ sdkState: s,
1229
+ dispatcher: o,
1230
+ logger: a
1231
+ }), this._auth = n, this._logger = a, this._dispatcher = o, this._dispatcher.on((function (e) {
1232
+ if (e instanceof de$2) {
1233
+ var t = e.stateType;
1234
+ switch (u._currentConnectionStateType = t, t) {
1235
+ case exports.J$1.CONNECTED:
1236
+ var n = u._lazyCallQueue;
1237
+ u._lazyCallQueue = [], n.forEach((function (e) {
1238
+ return r(u, void 0, void 0, (function () {
1239
+ var t, n, r, s, o;
1240
+ return i(this, (function (i) {
1241
+ switch (i.label) {
1242
+ case 0:
1243
+ t = e.command, n = e.deferred, r = e.timeout, clearTimeout(r), i.label = 1;
1244
+ case 1:
1245
+ return i.trys.push([1, 3, , 4]), [4, this.send(t)];
1246
+ case 2:
1247
+ return s = i.sent(), n.resolve(s), [3, 4];
1248
+ case 3:
1249
+ return o = i.sent(), n.reject(o), [3, 4];
1250
+ case 4:
1251
+ return [2]
1252
+ }
1253
+ }))
1254
+ }))
1255
+ }));
1256
+ break;
1257
+ case exports.J$1.INITIALIZED:
1258
+ case exports.J$1.DISCONNECTED:
1259
+ case exports.J$1.LOGOUT:
1260
+ n = u._lazyCallQueue;
1261
+ u._lazyCallQueue = [], n.forEach((function (e) {
1262
+ return r(u, void 0, void 0, (function () {
1263
+ var t, n;
1264
+ return i(this, (function (r) {
1265
+ return t = e.deferred, n = e.timeout, clearTimeout(n), this._auth && this._auth.hasSession ? t.reject(p.connectionClosed) : t.reject(p.connectionRequired), [2]
1266
+ }))
1267
+ }))
1268
+ }));
1269
+ }
1270
+ }
1271
+ }));
1272
+ }
1273
+ return Object.defineProperty(e.prototype, "isReady", {
1274
+ get: function () {
1275
+ return this._currentConnectionStateType === exports.J$1.CONNECTED
1276
+ },
1277
+ enumerable: !1,
1278
+ configurable: !0
1279
+ }), Object.defineProperty(e.prototype, "isLazyCallActivated", {
1280
+ get: function () {
1281
+ return this._currentConnectionStateType === exports.J$1.CONNECTING || this._currentConnectionStateType === exports.J$1.RECONNECTING
1282
+ },
1283
+ enumerable: !1,
1284
+ configurable: !0
1285
+ }), e.prototype.send = function (e) {
1286
+ return r(this, void 0, void 0, (function () {
1287
+ var t, n, r = this;
1288
+ return i(this, (function (i) {
1289
+ switch (i.label) {
1290
+ case 0:
1291
+ return e instanceof H$1 ? this.isReady ? (this._logger.debug("send websocket request", e), [4, this.commandRouter.send(e)]) : [3, 2] : [3, 4];
1292
+ case 1:
1293
+ case 5:
1294
+ return [2, i.sent()];
1295
+ case 2:
1296
+ if (this.isLazyCallActivated) return this._logger.debug("wait websocket request", e), t = new ee$1, this._lazyCallQueue.push({
1297
+ command: e,
1298
+ deferred: t,
1299
+ timeout: setTimeout((function () {
1300
+ return r.timeout(e.requestId)
1301
+ }), 1e4)
1302
+ }), [2, t.promise];
1303
+ throw this._logger.debug("fail websocket request"), p.connectionRequired;
1304
+ case 3:
1305
+ return [3, 7];
1306
+ case 4:
1307
+ return e instanceof q ? this._auth.hasSession ? (this._logger.debug("send api request", e), [4, this.commandRouter.send(e)]) : [3, 6] : [3, 7];
1308
+ case 6:
1309
+ if (this.isLazyCallActivated) return this._logger.debug("wait api request", e), t = new ee$1, this._lazyCallQueue.push({
1310
+ command: e,
1311
+ deferred: t,
1312
+ timeout: setTimeout((function () {
1313
+ return r.timeout(e.requestId)
1314
+ }), 1e4)
1315
+ }), [2, t.promise];
1316
+ throw n = p.connectionRequired, this._logger.debug("fail api request", n), n;
1317
+ case 7:
1318
+ return [2]
1319
+ }
1320
+ }))
1321
+ }))
1322
+ }, e.prototype.forceSend = function (e) {
1323
+ return r(this, void 0, void 0, (function () {
1324
+ return i(this, (function (t) {
1325
+ switch (t.label) {
1326
+ case 0:
1327
+ return this._logger.debug("send websocket request (forced)", e), [4, this.commandRouter.send(e)];
1328
+ case 1:
1329
+ return [2, t.sent()]
1330
+ }
1331
+ }))
1332
+ }))
1333
+ }, e.prototype.timeout = function (e) {
1334
+ this._logger.debug("timeout request", e);
1335
+ var t = this._lazyCallQueue.findIndex((function (t) {
1336
+ return t.command.requestId === e
1337
+ }));
1338
+ t > -1 && (this._lazyCallQueue[t].deferred.reject(p.connectionRequired), this._lazyCallQueue.splice(t, 1));
1339
+ }, e.prototype.cancel = function (e) {
1340
+ this._logger.debug("cancel api request", e), this.commandRouter.cancel(e);
1341
+ }, e.prototype.cancelAll = function () {
1342
+ this._logger.debug("cancel all api requests"), this.commandRouter.cancelAll();
1343
+ }, e
1344
+ }(),
1345
+ pe$2 = function (e) {
1346
+ function n(t) {
1347
+ var n = t.userId,
1348
+ r = t.authToken,
1349
+ i = t.expiringSession,
1350
+ s = void 0 === i || i,
1351
+ o = e.call(this) || this;
1352
+ return o.path = "/users/".concat(n, "/session_key"), o.method = exports.d.POST, o.params = {
1353
+ token: r,
1354
+ expiring_session: !!s
1355
+ }, o.requireAuth = !1, o
1356
+ }
1357
+ return t(n, e), n
1358
+ }(q),
1359
+ fe$2 = function (e) {
1360
+ function n(t) {
1361
+ var n = t.authToken,
1362
+ r = t.expiringSession,
1363
+ i = void 0 === r || r;
1364
+ return e.call(this, {
1365
+ code: "LOGI",
1366
+ payload: {
1367
+ token: n,
1368
+ expiring_session: i ? 1 : 0
1369
+ },
1370
+ ackRequired: !0
1371
+ }) || this
1372
+ }
1373
+ return t(n, e), n
1374
+ }(H$1),
1375
+ _e$2 = function (e) {
1376
+ function n(t, n) {
1377
+ var r = e.call(this, t, n) || this,
1378
+ i = n.key;
1379
+ return r.key = i, r
1380
+ }
1381
+ return t(n, e), n
1382
+ }(F),
1383
+ ge$2 = function (e) {
1384
+ function n(t, n, r) {
1385
+ var i = e.call(this, t, "LOGI", r) || this;
1386
+ return i.error = null, i.newKey = r.new_key, i.error = r.error ? new p(r.error) : null, i
1387
+ }
1388
+ return t(n, e), n
1389
+ }(B),
1390
+ ye$2 = function (e) {
1391
+ function n() {
1392
+ return null !== e && e.apply(this, arguments) || this
1393
+ }
1394
+ return t(n, e), n
1395
+ }(L),
1396
+ me$2 = function (e) {
1397
+ return r(void 0, void 0, void 0, (function () {
1398
+ return i(this, (function (t) {
1399
+ return [2, new Promise((function (t) {
1400
+ return setTimeout(t, e)
1401
+ }))]
1402
+ }))
1403
+ }))
1404
+ },
1405
+ ve$2 = function () {
1406
+ function e() {}
1407
+ return e.prototype.calcTimeout = function () {
1408
+ return 0
1409
+ }, e
1410
+ }(),
1411
+ Ee$2 = function (e, t, n) {
1412
+ return void 0 === n && (n = new ve$2), r(void 0, void 0, void 0, (function () {
1413
+ var r, s, o, a, u, c;
1414
+ return i(this, (function (i) {
1415
+ switch (i.label) {
1416
+ case 0:
1417
+ r = 0, s = null, o = function (e) {
1418
+ return void 0 === e && (e = null), s = null != e ? e : new Error("Halted")
1419
+ }, a = function () {
1420
+ r = 0;
1421
+ }, i.label = 1;
1422
+ case 1:
1423
+ if (!(-1 === t || r < t)) return [3, 9];
1424
+ i.label = 2;
1425
+ case 2:
1426
+ return i.trys.push([2, 4, , 8]), [4, e(o, a)];
1427
+ case 3:
1428
+ if (u = i.sent(), s) throw s;
1429
+ return [2, u];
1430
+ case 4:
1431
+ if (c = i.sent(), s) return [3, 6];
1432
+ if (++r === t) throw c;
1433
+ return [4, me$2(n.calcTimeout(r))];
1434
+ case 5:
1435
+ return i.sent(), [3, 7];
1436
+ case 6:
1437
+ throw s;
1438
+ case 7:
1439
+ return [3, 8];
1440
+ case 8:
1441
+ return [3, 1];
1442
+ case 9:
1443
+ return [2]
1444
+ }
1445
+ }))
1446
+ }))
1447
+ },
1448
+ Ie$1 = function (e) {
1449
+ return r(void 0, void 0, void 0, (function () {
1450
+ var t;
1451
+ return i(this, (function (n) {
1452
+ switch (n.label) {
1453
+ case 0:
1454
+ return n.trys.push([0, 2, , 3]), [4, e()];
1455
+ case 1:
1456
+ return n.sent(), [3, 3];
1457
+ case 2:
1458
+ if (!((t = n.sent()) instanceof p)) throw t;
1459
+ return t.throwOutside(), [3, 3];
1460
+ case 3:
1461
+ return [2]
1462
+ }
1463
+ }))
1464
+ }))
1465
+ },
1466
+ Se$1 = function (e) {
1467
+ return r(void 0, void 0, void 0, (function () {
1468
+ return i(this, (function (t) {
1469
+ switch (t.label) {
1470
+ case 0:
1471
+ return t.trys.push([0, 2, , 3]), [4, e()];
1472
+ case 1:
1473
+ case 2:
1474
+ return t.sent(), [3, 3];
1475
+ case 3:
1476
+ return [2]
1477
+ }
1478
+ }))
1479
+ }))
1480
+ },
1481
+ Te$1 = function () {
1482
+ function e(e) {
1483
+ var t = e.auth,
1484
+ n = e.sdkState,
1485
+ r = e.dispatcher,
1486
+ i = e.requestQueue,
1487
+ s = e.logger,
1488
+ o = this;
1489
+ this._currentConnectionStateType = exports.J$1.INITIALIZED, this.auth = t, this._sdkState = n, this._dispatcher = r, this._requestQueue = i, this._logger = s, this._dispatcher.on((function (e) {
1490
+ if (e instanceof de$2) {
1491
+ var t = e.stateType;
1492
+ o._currentConnectionStateType = t;
1493
+ } else e instanceof G && o.refresh();
1494
+ }));
1495
+ }
1496
+ return e.prototype.createRefreshWebsocketCommand = function (e) {
1497
+ return new fe$2({
1498
+ authToken: e,
1499
+ expiringSession: !0
1500
+ })
1501
+ }, e.prototype._refreshSessionKey = function (e, t) {
1502
+ return r(this, void 0, void 0, (function () {
1503
+ var n, s, o, a, u, c, l, d = this;
1504
+ return i(this, (function (f) {
1505
+ switch (f.label) {
1506
+ case 0:
1507
+ if (this._currentConnectionStateType !== exports.J$1.CONNECTED) return [3, 4];
1508
+ f.label = 1;
1509
+ case 1:
1510
+ return f.trys.push([1, 3, , 4]), n = this.createRefreshWebsocketCommand(e), [4, this._requestQueue.forceSend(n)];
1511
+ case 2:
1512
+ if (s = f.sent(), o = s.as(ge$2), a = o.newKey, u = o.error) throw u;
1513
+ return this.auth.sessionKey = null != a ? a : this.auth.sessionKey, this._logger.debug("session refreshed"), Ie$1((function () {
1514
+ return r(d, void 0, void 0, (function () {
1515
+ return i(this, (function (e) {
1516
+ return this.handler.onSessionRefreshed(), [2]
1517
+ }))
1518
+ }))
1519
+ })), t && t.resolve(), [2];
1520
+ case 3:
1521
+ if (c = f.sent(), h$1(c)) throw c;
1522
+ return c.isSessionTokenExpiredError ? (this._handleError(t), [2]) : [3, 4];
1523
+ case 4:
1524
+ return f.trys.push([4, 6, , 7]), l = new pe$2({
1525
+ userId: this._sdkState.userId,
1526
+ authToken: e,
1527
+ expiringSession: !0
1528
+ }), [4, Ee$2((function (e) {
1529
+ return r(d, void 0, void 0, (function () {
1530
+ var t, n, r;
1531
+ return i(this, (function (i) {
1532
+ switch (i.label) {
1533
+ case 0:
1534
+ return i.trys.push([0, 2, , 3]), [4, this._requestQueue.forceSend(l)];
1535
+ case 1:
1536
+ return t = i.sent(), n = t.as(_e$2).key, this.auth.sessionKey = n, [3, 3];
1537
+ case 2:
1538
+ throw (r = i.sent()).isSessionTokenExpiredError && e(p.sessionTokenRefreshFailed), r;
1539
+ case 3:
1540
+ return [2]
1541
+ }
1542
+ }))
1543
+ }))
1544
+ }), 3)];
1545
+ case 5:
1546
+ return f.sent(), this._logger.debug("session refreshed"), [3, 7];
1547
+ case 6:
1548
+ return f.sent(), this._handleError(t), [2];
1549
+ case 7:
1550
+ return Ie$1((function () {
1551
+ return r(d, void 0, void 0, (function () {
1552
+ return i(this, (function (e) {
1553
+ return this.handler.onSessionRefreshed(), [2]
1554
+ }))
1555
+ }))
1556
+ })), t && t.resolve(), [2]
1557
+ }
1558
+ }))
1559
+ }))
1560
+ }, e.prototype._handleError = function (e) {
1561
+ var t = this,
1562
+ n = p.sessionTokenRefreshFailed;
1563
+ Ie$1((function () {
1564
+ return r(t, void 0, void 0, (function () {
1565
+ return i(this, (function (e) {
1566
+ return this.handler.onSessionError(n), [2]
1567
+ }))
1568
+ }))
1569
+ })), e && e.reject(n);
1570
+ }, e.prototype.refresh = function () {
1571
+ return r(this, void 0, void 0, (function () {
1572
+ var e, t, n, s = this;
1573
+ return i(this, (function (o) {
1574
+ return this.handler ? (e = new ee$1, t = function (t) {
1575
+ t ? (s._logger.debug("session refreshing.."), s.auth.authToken = t, s._refreshSessionKey(t, e)) : (s._logger.debug("session closed"), Ie$1((function () {
1576
+ return r(s, void 0, void 0, (function () {
1577
+ return i(this, (function (e) {
1578
+ return this.handler.onSessionClosed(), [2]
1579
+ }))
1580
+ }))
1581
+ })), e.resolve());
1582
+ }, n = function () {
1583
+ s._dispatcher.dispatch(new ye$2);
1584
+ var t = p.sessionTokenRequestFailed;
1585
+ s.handler && (Ie$1((function () {
1586
+ return r(s, void 0, void 0, (function () {
1587
+ return i(this, (function (e) {
1588
+ return this.handler.onSessionError(t), [2]
1589
+ }))
1590
+ }))
1591
+ })), e.reject(t));
1592
+ }, this._logger.debug("session expired"), this.handler.onSessionExpired(), this.auth.authToken ? this._refreshSessionKey(this.auth.authToken, e) : Ie$1((function () {
1593
+ return r(s, void 0, void 0, (function () {
1594
+ return i(this, (function (e) {
1595
+ return this.handler.onSessionTokenRequired(t, n), [2]
1596
+ }))
1597
+ }))
1598
+ })), [2, e.promise]) : [2]
1599
+ }))
1600
+ }))
1601
+ }, e
1602
+ }(),
1603
+ be$2 = function () {
1604
+ function e() {
1605
+ this.type = exports.J$1.NONE, this.name = "none";
1606
+ }
1607
+ return e.prototype.run = function (e) {
1608
+ return r(this, void 0, void 0, (function () {
1609
+ return i(this, (function (e) {
1610
+ return [2]
1611
+ }))
1612
+ }))
1613
+ }, e.prototype.onConnect = function (e, t) {
1614
+ return r(this, void 0, void 0, (function () {
1615
+ return i(this, (function (e) {
1616
+ return [2]
1617
+ }))
1618
+ }))
1619
+ }, e.prototype.onReconnect = function (e, t) {
1620
+ return t.resetReconnectCount, r(this, void 0, void 0, (function () {
1621
+ return i(this, (function (e) {
1622
+ return [2]
1623
+ }))
1624
+ }))
1625
+ }, e.prototype.onDisconnect = function (e, t) {
1626
+ return t.error, t.autoReconnect, r(this, void 0, void 0, (function () {
1627
+ return i(this, (function (e) {
1628
+ return [2]
1629
+ }))
1630
+ }))
1631
+ }, e.prototype.onLogout = function (e) {
1632
+ return r(this, void 0, void 0, (function () {
1633
+ return i(this, (function (e) {
1634
+ return [2]
1635
+ }))
1636
+ }))
1637
+ }, e
1638
+ }(),
1639
+ Ne$1 = function (e) {
1640
+ function n() {
1641
+ var t = null !== e && e.apply(this, arguments) || this;
1642
+ return t.type = exports.J$1.LOGOUT, t.name = "logout", t
1643
+ }
1644
+ return t(n, e), n.prototype.run = function (e) {
1645
+ return r(this, void 0, void 0, (function () {
1646
+ var t, n = this;
1647
+ return i(this, (function (s) {
1648
+ switch (s.label) {
1649
+ case 0:
1650
+ return t = e.sdkState.userId, e.logout(), Ie$1((function () {
1651
+ return r(n, void 0, void 0, (function () {
1652
+ return i(this, (function (n) {
1653
+ return e.connectionHandlers.forEach((function (e) {
1654
+ e.onDisconnected(t);
1655
+ })), [2]
1656
+ }))
1657
+ }))
1658
+ })), [4, e.changeState(new Re$1)];
1659
+ case 1:
1660
+ return s.sent(), [2]
1661
+ }
1662
+ }))
1663
+ }))
1664
+ }, n
1665
+ }(be$2),
1666
+ Ae$2 = function (e) {
1667
+ function n(t) {
1668
+ var n = t.autoReconnect,
1669
+ r = e.call(this) || this;
1670
+ return r.type = exports.J$1.DISCONNECTED, r.name = "disconnected", r._autoReconnect = !1, r._autoReconnect = n, r
1671
+ }
1672
+ return t(n, e), n.prototype.run = function (e) {
1673
+ return r(this, void 0, void 0, (function () {
1674
+ return i(this, (function (t) {
1675
+ switch (t.label) {
1676
+ case 0:
1677
+ return e.disconnect(), this._autoReconnect ? [4, e.changeState(new Ce$1)] : [3, 2];
1678
+ case 1:
1679
+ t.sent(), t.label = 2;
1680
+ case 2:
1681
+ return [2]
1682
+ }
1683
+ }))
1684
+ }))
1685
+ }, n.prototype.onConnect = function (e, t) {
1686
+ return r(this, void 0, void 0, (function () {
1687
+ return i(this, (function (n) {
1688
+ switch (n.label) {
1689
+ case 0:
1690
+ return e.disconnect(), [4, e.changeState(new we$1({
1691
+ authToken: t
1692
+ }))];
1693
+ case 1:
1694
+ return n.sent(), [2]
1695
+ }
1696
+ }))
1697
+ }))
1698
+ }, n.prototype.onReconnect = function (e) {
1699
+ return r(this, void 0, void 0, (function () {
1700
+ return i(this, (function (t) {
1701
+ switch (t.label) {
1702
+ case 0:
1703
+ return [4, e.changeState(new Ce$1)];
1704
+ case 1:
1705
+ return t.sent(), [2]
1706
+ }
1707
+ }))
1708
+ }))
1709
+ }, n.prototype.onLogout = function (e) {
1710
+ return r(this, void 0, void 0, (function () {
1711
+ return i(this, (function (t) {
1712
+ switch (t.label) {
1713
+ case 0:
1714
+ return [4, e.changeState(new Ne$1)];
1715
+ case 1:
1716
+ return t.sent(), [2]
1717
+ }
1718
+ }))
1719
+ }))
1720
+ }, n
1721
+ }(be$2),
1722
+ Ce$1 = function (e) {
1723
+ function n() {
1724
+ var t = null !== e && e.apply(this, arguments) || this;
1725
+ return t.type = exports.J$1.RECONNECTING, t.name = "reconnecting", t._haltConnect = null, t._resetConnect = null, t._callbacks = [], t
1726
+ }
1727
+ return t(n, e), n.prototype.flushCallbacks = function (e) {
1728
+ void 0 === e && (e = null), this._callbacks.forEach((function (t) {
1729
+ return t(e)
1730
+ }));
1731
+ }, n.prototype.run = function (e) {
1732
+ return r(this, void 0, void 0, (function () {
1733
+ var t, n, s, o, a, c = this;
1734
+ return i(this, (function (l) {
1735
+ switch (l.label) {
1736
+ case 0:
1737
+ t = new ee$1, this._callbacks.push((function (e) {
1738
+ return e ? t.reject(e) : t.resolve()
1739
+ })), Ie$1((function () {
1740
+ return r(c, void 0, void 0, (function () {
1741
+ return i(this, (function (t) {
1742
+ return e.connectionHandlers.forEach((function (e) {
1743
+ e.onReconnectStarted();
1744
+ })), [2]
1745
+ }))
1746
+ }))
1747
+ })), l.label = 1;
1748
+ case 1:
1749
+ return l.trys.push([1, 4, , 9]), n = e.sdkState.websocket, s = n.reconnectMaxRetry, o = n.reconnectRetryStrategy, [4, Ee$2((function (t, n) {
1750
+ return r(c, void 0, void 0, (function () {
1751
+ var r;
1752
+ return i(this, (function (i) {
1753
+ switch (i.label) {
1754
+ case 0:
1755
+ this._haltConnect = t, this._resetConnect = n, i.label = 1;
1756
+ case 1:
1757
+ return i.trys.push([1, 3, , 4]), [4, e.connect()];
1758
+ case 2:
1759
+ return i.sent(), [3, 4];
1760
+ case 3:
1761
+ if ((r = i.sent()) instanceof p && r.code === u.CONNECTION_CANCELED) return t(r), [2];
1762
+ throw r;
1763
+ case 4:
1764
+ return [2]
1765
+ }
1766
+ }))
1767
+ }))
1768
+ }), s, o)];
1769
+ case 2:
1770
+ return l.sent(), [4, e.changeState(new Oe$1)];
1771
+ case 3:
1772
+ return l.sent(), Ie$1((function () {
1773
+ return r(c, void 0, void 0, (function () {
1774
+ return i(this, (function (t) {
1775
+ return e.connectionHandlers.forEach((function (e) {
1776
+ e.onReconnectSucceeded();
1777
+ })), this.flushCallbacks(null), [2]
1778
+ }))
1779
+ }))
1780
+ })), [3, 9];
1781
+ case 4:
1782
+ return a = l.sent(), h$1(a) ? [3, 7] : a instanceof p ? a.code === u.CONNECTION_CANCELED ? [3, 6] : [4, e.changeState(new Ae$2({
1783
+ autoReconnect: !1
1784
+ }))] : [3, 6];
1785
+ case 5:
1786
+ l.sent(), l.label = 6;
1787
+ case 6:
1788
+ return Ie$1((function () {
1789
+ return r(c, void 0, void 0, (function () {
1790
+ return i(this, (function (t) {
1791
+ return e.connectionHandlers.forEach((function (e) {
1792
+ e.onReconnectFailed();
1793
+ })), this.flushCallbacks(a), [2]
1794
+ }))
1795
+ }))
1796
+ })), [3, 8];
1797
+ case 7:
1798
+ throw a;
1799
+ case 8:
1800
+ return [3, 9];
1801
+ case 9:
1802
+ return [2, t.promise]
1803
+ }
1804
+ }))
1805
+ }))
1806
+ }, n.prototype.onConnect = function (e, t) {
1807
+ return r(this, void 0, void 0, (function () {
1808
+ var t;
1809
+ return i(this, (function (n) {
1810
+ return t = new ee$1, this._resetConnect && this._resetConnect(), e.cancelConnectForRetry(), this._callbacks.push((function (e) {
1811
+ return e ? t.reject(e) : t.resolve()
1812
+ })), [2, t.promise]
1813
+ }))
1814
+ }))
1815
+ }, n.prototype.onReconnect = function (e, t) {
1816
+ var n = t.resetReconnectCount,
1817
+ s = void 0 !== n && n;
1818
+ return r(this, void 0, void 0, (function () {
1819
+ var t;
1820
+ return i(this, (function (n) {
1821
+ return t = new ee$1, this._resetConnect && s && this._resetConnect(), e.cancelConnectForRetry(), this._callbacks.push((function (e) {
1822
+ return e ? t.reject(e) : t.resolve()
1823
+ })), [2, t.promise]
1824
+ }))
1825
+ }))
1826
+ }, n.prototype.onDisconnect = function (e, t) {
1827
+ var n = t.error,
1828
+ s = void 0 === n ? null : n,
1829
+ o = t.autoReconnect,
1830
+ a = void 0 === o || o;
1831
+ return r(this, void 0, void 0, (function () {
1832
+ return i(this, (function (t) {
1833
+ switch (t.label) {
1834
+ case 0:
1835
+ return this._haltConnect && this._haltConnect(null != s ? s : p.connectionCanceled), [4, e.changeState(new Ae$2({
1836
+ autoReconnect: a
1837
+ }))];
1838
+ case 1:
1839
+ return t.sent(), [2]
1840
+ }
1841
+ }))
1842
+ }))
1843
+ }, n.prototype.onLogout = function (e) {
1844
+ return r(this, void 0, void 0, (function () {
1845
+ return i(this, (function (t) {
1846
+ switch (t.label) {
1847
+ case 0:
1848
+ return this._haltConnect && this._haltConnect(p.connectionCanceled), [4, e.changeState(new Ne$1)];
1849
+ case 1:
1850
+ return t.sent(), [2]
1851
+ }
1852
+ }))
1853
+ }))
1854
+ }, n
1855
+ }(be$2),
1856
+ Oe$1 = function (e) {
1857
+ function n() {
1858
+ var t = null !== e && e.apply(this, arguments) || this;
1859
+ return t.type = exports.J$1.CONNECTED, t.name = "connected", t
1860
+ }
1861
+ return t(n, e), n.prototype.onReconnect = function (e) {
1862
+ return r(this, void 0, void 0, (function () {
1863
+ return i(this, (function (t) {
1864
+ switch (t.label) {
1865
+ case 0:
1866
+ return e.disconnect(), [4, e.changeState(new Ce$1)];
1867
+ case 1:
1868
+ return t.sent(), [2]
1869
+ }
1870
+ }))
1871
+ }))
1872
+ }, n.prototype.onDisconnect = function (e, t) {
1873
+ var n = t.autoReconnect;
1874
+ return r(this, void 0, void 0, (function () {
1875
+ return i(this, (function (t) {
1876
+ switch (t.label) {
1877
+ case 0:
1878
+ return [4, e.changeState(new Ae$2({
1879
+ autoReconnect: n
1880
+ }))];
1881
+ case 1:
1882
+ return t.sent(), [2]
1883
+ }
1884
+ }))
1885
+ }))
1886
+ }, n.prototype.onLogout = function (e) {
1887
+ return r(this, void 0, void 0, (function () {
1888
+ return i(this, (function (t) {
1889
+ switch (t.label) {
1890
+ case 0:
1891
+ return [4, e.changeState(new Ne$1)];
1892
+ case 1:
1893
+ return t.sent(), [2]
1894
+ }
1895
+ }))
1896
+ }))
1897
+ }, n
1898
+ }(be$2),
1899
+ we$1 = function (e) {
1900
+ function n(t) {
1901
+ var n = t.authToken,
1902
+ r = e.call(this) || this;
1903
+ return r.type = exports.J$1.CONNECTING, r.name = "connecting", r._authToken = "", r._haltConnect = null, r._callbacks = [], r._authToken = n, r
1904
+ }
1905
+ return t(n, e), n.prototype.flushCallbacks = function (e) {
1906
+ void 0 === e && (e = null), this._callbacks.forEach((function (t) {
1907
+ return t(e)
1908
+ }));
1909
+ }, n.prototype.run = function (e) {
1910
+ return r(this, void 0, void 0, (function () {
1911
+ var t, n, s = this;
1912
+ return i(this, (function (o) {
1913
+ switch (o.label) {
1914
+ case 0:
1915
+ t = new ee$1, this._callbacks.push((function (e) {
1916
+ return e ? t.reject(e) : t.resolve()
1917
+ })), o.label = 1;
1918
+ case 1:
1919
+ return o.trys.push([1, 4, , 9]), [4, Ee$2((function (t) {
1920
+ return r(s, void 0, void 0, (function () {
1921
+ var n;
1922
+ return i(this, (function (r) {
1923
+ switch (r.label) {
1924
+ case 0:
1925
+ this._haltConnect = t, r.label = 1;
1926
+ case 1:
1927
+ return r.trys.push([1, 3, , 4]), [4, e.connect(this._authToken)];
1928
+ case 2:
1929
+ return r.sent(), [3, 4];
1930
+ case 3:
1931
+ if ((n = r.sent()) instanceof p && n.code === u.CONNECTION_CANCELED) return t(n), [2];
1932
+ throw n;
1933
+ case 4:
1934
+ return [2]
1935
+ }
1936
+ }))
1937
+ }))
1938
+ }), e.sdkState.websocket.connectMaxRetry)];
1939
+ case 2:
1940
+ return o.sent(), [4, e.changeState(new Oe$1)];
1941
+ case 3:
1942
+ return o.sent(), Ie$1((function () {
1943
+ return r(s, void 0, void 0, (function () {
1944
+ return i(this, (function (t) {
1945
+ return e.connectionHandlers.forEach((function (t) {
1946
+ t.onConnected(e.sdkState.userId);
1947
+ })), this.flushCallbacks(null), [2]
1948
+ }))
1949
+ }))
1950
+ })), [3, 9];
1951
+ case 4:
1952
+ return n = o.sent(), h$1(n) ? [3, 7] : (e.disconnect(), n instanceof p ? n.code === u.CONNECTION_CANCELED ? [3, 6] : [4, e.changeState(new Re$1)] : [3, 6]);
1953
+ case 5:
1954
+ o.sent(), o.label = 6;
1955
+ case 6:
1956
+ return Ie$1((function () {
1957
+ return r(s, void 0, void 0, (function () {
1958
+ return i(this, (function (e) {
1959
+ return this.flushCallbacks(n), [2]
1960
+ }))
1961
+ }))
1962
+ })), [3, 8];
1963
+ case 7:
1964
+ throw n;
1965
+ case 8:
1966
+ return [3, 9];
1967
+ case 9:
1968
+ return [2, t.promise]
1969
+ }
1970
+ }))
1971
+ }))
1972
+ }, n.prototype.onConnect = function (e) {
1973
+ return r(this, void 0, void 0, (function () {
1974
+ var e;
1975
+ return i(this, (function (t) {
1976
+ return e = new ee$1, this._callbacks.push((function (t) {
1977
+ return t ? e.reject(t) : e.resolve()
1978
+ })), [2, e.promise]
1979
+ }))
1980
+ }))
1981
+ }, n.prototype.onDisconnect = function (e, t) {
1982
+ var n = t.error,
1983
+ s = void 0 === n ? null : n;
1984
+ return r(this, void 0, void 0, (function () {
1985
+ return i(this, (function (t) {
1986
+ switch (t.label) {
1987
+ case 0:
1988
+ return this._haltConnect && this._haltConnect(null != s ? s : p.connectionCanceled), [4, e.changeState(new Ne$1)];
1989
+ case 1:
1990
+ return t.sent(), [2]
1991
+ }
1992
+ }))
1993
+ }))
1994
+ }, n.prototype.onLogout = function (e) {
1995
+ return r(this, void 0, void 0, (function () {
1996
+ return i(this, (function (t) {
1997
+ switch (t.label) {
1998
+ case 0:
1999
+ return this._haltConnect && this._haltConnect(p.connectionCanceled), [4, e.changeState(new Ne$1)];
2000
+ case 1:
2001
+ return t.sent(), [2]
2002
+ }
2003
+ }))
2004
+ }))
2005
+ }, n
2006
+ }(be$2),
2007
+ Re$1 = function (e) {
2008
+ function n() {
2009
+ var t = null !== e && e.apply(this, arguments) || this;
2010
+ return t.type = exports.J$1.INITIALIZED, t.name = "initialized", t
2011
+ }
2012
+ return t(n, e), n.prototype.onConnect = function (e, t) {
2013
+ return r(this, void 0, void 0, (function () {
2014
+ return i(this, (function (n) {
2015
+ // debugger
2016
+ switch (n.label) {
2017
+ case 0:
2018
+ return [4, e.changeState(new we$1({
2019
+ authToken: t
2020
+ }))];
2021
+ case 1:
2022
+ return n.sent(), [2]
2023
+ }
2024
+ }))
2025
+ }))
2026
+ }, n
2027
+ }(be$2),
2028
+ De$1 = new Map,
2029
+ Me$1 = function (e, t) {
2030
+ var n;
2031
+ return void 0 === t && (t = null), null !== t && De$1.set(e, t), null !== (n = De$1.get(e)) && void 0 !== n ? n : ""
2032
+ },
2033
+ ke$1 = function (e) {
2034
+ void 0 === e && (e = {}), this.emojiHash = e.emoji_hash || "", this.uploadSizeLimit = e.file_upload_size_limit ? 1048576 * e.file_upload_size_limit : Number.MAX_VALUE, this.useReaction = !!e.use_reaction, this.applicationAttributes = e.application_attributes || [], this.premiumFeatureList = e.premium_feature_list || [];
2035
+ },
2036
+ Le$1 = function () {
2037
+ function e(e) {
2038
+ this._iid = "", this._iid = e;
2039
+ }
2040
+ return e.payloadify = function (e) {
2041
+ return e ? {} : null
2042
+ }, e
2043
+ }(),
2044
+ Ue$1 = "/".concat("v3", "/users"),
2045
+ Pe$1 = "/".concat("v3", "/storage/file"),
2046
+ qe$1 = "/".concat("v3", "/group_channels"),
2047
+ Fe$1 = "/".concat("v3", "/sdk/group_channels"),
2048
+ xe$1 = "/".concat("v3", "/open_channels"),
2049
+ Ge$1 = "/".concat("v3", "/sdk/open_channels"),
2050
+ Qe$1 = "/".concat("v3", "/search"),
2051
+ je$1 = "/".concat("v3", "/report"),
2052
+ Ke$1 = "/".concat("v3", "/emojis"),
2053
+ ze$1 = "/".concat("v3", "/emoji_categories"),
2054
+ Ve$1 = "/".concat("v3", "/scheduled_messages"),
2055
+ Be$1 = "/".concat("v3", "/sdk/statistics"),
2056
+ He$1 = function (e) {
2057
+ function n(t) {
2058
+ var n = t.userId,
2059
+ r = t.metadata,
2060
+ i = e.call(this) || this;
2061
+ return i.method = exports.d.POST, i.path = "".concat(Ue$1, "/").concat(n, "/metadata"), i.params = {
2062
+ metadata: r
2063
+ }, i
2064
+ }
2065
+ return t(n, e), n
2066
+ }(q);
2067
+ ! function (e) {
2068
+ function n(t, n) {
2069
+ var r = e.call(this, t, n) || this;
2070
+ return r.metadata = n, r
2071
+ }
2072
+ t(n, e);
2073
+ }(F),
2074
+ function (e) {
2075
+ e.BASE = "base", e.GROUP = "group", e.OPEN = "open";
2076
+ }(exports.ne || (exports.ne = {})),
2077
+ function (e) {
2078
+ e.OPERATOR = "operator", e.NONE = "none";
2079
+ }(exports.re$1 || (exports.re$1 = {})),
2080
+ function (e) {
2081
+ e.BASE = "base", e.USER = "user", e.FILE = "file", e.ADMIN = "admin";
2082
+ }(ie$1 || (ie$1 = {})),
2083
+ function (e) {
2084
+ e.ALL = "", e.USER = "MESG", e.FILE = "FILE", e.ADMIN = "ADMM";
2085
+ }(exports.se$1 || (exports.se$1 = {})),
2086
+ function (e) {
2087
+ e.USER = "MESG", e.FILE = "FILE", e.ADMIN = "ADMM";
2088
+ }(exports.oe$1 || (exports.oe$1 = {})),
2089
+ function (e) {
2090
+ e.USERS = "users", e.CHANNEL = "channel";
2091
+ }(exports.ae$1 || (exports.ae$1 = {})),
2092
+ function (e) {
2093
+ e.ALL = "all", e.NONE = "none", e.ONLY_REPLY_TO_CHANNEL = "only_reply_to_channel";
2094
+ }(exports.ue || (exports.ue = {})),
2095
+ function (e) {
2096
+ e.DEFAULT = "default", e.SUPPRESS = "suppress";
2097
+ }(ce$2 || (ce$2 = {})),
2098
+ function (e) {
2099
+ e.PENDING = "pending", e.SCHEDULED = "scheduled", e.SUCCEEDED = "succeeded", e.FAILED = "failed", e.CANCELED = "canceled";
2100
+ }(exports.le || (exports.le = {}));
2101
+ var We$1 = function (e) {
2102
+ switch (e) {
2103
+ case exports.ne.GROUP:
2104
+ return qe$1;
2105
+ case exports.ne.OPEN:
2106
+ return xe$1;
2107
+ default:
2108
+ return null
2109
+ }
2110
+ },
2111
+ Xe$1 = function (e) {
2112
+ switch (e) {
2113
+ case exports.ne.GROUP:
2114
+ return "".concat(je$1, "/group_channels");
2115
+ case exports.ne.OPEN:
2116
+ return "".concat(je$1, "/open_channels");
2117
+ default:
2118
+ return null
2119
+ }
2120
+ },
2121
+ Ye$1 = function (e, t, n) {
2122
+ var r, i;
2123
+ switch (e) {
2124
+ case exports.ae$1.CHANNEL:
2125
+ return !0;
2126
+ case exports.ae$1.USERS:
2127
+ if (t) try {
2128
+ for (var o = s(t), a = o.next(); !a.done; a = o.next()) {
2129
+ if (a.value === n) return !0
2130
+ }
2131
+ } catch (e) {
2132
+ r = {
2133
+ error: e
2134
+ };
2135
+ } finally {
2136
+ try {
2137
+ a && !a.done && (i = o.return) && i.call(o);
2138
+ } finally {
2139
+ if (r) throw r.error
2140
+ }
2141
+ }
2142
+ }
2143
+ return !1
2144
+ },
2145
+ Je$1 = function (e, t, n) {
2146
+ var r = Ye$1(e.mentionType, e.mentionedUserIds, n),
2147
+ i = Ye$1(t.mentionType, t.mentionedUserIds, n);
2148
+ return !r && i ? 1 : r && !i ? -1 : 0
2149
+ },
2150
+ Ze$1 = function (e) {
2151
+ function n(t) {
2152
+ var n = this,
2153
+ r = t.channelUrl,
2154
+ i = t.channelType,
2155
+ s = t.metadata;
2156
+ return (n = e.call(this) || this).method = exports.d.POST, n.path = "".concat(We$1(i), "/").concat(encodeURIComponent(r), "/metadata"), n.params = {
2157
+ metadata: s,
2158
+ include_ts: !0
2159
+ }, n
2160
+ }
2161
+ return t(n, e), n
2162
+ }(q),
2163
+ $e$1 = function (e) {
2164
+ function n(t, n) {
2165
+ var r = e.call(this, t, n) || this;
2166
+ return r.metaData = null != n ? n : {}, r
2167
+ }
2168
+ return t(n, e), n
2169
+ }(F),
2170
+ et$1 = function (e) {
2171
+ function n(t) {
2172
+ var n = t.userId,
2173
+ r = t.metadata,
2174
+ i = t.upsert,
2175
+ s = e.call(this) || this;
2176
+ return s.method = exports.d.PUT, s.path = "".concat(Ue$1, "/").concat(n, "/metadata"), s.params = {
2177
+ metadata: r,
2178
+ upsert: i
2179
+ }, s
2180
+ }
2181
+ return t(n, e), n
2182
+ }(q),
2183
+ tt$1 = function (e) {
2184
+ function n(t, n) {
2185
+ var r = e.call(this, t, n) || this;
2186
+ return r.metadata = n, r
2187
+ }
2188
+ return t(n, e), n
2189
+ }(F),
2190
+ nt$1 = function (e) {
2191
+ function n(t) {
2192
+ var n = t.userId,
2193
+ r = t.metadataKey,
2194
+ i = e.call(this) || this;
2195
+ return i.method = exports.d.DELETE, i.path = "".concat(Ue$1, "/").concat(n, "/metadata/").concat(r), i
2196
+ }
2197
+ return t(n, e), n
2198
+ }(q);
2199
+ ! function (e) {
2200
+ function n() {
2201
+ return null !== e && e.apply(this, arguments) || this
2202
+ }
2203
+ t(n, e);
2204
+ }(F);
2205
+ var rt$1 = function (e) {
2206
+ function n(t) {
2207
+ var n = t.userId,
2208
+ r = e.call(this) || this;
2209
+ return r.method = exports.d.DELETE, r.path = "".concat(Ue$1, "/").concat(n, "/metadata"), r
2210
+ }
2211
+ return t(n, e), n
2212
+ }(q);
2213
+ ! function (e) {
2214
+ function n() {
2215
+ return null !== e && e.apply(this, arguments) || this
2216
+ }
2217
+ t(n, e);
2218
+ }(F);
2219
+ var it$1, st$1 = function (e, t) {
2220
+ void 0 === t && (t = null);
2221
+ var n = JSON.parse(JSON.stringify(e));
2222
+ return n._iid && delete n._iid, t && t(n), n
2223
+ },
2224
+ ot$1 = function (e, t) {
2225
+ void 0 === t && (t = null);
2226
+ var n = JSON.parse(JSON.stringify(e));
2227
+ return t && t(n), n
2228
+ },
2229
+ at$1 = function (e) {
2230
+ return {
2231
+ do: function (t) {
2232
+ e || t();
2233
+ },
2234
+ throw: function (t) {
2235
+ if (!e) throw t
2236
+ }
2237
+ }
2238
+ };
2239
+ ! function (e) {
2240
+ e.ONLINE = "online", e.OFFLINE = "offline", e.NON_AVAILABLE = "nonavailable";
2241
+ }(it$1 || (it$1 = {}));
2242
+ var ut$1, ct$1 = function (e) {
2243
+ function s(t, n) {
2244
+ var r, i, s, u, c, l, d, h, p, f, _, g, v = this;
2245
+ return (v = e.call(this, t) || this).userId = null !== (i = null !== (r = n.guest_id) && void 0 !== r ? r : n.user_id) && void 0 !== i ? i : "", v.nickname = null !== (u = null !== (s = n.nickname) && void 0 !== s ? s : n.name) && void 0 !== u ? u : "", v.plainProfileUrl = null !== (l = null !== (c = n.profile_url) && void 0 !== c ? c : n.image) && void 0 !== l ? l : "", v.requireAuth = null !== (d = n.require_auth_for_profile_image) && void 0 !== d && d, v.metaData = null !== (h = n.metadata) && void 0 !== h ? h : {}, v.connectionStatus = it$1.NON_AVAILABLE, m(it$1, n.is_online) ? v.connectionStatus = n.is_online : y("boolean", n.is_online) && (v.connectionStatus = n.is_online ? it$1.ONLINE : it$1.OFFLINE), v.isActive = null === (p = n.is_active) || void 0 === p || p, v.lastSeenAt = null !== (f = n.last_seen_at) && void 0 !== f ? f : null, v.preferredLanguages = n.preferred_languages ? a([], o(n.preferred_languages), !1) : null, v.friendDiscoveryKey = null !== (_ = n.friend_discovery_key) && void 0 !== _ ? _ : null, v.friendName = null !== (g = n.friend_name) && void 0 !== g ? g : null, v
2246
+ }
2247
+ return t(s, e), s.payloadify = function (t) {
2248
+ return t ? U$1(exports.n(exports.n({}, e.payloadify.call(this, t)), {
2249
+ user_id: t.userId,
2250
+ nickname: t.nickname,
2251
+ profile_url: t.plainProfileUrl,
2252
+ require_auth_for_profile_image: t.requireAuth,
2253
+ metadata: t.metaData,
2254
+ is_online: t.connectionStatus,
2255
+ is_active: t.isActive,
2256
+ last_seen_at: t.lastSeenAt,
2257
+ preferred_languages: t.preferredLanguages,
2258
+ friend_discovery_key: t.friendDiscoveryKey,
2259
+ friend_name: t.friendName
2260
+ })) : null
2261
+ }, Object.defineProperty(s.prototype, "profileUrl", {
2262
+ get: function () {
2263
+ return this.requireAuth ? "".concat(this.plainProfileUrl, "?auth=").concat(Me$1(this._iid)) : this.plainProfileUrl
2264
+ },
2265
+ enumerable: !1,
2266
+ configurable: !0
2267
+ }), s.prototype.serialize = function () {
2268
+ return st$1(this)
2269
+ }, s.prototype._isValidMetaData = function (e) {
2270
+ return !Array.isArray(e) && Object.keys(e).length > 0 && Object.keys(e).map((function (t) {
2271
+ return e[t]
2272
+ })).every((function (e) {
2273
+ return y("string", e)
2274
+ }))
2275
+ }, s.prototype._applyMetaData = function (e, t) {
2276
+ var n = this;
2277
+ void 0 === t && (t = !1), Object.keys(e).forEach((function (r) {
2278
+ t ? delete n.metaData[r] : n.metaData[r] = e[r];
2279
+ }));
2280
+ }, s.prototype.createMetaData = function (e) {
2281
+ return r(this, void 0, void 0, (function () {
2282
+ var t, n, r, s, o, a;
2283
+ return i(this, (function (i) {
2284
+ switch (i.label) {
2285
+ case 0:
2286
+ return at$1(this._isValidMetaData(e)).throw(p.invalidParameters), t = St$1.of(this._iid), n = t.sdkState, r = t.requestQueue, s = new He$1({
2287
+ userId: n.userId,
2288
+ metadata: e
2289
+ }), [4, r.send(s)];
2290
+ case 1:
2291
+ return o = i.sent(), a = o.as($e$1).metaData, this._applyMetaData(a), [2, this.metaData]
2292
+ }
2293
+ }))
2294
+ }))
2295
+ }, s.prototype.updateMetaData = function (e, t) {
2296
+ return void 0 === t && (t = !1), r(this, void 0, void 0, (function () {
2297
+ var n, r, s, o, a, u;
2298
+ return i(this, (function (i) {
2299
+ switch (i.label) {
2300
+ case 0:
2301
+ return at$1(this._isValidMetaData(e)).throw(p.invalidParameters), n = St$1.of(this._iid), r = n.sdkState, s = n.requestQueue, o = new et$1({
2302
+ userId: r.userId,
2303
+ metadata: e,
2304
+ upsert: t
2305
+ }), [4, s.send(o)];
2306
+ case 1:
2307
+ return a = i.sent(), u = a.as(tt$1).metadata, this._applyMetaData(u), [2, this.metaData]
2308
+ }
2309
+ }))
2310
+ }))
2311
+ }, s.prototype.deleteMetaData = function (e) {
2312
+ return r(this, void 0, void 0, (function () {
2313
+ var t, n, r, s, o;
2314
+ return i(this, (function (i) {
2315
+ switch (i.label) {
2316
+ case 0:
2317
+ return at$1(y("string", e)).throw(p.invalidParameters), t = St$1.of(this._iid), n = t.sdkState, r = t.requestQueue, s = new nt$1({
2318
+ userId: n.userId,
2319
+ metadataKey: e
2320
+ }), [4, r.send(s)];
2321
+ case 1:
2322
+ return i.sent(), this._applyMetaData(((o = {})[e] = !0, o), !0), [2, this.metaData]
2323
+ }
2324
+ }))
2325
+ }))
2326
+ }, s.prototype.deleteAllMetaData = function () {
2327
+ return r(this, void 0, void 0, (function () {
2328
+ var e, t, n, r;
2329
+ return i(this, (function (i) {
2330
+ switch (i.label) {
2331
+ case 0:
2332
+ return e = St$1.of(this._iid), t = e.sdkState, n = e.requestQueue, r = new rt$1({
2333
+ userId: t.userId
2334
+ }), [4, n.send(r)];
2335
+ case 1:
2336
+ return i.sent(), this.metaData = {}, [2]
2337
+ }
2338
+ }))
2339
+ }))
2340
+ }, s
2341
+ }(Le$1),
2342
+ lt$1 = function (e) {
2343
+ function n(t) {
2344
+ var n = t.userProfile,
2345
+ r = e.call(this) || this;
2346
+ return r.userProfile = n, r
2347
+ }
2348
+ return t(n, e), n
2349
+ }(L),
2350
+ dt$1 = function () {
2351
+ function e(e, t) {
2352
+ var n, r, i, s, o, a, u, c, l, d, h, p, f, _;
2353
+ this._iid = e, this.appInfo = new ke$1(t), this.user = new ct$1(e, t), this.connectedAt = 1e3 * (null !== (n = t.login_ts) && void 0 !== n ? n : 0), this.firstConnectedAt = 0, this.pingInterval = null !== (r = t.ping_interval) && void 0 !== r ? r : 15e3, this.pongTimeout = null !== (i = t.pong_timeout) && void 0 !== i ? i : 5e3, this.reconnectInterval = null !== (o = null === (s = t.reconnect) || void 0 === s ? void 0 : s.interval) && void 0 !== o ? o : 3e3, this.reconnectMaxInterval = null !== (u = null === (a = t.reconnect) || void 0 === a ? void 0 : a.max_interval) && void 0 !== u ? u : 6e4, this.reconnectRetryCount = null !== (l = null === (c = t.reconnect) || void 0 === c ? void 0 : c.retry_cnt) && void 0 !== l ? l : 5, this.reconnectIntervalMultiple = null !== (h = null === (d = t.reconnect) || void 0 === d ? void 0 : d.mul) && void 0 !== h ? h : 2, this.maxUnreadCountOnSuperGroup = null !== (p = t.max_unread_cnt_on_super_group) && void 0 !== p ? p : 100, this.profileImageEncryption = !!t.profile_image_encryption, this.concurrentCallLimit = null !== (f = t.concurrent_call_limit) && void 0 !== f ? f : 5, this.backOffDelay = null !== (_ = t.back_off_delay) && void 0 !== _ ? _ : 100;
2354
+ }
2355
+ return e.payloadify = function (e) {
2356
+ return exports.n(exports.n({}, ct$1.payloadify(e.user)), {
2357
+ emoji_hash: e.appInfo.emojiHash,
2358
+ file_upload_size_limit: e.appInfo.uploadSizeLimit,
2359
+ application_attributes: e.appInfo.applicationAttributes,
2360
+ premium_feature_list: e.appInfo.premiumFeatureList,
2361
+ login_ts: e.connectedAt / 1e3,
2362
+ ping_interval: e.pingInterval,
2363
+ pong_timeout: e.pongTimeout,
2364
+ reconnect: {
2365
+ interval: e.reconnectInterval,
2366
+ max_interval: e.reconnectMaxInterval,
2367
+ retry_cnt: e.reconnectRetryCount,
2368
+ mul: e.reconnectIntervalMultiple
2369
+ },
2370
+ max_unread_cnt_on_super_group: e.maxUnreadCountOnSuperGroup,
2371
+ profile_image_encryption: e.profileImageEncryption,
2372
+ concurrent_call_limit: e.concurrentCallLimit,
2373
+ back_off_delay: e.backOffDelay
2374
+ })
2375
+ }, e.prototype.apply = function () {
2376
+ var e = this.reconnectInterval,
2377
+ t = this.reconnectMaxInterval,
2378
+ n = this.reconnectIntervalMultiple,
2379
+ r = St$1.of(this._iid);
2380
+ r.sdkState.websocket.pingInterval = 1e3 * this.pingInterval, r.sdkState.websocket.pongTimeout = 1e3 * this.pongTimeout, r.sdkState.websocket.reconnectMaxRetry = this.reconnectRetryCount, r.sdkState.websocket.reconnectRetryStrategy = {
2381
+ calcTimeout: function (r) {
2382
+ return r > 0 ? 1e3 * Math.min(e * Math.pow(n, r - 1), t) : 10
2383
+ }
2384
+ }, r.appInfo = this.appInfo, r.sessionManager.currentUser = this.user, r.connectedAt = this.connectedAt, this.firstConnectedAt || (r.firstConnectedAt = this.connectedAt), r.maxSuperGroupChannelUnreadCount = this.maxUnreadCountOnSuperGroup, r.concurrentCallLimit = this.concurrentCallLimit, r.backOffDelay = this.backOffDelay, r.dispatcher.dispatch(new lt$1({
2385
+ userProfile: this
2386
+ }));
2387
+ }, e
2388
+ }(),
2389
+ ht$1 = function (e) {
2390
+ function r(t, n, r) {
2391
+ var i, s = this;
2392
+ return (s = e.call(this, t, n, r) || this).error = null, s.userProfile = new dt$1(t, r), s.key = r.key, s.ekey = null !== (i = r.ekey) && void 0 !== i ? i : "", s.error = r.error ? new p(r) : null, s
2393
+ }
2394
+ return t(r, e), r.asError = function (e) {
2395
+ return new r(null, "LOGI", exports.n({
2396
+ user_id: null,
2397
+ error: !0
2398
+ }, e))
2399
+ }, r.prototype.applyTo = function (e) {
2400
+ if (this.error) throw this.error;
2401
+ var t = St$1.of(e);
2402
+ if (!t) throw p.lostInstance;
2403
+ t.sessionManager.auth.sessionKey = this.key, Me$1(e, this.ekey), this.userProfile.apply();
2404
+ }, r
2405
+ }(B),
2406
+ pt$1 = function (e) {
2407
+ function n(t) {
2408
+ var n = e.call(this) || this;
2409
+ return n.enabled = t, n
2410
+ }
2411
+ return t(n, e), n
2412
+ }(L),
2413
+ ft$1 = function (e) {
2414
+ function n(t, n) {
2415
+ var r = n.sdkState,
2416
+ i = n.connectionHandlers,
2417
+ s = n.sessionManager,
2418
+ o = n.websocketClient,
2419
+ a = n.dispatcher,
2420
+ u = n.logger,
2421
+ c = n.entryState,
2422
+ l = void 0 === c ? new Re$1 : c,
2423
+ d = e.call(this) || this;
2424
+ return d._currentState = null, d._loginTimer = null, d._connectingAt = 0, d._connectionRequestQueue = [], d._iid = t, d.sdkState = r, d.connectionHandlers = i, d._sessionManager = s, d._websocketClient = o, d._dispatcher = a, d._logger = u, d._currentState = l, d._websocketClient.on("message", (function (e) {
2425
+ if ("LOGI" === e.code) {
2426
+ d._loginTimer && (clearTimeout(d._loginTimer), d._loginTimer = null);
2427
+ var t = e.as(ht$1);
2428
+ if (t.error) t.error.isSessionKeyExpiredError && d._dispatcher.dispatch(new G), d._connectionRequestQueue.forEach((function (e) {
2429
+ return e.reject(t.error)
2430
+ })), d._statLogConnection(t.error);
2431
+ else {
2432
+ t.applyTo(d._iid), d._connectionRequestQueue.forEach((function (e) {
2433
+ return e.resolve()
2434
+ }));
2435
+ var n = t.userProfile;
2436
+ d._enableStatLog(n.appInfo.applicationAttributes.includes("allow_sdk_request_log_publish")), d._statLogConnection(null);
2437
+ }
2438
+ d._connectionRequestQueue = [];
2439
+ }
2440
+ })).on("close", (function () {
2441
+ d._connectionRequestQueue.length > 0 && (d._connectionRequestQueue.forEach((function (e) {
2442
+ return e.reject(p.networkError)
2443
+ })), d._connectionRequestQueue = [], d._statLogConnection(p.networkError));
2444
+ })), d
2445
+ }
2446
+ return t(n, e), Object.defineProperty(n.prototype, "currentState", {
2447
+ get: function () {
2448
+ return this._currentState
2449
+ },
2450
+ enumerable: !1,
2451
+ configurable: !0
2452
+ }), n.prototype.changeState = function (e) {
2453
+ return r(this, void 0, void 0, (function () {
2454
+ return i(this, (function (t) {
2455
+ // debugger last point
2456
+ switch (t.label) {
2457
+ case 0:
2458
+ return this._currentState = e, this._dispatcher.dispatch(new de$2({
2459
+ stateType: e.type
2460
+ })), this._logger.debug("connection state changes to ".concat(e.name)), [4, this._currentState.run(this)];
2461
+ case 1:
2462
+ return t.sent(), [2]
2463
+ }
2464
+ }))
2465
+ }))
2466
+ }, n.prototype._url = function (e) {
2467
+ void 0 === e && (e = "");
2468
+ var t = this.sdkState,
2469
+ n = t.appId,
2470
+ r = t.appVersion,
2471
+ i = t.userId,
2472
+ s = t.extensions,
2473
+ o = this._sessionManager.auth,
2474
+ a = s.sb_syncmanager ? "s".concat(s.sb_syncmanager) : "",
2475
+ u = s.sb_uikit ? "u".concat(s.sb_uikit) : "",
2476
+ c = "JS/c".concat(l$1.SDK_VERSION, "/").concat(a, "/").concat(u);
2477
+ return "".concat(this.sdkState.websocket.host, "/?p=JS&pv=").concat(encodeURIComponent(l$1.OS_VERSION), "&sv=").concat(encodeURIComponent(l$1.SDK_VERSION), "&ai=").concat(n).concat(r ? "&av=".concat(r) : "").concat(o.hasSession ? "&key=".concat(encodeURIComponent(o.sessionKey)) : "&user_id=".concat(encodeURIComponent(i), "&access_token=").concat(encodeURIComponent(e)), "&active=1&SB-User-Agent=").concat(c, "&Request-Sent-Timestamp=").concat(Date.now().toString(), "&include_extra_data=").concat(encodeURIComponent(String(["premium_feature_list", "file_upload_size_limit", "application_attributes", "emoji_hash"]))).concat(this._sessionManager.handler ? "&expiring_session=1" : "", "&use_local_cache=1")
2478
+ }, n.prototype._enableStatLog = function (e) {
2479
+ this._dispatcher.dispatch(new pt$1(e));
2480
+ }, n.prototype._statLogConnection = function (e) {
2481
+ this._dispatcher.dispatch(new Q(new K({
2482
+ type: P.WEBSOCKET_CONNECT,
2483
+ data: {
2484
+ host_url: this.sdkState.websocket.host,
2485
+ success: !e,
2486
+ latency: Date.now() - this._connectingAt,
2487
+ error_code: null == e ? void 0 : e.code,
2488
+ error_description: null == e ? void 0 : e.message
2489
+ }
2490
+ })));
2491
+ }, n.prototype.connect = function (e) {
2492
+ return void 0 === e && (e = ""), r(this, void 0, void 0, (function () {
2493
+ var t, n, r = this;
2494
+ return i(this, (function (i) {
2495
+ return t = this._url(e), n = new ee$1, this._connectionRequestQueue.push(n), 1 === this._connectionRequestQueue.length && (this._connectingAt = Date.now(), this._loginTimer = setTimeout((function () {
2496
+ r._loginTimer = null, r._dispatcher.dispatch(ht$1.asError(p.loginTimeout));
2497
+ }), this.sdkState.websocket.responseTimeout), this._websocketClient.connect(t)), [2, n.promise]
2498
+ }))
2499
+ }))
2500
+ }, n.prototype.cancelConnectForRetry = function () {
2501
+ this._dispatcher.dispatch(ht$1.asError(p.connectionRenew));
2502
+ }, n.prototype.disconnect = function () {
2503
+ this._websocketClient.disconnect();
2504
+ }, n.prototype.logout = function () {
2505
+ this.sdkState.userId = null, this._sessionManager.currentUser = null, this._sessionManager.auth.clear(), this.disconnect();
2506
+ }, n
2507
+ }(M),
2508
+ _t$1 = function () {
2509
+ function e(e, t) {
2510
+ var n = t.sdkState,
2511
+ r = t.connectionHandlers,
2512
+ i = t.sessionManager,
2513
+ s = t.websocketClient,
2514
+ o = t.dispatcher,
2515
+ a = t.logger,
2516
+ u = t.disableAutoReconnect,
2517
+ c = void 0 !== u && u,
2518
+ l = this;
2519
+ this._context = null, this._logger = a, this._context = new ft$1(e, {
2520
+ sdkState: n,
2521
+ connectionHandlers: r,
2522
+ sessionManager: i,
2523
+ websocketClient: s,
2524
+ dispatcher: o,
2525
+ logger: a
2526
+ }), c || s.on("close", (function () {
2527
+ "foreground" === n.appState && setTimeout((function () {
2528
+ l._logger.debug("try reconnect by websocket connection closed"), l.reconnect();
2529
+ }), 100);
2530
+ }));
2531
+ }
2532
+ return Object.defineProperty(e.prototype, "isConnected", {
2533
+ get: function () {
2534
+ return this._context.currentState.type === exports.J$1.CONNECTED
2535
+ },
2536
+ enumerable: !1,
2537
+ configurable: !0
2538
+ }), Object.defineProperty(e.prototype, "isConnecting", {
2539
+ get: function () {
2540
+ var e = this._context.currentState;
2541
+ return e.type === exports.J$1.CONNECTING || e.type === exports.J$1.RECONNECTING
2542
+ },
2543
+ enumerable: !1,
2544
+ configurable: !0
2545
+ }), e.prototype.connect = function (e) {
2546
+ return r(this, void 0, void 0, (function () {
2547
+ return i(this, (function (t) {
2548
+ // debugger
2549
+ switch (t.label) {
2550
+ case 0:
2551
+ return [4, this._context.currentState.onConnect(this._context, e)];
2552
+ case 1:
2553
+ return t.sent(), [2]
2554
+ }
2555
+ }))
2556
+ }))
2557
+ }, e.prototype.reconnect = function () {
2558
+ return r(this, void 0, void 0, (function () {
2559
+ return i(this, (function (e) {
2560
+ switch (e.label) {
2561
+ case 0:
2562
+ return [4, this._context.currentState.onReconnect(this._context, {})];
2563
+ case 1:
2564
+ return e.sent(), [2]
2565
+ }
2566
+ }))
2567
+ }))
2568
+ }, e.prototype.resetAndReconnect = function () {
2569
+ return r(this, void 0, void 0, (function () {
2570
+ return i(this, (function (e) {
2571
+ switch (e.label) {
2572
+ case 0:
2573
+ return [4, this._context.currentState.onReconnect(this._context, {
2574
+ resetReconnectCount: !0
2575
+ })];
2576
+ case 1:
2577
+ return e.sent(), [2]
2578
+ }
2579
+ }))
2580
+ }))
2581
+ }, e.prototype.background = function () {
2582
+ return r(this, void 0, void 0, (function () {
2583
+ return i(this, (function (e) {
2584
+ switch (e.label) {
2585
+ case 0:
2586
+ return [4, this._context.currentState.onDisconnect(this._context, {
2587
+ autoReconnect: !1
2588
+ })];
2589
+ case 1:
2590
+ return e.sent(), [2]
2591
+ }
2592
+ }))
2593
+ }))
2594
+ }, e.prototype.disconnect = function (e) {
2595
+ return void 0 === e && (e = null), r(this, void 0, void 0, (function () {
2596
+ return i(this, (function (t) {
2597
+ switch (t.label) {
2598
+ case 0:
2599
+ return [4, this._context.currentState.onDisconnect(this._context, {
2600
+ error: e,
2601
+ autoReconnect: !0
2602
+ })];
2603
+ case 1:
2604
+ return t.sent(), [2]
2605
+ }
2606
+ }))
2607
+ }))
2608
+ }, e.prototype.logout = function () {
2609
+ return r(this, void 0, void 0, (function () {
2610
+ return i(this, (function (e) {
2611
+ switch (e.label) {
2612
+ case 0:
2613
+ return [4, this._context.currentState.onLogout(this._context)];
2614
+ case 1:
2615
+ return e.sent(), [2]
2616
+ }
2617
+ }))
2618
+ }))
2619
+ }, e
2620
+ }(),
2621
+ gt$1 = function (e) {
2622
+ function n(t) {
2623
+ var n = t.deviceId,
2624
+ r = t.statLogs,
2625
+ i = e.call(this) || this;
2626
+ return i.method = exports.d.POST, i.path = "".concat(Be$1), i.params = {
2627
+ device_id: n,
2628
+ log_entries: r.map((function (e) {
2629
+ return K.payloadify(e)
2630
+ }))
2631
+ }, i
2632
+ }
2633
+ return t(n, e), n
2634
+ }(q);
2635
+ ! function (e) {
2636
+ e[e.PENDING = 0] = "PENDING", e[e.ENABLED = 1] = "ENABLED", e[e.DISABLED = 2] = "DISABLED";
2637
+ }(ut$1 || (ut$1 = {}));
2638
+ var yt$1, mt$1 = function () {
2639
+ function e(e) {
2640
+ var t = e.cacheContext,
2641
+ n = e.requestQueue,
2642
+ r = e.dispatcher,
2643
+ i = e.baseLimit,
2644
+ s = void 0 === i ? 100 : i,
2645
+ o = e.maxLimit,
2646
+ a = void 0 === o ? 1e3 : o,
2647
+ u = e.minLimit,
2648
+ c = void 0 === u ? 10 : u;
2649
+ this.queue = [], this.enabledstate = ut$1.PENDING, this.isFlushing = !1, this.generation = 1, this.lastFlushedAt = 0, this.deviceId = R(), this.cacheContext = t, this.requestQueue = n, this.dispatcher = r, this.baseLimit = s, this.limit = s, this.maxLimit = a, this.minLimit = c;
2650
+ }
2651
+ return Object.defineProperty(e.prototype, "isEnabled", {
2652
+ get: function () {
2653
+ return this.enabledstate === ut$1.ENABLED
2654
+ },
2655
+ enumerable: !1,
2656
+ configurable: !0
2657
+ }), e.prototype._save = function () {
2658
+ return r(this, void 0, void 0, (function () {
2659
+ return i(this, (function (e) {
2660
+ switch (e.label) {
2661
+ case 0:
2662
+ return this.cacheContext.localCacheEnabled ? [4, this.cacheContext.preference.set(this.key, {
2663
+ deviceId: this.deviceId,
2664
+ statLogs: this.queue.map((function (e) {
2665
+ return K.payloadify(e)
2666
+ })),
2667
+ generation: this.generation++,
2668
+ lastFlushedAt: this.lastFlushedAt
2669
+ })] : [3, 2];
2670
+ case 1:
2671
+ e.sent(), e.label = 2;
2672
+ case 2:
2673
+ return [2]
2674
+ }
2675
+ }))
2676
+ }))
2677
+ }, e.prototype._flush = function () {
2678
+ return r(this, void 0, void 0, (function () {
2679
+ var e, t;
2680
+ return i(this, (function (n) {
2681
+ switch (n.label) {
2682
+ case 0:
2683
+ if (!this.isEnabled) return [3, 7];
2684
+ if (this.isFlushing) return [3, 7];
2685
+ this.isFlushing = !0, n.label = 1;
2686
+ case 1:
2687
+ return n.trys.push([1, 5, 6, 7]), (e = this.queue.slice(0, Math.min(this.limit, this.maxLimit))).length > 0 ? (t = new gt$1({
2688
+ deviceId: this.deviceId,
2689
+ statLogs: e
2690
+ }), [4, this.requestQueue.send(t)]) : [3, 4];
2691
+ case 2:
2692
+ return n.sent(), this.queue = this.queue.slice(e.length), [4, this._save()];
2693
+ case 3:
2694
+ n.sent(), n.label = 4;
2695
+ case 4:
2696
+ return this.limit = this.baseLimit, this.lastFlushedAt = Date.now(), [3, 7];
2697
+ case 5:
2698
+ return n.sent(), this.limit = this.limit + 20, [3, 7];
2699
+ case 6:
2700
+ return this.isFlushing = !1, [7];
2701
+ case 7:
2702
+ return [2]
2703
+ }
2704
+ }))
2705
+ }))
2706
+ }, e.prototype.init = function (e) {
2707
+ return r(this, void 0, void 0, (function () {
2708
+ var t, n, r = this;
2709
+ return i(this, (function (i) {
2710
+ switch (i.label) {
2711
+ case 0:
2712
+ return this.key = e, this.cacheContext.localCacheEnabled ? [4, this.cacheContext.preference.get(this.key)] : [3, 4];
2713
+ case 1:
2714
+ return (t = i.sent()) ? (this.deviceId = t.deviceId, this.queue = t.statLogs.map((function (e) {
2715
+ return new K({
2716
+ type: e.stat_type,
2717
+ ts: e.ts,
2718
+ data: e.data
2719
+ })
2720
+ })), this.generation = t.generation, this.lastFlushedAt = t.lastFlushedAt, Date.now() - this.lastFlushedAt >= 108e5 && this.queue.length >= this.minLimit ? (n = Math.min(Math.floor(18e4 * Math.random()), 100), [4, me$2(n)]) : [3, 4]) : [3, 4];
2721
+ case 2:
2722
+ return i.sent(), [4, this._flush()];
2723
+ case 3:
2724
+ i.sent(), i.label = 4;
2725
+ case 4:
2726
+ return this.dispatcher.on((function (e) {
2727
+ if (e instanceof Q) {
2728
+ var t = e.statLog;
2729
+ r.put(t);
2730
+ } else e instanceof pt$1 && (r.enabledstate = e.enabled ? ut$1.ENABLED : ut$1.DISABLED, r.isEnabled ? r.queue.length >= r.limit && r._flush() : r.clear());
2731
+ })), [2]
2732
+ }
2733
+ }))
2734
+ }))
2735
+ }, e.prototype.put = function (e) {
2736
+ return r(this, void 0, void 0, (function () {
2737
+ return i(this, (function (t) {
2738
+ switch (t.label) {
2739
+ case 0:
2740
+ return this.enabledstate === ut$1.DISABLED ? [3, 3] : (this.queue.push(e), [4, this._save()]);
2741
+ case 1:
2742
+ return t.sent(), this.queue.length >= this.limit ? [4, this._flush()] : [3, 3];
2743
+ case 2:
2744
+ t.sent(), t.label = 3;
2745
+ case 3:
2746
+ return [2]
2747
+ }
2748
+ }))
2749
+ }))
2750
+ }, e.prototype.clear = function () {
2751
+ return r(this, void 0, void 0, (function () {
2752
+ return i(this, (function (e) {
2753
+ switch (e.label) {
2754
+ case 0:
2755
+ return this.queue = [], this.generation = 1, [4, this._save()];
2756
+ case 1:
2757
+ return e.sent(), [2]
2758
+ }
2759
+ }))
2760
+ }))
2761
+ }, e
2762
+ }();
2763
+ ! function (e) {
2764
+ e[e.NONE = 0] = "NONE", e[e.VERBOSE = 1] = "VERBOSE", e[e.DEBUG = 2] = "DEBUG", e[e.INFO = 3] = "INFO", e[e.WARN = 4] = "WARN", e[e.ERROR = 5] = "ERROR";
2765
+ }(yt$1 || (yt$1 = {}));
2766
+ var vt$1, Et$1 = function () {
2767
+ function e() {
2768
+ this.level = yt$1.WARN;
2769
+ }
2770
+ return e.prototype.verbose = function () {
2771
+ for (var e = [], t = 0; t < arguments.length; t++) e[t] = arguments[t];
2772
+ this.level <= yt$1.VERBOSE && console.log.apply(console, a(["[verbose]"], o(e), !1));
2773
+ }, e.prototype.debug = function () {
2774
+ for (var e = [], t = 0; t < arguments.length; t++) e[t] = arguments[t];
2775
+ this.level <= yt$1.DEBUG && console.log.apply(console, a(["[debug]"], o(e), !1));
2776
+ }, e.prototype.info = function () {
2777
+ for (var e = [], t = 0; t < arguments.length; t++) e[t] = arguments[t];
2778
+ this.level <= yt$1.INFO && console.log.apply(console, a(["[info]"], o(e), !1));
2779
+ }, e.prototype.warn = function () {
2780
+ for (var e = [], t = 0; t < arguments.length; t++) e[t] = arguments[t];
2781
+ this.level <= yt$1.WARN && console.warn.apply(console, a(["[warn]"], o(e), !1));
2782
+ }, e.prototype.error = function () {
2783
+ for (var e = [], t = 0; t < arguments.length; t++) e[t] = arguments[t];
2784
+ this.level <= yt$1.ERROR && console.error.apply(console, a(["[error]"], o(e), !1));
2785
+ }, e
2786
+ }(),
2787
+ It$1 = {},
2788
+ St$1 = function () {
2789
+ function e(e, t) {
2790
+ var n, r, i, s, o, a, u;
2791
+ if (this.connectedAt = 0, this.firstConnectedAt = 0, this.connectionHandlers = new Map, this.userEventHandlers = new Map, !It$1[e]) {
2792
+ It$1[e] = this;
2793
+ var c = null !== (n = t.options) && void 0 !== n ? n : new b,
2794
+ d = this.sdkState = {
2795
+ appId: t.appId,
2796
+ appVersion: null !== (r = t.appVersion) && void 0 !== r ? r : "",
2797
+ appState: "foreground",
2798
+ userId: null,
2799
+ extensions: {},
2800
+ api: {
2801
+ host: null !== (i = t.apiHost) && void 0 !== i ? i : "https://api-".concat(t.appId, ".sendbird.com")
2802
+ },
2803
+ websocket: {
2804
+ host: null !== (s = t.websocketHost) && void 0 !== s ? s : "wss://ws-".concat(t.appId, ".sendbird.com"),
2805
+ pingerDisabled: !!t.noPingpong,
2806
+ pingInterval: null,
2807
+ pongTimeout: null,
2808
+ connectMaxRetry: 2,
2809
+ reconnectMaxRetry: -1,
2810
+ reconnectRetryStrategy: new ve$2,
2811
+ responseTimeout: c.websocketResponseTimeout
2812
+ }
2813
+ };
2814
+ this.appInfo = null, this.subscribedUnreadMessageCount = {
2815
+ all: 0,
2816
+ customTypes: {},
2817
+ ts: 0
2818
+ };
2819
+ var h = this.logger = new Et$1;
2820
+ this.logger.level = null !== (o = t.logLevel) && void 0 !== o ? o : yt$1.WARN, this.connectedAt = 0, this.firstConnectedAt = 0, this.connectionHandlers = new Map, this.userEventHandlers = new Map, this.cacheContext = new O({
2821
+ encryption: t.encryption,
2822
+ store: t.store,
2823
+ localCacheEnabled: null !== (a = t.localCacheEnabled) && void 0 !== a && a
2824
+ }), this.debugMode = null !== (u = t.debugMode) && void 0 !== u && u, this.maxSuperGroupChannelUnreadCount = l$1.DEFAULT_MAX_UNREAD_COUNT_OF_SUPER_GROUP_CHANNEL, this.useMemberInfoInMessage = c.useMemberInfoInMessage, this.typingIndicatorInvalidateTime = c.typingIndicatorInvalidateTime, this.typingIndicatorThrottle = c.typingIndicatorThrottle, this.concurrentCallLimit = null, this.backOffDelay = null;
2825
+ var p = this.dispatcher = new k,
2826
+ f = new w;
2827
+ this.requestQueue = new he$2(e, {
2828
+ auth: f,
2829
+ sdkState: d,
2830
+ dispatcher: p,
2831
+ logger: h
2832
+ }), this.sessionManager = new Te$1({
2833
+ auth: f,
2834
+ sdkState: d,
2835
+ dispatcher: p,
2836
+ requestQueue: this.requestQueue,
2837
+ logger: h
2838
+ }), this.connectionManager = new _t$1(e, {
2839
+ sdkState: d,
2840
+ connectionHandlers: this.connectionHandlers,
2841
+ dispatcher: p,
2842
+ sessionManager: this.sessionManager,
2843
+ websocketClient: this.requestQueue.commandRouter.websocketClient,
2844
+ logger: h
2845
+ }), this.statLogCollector = new mt$1({
2846
+ cacheContext: this.cacheContext,
2847
+ requestQueue: this.requestQueue,
2848
+ dispatcher: p
2849
+ });
2850
+ }
2851
+ return It$1[e]
2852
+ }
2853
+ return e.of = function (e) {
2854
+ if (It$1[e]) return It$1[e];
2855
+ throw p.lostInstance
2856
+ }, e
2857
+ }(),
2858
+ Tt$1 = function () {
2859
+ function e() {}
2860
+ return e.prototype.init = function (e, t) {
2861
+ var n = t.sdkState,
2862
+ r = t.dispatcher,
2863
+ i = t.sessionManager,
2864
+ s = t.requestQueue,
2865
+ o = t.logger;
2866
+ t.onlineDetector;
2867
+ var a = t.cacheContext,
2868
+ u = void 0 === a ? null : a;
2869
+ this._iid = e, this._cacheContext = u, this._sdkState = n, this._dispatcher = r, this._sessionManager = i, this._requestQueue = s, this._logger = o;
2870
+ }, e
2871
+ }(),
2872
+ bt$1 = function (e) {
2873
+ function n(t) {
2874
+ var n = e.call(this) || this;
2875
+ if (n.method = exports.d.POST, n.path = "".concat(Pe$1), n.params = U$1({
2876
+ file: t.file,
2877
+ channel_url: t.channelUrl
2878
+ }), t.thumbnailSizes)
2879
+ for (var r = 0; r < t.thumbnailSizes.length; r++) {
2880
+ var i = t.thumbnailSizes[r],
2881
+ s = i.maxWidth,
2882
+ o = i.maxHeight;
2883
+ n.params["thumbnail".concat(r + 1)] = "".concat(s, ",").concat(o);
2884
+ }
2885
+ return n.requestId = t.requestId, n
2886
+ }
2887
+ return t(n, e), n
2888
+ }(q),
2889
+ Nt$1 = function (e) {
2890
+ function n(t, n) {
2891
+ var r, i, s, o = this;
2892
+ return (o = e.call(this, t, n) || this).url = n.url, o.fileSize = null !== (r = n.file_size) && void 0 !== r ? r : 0, o.thumbnailSizes = null !== (i = n.thumbnails) && void 0 !== i ? i : [], o.requireAuth = null !== (s = n.require_auth) && void 0 !== s && s, o
2893
+ }
2894
+ return t(n, e), n
2895
+ }(F),
2896
+ At$1 = function (e) {
2897
+ function r(t, n) {
2898
+ var r, i, s, o = this;
2899
+ return (o = e.call(this, t) || this).replyCount = 0, o.mostRepliedUsers = null, o.lastRepliedAt = 0, o.updatedAt = 0, o.replyCount = null !== (r = n.reply_count) && void 0 !== r ? r : 0, o.mostRepliedUsers = n.hasOwnProperty("most_replies") && E("object", n.most_replies) ? n.most_replies.map((function (e) {
2900
+ return new ct$1(o._iid, e)
2901
+ })) : [], o.lastRepliedAt = null !== (i = n.last_replied_at) && void 0 !== i ? i : 0, o.updatedAt = null !== (s = n.updated_at) && void 0 !== s ? s : 0, o
2902
+ }
2903
+ return t(r, e), r.payloadify = function (t) {
2904
+ return t ? U$1(exports.n(exports.n({}, e.payloadify.call(this, t)), {
2905
+ reply_count: t.replyCount,
2906
+ most_replies: Array.isArray(t.mostRepliedUsers) ? t.mostRepliedUsers.map((function (e) {
2907
+ return ct$1.payloadify(e)
2908
+ })) : [],
2909
+ last_replied_at: t.lastRepliedAt,
2910
+ updated_at: t.updatedAt
2911
+ })) : null
2912
+ }, r
2913
+ }(Le$1);
2914
+ ! function (e) {
2915
+ e.ADD = "add", e.DELETE = "delete";
2916
+ }(vt$1 || (vt$1 = {}));
2917
+ exports.Ct = void 0; exports.Ot = void 0; var wt$1 = function (e) {
2918
+ this.messageId = 0, this.userId = null, this.key = null, this.operation = null, this.updatedAt = 0;
2919
+ var t = y("string", e.msg_id) ? parseInt(e.msg_id) : e.msg_id,
2920
+ n = e.user_id,
2921
+ r = e.operation ? e.operation.toLowerCase() : null,
2922
+ i = e.reaction,
2923
+ s = e.updated_at;
2924
+ t && y("string", n) && y("string", r) && m(vt$1, r) && y("string", i) && i && y("number", s) && (this.messageId = t, this.userId = n, this.key = i, this.operation = r, this.updatedAt = s);
2925
+ },
2926
+ Rt$1 = function () {
2927
+ function e(e) {
2928
+ var t, n, r, i = e.key,
2929
+ u = null !== (r = a([], o(e.user_ids), !1)) && void 0 !== r ? r : [],
2930
+ c = e.updated_at;
2931
+ y("string", i) && i && E("string", u) && u.length > 0 && y("number", c) && (this.key = i, this.userIds = u, this.updatedAt = c);
2932
+ var l = {};
2933
+ try {
2934
+ for (var d = s(this.userIds), h = d.next(); !h.done; h = d.next()) {
2935
+ l[h.value] = this.updatedAt;
2936
+ }
2937
+ } catch (e) {
2938
+ t = {
2939
+ error: e
2940
+ };
2941
+ } finally {
2942
+ try {
2943
+ h && !h.done && (n = d.return) && n.call(d);
2944
+ } finally {
2945
+ if (t) throw t.error
2946
+ }
2947
+ }
2948
+ this._version = l;
2949
+ }
2950
+ return Object.defineProperty(e.prototype, "isEmpty", {
2951
+ get: function () {
2952
+ return 0 === this.userIds.length
2953
+ },
2954
+ enumerable: !1,
2955
+ configurable: !0
2956
+ }), e.payloadify = function (e) {
2957
+ return e ? U$1({
2958
+ key: e.key,
2959
+ user_ids: e.userIds,
2960
+ updated_at: e.updatedAt
2961
+ }) : null
2962
+ }, e.prototype.applyEvent = function (e) {
2963
+ if (e.key === this.key && this.updatedAt <= e.updatedAt) {
2964
+ if (!this._version[e.userId] || this._version[e.userId] <= e.updatedAt) {
2965
+ var t = this.userIds.indexOf(e.userId);
2966
+ switch (e.operation) {
2967
+ case vt$1.ADD:
2968
+ t < 0 && this.userIds.push(e.userId);
2969
+ break;
2970
+ case vt$1.DELETE:
2971
+ t >= 0 && this.userIds.splice(t, 1);
2972
+ }
2973
+ this._version[e.userId] = e.updatedAt;
2974
+ }
2975
+ this.updatedAt = Math.max(this.updatedAt, e.updatedAt);
2976
+ }
2977
+ }, e
2978
+ }(),
2979
+ Dt$1 = function () {
2980
+ function e(e) {
2981
+ this.key = e.key, this.value = E("string", e.value) ? a([], o(e.value), !1) : [];
2982
+ }
2983
+ return e.payloadify = function (e) {
2984
+ var t;
2985
+ return e ? U$1({
2986
+ key: e.key,
2987
+ value: null !== (t = e.value) && void 0 !== t ? t : []
2988
+ }) : null
2989
+ }, e
2990
+ }(),
2991
+ Mt$1 = function () {
2992
+ function e(e) {
2993
+ this.url = null, this.secureUrl = null, this.type = null, this.width = 0, this.height = 0, this.alt = null, this.url = e.url, e.hasOwnProperty("secure_url") && (this.secureUrl = e.secure_url), e.hasOwnProperty("type") && (this.type = e.type), e.hasOwnProperty("width") && (this.width = e.width), e.hasOwnProperty("height") && (this.height = e.height), e.hasOwnProperty("alt") && (this.alt = e.alt);
2994
+ }
2995
+ return e.payloadify = function (e) {
2996
+ var t, n;
2997
+ return e ? U$1({
2998
+ url: e.url,
2999
+ secure_url: e.secureUrl,
3000
+ type: e.type,
3001
+ width: null !== (t = e.width) && void 0 !== t ? t : 0,
3002
+ height: null !== (n = e.height) && void 0 !== n ? n : 0,
3003
+ alt: e.alt
3004
+ }) : null
3005
+ }, e
3006
+ }(),
3007
+ kt$1 = function () {
3008
+ function e(e) {
3009
+ this.title = null, this.url = null, this.description = null, this.defaultImage = null, e.hasOwnProperty("og:title") && (this.title = e["og:title"]), e.hasOwnProperty("og:url") && (this.url = e["og:url"]), e.hasOwnProperty("og:description") && (this.description = e["og:description"]), e.hasOwnProperty("og:image") && (this.defaultImage = new Mt$1(e["og:image"]));
3010
+ }
3011
+ return e.payloadify = function (e) {
3012
+ return e ? U$1({
3013
+ "og:title": e.title,
3014
+ "og:url": e.url,
3015
+ "og:description": e.description,
3016
+ "og:image": e.defaultImage ? Mt$1.payloadify(e.defaultImage) : null
3017
+ }) : null
3018
+ }, e
3019
+ }(),
3020
+ Lt = function () {
3021
+ function e(e) {
3022
+ var t, n;
3023
+ this.name = null, this.volume = 0, this.name = null !== (t = e.name) && void 0 !== t ? t : "default", this.volume = null !== (n = e.volume) && void 0 !== n ? n : 1;
3024
+ }
3025
+ return e.payloadify = function (e) {
3026
+ return e ? U$1({
3027
+ name: e.name,
3028
+ volume: e.volume
3029
+ }) : null
3030
+ }, e
3031
+ }();
3032
+ ! function (e) {
3033
+ e.PENDING = "pending", e.SENT = "sent", e.FAILED = "failed", e.CANCELED = "canceled";
3034
+ }(exports.Ct || (exports.Ct = {})),
3035
+ function (e) {
3036
+ e.PENDING = "pending", e.IN_QUEUE = "in_queue", e.SENT = "sent", e.FAILED = "failed", e.CANCELED = "canceled", e.REMOVED = "removed";
3037
+ }(exports.Ot || (exports.Ot = {}));
3038
+ var Ut$1, Pt$1 = function (e) {
3039
+ switch (e) {
3040
+ case ie$1.BASE:
3041
+ return "";
3042
+ case ie$1.USER:
3043
+ return "MESG";
3044
+ case ie$1.FILE:
3045
+ return "FILE";
3046
+ case ie$1.ADMIN:
3047
+ return "ADMM"
3048
+ }
3049
+ },
3050
+ qt$1 = function (e) {
3051
+ function r(t, n) {
3052
+ var r, i, s, o, a, u, c, l, d, h, p, f, _, g = this;
3053
+ (g = e.call(this, t) || this).channelUrl = null, g.channelType = exports.ne.BASE, g.messageId = 0, g.parentMessageId = null, g.parentMessage = null, g.silent = !1, g.isOperatorMessage = !1, g.messageType = ie$1.BASE, g.data = null, g.customType = null, g.mentionType = null, g.mentionedUsers = [], g.mentionedUserIds = [], g.mentionedMessageTemplate = null, g.threadInfo = null, g.reactions = [], g.metaArrays = [], g.ogMetaData = null, g.appleCriticalAlertOptions = null, g.createdAt = 0, g.updatedAt = 0, g.scheduledInfo = null, g._scheduledStatus = exports.Ot.PENDING, g.messageId = null !== (i = null !== (r = n.msg_id) && void 0 !== r ? r : n.message_id) && void 0 !== i ? i : 0, g.channelUrl = n.channel_url, g.channelType = m(exports.ne, n.channel_type) ? n.channel_type : exports.ne.GROUP, n.channel && (n.channel.channel_url && (g.channelUrl = n.channel.channel_url), n.channel.channel_type && (g.channelType = n.channel.channel_type)), g.parentMessageId = null !== (s = "string" == typeof n.parent_message_id ? parseInt(n.parent_message_id) : n.parent_message_id) && void 0 !== s ? s : 0, g.data = null !== (o = n.data) && void 0 !== o ? o : "", g.customType = null !== (a = n.custom_type) && void 0 !== a ? a : "", g.mentionType = m(exports.ae$1, n.mention_type) ? n.mention_type : null;
3054
+ var y = n.mentioned_users;
3055
+ g.mentionedUsers = y ? y.map((function (e) {
3056
+ return new ct$1(g._iid, e)
3057
+ })) : null;
3058
+ var v = n.mentioned_user_ids;
3059
+ g.mentionedUserIds = null != v ? v : null, g.mentionedMessageTemplate = null !== (u = n.mentioned_message_template) && void 0 !== u ? u : "", g.threadInfo = n.thread_info ? new At$1(g._iid, n.thread_info) : null, g.reactions = n.reactions ? n.reactions.map((function (e) {
3060
+ return new Rt$1(e)
3061
+ })) : [];
3062
+ for (var E = null !== (c = n.metaarray) && void 0 !== c ? c : {}, I = null !== (l = n.metaarray_key_order) && void 0 !== l ? l : Object.keys(E).sort((function (e, t) {
3063
+ return e.localeCompare(t)
3064
+ })), S = 0; S < I.length; S++) {
3065
+ var T = I[S];
3066
+ g.metaArrays.push(new Dt$1({
3067
+ key: T,
3068
+ value: E[T] || []
3069
+ }));
3070
+ }
3071
+ return n.sorted_metaarray && (g.metaArrays = n.sorted_metaarray.map((function (e) {
3072
+ return new Dt$1(e)
3073
+ }))), g.ogMetaData = n.og_tag ? new kt$1(n.og_tag) : null, g.silent = null !== (d = n.silent) && void 0 !== d && d, g.isOperatorMessage = null !== (h = n.is_op_msg) && void 0 !== h && h, g.appleCriticalAlertOptions = n.apple_critical_alert_options ? new Lt(n.apple_critical_alert_options) : null, g.createdAt = null !== (f = null !== (p = n.created_at) && void 0 !== p ? p : n.ts) && void 0 !== f ? f : 0, g.updatedAt = null !== (_ = n.updated_at) && void 0 !== _ ? _ : 0, "number" == typeof n.scheduled_message_id && n.scheduled_at && n.scheduled_status && (g.scheduledInfo = {
3074
+ scheduledMessageId: n.scheduled_message_id,
3075
+ scheduledAt: n.scheduled_at
3076
+ }, g._scheduledStatus = n.scheduled_status), g
3077
+ }
3078
+ return t(r, e), r.payloadify = function (t) {
3079
+ var r, i, s, o;
3080
+ return t ? U$1(exports.n(exports.n({}, e.payloadify.call(this, t)), {
3081
+ channel_url: t.channelUrl,
3082
+ channel_type: t.channelType,
3083
+ message_id: t.messageId,
3084
+ type: Pt$1(t.messageType),
3085
+ parent_message_id: t.parentMessageId,
3086
+ data: t.data,
3087
+ custom_type: t.customType,
3088
+ mention_type: t.mentionType,
3089
+ mentioned_user_ids: t.mentionedUserIds,
3090
+ mentioned_users: null === (r = t.mentionedUsers) || void 0 === r ? void 0 : r.map((function (e) {
3091
+ return ct$1.payloadify(e)
3092
+ })),
3093
+ mentioned_message_template: t.mentionedMessageTemplate,
3094
+ thread_info: t.threadInfo ? At$1.payloadify(t.threadInfo) : null,
3095
+ reactions: t.reactions.map((function (e) {
3096
+ return Rt$1.payloadify(e)
3097
+ })),
3098
+ sorted_metaarray: null === (i = t.metaArrays) || void 0 === i ? void 0 : i.map((function (e) {
3099
+ return Dt$1.payloadify(e)
3100
+ })),
3101
+ og_tag: kt$1.payloadify(t.ogMetaData),
3102
+ silent: t.silent,
3103
+ is_op_msg: t.isOperatorMessage,
3104
+ apple_critical_alert_options: Lt.payloadify(t.appleCriticalAlertOptions),
3105
+ created_at: t.createdAt,
3106
+ updated_at: t.updatedAt,
3107
+ scheduled_message_id: null === (s = t.scheduledInfo) || void 0 === s ? void 0 : s.scheduledMessageId,
3108
+ scheduled_at: null === (o = t.scheduledInfo) || void 0 === o ? void 0 : o.scheduledAt,
3109
+ scheduled_status: t._scheduledStatus
3110
+ })) : null
3111
+ }, r.prototype.isIdentical = function (e) {
3112
+ return this.messageId === e.messageId
3113
+ }, r.prototype.isEqual = function (e) {
3114
+ return g(this, e)
3115
+ }, r.prototype.isUserMessage = function () {
3116
+ return this.messageType === ie$1.USER
3117
+ }, r.prototype.isFileMessage = function () {
3118
+ return this.messageType === ie$1.FILE
3119
+ }, r.prototype.isAdminMessage = function () {
3120
+ return this.messageType === ie$1.ADMIN
3121
+ }, r.prototype.serialize = function () {
3122
+ return st$1(this)
3123
+ }, r.prototype.getMetaArraysByKeys = function (e) {
3124
+ return this.metaArrays.filter((function (t) {
3125
+ return e.includes(t.key)
3126
+ }))
3127
+ }, r.prototype.applyThreadInfoUpdateEvent = function (e) {
3128
+ return this.parentMessageId === e.targetMessageId && (this.threadInfo = e.threadInfo), !1
3129
+ }, r.prototype.applyReactionEvent = function (e) {
3130
+ if (this.messageId === e.messageId) {
3131
+ for (var t = !1, n = 0; n < this.reactions.length; n++)
3132
+ if (this.reactions[n].key === e.key) {
3133
+ this.reactions[n].applyEvent(e), this.reactions[n].isEmpty && this.reactions.splice(n, 1), t = !0;
3134
+ break
3135
+ } t || "add" !== e.operation || this.reactions.push(new Rt$1(Rt$1.payloadify({
3136
+ key: e.key,
3137
+ userIds: [e.userId],
3138
+ updatedAt: e.updatedAt
3139
+ })));
3140
+ }
3141
+ }, r.prototype.applyParentMessage = function (e) {
3142
+ if (this.parentMessageId === e.messageId) {
3143
+ var t = this.parentMessage.updatedAt;
3144
+ if (e.updatedAt >= t) return this.parentMessage = e, !0
3145
+ }
3146
+ return !1
3147
+ }, r
3148
+ }(Le$1),
3149
+ Ft = function (e) {
3150
+ function r(t, n) {
3151
+ var r = e.call(this, t, n) || this;
3152
+ return r.role = null, r.isBlockedByMe = !1, r.role = m(exports.re$1, n.role) ? n.role : exports.re$1.NONE, n.hasOwnProperty("is_blocked_by_me") && (r.isBlockedByMe = n.is_blocked_by_me), r
3153
+ }
3154
+ return t(r, e), r.payloadify = function (t) {
3155
+ return t ? U$1(exports.n(exports.n({}, e.payloadify.call(this, t)), {
3156
+ role: t.role,
3157
+ is_blocked_by_me: t.isBlockedByMe
3158
+ })) : null
3159
+ }, r
3160
+ }(ct$1),
3161
+ xt = function (e) {
3162
+ function r(t, n) {
3163
+ var r, i, s, o, a = this;
3164
+ if ((a = e.call(this, t, n) || this).sender = null, a.reqId = "", a.replyToChannel = !1, a.sendingStatus = exports.le.PENDING, a.errorCode = 0, a.sender = n.user ? new Ft(a._iid, n.user) : n.sender_id, a.reqId = null !== (i = null !== (r = n.req_id) && void 0 !== r ? r : n.request_id) && void 0 !== i ? i : "", a.replyToChannel = null !== (s = n.is_reply_to_channel) && void 0 !== s && s, a.sendingStatus = a.messageId > 0 ? exports.le.SUCCEEDED : exports.le.FAILED, n.request_state && m(exports.le, n.request_state) && (a.sendingStatus = n.request_state), n.scheduled_status) switch (n.scheduled_status) {
3165
+ case exports.Ot.SENT:
3166
+ case exports.Ot.IN_QUEUE:
3167
+ a.sendingStatus = exports.le.SUCCEEDED;
3168
+ break;
3169
+ case exports.Ot.PENDING:
3170
+ a.sendingStatus = exports.le.SCHEDULED;
3171
+ break;
3172
+ case exports.Ot.FAILED:
3173
+ case exports.Ot.REMOVED:
3174
+ a.sendingStatus = exports.le.FAILED;
3175
+ break;
3176
+ case exports.Ot.CANCELED:
3177
+ a.sendingStatus = exports.le.CANCELED;
3178
+ }
3179
+ return a.errorCode = null !== (o = n.error_code) && void 0 !== o ? o : 0, a
3180
+ }
3181
+ return t(r, e), r.payloadify = function (t) {
3182
+ return t ? U$1(exports.n(exports.n({}, e.payloadify.call(this, t)), {
3183
+ user: Ft.payloadify(t.sender),
3184
+ req_id: t.reqId,
3185
+ is_reply_to_channel: t.replyToChannel,
3186
+ request_state: t.sendingStatus,
3187
+ error_code: t.errorCode
3188
+ })) : null
3189
+ }, Object.defineProperty(r.prototype, "isResendable", {
3190
+ get: function () {
3191
+ return this.sendingStatus === exports.le.FAILED && ((e = this.errorCode) > 0 && f.indexOf(e) >= 0);
3192
+ var e;
3193
+ },
3194
+ enumerable: !1,
3195
+ configurable: !0
3196
+ }), r.prototype.isIdentical = function (e) {
3197
+ return this.messageId > 0 && e.messageId > 0 ? this.messageId === e.messageId : this.reqId === e.reqId
3198
+ }, r
3199
+ }(qt$1),
3200
+ Gt = function () {
3201
+ function e(e) {
3202
+ var t, n;
3203
+ this.url = null, this.width = 0, this.height = 0, this.realWidth = 0, this.realHeight = 0, this.url = e.url, this.width = e.width, this.height = e.height, this.realWidth = null !== (t = e.real_width) && void 0 !== t ? t : e.width, this.realHeight = null !== (n = e.real_height) && void 0 !== n ? n : e.height;
3204
+ }
3205
+ return e.payloadify = function (e) {
3206
+ return e ? U$1({
3207
+ url: "",
3208
+ width: e.maxWidth,
3209
+ height: e.maxHeight,
3210
+ real_width: 0,
3211
+ real_height: 0
3212
+ }) : null
3213
+ }, Object.defineProperty(e.prototype, "plainUrl", {
3214
+ get: function () {
3215
+ return this.url.split("?auth=")[0]
3216
+ },
3217
+ enumerable: !1,
3218
+ configurable: !0
3219
+ }), e
3220
+ }(),
3221
+ Qt = {
3222
+ prevResultSize: 0,
3223
+ nextResultSize: 0,
3224
+ isInclusive: !1,
3225
+ reverse: !1,
3226
+ messageTypeFilter: exports.se$1.ALL,
3227
+ customTypesFilter: null,
3228
+ senderUserIdsFilter: null,
3229
+ includeReactions: !1,
3230
+ includeMetaArray: !1,
3231
+ includeParentMessageInfo: !1
3232
+ },
3233
+ jt = function (e) {
3234
+ return y("number", e.prevResultSize) && y("number", e.nextResultSize) && y("boolean", e.isInclusive) && y("boolean", e.reverse) && y("string", e.messageTypeFilter) && m(exports.se$1, e.messageTypeFilter) && E("string", e.customTypesFilter, !0) && E("string", e.senderUserIdsFilter, !0) && y("boolean", e.includeMetaArray) && y("boolean", e.includeReactions) && y("boolean", e.includeParentMessageInfo)
3235
+ },
3236
+ Kt = function (e) {
3237
+ function s(t, r) {
3238
+ var i, s, o, a, u = this;
3239
+ if ((u = e.call(this, t, r) || this).message = null, u.translations = {}, u.message = null !== (i = r.message) && void 0 !== i ? i : "", u.messageType = ie$1.ADMIN, u.translations = null !== (s = r.translations) && void 0 !== s ? s : {}, r.parent_message_info) {
3240
+ var c = r.parent_message_info,
3241
+ l = exports.n(exports.n({}, c), {
3242
+ message_id: u.parentMessageId,
3243
+ channel_url: u.channelUrl,
3244
+ channel_type: u.channelType,
3245
+ file: c.file,
3246
+ url: null === (o = c.file) || void 0 === o ? void 0 : o.url,
3247
+ require_auth: null === (a = c.file) || void 0 === a ? void 0 : a.require_auth
3248
+ });
3249
+ u.parentMessage = Ht(t, l);
3250
+ }
3251
+ return u
3252
+ }
3253
+ return t(s, e), s.payloadify = function (t) {
3254
+ return t ? U$1(exports.n(exports.n({}, e.payloadify.call(this, t)), {
3255
+ message: t.message,
3256
+ translations: t.translations,
3257
+ parent_message_info: Bt(t.parentMessage)
3258
+ })) : null
3259
+ }, s.prototype.getThreadedMessagesByTimestamp = function (e, t) {
3260
+ return r(this, void 0, void 0, (function () {
3261
+ return i(this, (function (r) {
3262
+ switch (r.label) {
3263
+ case 0:
3264
+ return t = exports.n(exports.n({}, Qt), t), at$1(this.messageId > 0 && y("number", e) && jt(t)).throw(p.invalidParameters), [4, En.of(this._iid).getThreadedMessagesByTimestamp(this, e, t)];
3265
+ case 1:
3266
+ return [2, r.sent()]
3267
+ }
3268
+ }))
3269
+ }))
3270
+ }, s
3271
+ }(qt$1),
3272
+ zt = function () {
3273
+ function e(e) {
3274
+ var t, n;
3275
+ this.type = null, this.vendor = null, this.detail = {}, this.type = null !== (t = e.type) && void 0 !== t ? t : "", this.vendor = null !== (n = e.vendor) && void 0 !== n ? n : "", e.hasOwnProperty("detail") && y("object", e.detail) && !Array.isArray(e.detail) && (this.detail = e.detail);
3276
+ }
3277
+ return e.payloadify = function (e) {
3278
+ return e ? U$1({
3279
+ type: e.type,
3280
+ vendor: e.vendor,
3281
+ detail: e.detail
3282
+ }) : null
3283
+ }, e
3284
+ }(),
3285
+ Vt = function (e) {
3286
+ function o(t, r) {
3287
+ var i, o, a, u, c, l, d, h = this;
3288
+ if ((h = e.call(this, t, r) || this).message = "", h.messageParams = null, h.translations = {}, h.translationTargetLanguages = [], h.messageSurvivalSeconds = -1, h.plugins = [], h.message = r.message, h.messageType = ie$1.USER, h.translations = null !== (a = r.translations) && void 0 !== a ? a : {}, h.translationTargetLanguages = null !== (u = r.target_langs) && void 0 !== u ? u : [], h.translations === {} && h.translationTargetLanguages.length > 0) try {
3289
+ for (var p = s(h.translationTargetLanguages), f = p.next(); !f.done; f = p.next()) {
3290
+ var _ = f.value;
3291
+ h.translations[_] = "";
3292
+ }
3293
+ } catch (e) {
3294
+ i = {
3295
+ error: e
3296
+ };
3297
+ } finally {
3298
+ try {
3299
+ f && !f.done && (o = p.return) && o.call(p);
3300
+ } finally {
3301
+ if (i) throw i.error
3302
+ }
3303
+ }
3304
+ if (h.messageSurvivalSeconds = null !== (c = r.message_survival_seconds) && void 0 !== c ? c : -1, h.plugins = r.plugins ? r.plugins.map((function (e) {
3305
+ return new zt(e)
3306
+ })) : [], r.parent_message_info) {
3307
+ var g = r.parent_message_info,
3308
+ y = exports.n(exports.n({}, g), {
3309
+ created_at: g.ts,
3310
+ message_id: h.parentMessageId,
3311
+ channel_url: h.channelUrl,
3312
+ channel_type: h.channelType,
3313
+ file: g.file,
3314
+ url: null === (l = g.file) || void 0 === l ? void 0 : l.url,
3315
+ require_auth: null === (d = g.file) || void 0 === d ? void 0 : d.require_auth
3316
+ });
3317
+ h.parentMessage = Ht(t, U$1(y));
3318
+ }
3319
+ return h
3320
+ }
3321
+ return t(o, e), o.payloadify = function (t) {
3322
+ return t ? U$1(exports.n(exports.n({}, e.payloadify.call(this, t)), {
3323
+ message: t.message,
3324
+ translations: t.translations,
3325
+ message_survival_seconds: t.messageSurvivalSeconds,
3326
+ plugins: t.plugins.map((function (e) {
3327
+ return zt.payloadify(e)
3328
+ })),
3329
+ parent_message_info: Bt(t.parentMessage)
3330
+ })) : null
3331
+ }, o.prototype.getThreadedMessagesByTimestamp = function (e, t) {
3332
+ return r(this, void 0, void 0, (function () {
3333
+ return i(this, (function (r) {
3334
+ switch (r.label) {
3335
+ case 0:
3336
+ return t = exports.n(exports.n({}, Qt), t), at$1(this.messageId > 0 && y("number", e) && jt(t)).throw(p.invalidParameters), [4, En.of(this._iid).getThreadedMessagesByTimestamp(this, e, t)];
3337
+ case 1:
3338
+ return [2, r.sent()]
3339
+ }
3340
+ }))
3341
+ }))
3342
+ }, o
3343
+ }(xt),
3344
+ Bt = function (e) {
3345
+ if (e) switch (e.messageType) {
3346
+ case ie$1.USER:
3347
+ return Vt.payloadify(e);
3348
+ case ie$1.FILE:
3349
+ return Wt.payloadify(e);
3350
+ case ie$1.ADMIN:
3351
+ return Kt.payloadify(e)
3352
+ }
3353
+ return null
3354
+ },
3355
+ Ht = function (e, t) {
3356
+ switch (t.type) {
3357
+ case "MESG":
3358
+ return new Vt(e, t);
3359
+ case "FILE":
3360
+ return new Wt(e, t);
3361
+ case "ADMM":
3362
+ case "BRDM":
3363
+ return new Kt(e, t)
3364
+ }
3365
+ return null
3366
+ },
3367
+ Wt = function (e) {
3368
+ function s(t, r) {
3369
+ var i, s, o, a, u, c, l, d, h, p, f, _, g, y, m, v = this;
3370
+ (v = e.call(this, t, r) || this).messageParams = null, v.plainUrl = "", v.requireAuth = !1, v.name = null, v.size = 0, v.type = null, v.thumbnails = [], v.messageSurvivalSeconds = -1, v.messageType = ie$1.FILE;
3371
+ var E = null !== (i = r.file) && void 0 !== i ? i : null;
3372
+ if (v.plainUrl = (null !== (o = null !== (s = null == E ? void 0 : E.url) && void 0 !== s ? s : r.url) && void 0 !== o ? o : "").split("?auth=")[0], v.name = null !== (u = null !== (a = null == E ? void 0 : E.name) && void 0 !== a ? a : r.name) && void 0 !== u ? u : "File", v.size = null !== (l = null !== (c = null == E ? void 0 : E.size) && void 0 !== c ? c : r.size) && void 0 !== l ? l : 0, v.data = null !== (h = null !== (d = null == E ? void 0 : E.data) && void 0 !== d ? d : r.custom) && void 0 !== h ? h : "", v.type = E ? null !== (p = E.type) && void 0 !== p ? p : "" : null !== (f = r.type) && void 0 !== f ? f : "", v.requireAuth = null !== (_ = r.require_auth) && void 0 !== _ && _, v.thumbnails = r.thumbnails ? r.thumbnails.map((function (e) {
3373
+ return new Gt(exports.n(exports.n({}, e), {
3374
+ url: "".concat(e.url.split("?auth=")[0]).concat(v.requireAuth ? "?auth=".concat(Me$1(v._iid)) : "")
3375
+ }))
3376
+ })) : [], v.messageSurvivalSeconds = null !== (g = r.message_survival_seconds) && void 0 !== g ? g : -1, r.parent_message_info) {
3377
+ var I = r.parent_message_info,
3378
+ S = exports.n(exports.n({}, I), {
3379
+ message_id: v.parentMessageId,
3380
+ channel_url: v.channelUrl,
3381
+ channel_type: v.channelType,
3382
+ file: I.file,
3383
+ url: null === (y = I.file) || void 0 === y ? void 0 : y.url,
3384
+ require_auth: null === (m = I.file) || void 0 === m ? void 0 : m.require_auth
3385
+ });
3386
+ v.parentMessage = Ht(t, S);
3387
+ }
3388
+ return v
3389
+ }
3390
+ return t(s, e), s.payloadify = function (t) {
3391
+ return t ? U$1(exports.n(exports.n({}, e.payloadify.call(this, t)), {
3392
+ url: t.plainUrl,
3393
+ require_auth: t.requireAuth,
3394
+ file: {
3395
+ name: t.name,
3396
+ size: t.size,
3397
+ type: t.type,
3398
+ data: t.data
3399
+ },
3400
+ thumbnails: t.thumbnails.map((function (e) {
3401
+ return {
3402
+ url: e.url,
3403
+ width: e.width,
3404
+ height: e.height,
3405
+ real_width: e.realWidth,
3406
+ real_height: e.realHeight
3407
+ }
3408
+ })),
3409
+ message_survival_seconds: t.messageSurvivalSeconds,
3410
+ parent_message_info: Bt(t.parentMessage)
3411
+ })) : null
3412
+ }, Object.defineProperty(s.prototype, "url", {
3413
+ get: function () {
3414
+ return this.requireAuth ? "".concat(this.plainUrl, "?auth=").concat(Me$1(this._iid)) : this.plainUrl
3415
+ },
3416
+ enumerable: !1,
3417
+ configurable: !0
3418
+ }), s.prototype.getThreadedMessagesByTimestamp = function (e, t) {
3419
+ return r(this, void 0, void 0, (function () {
3420
+ return i(this, (function (r) {
3421
+ switch (r.label) {
3422
+ case 0:
3423
+ return t = exports.n(exports.n({}, Qt), t), at$1(this.messageId > 0 && y("number", e) && jt(t)).throw(p.invalidParameters), [4, En.of(this._iid).getThreadedMessagesByTimestamp(this, e, t)];
3424
+ case 1:
3425
+ return [2, r.sent()]
3426
+ }
3427
+ }))
3428
+ }))
3429
+ }, s
3430
+ }(xt),
3431
+ Xt = function (e) {
3432
+ function n(t) {
3433
+ var n, r, i, s = [];
3434
+ return t.mentionType === exports.ae$1.USERS && (t.mentionedUserIds ? s = t.mentionedUserIds : t.mentionedUsers && (s = t.mentionedUsers.map((function (e) {
3435
+ return e.userId
3436
+ })))), e.call(this, {
3437
+ code: "FILE",
3438
+ ackRequired: !0,
3439
+ payload: U$1({
3440
+ channel_url: t.channelUrl,
3441
+ url: t.url,
3442
+ name: null !== (n = t.fileName) && void 0 !== n ? n : "",
3443
+ type: null !== (r = t.mimeType) && void 0 !== r ? r : "",
3444
+ size: null !== (i = t.fileSize) && void 0 !== i ? i : 0,
3445
+ custom: t.data,
3446
+ custom_type: t.customType,
3447
+ thumbnails: t.thumbnailSizes,
3448
+ require_auth: t.requireAuth,
3449
+ metaarray: t.metaArrays,
3450
+ mention_type: t.mentionType,
3451
+ mentioned_user_ids: s,
3452
+ push_option: t.pushNotificationDeliveryOption && t.pushNotificationDeliveryOption !== ce$2.DEFAULT ? t.pushNotificationDeliveryOption : void 0,
3453
+ apple_critical_alert_options: t.appleCriticalAlertOptions,
3454
+ silent: t.silent,
3455
+ reply_to_channel: t.isReplyToChannel,
3456
+ parent_message_id: t.parentMessageId > 0 ? t.parentMessageId : null,
3457
+ req_id: t.reqId
3458
+ })
3459
+ }) || this
3460
+ }
3461
+ return t(n, e), n
3462
+ }(H$1),
3463
+ Yt = function (e) {
3464
+ function n(t) {
3465
+ var n, r = this;
3466
+ r = e.call(this) || this;
3467
+ var i = [];
3468
+ return t.mentionType === exports.ae$1.USERS && (t.mentionedUserIds ? i = t.mentionedUserIds : t.mentionedUsers && (i = t.mentionedUsers.map((function (e) {
3469
+ return e.userId
3470
+ })))), r.method = exports.d.POST, r.path = "".concat(We$1(t.channelType), "/").concat(encodeURIComponent(t.channelUrl), "/messages"), r.params = U$1({
3471
+ message_type: ie$1.FILE,
3472
+ user_id: t.userId,
3473
+ url: t.fileUrl,
3474
+ mention_type: t.mentionType,
3475
+ mentioned_user_ids: i,
3476
+ file_name: t.fileName,
3477
+ file_size: t.fileSize,
3478
+ file_type: t.mimeType,
3479
+ data: t.data,
3480
+ custom_type: t.customType,
3481
+ thumbnails: t.thumbnailSizes.map((function (e) {
3482
+ return Gt.payloadify(e)
3483
+ })),
3484
+ require_auth: t.requireAuth,
3485
+ sorted_metaarray: null === (n = t.metaArrays) || void 0 === n ? void 0 : n.map((function (e) {
3486
+ return Dt$1.payloadify(e)
3487
+ })),
3488
+ push_option: t.pushNotificationDeliveryOption,
3489
+ parent_message_id: t.parentMessageId > 0 ? t.parentMessageId : null,
3490
+ apple_critical_alert_options: Lt.payloadify(t.appleCriticalAlertOptions),
3491
+ reply_to_channel: t.isReplyToChannel,
3492
+ req_id: t.reqId
3493
+ }), r
3494
+ }
3495
+ return t(n, e), n
3496
+ }(q),
3497
+ Jt = function (e) {
3498
+ function n(t, n, r) {
3499
+ var i, s, o, a = this;
3500
+ (a = e.call(this, t, "FILE", r) || this).message = new Wt(t, r);
3501
+ var u = St$1.of(t).sdkState;
3502
+ return a.isMentioned = Ye$1(a.message.mentionType, null !== (i = a.message.mentionedUserIds) && void 0 !== i ? i : null === (s = a.message.mentionedUsers) || void 0 === s ? void 0 : s.map((function (e) {
3503
+ return e.userId
3504
+ })), u.userId), a.forceUpdateLastMessage = null !== (o = r.force_update_last_message) && void 0 !== o && o, a
3505
+ }
3506
+ return t(n, e), n
3507
+ }(B),
3508
+ Zt = function (e) {
3509
+ function n(t, n) {
3510
+ var r, i, s = this;
3511
+ (s = e.call(this, t, n) || this).message = new Wt(t, n);
3512
+ var o = St$1.of(t).sdkState;
3513
+ return s.isMentioned = Ye$1(s.message.mentionType, null !== (r = s.message.mentionedUserIds) && void 0 !== r ? r : s.message.mentionedUsers.map((function (e) {
3514
+ return e.userId
3515
+ })), o.userId), s.forceUpdateLastMessage = null !== (i = n.force_update_last_message) && void 0 !== i && i, s
3516
+ }
3517
+ return t(n, e), n
3518
+ }(F);
3519
+ ! function (e) {
3520
+ e[e.PENDING = 0] = "PENDING", e[e.UPLOADING = 1] = "UPLOADING", e[e.UPLOADED = 2] = "UPLOADED", e[e.SENDING = 3] = "SENDING", e[e.FAILED = 4] = "FAILED";
3521
+ }(Ut$1 || (Ut$1 = {}));
3522
+ exports.$t = void 0; var en = function () {
3523
+ function e(e, t) {
3524
+ var n = t.sdkState,
3525
+ r = t.dispatcher,
3526
+ i = t.requestQueue,
3527
+ s = t.onlineDetector,
3528
+ o = t.cacheContext,
3529
+ a = this;
3530
+ this._queueMap = new Map, this._connectionState = null, this._onlineDetector = null, this._iid = e, this._sdkState = n, this._requestQueue = i, this._cacheContext = o, this._dispatcher = r, this._dispatcher.on((function (e) {
3531
+ e instanceof de$2 && (a._connectionState = e.stateType);
3532
+ })), this._onlineDetector = s;
3533
+ }
3534
+ return Object.defineProperty(e.prototype, "_shouldSendThroughWebSocket", {
3535
+ get: function () {
3536
+ return this._connectionState === exports.J$1.CONNECTED || this._connectionState === exports.J$1.CONNECTING || this._connectionState === exports.J$1.RECONNECTING
3537
+ },
3538
+ enumerable: !1,
3539
+ configurable: !0
3540
+ }), e.prototype._sendFileMessage = function (e, t) {
3541
+ return r(this, void 0, void 0, (function () {
3542
+ var r, s;
3543
+ return i(this, (function (i) {
3544
+ switch (i.label) {
3545
+ case 0:
3546
+ return this._shouldSendThroughWebSocket ? (r = new Xt(exports.n(exports.n({
3547
+ channelUrl: e.url,
3548
+ channelType: e.channelType,
3549
+ url: t.params.fileUrl,
3550
+ requireAuth: t.requireAuth
3551
+ }, t.params), {
3552
+ reqId: t.requestId
3553
+ })), [4, this._requestQueue.send(r)]) : [3, 2];
3554
+ case 1:
3555
+ return s = i.sent(), [2, s.as(Jt).message];
3556
+ case 2:
3557
+ return r = new Yt(exports.n(exports.n({
3558
+ channelUrl: e.url,
3559
+ channelType: e.channelType,
3560
+ url: t.params.fileUrl,
3561
+ userId: this._sdkState.userId,
3562
+ requireAuth: t.requireAuth
3563
+ }, t.params), {
3564
+ reqId: t.requestId
3565
+ })), [4, this._requestQueue.send(r)];
3566
+ case 3:
3567
+ return s = i.sent(), [2, s.as(Zt).message]
3568
+ }
3569
+ }))
3570
+ }))
3571
+ }, e.prototype._resolveMessageQueue = function (e) {
3572
+ return r(this, void 0, void 0, (function () {
3573
+ var t, n, r, o, a, c, l, d, h, f, _, g;
3574
+ return i(this, (function (i) {
3575
+ switch (i.label) {
3576
+ case 0:
3577
+ if (!(t = this._queueMap.get(e.url))) return [3, 21];
3578
+ if (t.isResolving) return [3, 20];
3579
+ t.isResolving = !0, n = [], r = !0, i.label = 1;
3580
+ case 1:
3581
+ i.trys.push([1, 15, 16, 17]), o = s(t.messageQueue), a = o.next(), i.label = 2;
3582
+ case 2:
3583
+ if (a.done) return [3, 14];
3584
+ switch (c = a.value, c.state) {
3585
+ case Ut$1.PENDING:
3586
+ case Ut$1.UPLOADING:
3587
+ return [3, 3];
3588
+ case Ut$1.UPLOADED:
3589
+ return [3, 4];
3590
+ case Ut$1.FAILED:
3591
+ return [3, 12]
3592
+ }
3593
+ return [3, 13];
3594
+ case 3:
3595
+ return r = !1, n.push(c), [3, 13];
3596
+ case 4:
3597
+ if (!r) return [3, 10];
3598
+ i.label = 5;
3599
+ case 5:
3600
+ return i.trys.push([5, 8, , 9]), c.state = Ut$1.SENDING, [4, this._sendFileMessage(e, c)];
3601
+ case 6:
3602
+ return l = i.sent(), c.deferred.resolve(l), [4, me$2(100)];
3603
+ case 7:
3604
+ return i.sent(), [3, 9];
3605
+ case 8:
3606
+ return d = i.sent(), c.deferred.reject(d), [3, 9];
3607
+ case 9:
3608
+ return [3, 11];
3609
+ case 10:
3610
+ n.push(c), i.label = 11;
3611
+ case 11:
3612
+ return [3, 13];
3613
+ case 12:
3614
+ return c.deferred.reject(c.error.code === u.REQUEST_CANCELED ? p.fileUploadCanceled : c.error), [3, 13];
3615
+ case 13:
3616
+ return a = o.next(), [3, 2];
3617
+ case 14:
3618
+ return [3, 17];
3619
+ case 15:
3620
+ return h = i.sent(), _ = {
3621
+ error: h
3622
+ }, [3, 17];
3623
+ case 16:
3624
+ try {
3625
+ a && !a.done && (g = o.return) && g.call(o);
3626
+ } finally {
3627
+ if (_) throw _.error
3628
+ }
3629
+ return [7];
3630
+ case 17:
3631
+ return f = t.isResolveRequestPending, t.messageQueue = n, t.isResolving = !1, t.isResolveRequestPending = !1, f ? [4, this._resolveMessageQueue(e)] : [3, 19];
3632
+ case 18:
3633
+ i.sent(), i.label = 19;
3634
+ case 19:
3635
+ return [3, 21];
3636
+ case 20:
3637
+ t.isResolveRequestPending = !0, i.label = 21;
3638
+ case 21:
3639
+ return [2]
3640
+ }
3641
+ }))
3642
+ }))
3643
+ }, e.prototype._uploadNextPendingItem = function (e) {
3644
+ return r(this, void 0, void 0, (function () {
3645
+ var t, n, r, s, o, a, u, c, l, d, h, f, _, g;
3646
+ return i(this, (function (i) {
3647
+ switch (i.label) {
3648
+ case 0:
3649
+ return t = this._queueMap.get(e.url), (n = t.messageQueue.find((function (e) {
3650
+ return e.state === Ut$1.PENDING
3651
+ }))) ? S(n.params.file) ? t.uploadQueue.length < 6 ? (n.state = Ut$1.UPLOADING, t.uploadQueue.push(n), [4, this._onlineDetector.isOnline()]) : [3, 10] : [3, 11] : [3, 13];
3652
+ case 1:
3653
+ if (!i.sent()) return [3, 8];
3654
+ i.label = 2;
3655
+ case 2:
3656
+ return i.trys.push([2, 4, 5, 7]), r = new bt$1({
3657
+ file: n.params.file,
3658
+ channelUrl: e.url,
3659
+ thumbnailSizes: n.params.thumbnailSizes,
3660
+ requestId: n.requestId
3661
+ }), [4, this._requestQueue.send(r)];
3662
+ case 3:
3663
+ return s = i.sent(), o = s.as(Nt$1), a = o.url, u = o.fileSize, c = void 0 === u ? n.params.fileSize : u, l = o.thumbnailSizes, d = void 0 === l ? n.params.thumbnailSizes : l, h = o.requireAuth, f = void 0 !== h && h, n.params.fileUrl = a, n.params.fileSize = c, n.params.thumbnailSizes = d, n.params.requireAuth = f, n.requireAuth = f, n.state = Ut$1.UPLOADED, [3, 7];
3664
+ case 4:
3665
+ return _ = i.sent(), n.state = Ut$1.FAILED, n.error = _, [3, 7];
3666
+ case 5:
3667
+ return (g = t.uploadQueue.findIndex((function (e) {
3668
+ return e.requestId === n.requestId
3669
+ }))) >= 0 && (t.uploadQueue.splice(g, 1), this._uploadNextPendingItem(e)), [4, this._resolveMessageQueue(e)];
3670
+ case 6:
3671
+ return i.sent(), [7];
3672
+ case 7:
3673
+ return [3, 10];
3674
+ case 8:
3675
+ return n.state = Ut$1.FAILED, n.error = p.connectionRequired, (g = t.uploadQueue.findIndex((function (e) {
3676
+ return e.requestId === n.requestId
3677
+ }))) >= 0 && (t.uploadQueue.splice(g, 1), this._uploadNextPendingItem(e)), [4, this._resolveMessageQueue(e)];
3678
+ case 9:
3679
+ i.sent(), i.label = 10;
3680
+ case 10:
3681
+ return [3, 13];
3682
+ case 11:
3683
+ return n.params.thumbnailSizes = [], n.state = Ut$1.UPLOADED, [4, this._resolveMessageQueue(e)];
3684
+ case 12:
3685
+ i.sent(), i.label = 13;
3686
+ case 13:
3687
+ return [2]
3688
+ }
3689
+ }))
3690
+ }))
3691
+ }, e.prototype.request = function (e, t, n) {
3692
+ var s, o, a;
3693
+ return r(this, void 0, void 0, (function () {
3694
+ var r;
3695
+ return i(this, (function (i) {
3696
+ return r = new ee$1, S(n.file) && (n.fileName = null !== (s = n.fileName) && void 0 !== s ? s : n.file.name, n.mimeType = null !== (o = n.mimeType) && void 0 !== o ? o : n.file.type, n.fileSize = null !== (a = n.fileSize) && void 0 !== a ? a : n.file.size), this._queueMap.has(e.url) || this._queueMap.set(e.url, {
3697
+ messageQueue: [],
3698
+ uploadQueue: [],
3699
+ isResolving: !1,
3700
+ isResolveRequestPending: !1
3701
+ }), this._queueMap.get(e.url).messageQueue.push({
3702
+ requestId: t,
3703
+ params: n,
3704
+ state: Ut$1.PENDING,
3705
+ deferred: r,
3706
+ requireAuth: n.requireAuth
3707
+ }), this._uploadNextPendingItem(e), [2, r.promise]
3708
+ }))
3709
+ }))
3710
+ }, e.prototype.cancel = function (e, t) {
3711
+ var n, r;
3712
+ void 0 === t && (t = null);
3713
+ var i = this._queueMap.get(e.url);
3714
+ if (i) {
3715
+ var u = t ? [i.messageQueue.find((function (e) {
3716
+ return e.requestId === t
3717
+ }))] : a([], o(i.messageQueue), !1);
3718
+ try {
3719
+ for (var c = s(u), l = c.next(); !l.done; l = c.next()) {
3720
+ var d = l.value;
3721
+ if (d) switch (d.state) {
3722
+ case Ut$1.PENDING:
3723
+ d.state = Ut$1.FAILED, d.error = p.requestCanceled, this._resolveMessageQueue(e);
3724
+ break;
3725
+ case Ut$1.UPLOADING:
3726
+ this._requestQueue.cancel(d.requestId);
3727
+ }
3728
+ }
3729
+ } catch (e) {
3730
+ n = {
3731
+ error: e
3732
+ };
3733
+ } finally {
3734
+ try {
3735
+ l && !l.done && (r = c.return) && r.call(c);
3736
+ } finally {
3737
+ if (n) throw n.error
3738
+ }
3739
+ }
3740
+ }
3741
+ }, e
3742
+ }(),
3743
+ tn = {
3744
+ prevResultSize: 0,
3745
+ nextResultSize: 0,
3746
+ isInclusive: !1,
3747
+ reverse: !1,
3748
+ messageTypeFilter: exports.se$1.ALL,
3749
+ customTypesFilter: null,
3750
+ senderUserIdsFilter: null,
3751
+ replyType: exports.ue.NONE,
3752
+ includeReactions: !1,
3753
+ includeMetaArray: !1,
3754
+ includeParentMessageInfo: !1,
3755
+ includeThreadInfo: !1,
3756
+ showSubchannelMessagesOnly: !1
3757
+ },
3758
+ nn = function (e) {
3759
+ return y("number", e.prevResultSize) && y("number", e.nextResultSize) && y("boolean", e.isInclusive) && y("boolean", e.reverse) && y("string", e.messageTypeFilter) && m(exports.se$1, e.messageTypeFilter) && E("string", e.customTypesFilter, !0) && E("string", e.senderUserIdsFilter, !0) && m(exports.ue, e.replyType) && y("boolean", e.includeMetaArray) && y("boolean", e.includeReactions) && y("boolean", e.includeParentMessageInfo) && y("boolean", e.includeThreadInfo) && y("boolean", e.showSubchannelMessagesOnly)
3760
+ },
3761
+ rn = {
3762
+ replyType: exports.ue.NONE,
3763
+ includeReactions: !1,
3764
+ includeThreadInfo: !1,
3765
+ includeMetaArray: !1,
3766
+ includeParentMessageInfo: !1,
3767
+ includePollDetails: !1
3768
+ },
3769
+ sn = function (e) {
3770
+ return m(exports.ue, e.replyType) && y("boolean", e.includeReactions) && y("boolean", e.includeMetaArray) && y("boolean", e.includeParentMessageInfo) && y("boolean", e.includeThreadInfo) && y("boolean", e.includePollDetails)
3771
+ };
3772
+ ! function (e) {
3773
+ e.UNKNOWN = "UNKNOWN", e.EVENT_MESSAGE_SENT_SUCCESS = "EVENT_MESSAGE_SENT_SUCCESS", e.EVENT_MESSAGE_SENT_FAILED = "EVENT_MESSAGE_SENT_FAILED", e.EVENT_MESSAGE_SENT_PENDING = "EVENT_MESSAGE_SENT_PENDING", e.EVENT_MESSAGE_RECEIVED = "EVENT_MESSAGE_RECEIVED", e.EVENT_MESSAGE_UPDATED = "EVENT_MESSAGE_UPDATED", e.EVENT_MESSAGE_DELETED = "EVENT_MESSAGE_DELETED", e.EVENT_MESSAGE_READ = "EVENT_MESSAGE_READ", e.EVENT_MESSAGE_DELIVERED = "EVENT_MESSAGE_DELIVERED", e.EVENT_MESSAGE_REACTION_UPDATED = "EVENT_MESSAGE_REACTION_UPDATED", e.EVENT_MESSAGE_THREADINFO_UPDATED = "EVENT_MESSAGE_THREADINFO_UPDATED", e.EVENT_MESSAGE_OFFSET_UPDATED = "EVENT_MESSAGE_OFFSET_UPDATED", e.REQUEST_MESSAGE = "REQUEST_MESSAGE", e.REQUEST_RESEND_MESSAGE = "REQUEST_RESEND_MESSAGE", e.REQUEST_THREADED_MESSAGE = "REQUEST_THREADED_MESSAGE", e.REQUEST_MESSAGE_CHANGELOGS = "REQUEST_MESSAGE_CHANGELOGS", e.SYNC_MESSAGE_FILL = "SYNC_MESSAGE_FILL", e.SYNC_MESSAGE_BACKGROUND = "SYNC_MESSAGE_BACKGROUND", e.SYNC_MESSAGE_CHANGELOGS = "SYNC_MESSAGE_CHANGELOGS", e.LOCAL_MESSAGE_PENDING_CREATED = "LOCAL_MESSAGE_PENDING_CREATED", e.LOCAL_MESSAGE_FAILED = "LOCAL_MESSAGE_FAILED", e.LOCAL_MESSAGE_CANCELED = "LOCAL_MESSAGE_CANCELED", e.LOCAL_MESSAGE_RESEND_STARTED = "LOCAL_MESSAGE_RESEND_STARTED";
3774
+ }(exports.$t || (exports.$t = {}));
3775
+ var on, an = function (e) {
3776
+ return e.startsWith("EVENT_") || e === exports.$t.SYNC_MESSAGE_FILL || e === exports.$t.SYNC_MESSAGE_CHANGELOGS
3777
+ },
3778
+ un = function (e) {
3779
+ function n(t) {
3780
+ var n = t.messages,
3781
+ r = t.source,
3782
+ i = e.call(this) || this;
3783
+ return i.messages = n, i.source = r, i
3784
+ }
3785
+ return t(n, e), n
3786
+ }(L),
3787
+ cn = function (e) {
3788
+ function n(t) {
3789
+ var n = t.messageIds,
3790
+ r = t.source,
3791
+ i = e.call(this) || this;
3792
+ return i.messageIds = n, i.source = r, i
3793
+ }
3794
+ return t(n, e), n
3795
+ }(L),
3796
+ ln = function (e) {
3797
+ function n(t) {
3798
+ var n = t.reqId,
3799
+ r = t.source,
3800
+ i = e.call(this) || this;
3801
+ return i.reqId = n, i.source = r, i
3802
+ }
3803
+ return t(n, e), n
3804
+ }(L),
3805
+ dn = function (e) {
3806
+ function n(t) {
3807
+ var n = t.channelType,
3808
+ r = t.channelUrl,
3809
+ i = t.messageId,
3810
+ s = t.includeMetaArray,
3811
+ o = t.includeReactions,
3812
+ a = t.includeThreadInfo,
3813
+ u = t.includeParentMessageInfo,
3814
+ c = t.includePollDetails,
3815
+ l = e.call(this) || this;
3816
+ return l.method = exports.d.GET, l.path = "".concat(We$1(n), "/").concat(encodeURIComponent(r), "/messages/").concat(encodeURIComponent(i)), l.params = {
3817
+ is_sdk: !0,
3818
+ with_sorted_meta_array: s,
3819
+ include_reactions: o,
3820
+ include_thread_info: a,
3821
+ include_parent_message_info: u,
3822
+ include_poll_details: c
3823
+ }, l
3824
+ }
3825
+ return t(n, e), n
3826
+ }(q),
3827
+ hn = function (e) {
3828
+ function r(t, r) {
3829
+ var i = e.call(this, t, r) || this;
3830
+ return i.message = r ? Ht(t, exports.n({}, r)) : null, i
3831
+ }
3832
+ return t(r, e), r
3833
+ }(F),
3834
+ pn = function (e) {
3835
+ function n(t) {
3836
+ var n = t.channelType,
3837
+ r = t.channelUrl,
3838
+ i = t.timestamp,
3839
+ s = void 0 === i ? null : i,
3840
+ o = t.token,
3841
+ a = void 0 === o ? null : o,
3842
+ u = t.prevResultSize,
3843
+ c = t.nextResultSize,
3844
+ l = t.isInclusive,
3845
+ h = t.reverse,
3846
+ p = t.messageTypeFilter,
3847
+ f = t.customTypesFilter,
3848
+ _ = t.senderUserIdsFilter,
3849
+ g = t.replyType,
3850
+ y = t.includeMetaArray,
3851
+ m = t.includeReactions,
3852
+ v = t.parentMessageId,
3853
+ E = t.includeThreadInfo,
3854
+ I = t.includeParentMessageInfo,
3855
+ S = t.showSubchannelMessagesOnly,
3856
+ T = t.includePollDetails,
3857
+ b = e.call(this) || this;
3858
+ return b.method = exports.d.GET, b.path = "".concat(We$1(n), "/").concat(encodeURIComponent(r), "/messages"), b.params = U$1({
3859
+ is_sdk: !0,
3860
+ prev_limit: u,
3861
+ next_limit: c,
3862
+ include: l,
3863
+ reverse: h,
3864
+ message_ts: s,
3865
+ message_id: a,
3866
+ message_type: null != p ? p : null,
3867
+ custom_types: f,
3868
+ sender_ids: _,
3869
+ include_reply_type: g,
3870
+ with_sorted_meta_array: y,
3871
+ include_reactions: m,
3872
+ parent_message_id: v,
3873
+ include_thread_info: E,
3874
+ include_parent_message_info: I,
3875
+ show_subchannel_message_only: S,
3876
+ include_poll_details: T
3877
+ }), b
3878
+ }
3879
+ return t(n, e), n
3880
+ }(q),
3881
+ fn = function (e) {
3882
+ function n(t, n) {
3883
+ var r = e.call(this, t, n) || this;
3884
+ return r.messages = n.messages.map((function (e) {
3885
+ return Ht(t, e)
3886
+ })), r
3887
+ }
3888
+ return t(n, e), n
3889
+ }(F),
3890
+ _n = function (e) {
3891
+ function n(t) {
3892
+ var n = t.channelType,
3893
+ r = t.channelUrl,
3894
+ i = t.timestamp,
3895
+ s = t.token,
3896
+ o = t.replyType,
3897
+ a = t.includeMetaArray,
3898
+ u = t.includeReactions,
3899
+ c = t.includeThreadInfo,
3900
+ l = t.includeParentMessageInfo,
3901
+ h = t.includePollDetails,
3902
+ p = e.call(this) || this;
3903
+ return p.method = exports.d.GET, p.path = "".concat(We$1(n), "/").concat(encodeURIComponent(r), "/messages/changelogs"), p.params = {
3904
+ change_ts: i,
3905
+ token: s,
3906
+ with_sorted_meta_array: a,
3907
+ include_reactions: u,
3908
+ include_thread_info: c,
3909
+ include_reply_type: o,
3910
+ include_parent_message_info: l,
3911
+ include_poll_details: h
3912
+ }, p
3913
+ }
3914
+ return t(n, e), n
3915
+ }(q),
3916
+ gn = function (e) {
3917
+ function n(t, n) {
3918
+ var r = e.call(this, t, n) || this;
3919
+ return r.updatedMessages = n.updated.map((function (e) {
3920
+ return Ht(t, e)
3921
+ })), r.deletedMessagesInfo = n.deleted.map((function (e) {
3922
+ return {
3923
+ messageId: e.message_id,
3924
+ deletedAt: e.deleted_at
3925
+ }
3926
+ })), r.hasMore = n.has_more, r.nextToken = n.next, r
3927
+ }
3928
+ return t(n, e), n
3929
+ }(F),
3930
+ yn = function (e) {
3931
+ function n(t) {
3932
+ var n = t.channelUrl,
3933
+ r = t.scheduledMessageId,
3934
+ i = e.call(this) || this;
3935
+ return i.method = exports.d.GET, i.path = "".concat(qe$1, "/").concat(encodeURIComponent(n), "/scheduled_messages/").concat(encodeURIComponent(r)), i.params = {}, i
3936
+ }
3937
+ return t(n, e), n
3938
+ }(q),
3939
+ mn = function (e) {
3940
+ function r(t, r) {
3941
+ var i = e.call(this, t, r) || this;
3942
+ return i.message = r ? Ht(t, exports.n({}, r)) : null, i
3943
+ }
3944
+ return t(r, e), r
3945
+ }(F),
3946
+ vn = {},
3947
+ En = function () {
3948
+ function e(e, t) {
3949
+ var n = t.sdkState,
3950
+ r = t.dispatcher,
3951
+ i = t.requestQueue,
3952
+ s = t.onlineDetector,
3953
+ o = t.cacheContext;
3954
+ this._iid = e, this._sdkState = n, this._requestQueue = i, this._dispatcher = r, this._onlineDetector = s, this._cacheContext = o, this.fileMessageQueue = new en(e, {
3955
+ sdkState: n,
3956
+ dispatcher: r,
3957
+ requestQueue: i,
3958
+ onlineDetector: s,
3959
+ cacheContext: o
3960
+ }), vn[e] = this;
3961
+ }
3962
+ return e.of = function (e) {
3963
+ return vn[e]
3964
+ }, e.prototype.buildMessageFromSerializedData = function (e) {
3965
+ var t = ot$1(e);
3966
+ switch (t.messageType) {
3967
+ case ie$1.USER:
3968
+ return new Vt(this._iid, Vt.payloadify(t));
3969
+ case ie$1.FILE:
3970
+ return new Wt(this._iid, Wt.payloadify(t));
3971
+ case ie$1.ADMIN:
3972
+ return new Kt(this._iid, Kt.payloadify(t))
3973
+ }
3974
+ return null
3975
+ }, e.prototype.buildUserMessageCreateParamsFromSerializedData = function (e, t) {
3976
+ return U$1({
3977
+ data: t.data,
3978
+ customType: t.customType,
3979
+ mentionType: t.mentionType,
3980
+ mentionedUserIds: t.mentionedUserIds,
3981
+ mentionedUsers: t.mentionedUsers,
3982
+ mentionedMessageTemplate: t.mentionedMessageTemplate,
3983
+ metaArrays: t.metaArrays,
3984
+ parentMessageId: t.parentMessageId,
3985
+ isReplyToChannel: e.isReplyToChannel,
3986
+ pushNotificationDeliveryOption: e.pushNotificationDeliveryOption,
3987
+ appleCriticalAlertOptions: t.appleCriticalAlertOptions,
3988
+ reqId: t.reqId,
3989
+ message: t.message,
3990
+ translationTargetLanguages: Object.keys(t.translations)
3991
+ })
3992
+ }, e.prototype.buildFileMessageCreateParamsFromSerializedData = function (e, t) {
3993
+ return U$1({
3994
+ data: t.data,
3995
+ customType: t.customType,
3996
+ mentionType: t.mentionType,
3997
+ mentionedUserIds: t.mentionedUserIds,
3998
+ mentionedUsers: t.mentionedUsers,
3999
+ mentionedMessageTemplate: t.mentionedMessageTemplate,
4000
+ metaArrays: t.metaArrays,
4001
+ parentMessageId: t.parentMessageId,
4002
+ isReplyToChannel: e.isReplyToChannel,
4003
+ pushNotificationDeliveryOption: e.pushNotificationDeliveryOption,
4004
+ appleCriticalAlertOptions: t.appleCriticalAlertOptions,
4005
+ reqId: t.reqId,
4006
+ file: e.file,
4007
+ fileKey: e.fileKey,
4008
+ fileUrl: t.url,
4009
+ fileName: t.name,
4010
+ fileSize: t.size,
4011
+ mimeType: t.type,
4012
+ thumbnailSizes: t.thumbnails.map((function (e) {
4013
+ return {
4014
+ maxWidth: e.width,
4015
+ maxHeight: e.height
4016
+ }
4017
+ })),
4018
+ fileType: e.fileType,
4019
+ requireAuth: t.requireAuth
4020
+ })
4021
+ }, e.prototype.buildScheduledUserMessageCreateParamsFromSerializedData = function (e, t) {
4022
+ return exports.n(exports.n({}, this.buildUserMessageCreateParamsFromSerializedData(e, t)), {
4023
+ scheduledAt: e.scheduledAt
4024
+ })
4025
+ }, e.prototype.buildScheduledFileMessageCreateParamsFromSerializedData = function (e, t) {
4026
+ return exports.n(exports.n({}, this.buildFileMessageCreateParamsFromSerializedData(e, t)), {
4027
+ scheduledAt: e.scheduledAt
4028
+ })
4029
+ }, e.prototype.buildSenderFromSerializedData = function (e) {
4030
+ var t = ot$1(e);
4031
+ return new Ft(this._iid, Ft.payloadify(t))
4032
+ }, e.prototype.getMessage = function (e) {
4033
+ return r(this, void 0, void 0, (function () {
4034
+ var t, n;
4035
+ return i(this, (function (r) {
4036
+ switch (r.label) {
4037
+ case 0:
4038
+ return t = new dn(e), [4, this._requestQueue.send(t)];
4039
+ case 1:
4040
+ return n = r.sent(), [2, n.as(hn).message]
4041
+ }
4042
+ }))
4043
+ }))
4044
+ }, e.prototype.getScheduledMessage = function (e) {
4045
+ return r(this, void 0, void 0, (function () {
4046
+ var t, n;
4047
+ return i(this, (function (r) {
4048
+ switch (r.label) {
4049
+ case 0:
4050
+ return t = new yn(e), [4, this._requestQueue.send(t)];
4051
+ case 1:
4052
+ return n = r.sent(), [2, n.as(mn).message]
4053
+ }
4054
+ }))
4055
+ }))
4056
+ }, e.prototype.getMessagesByTimestamp = function (e, t, s, o, a) {
4057
+ return void 0 === a && (a = exports.$t.REQUEST_MESSAGE), r(this, void 0, void 0, (function () {
4058
+ var r, u, c;
4059
+ return i(this, (function (i) {
4060
+ switch (i.label) {
4061
+ case 0:
4062
+ return r = new pn(exports.n(exports.n({
4063
+ channelType: t,
4064
+ channelUrl: e,
4065
+ timestamp: s
4066
+ }, tn), o)), [4, this._requestQueue.send(r)];
4067
+ case 1:
4068
+ return u = i.sent(), c = u.as(fn).messages, this._dispatcher.dispatch(new un({
4069
+ messages: c,
4070
+ source: a
4071
+ })), [2, c]
4072
+ }
4073
+ }))
4074
+ }))
4075
+ }, e.prototype.getThreadedMessagesByTimestamp = function (e, t, s, o) {
4076
+ return void 0 === o && (o = exports.$t.REQUEST_THREADED_MESSAGE), r(this, void 0, void 0, (function () {
4077
+ var r, a, u, c;
4078
+ return i(this, (function (i) {
4079
+ switch (i.label) {
4080
+ case 0:
4081
+ return r = new pn(exports.n(exports.n(exports.n({
4082
+ channelUrl: e.channelUrl,
4083
+ channelType: e.channelType,
4084
+ timestamp: t
4085
+ }, Qt), s), {
4086
+ replyType: exports.ue.ALL,
4087
+ parentMessageId: e.messageId,
4088
+ includeThreadInfo: !0
4089
+ })), [4, this._requestQueue.send(r)];
4090
+ case 1:
4091
+ return a = i.sent(), u = a.as(fn).messages, (c = u.slice(1)).forEach((function (t) {
4092
+ t.parentMessage = e;
4093
+ })), this._dispatcher.dispatch(new un({
4094
+ messages: c,
4095
+ source: o
4096
+ })), [2, {
4097
+ parentMessage: u[0],
4098
+ threadedMessages: c
4099
+ }]
4100
+ }
4101
+ }))
4102
+ }))
4103
+ }, e.prototype.getMessageChangelogs = function (e, t, s, o, a) {
4104
+ return void 0 === a && (a = exports.$t.REQUEST_MESSAGE_CHANGELOGS), r(this, void 0, void 0, (function () {
4105
+ var r, u, c, l, d, h, p, f;
4106
+ return i(this, (function (i) {
4107
+ switch (i.label) {
4108
+ case 0:
4109
+ return r = new _n(U$1(exports.n(exports.n({
4110
+ channelType: t,
4111
+ channelUrl: e,
4112
+ timestamp: "number" == typeof s ? s : null,
4113
+ token: "string" == typeof s ? s : null
4114
+ }, rn), o))), [4, this._requestQueue.send(r)];
4115
+ case 1:
4116
+ return u = i.sent(), c = u.as(gn), l = c.updatedMessages, d = c.deletedMessagesInfo, h = c.hasMore, p = c.nextToken, f = d.map((function (e) {
4117
+ return e.messageId
4118
+ })), l.length > 0 && this._dispatcher.dispatch(new un({
4119
+ messages: l,
4120
+ source: a
4121
+ })), f.length > 0 && this._dispatcher.dispatch(new cn({
4122
+ messageIds: f,
4123
+ source: a
4124
+ })), [2, {
4125
+ updatedMessages: l,
4126
+ deletedMessageIds: f,
4127
+ hasMore: h,
4128
+ token: p
4129
+ }]
4130
+ }
4131
+ }))
4132
+ }))
4133
+ }, e
4134
+ }(),
4135
+ In = function () {
4136
+ function e() {
4137
+ this._onPending = Y$1, this._onFailed = Y$1, this._onSucceeded = Y$1;
4138
+ }
4139
+ return e.prototype._trigger = function (e, t) {
4140
+ switch (t.sendingStatus) {
4141
+ case exports.le.PENDING:
4142
+ this._onPending(t);
4143
+ break;
4144
+ case exports.le.FAILED:
4145
+ case exports.le.CANCELED:
4146
+ this._onFailed(e, t.isResendable ? t : null);
4147
+ break;
4148
+ case exports.le.SCHEDULED:
4149
+ case exports.le.SUCCEEDED:
4150
+ this._onSucceeded(t);
4151
+ }
4152
+ }, e.prototype.onPending = function (e) {
4153
+ return this._onPending = e, this
4154
+ }, e.prototype.onFailed = function (e) {
4155
+ return this._onFailed = e, this
4156
+ }, e.prototype.onSucceeded = function (e) {
4157
+ return this._onSucceeded = e, this
4158
+ }, e
4159
+ }(),
4160
+ Sn = function (e) {
4161
+ function n(t, n) {
4162
+ var r = e.call(this, t) || this;
4163
+ r.threadInfo = null, r.targetMessageId = 0, r.channelUrl = null, r.channelType = null;
4164
+ var i = n.thread_info,
4165
+ s = n.root_message_id,
4166
+ o = n.channel_url,
4167
+ a = n.channel_type;
4168
+ return i && y("object", i) && y("number", s) && y("string", o) && y("string", a) && (r.threadInfo = new At$1(t, i), r.targetMessageId = s, r.channelUrl = o, r.channelType = a), r
4169
+ }
4170
+ return t(n, e), n
4171
+ }(Le$1),
4172
+ Tn = {
4173
+ channelUrl: null,
4174
+ channelType: null,
4175
+ messageId: 0,
4176
+ includeReactions: !1,
4177
+ includeMetaArray: !1,
4178
+ includeParentMessageInfo: !1,
4179
+ includeThreadInfo: !1,
4180
+ includePollDetails: !1
4181
+ },
4182
+ bn = function () {
4183
+ function e(e, t) {
4184
+ var n;
4185
+ this._iid = null, this.limit = 20, this._isLoading = !1, this._hasNext = !0, this._token = "", this._iid = e, this.limit = null !== (n = t.limit) && void 0 !== n ? n : 20;
4186
+ }
4187
+ return Object.defineProperty(e.prototype, "hasNext", {
4188
+ get: function () {
4189
+ return this._hasNext
4190
+ },
4191
+ enumerable: !1,
4192
+ configurable: !0
4193
+ }), Object.defineProperty(e.prototype, "isLoading", {
4194
+ get: function () {
4195
+ return this._isLoading
4196
+ },
4197
+ enumerable: !1,
4198
+ configurable: !0
4199
+ }), e.prototype._validate = function () {
4200
+ return y("number", this.limit) && this.limit > 0
4201
+ }, e
4202
+ }(),
4203
+ Nn = function (e) {
4204
+ function n(t) {
4205
+ var n = t.channelCustomType,
4206
+ r = t.keyword,
4207
+ i = t.limit,
4208
+ s = t.reverse,
4209
+ o = t.exactMatch,
4210
+ a = t.channelUrl,
4211
+ u = t.order,
4212
+ c = t.messageTimestampFrom,
4213
+ l = t.messageTimestampTo,
4214
+ h = t.advancedQuery,
4215
+ p = t.targetFields,
4216
+ f = t.nextToken,
4217
+ _ = e.call(this) || this;
4218
+ return _.method = exports.d.GET, _.path = "".concat(Qe$1, "/messages"), _.params = {
4219
+ custom_type: n,
4220
+ query: r,
4221
+ limit: i,
4222
+ reverse: s,
4223
+ exact_match: o,
4224
+ channel_url: a,
4225
+ message_ts_from: c,
4226
+ message_ts_to: l,
4227
+ sort_field: u,
4228
+ advanced_query: h,
4229
+ target_fields: p,
4230
+ after: f
4231
+ }, _
4232
+ }
4233
+ return t(n, e), n
4234
+ }(q),
4235
+ An = function (e) {
4236
+ function n(t, n) {
4237
+ var r = e.call(this, t, n) || this;
4238
+ return r.messages = n.results.map((function (e) {
4239
+ return Ht(t, e)
4240
+ })), r.hasNext = n.has_next, r.nextToken = n.end_cursor, r
4241
+ }
4242
+ return t(n, e), n
4243
+ }(F);
4244
+ ! function (e) {
4245
+ e.SCORE = "score", e.TIMESTAMP = "ts";
4246
+ }(on || (on = {}));
4247
+ var Cn = function (e) {
4248
+ function s(t, n) {
4249
+ var r, i, s, o, a, u, c, l, d, h = this;
4250
+ return (h = e.call(this, t, n) || this).keyword = "", h.reverse = !1, h.exactMatch = !1, h.channelUrl = "", h.channelCustomType = "", h.messageTimestampFrom = null, h.messageTimestampTo = null, h.order = on.SCORE, h.advancedQuery = !1, h.targetFields = null, h._nextToken = "", h.keyword = n.keyword, h.reverse = null !== (r = n.reverse) && void 0 !== r && r, h.exactMatch = null !== (i = n.exactMatch) && void 0 !== i && i, h.channelUrl = null !== (s = n.channelUrl) && void 0 !== s ? s : "", h.channelCustomType = null !== (o = n.channelCustomType) && void 0 !== o ? o : "", h.messageTimestampFrom = null !== (a = n.messageTimestampFrom) && void 0 !== a ? a : null, h.messageTimestampTo = null !== (u = n.messageTimestampTo) && void 0 !== u ? u : null, h.order = null !== (c = n.order) && void 0 !== c ? c : on.SCORE, h.advancedQuery = null !== (l = n.advancedQuery) && void 0 !== l && l, h.targetFields = null !== (d = n.targetFields) && void 0 !== d ? d : null, h
4251
+ }
4252
+ return t(s, e), s.prototype._validate = function () {
4253
+ return e.prototype._validate.call(this) && y("string", this.keyword) && this.keyword.length > 0 && y("boolean", this.reverse) && y("boolean", this.exactMatch) && y("string", this.channelUrl) && y("string", this.channelCustomType) && (y("number", this.messageTimestampFrom) || null === this.messageTimestampFrom) && (y("number", this.messageTimestampTo) || null === this.messageTimestampTo) && m(on, this.order) && y("boolean", this.advancedQuery) && E("string", this.targetFields, !0)
4254
+ }, s.prototype.next = function () {
4255
+ return r(this, void 0, void 0, (function () {
4256
+ var e, t, r, s, o, a, u;
4257
+ return i(this, (function (i) {
4258
+ switch (i.label) {
4259
+ case 0:
4260
+ return this._validate() ? this._isLoading ? [3, 3] : this._hasNext ? (this._isLoading = !0, e = St$1.of(this._iid).requestQueue, t = new Nn(exports.n(exports.n({}, this), {
4261
+ nextToken: this._nextToken ? this._nextToken : null
4262
+ })), [4, e.send(t)]) : [3, 2] : [3, 5];
4263
+ case 1:
4264
+ return r = i.sent(), s = r.as(An), o = s.messages, a = s.hasNext, u = s.nextToken, this._nextToken = u, this._hasNext = a, this._isLoading = !1, [2, o];
4265
+ case 2:
4266
+ return [2, []];
4267
+ case 3:
4268
+ throw p.queryInProgress;
4269
+ case 4:
4270
+ return [3, 6];
4271
+ case 5:
4272
+ throw p.invalidParameters;
4273
+ case 6:
4274
+ return [2]
4275
+ }
4276
+ }))
4277
+ }))
4278
+ }, s
4279
+ }(bn),
4280
+ On = function (e) {
4281
+ function n(t, n, r, i) {
4282
+ var s = e.call(this, t, i) || this;
4283
+ return s.channelUrl = n, s.channelType = r, s
4284
+ }
4285
+ return t(n, e), n.prototype._validate = function () {
4286
+ return e.prototype._validate.call(this) && y("string", this.channelUrl) && m(exports.ne, this.channelType)
4287
+ }, n
4288
+ }(bn),
4289
+ wn = function (e) {
4290
+ function n(t, n, r, i) {
4291
+ var s, o, a, u, c, l, d, h, p, f, _ = this;
4292
+ return (_ = e.call(this, t, n, r, i) || this).reverse = !1, _.messageTypeFilter = exports.se$1.ALL, _.customTypesFilter = null, _.senderUserIdsFilter = null, _.replyType = exports.ue.NONE, _.includeMetaArray = !1, _.includeReactions = !1, _.includeParentMessageInfo = !1, _.includeThreadInfo = !1, _.showSubchannelMessagesOnly = !1, _._edge = Number.MAX_SAFE_INTEGER, _.reverse = null !== (s = i.reverse) && void 0 !== s && s, _.messageTypeFilter = null !== (o = i.messageTypeFilter) && void 0 !== o ? o : exports.se$1.ALL, _.customTypesFilter = null !== (a = i.customTypesFilter) && void 0 !== a ? a : null, _.senderUserIdsFilter = null !== (u = i.senderUserIdsFilter) && void 0 !== u ? u : null, _.replyType = null !== (c = i.replyType) && void 0 !== c ? c : exports.ue.NONE, _.includeMetaArray = null !== (l = i.includeMetaArray) && void 0 !== l && l, _.includeReactions = null !== (d = i.includeReactions) && void 0 !== d && d, _.includeParentMessageInfo = null !== (h = i.includeParentMessageInfo) && void 0 !== h && h, _.includeThreadInfo = null !== (p = i.includeThreadInfo) && void 0 !== p && p, _.showSubchannelMessagesOnly = null !== (f = i.showSubchannelMessagesOnly) && void 0 !== f && f, _
4293
+ }
4294
+ return t(n, e), n.prototype._validate = function () {
4295
+ return e.prototype._validate.call(this) && y("boolean", this.reverse) && m(exports.se$1, this.messageTypeFilter) && m(exports.ue, this.replyType) && E("string", this.customTypesFilter, !0) && E("string", this.senderUserIdsFilter, !0) && y("boolean", this.includeMetaArray) && y("boolean", this.includeReactions) && y("boolean", this.includeParentMessageInfo) && y("boolean", this.includeThreadInfo) && y("boolean", this.showSubchannelMessagesOnly)
4296
+ }, n.prototype.load = function () {
4297
+ return r(this, void 0, void 0, (function () {
4298
+ var e;
4299
+ return i(this, (function (t) {
4300
+ switch (t.label) {
4301
+ case 0:
4302
+ return this._validate() ? this._isLoading ? [3, 3] : this._hasNext ? (this._isLoading = !0, [4, En.of(this._iid).getMessagesByTimestamp(this.channelUrl, this.channelType, this._edge, {
4303
+ prevResultSize: this.limit,
4304
+ nextResultSize: 0,
4305
+ isInclusive: !1,
4306
+ reverse: this.reverse,
4307
+ messageTypeFilter: this.messageTypeFilter,
4308
+ customTypesFilter: this.customTypesFilter,
4309
+ replyType: this.replyType,
4310
+ senderUserIdsFilter: this.senderUserIdsFilter,
4311
+ includeReactions: this.includeReactions,
4312
+ includeMetaArray: this.includeMetaArray,
4313
+ includeParentMessageInfo: this.includeParentMessageInfo,
4314
+ includeThreadInfo: this.includeThreadInfo,
4315
+ showSubchannelMessagesOnly: this.showSubchannelMessagesOnly
4316
+ })]) : [3, 2] : [3, 5];
4317
+ case 1:
4318
+ return e = t.sent(), this._edge = Math.min.apply(Math, a([Number.MAX_SAFE_INTEGER], o(e.map((function (e) {
4319
+ return e.createdAt
4320
+ }))), !1)), this._hasNext = e.length >= this.limit, this._isLoading = !1, [2, e];
4321
+ case 2:
4322
+ return [2, []];
4323
+ case 3:
4324
+ throw p.queryInProgress;
4325
+ case 4:
4326
+ return [3, 6];
4327
+ case 5:
4328
+ throw p.invalidParameters;
4329
+ case 6:
4330
+ return [2]
4331
+ }
4332
+ }))
4333
+ }))
4334
+ }, n
4335
+ }(On),
4336
+ Rn = {
4337
+ channelUrl: null,
4338
+ scheduledMessageId: 0
4339
+ },
4340
+ Dn = function (e) {
4341
+ function s() {
4342
+ var t = null !== e && e.apply(this, arguments) || this;
4343
+ return t.name = "message", t
4344
+ }
4345
+ return t(s, e), s.prototype.init = function (t, n) {
4346
+ var r = n.sdkState,
4347
+ i = n.dispatcher,
4348
+ s = n.sessionManager,
4349
+ o = n.requestQueue,
4350
+ a = n.logger,
4351
+ u = n.onlineDetector,
4352
+ c = n.cacheContext;
4353
+ e.prototype.init.call(this, t, {
4354
+ sdkState: r,
4355
+ dispatcher: i,
4356
+ sessionManager: s,
4357
+ requestQueue: o,
4358
+ logger: a,
4359
+ onlineDetector: u,
4360
+ cacheContext: c
4361
+ }), this._manager = new En(t, {
4362
+ sdkState: r,
4363
+ dispatcher: i,
4364
+ requestQueue: o,
4365
+ onlineDetector: u,
4366
+ cacheContext: c
4367
+ });
4368
+ }, s.prototype.buildMessageFromSerializedData = function (e) {
4369
+ return this._manager.buildMessageFromSerializedData(e)
4370
+ }, s.prototype.buildSenderFromSerializedData = function (e) {
4371
+ return this._manager.buildSenderFromSerializedData(e)
4372
+ }, s.prototype.getMessage = function (e) {
4373
+ return r(this, void 0, void 0, (function () {
4374
+ return i(this, (function (t) {
4375
+ return e = exports.n(exports.n({}, Tn), e), at$1(function (e) {
4376
+ return y("string", e.channelUrl) && y("string", e.channelType) && m(exports.ne, e.channelType) && y("number", e.messageId) && y("boolean", e.includeMetaArray) && y("boolean", e.includeParentMessageInfo) && y("boolean", e.includeThreadInfo) && y("boolean", e.includePollDetails)
4377
+ }(e)).throw(p.invalidParameters), [2, this._manager.getMessage(e)]
4378
+ }))
4379
+ }))
4380
+ }, s.prototype.getScheduledMessage = function (e) {
4381
+ return r(this, void 0, void 0, (function () {
4382
+ return i(this, (function (t) {
4383
+ return e = exports.n(exports.n({}, Rn), e), at$1(function (e) {
4384
+ return y("string", e.channelUrl) && y("number", e.scheduledMessageId)
4385
+ }(e)).throw(p.invalidParameters), [2, this._manager.getScheduledMessage(e)]
4386
+ }))
4387
+ }))
4388
+ }, s
4389
+ }(Tt$1);
4390
+
4391
+ var oe$1,ue$1={data:null,customType:null,mentionType:exports.ae$1.USERS,mentionedUserIds:null,mentionedUsers:null,mentionedMessageTemplate:null,metaArrays:null,parentMessageId:null,isReplyToChannel:!1,pushNotificationDeliveryOption:null,appleCriticalAlertOptions:null},ce$1=function(u){return y("string",u.data,!0)&&y("string",u.customType,!0)&&m(exports.ae$1,u.mentionType)&&E("string",u.mentionedUserIds,!0)&&E(ct$1,u.mentionedUsers,!0)&&y("string",u.mentionedMessageTemplate,!0)&&E(Dt$1,u.metaArrays,!0)&&y("number",u.parentMessageId,!0)&&y("boolean",u.isReplyToChannel)&&m(ce$2,u.pushNotificationDeliveryOption,!0)&&y(Lt,u.appleCriticalAlertOptions,!0)},le$1=function(e){return e?{isReplyToChannel:e.isReplyToChannel,pushNotificationDeliveryOption:e.pushNotificationDeliveryOption}:null},de$1=exports.n(exports.n({},ue$1),{message:null,translationTargetLanguages:null}),he$1=function(e){return ce$1(e)&&y("string",e.message)&&E("string",e.translationTargetLanguages,!0)};!function(e){e.FILE="file",e.BLOB="blob",e.BLOB_LIKE_OBJECT="blobLikeObject",e.URL="url";}(oe$1||(oe$1={}));var pe$1,fe$1=function(e){return "undefined"!=typeof window&&"Blob"in window&&"undefined"!=typeof Blob&&e instanceof Blob},me$1=function(e){return e===oe$1.BLOB||e===oe$1.FILE},ve$1=function(e){return e?{file:e.file,fileKey:e.fileKey,fileType:e.fileType,isReplyToChannel:e.isReplyToChannel,pushNotificationDeliveryOption:e.pushNotificationDeliveryOption}:null},ye$1=exports.n(exports.n({},ue$1),{file:null,fileKey:null,fileUrl:null,fileName:null,fileType:null,fileSize:null,mimeType:null,thumbnailSizes:null,requireAuth:!1}),ge$1=function(e){return ce$1(e)&&(S(e.file)||y("string",e.fileUrl))&&y("string",e.fileName,!0)&&y("string",e.mimeType,!0)&&y("number",e.fileSize,!0)&&(null===e.thumbnailSizes||Array.isArray(e.thumbnailSizes)&&e.thumbnailSizes.every((function(e){return y("object",e)&&e.maxWidth>0&&e.maxHeight>0})))};!function(e){e.MUTED="muted",e.BANNED="banned";}(pe$1||(pe$1={}));var _e$1,Te=function(){function e(e){var t,r,i;this.restrictionType=null,this.description=null,this.endAt=-1,m(pe$1,e.restriction_type)&&(this.restrictionType=e.restriction_type),this.description=null!==(t=e.description)&&void 0!==t?t:null,this.endAt=null!==(i=null!==(r=e.end_at)&&void 0!==r?r:e.muted_end_at)&&void 0!==i?i:-1;}return e.payloadify=function(e){return e?U$1({restriction_type:e.restrictionType,description:e.description,end_at:e.endAt}):null},e}(),Ue=function(e){function t$1(t,n){var r=e.call(this,t,n)||this;return r.restrictionInfo=null,r.restrictionInfo=new Te(n),r}return t(t$1,e),t$1.payloadify=function(t){return t?U$1(exports.n(exports.n({},e.payloadify.call(this,t)),Te.payloadify(t.restrictionInfo))):null},t$1}(ct$1),Ie={data:null,customType:null,mentionType:exports.ae$1.USERS,mentionedUserIds:null,mentionedUsers:null,mentionedMessageTemplate:null,metaArrays:null,pushNotificationDeliveryOption:null,appleCriticalAlertOptions:null},Ee$1=function(u){return y("string",u.data,!0)&&y("string",u.customType,!0)&&m(exports.ae$1,u.mentionType)&&E("string",u.mentionedUserIds,!0)&&E(ct$1,u.mentionedUsers,!0)&&y("string",u.mentionedMessageTemplate,!0)&&E(Dt$1,u.metaArrays,!0)&&m(ce$2,u.pushNotificationDeliveryOption,!0)&&y(Lt,u.appleCriticalAlertOptions,!0)},we=exports.n(exports.n({},Ie),{message:null,translationTargetLanguages:null}),Me=function(e){return Ee$1(e)&&y("string",e.message,!0)&&E("string",e.translationTargetLanguages,!0)},Se=exports.n({},Ie),Ce=function(e){function t$1(t){var n=t.channelUrl,r=t.channelType,i=t.token,a=t.limit,s=e.call(this)||this;return s.method=exports.d.GET,s.path="".concat(We$1(r),"/").concat(encodeURIComponent(n),"/operators"),s.params={token:i,limit:a},s}return t(t$1,e),t$1}(q),be$1=function(e){function t$1(t,n){var r=e.call(this,t,n)||this;return r.operators=n.operators.map((function(e){return new ct$1(t,e)})),r.token=n.next,r}return t(t$1,e),t$1}(F),Ae$1=function(e){function t$1(t,n,r,i){return e.call(this,t,n,r,i)||this}return t(t$1,e),t$1.prototype._validate=function(){return e.prototype._validate.call(this)},t$1.prototype.next=function(){return r(this,void 0,void 0,(function(){var e,t,n,r,i$1,a,s;return i(this,(function(o){switch(o.label){case 0:return this._validate()?this._isLoading?[3,3]:(e=[],this._hasNext?(this._isLoading=!0,t=St$1.of(this._iid).requestQueue,n=new Ce(exports.n(exports.n({},this),{channelUrl:this.channelUrl,token:this._token})),[4,t.send(n)]):[3,2]):[3,5];case 1:return r=o.sent(),i$1=r.as(be$1),a=i$1.operators,s=i$1.token,this._token=s,this._hasNext=!!s,this._isLoading=!1,[2,a];case 2:return [2,e];case 3:throw p.queryInProgress;case 4:return [3,6];case 5:throw p.invalidParameters;case 6:return [2]}}))}))},t$1}(On),Pe=function(e){function t$1(t){var n=this,r=t.channelUrl,i=t.channelType,a=t.limit,s=t.token;return (n=e.call(this)||this).method=exports.d.GET,n.path="".concat(We$1(i),"/").concat(encodeURIComponent(r),"/mute"),n.params={limit:a,token:s},n}return t(t$1,e),t$1}(q),De=function(e){function t$1(t,n){var r=e.call(this,t,n)||this;r.token=null,r.mutedUsers=[];var i=n.next,a=n.muted_list;return r.token=i,a&&a.length>0&&(r.mutedUsers=a.map((function(e){return new Ue(t,e)}))),r}return t(t$1,e),t$1}(F),Re=function(e){function t$1(t,n,r,i){return e.call(this,t,n,r,i)||this}return t(t$1,e),t$1.prototype.next=function(){return r(this,void 0,void 0,(function(){var e,t,n,r,i$1,a;return i(this,(function(s){switch(s.label){case 0:return this._validate()?this._isLoading?[3,3]:this._hasNext?(this._isLoading=!0,e=St$1.of(this._iid).requestQueue,t=new Pe(exports.n(exports.n({},this),{token:this._token})),[4,e.send(t)]):[3,2]:[3,5];case 1:return n=s.sent(),r=n.as(De),i$1=r.mutedUsers,a=r.token,this._token=a,this._hasNext=!!a,this._isLoading=!1,[2,i$1];case 2:return [2,[]];case 3:throw p.queryInProgress;case 4:return [3,6];case 5:throw p.invalidParameters;case 6:return [2]}}))}))},t$1}(On),Ne=function(e){function t$1(t){var n=this,r=t.channelUrl,i=t.channelType,a=t.limit,s=t.token;return (n=e.call(this)||this).method=exports.d.GET,n.path="".concat(We$1(i),"/").concat(encodeURIComponent(r),"/ban"),n.params=U$1({limit:a,token:s}),n}return t(t$1,e),t$1}(q),qe=function(e){function t$1(t,n){var r=e.call(this,t,n)||this;r.token=null,r.bannedUsers=[];var i=n.next,a=n.banned_list;return r.token=i,a&&a.length>0&&(r.bannedUsers=a.map((function(e){return new Ue(t,e.user)}))),r}return t(t$1,e),t$1}(F),Oe=function(e){function t$1(t,n,r,i){return e.call(this,t,n,r,i)||this}return t(t$1,e),t$1.prototype._validate=function(){return e.prototype._validate.call(this)},t$1.prototype.next=function(){return r(this,void 0,void 0,(function(){var e,t,n,r,i$1,a;return i(this,(function(s){switch(s.label){case 0:return this._validate()?this._isLoading?[3,3]:this._hasNext?(this._isLoading=!0,e=St$1.of(this._iid).requestQueue,t=new Ne(exports.n(exports.n({},this),{token:this._token})),[4,e.send(t)]):[3,2]:[3,5];case 1:return n=s.sent(),r=n.as(qe),i$1=r.bannedUsers,a=r.token,this._token=a,this._hasNext=!!a,this._isLoading=!1,[2,i$1];case 2:return [2,[]];case 3:throw p.queryInProgress;case 4:return [3,6];case 5:throw p.invalidParameters;case 6:return [2]}}))}))},t$1}(On);!function(e){e.SPAM="spam",e.HARASSING="harassing",e.SUSPICIOUS="suspicious",e.INAPPROPRIATE="inappropriate";}(_e$1||(_e$1={}));var ke=function(e){function t$1(t){var n=this,r=t.channelUrl,i=t.channelType,a=t.operatorUserIds;return (n=e.call(this)||this).method=exports.d.POST,n.path="".concat(We$1(i),"/").concat(encodeURIComponent(r),"/operators"),n.params={operator_ids:a},n}return t(t$1,e),t$1}(q);!function(e){function t$1(){return null!==e&&e.apply(this,arguments)||this}t(t$1,e);}(F);var Fe=function(e){function t$1(t){var n=this,r=t.channelUrl,i=t.channelType,a=t.operatorUserIds;return (n=e.call(this)||this).method=exports.d.DELETE,n.path="".concat(We$1(i),"/").concat(encodeURIComponent(r),"/operators"),n.params={operator_ids:a},n}return t(t$1,e),t$1}(q);!function(e){function t$1(t,n){return e.call(this,t,n)||this}t(t$1,e);}(F);var Le=function(e){function t$1(t){var n=this,r=t.channelUrl,i=t.channelType,a=t.userId;return (n=e.call(this)||this).method=exports.d.GET,n.path="".concat(We$1(i),"/").concat(encodeURIComponent(r),"/mute/").concat(a),n}return t(t$1,e),t$1}(q),Qe=function(e){function t$1(t,n){var r=e.call(this,t,n)||this;r.isMuted=!1,r.startAt=null,r.endAt=null,r.remainingDuration=null,r.description=null;var i=n.is_muted,a=n.start_at,s=n.end_at,o=n.remaining_duration,u=n.description;return r.isMuted=i,r.startAt=a,r.endAt=s,r.remainingDuration=o,r.description=u,r}return t(t$1,e),t$1}(F),ze=function(e){function t$1(t){var n=this,r=t.channelUrl,i=t.channelType,a=t.keys;return (n=e.call(this)||this).method=exports.d.GET,n.path="".concat(We$1(i),"/").concat(encodeURIComponent(r),"/metadata"),n.params={keys:a,include_ts:!0},n}return t(t$1,e),t$1}(q),Ge=function(e){function t$1(t,n){var r=e.call(this,t,n)||this;r.ts=null;var i=n.metadata,a=n.ts;return r.metadata=i,r.ts=null!=a?a:null,r}return t(t$1,e),t$1}(F),xe=function(e){function t$1(t){var n=this,r=t.channelUrl,i=t.channelType,a=t.metadata,s=t.upsert;return (n=e.call(this)||this).method=exports.d.PUT,n.path="".concat(We$1(i),"/").concat(encodeURIComponent(r),"/metadata"),n.params={metadata:a,include_ts:!0,upsert:null!=s&&s},n}return t(t$1,e),t$1}(q),Ve=function(e){function t$1(t,n){var r=e.call(this,t,n)||this;r.ts=null;var i=n.metadata,a=n.ts;return r.metadata=i,r.ts=null!=a?a:null,r}return t(t$1,e),t$1}(F),je=function(e){function t$1(t,n,r){var i=e.call(this,t,"SYEV",r)||this;return i.created=null,i.updated=null,i.deleted=null,r.data&&(i.created=r.data.created,i.updated=r.data.updated,i.deleted=r.data.deleted),i}return t(t$1,e),t$1}(B),Be=function(e){function t$1(t){var n=this,r=t.channelUrl,i=t.channelType,a=t.key;return (n=e.call(this)||this).method=exports.d.DELETE,n.path="".concat(We$1(i),"/").concat(encodeURIComponent(r),"/metadata/").concat(a),n.params={include_ts:!0},n}return t(t$1,e),t$1}(q),We=function(e){function t$1(t,n){var r=e.call(this,t,n)||this;r.ts=null;var i=n.ts;return r.ts=null!=i?i:null,r}return t(t$1,e),t$1}(F),Ke=function(e){function t$1(t){var n=this,r=t.channelUrl,i=t.channelType;return (n=e.call(this)||this).method=exports.d.PUT,n.path="".concat(We$1(i),"/").concat(encodeURIComponent(r),"/metadata"),n.params={include_ts:!0},n}return t(t$1,e),t$1}(q),Ye=function(e){function t$1(t,n){var r=e.call(this,t,n)||this;r.ts=null;var i=n.ts;return r.ts=null!=i?i:null,r}return t(t$1,e),t$1}(F),He=function(e){function t$1(t){var n=this,r=t.channelUrl,i=t.channelType,a=t.keys;return (n=e.call(this)||this).method=exports.d.GET,n.path="".concat(We$1(i),"/").concat(encodeURIComponent(r),"/metacounter"),n.params={keys:a},n}return t(t$1,e),t$1}(q),Je=function(e){function t$1(t,n){var r=e.call(this,t,n)||this;return r.metaCounter=n,r}return t(t$1,e),t$1}(F),Xe=function(e){function t$1(t){var n=this,r=t.channelUrl,i=t.channelType,a=t.metaCounter;return (n=e.call(this)||this).method=exports.d.POST,n.path="".concat(We$1(i),"/").concat(encodeURIComponent(r),"/metacounter"),n.params={metacounter:a},n}return t(t$1,e),t$1}(q),Ze=function(e){function t$1(t,n){var r=e.call(this,t,n)||this;return r.metaCounter=n,r}return t(t$1,e),t$1}(F),$e=function(e){function t$1(t){var n=this,r=t.channelUrl,i=t.channelType,a=t.metaCounter,s=t.upsert,o=void 0!==s&&s,u=t.mode,c=void 0===u?"set":u;return (n=e.call(this)||this).method=exports.d.PUT,n.path="".concat(We$1(i),"/").concat(encodeURIComponent(r),"/metacounter"),n.params={metacounter:a,upsert:o,mode:c},n}return t(t$1,e),t$1}(q),et=function(e){function t$1(t,n){var r=e.call(this,t,n)||this;return r.metaCounter=n,r}return t(t$1,e),t$1}(F),tt=function(e){function t$1(t,n,r){var i=e.call(this,t,"SYEV",r)||this;return i.created=null,i.updated=null,i.deleted=null,r.data&&(i.created=r.data.created,i.updated=r.data.updated,i.deleted=r.data.deleted),i}return t(t$1,e),t$1}(B),nt=function(e){function t$1(t){var n=this,r=t.channelUrl,i=t.channelType,a=t.key;return (n=e.call(this)||this).method=exports.d.DELETE,n.path="".concat(We$1(i),"/").concat(encodeURIComponent(r),"/metacounter/").concat(a),n.params=null,n}return t(t$1,e),t$1}(q);!function(e){function t$1(t,n){return e.call(this,t,n)||this}t(t$1,e);}(F);var rt=function(e){function t$1(t){var n=this,r=t.channelUrl,i=t.channelType;return (n=e.call(this)||this).method=exports.d.DELETE,n.path="".concat(We$1(i),"/").concat(encodeURIComponent(r),"/metacounter"),n.params=null,n}return t(t$1,e),t$1}(q);!function(e){function t$1(){return null!==e&&e.apply(this,arguments)||this}t(t$1,e);}(F);var it=function(e){function t$1(t){var n=this,r=t.channelUrl,i=t.channelType,a=t.userId,s=t.seconds,o=t.description;return (n=e.call(this)||this).method=exports.d.POST,n.path="".concat(We$1(i),"/").concat(encodeURIComponent(r),"/mute"),n.params={user_id:a,seconds:s,description:o},n}return t(t$1,e),t$1}(q);!function(e){function t$1(t,n){return e.call(this,t,n)||this}t(t$1,e);}(F);var at=function(e){function t$1(t,n,r){var i=e.call(this,t,"SYEV",r)||this;return i.user=new Ue(t,r.data),i}return t(t$1,e),t$1}(B),st=function(e){function t$1(t){var n=this,r=t.channelUrl,i=t.channelType,a=t.userId;return (n=e.call(this)||this).method=exports.d.DELETE,n.path="".concat(We$1(i),"/").concat(encodeURIComponent(r),"/mute/").concat(encodeURIComponent(a)),n}return t(t$1,e),t$1}(q);!function(e){function t$1(){return null!==e&&e.apply(this,arguments)||this}t(t$1,e);}(F);var ot=function(e){function t$1(t,n,r){var i=e.call(this,t,"SYEV",r)||this;return i.user=new Ue(t,r.data),i}return t(t$1,e),t$1}(B),ut=function(e){function t$1(t){var n=this,r=t.channelUrl,i=t.channelType,a=t.userId,s=t.seconds,o=t.description;return (n=e.call(this)||this).method=exports.d.POST,n.path="".concat(We$1(i),"/").concat(encodeURIComponent(r),"/ban"),n.params=U$1({user_id:a,seconds:s,description:o}),n}return t(t$1,e),t$1}(q);!function(e){function t$1(){return null!==e&&e.apply(this,arguments)||this}t(t$1,e);}(F);var ct=function(e){function t$1(t,n,r){var i=e.call(this,t,"SYEV",r)||this;return i.memberCount=null,i.joinedMemberCount=null,i.user=new Ue(t,r.data),r.data.member_count&&(i.memberCount=r.data.member_count),r.data.joined_member_count&&(i.joinedMemberCount=r.data.joined_member_count),i}return t(t$1,e),t$1}(B),lt=function(e){function t$1(t){var n=this,r=t.channelUrl,i=t.channelType,a=t.userId;return (n=e.call(this)||this).method=exports.d.DELETE,n.path="".concat(We$1(i),"/").concat(encodeURIComponent(r),"/ban/").concat(encodeURIComponent(a)),n}return t(t$1,e),t$1}(q);!function(e){function t$1(){return null!==e&&e.apply(this,arguments)||this}t(t$1,e);}(F);var dt=function(e){function t$1(t,n,r){var i=e.call(this,t,"SYEV",r)||this;return i.user=new Ue(t,r.data),i}return t(t$1,e),t$1}(B),ht=function(e){function t$1(t){var n=this,r=t.channelUrl,i=t.channelType,a=t.freezing;return (n=e.call(this)||this).method=exports.d.PUT,n.path="".concat(We$1(i),"/").concat(encodeURIComponent(r),"/freeze"),n.params={freeze:a},n}return t(t$1,e),t$1}(q);!function(e){function t$1(){return null!==e&&e.apply(this,arguments)||this}t(t$1,e);}(F);var pt=function(e){function t$1(t,n,r){var i=e.call(this,t,"SYEV",r)||this;return i.freeze=r.data.freeze,i}return t(t$1,e),t$1}(B),ft=function(e){function t$1(t){var n=this,r=t.channelUrl,i=t.channelType,a=t.category,s=t.userId,o=t.description;return (n=e.call(this)||this).method=exports.d.POST,n.path="".concat(Xe$1(i),"/").concat(encodeURIComponent(r)),n.params={report_category:a,reporting_user_id:s,report_description:o},n}return t(t$1,e),t$1}(q),mt=function(e){function t$1(t){var n=this,r=t.channelUrl,i=t.channelType,a=t.category,s=t.userId,o=t.offendingUserId,u=t.description;return (n=e.call(this)||this).method=exports.d.POST,n.path="/report/users/".concat(o),n.params={channel_url:r,channel_type:i===exports.ne.OPEN?"open_channels":"group_channels",report_category:a,reporting_user_id:s,report_description:u},n}return t(t$1,e),t$1}(q),vt=function(e){function t$1(t){var n=this,r=t.channelUrl,i=t.channelType,a=t.category,s=t.userId,o=t.offendingUserId,u=t.messageId,c=t.description;return (n=e.call(this)||this).method=exports.d.POST,n.path="".concat(Xe$1(i),"/").concat(encodeURIComponent(r),"/messages/").concat(u),n.params={report_category:a,reporting_user_id:s,report_description:c,offending_user_id:o},n}return t(t$1,e),t$1}(q),yt=function(t$1){function n(n){var r=[];return n.mentionType===exports.ae$1.USERS&&(n.mentionedUserIds?r=n.mentionedUserIds:n.mentionedUsers&&(r=n.mentionedUsers.map((function(e){return e.userId})))),t$1.call(this,{code:"MESG",ackRequired:!0,payload:U$1({channel_url:n.channelUrl,message:n.message,data:n.data,custom_type:n.customType,metaarray:n.metaArrays,mention_type:n.mentionType,mentioned_user_ids:r,mentioned_message_template:n.mentionedMessageTemplate,target_langs:n.translationTargetLanguages,push_option:n.pushNotificationDeliveryOption&&n.pushNotificationDeliveryOption!==ce$2.DEFAULT?n.pushNotificationDeliveryOption:void 0,apple_critical_alert_options:n.appleCriticalAlertOptions,silent:n.silent,reply_to_channel:n.isReplyToChannel,parent_message_id:n.parentMessageId>0?n.parentMessageId:null,req_id:n.reqId})})||this}return t(n,t$1),n}(H$1),gt=function(e){function t$1(t,n,r){var i,a,s,o=this;(o=e.call(this,t,"MESG",r)||this).message=new Vt(t,r);var u=St$1.of(t).sdkState;return o.isMentioned=Ye$1(o.message.mentionType,null!==(i=o.message.mentionedUserIds)&&void 0!==i?i:null===(a=o.message.mentionedUsers)||void 0===a?void 0:a.map((function(e){return e.userId})),u.userId),o.forceUpdateLastMessage=null!==(s=r.force_update_last_message)&&void 0!==s&&s,o}return t(t$1,e),t$1}(B),_t=function(t$1){function n(n){var r=[];return n.mentionType===exports.ae$1.USERS&&(n.mentionedUserIds?r=n.mentionedUserIds:n.mentionedUsers&&(r=n.mentionedUsers.map((function(e){return e.userId})))),t$1.call(this,{code:"MEDI",ackRequired:!0,payload:U$1({channel_url:n.channelUrl,msg_id:n.messageId,message:n.message,data:n.data,custom_type:n.customType,metaarray:n.metaArrayParams,mention_type:n.mentionType,mentioned_user_ids:r,mentioned_message_template:n.mentionedMessageTemplate,apple_critical_alert_options:n.appleCriticalAlertOptions})})||this}return t(n,t$1),n}(H$1),Tt=function(e){function t$1(t,n,r){var i,a,s,o,u,c,l=this;(l=e.call(this,t,"MEDI",r)||this).message=new Vt(t,r);var d=St$1.of(t).sdkState;return l.mentionCountChange=Je$1({mentionType:null!==(a=null===(i=r.old_values)||void 0===i?void 0:i.mention_type)&&void 0!==a?a:null,mentionedUserIds:null!==(o=null===(s=r.old_values)||void 0===s?void 0:s.mentioned_user_ids)&&void 0!==o?o:[]},{mentionType:l.message.mentionType,mentionedUserIds:null!==(u=l.message.mentionedUserIds)&&void 0!==u?u:null===(c=l.message.mentionedUsers)||void 0===c?void 0:c.map((function(e){return e.userId}))},d.userId),l}return t(t$1,e),t$1}(B),Ut=function(t$1){function n(n){var r=[];return n.mentionType===exports.ae$1.USERS&&(n.mentionedUserIds?r=n.mentionedUserIds:n.mentionedUsers&&(r=n.mentionedUsers.map((function(e){return e.userId})))),t$1.call(this,{code:"FEDI",ackRequired:!0,payload:U$1({channel_url:n.channelUrl,msg_id:n.messageId,data:n.data,custom_type:n.customType,metaarray:n.metaArrayParams,mention_type:n.mentionType,mentioned_user_ids:r,apple_critical_alert_options:n.appleCriticalAlertOptions})})||this}return t(n,t$1),n}(H$1),It=function(e){function t$1(t,n,r){var i,a,s,o,u,c,l=this;(l=e.call(this,t,"FEDI",r)||this).message=new Wt(t,r);var d=St$1.of(t).sdkState;return l.mentionCountChange=Je$1({mentionType:null!==(a=null===(i=r.old_values)||void 0===i?void 0:i.mention_type)&&void 0!==a?a:null,mentionedUserIds:null!==(o=null===(s=r.old_values)||void 0===s?void 0:s.mentioned_user_ids)&&void 0!==o?o:[]},{mentionType:l.message.mentionType,mentionedUserIds:null!==(u=l.message.mentionedUserIds)&&void 0!==u?u:null===(c=l.message.mentionedUsers)||void 0===c?void 0:c.map((function(e){return e.userId}))},d.userId),l}return t(t$1,e),t$1}(B),Et=function(e){function t$1(t){var n=e.call(this)||this;return n.method=exports.d.DELETE,n.path="".concat(We$1(t.channelType),"/").concat(t.channelUrl,"/messages/").concat(t.messageId),n}return t(t$1,e),t$1}(q);!function(e){function t$1(){return null!==e&&e.apply(this,arguments)||this}t(t$1,e);}(F);var wt=function(e){function t$1(t,n,r){var i=e.call(this,t,"DELM",r)||this;return i.channelUrl=r.channel_url,i.channelType=r.channel_type,i.messageId=Number(r.msg_id),i}return t(t$1,e),t$1}(B),Mt=function(e){function t$1(t){var n=t.channelType,r=t.channelUrl,i=t.messageId,a=t.reactionKey,s=e.call(this)||this;return s.method=exports.d.POST,s.path="".concat(We$1(n),"/").concat(encodeURIComponent(r),"/messages/").concat(i,"/reactions"),s.params={reaction:a},s}return t(t$1,e),t$1}(q),St=function(e){function t$1(t,n){var r=e.call(this,t,n)||this;return r.reactionEvent=new wt$1(n),r}return t(t$1,e),t$1}(F),Ct=function(e){function t$1(t){var n=t.channelType,r=t.channelUrl,i=t.messageId,a=t.reactionKey,s=e.call(this)||this;return s.method=exports.d.DELETE,s.path="".concat(We$1(n),"/").concat(encodeURIComponent(r),"/messages/").concat(i,"/reactions"),s.params={reaction:a},s}return t(t$1,e),t$1}(q),bt=function(e){function t$1(t,n){var r=e.call(this,t,n)||this;return r.reactionEvent=new wt$1(exports.n({},n)),r}return t(t$1,e),t$1}(F),At=function(e){function t$1(t){var n=t.channelType,r=t.channelUrl,i=t.messageId,a=t.translationTargetLanguages,s=e.call(this)||this;return s.method=exports.d.POST,s.path="".concat(We$1(n),"/").concat(encodeURIComponent(r),"/messages/").concat(encodeURIComponent(i),"/translation"),s.params={target_langs:a},s}return t(t$1,e),t$1}(q),Pt=function(e){function t$1(t,n){var r=e.call(this,t,n)||this;return r.message=new Vt(t,n),r}return t(t$1,e),t$1}(F),Dt=function(t$1){function n(n){var r,i=this;i=t$1.call(this)||this;var s=[];n.mentionType===exports.ae$1.USERS&&(n.mentionedUserIds?s=n.mentionedUserIds:n.mentionedUsers&&(s=n.mentionedUsers.map((function(e){return e.userId}))));var u=n.channelType,c=n.channelUrl;return i.method=exports.d.POST,i.path="".concat(We$1(u),"/").concat(encodeURIComponent(c),"/scheduled_messages"),i.params={req_id:n.reqId,scheduled_at:n.scheduledAt,message_type:exports.oe$1.USER,message:n.message,custom_type:n.customType,data:n.data,mention_type:n.mentionType,mentioned_user_ids:s,sorted_metaarray:null===(r=n.metaArrays)||void 0===r?void 0:r.map((function(e){return Dt$1.payloadify(e)})),apple_critical_alert_options:Lt.payloadify(n.appleCriticalAlertOptions),target_langs:n.translationTargetLanguages,push_option:n.pushNotificationDeliveryOption},i}return t(n,t$1),n}(q),Rt=function(e){function t$1(t,n){var r=e.call(this,t,n)||this;return r.message=new Vt(t,n),r}return t(t$1,e),t$1}(F),Nt=function(t$1){function n(n){var r,i=this;i=t$1.call(this)||this;var s=[];n.mentionType===exports.ae$1.USERS&&(n.mentionedUserIds?s=n.mentionedUserIds:n.mentionedUsers&&(s=n.mentionedUsers.map((function(e){return e.userId}))));var u=n.channelType,c=n.channelUrl;return i.method=exports.d.POST,i.path="".concat(We$1(u),"/").concat(encodeURIComponent(c),"/scheduled_messages"),i.params={req_id:n.reqId,scheduled_at:n.scheduledAt,message_type:exports.oe$1.FILE,url:n.fileUrl,file_name:n.fileName,file_size:n.fileSize,file_type:n.mimeType,thumbnails:n.thumbnailSizes?n.thumbnailSizes.map((function(e){return Gt.payloadify(e)})):[],custom_type:n.customType,data:n.data,require_auth:n.requireAuth,mention_type:n.mentionType,mentioned_user_ids:s,sorted_metaarray:null===(r=n.metaArrays)||void 0===r?void 0:r.map((function(e){return Dt$1.payloadify(e)})),apple_critical_alert_options:Lt.payloadify(n.appleCriticalAlertOptions),push_option:n.pushNotificationDeliveryOption},i}return t(n,t$1),n}(q),qt=function(e){function t$1(t,n){var r=e.call(this,t,n)||this;return r.message=new Wt(t,n),r}return t(t$1,e),t$1}(F),Ot=2,kt=function(e){function l(n,r){var a,s,o,u,c=this;return (c=e.call(this,n)||this).url="",c.channelType=exports.ne.BASE,c.name="",c.coverUrl="",c.customType="",c.data="",c.isFrozen=!1,c.isEphemeral=!1,c.creator=null,c.createdAt=0,c.url=r.channel_url,c.name=null!==(a=r.name)&&void 0!==a?a:"",c.coverUrl=null!==(s=r.cover_url)&&void 0!==s?s:"",c.customType=null!==(o=r.custom_type)&&void 0!==o?o:"",c.data=null!==(u=r.data)&&void 0!==u?u:"",c.isFrozen=!!y("boolean",r.freeze)&&r.freeze,c.isEphemeral=!!y("boolean",r.is_ephemeral)&&r.is_ephemeral,c.creator=r.created_by?new ct$1(c._iid,r.created_by):null,c.createdAt=1e3*r.created_at,c._cachedMetaData=new Map,r.metadata&&r.ts&&Object.keys(r.metadata).forEach((function(e){c._cachedMetaData.set(e,{value:r.metadata[e],isRemoved:!1,updatedAt:r.ts});})),c}return t(l,e),l.payloadify=function(t){return U$1(exports.n(exports.n({},e.payloadify.call(this,t)),{channel_url:t.url,name:t.name,cover_url:t.coverUrl,custom_type:t.customType,data:t.data,freeze:t.isFrozen,is_ephemeral:t.isEphemeral,created_by:ct$1.payloadify(t.creator),created_at:t.createdAt/1e3}))},l.prototype.isGroupChannel=function(){return this.channelType===exports.ne.GROUP},l.prototype.isOpenChannel=function(){return this.channelType===exports.ne.OPEN},Object.defineProperty(l.prototype,"cachedMetaData",{get:function(){var e={};return this._cachedMetaData.forEach((function(t,n){t.isRemoved||(e[n]=t.value);})),e},enumerable:!1,configurable:!0}),l.prototype._upsertCachedMetaData=function(e,t){var n=this;Object.keys(e).forEach((function(r){var i=n._cachedMetaData.get(r);(!i||i.updatedAt<=t)&&n._cachedMetaData.set(r,{value:e[r],isRemoved:!1,updatedAt:t});}));},l.prototype._removeFromCachedMetaData=function(e,t){var n=this;e.forEach((function(e){var r=n._cachedMetaData.get(e);r&&r.updatedAt<t&&(r.isRemoved=!1,r.updatedAt=t);}));},l.prototype._generateRequestId=function(){return "rq-".concat(R())},l.prototype.isIdentical=function(e){return e&&this.url===e.url},l.prototype.isEqual=function(e){return g(this,e)},l.prototype.createOperatorListQuery=function(e){return void 0===e&&(e={}),new Ae$1(this._iid,this.url,this.channelType,e)},l.prototype.createMutedUserListQuery=function(e){return void 0===e&&(e={}),new Re(this._iid,this.url,this.channelType,e)},l.prototype.createBannedUserListQuery=function(e){return void 0===e&&(e={}),new Oe(this._iid,this.url,this.channelType,e)},l.prototype.createPreviousMessageListQuery=function(e){return void 0===e&&(e={}),new wn(this._iid,this.url,this.channelType,e)},l.prototype.addOperators=function(e){return r(this,void 0,void 0,(function(){var t,n;return i(this,(function(i){switch(i.label){case 0:return at$1(E("string",e)).throw(p.invalidParameters),t=St$1.of(this._iid).requestQueue,n=new ke({channelUrl:this.url,channelType:this.channelType,operatorUserIds:e}),[4,t.send(n)];case 1:return i.sent(),[2]}}))}))},l.prototype.removeOperators=function(e){return r(this,void 0,void 0,(function(){var t,n;return i(this,(function(i){switch(i.label){case 0:return at$1(E("string",e)).throw(p.invalidParameters),t=St$1.of(this._iid).requestQueue,n=new Fe({channelUrl:this.url,channelType:this.channelType,operatorUserIds:e}),[4,t.send(n)];case 1:return i.sent(),[2]}}))}))},l.prototype.getMyMutedInfo=function(){return r(this,void 0,void 0,(function(){var e,t,n,r,i$1,a,s,o,u,c,l;return i(this,(function(d){switch(d.label){case 0:return e=St$1.of(this._iid),t=e.sdkState,n=e.requestQueue,r=new Le({channelUrl:this.url,channelType:this.channelType,userId:t.userId}),[4,n.send(r)];case 1:return i$1=d.sent(),a=i$1.as(Qe),s=a.isMuted,o=a.startAt,u=a.endAt,c=a.remainingDuration,l=a.description,[2,{isMuted:s,startAt:o,endAt:u,remainingDuration:c,description:l}]}}))}))},l.prototype.getMetaData=function(e){return r(this,void 0,void 0,(function(){var t,n,i$1,a,s,o;return i(this,(function(u){switch(u.label){case 0:return at$1(E("string",e)).throw(p.invalidParameters),t=St$1.of(this._iid).requestQueue,n=new ze({channelUrl:this.url,channelType:this.channelType,keys:e}),[4,t.send(n)];case 1:return i$1=u.sent(),a=i$1.as(Ge),s=a.metadata,o=a.ts,this._upsertCachedMetaData(s,o),[2,s]}}))}))},l.prototype.getAllMetaData=function(){return r(this,void 0,void 0,(function(){var e,t,n,r,i$1,a;return i(this,(function(s){switch(s.label){case 0:return e=St$1.of(this._iid).requestQueue,t=new ze({channelUrl:this.url,channelType:this.channelType,keys:[]}),[4,e.send(t)];case 1:return n=s.sent(),r=n.as(Ge),i$1=r.metadata,a=r.ts,this._upsertCachedMetaData(i$1,a),[2,i$1]}}))}))},l.prototype.createMetaData=function(e){return r(this,void 0,void 0,(function(){var t,n,r,i$1;return i(this,(function(a){switch(a.label){case 0:return t=St$1.of(this._iid).requestQueue,n=new Ze$1({channelUrl:this.url,channelType:this.channelType,metadata:e}),[4,t.send(n)];case 1:return r=a.sent(),i$1=r.as($e$1).metaData,this._upsertCachedMetaData(i$1,0),[2,i$1]}}))}))},l.prototype.updateMetaData=function(e,t){return void 0===t&&(t=!1),r(this,void 0,void 0,(function(){var n,r,i$1,a,s,o;return i(this,(function(u){switch(u.label){case 0:return n=St$1.of(this._iid).requestQueue,r=new xe({channelUrl:this.url,channelType:this.channelType,metadata:e,upsert:t}),[4,n.send(r)];case 1:return i$1=u.sent(),a=i$1.as(Ve),s=a.metadata,o=a.ts,this._upsertCachedMetaData(s,o),[2,s]}}))}))},l.prototype.deleteMetaData=function(e){return r(this,void 0,void 0,(function(){var n,r,i$1,a;return i(this,(function(s){switch(s.label){case 0:return at$1(y("string",e)).throw(p.invalidParameters),n=St$1.of(this._iid).requestQueue,r=new Be({channelUrl:this.url,channelType:this.channelType,key:e}),[4,n.send(r)];case 1:return i$1=s.sent(),a=i$1.as(We).ts,this._removeFromCachedMetaData([e],a),[2]}}))}))},l.prototype.deleteAllMetaData=function(){return r(this,void 0,void 0,(function(){var e,t,n,r;return i(this,(function(i){switch(i.label){case 0:return e=St$1.of(this._iid).requestQueue,t=new Ke({channelUrl:this.url,channelType:this.channelType}),[4,e.send(t)];case 1:return n=i.sent(),r=n.as(Ye).ts,this._removeFromCachedMetaData(a([],o(this._cachedMetaData.keys()),!1),r),[2]}}))}))},l.prototype.getMetaCounters=function(e){return r(this,void 0,void 0,(function(){var t,n,i$1;return i(this,(function(a){switch(a.label){case 0:return at$1(E("string",e)).throw(p.invalidParameters),t=St$1.of(this._iid).requestQueue,n=new He({channelUrl:this.url,channelType:this.channelType,keys:e}),[4,t.send(n)];case 1:return i$1=a.sent(),[2,i$1.as(Je).metaCounter]}}))}))},l.prototype.getAllMetaCounters=function(){return r(this,void 0,void 0,(function(){var e,t,n;return i(this,(function(r){switch(r.label){case 0:return e=St$1.of(this._iid).requestQueue,t=new He({channelUrl:this.url,channelType:this.channelType,keys:[]}),[4,e.send(t)];case 1:return n=r.sent(),[2,n.as(Je).metaCounter]}}))}))},l.prototype.createMetaCounters=function(e){return r(this,void 0,void 0,(function(){var t,n,r;return i(this,(function(i){switch(i.label){case 0:return t=St$1.of(this._iid).requestQueue,n=new Xe({channelUrl:this.url,channelType:this.channelType,metaCounter:e}),[4,t.send(n)];case 1:return r=i.sent(),[2,r.as(Ze).metaCounter]}}))}))},l.prototype.updateMetaCounters=function(e,t){return void 0===t&&(t=!1),r(this,void 0,void 0,(function(){var n,r,i$1;return i(this,(function(a){switch(a.label){case 0:return n=St$1.of(this._iid).requestQueue,r=new $e({channelUrl:this.url,channelType:this.channelType,metaCounter:e,upsert:t}),[4,n.send(r)];case 1:return i$1=a.sent(),[2,i$1.as(et).metaCounter]}}))}))},l.prototype.increaseMetaCounters=function(e){return r(this,void 0,void 0,(function(){var t,n,r;return i(this,(function(i){switch(i.label){case 0:return t=St$1.of(this._iid).requestQueue,n=new $e({channelUrl:this.url,channelType:this.channelType,metaCounter:e,upsert:!1,mode:"increase"}),[4,t.send(n)];case 1:return r=i.sent(),[2,r.as(et).metaCounter]}}))}))},l.prototype.decreaseMetaCounters=function(e){return r(this,void 0,void 0,(function(){var t,n,r;return i(this,(function(i){switch(i.label){case 0:return t=St$1.of(this._iid).requestQueue,n=new $e({channelUrl:this.url,channelType:this.channelType,metaCounter:e,upsert:!1,mode:"decrease"}),[4,t.send(n)];case 1:return r=i.sent(),[2,r.as(et).metaCounter]}}))}))},l.prototype.deleteMetaCounter=function(e){return r(this,void 0,void 0,(function(){var n,r;return i(this,(function(i){switch(i.label){case 0:return at$1(y("string",e)).throw(p.invalidParameters),n=St$1.of(this._iid).requestQueue,r=new nt({channelUrl:this.url,channelType:this.channelType,key:e}),[4,n.send(r)];case 1:return i.sent(),[2]}}))}))},l.prototype.deleteAllMetaCounters=function(){return r(this,void 0,void 0,(function(){var e,t;return i(this,(function(n){switch(n.label){case 0:return e=St$1.of(this._iid).requestQueue,t=new rt({channelUrl:this.url,channelType:this.channelType}),[4,e.send(t)];case 1:return n.sent(),[2]}}))}))},l.prototype.muteUser=function(e,t,n){return r(this,void 0,void 0,(function(){return i(this,(function(r){return [2,this.muteUserWithUserId(e.userId,t,n)]}))}))},l.prototype.muteUserWithUserId=function(e,n,r$1){return r(this,void 0,void 0,(function(){var i$1,a;return i(this,(function(s){switch(s.label){case 0:return at$1(y("string",e)&&y("number",n,!0)&&y("string",r$1,!0)).throw(p.invalidParameters),i$1=St$1.of(this._iid).requestQueue,a=new it({channelUrl:this.url,channelType:this.channelType,userId:e,seconds:n,description:r$1}),[4,i$1.send(a)];case 1:return s.sent(),[2]}}))}))},l.prototype.unmuteUser=function(e){return r(this,void 0,void 0,(function(){return i(this,(function(t){return [2,this.unmuteUserWithUserId(e.userId)]}))}))},l.prototype.unmuteUserWithUserId=function(e){return r(this,void 0,void 0,(function(){var n,r;return i(this,(function(i){switch(i.label){case 0:return at$1(y("string",e)).throw(p.invalidParameters),n=St$1.of(this._iid).requestQueue,r=new st({channelUrl:this.url,channelType:this.channelType,userId:e}),[4,n.send(r)];case 1:return i.sent(),[2]}}))}))},l.prototype.banUser=function(e,t,n){return r(this,void 0,void 0,(function(){return i(this,(function(r){return [2,this.banUserWithUserId(e.userId,t,n)]}))}))},l.prototype.banUserWithUserId=function(e,n,r$1){return r(this,void 0,void 0,(function(){var i$1,a;return i(this,(function(s){switch(s.label){case 0:return at$1(y("string",e)&&y("number",n,!0)&&y("string",r$1,!0)).throw(p.invalidParameters),i$1=St$1.of(this._iid).requestQueue,a=new ut({channelUrl:this.url,channelType:this.channelType,userId:e,seconds:n,description:r$1}),[4,i$1.send(a)];case 1:return s.sent(),[2]}}))}))},l.prototype.unbanUser=function(e){return r(this,void 0,void 0,(function(){return i(this,(function(t){return [2,this.unbanUserWithUserId(e.userId)]}))}))},l.prototype.unbanUserWithUserId=function(e){return r(this,void 0,void 0,(function(){var n,r;return i(this,(function(i){switch(i.label){case 0:return at$1(y("string",e)).throw(p.invalidParameters),n=St$1.of(this._iid).requestQueue,r=new lt({channelUrl:this.url,channelType:this.channelType,userId:e}),[4,n.send(r)];case 1:return i.sent(),[2]}}))}))},l.prototype.freeze=function(){return r(this,void 0,void 0,(function(){var e,t;return i(this,(function(n){switch(n.label){case 0:return e=St$1.of(this._iid).requestQueue,t=new ht({channelUrl:this.url,channelType:this.channelType,freezing:!0}),[4,e.send(t)];case 1:return n.sent(),this.isFrozen=!0,[2]}}))}))},l.prototype.unfreeze=function(){return r(this,void 0,void 0,(function(){var e,t;return i(this,(function(n){switch(n.label){case 0:return e=St$1.of(this._iid).requestQueue,t=new ht({channelUrl:this.url,channelType:this.channelType,freezing:!1}),[4,e.send(t)];case 1:return n.sent(),this.isFrozen=!1,[2]}}))}))},l.prototype.getMessagesByTimestamp=function(e,n){return r(this,void 0,void 0,(function(){return i(this,(function(r){switch(r.label){case 0:return n=exports.n(exports.n({},tn),n),at$1(y("number",e)&&nn(n)).throw(p.invalidParameters),[4,En.of(this._iid).getMessagesByTimestamp(this.url,this.channelType,e,n)];case 1:return [2,r.sent()]}}))}))},l.prototype.getMessageChangeLogsSinceTimestamp=function(e,n){return r(this,void 0,void 0,(function(){return i(this,(function(r){switch(r.label){case 0:return n=exports.n(exports.n({},rn),n),at$1(y("number",e)&&sn(n)).throw(p.invalidParameters),[4,En.of(this._iid).getMessageChangelogs(this.url,this.channelType,e,n)];case 1:return [2,r.sent()]}}))}))},l.prototype.getMessageChangeLogsSinceToken=function(e,n){return r(this,void 0,void 0,(function(){return i(this,(function(r){switch(r.label){case 0:return n=exports.n(exports.n({},rn),n),at$1(y("string",e)&&sn(n)).throw(p.invalidParameters),[4,En.of(this._iid).getMessageChangelogs(this.url,this.channelType,e,n)];case 1:return [2,r.sent()]}}))}))},l.prototype._createPendingSendableMessagePayload=function(e,t,n){var r=St$1.of(this._iid).sessionManager;return U$1({channel_url:this.url,channel_type:this.channelType,msg_id:0,parent_message_id:e.parentMessageId,data:e.data,custom_type:e.customType,mention_type:e.mentionType,sorted_metaarray:e.metaArrays?e.metaArrays.map((function(e){return Dt$1.payloadify(e)})):null,apple_critical_alert_options:e.appleCriticalAlertOptions?Lt.payloadify(e.appleCriticalAlertOptions):null,created_at:n,user:Ft.payloadify(r.currentUser),req_id:t,request_state:exports.le.PENDING,mentioned_user_ids:e.mentionedUserIds,mentioned_users:e.mentionedUsers})},l.prototype._createPendingUserMessage=function(e,t,n){var r,i,a={};if(e.translationTargetLanguages)try{for(var s$1=s(e.translationTargetLanguages),o=s$1.next();!o.done;o=s$1.next()){a[o.value]="";}}catch(e){r={error:e};}finally{try{o&&!o.done&&(i=s$1.return)&&i.call(s$1);}finally{if(r)throw r.error}}var l=U$1(exports.n(exports.n({},this._createPendingSendableMessagePayload(e,t,n)),{type:ie$1.USER,message:e.message,translations:a})),d=new Vt(this._iid,l);return d.messageParams=e,d},l.prototype._createPendingScheduledUserMessage=function(e,t,n){var r=this._createPendingUserMessage(e,t,n);return r.scheduledInfo={scheduledMessageId:0,scheduledAt:e.scheduledAt,scheduledMessageParams:e},r},l.prototype._createPendingFileMessage=function(e,t,n){var r=U$1(exports.n(exports.n({},this._createPendingSendableMessagePayload(e,t,n)),{type:ie$1.FILE,url:e.fileUrl,file:{name:e.fileName,size:e.fileSize,type:e.mimeType,data:e.data},thumbnails:e.thumbnailSizes?e.thumbnailSizes.map((function(e){return {url:"",width:e.maxWidth,height:e.maxHeight}})):[]})),i=new Wt(this._iid,r);return i.messageParams=e,i},l.prototype._createPendingScheduledFileMessage=function(e,t,n){var r=this._createPendingFileMessage(e,t,n);return r.scheduledInfo={scheduledMessageId:0,scheduledAt:e.scheduledAt,scheduledMessageParams:e},r},l.prototype._markMessageAsFailed=function(e,t,n){void 0===n&&(n=!1),e.errorCode=t.code,t.code===u.REQUEST_CANCELED?e.sendingStatus=exports.le.CANCELED:n||(e.sendingStatus=exports.le.FAILED);},l.prototype.sendUserMessage=function(e){return e=exports.n(exports.n({},de$1),e),at$1(he$1(e)).throw(p.invalidParameters),this._sendUserMessage(e)},l.prototype._sendUserMessage=function(e,t,n){var r$1=this;void 0===t&&(t=Date.now()),void 0===n&&(n=null);var i$1=St$1.of(this._iid),a=i$1.dispatcher,s=i$1.requestQueue,o=n,c=new In;if(!o){o=this._generateRequestId();var l=St$1.of(this._iid).dispatcher;me$2(2).then((function(){var n=r$1._createPendingUserMessage(e,o,t);l.dispatch(new un({messages:[n],source:exports.$t.EVENT_MESSAGE_SENT_PENDING})),Ie$1((function(){return r(r$1,void 0,void 0,(function(){return i(this,(function(e){return [2,c._trigger(null,n)]}))}))}));}));}var d=new yt(exports.n({channelUrl:this.url,channelType:this.channelType,reqId:o},e));return s.send(d).then((function(e){var t=e.as(gt).message;a.dispatch(new un({messages:[t],source:exports.$t.EVENT_MESSAGE_SENT_SUCCESS})),Ie$1((function(){return r(r$1,void 0,void 0,(function(){return i(this,(function(e){return [2,c._trigger(null,t)]}))}))}));})).catch((function(n){if(h$1(n))throw n;me$2(2).then((function(){var i$1=r$1._createPendingUserMessage(e,o,t),s=St$1.of(r$1._iid).cacheContext.localCacheEnabled&&I(n.code);r$1._markMessageAsFailed(i$1,n,s),a.dispatch(new un({messages:[i$1],source:i$1.sendingStatus===exports.le.PENDING?exports.$t.REQUEST_RESEND_MESSAGE:exports.$t.EVENT_MESSAGE_SENT_FAILED})),Ie$1((function(){return r(r$1,void 0,void 0,(function(){return i(this,(function(e){return [2,c._trigger(n,i$1)]}))}))}));}));})),c},l.prototype._autoResendUserMessage=function(e){return at$1(e instanceof Vt).throw(p.invalidParameters),this._sendUserMessage(e.messageParams,e.createdAt,e.reqId)},l.prototype.resendUserMessage=function(e){var t;return r(this,void 0,void 0,(function(){var n,r;return i(this,(function(i){var a;return at$1(e instanceof Vt&&!e.scheduledInfo).throw(p.invalidParameters),n=new ee$1,r=null!==(t=e.messageParams)&&void 0!==t?t:U$1({data:(a=e).data,customType:a.customType,mentionType:a.mentionType,mentionedUsers:a.mentionedUsers,mentionedUserIds:a.mentionedUserIds,mentionedMessageTemplate:a.mentionedMessageTemplate,metaArrays:a.metaArrays,parentMessageId:a.parentMessageId,appleCriticalAlertOptions:a.appleCriticalAlertOptions,message:a.message,translationTargetLanguages:Object.keys(a.translations)}),this._sendUserMessage(r).onFailed((function(e){return n.reject(e)})).onSucceeded((function(e){return n.resolve(e)})),[2,n.promise]}))}))},l.prototype.updateUserMessage=function(e,n){return r(this,void 0,void 0,(function(){var r,i$1,a,s,o,c;return i(this,(function(l){switch(l.label){case 0:return n=exports.n(exports.n({},we),n),at$1(y("number",e)&&Me(n)).throw(p.invalidParameters),r=St$1.of(this._iid),i$1=r.dispatcher,a=r.requestQueue,s=new _t(exports.n({channelType:this.channelType,channelUrl:this.url,messageId:e},n)),[4,a.send(s)];case 1:return o=l.sent(),c=o.as(Tt).message,i$1.dispatch(new un({messages:[c],source:exports.$t.EVENT_MESSAGE_UPDATED})),[2,c]}}))}))},l.prototype.copyUserMessage=function(e,t){var n,r$1,i$1;return r(this,void 0,void 0,(function(){var a,o;return i(this,(function(c){return at$1(e instanceof l&&t instanceof Vt&&t.sendingStatus===exports.le.SUCCEEDED&&e.url===t.channelUrl&&!t.scheduledInfo).throw(p.invalidParameters),a=new ee$1,o=null!==(n=t.messageParams)&&void 0!==n?n:exports.n(exports.n({},t),{mentionType:t.mentionType,mentionedUserIds:null!==(r$1=t.mentionedUserIds)&&void 0!==r$1?r$1:null===(i$1=t.mentionedUsers)||void 0===i$1?void 0:i$1.map((function(e){return e.userId})),translationTargetLanguages:Object.keys(t.translations),pushNotificationDeliveryOption:ce$2.DEFAULT,parentMessageId:null,isReplyToChannel:!1}),e._sendUserMessage(o).onSucceeded((function(e){return a.resolve(e)})).onFailed((function(e){return a.reject(e)})),[2,a.promise]}))}))},l.prototype.translateUserMessage=function(e,t){return r(this,void 0,void 0,(function(){var n,i$1,a;return i(this,(function(s){switch(s.label){case 0:return at$1(e instanceof Vt&&e.messageId>0&&E("string",t)).throw(p.invalidParameters),n=St$1.of(this._iid).requestQueue,i$1=new At({channelType:this.channelType,channelUrl:this.url,messageId:e.messageId,translationTargetLanguages:t}),[4,n.send(i$1)];case 1:return a=s.sent(),[2,a.as(Pt).message]}}))}))},l.prototype._createScheduledUserMessage=function(e,t){var n=this,r$1=St$1.of(this._iid),i$1=r$1.dispatcher,a=r$1.requestQueue,s=Date.now(),o=this._generateRequestId();me$2(2).then((function(){var r$1=n._createPendingScheduledUserMessage(e,o,s);i$1.dispatch(new un({messages:[r$1],source:exports.$t.EVENT_MESSAGE_SENT_PENDING})),Ie$1((function(){return r(n,void 0,void 0,(function(){return i(this,(function(e){return [2,t._trigger(null,r$1)]}))}))}));}));var c=new Dt(exports.n({reqId:o,channelType:this.channelType,channelUrl:this.url},e));a.send(c).then((function(e){var r$1=e.as(Rt).message;i$1.dispatch(new un({messages:[r$1],source:exports.$t.EVENT_MESSAGE_SENT_SUCCESS})),Ie$1((function(){return r(n,void 0,void 0,(function(){return i(this,(function(e){return [2,t._trigger(null,r$1)]}))}))}));})).catch((function(r$1){if(h$1(r$1))throw r$1;me$2(2).then((function(){var a=n._createPendingScheduledUserMessage(e,o,s);n._markMessageAsFailed(a,r$1),i$1.dispatch(new un({messages:[a],source:exports.$t.EVENT_MESSAGE_SENT_FAILED})),Ie$1((function(){return r(n,void 0,void 0,(function(){return i(this,(function(e){return [2,t._trigger(r$1,a)]}))}))}));}));}));},l.prototype.sendFileMessage=function(e){return e=exports.n(exports.n({},ye$1),e),at$1(ge$1(e)).throw(p.invalidParameters),this._sendFileMessage(e)},l.prototype._sendFileMessage=function(e,t,n){var r$1=this;void 0===t&&(t=Date.now()),void 0===n&&(n=null);var i$1=St$1.of(this._iid).dispatcher,a=En.of(this._iid).fileMessageQueue,s=n,o=new In;return s||(s=this._generateRequestId(),me$2(2).then((function(){var n=r$1._createPendingFileMessage(e,s,t);i$1.dispatch(new un({messages:[n],source:exports.$t.EVENT_MESSAGE_SENT_PENDING})),Ie$1((function(){return r(r$1,void 0,void 0,(function(){return i(this,(function(e){return [2,o._trigger(null,n)]}))}))}));}))),a.request(this,s,e).then((function(e){i$1.dispatch(new un({messages:[e],source:exports.$t.EVENT_MESSAGE_SENT_SUCCESS})),Ie$1((function(){return r(r$1,void 0,void 0,(function(){return i(this,(function(t){return [2,o._trigger(null,e)]}))}))}));})).catch((function(n){if(h$1(n))throw n;me$2(2).then((function(){var a=r$1._createPendingFileMessage(e,s,t),u=St$1.of(r$1._iid).cacheContext.localCacheEnabled&&I(n.code);r$1._markMessageAsFailed(a,n,u),i$1.dispatch(new un({messages:[a],source:a.sendingStatus===exports.le.PENDING?exports.$t.REQUEST_RESEND_MESSAGE:exports.$t.EVENT_MESSAGE_SENT_FAILED})),Ie$1((function(){return r(r$1,void 0,void 0,(function(){return i(this,(function(e){return [2,o._trigger(n,a)]}))}))}));}));})),o},l.prototype._autoResendFileMessage=function(e){at$1(e instanceof Wt).throw(p.invalidParameters);var t=St$1.of(this._iid).logger;return t.debug("autoResendFileMessage pending",e),this._sendFileMessage(e.messageParams,e.createdAt,e.reqId).onFailed((function(e){t.debug("autoResendFileMessage failed",e);})).onSucceeded((function(e){t.debug("autoResendFileMessage success",e);}))},l.prototype._createScheduledFileMessage=function(e,t,n,r$1){var i$1=this,a=St$1.of(this._iid),s=a.dispatcher,o=a.requestQueue,c=new Nt(exports.n(exports.n({reqId:n,channelType:this.channelType,channelUrl:this.url},e),{fileUrl:e.fileUrl,requireAuth:e.requireAuth}));o.send(c).then((function(e){var n=e.as(qt).message;s.dispatch(new un({messages:[n],source:exports.$t.EVENT_MESSAGE_SENT_SUCCESS})),Ie$1((function(){return r(i$1,void 0,void 0,(function(){return i(this,(function(e){return [2,t._trigger(null,n)]}))}))}));})).catch((function(a){if(h$1(a))throw a;me$2(2).then((function(){var o=i$1._createPendingScheduledFileMessage(e,n,r$1);i$1._markMessageAsFailed(o,a),s.dispatch(new un({messages:[o],source:exports.$t.EVENT_MESSAGE_SENT_FAILED})),Ie$1((function(){return r(i$1,void 0,void 0,(function(){return i(this,(function(e){return [2,t._trigger(a,o)]}))}))}));}));}));},l.prototype.sendFileMessages=function(e){var t,n;at$1(e.every((function(e){return ge$1(exports.n(exports.n({},ye$1),e))}))).throw(p.invalidParameters);var r=new In;try{for(var i=s(e),a=i.next();!a.done;a=i.next()){var s$1=a.value;this.sendFileMessage(s$1).onPending((function(e){return r._trigger(null,e)})).onFailed((function(e,t){return r._trigger(e,t)})).onSucceeded((function(e){return r._trigger(null,e)}));}}catch(e){t={error:e};}finally{try{a&&!a.done&&(n=i.return)&&n.call(i);}finally{if(t)throw t.error}}return r},l.prototype.resendFileMessage=function(e,t){var n;return r(this,void 0,void 0,(function(){var r,i$1;return i(this,(function(a){return at$1(e instanceof Wt&&t instanceof Blob&&!e.scheduledInfo).throw(p.invalidParameters),r=new ee$1,i$1=null!==(n=e.messageParams)&&void 0!==n?n:function(e,t){return void 0===t&&(t=null),U$1({data:e.data,customType:e.customType,mentionType:e.mentionType,mentionedUsers:e.mentionedUsers,mentionedUserIds:e.mentionedUserIds,metaArrays:e.metaArrays,parentMessageId:e.parentMessageId,appleCriticalAlertOptions:e.appleCriticalAlertOptions,file:t,fileUrl:e.url,fileName:e.name,fileSize:e.size,mimeType:e.type,thumbnailSizes:e.thumbnails.map((function(e){return {maxWidth:e.width,maxHeight:e.height}}))})}(e,t),this._sendFileMessage(i$1).onFailed((function(e){return r.reject(e)})).onSucceeded((function(e){return r.resolve(e)})),[2,r.promise]}))}))},l.prototype.updateFileMessage=function(e,n){return r(this,void 0,void 0,(function(){var r,i$1,a,s,o,c;return i(this,(function(l){switch(l.label){case 0:return n=exports.n(exports.n({},Se),n),at$1(y("number",e)&&function(e){return Ee$1(e)}(n)).throw(p.invalidParameters),r=St$1.of(this._iid),i$1=r.dispatcher,a=r.requestQueue,s=new Ut(exports.n({channelType:this.channelType,channelUrl:this.url,messageId:e},n)),[4,a.send(s)];case 1:return o=l.sent(),c=o.as(It).message,i$1.dispatch(new un({messages:[c],source:exports.$t.EVENT_MESSAGE_UPDATED})),[2,c]}}))}))},l.prototype.cancelUploadingFileMessage=function(e){return r(this,void 0,void 0,(function(){return i(this,(function(n){return at$1(y("string",e)).throw(p.invalidParameters),En.of(this._iid).fileMessageQueue.cancel(this,e),[2,!0]}))}))},l.prototype.copyFileMessage=function(e,t){var n,r$1;return r(this,void 0,void 0,(function(){var i$1,a;return i(this,(function(o){return at$1(e instanceof l&&t instanceof Wt&&t.sendingStatus===exports.le.SUCCEEDED&&e.url===t.channelUrl&&!t.scheduledInfo).throw(p.invalidParameters),i$1=new ee$1,a=exports.n(exports.n({},t),{fileUrl:t.url,fileName:t.name,fileSize:t.size,mimeType:t.type,mentionType:t.mentionType,mentionedUserIds:null!==(n=t.mentionedUserIds)&&void 0!==n?n:null===(r$1=t.mentionedUsers)||void 0===r$1?void 0:r$1.map((function(e){return e.userId})),pushNotificationDeliveryOption:ce$2.DEFAULT,parentMessageId:null,isReplyToChannel:!1,thumbnailSizes:t.thumbnails.map((function(e){return {maxWidth:e.width,maxHeight:e.height}})),requireAuth:t.requireAuth}),e._sendFileMessage(a).onSucceeded((function(e){return i$1.resolve(e)})).onFailed((function(e){return i$1.reject(e)})),[2,i$1.promise]}))}))},l.prototype.deleteMessage=function(e){return r(this,void 0,void 0,(function(){var t,n;return i(this,(function(r){switch(r.label){case 0:return at$1(e instanceof xt).throw(p.invalidParameters),e.messageId>0?(t=St$1.of(this._iid).requestQueue,n=new Et({channelType:this.channelType,channelUrl:this.url,messageId:e.messageId}),[4,t.send(n)]):[3,2];case 1:r.sent(),r.label=2;case 2:return [2]}}))}))},l.prototype.addReaction=function(e,n){return r(this,void 0,void 0,(function(){var r,i$1,a;return i(this,(function(s){switch(s.label){case 0:return at$1(e instanceof qt$1&&e.messageId>0&&y("string",n)).throw(p.invalidParameters),r=St$1.of(this._iid).requestQueue,i$1=new Mt({channelType:this.channelType,channelUrl:this.url,messageId:e.messageId,reactionKey:n}),[4,r.send(i$1)];case 1:return a=s.sent(),[2,a.as(St).reactionEvent]}}))}))},l.prototype.deleteReaction=function(e,n){return r(this,void 0,void 0,(function(){var r,i$1,a;return i(this,(function(s){switch(s.label){case 0:return at$1(e instanceof qt$1&&e.messageId>0&&y("string",n)).throw(p.invalidParameters),r=St$1.of(this._iid).requestQueue,i$1=new Ct({channelType:this.channelType,channelUrl:this.url,messageId:e.messageId,reactionKey:n}),[4,r.send(i$1)];case 1:return a=s.sent(),[2,a.as(bt).reactionEvent]}}))}))},l.prototype._updateMessageMetaArray=function(e,t,n,r$1){return r(this,void 0,void 0,(function(){var i$1,a,s,o,u,c;return i(this,(function(l){switch(l.label){case 0:return i$1=St$1.of(this._iid),a=i$1.dispatcher,s=i$1.requestQueue,o=new _t({channelType:this.channelType,channelUrl:this.url,messageId:e,metaArrayParams:{array:t,mode:n,upsert:r$1}}),[4,s.send(o)];case 1:return u=l.sent(),c=u.as(Tt).message,a.dispatch(new un({messages:[c],source:exports.$t.EVENT_MESSAGE_UPDATED})),[2,c]}}))}))},l.prototype.createMessageMetaArrayKeys=function(e,t){return r(this,void 0,void 0,(function(){var n;return i(this,(function(i){return at$1(e instanceof xt&&e.messageId>0&&E("string",t)).throw(p.invalidParameters),n=t.map((function(e){return new Dt$1({key:e})})),[2,this._updateMessageMetaArray(e.messageId,n,"add",!0)]}))}))},l.prototype.deleteMessageMetaArrayKeys=function(e,t){return r(this,void 0,void 0,(function(){var n;return i(this,(function(i){return at$1(e instanceof xt&&e.messageId>0&&E("string",t)).throw(p.invalidParameters),n=t.map((function(e){return new Dt$1({key:e})})),[2,this._updateMessageMetaArray(e.messageId,n,"remove",!0)]}))}))},l.prototype.addMessageMetaArrayValues=function(e,t){return r(this,void 0,void 0,(function(){return i(this,(function(n){return at$1(e instanceof xt&&e.messageId>0&&t.every((function(e){return e instanceof Dt$1}))).throw(p.invalidParameters),[2,this._updateMessageMetaArray(e.messageId,t,"add",!0)]}))}))},l.prototype.removeMessageMetaArrayValues=function(e,t){return r(this,void 0,void 0,(function(){return i(this,(function(n){return at$1(e instanceof xt&&e.messageId>0&&t.every((function(e){return e instanceof Dt$1}))).throw(p.invalidParameters),[2,this._updateMessageMetaArray(e.messageId,t,"remove",!0)]}))}))},l.prototype.report=function(e,r$1){return r(this,void 0,void 0,(function(){var i$1,a,s,o;return i(this,(function(u){switch(u.label){case 0:return at$1(m(_e$1,e)&&y("string",r$1)).throw(p.invalidParameters),i$1=St$1.of(this._iid),a=i$1.sdkState,s=i$1.requestQueue,o=new ft({channelUrl:this.url,channelType:this.channelType,userId:a.userId,category:e,description:r$1}),[4,s.send(o)];case 1:return u.sent(),[2]}}))}))},l.prototype.reportUser=function(e,r$1,a){return r(this,void 0,void 0,(function(){var s,o,u,c;return i(this,(function(l){switch(l.label){case 0:return at$1(e instanceof ct$1&&m(_e$1,r$1)&&y("string",a)).throw(p.invalidParameters),s=St$1.of(this._iid),o=s.sdkState,u=s.requestQueue,c=new mt({channelUrl:this.url,channelType:this.channelType,userId:o.userId,offendingUserId:e.userId,category:r$1,description:a}),[4,u.send(c)];case 1:return l.sent(),[2]}}))}))},l.prototype.reportMessage=function(e,r$1,i$1){return r(this,void 0,void 0,(function(){var a,s,o,u;return i(this,(function(c){switch(c.label){case 0:return at$1(e instanceof xt&&m(_e$1,r$1)&&y("string",i$1)).throw(p.invalidParameters),a=St$1.of(this._iid),s=a.sdkState,o=a.requestQueue,u=new vt({channelUrl:this.url,channelType:this.channelType,userId:s.userId,offendingUserId:e.sender.userId,messageId:e.messageId,category:r$1,description:i$1}),[4,o.send(u)];case 1:return c.sent(),[2]}}))}))},l}(Le$1);
4392
+
4393
+ exports.B$1 = void 0;exports.H = void 0;exports.z = void 0;exports.q$1 = void 0;!function(e){e.SUCCESS="success",e.PENDING="pending",e.ERROR="error";}(exports.B$1||(exports.B$1={})),function(e){e.DEFAULT="default",e.ALL="all",e.MENTION_ONLY="mention_only",e.OFF="off";}(exports.H||(exports.H={})),function(e){e.FCM="gcm",e.APNS="apns",e.UNKNOWN="unknown";}(exports.z||(exports.z={})),function(e){e.ALTERNATIVE="alternative",e.DEFAULT="default";}(exports.q$1||(exports.q$1={}));exports.K = void 0;exports.G = void 0;exports.Q = void 0;var j=100,W="GroupChannel",V="url",Y=100,J="Message",X="messageId";!function(e){e.LATEST_LAST_MESSAGE="latest_last_message",e.CHRONOLOGICAL="chronological",e.CHANNEL_NAME_ALPHABETICAL="channel_name_alphabetical",e.METADATA_VALUE_ALPHABETICAL="metadata_value_alphabetical";}(exports.K||(exports.K={})),function(e){e.CHRONOLOGICAL="chronological",e.CHANNEL_NAME_ALPHABETICAL="channel_name_alphabetical",e.METADATA_VALUE_ALPHABETICAL="metadata_value_alphabetical";}(exports.G||(exports.G={})),function(e){e.CREATED_AT="created_at",e.SCHEDULED_AT="scheduled_at";}(exports.Q||(exports.Q={}));exports.Z = void 0;var $=function(e){switch(e){case exports.K.LATEST_LAST_MESSAGE:return ["-lastMessageUpdatedAt","-createdAt","syncIndex"];case exports.K.CHRONOLOGICAL:return ["-createdAt","syncIndex"];case exports.K.CHANNEL_NAME_ALPHABETICAL:return ["name"]}},ee=function(){function r(){this.messageTypeFilter=exports.se$1.ALL,this.customTypesFilter=null,this.senderUserIdsFilter=null,this.replyType=exports.ue.NONE;}return r.prototype.clone=function(){var e=new r,t=JSON.parse(JSON.stringify(this));return Object.keys(t).forEach((function(s){e[s]=t[s];})),e},r.prototype.match=function(r){switch(this.messageTypeFilter){case exports.se$1.USER:if(r.messageType!==ie$1.USER)return !1;break;case exports.se$1.FILE:if(r.messageType!==ie$1.FILE)return !1;break;case exports.se$1.ADMIN:if(r.messageType!==ie$1.ADMIN)return !1}if(this.customTypesFilter&&this.customTypesFilter.length>0&&!this.customTypesFilter.includes(r.customType))return !1;if(this.senderUserIdsFilter&&this.senderUserIdsFilter.length>0){if(!(r instanceof xt))return !1;if(!this.senderUserIdsFilter.includes(r.sender.userId))return !1}switch(this.replyType){case exports.ue.NONE:if(r.parentMessageId>0)return !1;break;case exports.ue.ONLY_REPLY_TO_CHANNEL:if(r instanceof xt&&r.parentMessageId>0&&!r.replyToChannel)return !1}return !0},r}();!function(e){e.CHANNEL_LATEST="channel_latest",e.NEWEST_CHILD_MESSAGE="newest_child_message";}(exports.Z||(exports.Z={}));exports.te = void 0;var se=function(e){switch(e){case exports.Z.CHANNEL_LATEST:return ["channelUrl","-createdAt","-messageId"];case exports.Z.NEWEST_CHILD_MESSAGE:return ["channelUrl","-parentMessageId","-createdAt","-messageId"]}},ne=exports.n(exports.n({},de$1),{scheduledAt:null}),re=function(e){return he$1(e)&&y("number",e.scheduledAt,!0)},ae=exports.n(exports.n({},ue$1),{scheduledAt:null,file:null,fileUrl:null,fileName:null,mimeType:null,fileSize:null,thumbnailSizes:null,requireAuth:!1}),ie=function(e){return ce$1(e)&&y("number",e.scheduledAt)&&(S(e.file)||y("string",e.fileUrl))&&y("string",e.fileName,!0)&&y("string",e.mimeType,!0)&&y("number",e.fileSize,!0)&&(null===e.thumbnailSizes||e.thumbnailSizes.every((function(e){return y("object",e)&&e.maxWidth>0&&e.maxHeight>0})))},ce="UnsentMessage",oe="reqId",le={},ue=function(e){function t$1(t,s){var n=s.sdkState,r=s.cacheContext,a=e.call(this,t)||this;return a._sdkState=n,a._cacheContext=r,le[t]=a,a}return t(t$1,e),t$1.of=function(e){return le[e]},Object.defineProperty(t$1.prototype,"collection",{get:function(){var e=this._cacheContext.nestdb;return e&&e.collection("UnsentMessage")},enumerable:!1,configurable:!0}),Object.defineProperty(t$1.prototype,"localCacheEnabled",{get:function(){return this._cacheContext.localCacheEnabled&&!!this.collection},enumerable:!1,configurable:!0}),t$1.prototype._serialize=function(e){if(e.messageId>0)throw p.invalidParameters;var t,s=exports.n({},e.serialize());return e instanceof Vt?(e.messageParams&&(s.messageParams=le$1(e.messageParams)),e.scheduledInfo&&e.scheduledInfo.scheduledMessageParams&&(s.scheduledInfo.scheduledMessageParams=(t=e.scheduledInfo.scheduledMessageParams,exports.n(exports.n({},le$1(t)),{scheduledAt:t.scheduledAt})))):e instanceof Wt&&(e.messageParams&&(s.messageParams=ve$1(e.messageParams)),e.scheduledInfo&&e.scheduledInfo.scheduledMessageParams&&(s.scheduledInfo.scheduledMessageParams=function(e){return exports.n(exports.n({},ve$1(e)),{scheduledAt:e.scheduledAt})}(e.scheduledInfo.scheduledMessageParams))),s},t$1.prototype._deserialize=function(e){return e?(e=exports.n(exports.n({},e),{messageId:parseInt(e.messageId)}),En.of(this._iid).buildMessageFromSerializedData(e)):null},t$1.prototype.get=function(e){return r(this,void 0,void 0,(function(){var t;return i(this,(function(s){switch(s.label){case 0:return this.localCacheEnabled?[4,this.collection.getByKey("".concat(e))]:[3,2];case 1:if(t=s.sent())return [2,this._deserialize(t)];s.label=2;case 2:return [2,null]}}))}))},t$1.prototype.fetch=function(e){var t=e.channelUrl,s=void 0===t?null:t,n=e.filter,r$1=void 0===n?new ee:n,a=e.order,i$1=void 0===a?exports.Z.CHANNEL_LATEST:a,c=e.sendingStatus,o=void 0===c?null:c,g=e.backward,p=void 0!==g&&g,m=e.parentMessageId,v=void 0===m?null:m;return r(this,void 0,void 0,(function(){var e,t,n,a,c=this;return i(this,(function(g){switch(g.label){case 0:return this.localCacheEnabled?(e=se(i$1),t={"/where":function(e){return !!(i$1!==exports.Z.NEWEST_CHILD_MESSAGE||v&&0!==e.parentMessageId&&e.parentMessageId===v)&&r$1.match(c._deserialize(e))}},s&&(t.channelUrl=s),o&&(t.sendingStatus=o),n={where:t,index:e,backward:p},[4,this.collection.query(n)]):[3,3];case 1:return [4,g.sent().fetch({})];case 2:return a=g.sent(),[2,Promise.all(a.map((function(e){return r(c,void 0,void 0,(function(){var t,s,n,r,a,i$1;return i(this,(function(c){switch(c.label){case 0:return t=En.of(this._iid),s=this._deserialize(e),(n=e.messageParams)?s instanceof Vt?(s.messageParams=t.buildUserMessageCreateParamsFromSerializedData(n,s),[3,4]):[3,1]:[3,4];case 1:return s instanceof Wt?n.fileKey&&"string"==typeof n.fileKey&&me$1(n.fileType)?(r=n,[4,this.collection.getBlob(n.fileKey)]):[3,3]:[3,4];case 2:r.file=c.sent(),c.label=3;case 3:s.messageParams=t.buildFileMessageCreateParamsFromSerializedData(n,s),c.label=4;case 4:return s.scheduledInfo&&e.scheduledInfo&&e.scheduledInfo.scheduledMessageParams?s instanceof Vt?(a=e.scheduledInfo.scheduledMessageParams,s.scheduledInfo.scheduledMessageParams=t.buildScheduledUserMessageCreateParamsFromSerializedData(a,s),[3,8]):[3,5]:[3,8];case 5:return s instanceof Wt?(a=e.scheduledInfo.scheduledMessageParams).fileKey&&"string"==typeof a.fileKey&&me$1(a.fileType)?(i$1=a,[4,this.collection.getBlob(a.fileKey)]):[3,7]:[3,8];case 6:i$1.file=c.sent(),c.label=7;case 7:s.scheduledInfo.scheduledMessageParams=t.buildScheduledFileMessageCreateParamsFromSerializedData(a,s),c.label=8;case 8:return [2,s]}}))}))})))];case 3:return [2,[]]}}))}))},t$1.prototype.getAllChildMessages=function(e,t){return void 0===t&&(t=new ee),r(this,void 0,void 0,(function(){return i(this,(function(s){switch(s.label){case 0:return [4,this.fetch({filter:t,order:exports.Z.NEWEST_CHILD_MESSAGE,channelUrl:e.channelUrl,backward:!1,parentMessageId:e.messageId})];case 1:return [2,s.sent()]}}))}))},t$1.prototype.upsert=function(e){return r(this,void 0,void 0,(function(){var t,s=this;return i(this,(function(n){switch(n.label){case 0:return this.localCacheEnabled?[4,this.saveBlobs(e)]:[3,3];case 1:return n.sent(),t=e.map((function(e){return s._serialize(e)})),[4,this.collection.upsertMany(t)];case 2:n.sent(),n.label=3;case 3:return [2]}}))}))},t$1.prototype.upsertChildMessages=function(e){return r(this,void 0,void 0,(function(){var t=this;return i(this,(function(s){switch(s.label){case 0:return this.localCacheEnabled?[4,Promise.all(e.map((function(e){return r(t,void 0,void 0,(function(){var t,s;return i(this,(function(n){switch(n.label){case 0:return t=[],(null===(s=e.threadInfo)||void 0===s?void 0:s.replyCount)>0?[4,this.getAllChildMessages(e)]:[3,2];case 1:t=n.sent(),n.label=2;case 2:return t.length>0?(t.forEach((function(t){return t.applyParentMessage(e)})),[4,this.upsert(t)]):[3,4];case 3:n.sent(),n.label=4;case 4:return [2]}}))}))})))]:[3,2];case 1:s.sent(),s.label=2;case 2:return [2]}}))}))},t$1.prototype.remove=function(e){return r(this,void 0,void 0,(function(){var t,s$1,n,r,a,i$1;return i(this,(function(c){switch(c.label){case 0:if(!this.localCacheEnabled)return [3,8];c.label=1;case 1:c.trys.push([1,6,7,8]),t=s(e),s$1=t.next(),c.label=2;case 2:return s$1.done?[3,5]:(n=s$1.value,[4,this.collection.remove(n)]);case 3:c.sent(),c.label=4;case 4:return s$1=t.next(),[3,2];case 5:return [3,8];case 6:return r=c.sent(),a={error:r},[3,8];case 7:try{s$1&&!s$1.done&&(i$1=t.return)&&i$1.call(t);}finally{if(a)throw a.error}return [7];case 8:return [2]}}))}))},t$1.prototype.removeMessagesOfChannel=function(e){return r(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return this.localCacheEnabled?[4,this.collection.removeIf({where:{channelUrl:e}})]:[3,2];case 1:t.sent(),t.label=2;case 2:return [2]}}))}))},t$1.prototype.clear=function(){return r(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return this.localCacheEnabled?[4,this.collection.clear()]:[3,2];case 1:e.sent(),e.label=2;case 2:return [2]}}))}))},t$1.prototype.saveBlobs=function(e){return r(this,void 0,void 0,(function(){var t=this;return i(this,(function(s){switch(s.label){case 0:return [4,Promise.all(e.map((function(e){return r(t,void 0,void 0,(function(){var t,s,n;return i(this,(function(r){switch(r.label){case 0:return e instanceof Wt?e.messageParams&&(t=e.messageParams).file&&fe$1(t.file)?[4,this.collection.saveBlob(t.file,e.reqId)]:[3,2]:[3,4];case 1:n=r.sent(),t.fileKey=n,t.fileType=oe$1.BLOB,r.label=2;case 2:return e.scheduledInfo&&e.scheduledInfo.scheduledMessageParams&&((s=e.scheduledInfo.scheduledMessageParams).file&&fe$1(s.file))?[4,this.collection.saveBlob(s.file,e.reqId)]:[3,4];case 3:n=r.sent(),s.fileKey=n,s.fileType=oe$1.BLOB,r.label=4;case 4:return [2]}}))}))})))];case 1:return s.sent(),[2]}}))}))},t$1}(Le$1),de={},he=function(e){function t$1(t,s){var n=s.sdkState,r=s.cacheContext,a=s.unsentMessageCache,i=e.call(this,t)||this;return i._sdkState=n,i._cacheContext=r,i._unsentMessageCache=a,de[t]=i,i}return t(t$1,e),t$1.of=function(e){return de[e]},Object.defineProperty(t$1.prototype,"collection",{get:function(){var e=this._cacheContext.nestdb;return e?e.collection("Message"):null},enumerable:!1,configurable:!0}),Object.defineProperty(t$1.prototype,"localCacheEnabled",{get:function(){return this._cacheContext.localCacheEnabled&&!!this.collection},enumerable:!1,configurable:!0}),t$1.prototype._serialize=function(e){return exports.n(exports.n({},e.serialize()),{messageId:"".concat(e.messageId)})},t$1.prototype._deserialize=function(e){return e=exports.n(exports.n({},e),{messageId:parseInt(e.messageId)}),En.of(this._iid).buildMessageFromSerializedData(e)},t$1.prototype.get=function(e){return r(this,void 0,void 0,(function(){var t;return i(this,(function(s){switch(s.label){case 0:return this.localCacheEnabled?[4,this.collection.getByKey("".concat(e))]:[3,2];case 1:if(t=s.sent())return [2,this._deserialize(t)];s.label=2;case 2:return [2,null]}}))}))},t$1.prototype.fetch=function(e){var t=e.channelUrl,s=e.token,n=e.limit,r$1=void 0===n?100:n,a=e.filter,i$1=void 0===a?new ee:a,c=e.order,o=void 0===c?exports.Z.CHANNEL_LATEST:c,d=e.backward,g=void 0!==d&&d,p=e.parentMessageId,m=void 0===p?null:p;return r(this,void 0,void 0,(function(){var e,n,a,c=this;return i(this,(function(d){switch(d.label){case 0:return this.localCacheEnabled?(e=se(o),n={where:{channelUrl:t,"/where":function(e){if(s)switch(o){case exports.Z.CHANNEL_LATEST:if(!g&&e.createdAt>s||g&&e.createdAt<s)return !1;break;case exports.Z.NEWEST_CHILD_MESSAGE:if(!m||0===e.parentMessageId||e.parentMessageId!==m)return !1}return i$1.match(c._deserialize(e))}},index:e,backward:g},[4,this.collection.query(n)]):[3,3];case 1:return [4,d.sent().fetch({limit:r$1})];case 2:return a=d.sent(),[2,Promise.all(a.map((function(e){return r(c,void 0,void 0,(function(){var t,s,n;return i(this,(function(r){switch(r.label){case 0:return t=this._deserialize(e),(s=e.messageParams)?t instanceof Vt?(t.messageParams=s,[3,4]):[3,1]:[3,4];case 1:return t instanceof Wt?s.fileKey&&"string"==typeof s.fileKey&&me$1(s.fileType)?(n=s,[4,this.collection.getBlob(s.fileKey)]):[3,3]:[3,4];case 2:n.file=r.sent(),r.label=3;case 3:t.messageParams=s,r.label=4;case 4:return [2,t]}}))}))})))];case 3:return [2,[]]}}))}))},t$1.prototype.getAllChildMessages=function(e,t){return void 0===t&&(t=new ee),r(this,void 0,void 0,(function(){return i(this,(function(s){switch(s.label){case 0:return [4,this.fetch({channelUrl:e.channelUrl,token:Date.now(),limit:null,backward:!1,filter:t,order:exports.Z.NEWEST_CHILD_MESSAGE,parentMessageId:e.messageId})];case 1:return [2,s.sent()]}}))}))},t$1.prototype.upsert=function(e){return r(this,void 0,void 0,(function(){var t,s=this;return i(this,(function(n){switch(n.label){case 0:return this.localCacheEnabled?[4,this.saveBlobs(e)]:[3,5];case 1:return n.sent(),t=e.map((function(e){return s._serialize(e)})),[4,this.collection.upsertMany(t)];case 2:return n.sent(),[4,this.upsertChildMessages(e)];case 3:return n.sent(),[4,this._unsentMessageCache.upsertChildMessages(e)];case 4:n.sent(),n.label=5;case 5:return [2]}}))}))},t$1.prototype.upsertChildMessages=function(e){return r(this,void 0,void 0,(function(){var t=this;return i(this,(function(s){switch(s.label){case 0:return this.localCacheEnabled?[4,Promise.all(e.map((function(e){return r(t,void 0,void 0,(function(){var t,s;return i(this,(function(n){switch(n.label){case 0:return t=[],(null===(s=e.threadInfo)||void 0===s?void 0:s.replyCount)>0?[4,this.getAllChildMessages(e)]:[3,2];case 1:t=n.sent(),n.label=2;case 2:return t.length>0?(t.forEach((function(t){return t.applyParentMessage(e)})),[4,this.upsert(t)]):[3,4];case 3:n.sent(),n.label=4;case 4:return [2]}}))}))})))]:[3,2];case 1:s.sent(),s.label=2;case 2:return [2]}}))}))},t$1.prototype.remove=function(e){return r(this,void 0,void 0,(function(){var t,s$1,n,r,a,i$1;return i(this,(function(c){switch(c.label){case 0:if(!this.localCacheEnabled)return [3,8];c.label=1;case 1:c.trys.push([1,6,7,8]),t=s(e),s$1=t.next(),c.label=2;case 2:return s$1.done?[3,5]:(n=s$1.value,[4,this.collection.remove("".concat(n))]);case 3:c.sent(),c.label=4;case 4:return s$1=t.next(),[3,2];case 5:return [3,8];case 6:return r=c.sent(),a={error:r},[3,8];case 7:try{s$1&&!s$1.done&&(i$1=t.return)&&i$1.call(t);}finally{if(a)throw a.error}return [7];case 8:return [2]}}))}))},t$1.prototype.removeMessagesOfChannel=function(e){return r(this,void 0,void 0,(function(){var t;return i(this,(function(s){switch(s.label){case 0:return this.localCacheEnabled?[4,this.collection.removeIf({where:{channelUrl:e},index:se(exports.Z.CHANNEL_LATEST)})]:[3,6];case 1:return s.sent(),[4,(t=this._cacheContext.preference).remove("sendbird:".concat(this._sdkState.userId,"@groupchannel/").concat(e,"/message/sync"))];case 2:return s.sent(),[4,t.remove("sendbird:".concat(this._sdkState.userId,"@groupchannel/").concat(e,"/message/sync.meta"))];case 3:return s.sent(),[4,t.remove("sendbird:".concat(this._sdkState.userId,"@groupchannel/").concat(e,"/message/changelogs"))];case 4:return s.sent(),[4,t.remove("sendbird:".concat(this._sdkState.userId,"@groupchannel/").concat(e,"/message/changelogs.meta"))];case 5:s.sent(),s.label=6;case 6:return [2]}}))}))},t$1.prototype.removeUnderOffset=function(e,t){return r(this,void 0,void 0,(function(){return i(this,(function(s){switch(s.label){case 0:return this.localCacheEnabled?[4,this.collection.removeIf({where:{channelUrl:e,createdAt:{"<":t}},index:se(exports.Z.CHANNEL_LATEST)})]:[3,2];case 1:s.sent(),s.label=2;case 2:return [2]}}))}))},t$1.prototype.clear=function(){return r(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return this.localCacheEnabled?[4,this.collection.clear()]:[3,2];case 1:e.sent(),e.label=2;case 2:return [2]}}))}))},t$1.prototype.countBetween=function(e,t,s){return r(this,void 0,void 0,(function(){var n,r=this;return i(this,(function(a){switch(a.label){case 0:return this.localCacheEnabled?(n=se(exports.Z.CHANNEL_LATEST),[4,this.collection.query({where:{channelUrl:e,"/where":function(e){var n=r._deserialize(e);return s.includes(n.createdAt)&&t.match(n)}},index:n}).count()]):[3,2];case 1:return [2,a.sent()];case 2:return [2,0]}}))}))},t$1.prototype.saveBlobs=function(e){return r(this,void 0,void 0,(function(){var t=this;return i(this,(function(s){switch(s.label){case 0:return [4,Promise.all(e.map((function(e){return r(t,void 0,void 0,(function(){var t,s;return i(this,(function(n){switch(n.label){case 0:return e instanceof Wt&&e.messageParams&&((t=e.messageParams).file&&fe$1(t.file))?[4,this.collection.saveBlob(t.file,e.reqId)]:[3,2];case 1:s=n.sent(),t.fileKey=s,n.label=2;case 2:return [2]}}))}))})))];case 1:return s.sent(),[2]}}))}))},t$1}(Le$1),fe=function(e){function t$1(t){var s=t.message,n=e.call(this)||this;return n.message=s,n}return t(t$1,e),t$1}(L),ge={},pe=function(){function e(e,t){var s=t.localCacheEnabled,n=t.dispatcher,r=t.sdkState,a=t.logger,i=this;ge[e]=this,this._iid=e,ge[e]=this,this._localCacheEnabled=s,this._isProcessingAutoResend=!1,this._autoResendQueue=[],this._dispatcher=n,this._logger=a,this._sdkState=r,this._localCacheEnabled&&n.on((function(e){if(e instanceof de$2)switch(e.stateType){case exports.J$1.CONNECTED:i._isProcessingAutoResend||i.processAutoResendRegisteredPendingMessages().then((function(){return i._processNextAutoResend()}));break;case exports.J$1.DISCONNECTED:i._isProcessingAutoResend=!1;}}));}return e.of=function(e){return ge[e]},e.prototype.processNonAutoResendRegisteredPendingMessages=function(){return r(this,void 0,void 0,(function(){var e,t,s$1,n,r,a;return i(this,(function(i){switch(i.label){case 0:return [4,this._fetchAllCachedPendingMessages()];case 1:e=i.sent();try{for(t=s(e),s$1=t.next();!s$1.done;s$1=t.next())0===(n=s$1.value).errorCode&&(this._logger.debug("cached pending message is not auto-resend registered. changing its sending status to failed: ",n.reqId),n.sendingStatus=exports.le.FAILED,n.errorCode=u.ACK_TIMEOUT,this._dispatcher.dispatch(new un({messages:[n],source:exports.$t.LOCAL_MESSAGE_FAILED})));}catch(e){r={error:e};}finally{try{s$1&&!s$1.done&&(a=t.return)&&a.call(t);}finally{if(r)throw r.error}}return [2]}}))}))},e.prototype.processAutoResendRegisteredPendingMessages=function(){return r(this,void 0,void 0,(function(){var e,t,s$1,n,r,a,i$1,c;return i(this,(function(o){switch(o.label){case 0:return [4,this._fetchAllCachedPendingMessages()];case 1:e=o.sent();try{for(t=s(e),s$1=t.next();!s$1.done;s$1=t.next())(n=s$1.value).errorCode&&I(n.errorCode)&&(r=(new Date).getTime(),a=n.createdAt+2592e5,r<=a?this._autoResendQueue.map((function(e){return e.reqId})).indexOf(n.reqId)<0&&this._autoResendQueue.push(n):(this._logger.debug("auto-resend registered pending messaged expired. expiration date: ",new Date(a).toLocaleString()),n.sendingStatus=exports.le.FAILED,this._dispatcher.dispatch(new un({messages:[n],source:exports.$t.LOCAL_MESSAGE_FAILED}))));}catch(e){i$1={error:e};}finally{try{s$1&&!s$1.done&&(c=t.return)&&c.call(t);}finally{if(i$1)throw i$1.error}}return [2]}}))}))},e.prototype.completeCurrentAndProcessNextAutoResend=function(e){if(this._localCacheEnabled&&(e.sendingStatus===exports.le.SUCCEEDED||e.sendingStatus===exports.le.FAILED&&!I(e.errorCode))){var t=this.indexOf(e);t>=0&&this._autoResendQueue.splice(t,1),0===t&&this._processNextAutoResend();}},e.prototype._fetchAllCachedPendingMessages=function(){return r(this,void 0,void 0,(function(){var e,t;return i(this,(function(s){switch(s.label){case 0:return (e=ue.of(this._iid))?[4,e.fetch({sendingStatus:exports.le.PENDING,backward:!0})]:[3,2];case 1:return t=s.sent(),[3,3];case 2:t=[],s.label=3;case 3:return [2,t]}}))}))},e.prototype.indexOf=function(e){return this._autoResendQueue.length>0?this._autoResendQueue.map((function(e){return e.reqId})).indexOf(e.reqId):-1},e.prototype._isNotInQueue=function(e){return -1===this._autoResendQueue.map((function(e){return e.reqId})).indexOf(e.reqId)},e.prototype._processNextAutoResend=function(){return r(this,void 0,void 0,(function(){var e;return i(this,(function(t){if(this._localCacheEnabled&&"foreground"===this._sdkState.appState)try{this._autoResendQueue.length>0?(this._isProcessingAutoResend||(this._logger.debug("auto-resend queue started."),this._isProcessingAutoResend=!0),e=this._autoResendQueue[0],this._dispatcher.dispatch(new fe({message:e})),this._logger.debug("processing auto-resend for message request id: ",e.reqId)):(this._logger.debug("auto-resend queue finished."),this._isProcessingAutoResend=!1);}catch(e){this._logger.warn("process auto-resend error: ",e),this._isProcessingAutoResend=!1;}return [2]}))}))},e}();!function(e){e[e.USER_BLOCK=20001]="USER_BLOCK",e[e.USER_UNBLOCK=2e4]="USER_UNBLOCK",e[e.FRIEND_DISCOVERED=20900]="FRIEND_DISCOVERED";}(exports.te||(exports.te={}));var me=function(){function e(e){this.category=e.cat,this.data=e.data;}return e.getDataAsUserBlockEvent=function(e,t){var s=t.data,n=s.blocker,r=s.blockee;return {blocker:new ct$1(e,n),blockee:new ct$1(e,r)}},e.getDataAsFriendDiscoveredEvent=function(e,t){var s=t.data.friend_discoveries;return {friendDiscoveries:Array.isArray(s)?s.map((function(t){return new ct$1(e,t)})):[]}},e}(),ve=function(e){function t$1(t,s){var n=s.userId,r=e.call(this)||this;return r._iid=t,r.userId=n,r}return t(t$1,e),t$1}(L),be=function(e){function t$1(t,s,n){var r=e.call(this,t,"USEV",n)||this;return r.event=new me(n),r}return t(t$1,e),t$1}(B),_e=function(e){function t$1(t){var s=t.userId,n=e.call(this)||this;return n.method=exports.d.GET,n.path="".concat(Ue$1,"/").concat(encodeURIComponent(s),"/push_preference"),n}return t(t$1,e),t$1}(q),Ee=function(e){function t$1(t,s){var n=e.call(this,t,s)||this;return n.pushTriggerOption=s.push_trigger_option,n}return t(t$1,e),t$1}(F),Ae=function(e){function t$1(t){var s=t.userId,n=t.pushTriggerOption,r=e.call(this)||this;return r.method=exports.d.PUT,r.path="".concat(Ue$1,"/").concat(encodeURIComponent(s),"/push_preference"),r.params={push_trigger_option:n},r}return t(t$1,e),t$1}(q),ye=function(e){function t$1(t,s){var n=e.call(this,t,s)||this;return n.pushTriggerOption=s.push_trigger_option,n}return t(t$1,e),t$1}(F);
4394
+
4395
+ exports._ = void 0;!function(e){e[e.NONE=0]="NONE",e[e.CHANNEL_ENTER=10102]="CHANNEL_ENTER",e[e.CHANNEL_EXIT=10103]="CHANNEL_EXIT",e[e.USER_CHANNEL_MUTE=10201]="USER_CHANNEL_MUTE",e[e.USER_CHANNEL_UNMUTE=10200]="USER_CHANNEL_UNMUTE",e[e.USER_CHANNEL_BAN=10601]="USER_CHANNEL_BAN",e[e.USER_CHANNEL_UNBAN=10600]="USER_CHANNEL_UNBAN",e[e.CHANNEL_FREEZE=10701]="CHANNEL_FREEZE",e[e.CHANNEL_UNFREEZE=10700]="CHANNEL_UNFREEZE",e[e.TYPING_START=10900]="TYPING_START",e[e.TYPING_END=10901]="TYPING_END",e[e.CHANNEL_JOIN=1e4]="CHANNEL_JOIN",e[e.CHANNEL_LEAVE=10001]="CHANNEL_LEAVE",e[e.CHANNEL_OPERATOR_UPDATE=10002]="CHANNEL_OPERATOR_UPDATE",e[e.CHANNEL_INVITE=10020]="CHANNEL_INVITE",e[e.CHANNEL_ACCEPT_INVITE=10021]="CHANNEL_ACCEPT_INVITE",e[e.CHANNEL_DECLINE_INVITE=10022]="CHANNEL_DECLINE_INVITE",e[e.CHANNEL_PROP_CHANGED=11e3]="CHANNEL_PROP_CHANGED",e[e.CHANNEL_DELETED=12e3]="CHANNEL_DELETED",e[e.CHANNEL_META_DATA_CHANGED=11100]="CHANNEL_META_DATA_CHANGED",e[e.CHANNEL_META_COUNTERS_CHANGED=11200]="CHANNEL_META_COUNTERS_CHANGED",e[e.CHANNEL_HIDE=13e3]="CHANNEL_HIDE",e[e.CHANNEL_UNHIDE=13001]="CHANNEL_UNHIDE";}(exports._||(exports._={}));var l=function(){function n(e){this.channelUrl=e.channel_url,this.channelType=e.channel_type,this.category=e.cat,this.data=e.data,this.ts=e.ts;}return Object.defineProperty(n.prototype,"isGroupChannelEvent",{get:function(){return this.channelType===exports.ne.GROUP},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isOpenChannelEvent",{get:function(){return this.channelType===exports.ne.OPEN},enumerable:!1,configurable:!0}),n}(),C=function(e){function t$1(n,t,a){var s=e.call(this,n,"SYEV",a)||this;return s.event=new l(a),s}return t(t$1,e),t$1}(B),d=function(e){function t$1(n,t,s){var N=e.call(this,n,t,s)||this,o=s.data.operators,E=void 0===o?[]:o;return N.operators=E.map((function(e){return new ct$1(N._iid,e)})),N}return t(t$1,e),t$1}(C),h=function(e){function t$1(n,t,a){var s=e.call(this,n,"MCNT",a)||this;return s.groupChannelMemberCounts=a.group_channels.map((function(e){return {channelUrl:e.channel_url,memberCount:e.member_count,joinedMemberCount:e.joined_member_count,updatedAt:e.ts}})),s.openChannelMemberCounts=a.open_channels.map((function(e){return {channelUrl:e.channel_url,participantCount:e.participant_count,updatedAt:e.ts}})),s}return t(t$1,e),t$1}(B),A=function(e){function t$1(n,t,a){var E,r,i,u=this;(u=e.call(this,n,"ADMM",a)||this).message=new Kt(n,a);var _=St$1.of(n).sdkState;return u.isMentioned=Ye$1(u.message.mentionType,null!==(E=u.message.mentionedUserIds)&&void 0!==E?E:null===(r=u.message.mentionedUsers)||void 0===r?void 0:r.map((function(e){return e.userId})),_.userId),u.forceUpdateLastMessage=null!==(i=a.force_update_last_message)&&void 0!==i&&i,u}return t(t$1,e),t$1}(B),c=function(e){function t$1(n,t,a){var o,r,i,u,_,l,C=this;(C=e.call(this,n,"AEDI",a)||this).message=new Kt(n,a);var d=St$1.of(n).sdkState;return C.mentionCountChange=Je$1({mentionType:null!==(r=null===(o=a.old_values)||void 0===o?void 0:o.mention_type)&&void 0!==r?r:null,mentionedUserIds:null!==(u=null===(i=a.old_values)||void 0===i?void 0:i.mentioned_user_ids)&&void 0!==u?u:[]},{mentionType:C.message.mentionType,mentionedUserIds:null!==(_=C.message.mentionedUserIds)&&void 0!==_?_:null===(l=C.message.mentionedUsers)||void 0===l?void 0:l.map((function(e){return e.userId}))},d.userId),C}return t(t$1,e),t$1}(B),H=function(e){function t$1(n,t,a){var s=e.call(this,n,"MRCT",a)||this;return s.channelUrl=a.channel_url,s.channelType=a.channel_type,s.event=new wt$1(a),s}return t(t$1,e),t$1}(B),T=function(e){function t$1(n,t,a){var s=e.call(this,n,"MTHD",a)||this;return s.event=new Sn(n,a),s}return t(t$1,e),t$1}(B),U=function(){this.onUserMuted=Y$1,this.onUserUnmuted=Y$1,this.onUserBanned=Y$1,this.onUserUnbanned=Y$1,this.onChannelChanged=Y$1,this.onChannelDeleted=Y$1,this.onChannelFrozen=Y$1,this.onChannelUnfrozen=Y$1,this.onOperatorUpdated=Y$1,this.onChannelMemberCountChanged=Y$1,this.onMetaDataCreated=Y$1,this.onMetaDataUpdated=Y$1,this.onMetaDataDeleted=Y$1,this.onMetaCounterCreated=Y$1,this.onMetaCounterUpdated=Y$1,this.onMetaCounterDeleted=Y$1,this.onMessageReceived=Y$1,this.onMessageUpdated=Y$1,this.onMessageDeleted=Y$1,this.onMentionReceived=Y$1,this.onReactionUpdated=Y$1,this.onThreadInfoUpdated=Y$1;};
4396
+
4397
+ exports.$ = $$1;
4398
+ exports.$$1 = $;
4399
+ exports.A = A$1;
4400
+ exports.A$1 = A;
4401
+ exports.Ae = Ae;
4402
+ exports.B = B;
4403
+ exports.Bt = Bt;
4404
+ exports.C = C;
4405
+ exports.Cn = Cn;
4406
+ exports.Dn = Dn;
4407
+ exports.Dt = Dt$1;
4408
+ exports.E = E;
4409
+ exports.Ee = Ee;
4410
+ exports.Ee$1 = Ee$2;
4411
+ exports.Ee$2 = Ee$1;
4412
+ exports.En = En;
4413
+ exports.F = F;
4414
+ exports.Fe = Fe$1;
4415
+ exports.Ge = Ge$1;
4416
+ exports.Gt = Gt;
4417
+ exports.H$1 = H$1;
4418
+ exports.H$2 = H;
4419
+ exports.Ht = Ht;
4420
+ exports.Ie = Ie$1;
4421
+ exports.Ie$1 = Ie;
4422
+ exports.In = In;
4423
+ exports.It = It;
4424
+ exports.J = J;
4425
+ exports.Jt = Jt;
4426
+ exports.Ke = Ke$1;
4427
+ exports.L = L;
4428
+ exports.Le = Le$1;
4429
+ exports.Lt = Lt;
4430
+ exports.M = M;
4431
+ exports.Me = Me$1;
4432
+ exports.Me$1 = Me;
4433
+ exports.N = N;
4434
+ exports.Nt = Nt$1;
4435
+ exports.On = On;
4436
+ exports.Ot$1 = Ot;
4437
+ exports.R = R;
4438
+ exports.Rt = Rt;
4439
+ exports.S = S;
4440
+ exports.Se = Se$1;
4441
+ exports.St = St$1;
4442
+ exports.T = T;
4443
+ exports.T$1 = T$1;
4444
+ exports.Tt = Tt$1;
4445
+ exports.Tt$1 = Tt;
4446
+ exports.U = U$1;
4447
+ exports.U$1 = U;
4448
+ exports.Ue = Ue$1;
4449
+ exports.Ue$1 = Ue;
4450
+ exports.V = V;
4451
+ exports.Ve = Ve$1;
4452
+ exports.Vt = Vt;
4453
+ exports.W = W;
4454
+ exports.We = We$1;
4455
+ exports.Wt = Wt;
4456
+ exports.X = X;
4457
+ exports.Y = Y$1;
4458
+ exports.Y$1 = Y;
4459
+ exports._e = _e;
4460
+ exports.a = a;
4461
+ exports.ae = ae;
4462
+ exports.an = an;
4463
+ exports.at = at$1;
4464
+ exports.at$1 = at;
4465
+ exports.b = b;
4466
+ exports.be = be;
4467
+ exports.bn = bn;
4468
+ exports.bt = bt$1;
4469
+ exports.c = c$1;
4470
+ exports.c$1 = c;
4471
+ exports.ce = ce;
4472
+ exports.cn = cn;
4473
+ exports.ct = ct$1;
4474
+ exports.ct$1 = ct;
4475
+ exports.d$1 = d;
4476
+ exports.de = de$2;
4477
+ exports.dt = dt$1;
4478
+ exports.dt$1 = dt;
4479
+ exports.ee = ee;
4480
+ exports.fe = fe;
4481
+ exports.gt = gt;
4482
+ exports.h = h$1;
4483
+ exports.h$1 = h;
4484
+ exports.he = he;
4485
+ exports.i = i;
4486
+ exports.ie = ie;
4487
+ exports.j$1 = j;
4488
+ exports.je = je;
4489
+ exports.kt = kt;
4490
+ exports.ln = ln;
4491
+ exports.lt = lt$1;
4492
+ exports.m = m;
4493
+ exports.me = me;
4494
+ exports.me$1 = me$2;
4495
+ exports.ne$1 = ne;
4496
+ exports.o = o;
4497
+ exports.oe = oe;
4498
+ exports.ot = ot$1;
4499
+ exports.ot$1 = ot;
4500
+ exports.p = p;
4501
+ exports.pe = pe;
4502
+ exports.pt = pt;
4503
+ exports.q = q;
4504
+ exports.qe = qe$1;
4505
+ exports.r = r;
4506
+ exports.re = re;
4507
+ exports.s = s;
4508
+ exports.se = se;
4509
+ exports.st = st$1;
4510
+ exports.t = t;
4511
+ exports.tt = tt;
4512
+ exports.ue$1 = ue;
4513
+ exports.un = un;
4514
+ exports.ve = ve;
4515
+ exports.we = we;
4516
+ exports.wt = wt;
4517
+ exports.xe = xe$1;
4518
+ exports.xt = xt;
4519
+ exports.y = y;
4520
+ exports.ye = ye;
4521
+ exports.z$1 = z;
4522
+ exports.ze = ze$1;
4523
+ //# sourceMappingURL=__bundle-7dfccc8c-e40d0934.js.map