@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,4396 @@
1
+ /*! *****************************************************************************
2
+ Copyright (c) Microsoft Corporation.
3
+
4
+ Permission to use, copy, modify, and/or distribute this software for any
5
+ purpose with or without fee is hereby granted.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
8
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
9
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
10
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
11
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
12
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
13
+ PERFORMANCE OF THIS SOFTWARE.
14
+ ***************************************************************************** */
15
+ var e = function (t, n) {
16
+ return e = Object.setPrototypeOf || {
17
+ __proto__: []
18
+ }
19
+ instanceof Array && function (e, t) {
20
+ e.__proto__ = t;
21
+ } || function (e, t) {
22
+ for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
23
+ }, e(t, n)
24
+ };
25
+
26
+ function t(t, n) {
27
+ if ("function" != typeof n && null !== n) throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");
28
+
29
+ function r() {
30
+ this.constructor = t;
31
+ }
32
+ e(t, n), t.prototype = null === n ? Object.create(n) : (r.prototype = n.prototype, new r);
33
+ }
34
+ var n = function () {
35
+ return n = Object.assign || function (e) {
36
+ for (var t, n = 1, r = arguments.length; n < r; n++)
37
+ for (var i in t = arguments[n]) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
38
+ return e
39
+ }, n.apply(this, arguments)
40
+ };
41
+
42
+ function r(e, t, n, r) {
43
+ return new(n || (n = Promise))((function (i, s) {
44
+ function o(e) {
45
+ try {
46
+ u(r.next(e));
47
+ } catch (e) {
48
+ s(e);
49
+ }
50
+ }
51
+
52
+ function a(e) {
53
+ try {
54
+ u(r.throw(e));
55
+ } catch (e) {
56
+ s(e);
57
+ }
58
+ }
59
+
60
+ function u(e) {
61
+ var t;
62
+ e.done ? i(e.value) : (t = e.value, t instanceof n ? t : new n((function (e) {
63
+ e(t);
64
+ }))).then(o, a);
65
+ }
66
+ u((r = r.apply(e, t || [])).next());
67
+ }))
68
+ }
69
+
70
+ function i(e, t) {
71
+ var n, r, i, s, o = {
72
+ label: 0,
73
+ sent: function () {
74
+ if (1 & i[0]) throw i[1];
75
+ return i[1]
76
+ },
77
+ trys: [],
78
+ ops: []
79
+ };
80
+ return s = {
81
+ next: a(0),
82
+ throw: a(1),
83
+ return: a(2)
84
+ }, "function" == typeof Symbol && (s[Symbol.iterator] = function () {
85
+ return this
86
+ }), s;
87
+
88
+ function a(s) {
89
+ return function (a) {
90
+ return function (s) {
91
+ if (n) throw new TypeError("Generator is already executing.");
92
+ for (; o;) try {
93
+ 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;
94
+ switch (r = 0, i && (s = [2 & s[0], i.value]), s[0]) {
95
+ case 0:
96
+ case 1:
97
+ i = s;
98
+ break;
99
+ case 4:
100
+ return o.label++, {
101
+ value: s[1],
102
+ done: !1
103
+ };
104
+ case 5:
105
+ o.label++, r = s[1], s = [0];
106
+ continue;
107
+ case 7:
108
+ s = o.ops.pop(), o.trys.pop();
109
+ continue;
110
+ default:
111
+ if (!(i = o.trys, (i = i.length > 0 && i[i.length - 1]) || 6 !== s[0] && 2 !== s[0])) {
112
+ o = 0;
113
+ continue
114
+ }
115
+ if (3 === s[0] && (!i || s[1] > i[0] && s[1] < i[3])) {
116
+ o.label = s[1];
117
+ break
118
+ }
119
+ if (6 === s[0] && o.label < i[1]) {
120
+ o.label = i[1], i = s;
121
+ break
122
+ }
123
+ if (i && o.label < i[2]) {
124
+ o.label = i[2], o.ops.push(s);
125
+ break
126
+ }
127
+ i[2] && o.ops.pop(), o.trys.pop();
128
+ continue
129
+ }
130
+ s = t.call(e, o);
131
+ } catch (e) {
132
+ s = [6, e], r = 0;
133
+ } finally {
134
+ n = i = 0;
135
+ }
136
+ if (5 & s[0]) throw s[1];
137
+ return {
138
+ value: s[0] ? s[1] : void 0,
139
+ done: !0
140
+ }
141
+ }([s, a])
142
+ }
143
+ }
144
+ }
145
+
146
+ function s(e) {
147
+ var t = "function" == typeof Symbol && Symbol.iterator,
148
+ n = t && e[t],
149
+ r = 0;
150
+ if (n) return n.call(e);
151
+ if (e && "number" == typeof e.length) return {
152
+ next: function () {
153
+ return e && r >= e.length && (e = void 0), {
154
+ value: e && e[r++],
155
+ done: !e
156
+ }
157
+ }
158
+ };
159
+ throw new TypeError(t ? "Object is not iterable." : "Symbol.iterator is not defined.")
160
+ }
161
+
162
+ function o(e, t) {
163
+ var n = "function" == typeof Symbol && e[Symbol.iterator];
164
+ if (!n) return e;
165
+ var r, i, s = n.call(e),
166
+ o = [];
167
+ try {
168
+ for (;
169
+ (void 0 === t || t-- > 0) && !(r = s.next()).done;) o.push(r.value);
170
+ } catch (e) {
171
+ i = {
172
+ error: e
173
+ };
174
+ } finally {
175
+ try {
176
+ r && !r.done && (n = s.return) && n.call(s);
177
+ } finally {
178
+ if (i) throw i.error
179
+ }
180
+ }
181
+ return o
182
+ }
183
+
184
+ function a(e, t, n) {
185
+ if (n || 2 === arguments.length)
186
+ 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]);
187
+ return e.concat(r || Array.prototype.slice.call(t))
188
+ }
189
+ var u, c$1 = "4.0.4",
190
+ l$1 = function () {
191
+ function e() {}
192
+ return Object.defineProperty(e, "OS_VERSION", {
193
+ get: function () {
194
+ return "undefined" != typeof navigator && navigator.userAgent ? navigator.userAgent.replace(/,/g, ".") : "noAgent"
195
+ },
196
+ enumerable: !1,
197
+ configurable: !0
198
+ }), Object.defineProperty(e, "SDK_VERSION", {
199
+ get: function () {
200
+ return "4.0.4"
201
+ },
202
+ enumerable: !1,
203
+ configurable: !0
204
+ }), Object.defineProperty(e, "SDK_MAJOR_VERSION", {
205
+ get: function () {
206
+ return e.SDK_VERSION.split(".")[0]
207
+ },
208
+ enumerable: !1,
209
+ configurable: !0
210
+ }), Object.defineProperty(e, "DEFAULT_MAX_UNREAD_COUNT_OF_SUPER_GROUP_CHANNEL", {
211
+ get: function () {
212
+ return 100
213
+ },
214
+ enumerable: !1,
215
+ configurable: !0
216
+ }), Object.defineProperty(e, "INTERNAL_CALL", {
217
+ get: function () {
218
+ return "ic"
219
+ },
220
+ enumerable: !1,
221
+ configurable: !0
222
+ }), e
223
+ }();
224
+ ! function (e) {
225
+ 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";
226
+ }(u || (u = {}));
227
+ var d$1, h$1 = function (e) {
228
+ return !(e instanceof p && !e.shouldThrowOutside)
229
+ },
230
+ p = function (e) {
231
+ function n(t) {
232
+ var r = t.code,
233
+ i = void 0 === r ? 0 : r,
234
+ s = t.message,
235
+ o = e.call(this, s) || this;
236
+ return o.shouldThrowOutside = !1, o.name = "SendbirdError", o.code = i, Object.setPrototypeOf(o, n.prototype), o
237
+ }
238
+ return t(n, e), Object.defineProperty(n.prototype, "isInvalidTokenError", {
239
+ get: function () {
240
+ return this.code === u.INVALID_TOKEN
241
+ },
242
+ enumerable: !1,
243
+ configurable: !0
244
+ }), Object.defineProperty(n.prototype, "isSessionTokenExpiredError", {
245
+ get: function () {
246
+ return this.code === u.SESSION_TOKEN_EXPIRED
247
+ },
248
+ enumerable: !1,
249
+ configurable: !0
250
+ }), Object.defineProperty(n.prototype, "isSessionKeyExpiredError", {
251
+ get: function () {
252
+ return this.code === u.SESSION_KEY_EXPIRED
253
+ },
254
+ enumerable: !1,
255
+ configurable: !0
256
+ }), Object.defineProperty(n, "debugModeRequired", {
257
+ get: function () {
258
+ return new n({
259
+ code: u.DEBUG_MODE_REQUIRED,
260
+ message: "Cannot run this operation in production mode."
261
+ })
262
+ },
263
+ enumerable: !1,
264
+ configurable: !0
265
+ }), Object.defineProperty(n, "lostInstance", {
266
+ get: function () {
267
+ return new n({
268
+ code: u.LOST_INSTANCE,
269
+ message: "Instance ID is missing. It should belong to an instance."
270
+ })
271
+ },
272
+ enumerable: !1,
273
+ configurable: !0
274
+ }), Object.defineProperty(n, "connectionRenew", {
275
+ get: function () {
276
+ return new n({
277
+ code: u.CONNECTION_RENEW,
278
+ message: "Connection restarts."
279
+ })
280
+ },
281
+ enumerable: !1,
282
+ configurable: !0
283
+ }), Object.defineProperty(n, "invalidConnectionStateTransition", {
284
+ get: function () {
285
+ return new n({
286
+ code: u.INVALID_CONNECTION_STATE_TRANSITION,
287
+ message: "Invalid connection state transition."
288
+ })
289
+ },
290
+ enumerable: !1,
291
+ configurable: !0
292
+ }), Object.defineProperty(n, "connectionRequired", {
293
+ get: function () {
294
+ return new n({
295
+ code: u.CONNECTION_REQUIRED,
296
+ message: "Connection is required."
297
+ })
298
+ },
299
+ enumerable: !1,
300
+ configurable: !0
301
+ }), Object.defineProperty(n, "connectionCanceled", {
302
+ get: function () {
303
+ return new n({
304
+ code: u.CONNECTION_CANCELED,
305
+ message: "Connection is canceled."
306
+ })
307
+ },
308
+ enumerable: !1,
309
+ configurable: !0
310
+ }), Object.defineProperty(n, "invalidParameters", {
311
+ get: function () {
312
+ return new n({
313
+ code: u.INVALID_PARAMETER,
314
+ message: "Invalid parameters."
315
+ })
316
+ },
317
+ enumerable: !1,
318
+ configurable: !0
319
+ }), Object.defineProperty(n, "networkError", {
320
+ get: function () {
321
+ return new n({
322
+ code: u.NETWORK_ERROR,
323
+ message: "There was a network error."
324
+ })
325
+ },
326
+ enumerable: !1,
327
+ configurable: !0
328
+ }), Object.defineProperty(n, "markAsReadAllRateLimitExceeded", {
329
+ get: function () {
330
+ return new n({
331
+ code: u.MARK_AS_READ_RATE_LIMIT_EXCEEDED,
332
+ message: "markAsRead rate limit exceeded."
333
+ })
334
+ },
335
+ enumerable: !1,
336
+ configurable: !0
337
+ }), Object.defineProperty(n, "queryInProgress", {
338
+ get: function () {
339
+ return new n({
340
+ code: u.QUERY_IN_PROGRESS,
341
+ message: "Query in progress."
342
+ })
343
+ },
344
+ enumerable: !1,
345
+ configurable: !0
346
+ }), Object.defineProperty(n, "noAckTimeout", {
347
+ get: function () {
348
+ return new n({
349
+ code: u.ACK_TIMEOUT,
350
+ message: "Command received no ack."
351
+ })
352
+ },
353
+ enumerable: !1,
354
+ configurable: !0
355
+ }), Object.defineProperty(n, "loginTimeout", {
356
+ get: function () {
357
+ return new n({
358
+ code: u.LOGIN_TIMEOUT,
359
+ message: "Connection timeout."
360
+ })
361
+ },
362
+ enumerable: !1,
363
+ configurable: !0
364
+ }), Object.defineProperty(n, "connectionClosed", {
365
+ get: function () {
366
+ return new n({
367
+ code: u.WEBSOCKET_CONNECTION_CLOSED,
368
+ message: "Connection is closed. Please reconnect."
369
+ })
370
+ },
371
+ enumerable: !1,
372
+ configurable: !0
373
+ }), Object.defineProperty(n, "requestFailed", {
374
+ get: function () {
375
+ return new n({
376
+ code: u.REQUEST_FAILED,
377
+ message: "Request failed."
378
+ })
379
+ },
380
+ enumerable: !1,
381
+ configurable: !0
382
+ }), Object.defineProperty(n, "fileUploadCanceled", {
383
+ get: function () {
384
+ return new n({
385
+ code: u.FILE_UPLOAD_CANCEL_FAILED,
386
+ message: "File upload has been canceled."
387
+ })
388
+ },
389
+ enumerable: !1,
390
+ configurable: !0
391
+ }), Object.defineProperty(n, "requestCanceled", {
392
+ get: function () {
393
+ return new n({
394
+ code: u.REQUEST_CANCELED,
395
+ message: "Request has been canceled."
396
+ })
397
+ },
398
+ enumerable: !1,
399
+ configurable: !0
400
+ }), Object.defineProperty(n, "sessionTokenRefreshFailed", {
401
+ get: function () {
402
+ return new n({
403
+ code: u.SESSION_TOKEN_REFRESH_FAILED,
404
+ message: "Failed to refresh the session key."
405
+ })
406
+ },
407
+ enumerable: !1,
408
+ configurable: !0
409
+ }), Object.defineProperty(n, "sessionTokenRequestFailed", {
410
+ get: function () {
411
+ return new n({
412
+ code: u.SESSION_TOKEN_REQUEST_FAILED,
413
+ message: "Failed to get the session token."
414
+ })
415
+ },
416
+ enumerable: !1,
417
+ configurable: !0
418
+ }), n.prototype.throwOutside = function () {
419
+ throw this.shouldThrowOutside = !0, this
420
+ }, n
421
+ }(Error),
422
+ 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],
423
+ _$1 = [u.WEBSOCKET_CONNECTION_CLOSED, u.WEBSOCKET_CONNECTION_FAILED, u.CONNECTION_REQUIRED],
424
+ g = function (e, t) {
425
+ if (e !== t) {
426
+ var r = n({}, e),
427
+ i = n({}, t);
428
+ 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)))
429
+ }
430
+ return !0
431
+ },
432
+ y = function (e, t, n) {
433
+ return void 0 === n && (n = !1), !(!n || null != t) || ("string" != typeof e ? "object" == typeof e ? m(e, t) : v(e, t) : typeof t === e)
434
+ },
435
+ m = function (e, t, n) {
436
+ return void 0 === n && (n = !1), !(!n || null != t) || Object.values(e).includes(t)
437
+ },
438
+ v = function (e, t) {
439
+ return t instanceof e
440
+ },
441
+ E = function (e, t, n) {
442
+ return void 0 === n && (n = !1), !(!n || null != t) || Array.isArray(t) && t.every((function (t) {
443
+ return y(e, t)
444
+ }))
445
+ },
446
+ I = function (e) {
447
+ return e > 0 && _$1.indexOf(e) >= 0
448
+ },
449
+ S = function (e, t) {
450
+ if (void 0 === t && (t = !1), t && null === e) return !0;
451
+ 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;
452
+ if (!n) {
453
+ if ("undefined" != typeof Blob) return e instanceof Blob;
454
+ if ("undefined" != typeof File) return e instanceof File
455
+ }
456
+ return n
457
+ },
458
+ T$1 = function (e, t) {
459
+ if (e === t) return !0;
460
+ if (null == e || null == t) return !1;
461
+ if (e.length !== t.length) return !1;
462
+ for (var n = a([], o(e), !1).sort(), r = a([], o(t), !1).sort(), i = 0; i < n.length; ++i)
463
+ if (n[i] !== r[i]) return !1;
464
+ return !0
465
+ },
466
+ b = function () {
467
+ function e(e) {
468
+ var t = void 0 === e ? {} : e,
469
+ n = t.useMemberInfoInMessage,
470
+ r = void 0 !== n && n,
471
+ i = t.typingIndicatorInvalidateTime,
472
+ s = void 0 === i ? 1e4 : i,
473
+ o = t.typingIndicatorThrottle,
474
+ a = void 0 === o ? 1e3 : o,
475
+ u = t.websocketResponseTimeout,
476
+ c = void 0 === u ? 1e4 : u;
477
+ this._useMemberInfoInMessage = !1, this._typingIndicatorInvalidateTime = 1e4, this._typingIndicatorThrottle = 1e3, this._websocketResponseTimeout = 1e4, this._useMemberInfoInMessage = r, this._typingIndicatorInvalidateTime = s, this._typingIndicatorThrottle = a, this._websocketResponseTimeout = c;
478
+ }
479
+ return Object.defineProperty(e.prototype, "useMemberInfoInMessage", {
480
+ get: function () {
481
+ return this._useMemberInfoInMessage
482
+ },
483
+ set: function (e) {
484
+ y("boolean", e) && (this._useMemberInfoInMessage = e);
485
+ },
486
+ enumerable: !1,
487
+ configurable: !0
488
+ }), Object.defineProperty(e.prototype, "typingIndicatorInvalidateTime", {
489
+ get: function () {
490
+ return this._typingIndicatorInvalidateTime
491
+ },
492
+ set: function (e) {
493
+ y("number", e) && (this._typingIndicatorInvalidateTime = e);
494
+ },
495
+ enumerable: !1,
496
+ configurable: !0
497
+ }), Object.defineProperty(e.prototype, "typingIndicatorThrottle", {
498
+ get: function () {
499
+ return this._typingIndicatorThrottle
500
+ },
501
+ set: function (e) {
502
+ y("number", e) && e >= 1e3 && e <= 9e3 && (this._typingIndicatorThrottle = e);
503
+ },
504
+ enumerable: !1,
505
+ configurable: !0
506
+ }), Object.defineProperty(e.prototype, "websocketResponseTimeout", {
507
+ get: function () {
508
+ return this._websocketResponseTimeout
509
+ },
510
+ set: function (e) {
511
+ y("number", e) && e >= 5e3 && e <= 3e4 && (this._websocketResponseTimeout = e);
512
+ },
513
+ enumerable: !1,
514
+ configurable: !0
515
+ }), e
516
+ }(),
517
+ N = {
518
+ key: "__ev",
519
+ value: {
520
+ k: "__ev",
521
+ v: "scs"
522
+ },
523
+ generation: 1
524
+ },
525
+ A$1 = {
526
+ encrypt: function (e) {
527
+ return e
528
+ },
529
+ decrypt: function (e) {
530
+ return e
531
+ }
532
+ },
533
+ C$1 = function () {
534
+ function e(e) {
535
+ var t = e.store;
536
+ this._preference = new Map, this._store = t;
537
+ }
538
+ return e.prototype._savePreferenceKeys = function () {
539
+ return r(this, void 0, void 0, (function () {
540
+ return i(this, (function (e) {
541
+ switch (e.label) {
542
+ case 0:
543
+ return [4, this._store.set({
544
+ key: this._keysAddress,
545
+ value: a([], o(this._preference.keys()), !1),
546
+ generation: 1
547
+ })];
548
+ case 1:
549
+ return e.sent(), [2]
550
+ }
551
+ }))
552
+ }))
553
+ }, e.prototype.init = function (e) {
554
+ var t;
555
+ return r(this, void 0, void 0, (function () {
556
+ var n, r, o, a, u, c, l, d;
557
+ return i(this, (function (i) {
558
+ switch (i.label) {
559
+ case 0:
560
+ return this._keysAddress = e, [4, this._store.get(e)];
561
+ case 1:
562
+ n = null !== (t = i.sent()) && void 0 !== t ? t : [], i.label = 2;
563
+ case 2:
564
+ i.trys.push([2, 7, 8, 9]), r = s(n), o = r.next(), i.label = 3;
565
+ case 3:
566
+ return o.done ? [3, 6] : (a = o.value, [4, this._store.get(a)]);
567
+ case 4:
568
+ (u = i.sent()) && this._preference.set(a, u), i.label = 5;
569
+ case 5:
570
+ return o = r.next(), [3, 3];
571
+ case 6:
572
+ return [3, 9];
573
+ case 7:
574
+ return c = i.sent(), l = {
575
+ error: c
576
+ }, [3, 9];
577
+ case 8:
578
+ try {
579
+ o && !o.done && (d = r.return) && d.call(r);
580
+ } finally {
581
+ if (l) throw l.error
582
+ }
583
+ return [7];
584
+ case 9:
585
+ return [2]
586
+ }
587
+ }))
588
+ }))
589
+ }, e.prototype.get = function (e) {
590
+ var t;
591
+ return r(this, void 0, void 0, (function () {
592
+ return i(this, (function (n) {
593
+ return [2, null !== (t = this._preference.get(e)) && void 0 !== t ? t : null]
594
+ }))
595
+ }))
596
+ }, e.prototype.set = function (e, t) {
597
+ return r(this, void 0, void 0, (function () {
598
+ var n;
599
+ return i(this, (function (r) {
600
+ switch (r.label) {
601
+ case 0:
602
+ return n = !this._preference.has(e), [4, this._store.set({
603
+ key: e,
604
+ value: t,
605
+ generation: 1
606
+ })];
607
+ case 1:
608
+ return r.sent(), this._preference.set(e, t), n ? [4, this._savePreferenceKeys()] : [3, 3];
609
+ case 2:
610
+ r.sent(), r.label = 3;
611
+ case 3:
612
+ return [2]
613
+ }
614
+ }))
615
+ }))
616
+ }, e.prototype.remove = function (e) {
617
+ return r(this, void 0, void 0, (function () {
618
+ return i(this, (function (t) {
619
+ switch (t.label) {
620
+ case 0:
621
+ return [4, this._store.remove(e)];
622
+ case 1:
623
+ return t.sent(), this._preference.delete(e), [4, this._savePreferenceKeys()];
624
+ case 2:
625
+ return t.sent(), [2]
626
+ }
627
+ }))
628
+ }))
629
+ }, e.prototype.clear = function () {
630
+ return r(this, void 0, void 0, (function () {
631
+ return i(this, (function (e) {
632
+ switch (e.label) {
633
+ case 0:
634
+ return [4, this._store.removeMany(a([], o(this._preference.keys()), !1))];
635
+ case 1:
636
+ return e.sent(), this._preference.clear(), [4, this._savePreferenceKeys()];
637
+ case 2:
638
+ return e.sent(), [2]
639
+ }
640
+ }))
641
+ }))
642
+ }, e
643
+ }(),
644
+ O = function (e) {
645
+ var t = e.encryption,
646
+ n = void 0 === t ? null : t,
647
+ r = e.store,
648
+ i = void 0 === r ? null : r,
649
+ s = e.localCacheEnabled,
650
+ o = void 0 === s || s;
651
+ this.nestdb = null, this.store = i, this.preference = new C$1({
652
+ store: i
653
+ }), this.encryption = null != n ? n : A$1, this.localCacheEnabled = o;
654
+ },
655
+ w = function () {
656
+ function e() {
657
+ this.sessionKey = null, this.authToken = null;
658
+ }
659
+ return Object.defineProperty(e.prototype, "hasSession", {
660
+ get: function () {
661
+ return !!this.sessionKey
662
+ },
663
+ enumerable: !1,
664
+ configurable: !0
665
+ }), e.prototype.clear = function () {
666
+ this.authToken = null, this.sessionKey = null;
667
+ }, e
668
+ }(),
669
+ R = function () {
670
+ var e = (new Date).getTime();
671
+ return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (function (t) {
672
+ var n = (e + 16 * Math.random()) % 16 | 0;
673
+ return e = Math.floor(e / 16), ("x" === t ? n : 3 & n | 8).toString(16)
674
+ }))
675
+ },
676
+ D = function () {
677
+ function e(e) {
678
+ var t = e.container;
679
+ this._container = {}, this._container = t, this.key = R();
680
+ }
681
+ return e.prototype._register = function (e, t, n) {
682
+ return e in this._container || (this._container[e] = new Map), this._container[e].set(this.key, {
683
+ occurence: t,
684
+ handler: n
685
+ }), this
686
+ }, e.prototype.on = function (e, t) {
687
+ return this._register(e, -1, t)
688
+ }, e.prototype.once = function (e, t) {
689
+ return this._register(e, 1, t)
690
+ }, e.prototype.close = function () {
691
+ for (var e in this._container) this._container[e].delete(this.key);
692
+ }, e
693
+ }(),
694
+ M = function () {
695
+ function e() {
696
+ this._container = {};
697
+ }
698
+ return e.prototype.on = function (e, t) {
699
+ return new D({
700
+ container: this._container
701
+ }).on(e, t)
702
+ }, e.prototype.once = function (e, t) {
703
+ return new D({
704
+ container: this._container
705
+ }).once(e, t)
706
+ }, e.prototype.dispatch = function (e, t) {
707
+ var n, r, i = this._container[e];
708
+ if (i) {
709
+ var o = [];
710
+ try {
711
+ for (var a = s(i.keys()), u = a.next(); !u.done; u = a.next()) {
712
+ var c = u.value,
713
+ l = i.get(c);
714
+ l.handler(t), l.occurence > 0 && (l.occurence--, 0 === l.occurence && o.push(c));
715
+ }
716
+ } catch (e) {
717
+ n = {
718
+ error: e
719
+ };
720
+ } finally {
721
+ try {
722
+ u && !u.done && (r = a.return) && r.call(a);
723
+ } finally {
724
+ if (n) throw n.error
725
+ }
726
+ }
727
+ o.forEach((function (e) {
728
+ return i.delete(e)
729
+ }));
730
+ }
731
+ }, e
732
+ }(),
733
+ k = function () {
734
+ function e() {
735
+ this._dispatcher = new M;
736
+ }
737
+ return e.prototype.on = function (e) {
738
+ return this._dispatcher.on("event", e)
739
+ }, e.prototype.once = function (e) {
740
+ return this._dispatcher.once("event", e)
741
+ }, e.prototype.dispatch = function (e) {
742
+ this._dispatcher.dispatch("event", e);
743
+ }, e
744
+ }(),
745
+ L = function () {},
746
+ U$1 = function (e) {
747
+ var t = {};
748
+ return e && Object.keys(e).forEach((function (n) {
749
+ void 0 !== e[n] && NaN !== e[n] && null !== e[n] && (t[n] = e[n]);
750
+ })), t
751
+ };
752
+ ! function (e) {
753
+ e.GET = "GET", e.POST = "POST", e.PUT = "PUT", e.DELETE = "DELETE";
754
+ }(d$1 || (d$1 = {}));
755
+ var P, q$1 = function (e) {
756
+ function n() {
757
+ var t = null !== e && e.apply(this, arguments) || this;
758
+ return t.params = {}, t.requireAuth = !0, t.headers = {}, t.requestId = R(), t
759
+ }
760
+ return t(n, e), n.prototype.stringifyParams = function (e) {
761
+ return "object" != typeof e || Array.isArray(e) ? String(e) : e ? JSON.stringify(e) : ""
762
+ }, Object.defineProperty(n.prototype, "query", {
763
+ get: function () {
764
+ var e = this,
765
+ t = U$1(this.params);
766
+ return "?".concat(Object.keys(t).map((function (n) {
767
+ return "".concat(encodeURIComponent(n), "=").concat(encodeURIComponent(e.stringifyParams(t[n])))
768
+ })).join("&"))
769
+ },
770
+ enumerable: !1,
771
+ configurable: !0
772
+ }), Object.defineProperty(n.prototype, "payload", {
773
+ get: function () {
774
+ var e = this,
775
+ t = U$1(this.params);
776
+ if (Object.keys(t).some((function (e) {
777
+ return S(t[e])
778
+ }))) {
779
+ var n = new FormData;
780
+ return Object.keys(t).forEach((function (r) {
781
+ var i, s = t[r];
782
+ if (S(s)) {
783
+ var o = s;
784
+ n.append(r, o, null !== (i = o.name) && void 0 !== i ? i : "filename");
785
+ } else n.append(r, e.stringifyParams(s));
786
+ })), n
787
+ }
788
+ return JSON.stringify(t)
789
+ },
790
+ enumerable: !1,
791
+ configurable: !0
792
+ }), n
793
+ }(L),
794
+ F = function (e) {
795
+ function r(t, n) {
796
+ var r = e.call(this) || this;
797
+ return r._iid = t, r._payload = n, r
798
+ }
799
+ return t(r, e), Object.defineProperty(r.prototype, "payload", {
800
+ get: function () {
801
+ return n({}, this._payload)
802
+ },
803
+ enumerable: !1,
804
+ configurable: !0
805
+ }), r.prototype.as = function (e) {
806
+ return new e(this._iid, this.payload)
807
+ }, r
808
+ }(L),
809
+ x = function (e) {
810
+ function n(t) {
811
+ var n = e.call(this) || this;
812
+ return n.requestId = t, n
813
+ }
814
+ return t(n, e), n
815
+ }(L),
816
+ G$1 = function (e) {
817
+ function n() {
818
+ return null !== e && e.apply(this, arguments) || this
819
+ }
820
+ return t(n, e), n
821
+ }(L),
822
+ Q$1 = function (e) {
823
+ function n(t) {
824
+ var n = e.call(this) || this;
825
+ return n.statLog = t, n
826
+ }
827
+ return t(n, e), n
828
+ }(L);
829
+ ! function (e) {
830
+ e.WEBSOCKET_CONNECT = "ws:connect", e.API_RESULT = "api:result";
831
+ }(P || (P = {}));
832
+ var j$1, K$1 = function () {
833
+ function e(e) {
834
+ var t = e.type,
835
+ n = e.data,
836
+ r = e.ts,
837
+ i = void 0 === r ? Date.now() : r;
838
+ this.type = t, this.createdAt = i, this.data = n;
839
+ }
840
+ return e.payloadify = function (e) {
841
+ return U$1({
842
+ stat_type: e.type,
843
+ ts: e.createdAt,
844
+ data: U$1(e.data)
845
+ })
846
+ }, e
847
+ }(),
848
+ z$1 = function () {
849
+ return "undefined" == typeof document && "undefined" != typeof navigator && "ReactNative" == navigator.product
850
+ },
851
+ V$1 = function () {
852
+ function e(e, t) {
853
+ var n = t.auth,
854
+ r = t.sdkState,
855
+ i = t.dispatcher,
856
+ s = t.logger,
857
+ o = this;
858
+ this._abortControl = new Map, this._iid = e, this._auth = n, this._sdkState = r, this._dispatcher = i, this._dispatcher.on((function (e) {
859
+ e instanceof x && o.cancel(e.requestId);
860
+ })), this._logger = s;
861
+ }
862
+ return Object.defineProperty(e.prototype, "_userAgentWithExtension", {
863
+ get: function () {
864
+ var e = this._sdkState.extensions,
865
+ t = z$1() ? "reactnative" : "JS",
866
+ n = e.sb_syncmanager ? "s".concat(e.sb_syncmanager) : "",
867
+ r = e.sb_uikit ? "u".concat(e.sb_uikit) : "",
868
+ i = e["device-os-platform"] ? "o".concat(e["device-os-platform"]) : "";
869
+ return "".concat(t, "/c").concat(l$1.SDK_VERSION, "/").concat(n, "/").concat(r, "/").concat(i)
870
+ },
871
+ enumerable: !1,
872
+ configurable: !0
873
+ }), e.prototype._createHeader = function (e, t) {
874
+ void 0 === t && (t = null);
875
+ var r = this._sdkState,
876
+ i = r.appId,
877
+ s = r.appVersion,
878
+ o = n(n({}, e.headers), {
879
+ SendBird: "JS,".concat(l$1.OS_VERSION, ",").concat(l$1.SDK_VERSION, ",").concat(i).concat(s ? ",".concat(s) : ""),
880
+ "SB-User-Agent": encodeURIComponent(this._userAgentWithExtension),
881
+ "Request-Sent-Timestamp": Date.now().toString()
882
+ });
883
+ 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
884
+ }, e.prototype._statLogApiResult = function (e, t, n) {
885
+ this._dispatcher.dispatch(new Q$1(new K$1({
886
+ type: P.API_RESULT,
887
+ data: {
888
+ endpoint: e.path,
889
+ method: e.method,
890
+ success: !n,
891
+ latency: Date.now() - t,
892
+ error_code: null == n ? void 0 : n.code,
893
+ error_description: null == n ? void 0 : n.message
894
+ }
895
+ })));
896
+ }, e.prototype.send = function (e) {
897
+ return r(this, void 0, void 0, (function () {
898
+ var t, n, r, s, o, a, u, c, l, h, f, _, g, y, m;
899
+ return i(this, (function (i) {
900
+ switch (i.label) {
901
+ case 0:
902
+ t = e.path, n = e.method, r = ![d$1.GET, d$1.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;
903
+ case 1:
904
+ return i.trys.push([1, 4, , 5]), [4, fetch(o, {
905
+ method: n,
906
+ body: a,
907
+ headers: u,
908
+ signal: l
909
+ })];
910
+ case 2:
911
+ return [4, (f = i.sent()).json()];
912
+ case 3:
913
+ 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, _)];
914
+ throw _ ? ((g = new p(_)).isSessionKeyExpiredError && this._dispatcher.dispatch(new G$1), this._statLogApiResult(e, h, g), g) : (g = p.requestFailed, this._statLogApiResult(e, h, g), g);
915
+ case 4:
916
+ 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);
917
+ case 5:
918
+ return [2]
919
+ }
920
+ }))
921
+ }))
922
+ }, e.prototype.cancel = function (e) {
923
+ this._abortControl.has(e) && (this._abortControl.get(e).abort(), this._abortControl.delete(e));
924
+ }, e.prototype.cancelAll = function () {
925
+ var e, t;
926
+ try {
927
+ for (var n = s(this._abortControl.values()), r = n.next(); !r.done; r = n.next()) {
928
+ r.value.abort();
929
+ }
930
+ } catch (t) {
931
+ e = {
932
+ error: t
933
+ };
934
+ } finally {
935
+ try {
936
+ r && !r.done && (t = n.return) && t.call(n);
937
+ } finally {
938
+ if (e) throw e.error
939
+ }
940
+ }
941
+ this._abortControl.clear();
942
+ }, e
943
+ }(),
944
+ B$1 = function (e) {
945
+ function n(t, n, r, i) {
946
+ void 0 === i && (i = "");
947
+ var s, o = this;
948
+ 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
949
+ }
950
+ return t(n, e), n.createFromRawMessage = function (e, t) {
951
+ var r = t.substring(0, 4),
952
+ i = null;
953
+ try {
954
+ i = JSON.parse(t.substring(4));
955
+ } catch (e) {
956
+ r = "NOOP";
957
+ } finally {
958
+ return new n(e, r, i)
959
+ }
960
+ }, n.prototype.convertToMessage = function () {
961
+ return "".concat(this.code).concat(JSON.stringify(this.payload), "\n")
962
+ }, n.prototype.as = function (e) {
963
+ return new e(this._iid, this.code, this.payload)
964
+ }, n
965
+ }(L),
966
+ H$2 = function (e) {
967
+ function n(t) {
968
+ var n, r = t.code,
969
+ i = t.ackRequired,
970
+ s = t.payload,
971
+ o = void 0 === s ? null : s,
972
+ a = this;
973
+ 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
974
+ }
975
+ return t(n, e), n.prototype.convertToMessage = function () {
976
+ return "".concat(this.code).concat(JSON.stringify(this.payload), "\n")
977
+ }, n
978
+ }(L),
979
+ W$1 = function (e) {
980
+ function n() {
981
+ return e.call(this, {
982
+ code: "PING",
983
+ payload: {
984
+ id: Date.now(),
985
+ active: 1
986
+ },
987
+ ackRequired: !1
988
+ }) || this
989
+ }
990
+ return t(n, e), n
991
+ }(H$2),
992
+ X$1 = function () {
993
+ function e(e) {
994
+ var t = e.pingDelegate,
995
+ n = e.sdkState,
996
+ r = e.logger;
997
+ this._pingTimer = null, this._pingTimeoutTimer = null, this.pingDelegate = t, this.sdkState = n, this._logger = r;
998
+ }
999
+ return Object.defineProperty(e.prototype, "isWaiting", {
1000
+ get: function () {
1001
+ return !!this._pingTimeoutTimer
1002
+ },
1003
+ enumerable: !1,
1004
+ configurable: !0
1005
+ }), e.prototype.ping = function () {
1006
+ var e, t = this,
1007
+ n = new W$1;
1008
+ try {
1009
+ var r = null !== (e = this.sdkState.websocket.pongTimeout) && void 0 !== e ? e : 5e3;
1010
+ this._pingTimeoutTimer = setTimeout((function () {
1011
+ t._logger.debug("pinger.ping() timeout"), t.pingDelegate.error(null);
1012
+ }), r), this.pingDelegate.send(n), this._logger.debug("pinger.ping()");
1013
+ } catch (e) {
1014
+ this._logger.debug("pinger.ping() error", e), this._pingTimeoutTimer && (clearTimeout(this._pingTimeoutTimer), this._pingTimeoutTimer = null), this.pingDelegate.error(null);
1015
+ }
1016
+ return n
1017
+ }, e.prototype.pong = function () {
1018
+ this._logger.debug("pinger.pong()"), this._pingTimeoutTimer && (clearTimeout(this._pingTimeoutTimer), this._pingTimeoutTimer = null);
1019
+ }, e.prototype.refreshTimer = function () {
1020
+ var e, t = this;
1021
+ this._logger.debug("pinger.refreshTimer()");
1022
+ var n = null !== (e = this.sdkState.websocket.pingInterval) && void 0 !== e ? e : 15e3;
1023
+ this.stop(), this._pingTimer = setInterval((function () {
1024
+ t.ping();
1025
+ }), n);
1026
+ }, e.prototype.start = function () {
1027
+ this._logger.debug("pinger.start()"), this.refreshTimer(), this.ping();
1028
+ }, e.prototype.stop = function () {
1029
+ this._logger.debug("pinger.stop()"), this._pingTimer && (clearInterval(this._pingTimer), this._pingTimer = null), this._pingTimeoutTimer && (clearTimeout(this._pingTimeoutTimer), this._pingTimeoutTimer = null);
1030
+ }, e
1031
+ }(),
1032
+ Y$1 = function () {};
1033
+ ! function (e) {
1034
+ e.CONNECTING = "CONNECTING", e.OPEN = "OPEN", e.CLOSED = "CLOSED";
1035
+ }(j$1 || (j$1 = {}));
1036
+ var J$1, Z$1 = function (e) {
1037
+ function n(t, n) {
1038
+ var r = n.sdkState,
1039
+ i = n.dispatcher,
1040
+ s = n.logger,
1041
+ o = e.call(this) || this;
1042
+ 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({
1043
+ pingDelegate: {
1044
+ send: function (e) {
1045
+ return o.send(e)
1046
+ },
1047
+ error: function (e) {
1048
+ return o.error(e)
1049
+ }
1050
+ },
1051
+ sdkState: o._sdkState,
1052
+ logger: s
1053
+ })), o
1054
+ }
1055
+ return t(n, e), Object.defineProperty(n.prototype, "connectionState", {
1056
+ get: function () {
1057
+ if (this._ws) switch (this._ws.readyState) {
1058
+ case 0:
1059
+ return j$1.CONNECTING;
1060
+ case 1:
1061
+ return j$1.OPEN
1062
+ }
1063
+ return j$1.CLOSED
1064
+ },
1065
+ enumerable: !1,
1066
+ configurable: !0
1067
+ }), n.prototype.connect = function (e) {
1068
+ var t = this;
1069
+ this._ws = new WebSocket(e), this._ws.onopen = function () {
1070
+ t._logger.debug("websocket open"), t.dispatch("open");
1071
+ }, this._ws.onmessage = function (e) {
1072
+ e.data.split("\n").forEach((function (e) {
1073
+ if (e && y("string", e)) {
1074
+ var n = B$1.createFromRawMessage(t._iid, e);
1075
+ 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$1) : "NOOP" === n.code || t.dispatch("message", n);
1076
+ }
1077
+ }));
1078
+ }, this._ws.onerror = function () {
1079
+ t._logger.debug("websocket error"), t._pinger && t._pinger.stop(), t.dispatch("error", p.networkError);
1080
+ }, this._ws.onclose = function () {
1081
+ t._logger.debug("websocket close"), t._pinger && t._pinger.stop(), t.dispatch("close");
1082
+ }, this.lastActive = Date.now();
1083
+ }, n.prototype.disconnect = function () {
1084
+ var e = this;
1085
+ 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 () {
1086
+ e.dispatch("close");
1087
+ }, this._ws.close(), this._ws = null);
1088
+ }, n.prototype.send = function (e) {
1089
+ if (!this._ws) throw p.connectionClosed;
1090
+ "PING" !== e.code ? this._pinger && this._pinger.refreshTimer() : this._logger.debug("send ping", e), this._ws.send(e.convertToMessage());
1091
+ }, n.prototype.error = function (e) {
1092
+ this._logger.debug("websocket error", e), this._pinger && this._pinger.stop(), this.dispatch("error", e);
1093
+ }, n
1094
+ }(M),
1095
+ $$1 = function (e) {
1096
+ function n(t) {
1097
+ var n = t.all,
1098
+ r = t.custom_types,
1099
+ i = t.ts,
1100
+ s = e.call(this) || this;
1101
+ return s.all = n, s.customTypes = r, s.ts = i, s
1102
+ }
1103
+ return t(n, e), n
1104
+ }(L),
1105
+ ee$1 = function () {
1106
+ var e = this;
1107
+ this.promise = new Promise((function (t, n) {
1108
+ e.resolve = t, e.reject = n;
1109
+ }));
1110
+ },
1111
+ te$1 = function () {
1112
+ function e(e, t) {
1113
+ var n = t.auth,
1114
+ r = t.sdkState,
1115
+ i = t.dispatcher,
1116
+ s = t.logger,
1117
+ o = this;
1118
+ this._ackStateMap = new Map, this._sdkState = r, this._dispatcher = i, this._logger = s, this.apiClient = new V$1(e, {
1119
+ auth: n,
1120
+ sdkState: r,
1121
+ dispatcher: i,
1122
+ logger: s
1123
+ }), this.websocketClient = new Z$1(e, {
1124
+ sdkState: r,
1125
+ dispatcher: i,
1126
+ logger: s
1127
+ }), this.websocketClient.on("message", (function (e) {
1128
+ if (e.payload.unread_cnt && o._dispatcher.dispatch(new $$1(e.payload.unread_cnt)), e.requestId) {
1129
+ if (o._ackStateMap.has(e.requestId)) {
1130
+ var t = o._ackStateMap.get(e.requestId);
1131
+ "EROR" !== e.code ? t.resolve(e) : t.reject(new p({
1132
+ code: e.payload.code,
1133
+ message: e.payload.message
1134
+ }));
1135
+ }
1136
+ } else o._dispatcher.dispatch(e);
1137
+ })).on("close", (function () {
1138
+ o._ackStateMap.forEach((function (e) {
1139
+ e.reject(p.connectionClosed);
1140
+ })), o._ackStateMap.clear();
1141
+ }));
1142
+ }
1143
+ return e.prototype._sendApiRequest = function (e) {
1144
+ return r(this, void 0, void 0, (function () {
1145
+ return i(this, (function (t) {
1146
+ switch (t.label) {
1147
+ case 0:
1148
+ return [4, this.apiClient.send(e)];
1149
+ case 1:
1150
+ return [2, t.sent()]
1151
+ }
1152
+ }))
1153
+ }))
1154
+ }, e.prototype._sendWebsocketRequest = function (e) {
1155
+ return r(this, void 0, void 0, (function () {
1156
+ var t, n, r, s = this;
1157
+ return i(this, (function (i) {
1158
+ if (t = new ee$1, e.ackRequired) {
1159
+ n = null, r = function (r, i) {
1160
+ 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)));
1161
+ };
1162
+ try {
1163
+ n = setTimeout((function () {
1164
+ return r(p.noAckTimeout)
1165
+ }), this._sdkState.websocket.responseTimeout), this._ackStateMap.set(e.requestId, {
1166
+ resolve: function (e) {
1167
+ return r(null, e)
1168
+ },
1169
+ reject: function (e) {
1170
+ return r(e)
1171
+ }
1172
+ }), this.websocketClient.send(e);
1173
+ } catch (e) {
1174
+ r(e);
1175
+ }
1176
+ } else try {
1177
+ this.websocketClient.send(e), t.resolve(null);
1178
+ } catch (e) {
1179
+ t.reject(e);
1180
+ }
1181
+ return [2, t.promise]
1182
+ }))
1183
+ }))
1184
+ }, e.prototype.send = function (e) {
1185
+ return r(this, void 0, void 0, (function () {
1186
+ return i(this, (function (t) {
1187
+ switch (t.label) {
1188
+ case 0:
1189
+ return e instanceof q$1 ? [4, this._sendApiRequest(e)] : [3, 2];
1190
+ case 1:
1191
+ case 3:
1192
+ return [2, t.sent()];
1193
+ case 2:
1194
+ return e instanceof H$2 ? [4, this._sendWebsocketRequest(e)] : [3, 4];
1195
+ case 4:
1196
+ throw p.invalidParameters
1197
+ }
1198
+ }))
1199
+ }))
1200
+ }, e.prototype.cancel = function (e) {
1201
+ this.apiClient.cancel(e);
1202
+ }, e.prototype.cancelAll = function () {
1203
+ this.apiClient.cancelAll();
1204
+ }, e
1205
+ }();
1206
+ ! function (e) {
1207
+ 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";
1208
+ }(J$1 || (J$1 = {}));
1209
+ var ne$1, re$1, ie$1, se$1, oe$2, ae$1, ue$2, ce$2, le$2, de$2 = function (e) {
1210
+ function n(t) {
1211
+ var n = t.stateType,
1212
+ r = e.call(this) || this;
1213
+ return r.stateType = n, r
1214
+ }
1215
+ return t(n, e), n
1216
+ }(L),
1217
+ he$2 = function () {
1218
+ function e(e, t) {
1219
+ var n = t.auth,
1220
+ s = t.sdkState,
1221
+ o = t.dispatcher,
1222
+ a = t.logger,
1223
+ u = this;
1224
+ this._currentConnectionStateType = J$1.INITIALIZED, this._lazyCallQueue = [], this.commandRouter = new te$1(e, {
1225
+ auth: n,
1226
+ sdkState: s,
1227
+ dispatcher: o,
1228
+ logger: a
1229
+ }), this._auth = n, this._logger = a, this._dispatcher = o, this._dispatcher.on((function (e) {
1230
+ if (e instanceof de$2) {
1231
+ var t = e.stateType;
1232
+ switch (u._currentConnectionStateType = t, t) {
1233
+ case J$1.CONNECTED:
1234
+ var n = u._lazyCallQueue;
1235
+ u._lazyCallQueue = [], n.forEach((function (e) {
1236
+ return r(u, void 0, void 0, (function () {
1237
+ var t, n, r, s, o;
1238
+ return i(this, (function (i) {
1239
+ switch (i.label) {
1240
+ case 0:
1241
+ t = e.command, n = e.deferred, r = e.timeout, clearTimeout(r), i.label = 1;
1242
+ case 1:
1243
+ return i.trys.push([1, 3, , 4]), [4, this.send(t)];
1244
+ case 2:
1245
+ return s = i.sent(), n.resolve(s), [3, 4];
1246
+ case 3:
1247
+ return o = i.sent(), n.reject(o), [3, 4];
1248
+ case 4:
1249
+ return [2]
1250
+ }
1251
+ }))
1252
+ }))
1253
+ }));
1254
+ break;
1255
+ case J$1.INITIALIZED:
1256
+ case J$1.DISCONNECTED:
1257
+ case J$1.LOGOUT:
1258
+ n = u._lazyCallQueue;
1259
+ u._lazyCallQueue = [], n.forEach((function (e) {
1260
+ return r(u, void 0, void 0, (function () {
1261
+ var t, n;
1262
+ return i(this, (function (r) {
1263
+ return t = e.deferred, n = e.timeout, clearTimeout(n), this._auth && this._auth.hasSession ? t.reject(p.connectionClosed) : t.reject(p.connectionRequired), [2]
1264
+ }))
1265
+ }))
1266
+ }));
1267
+ }
1268
+ }
1269
+ }));
1270
+ }
1271
+ return Object.defineProperty(e.prototype, "isReady", {
1272
+ get: function () {
1273
+ return this._currentConnectionStateType === J$1.CONNECTED
1274
+ },
1275
+ enumerable: !1,
1276
+ configurable: !0
1277
+ }), Object.defineProperty(e.prototype, "isLazyCallActivated", {
1278
+ get: function () {
1279
+ return this._currentConnectionStateType === J$1.CONNECTING || this._currentConnectionStateType === J$1.RECONNECTING
1280
+ },
1281
+ enumerable: !1,
1282
+ configurable: !0
1283
+ }), e.prototype.send = function (e) {
1284
+ return r(this, void 0, void 0, (function () {
1285
+ var t, n, r = this;
1286
+ return i(this, (function (i) {
1287
+ switch (i.label) {
1288
+ case 0:
1289
+ return e instanceof H$2 ? this.isReady ? (this._logger.debug("send websocket request", e), [4, this.commandRouter.send(e)]) : [3, 2] : [3, 4];
1290
+ case 1:
1291
+ case 5:
1292
+ return [2, i.sent()];
1293
+ case 2:
1294
+ if (this.isLazyCallActivated) return this._logger.debug("wait websocket request", e), t = new ee$1, this._lazyCallQueue.push({
1295
+ command: e,
1296
+ deferred: t,
1297
+ timeout: setTimeout((function () {
1298
+ return r.timeout(e.requestId)
1299
+ }), 1e4)
1300
+ }), [2, t.promise];
1301
+ throw this._logger.debug("fail websocket request"), p.connectionRequired;
1302
+ case 3:
1303
+ return [3, 7];
1304
+ case 4:
1305
+ return e instanceof q$1 ? this._auth.hasSession ? (this._logger.debug("send api request", e), [4, this.commandRouter.send(e)]) : [3, 6] : [3, 7];
1306
+ case 6:
1307
+ if (this.isLazyCallActivated) return this._logger.debug("wait api request", e), t = new ee$1, this._lazyCallQueue.push({
1308
+ command: e,
1309
+ deferred: t,
1310
+ timeout: setTimeout((function () {
1311
+ return r.timeout(e.requestId)
1312
+ }), 1e4)
1313
+ }), [2, t.promise];
1314
+ throw n = p.connectionRequired, this._logger.debug("fail api request", n), n;
1315
+ case 7:
1316
+ return [2]
1317
+ }
1318
+ }))
1319
+ }))
1320
+ }, e.prototype.forceSend = function (e) {
1321
+ return r(this, void 0, void 0, (function () {
1322
+ return i(this, (function (t) {
1323
+ switch (t.label) {
1324
+ case 0:
1325
+ return this._logger.debug("send websocket request (forced)", e), [4, this.commandRouter.send(e)];
1326
+ case 1:
1327
+ return [2, t.sent()]
1328
+ }
1329
+ }))
1330
+ }))
1331
+ }, e.prototype.timeout = function (e) {
1332
+ this._logger.debug("timeout request", e);
1333
+ var t = this._lazyCallQueue.findIndex((function (t) {
1334
+ return t.command.requestId === e
1335
+ }));
1336
+ t > -1 && (this._lazyCallQueue[t].deferred.reject(p.connectionRequired), this._lazyCallQueue.splice(t, 1));
1337
+ }, e.prototype.cancel = function (e) {
1338
+ this._logger.debug("cancel api request", e), this.commandRouter.cancel(e);
1339
+ }, e.prototype.cancelAll = function () {
1340
+ this._logger.debug("cancel all api requests"), this.commandRouter.cancelAll();
1341
+ }, e
1342
+ }(),
1343
+ pe$2 = function (e) {
1344
+ function n(t) {
1345
+ var n = t.userId,
1346
+ r = t.authToken,
1347
+ i = t.expiringSession,
1348
+ s = void 0 === i || i,
1349
+ o = e.call(this) || this;
1350
+ return o.path = "/users/".concat(n, "/session_key"), o.method = d$1.POST, o.params = {
1351
+ token: r,
1352
+ expiring_session: !!s
1353
+ }, o.requireAuth = !1, o
1354
+ }
1355
+ return t(n, e), n
1356
+ }(q$1),
1357
+ fe$2 = function (e) {
1358
+ function n(t) {
1359
+ var n = t.authToken,
1360
+ r = t.expiringSession,
1361
+ i = void 0 === r || r;
1362
+ return e.call(this, {
1363
+ code: "LOGI",
1364
+ payload: {
1365
+ token: n,
1366
+ expiring_session: i ? 1 : 0
1367
+ },
1368
+ ackRequired: !0
1369
+ }) || this
1370
+ }
1371
+ return t(n, e), n
1372
+ }(H$2),
1373
+ _e$2 = function (e) {
1374
+ function n(t, n) {
1375
+ var r = e.call(this, t, n) || this,
1376
+ i = n.key;
1377
+ return r.key = i, r
1378
+ }
1379
+ return t(n, e), n
1380
+ }(F),
1381
+ ge$2 = function (e) {
1382
+ function n(t, n, r) {
1383
+ var i = e.call(this, t, "LOGI", r) || this;
1384
+ return i.error = null, i.newKey = r.new_key, i.error = r.error ? new p(r.error) : null, i
1385
+ }
1386
+ return t(n, e), n
1387
+ }(B$1),
1388
+ ye$2 = function (e) {
1389
+ function n() {
1390
+ return null !== e && e.apply(this, arguments) || this
1391
+ }
1392
+ return t(n, e), n
1393
+ }(L),
1394
+ me$2 = function (e) {
1395
+ return r(void 0, void 0, void 0, (function () {
1396
+ return i(this, (function (t) {
1397
+ return [2, new Promise((function (t) {
1398
+ return setTimeout(t, e)
1399
+ }))]
1400
+ }))
1401
+ }))
1402
+ },
1403
+ ve$2 = function () {
1404
+ function e() {}
1405
+ return e.prototype.calcTimeout = function () {
1406
+ return 0
1407
+ }, e
1408
+ }(),
1409
+ Ee$2 = function (e, t, n) {
1410
+ return void 0 === n && (n = new ve$2), r(void 0, void 0, void 0, (function () {
1411
+ var r, s, o, a, u, c;
1412
+ return i(this, (function (i) {
1413
+ switch (i.label) {
1414
+ case 0:
1415
+ r = 0, s = null, o = function (e) {
1416
+ return void 0 === e && (e = null), s = null != e ? e : new Error("Halted")
1417
+ }, a = function () {
1418
+ r = 0;
1419
+ }, i.label = 1;
1420
+ case 1:
1421
+ if (!(-1 === t || r < t)) return [3, 9];
1422
+ i.label = 2;
1423
+ case 2:
1424
+ return i.trys.push([2, 4, , 8]), [4, e(o, a)];
1425
+ case 3:
1426
+ if (u = i.sent(), s) throw s;
1427
+ return [2, u];
1428
+ case 4:
1429
+ if (c = i.sent(), s) return [3, 6];
1430
+ if (++r === t) throw c;
1431
+ return [4, me$2(n.calcTimeout(r))];
1432
+ case 5:
1433
+ return i.sent(), [3, 7];
1434
+ case 6:
1435
+ throw s;
1436
+ case 7:
1437
+ return [3, 8];
1438
+ case 8:
1439
+ return [3, 1];
1440
+ case 9:
1441
+ return [2]
1442
+ }
1443
+ }))
1444
+ }))
1445
+ },
1446
+ Ie$1 = function (e) {
1447
+ return r(void 0, void 0, void 0, (function () {
1448
+ var t;
1449
+ return i(this, (function (n) {
1450
+ switch (n.label) {
1451
+ case 0:
1452
+ return n.trys.push([0, 2, , 3]), [4, e()];
1453
+ case 1:
1454
+ return n.sent(), [3, 3];
1455
+ case 2:
1456
+ if (!((t = n.sent()) instanceof p)) throw t;
1457
+ return t.throwOutside(), [3, 3];
1458
+ case 3:
1459
+ return [2]
1460
+ }
1461
+ }))
1462
+ }))
1463
+ },
1464
+ Se$1 = function (e) {
1465
+ return r(void 0, void 0, void 0, (function () {
1466
+ return i(this, (function (t) {
1467
+ switch (t.label) {
1468
+ case 0:
1469
+ return t.trys.push([0, 2, , 3]), [4, e()];
1470
+ case 1:
1471
+ case 2:
1472
+ return t.sent(), [3, 3];
1473
+ case 3:
1474
+ return [2]
1475
+ }
1476
+ }))
1477
+ }))
1478
+ },
1479
+ Te$1 = function () {
1480
+ function e(e) {
1481
+ var t = e.auth,
1482
+ n = e.sdkState,
1483
+ r = e.dispatcher,
1484
+ i = e.requestQueue,
1485
+ s = e.logger,
1486
+ o = this;
1487
+ this._currentConnectionStateType = J$1.INITIALIZED, this.auth = t, this._sdkState = n, this._dispatcher = r, this._requestQueue = i, this._logger = s, this._dispatcher.on((function (e) {
1488
+ if (e instanceof de$2) {
1489
+ var t = e.stateType;
1490
+ o._currentConnectionStateType = t;
1491
+ } else e instanceof G$1 && o.refresh();
1492
+ }));
1493
+ }
1494
+ return e.prototype.createRefreshWebsocketCommand = function (e) {
1495
+ return new fe$2({
1496
+ authToken: e,
1497
+ expiringSession: !0
1498
+ })
1499
+ }, e.prototype._refreshSessionKey = function (e, t) {
1500
+ return r(this, void 0, void 0, (function () {
1501
+ var n, s, o, a, u, c, l, d = this;
1502
+ return i(this, (function (f) {
1503
+ switch (f.label) {
1504
+ case 0:
1505
+ if (this._currentConnectionStateType !== J$1.CONNECTED) return [3, 4];
1506
+ f.label = 1;
1507
+ case 1:
1508
+ return f.trys.push([1, 3, , 4]), n = this.createRefreshWebsocketCommand(e), [4, this._requestQueue.forceSend(n)];
1509
+ case 2:
1510
+ if (s = f.sent(), o = s.as(ge$2), a = o.newKey, u = o.error) throw u;
1511
+ return this.auth.sessionKey = null != a ? a : this.auth.sessionKey, this._logger.debug("session refreshed"), Ie$1((function () {
1512
+ return r(d, void 0, void 0, (function () {
1513
+ return i(this, (function (e) {
1514
+ return this.handler.onSessionRefreshed(), [2]
1515
+ }))
1516
+ }))
1517
+ })), t && t.resolve(), [2];
1518
+ case 3:
1519
+ if (c = f.sent(), h$1(c)) throw c;
1520
+ return c.isSessionTokenExpiredError ? (this._handleError(t), [2]) : [3, 4];
1521
+ case 4:
1522
+ return f.trys.push([4, 6, , 7]), l = new pe$2({
1523
+ userId: this._sdkState.userId,
1524
+ authToken: e,
1525
+ expiringSession: !0
1526
+ }), [4, Ee$2((function (e) {
1527
+ return r(d, void 0, void 0, (function () {
1528
+ var t, n, r;
1529
+ return i(this, (function (i) {
1530
+ switch (i.label) {
1531
+ case 0:
1532
+ return i.trys.push([0, 2, , 3]), [4, this._requestQueue.forceSend(l)];
1533
+ case 1:
1534
+ return t = i.sent(), n = t.as(_e$2).key, this.auth.sessionKey = n, [3, 3];
1535
+ case 2:
1536
+ throw (r = i.sent()).isSessionTokenExpiredError && e(p.sessionTokenRefreshFailed), r;
1537
+ case 3:
1538
+ return [2]
1539
+ }
1540
+ }))
1541
+ }))
1542
+ }), 3)];
1543
+ case 5:
1544
+ return f.sent(), this._logger.debug("session refreshed"), [3, 7];
1545
+ case 6:
1546
+ return f.sent(), this._handleError(t), [2];
1547
+ case 7:
1548
+ return Ie$1((function () {
1549
+ return r(d, void 0, void 0, (function () {
1550
+ return i(this, (function (e) {
1551
+ return this.handler.onSessionRefreshed(), [2]
1552
+ }))
1553
+ }))
1554
+ })), t && t.resolve(), [2]
1555
+ }
1556
+ }))
1557
+ }))
1558
+ }, e.prototype._handleError = function (e) {
1559
+ var t = this,
1560
+ n = p.sessionTokenRefreshFailed;
1561
+ Ie$1((function () {
1562
+ return r(t, void 0, void 0, (function () {
1563
+ return i(this, (function (e) {
1564
+ return this.handler.onSessionError(n), [2]
1565
+ }))
1566
+ }))
1567
+ })), e && e.reject(n);
1568
+ }, e.prototype.refresh = function () {
1569
+ return r(this, void 0, void 0, (function () {
1570
+ var e, t, n, s = this;
1571
+ return i(this, (function (o) {
1572
+ return this.handler ? (e = new ee$1, t = function (t) {
1573
+ t ? (s._logger.debug("session refreshing.."), s.auth.authToken = t, s._refreshSessionKey(t, e)) : (s._logger.debug("session closed"), Ie$1((function () {
1574
+ return r(s, void 0, void 0, (function () {
1575
+ return i(this, (function (e) {
1576
+ return this.handler.onSessionClosed(), [2]
1577
+ }))
1578
+ }))
1579
+ })), e.resolve());
1580
+ }, n = function () {
1581
+ s._dispatcher.dispatch(new ye$2);
1582
+ var t = p.sessionTokenRequestFailed;
1583
+ s.handler && (Ie$1((function () {
1584
+ return r(s, void 0, void 0, (function () {
1585
+ return i(this, (function (e) {
1586
+ return this.handler.onSessionError(t), [2]
1587
+ }))
1588
+ }))
1589
+ })), e.reject(t));
1590
+ }, this._logger.debug("session expired"), this.handler.onSessionExpired(), this.auth.authToken ? this._refreshSessionKey(this.auth.authToken, e) : Ie$1((function () {
1591
+ return r(s, void 0, void 0, (function () {
1592
+ return i(this, (function (e) {
1593
+ return this.handler.onSessionTokenRequired(t, n), [2]
1594
+ }))
1595
+ }))
1596
+ })), [2, e.promise]) : [2]
1597
+ }))
1598
+ }))
1599
+ }, e
1600
+ }(),
1601
+ be$2 = function () {
1602
+ function e() {
1603
+ this.type = J$1.NONE, this.name = "none";
1604
+ }
1605
+ return e.prototype.run = function (e) {
1606
+ return r(this, void 0, void 0, (function () {
1607
+ return i(this, (function (e) {
1608
+ return [2]
1609
+ }))
1610
+ }))
1611
+ }, e.prototype.onConnect = function (e, t) {
1612
+ return r(this, void 0, void 0, (function () {
1613
+ return i(this, (function (e) {
1614
+ return [2]
1615
+ }))
1616
+ }))
1617
+ }, e.prototype.onReconnect = function (e, t) {
1618
+ return t.resetReconnectCount, r(this, void 0, void 0, (function () {
1619
+ return i(this, (function (e) {
1620
+ return [2]
1621
+ }))
1622
+ }))
1623
+ }, e.prototype.onDisconnect = function (e, t) {
1624
+ return t.error, t.autoReconnect, r(this, void 0, void 0, (function () {
1625
+ return i(this, (function (e) {
1626
+ return [2]
1627
+ }))
1628
+ }))
1629
+ }, e.prototype.onLogout = function (e) {
1630
+ return r(this, void 0, void 0, (function () {
1631
+ return i(this, (function (e) {
1632
+ return [2]
1633
+ }))
1634
+ }))
1635
+ }, e
1636
+ }(),
1637
+ Ne$1 = function (e) {
1638
+ function n() {
1639
+ var t = null !== e && e.apply(this, arguments) || this;
1640
+ return t.type = J$1.LOGOUT, t.name = "logout", t
1641
+ }
1642
+ return t(n, e), n.prototype.run = function (e) {
1643
+ return r(this, void 0, void 0, (function () {
1644
+ var t, n = this;
1645
+ return i(this, (function (s) {
1646
+ switch (s.label) {
1647
+ case 0:
1648
+ return t = e.sdkState.userId, e.logout(), Ie$1((function () {
1649
+ return r(n, void 0, void 0, (function () {
1650
+ return i(this, (function (n) {
1651
+ return e.connectionHandlers.forEach((function (e) {
1652
+ e.onDisconnected(t);
1653
+ })), [2]
1654
+ }))
1655
+ }))
1656
+ })), [4, e.changeState(new Re$1)];
1657
+ case 1:
1658
+ return s.sent(), [2]
1659
+ }
1660
+ }))
1661
+ }))
1662
+ }, n
1663
+ }(be$2),
1664
+ Ae$2 = function (e) {
1665
+ function n(t) {
1666
+ var n = t.autoReconnect,
1667
+ r = e.call(this) || this;
1668
+ return r.type = J$1.DISCONNECTED, r.name = "disconnected", r._autoReconnect = !1, r._autoReconnect = n, r
1669
+ }
1670
+ return t(n, e), n.prototype.run = function (e) {
1671
+ return r(this, void 0, void 0, (function () {
1672
+ return i(this, (function (t) {
1673
+ switch (t.label) {
1674
+ case 0:
1675
+ return e.disconnect(), this._autoReconnect ? [4, e.changeState(new Ce$1)] : [3, 2];
1676
+ case 1:
1677
+ t.sent(), t.label = 2;
1678
+ case 2:
1679
+ return [2]
1680
+ }
1681
+ }))
1682
+ }))
1683
+ }, n.prototype.onConnect = function (e, t) {
1684
+ return r(this, void 0, void 0, (function () {
1685
+ return i(this, (function (n) {
1686
+ switch (n.label) {
1687
+ case 0:
1688
+ return e.disconnect(), [4, e.changeState(new we$1({
1689
+ authToken: t
1690
+ }))];
1691
+ case 1:
1692
+ return n.sent(), [2]
1693
+ }
1694
+ }))
1695
+ }))
1696
+ }, n.prototype.onReconnect = function (e) {
1697
+ return r(this, void 0, void 0, (function () {
1698
+ return i(this, (function (t) {
1699
+ switch (t.label) {
1700
+ case 0:
1701
+ return [4, e.changeState(new Ce$1)];
1702
+ case 1:
1703
+ return t.sent(), [2]
1704
+ }
1705
+ }))
1706
+ }))
1707
+ }, n.prototype.onLogout = function (e) {
1708
+ return r(this, void 0, void 0, (function () {
1709
+ return i(this, (function (t) {
1710
+ switch (t.label) {
1711
+ case 0:
1712
+ return [4, e.changeState(new Ne$1)];
1713
+ case 1:
1714
+ return t.sent(), [2]
1715
+ }
1716
+ }))
1717
+ }))
1718
+ }, n
1719
+ }(be$2),
1720
+ Ce$1 = function (e) {
1721
+ function n() {
1722
+ var t = null !== e && e.apply(this, arguments) || this;
1723
+ return t.type = J$1.RECONNECTING, t.name = "reconnecting", t._haltConnect = null, t._resetConnect = null, t._callbacks = [], t
1724
+ }
1725
+ return t(n, e), n.prototype.flushCallbacks = function (e) {
1726
+ void 0 === e && (e = null), this._callbacks.forEach((function (t) {
1727
+ return t(e)
1728
+ }));
1729
+ }, n.prototype.run = function (e) {
1730
+ return r(this, void 0, void 0, (function () {
1731
+ var t, n, s, o, a, c = this;
1732
+ return i(this, (function (l) {
1733
+ switch (l.label) {
1734
+ case 0:
1735
+ t = new ee$1, this._callbacks.push((function (e) {
1736
+ return e ? t.reject(e) : t.resolve()
1737
+ })), Ie$1((function () {
1738
+ return r(c, void 0, void 0, (function () {
1739
+ return i(this, (function (t) {
1740
+ return e.connectionHandlers.forEach((function (e) {
1741
+ e.onReconnectStarted();
1742
+ })), [2]
1743
+ }))
1744
+ }))
1745
+ })), l.label = 1;
1746
+ case 1:
1747
+ return l.trys.push([1, 4, , 9]), n = e.sdkState.websocket, s = n.reconnectMaxRetry, o = n.reconnectRetryStrategy, [4, Ee$2((function (t, n) {
1748
+ return r(c, void 0, void 0, (function () {
1749
+ var r;
1750
+ return i(this, (function (i) {
1751
+ switch (i.label) {
1752
+ case 0:
1753
+ this._haltConnect = t, this._resetConnect = n, i.label = 1;
1754
+ case 1:
1755
+ return i.trys.push([1, 3, , 4]), [4, e.connect()];
1756
+ case 2:
1757
+ return i.sent(), [3, 4];
1758
+ case 3:
1759
+ if ((r = i.sent()) instanceof p && r.code === u.CONNECTION_CANCELED) return t(r), [2];
1760
+ throw r;
1761
+ case 4:
1762
+ return [2]
1763
+ }
1764
+ }))
1765
+ }))
1766
+ }), s, o)];
1767
+ case 2:
1768
+ return l.sent(), [4, e.changeState(new Oe$1)];
1769
+ case 3:
1770
+ return l.sent(), Ie$1((function () {
1771
+ return r(c, void 0, void 0, (function () {
1772
+ return i(this, (function (t) {
1773
+ return e.connectionHandlers.forEach((function (e) {
1774
+ e.onReconnectSucceeded();
1775
+ })), this.flushCallbacks(null), [2]
1776
+ }))
1777
+ }))
1778
+ })), [3, 9];
1779
+ case 4:
1780
+ 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({
1781
+ autoReconnect: !1
1782
+ }))] : [3, 6];
1783
+ case 5:
1784
+ l.sent(), l.label = 6;
1785
+ case 6:
1786
+ return Ie$1((function () {
1787
+ return r(c, void 0, void 0, (function () {
1788
+ return i(this, (function (t) {
1789
+ return e.connectionHandlers.forEach((function (e) {
1790
+ e.onReconnectFailed();
1791
+ })), this.flushCallbacks(a), [2]
1792
+ }))
1793
+ }))
1794
+ })), [3, 8];
1795
+ case 7:
1796
+ throw a;
1797
+ case 8:
1798
+ return [3, 9];
1799
+ case 9:
1800
+ return [2, t.promise]
1801
+ }
1802
+ }))
1803
+ }))
1804
+ }, n.prototype.onConnect = function (e, t) {
1805
+ return r(this, void 0, void 0, (function () {
1806
+ var t;
1807
+ return i(this, (function (n) {
1808
+ return t = new ee$1, this._resetConnect && this._resetConnect(), e.cancelConnectForRetry(), this._callbacks.push((function (e) {
1809
+ return e ? t.reject(e) : t.resolve()
1810
+ })), [2, t.promise]
1811
+ }))
1812
+ }))
1813
+ }, n.prototype.onReconnect = function (e, t) {
1814
+ var n = t.resetReconnectCount,
1815
+ s = void 0 !== n && n;
1816
+ return r(this, void 0, void 0, (function () {
1817
+ var t;
1818
+ return i(this, (function (n) {
1819
+ return t = new ee$1, this._resetConnect && s && this._resetConnect(), e.cancelConnectForRetry(), this._callbacks.push((function (e) {
1820
+ return e ? t.reject(e) : t.resolve()
1821
+ })), [2, t.promise]
1822
+ }))
1823
+ }))
1824
+ }, n.prototype.onDisconnect = function (e, t) {
1825
+ var n = t.error,
1826
+ s = void 0 === n ? null : n,
1827
+ o = t.autoReconnect,
1828
+ a = void 0 === o || o;
1829
+ return r(this, void 0, void 0, (function () {
1830
+ return i(this, (function (t) {
1831
+ switch (t.label) {
1832
+ case 0:
1833
+ return this._haltConnect && this._haltConnect(null != s ? s : p.connectionCanceled), [4, e.changeState(new Ae$2({
1834
+ autoReconnect: a
1835
+ }))];
1836
+ case 1:
1837
+ return t.sent(), [2]
1838
+ }
1839
+ }))
1840
+ }))
1841
+ }, n.prototype.onLogout = function (e) {
1842
+ return r(this, void 0, void 0, (function () {
1843
+ return i(this, (function (t) {
1844
+ switch (t.label) {
1845
+ case 0:
1846
+ return this._haltConnect && this._haltConnect(p.connectionCanceled), [4, e.changeState(new Ne$1)];
1847
+ case 1:
1848
+ return t.sent(), [2]
1849
+ }
1850
+ }))
1851
+ }))
1852
+ }, n
1853
+ }(be$2),
1854
+ Oe$1 = function (e) {
1855
+ function n() {
1856
+ var t = null !== e && e.apply(this, arguments) || this;
1857
+ return t.type = J$1.CONNECTED, t.name = "connected", t
1858
+ }
1859
+ return t(n, e), n.prototype.onReconnect = function (e) {
1860
+ return r(this, void 0, void 0, (function () {
1861
+ return i(this, (function (t) {
1862
+ switch (t.label) {
1863
+ case 0:
1864
+ return e.disconnect(), [4, e.changeState(new Ce$1)];
1865
+ case 1:
1866
+ return t.sent(), [2]
1867
+ }
1868
+ }))
1869
+ }))
1870
+ }, n.prototype.onDisconnect = function (e, t) {
1871
+ var n = t.autoReconnect;
1872
+ return r(this, void 0, void 0, (function () {
1873
+ return i(this, (function (t) {
1874
+ switch (t.label) {
1875
+ case 0:
1876
+ return [4, e.changeState(new Ae$2({
1877
+ autoReconnect: n
1878
+ }))];
1879
+ case 1:
1880
+ return t.sent(), [2]
1881
+ }
1882
+ }))
1883
+ }))
1884
+ }, n.prototype.onLogout = function (e) {
1885
+ return r(this, void 0, void 0, (function () {
1886
+ return i(this, (function (t) {
1887
+ switch (t.label) {
1888
+ case 0:
1889
+ return [4, e.changeState(new Ne$1)];
1890
+ case 1:
1891
+ return t.sent(), [2]
1892
+ }
1893
+ }))
1894
+ }))
1895
+ }, n
1896
+ }(be$2),
1897
+ we$1 = function (e) {
1898
+ function n(t) {
1899
+ var n = t.authToken,
1900
+ r = e.call(this) || this;
1901
+ return r.type = J$1.CONNECTING, r.name = "connecting", r._authToken = "", r._haltConnect = null, r._callbacks = [], r._authToken = n, r
1902
+ }
1903
+ return t(n, e), n.prototype.flushCallbacks = function (e) {
1904
+ void 0 === e && (e = null), this._callbacks.forEach((function (t) {
1905
+ return t(e)
1906
+ }));
1907
+ }, n.prototype.run = function (e) {
1908
+ return r(this, void 0, void 0, (function () {
1909
+ var t, n, s = this;
1910
+ return i(this, (function (o) {
1911
+ switch (o.label) {
1912
+ case 0:
1913
+ t = new ee$1, this._callbacks.push((function (e) {
1914
+ return e ? t.reject(e) : t.resolve()
1915
+ })), o.label = 1;
1916
+ case 1:
1917
+ return o.trys.push([1, 4, , 9]), [4, Ee$2((function (t) {
1918
+ return r(s, void 0, void 0, (function () {
1919
+ var n;
1920
+ return i(this, (function (r) {
1921
+ switch (r.label) {
1922
+ case 0:
1923
+ this._haltConnect = t, r.label = 1;
1924
+ case 1:
1925
+ return r.trys.push([1, 3, , 4]), [4, e.connect(this._authToken)];
1926
+ case 2:
1927
+ return r.sent(), [3, 4];
1928
+ case 3:
1929
+ if ((n = r.sent()) instanceof p && n.code === u.CONNECTION_CANCELED) return t(n), [2];
1930
+ throw n;
1931
+ case 4:
1932
+ return [2]
1933
+ }
1934
+ }))
1935
+ }))
1936
+ }), e.sdkState.websocket.connectMaxRetry)];
1937
+ case 2:
1938
+ return o.sent(), [4, e.changeState(new Oe$1)];
1939
+ case 3:
1940
+ return o.sent(), Ie$1((function () {
1941
+ return r(s, void 0, void 0, (function () {
1942
+ return i(this, (function (t) {
1943
+ return e.connectionHandlers.forEach((function (t) {
1944
+ t.onConnected(e.sdkState.userId);
1945
+ })), this.flushCallbacks(null), [2]
1946
+ }))
1947
+ }))
1948
+ })), [3, 9];
1949
+ case 4:
1950
+ 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]);
1951
+ case 5:
1952
+ o.sent(), o.label = 6;
1953
+ case 6:
1954
+ return Ie$1((function () {
1955
+ return r(s, void 0, void 0, (function () {
1956
+ return i(this, (function (e) {
1957
+ return this.flushCallbacks(n), [2]
1958
+ }))
1959
+ }))
1960
+ })), [3, 8];
1961
+ case 7:
1962
+ throw n;
1963
+ case 8:
1964
+ return [3, 9];
1965
+ case 9:
1966
+ return [2, t.promise]
1967
+ }
1968
+ }))
1969
+ }))
1970
+ }, n.prototype.onConnect = function (e) {
1971
+ return r(this, void 0, void 0, (function () {
1972
+ var e;
1973
+ return i(this, (function (t) {
1974
+ return e = new ee$1, this._callbacks.push((function (t) {
1975
+ return t ? e.reject(t) : e.resolve()
1976
+ })), [2, e.promise]
1977
+ }))
1978
+ }))
1979
+ }, n.prototype.onDisconnect = function (e, t) {
1980
+ var n = t.error,
1981
+ s = void 0 === n ? null : n;
1982
+ return r(this, void 0, void 0, (function () {
1983
+ return i(this, (function (t) {
1984
+ switch (t.label) {
1985
+ case 0:
1986
+ return this._haltConnect && this._haltConnect(null != s ? s : p.connectionCanceled), [4, e.changeState(new Ne$1)];
1987
+ case 1:
1988
+ return t.sent(), [2]
1989
+ }
1990
+ }))
1991
+ }))
1992
+ }, n.prototype.onLogout = function (e) {
1993
+ return r(this, void 0, void 0, (function () {
1994
+ return i(this, (function (t) {
1995
+ switch (t.label) {
1996
+ case 0:
1997
+ return this._haltConnect && this._haltConnect(p.connectionCanceled), [4, e.changeState(new Ne$1)];
1998
+ case 1:
1999
+ return t.sent(), [2]
2000
+ }
2001
+ }))
2002
+ }))
2003
+ }, n
2004
+ }(be$2),
2005
+ Re$1 = function (e) {
2006
+ function n() {
2007
+ var t = null !== e && e.apply(this, arguments) || this;
2008
+ return t.type = J$1.INITIALIZED, t.name = "initialized", t
2009
+ }
2010
+ return t(n, e), n.prototype.onConnect = function (e, t) {
2011
+ return r(this, void 0, void 0, (function () {
2012
+ return i(this, (function (n) {
2013
+ // debugger
2014
+ switch (n.label) {
2015
+ case 0:
2016
+ return [4, e.changeState(new we$1({
2017
+ authToken: t
2018
+ }))];
2019
+ case 1:
2020
+ return n.sent(), [2]
2021
+ }
2022
+ }))
2023
+ }))
2024
+ }, n
2025
+ }(be$2),
2026
+ De$1 = new Map,
2027
+ Me$1 = function (e, t) {
2028
+ var n;
2029
+ return void 0 === t && (t = null), null !== t && De$1.set(e, t), null !== (n = De$1.get(e)) && void 0 !== n ? n : ""
2030
+ },
2031
+ ke$1 = function (e) {
2032
+ 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 || [];
2033
+ },
2034
+ Le$1 = function () {
2035
+ function e(e) {
2036
+ this._iid = "", this._iid = e;
2037
+ }
2038
+ return e.payloadify = function (e) {
2039
+ return e ? {} : null
2040
+ }, e
2041
+ }(),
2042
+ Ue$1 = "/".concat("v3", "/users"),
2043
+ Pe$1 = "/".concat("v3", "/storage/file"),
2044
+ qe$1 = "/".concat("v3", "/group_channels"),
2045
+ Fe$1 = "/".concat("v3", "/sdk/group_channels"),
2046
+ xe$1 = "/".concat("v3", "/open_channels"),
2047
+ Ge$1 = "/".concat("v3", "/sdk/open_channels"),
2048
+ Qe$1 = "/".concat("v3", "/search"),
2049
+ je$1 = "/".concat("v3", "/report"),
2050
+ Ke$1 = "/".concat("v3", "/emojis"),
2051
+ ze$1 = "/".concat("v3", "/emoji_categories"),
2052
+ Ve$1 = "/".concat("v3", "/scheduled_messages"),
2053
+ Be$1 = "/".concat("v3", "/sdk/statistics"),
2054
+ He$1 = function (e) {
2055
+ function n(t) {
2056
+ var n = t.userId,
2057
+ r = t.metadata,
2058
+ i = e.call(this) || this;
2059
+ return i.method = d$1.POST, i.path = "".concat(Ue$1, "/").concat(n, "/metadata"), i.params = {
2060
+ metadata: r
2061
+ }, i
2062
+ }
2063
+ return t(n, e), n
2064
+ }(q$1);
2065
+ ! function (e) {
2066
+ function n(t, n) {
2067
+ var r = e.call(this, t, n) || this;
2068
+ return r.metadata = n, r
2069
+ }
2070
+ t(n, e);
2071
+ }(F),
2072
+ function (e) {
2073
+ e.BASE = "base", e.GROUP = "group", e.OPEN = "open";
2074
+ }(ne$1 || (ne$1 = {})),
2075
+ function (e) {
2076
+ e.OPERATOR = "operator", e.NONE = "none";
2077
+ }(re$1 || (re$1 = {})),
2078
+ function (e) {
2079
+ e.BASE = "base", e.USER = "user", e.FILE = "file", e.ADMIN = "admin";
2080
+ }(ie$1 || (ie$1 = {})),
2081
+ function (e) {
2082
+ e.ALL = "", e.USER = "MESG", e.FILE = "FILE", e.ADMIN = "ADMM";
2083
+ }(se$1 || (se$1 = {})),
2084
+ function (e) {
2085
+ e.USER = "MESG", e.FILE = "FILE", e.ADMIN = "ADMM";
2086
+ }(oe$2 || (oe$2 = {})),
2087
+ function (e) {
2088
+ e.USERS = "users", e.CHANNEL = "channel";
2089
+ }(ae$1 || (ae$1 = {})),
2090
+ function (e) {
2091
+ e.ALL = "all", e.NONE = "none", e.ONLY_REPLY_TO_CHANNEL = "only_reply_to_channel";
2092
+ }(ue$2 || (ue$2 = {})),
2093
+ function (e) {
2094
+ e.DEFAULT = "default", e.SUPPRESS = "suppress";
2095
+ }(ce$2 || (ce$2 = {})),
2096
+ function (e) {
2097
+ e.PENDING = "pending", e.SCHEDULED = "scheduled", e.SUCCEEDED = "succeeded", e.FAILED = "failed", e.CANCELED = "canceled";
2098
+ }(le$2 || (le$2 = {}));
2099
+ var We$1 = function (e) {
2100
+ switch (e) {
2101
+ case ne$1.GROUP:
2102
+ return qe$1;
2103
+ case ne$1.OPEN:
2104
+ return xe$1;
2105
+ default:
2106
+ return null
2107
+ }
2108
+ },
2109
+ Xe$1 = function (e) {
2110
+ switch (e) {
2111
+ case ne$1.GROUP:
2112
+ return "".concat(je$1, "/group_channels");
2113
+ case ne$1.OPEN:
2114
+ return "".concat(je$1, "/open_channels");
2115
+ default:
2116
+ return null
2117
+ }
2118
+ },
2119
+ Ye$1 = function (e, t, n) {
2120
+ var r, i;
2121
+ switch (e) {
2122
+ case ae$1.CHANNEL:
2123
+ return !0;
2124
+ case ae$1.USERS:
2125
+ if (t) try {
2126
+ for (var o = s(t), a = o.next(); !a.done; a = o.next()) {
2127
+ if (a.value === n) return !0
2128
+ }
2129
+ } catch (e) {
2130
+ r = {
2131
+ error: e
2132
+ };
2133
+ } finally {
2134
+ try {
2135
+ a && !a.done && (i = o.return) && i.call(o);
2136
+ } finally {
2137
+ if (r) throw r.error
2138
+ }
2139
+ }
2140
+ }
2141
+ return !1
2142
+ },
2143
+ Je$1 = function (e, t, n) {
2144
+ var r = Ye$1(e.mentionType, e.mentionedUserIds, n),
2145
+ i = Ye$1(t.mentionType, t.mentionedUserIds, n);
2146
+ return !r && i ? 1 : r && !i ? -1 : 0
2147
+ },
2148
+ Ze$1 = function (e) {
2149
+ function n(t) {
2150
+ var n = this,
2151
+ r = t.channelUrl,
2152
+ i = t.channelType,
2153
+ s = t.metadata;
2154
+ return (n = e.call(this) || this).method = d$1.POST, n.path = "".concat(We$1(i), "/").concat(encodeURIComponent(r), "/metadata"), n.params = {
2155
+ metadata: s,
2156
+ include_ts: !0
2157
+ }, n
2158
+ }
2159
+ return t(n, e), n
2160
+ }(q$1),
2161
+ $e$1 = function (e) {
2162
+ function n(t, n) {
2163
+ var r = e.call(this, t, n) || this;
2164
+ return r.metaData = null != n ? n : {}, r
2165
+ }
2166
+ return t(n, e), n
2167
+ }(F),
2168
+ et$1 = function (e) {
2169
+ function n(t) {
2170
+ var n = t.userId,
2171
+ r = t.metadata,
2172
+ i = t.upsert,
2173
+ s = e.call(this) || this;
2174
+ return s.method = d$1.PUT, s.path = "".concat(Ue$1, "/").concat(n, "/metadata"), s.params = {
2175
+ metadata: r,
2176
+ upsert: i
2177
+ }, s
2178
+ }
2179
+ return t(n, e), n
2180
+ }(q$1),
2181
+ tt$1 = function (e) {
2182
+ function n(t, n) {
2183
+ var r = e.call(this, t, n) || this;
2184
+ return r.metadata = n, r
2185
+ }
2186
+ return t(n, e), n
2187
+ }(F),
2188
+ nt$1 = function (e) {
2189
+ function n(t) {
2190
+ var n = t.userId,
2191
+ r = t.metadataKey,
2192
+ i = e.call(this) || this;
2193
+ return i.method = d$1.DELETE, i.path = "".concat(Ue$1, "/").concat(n, "/metadata/").concat(r), i
2194
+ }
2195
+ return t(n, e), n
2196
+ }(q$1);
2197
+ ! function (e) {
2198
+ function n() {
2199
+ return null !== e && e.apply(this, arguments) || this
2200
+ }
2201
+ t(n, e);
2202
+ }(F);
2203
+ var rt$1 = function (e) {
2204
+ function n(t) {
2205
+ var n = t.userId,
2206
+ r = e.call(this) || this;
2207
+ return r.method = d$1.DELETE, r.path = "".concat(Ue$1, "/").concat(n, "/metadata"), r
2208
+ }
2209
+ return t(n, e), n
2210
+ }(q$1);
2211
+ ! function (e) {
2212
+ function n() {
2213
+ return null !== e && e.apply(this, arguments) || this
2214
+ }
2215
+ t(n, e);
2216
+ }(F);
2217
+ var it$1, st$1 = function (e, t) {
2218
+ void 0 === t && (t = null);
2219
+ var n = JSON.parse(JSON.stringify(e));
2220
+ return n._iid && delete n._iid, t && t(n), n
2221
+ },
2222
+ ot$1 = function (e, t) {
2223
+ void 0 === t && (t = null);
2224
+ var n = JSON.parse(JSON.stringify(e));
2225
+ return t && t(n), n
2226
+ },
2227
+ at$1 = function (e) {
2228
+ return {
2229
+ do: function (t) {
2230
+ e || t();
2231
+ },
2232
+ throw: function (t) {
2233
+ if (!e) throw t
2234
+ }
2235
+ }
2236
+ };
2237
+ ! function (e) {
2238
+ e.ONLINE = "online", e.OFFLINE = "offline", e.NON_AVAILABLE = "nonavailable";
2239
+ }(it$1 || (it$1 = {}));
2240
+ var ut$1, ct$1 = function (e) {
2241
+ function s(t, n) {
2242
+ var r, i, s, u, c, l, d, h, p, f, _, g, v = this;
2243
+ 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
2244
+ }
2245
+ return t(s, e), s.payloadify = function (t) {
2246
+ return t ? U$1(n(n({}, e.payloadify.call(this, t)), {
2247
+ user_id: t.userId,
2248
+ nickname: t.nickname,
2249
+ profile_url: t.plainProfileUrl,
2250
+ require_auth_for_profile_image: t.requireAuth,
2251
+ metadata: t.metaData,
2252
+ is_online: t.connectionStatus,
2253
+ is_active: t.isActive,
2254
+ last_seen_at: t.lastSeenAt,
2255
+ preferred_languages: t.preferredLanguages,
2256
+ friend_discovery_key: t.friendDiscoveryKey,
2257
+ friend_name: t.friendName
2258
+ })) : null
2259
+ }, Object.defineProperty(s.prototype, "profileUrl", {
2260
+ get: function () {
2261
+ return this.requireAuth ? "".concat(this.plainProfileUrl, "?auth=").concat(Me$1(this._iid)) : this.plainProfileUrl
2262
+ },
2263
+ enumerable: !1,
2264
+ configurable: !0
2265
+ }), s.prototype.serialize = function () {
2266
+ return st$1(this)
2267
+ }, s.prototype._isValidMetaData = function (e) {
2268
+ return !Array.isArray(e) && Object.keys(e).length > 0 && Object.keys(e).map((function (t) {
2269
+ return e[t]
2270
+ })).every((function (e) {
2271
+ return y("string", e)
2272
+ }))
2273
+ }, s.prototype._applyMetaData = function (e, t) {
2274
+ var n = this;
2275
+ void 0 === t && (t = !1), Object.keys(e).forEach((function (r) {
2276
+ t ? delete n.metaData[r] : n.metaData[r] = e[r];
2277
+ }));
2278
+ }, s.prototype.createMetaData = function (e) {
2279
+ return r(this, void 0, void 0, (function () {
2280
+ var t, n, r, s, o, a;
2281
+ return i(this, (function (i) {
2282
+ switch (i.label) {
2283
+ case 0:
2284
+ 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({
2285
+ userId: n.userId,
2286
+ metadata: e
2287
+ }), [4, r.send(s)];
2288
+ case 1:
2289
+ return o = i.sent(), a = o.as($e$1).metaData, this._applyMetaData(a), [2, this.metaData]
2290
+ }
2291
+ }))
2292
+ }))
2293
+ }, s.prototype.updateMetaData = function (e, t) {
2294
+ return void 0 === t && (t = !1), r(this, void 0, void 0, (function () {
2295
+ var n, r, s, o, a, u;
2296
+ return i(this, (function (i) {
2297
+ switch (i.label) {
2298
+ case 0:
2299
+ 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({
2300
+ userId: r.userId,
2301
+ metadata: e,
2302
+ upsert: t
2303
+ }), [4, s.send(o)];
2304
+ case 1:
2305
+ return a = i.sent(), u = a.as(tt$1).metadata, this._applyMetaData(u), [2, this.metaData]
2306
+ }
2307
+ }))
2308
+ }))
2309
+ }, s.prototype.deleteMetaData = function (e) {
2310
+ return r(this, void 0, void 0, (function () {
2311
+ var t, n, r, s, o;
2312
+ return i(this, (function (i) {
2313
+ switch (i.label) {
2314
+ case 0:
2315
+ 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({
2316
+ userId: n.userId,
2317
+ metadataKey: e
2318
+ }), [4, r.send(s)];
2319
+ case 1:
2320
+ return i.sent(), this._applyMetaData(((o = {})[e] = !0, o), !0), [2, this.metaData]
2321
+ }
2322
+ }))
2323
+ }))
2324
+ }, s.prototype.deleteAllMetaData = function () {
2325
+ return r(this, void 0, void 0, (function () {
2326
+ var e, t, n, r;
2327
+ return i(this, (function (i) {
2328
+ switch (i.label) {
2329
+ case 0:
2330
+ return e = St$1.of(this._iid), t = e.sdkState, n = e.requestQueue, r = new rt$1({
2331
+ userId: t.userId
2332
+ }), [4, n.send(r)];
2333
+ case 1:
2334
+ return i.sent(), this.metaData = {}, [2]
2335
+ }
2336
+ }))
2337
+ }))
2338
+ }, s
2339
+ }(Le$1),
2340
+ lt$1 = function (e) {
2341
+ function n(t) {
2342
+ var n = t.userProfile,
2343
+ r = e.call(this) || this;
2344
+ return r.userProfile = n, r
2345
+ }
2346
+ return t(n, e), n
2347
+ }(L),
2348
+ dt$1 = function () {
2349
+ function e(e, t) {
2350
+ var n, r, i, s, o, a, u, c, l, d, h, p, f, _;
2351
+ 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;
2352
+ }
2353
+ return e.payloadify = function (e) {
2354
+ return n(n({}, ct$1.payloadify(e.user)), {
2355
+ emoji_hash: e.appInfo.emojiHash,
2356
+ file_upload_size_limit: e.appInfo.uploadSizeLimit,
2357
+ application_attributes: e.appInfo.applicationAttributes,
2358
+ premium_feature_list: e.appInfo.premiumFeatureList,
2359
+ login_ts: e.connectedAt / 1e3,
2360
+ ping_interval: e.pingInterval,
2361
+ pong_timeout: e.pongTimeout,
2362
+ reconnect: {
2363
+ interval: e.reconnectInterval,
2364
+ max_interval: e.reconnectMaxInterval,
2365
+ retry_cnt: e.reconnectRetryCount,
2366
+ mul: e.reconnectIntervalMultiple
2367
+ },
2368
+ max_unread_cnt_on_super_group: e.maxUnreadCountOnSuperGroup,
2369
+ profile_image_encryption: e.profileImageEncryption,
2370
+ concurrent_call_limit: e.concurrentCallLimit,
2371
+ back_off_delay: e.backOffDelay
2372
+ })
2373
+ }, e.prototype.apply = function () {
2374
+ var e = this.reconnectInterval,
2375
+ t = this.reconnectMaxInterval,
2376
+ n = this.reconnectIntervalMultiple,
2377
+ r = St$1.of(this._iid);
2378
+ r.sdkState.websocket.pingInterval = 1e3 * this.pingInterval, r.sdkState.websocket.pongTimeout = 1e3 * this.pongTimeout, r.sdkState.websocket.reconnectMaxRetry = this.reconnectRetryCount, r.sdkState.websocket.reconnectRetryStrategy = {
2379
+ calcTimeout: function (r) {
2380
+ return r > 0 ? 1e3 * Math.min(e * Math.pow(n, r - 1), t) : 10
2381
+ }
2382
+ }, 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({
2383
+ userProfile: this
2384
+ }));
2385
+ }, e
2386
+ }(),
2387
+ ht$1 = function (e) {
2388
+ function r(t, n, r) {
2389
+ var i, s = this;
2390
+ 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
2391
+ }
2392
+ return t(r, e), r.asError = function (e) {
2393
+ return new r(null, "LOGI", n({
2394
+ user_id: null,
2395
+ error: !0
2396
+ }, e))
2397
+ }, r.prototype.applyTo = function (e) {
2398
+ if (this.error) throw this.error;
2399
+ var t = St$1.of(e);
2400
+ if (!t) throw p.lostInstance;
2401
+ t.sessionManager.auth.sessionKey = this.key, Me$1(e, this.ekey), this.userProfile.apply();
2402
+ }, r
2403
+ }(B$1),
2404
+ pt$1 = function (e) {
2405
+ function n(t) {
2406
+ var n = e.call(this) || this;
2407
+ return n.enabled = t, n
2408
+ }
2409
+ return t(n, e), n
2410
+ }(L),
2411
+ ft$1 = function (e) {
2412
+ function n(t, n) {
2413
+ var r = n.sdkState,
2414
+ i = n.connectionHandlers,
2415
+ s = n.sessionManager,
2416
+ o = n.websocketClient,
2417
+ a = n.dispatcher,
2418
+ u = n.logger,
2419
+ c = n.entryState,
2420
+ l = void 0 === c ? new Re$1 : c,
2421
+ d = e.call(this) || this;
2422
+ 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) {
2423
+ if ("LOGI" === e.code) {
2424
+ d._loginTimer && (clearTimeout(d._loginTimer), d._loginTimer = null);
2425
+ var t = e.as(ht$1);
2426
+ if (t.error) t.error.isSessionKeyExpiredError && d._dispatcher.dispatch(new G$1), d._connectionRequestQueue.forEach((function (e) {
2427
+ return e.reject(t.error)
2428
+ })), d._statLogConnection(t.error);
2429
+ else {
2430
+ t.applyTo(d._iid), d._connectionRequestQueue.forEach((function (e) {
2431
+ return e.resolve()
2432
+ }));
2433
+ var n = t.userProfile;
2434
+ d._enableStatLog(n.appInfo.applicationAttributes.includes("allow_sdk_request_log_publish")), d._statLogConnection(null);
2435
+ }
2436
+ d._connectionRequestQueue = [];
2437
+ }
2438
+ })).on("close", (function () {
2439
+ d._connectionRequestQueue.length > 0 && (d._connectionRequestQueue.forEach((function (e) {
2440
+ return e.reject(p.networkError)
2441
+ })), d._connectionRequestQueue = [], d._statLogConnection(p.networkError));
2442
+ })), d
2443
+ }
2444
+ return t(n, e), Object.defineProperty(n.prototype, "currentState", {
2445
+ get: function () {
2446
+ return this._currentState
2447
+ },
2448
+ enumerable: !1,
2449
+ configurable: !0
2450
+ }), n.prototype.changeState = function (e) {
2451
+ return r(this, void 0, void 0, (function () {
2452
+ return i(this, (function (t) {
2453
+ // debugger last point
2454
+ switch (t.label) {
2455
+ case 0:
2456
+ return this._currentState = e, this._dispatcher.dispatch(new de$2({
2457
+ stateType: e.type
2458
+ })), this._logger.debug("connection state changes to ".concat(e.name)), [4, this._currentState.run(this)];
2459
+ case 1:
2460
+ return t.sent(), [2]
2461
+ }
2462
+ }))
2463
+ }))
2464
+ }, n.prototype._url = function (e) {
2465
+ void 0 === e && (e = "");
2466
+ var t = this.sdkState,
2467
+ n = t.appId,
2468
+ r = t.appVersion,
2469
+ i = t.userId,
2470
+ s = t.extensions,
2471
+ o = this._sessionManager.auth,
2472
+ a = s.sb_syncmanager ? "s".concat(s.sb_syncmanager) : "",
2473
+ u = s.sb_uikit ? "u".concat(s.sb_uikit) : "",
2474
+ c = "JS/c".concat(l$1.SDK_VERSION, "/").concat(a, "/").concat(u);
2475
+ 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")
2476
+ }, n.prototype._enableStatLog = function (e) {
2477
+ this._dispatcher.dispatch(new pt$1(e));
2478
+ }, n.prototype._statLogConnection = function (e) {
2479
+ this._dispatcher.dispatch(new Q$1(new K$1({
2480
+ type: P.WEBSOCKET_CONNECT,
2481
+ data: {
2482
+ host_url: this.sdkState.websocket.host,
2483
+ success: !e,
2484
+ latency: Date.now() - this._connectingAt,
2485
+ error_code: null == e ? void 0 : e.code,
2486
+ error_description: null == e ? void 0 : e.message
2487
+ }
2488
+ })));
2489
+ }, n.prototype.connect = function (e) {
2490
+ return void 0 === e && (e = ""), r(this, void 0, void 0, (function () {
2491
+ var t, n, r = this;
2492
+ return i(this, (function (i) {
2493
+ 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 () {
2494
+ r._loginTimer = null, r._dispatcher.dispatch(ht$1.asError(p.loginTimeout));
2495
+ }), this.sdkState.websocket.responseTimeout), this._websocketClient.connect(t)), [2, n.promise]
2496
+ }))
2497
+ }))
2498
+ }, n.prototype.cancelConnectForRetry = function () {
2499
+ this._dispatcher.dispatch(ht$1.asError(p.connectionRenew));
2500
+ }, n.prototype.disconnect = function () {
2501
+ this._websocketClient.disconnect();
2502
+ }, n.prototype.logout = function () {
2503
+ this.sdkState.userId = null, this._sessionManager.currentUser = null, this._sessionManager.auth.clear(), this.disconnect();
2504
+ }, n
2505
+ }(M),
2506
+ _t$1 = function () {
2507
+ function e(e, t) {
2508
+ var n = t.sdkState,
2509
+ r = t.connectionHandlers,
2510
+ i = t.sessionManager,
2511
+ s = t.websocketClient,
2512
+ o = t.dispatcher,
2513
+ a = t.logger,
2514
+ u = t.disableAutoReconnect,
2515
+ c = void 0 !== u && u,
2516
+ l = this;
2517
+ this._context = null, this._logger = a, this._context = new ft$1(e, {
2518
+ sdkState: n,
2519
+ connectionHandlers: r,
2520
+ sessionManager: i,
2521
+ websocketClient: s,
2522
+ dispatcher: o,
2523
+ logger: a
2524
+ }), c || s.on("close", (function () {
2525
+ "foreground" === n.appState && setTimeout((function () {
2526
+ l._logger.debug("try reconnect by websocket connection closed"), l.reconnect();
2527
+ }), 100);
2528
+ }));
2529
+ }
2530
+ return Object.defineProperty(e.prototype, "isConnected", {
2531
+ get: function () {
2532
+ return this._context.currentState.type === J$1.CONNECTED
2533
+ },
2534
+ enumerable: !1,
2535
+ configurable: !0
2536
+ }), Object.defineProperty(e.prototype, "isConnecting", {
2537
+ get: function () {
2538
+ var e = this._context.currentState;
2539
+ return e.type === J$1.CONNECTING || e.type === J$1.RECONNECTING
2540
+ },
2541
+ enumerable: !1,
2542
+ configurable: !0
2543
+ }), e.prototype.connect = function (e) {
2544
+ return r(this, void 0, void 0, (function () {
2545
+ return i(this, (function (t) {
2546
+ // debugger
2547
+ switch (t.label) {
2548
+ case 0:
2549
+ return [4, this._context.currentState.onConnect(this._context, e)];
2550
+ case 1:
2551
+ return t.sent(), [2]
2552
+ }
2553
+ }))
2554
+ }))
2555
+ }, e.prototype.reconnect = function () {
2556
+ return r(this, void 0, void 0, (function () {
2557
+ return i(this, (function (e) {
2558
+ switch (e.label) {
2559
+ case 0:
2560
+ return [4, this._context.currentState.onReconnect(this._context, {})];
2561
+ case 1:
2562
+ return e.sent(), [2]
2563
+ }
2564
+ }))
2565
+ }))
2566
+ }, e.prototype.resetAndReconnect = function () {
2567
+ return r(this, void 0, void 0, (function () {
2568
+ return i(this, (function (e) {
2569
+ switch (e.label) {
2570
+ case 0:
2571
+ return [4, this._context.currentState.onReconnect(this._context, {
2572
+ resetReconnectCount: !0
2573
+ })];
2574
+ case 1:
2575
+ return e.sent(), [2]
2576
+ }
2577
+ }))
2578
+ }))
2579
+ }, e.prototype.background = function () {
2580
+ return r(this, void 0, void 0, (function () {
2581
+ return i(this, (function (e) {
2582
+ switch (e.label) {
2583
+ case 0:
2584
+ return [4, this._context.currentState.onDisconnect(this._context, {
2585
+ autoReconnect: !1
2586
+ })];
2587
+ case 1:
2588
+ return e.sent(), [2]
2589
+ }
2590
+ }))
2591
+ }))
2592
+ }, e.prototype.disconnect = function (e) {
2593
+ return void 0 === e && (e = null), r(this, void 0, void 0, (function () {
2594
+ return i(this, (function (t) {
2595
+ switch (t.label) {
2596
+ case 0:
2597
+ return [4, this._context.currentState.onDisconnect(this._context, {
2598
+ error: e,
2599
+ autoReconnect: !0
2600
+ })];
2601
+ case 1:
2602
+ return t.sent(), [2]
2603
+ }
2604
+ }))
2605
+ }))
2606
+ }, e.prototype.logout = function () {
2607
+ return r(this, void 0, void 0, (function () {
2608
+ return i(this, (function (e) {
2609
+ switch (e.label) {
2610
+ case 0:
2611
+ return [4, this._context.currentState.onLogout(this._context)];
2612
+ case 1:
2613
+ return e.sent(), [2]
2614
+ }
2615
+ }))
2616
+ }))
2617
+ }, e
2618
+ }(),
2619
+ gt$1 = function (e) {
2620
+ function n(t) {
2621
+ var n = t.deviceId,
2622
+ r = t.statLogs,
2623
+ i = e.call(this) || this;
2624
+ return i.method = d$1.POST, i.path = "".concat(Be$1), i.params = {
2625
+ device_id: n,
2626
+ log_entries: r.map((function (e) {
2627
+ return K$1.payloadify(e)
2628
+ }))
2629
+ }, i
2630
+ }
2631
+ return t(n, e), n
2632
+ }(q$1);
2633
+ ! function (e) {
2634
+ e[e.PENDING = 0] = "PENDING", e[e.ENABLED = 1] = "ENABLED", e[e.DISABLED = 2] = "DISABLED";
2635
+ }(ut$1 || (ut$1 = {}));
2636
+ var yt$1, mt$1 = function () {
2637
+ function e(e) {
2638
+ var t = e.cacheContext,
2639
+ n = e.requestQueue,
2640
+ r = e.dispatcher,
2641
+ i = e.baseLimit,
2642
+ s = void 0 === i ? 100 : i,
2643
+ o = e.maxLimit,
2644
+ a = void 0 === o ? 1e3 : o,
2645
+ u = e.minLimit,
2646
+ c = void 0 === u ? 10 : u;
2647
+ 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;
2648
+ }
2649
+ return Object.defineProperty(e.prototype, "isEnabled", {
2650
+ get: function () {
2651
+ return this.enabledstate === ut$1.ENABLED
2652
+ },
2653
+ enumerable: !1,
2654
+ configurable: !0
2655
+ }), e.prototype._save = function () {
2656
+ return r(this, void 0, void 0, (function () {
2657
+ return i(this, (function (e) {
2658
+ switch (e.label) {
2659
+ case 0:
2660
+ return this.cacheContext.localCacheEnabled ? [4, this.cacheContext.preference.set(this.key, {
2661
+ deviceId: this.deviceId,
2662
+ statLogs: this.queue.map((function (e) {
2663
+ return K$1.payloadify(e)
2664
+ })),
2665
+ generation: this.generation++,
2666
+ lastFlushedAt: this.lastFlushedAt
2667
+ })] : [3, 2];
2668
+ case 1:
2669
+ e.sent(), e.label = 2;
2670
+ case 2:
2671
+ return [2]
2672
+ }
2673
+ }))
2674
+ }))
2675
+ }, e.prototype._flush = function () {
2676
+ return r(this, void 0, void 0, (function () {
2677
+ var e, t;
2678
+ return i(this, (function (n) {
2679
+ switch (n.label) {
2680
+ case 0:
2681
+ if (!this.isEnabled) return [3, 7];
2682
+ if (this.isFlushing) return [3, 7];
2683
+ this.isFlushing = !0, n.label = 1;
2684
+ case 1:
2685
+ 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({
2686
+ deviceId: this.deviceId,
2687
+ statLogs: e
2688
+ }), [4, this.requestQueue.send(t)]) : [3, 4];
2689
+ case 2:
2690
+ return n.sent(), this.queue = this.queue.slice(e.length), [4, this._save()];
2691
+ case 3:
2692
+ n.sent(), n.label = 4;
2693
+ case 4:
2694
+ return this.limit = this.baseLimit, this.lastFlushedAt = Date.now(), [3, 7];
2695
+ case 5:
2696
+ return n.sent(), this.limit = this.limit + 20, [3, 7];
2697
+ case 6:
2698
+ return this.isFlushing = !1, [7];
2699
+ case 7:
2700
+ return [2]
2701
+ }
2702
+ }))
2703
+ }))
2704
+ }, e.prototype.init = function (e) {
2705
+ return r(this, void 0, void 0, (function () {
2706
+ var t, n, r = this;
2707
+ return i(this, (function (i) {
2708
+ switch (i.label) {
2709
+ case 0:
2710
+ return this.key = e, this.cacheContext.localCacheEnabled ? [4, this.cacheContext.preference.get(this.key)] : [3, 4];
2711
+ case 1:
2712
+ return (t = i.sent()) ? (this.deviceId = t.deviceId, this.queue = t.statLogs.map((function (e) {
2713
+ return new K$1({
2714
+ type: e.stat_type,
2715
+ ts: e.ts,
2716
+ data: e.data
2717
+ })
2718
+ })), 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];
2719
+ case 2:
2720
+ return i.sent(), [4, this._flush()];
2721
+ case 3:
2722
+ i.sent(), i.label = 4;
2723
+ case 4:
2724
+ return this.dispatcher.on((function (e) {
2725
+ if (e instanceof Q$1) {
2726
+ var t = e.statLog;
2727
+ r.put(t);
2728
+ } 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());
2729
+ })), [2]
2730
+ }
2731
+ }))
2732
+ }))
2733
+ }, e.prototype.put = function (e) {
2734
+ return r(this, void 0, void 0, (function () {
2735
+ return i(this, (function (t) {
2736
+ switch (t.label) {
2737
+ case 0:
2738
+ return this.enabledstate === ut$1.DISABLED ? [3, 3] : (this.queue.push(e), [4, this._save()]);
2739
+ case 1:
2740
+ return t.sent(), this.queue.length >= this.limit ? [4, this._flush()] : [3, 3];
2741
+ case 2:
2742
+ t.sent(), t.label = 3;
2743
+ case 3:
2744
+ return [2]
2745
+ }
2746
+ }))
2747
+ }))
2748
+ }, e.prototype.clear = function () {
2749
+ return r(this, void 0, void 0, (function () {
2750
+ return i(this, (function (e) {
2751
+ switch (e.label) {
2752
+ case 0:
2753
+ return this.queue = [], this.generation = 1, [4, this._save()];
2754
+ case 1:
2755
+ return e.sent(), [2]
2756
+ }
2757
+ }))
2758
+ }))
2759
+ }, e
2760
+ }();
2761
+ ! function (e) {
2762
+ 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";
2763
+ }(yt$1 || (yt$1 = {}));
2764
+ var vt$1, Et$1 = function () {
2765
+ function e() {
2766
+ this.level = yt$1.WARN;
2767
+ }
2768
+ return e.prototype.verbose = function () {
2769
+ for (var e = [], t = 0; t < arguments.length; t++) e[t] = arguments[t];
2770
+ this.level <= yt$1.VERBOSE && console.log.apply(console, a(["[verbose]"], o(e), !1));
2771
+ }, e.prototype.debug = function () {
2772
+ for (var e = [], t = 0; t < arguments.length; t++) e[t] = arguments[t];
2773
+ this.level <= yt$1.DEBUG && console.log.apply(console, a(["[debug]"], o(e), !1));
2774
+ }, e.prototype.info = function () {
2775
+ for (var e = [], t = 0; t < arguments.length; t++) e[t] = arguments[t];
2776
+ this.level <= yt$1.INFO && console.log.apply(console, a(["[info]"], o(e), !1));
2777
+ }, e.prototype.warn = function () {
2778
+ for (var e = [], t = 0; t < arguments.length; t++) e[t] = arguments[t];
2779
+ this.level <= yt$1.WARN && console.warn.apply(console, a(["[warn]"], o(e), !1));
2780
+ }, e.prototype.error = function () {
2781
+ for (var e = [], t = 0; t < arguments.length; t++) e[t] = arguments[t];
2782
+ this.level <= yt$1.ERROR && console.error.apply(console, a(["[error]"], o(e), !1));
2783
+ }, e
2784
+ }(),
2785
+ It$1 = {},
2786
+ St$1 = function () {
2787
+ function e(e, t) {
2788
+ var n, r, i, s, o, a, u;
2789
+ if (this.connectedAt = 0, this.firstConnectedAt = 0, this.connectionHandlers = new Map, this.userEventHandlers = new Map, !It$1[e]) {
2790
+ It$1[e] = this;
2791
+ var c = null !== (n = t.options) && void 0 !== n ? n : new b,
2792
+ d = this.sdkState = {
2793
+ appId: t.appId,
2794
+ appVersion: null !== (r = t.appVersion) && void 0 !== r ? r : "",
2795
+ appState: "foreground",
2796
+ userId: null,
2797
+ extensions: {},
2798
+ api: {
2799
+ host: null !== (i = t.apiHost) && void 0 !== i ? i : "https://api-".concat(t.appId, ".sendbird.com")
2800
+ },
2801
+ websocket: {
2802
+ host: null !== (s = t.websocketHost) && void 0 !== s ? s : "wss://ws-".concat(t.appId, ".sendbird.com"),
2803
+ pingerDisabled: !!t.noPingpong,
2804
+ pingInterval: null,
2805
+ pongTimeout: null,
2806
+ connectMaxRetry: 2,
2807
+ reconnectMaxRetry: -1,
2808
+ reconnectRetryStrategy: new ve$2,
2809
+ responseTimeout: c.websocketResponseTimeout
2810
+ }
2811
+ };
2812
+ this.appInfo = null, this.subscribedUnreadMessageCount = {
2813
+ all: 0,
2814
+ customTypes: {},
2815
+ ts: 0
2816
+ };
2817
+ var h = this.logger = new Et$1;
2818
+ 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({
2819
+ encryption: t.encryption,
2820
+ store: t.store,
2821
+ localCacheEnabled: null !== (a = t.localCacheEnabled) && void 0 !== a && a
2822
+ }), 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;
2823
+ var p = this.dispatcher = new k,
2824
+ f = new w;
2825
+ this.requestQueue = new he$2(e, {
2826
+ auth: f,
2827
+ sdkState: d,
2828
+ dispatcher: p,
2829
+ logger: h
2830
+ }), this.sessionManager = new Te$1({
2831
+ auth: f,
2832
+ sdkState: d,
2833
+ dispatcher: p,
2834
+ requestQueue: this.requestQueue,
2835
+ logger: h
2836
+ }), this.connectionManager = new _t$1(e, {
2837
+ sdkState: d,
2838
+ connectionHandlers: this.connectionHandlers,
2839
+ dispatcher: p,
2840
+ sessionManager: this.sessionManager,
2841
+ websocketClient: this.requestQueue.commandRouter.websocketClient,
2842
+ logger: h
2843
+ }), this.statLogCollector = new mt$1({
2844
+ cacheContext: this.cacheContext,
2845
+ requestQueue: this.requestQueue,
2846
+ dispatcher: p
2847
+ });
2848
+ }
2849
+ return It$1[e]
2850
+ }
2851
+ return e.of = function (e) {
2852
+ if (It$1[e]) return It$1[e];
2853
+ throw p.lostInstance
2854
+ }, e
2855
+ }(),
2856
+ Tt$1 = function () {
2857
+ function e() {}
2858
+ return e.prototype.init = function (e, t) {
2859
+ var n = t.sdkState,
2860
+ r = t.dispatcher,
2861
+ i = t.sessionManager,
2862
+ s = t.requestQueue,
2863
+ o = t.logger;
2864
+ t.onlineDetector;
2865
+ var a = t.cacheContext,
2866
+ u = void 0 === a ? null : a;
2867
+ this._iid = e, this._cacheContext = u, this._sdkState = n, this._dispatcher = r, this._sessionManager = i, this._requestQueue = s, this._logger = o;
2868
+ }, e
2869
+ }(),
2870
+ bt$1 = function (e) {
2871
+ function n(t) {
2872
+ var n = e.call(this) || this;
2873
+ if (n.method = d$1.POST, n.path = "".concat(Pe$1), n.params = U$1({
2874
+ file: t.file,
2875
+ channel_url: t.channelUrl
2876
+ }), t.thumbnailSizes)
2877
+ for (var r = 0; r < t.thumbnailSizes.length; r++) {
2878
+ var i = t.thumbnailSizes[r],
2879
+ s = i.maxWidth,
2880
+ o = i.maxHeight;
2881
+ n.params["thumbnail".concat(r + 1)] = "".concat(s, ",").concat(o);
2882
+ }
2883
+ return n.requestId = t.requestId, n
2884
+ }
2885
+ return t(n, e), n
2886
+ }(q$1),
2887
+ Nt$1 = function (e) {
2888
+ function n(t, n) {
2889
+ var r, i, s, o = this;
2890
+ 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
2891
+ }
2892
+ return t(n, e), n
2893
+ }(F),
2894
+ At$1 = function (e) {
2895
+ function r(t, n) {
2896
+ var r, i, s, o = this;
2897
+ 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) {
2898
+ return new ct$1(o._iid, e)
2899
+ })) : [], 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
2900
+ }
2901
+ return t(r, e), r.payloadify = function (t) {
2902
+ return t ? U$1(n(n({}, e.payloadify.call(this, t)), {
2903
+ reply_count: t.replyCount,
2904
+ most_replies: Array.isArray(t.mostRepliedUsers) ? t.mostRepliedUsers.map((function (e) {
2905
+ return ct$1.payloadify(e)
2906
+ })) : [],
2907
+ last_replied_at: t.lastRepliedAt,
2908
+ updated_at: t.updatedAt
2909
+ })) : null
2910
+ }, r
2911
+ }(Le$1);
2912
+ ! function (e) {
2913
+ e.ADD = "add", e.DELETE = "delete";
2914
+ }(vt$1 || (vt$1 = {}));
2915
+ var Ct$1, Ot$1, wt$1 = function (e) {
2916
+ this.messageId = 0, this.userId = null, this.key = null, this.operation = null, this.updatedAt = 0;
2917
+ var t = y("string", e.msg_id) ? parseInt(e.msg_id) : e.msg_id,
2918
+ n = e.user_id,
2919
+ r = e.operation ? e.operation.toLowerCase() : null,
2920
+ i = e.reaction,
2921
+ s = e.updated_at;
2922
+ 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);
2923
+ },
2924
+ Rt$1 = function () {
2925
+ function e(e) {
2926
+ var t, n, r, i = e.key,
2927
+ u = null !== (r = a([], o(e.user_ids), !1)) && void 0 !== r ? r : [],
2928
+ c = e.updated_at;
2929
+ y("string", i) && i && E("string", u) && u.length > 0 && y("number", c) && (this.key = i, this.userIds = u, this.updatedAt = c);
2930
+ var l = {};
2931
+ try {
2932
+ for (var d = s(this.userIds), h = d.next(); !h.done; h = d.next()) {
2933
+ l[h.value] = this.updatedAt;
2934
+ }
2935
+ } catch (e) {
2936
+ t = {
2937
+ error: e
2938
+ };
2939
+ } finally {
2940
+ try {
2941
+ h && !h.done && (n = d.return) && n.call(d);
2942
+ } finally {
2943
+ if (t) throw t.error
2944
+ }
2945
+ }
2946
+ this._version = l;
2947
+ }
2948
+ return Object.defineProperty(e.prototype, "isEmpty", {
2949
+ get: function () {
2950
+ return 0 === this.userIds.length
2951
+ },
2952
+ enumerable: !1,
2953
+ configurable: !0
2954
+ }), e.payloadify = function (e) {
2955
+ return e ? U$1({
2956
+ key: e.key,
2957
+ user_ids: e.userIds,
2958
+ updated_at: e.updatedAt
2959
+ }) : null
2960
+ }, e.prototype.applyEvent = function (e) {
2961
+ if (e.key === this.key && this.updatedAt <= e.updatedAt) {
2962
+ if (!this._version[e.userId] || this._version[e.userId] <= e.updatedAt) {
2963
+ var t = this.userIds.indexOf(e.userId);
2964
+ switch (e.operation) {
2965
+ case vt$1.ADD:
2966
+ t < 0 && this.userIds.push(e.userId);
2967
+ break;
2968
+ case vt$1.DELETE:
2969
+ t >= 0 && this.userIds.splice(t, 1);
2970
+ }
2971
+ this._version[e.userId] = e.updatedAt;
2972
+ }
2973
+ this.updatedAt = Math.max(this.updatedAt, e.updatedAt);
2974
+ }
2975
+ }, e
2976
+ }(),
2977
+ Dt$1 = function () {
2978
+ function e(e) {
2979
+ this.key = e.key, this.value = E("string", e.value) ? a([], o(e.value), !1) : [];
2980
+ }
2981
+ return e.payloadify = function (e) {
2982
+ var t;
2983
+ return e ? U$1({
2984
+ key: e.key,
2985
+ value: null !== (t = e.value) && void 0 !== t ? t : []
2986
+ }) : null
2987
+ }, e
2988
+ }(),
2989
+ Mt$1 = function () {
2990
+ function e(e) {
2991
+ 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);
2992
+ }
2993
+ return e.payloadify = function (e) {
2994
+ var t, n;
2995
+ return e ? U$1({
2996
+ url: e.url,
2997
+ secure_url: e.secureUrl,
2998
+ type: e.type,
2999
+ width: null !== (t = e.width) && void 0 !== t ? t : 0,
3000
+ height: null !== (n = e.height) && void 0 !== n ? n : 0,
3001
+ alt: e.alt
3002
+ }) : null
3003
+ }, e
3004
+ }(),
3005
+ kt$1 = function () {
3006
+ function e(e) {
3007
+ 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"]));
3008
+ }
3009
+ return e.payloadify = function (e) {
3010
+ return e ? U$1({
3011
+ "og:title": e.title,
3012
+ "og:url": e.url,
3013
+ "og:description": e.description,
3014
+ "og:image": e.defaultImage ? Mt$1.payloadify(e.defaultImage) : null
3015
+ }) : null
3016
+ }, e
3017
+ }(),
3018
+ Lt = function () {
3019
+ function e(e) {
3020
+ var t, n;
3021
+ 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;
3022
+ }
3023
+ return e.payloadify = function (e) {
3024
+ return e ? U$1({
3025
+ name: e.name,
3026
+ volume: e.volume
3027
+ }) : null
3028
+ }, e
3029
+ }();
3030
+ ! function (e) {
3031
+ e.PENDING = "pending", e.SENT = "sent", e.FAILED = "failed", e.CANCELED = "canceled";
3032
+ }(Ct$1 || (Ct$1 = {})),
3033
+ function (e) {
3034
+ e.PENDING = "pending", e.IN_QUEUE = "in_queue", e.SENT = "sent", e.FAILED = "failed", e.CANCELED = "canceled", e.REMOVED = "removed";
3035
+ }(Ot$1 || (Ot$1 = {}));
3036
+ var Ut$1, Pt$1 = function (e) {
3037
+ switch (e) {
3038
+ case ie$1.BASE:
3039
+ return "";
3040
+ case ie$1.USER:
3041
+ return "MESG";
3042
+ case ie$1.FILE:
3043
+ return "FILE";
3044
+ case ie$1.ADMIN:
3045
+ return "ADMM"
3046
+ }
3047
+ },
3048
+ qt$1 = function (e) {
3049
+ function r(t, n) {
3050
+ var r, i, s, o, a, u, c, l, d, h, p, f, _, g = this;
3051
+ (g = e.call(this, t) || this).channelUrl = null, g.channelType = ne$1.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 = Ot$1.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(ne$1, n.channel_type) ? n.channel_type : ne$1.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(ae$1, n.mention_type) ? n.mention_type : null;
3052
+ var y = n.mentioned_users;
3053
+ g.mentionedUsers = y ? y.map((function (e) {
3054
+ return new ct$1(g._iid, e)
3055
+ })) : null;
3056
+ var v = n.mentioned_user_ids;
3057
+ 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) {
3058
+ return new Rt$1(e)
3059
+ })) : [];
3060
+ 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) {
3061
+ return e.localeCompare(t)
3062
+ })), S = 0; S < I.length; S++) {
3063
+ var T = I[S];
3064
+ g.metaArrays.push(new Dt$1({
3065
+ key: T,
3066
+ value: E[T] || []
3067
+ }));
3068
+ }
3069
+ return n.sorted_metaarray && (g.metaArrays = n.sorted_metaarray.map((function (e) {
3070
+ return new Dt$1(e)
3071
+ }))), 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 = {
3072
+ scheduledMessageId: n.scheduled_message_id,
3073
+ scheduledAt: n.scheduled_at
3074
+ }, g._scheduledStatus = n.scheduled_status), g
3075
+ }
3076
+ return t(r, e), r.payloadify = function (t) {
3077
+ var r, i, s, o;
3078
+ return t ? U$1(n(n({}, e.payloadify.call(this, t)), {
3079
+ channel_url: t.channelUrl,
3080
+ channel_type: t.channelType,
3081
+ message_id: t.messageId,
3082
+ type: Pt$1(t.messageType),
3083
+ parent_message_id: t.parentMessageId,
3084
+ data: t.data,
3085
+ custom_type: t.customType,
3086
+ mention_type: t.mentionType,
3087
+ mentioned_user_ids: t.mentionedUserIds,
3088
+ mentioned_users: null === (r = t.mentionedUsers) || void 0 === r ? void 0 : r.map((function (e) {
3089
+ return ct$1.payloadify(e)
3090
+ })),
3091
+ mentioned_message_template: t.mentionedMessageTemplate,
3092
+ thread_info: t.threadInfo ? At$1.payloadify(t.threadInfo) : null,
3093
+ reactions: t.reactions.map((function (e) {
3094
+ return Rt$1.payloadify(e)
3095
+ })),
3096
+ sorted_metaarray: null === (i = t.metaArrays) || void 0 === i ? void 0 : i.map((function (e) {
3097
+ return Dt$1.payloadify(e)
3098
+ })),
3099
+ og_tag: kt$1.payloadify(t.ogMetaData),
3100
+ silent: t.silent,
3101
+ is_op_msg: t.isOperatorMessage,
3102
+ apple_critical_alert_options: Lt.payloadify(t.appleCriticalAlertOptions),
3103
+ created_at: t.createdAt,
3104
+ updated_at: t.updatedAt,
3105
+ scheduled_message_id: null === (s = t.scheduledInfo) || void 0 === s ? void 0 : s.scheduledMessageId,
3106
+ scheduled_at: null === (o = t.scheduledInfo) || void 0 === o ? void 0 : o.scheduledAt,
3107
+ scheduled_status: t._scheduledStatus
3108
+ })) : null
3109
+ }, r.prototype.isIdentical = function (e) {
3110
+ return this.messageId === e.messageId
3111
+ }, r.prototype.isEqual = function (e) {
3112
+ return g(this, e)
3113
+ }, r.prototype.isUserMessage = function () {
3114
+ return this.messageType === ie$1.USER
3115
+ }, r.prototype.isFileMessage = function () {
3116
+ return this.messageType === ie$1.FILE
3117
+ }, r.prototype.isAdminMessage = function () {
3118
+ return this.messageType === ie$1.ADMIN
3119
+ }, r.prototype.serialize = function () {
3120
+ return st$1(this)
3121
+ }, r.prototype.getMetaArraysByKeys = function (e) {
3122
+ return this.metaArrays.filter((function (t) {
3123
+ return e.includes(t.key)
3124
+ }))
3125
+ }, r.prototype.applyThreadInfoUpdateEvent = function (e) {
3126
+ return this.parentMessageId === e.targetMessageId && (this.threadInfo = e.threadInfo), !1
3127
+ }, r.prototype.applyReactionEvent = function (e) {
3128
+ if (this.messageId === e.messageId) {
3129
+ for (var t = !1, n = 0; n < this.reactions.length; n++)
3130
+ if (this.reactions[n].key === e.key) {
3131
+ this.reactions[n].applyEvent(e), this.reactions[n].isEmpty && this.reactions.splice(n, 1), t = !0;
3132
+ break
3133
+ } t || "add" !== e.operation || this.reactions.push(new Rt$1(Rt$1.payloadify({
3134
+ key: e.key,
3135
+ userIds: [e.userId],
3136
+ updatedAt: e.updatedAt
3137
+ })));
3138
+ }
3139
+ }, r.prototype.applyParentMessage = function (e) {
3140
+ if (this.parentMessageId === e.messageId) {
3141
+ var t = this.parentMessage.updatedAt;
3142
+ if (e.updatedAt >= t) return this.parentMessage = e, !0
3143
+ }
3144
+ return !1
3145
+ }, r
3146
+ }(Le$1),
3147
+ Ft = function (e) {
3148
+ function r(t, n) {
3149
+ var r = e.call(this, t, n) || this;
3150
+ return r.role = null, r.isBlockedByMe = !1, r.role = m(re$1, n.role) ? n.role : re$1.NONE, n.hasOwnProperty("is_blocked_by_me") && (r.isBlockedByMe = n.is_blocked_by_me), r
3151
+ }
3152
+ return t(r, e), r.payloadify = function (t) {
3153
+ return t ? U$1(n(n({}, e.payloadify.call(this, t)), {
3154
+ role: t.role,
3155
+ is_blocked_by_me: t.isBlockedByMe
3156
+ })) : null
3157
+ }, r
3158
+ }(ct$1),
3159
+ xt = function (e) {
3160
+ function r(t, n) {
3161
+ var r, i, s, o, a = this;
3162
+ if ((a = e.call(this, t, n) || this).sender = null, a.reqId = "", a.replyToChannel = !1, a.sendingStatus = le$2.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 ? le$2.SUCCEEDED : le$2.FAILED, n.request_state && m(le$2, n.request_state) && (a.sendingStatus = n.request_state), n.scheduled_status) switch (n.scheduled_status) {
3163
+ case Ot$1.SENT:
3164
+ case Ot$1.IN_QUEUE:
3165
+ a.sendingStatus = le$2.SUCCEEDED;
3166
+ break;
3167
+ case Ot$1.PENDING:
3168
+ a.sendingStatus = le$2.SCHEDULED;
3169
+ break;
3170
+ case Ot$1.FAILED:
3171
+ case Ot$1.REMOVED:
3172
+ a.sendingStatus = le$2.FAILED;
3173
+ break;
3174
+ case Ot$1.CANCELED:
3175
+ a.sendingStatus = le$2.CANCELED;
3176
+ }
3177
+ return a.errorCode = null !== (o = n.error_code) && void 0 !== o ? o : 0, a
3178
+ }
3179
+ return t(r, e), r.payloadify = function (t) {
3180
+ return t ? U$1(n(n({}, e.payloadify.call(this, t)), {
3181
+ user: Ft.payloadify(t.sender),
3182
+ req_id: t.reqId,
3183
+ is_reply_to_channel: t.replyToChannel,
3184
+ request_state: t.sendingStatus,
3185
+ error_code: t.errorCode
3186
+ })) : null
3187
+ }, Object.defineProperty(r.prototype, "isResendable", {
3188
+ get: function () {
3189
+ return this.sendingStatus === le$2.FAILED && ((e = this.errorCode) > 0 && f.indexOf(e) >= 0);
3190
+ var e;
3191
+ },
3192
+ enumerable: !1,
3193
+ configurable: !0
3194
+ }), r.prototype.isIdentical = function (e) {
3195
+ return this.messageId > 0 && e.messageId > 0 ? this.messageId === e.messageId : this.reqId === e.reqId
3196
+ }, r
3197
+ }(qt$1),
3198
+ Gt = function () {
3199
+ function e(e) {
3200
+ var t, n;
3201
+ 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;
3202
+ }
3203
+ return e.payloadify = function (e) {
3204
+ return e ? U$1({
3205
+ url: "",
3206
+ width: e.maxWidth,
3207
+ height: e.maxHeight,
3208
+ real_width: 0,
3209
+ real_height: 0
3210
+ }) : null
3211
+ }, Object.defineProperty(e.prototype, "plainUrl", {
3212
+ get: function () {
3213
+ return this.url.split("?auth=")[0]
3214
+ },
3215
+ enumerable: !1,
3216
+ configurable: !0
3217
+ }), e
3218
+ }(),
3219
+ Qt = {
3220
+ prevResultSize: 0,
3221
+ nextResultSize: 0,
3222
+ isInclusive: !1,
3223
+ reverse: !1,
3224
+ messageTypeFilter: se$1.ALL,
3225
+ customTypesFilter: null,
3226
+ senderUserIdsFilter: null,
3227
+ includeReactions: !1,
3228
+ includeMetaArray: !1,
3229
+ includeParentMessageInfo: !1
3230
+ },
3231
+ jt = function (e) {
3232
+ return y("number", e.prevResultSize) && y("number", e.nextResultSize) && y("boolean", e.isInclusive) && y("boolean", e.reverse) && y("string", e.messageTypeFilter) && m(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)
3233
+ },
3234
+ Kt = function (e) {
3235
+ function s(t, r) {
3236
+ var i, s, o, a, u = this;
3237
+ 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) {
3238
+ var c = r.parent_message_info,
3239
+ l = n(n({}, c), {
3240
+ message_id: u.parentMessageId,
3241
+ channel_url: u.channelUrl,
3242
+ channel_type: u.channelType,
3243
+ file: c.file,
3244
+ url: null === (o = c.file) || void 0 === o ? void 0 : o.url,
3245
+ require_auth: null === (a = c.file) || void 0 === a ? void 0 : a.require_auth
3246
+ });
3247
+ u.parentMessage = Ht(t, l);
3248
+ }
3249
+ return u
3250
+ }
3251
+ return t(s, e), s.payloadify = function (t) {
3252
+ return t ? U$1(n(n({}, e.payloadify.call(this, t)), {
3253
+ message: t.message,
3254
+ translations: t.translations,
3255
+ parent_message_info: Bt(t.parentMessage)
3256
+ })) : null
3257
+ }, s.prototype.getThreadedMessagesByTimestamp = function (e, t) {
3258
+ return r(this, void 0, void 0, (function () {
3259
+ return i(this, (function (r) {
3260
+ switch (r.label) {
3261
+ case 0:
3262
+ return t = n(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)];
3263
+ case 1:
3264
+ return [2, r.sent()]
3265
+ }
3266
+ }))
3267
+ }))
3268
+ }, s
3269
+ }(qt$1),
3270
+ zt = function () {
3271
+ function e(e) {
3272
+ var t, n;
3273
+ 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);
3274
+ }
3275
+ return e.payloadify = function (e) {
3276
+ return e ? U$1({
3277
+ type: e.type,
3278
+ vendor: e.vendor,
3279
+ detail: e.detail
3280
+ }) : null
3281
+ }, e
3282
+ }(),
3283
+ Vt = function (e) {
3284
+ function o(t, r) {
3285
+ var i, o, a, u, c, l, d, h = this;
3286
+ 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 {
3287
+ for (var p = s(h.translationTargetLanguages), f = p.next(); !f.done; f = p.next()) {
3288
+ var _ = f.value;
3289
+ h.translations[_] = "";
3290
+ }
3291
+ } catch (e) {
3292
+ i = {
3293
+ error: e
3294
+ };
3295
+ } finally {
3296
+ try {
3297
+ f && !f.done && (o = p.return) && o.call(p);
3298
+ } finally {
3299
+ if (i) throw i.error
3300
+ }
3301
+ }
3302
+ if (h.messageSurvivalSeconds = null !== (c = r.message_survival_seconds) && void 0 !== c ? c : -1, h.plugins = r.plugins ? r.plugins.map((function (e) {
3303
+ return new zt(e)
3304
+ })) : [], r.parent_message_info) {
3305
+ var g = r.parent_message_info,
3306
+ y = n(n({}, g), {
3307
+ created_at: g.ts,
3308
+ message_id: h.parentMessageId,
3309
+ channel_url: h.channelUrl,
3310
+ channel_type: h.channelType,
3311
+ file: g.file,
3312
+ url: null === (l = g.file) || void 0 === l ? void 0 : l.url,
3313
+ require_auth: null === (d = g.file) || void 0 === d ? void 0 : d.require_auth
3314
+ });
3315
+ h.parentMessage = Ht(t, U$1(y));
3316
+ }
3317
+ return h
3318
+ }
3319
+ return t(o, e), o.payloadify = function (t) {
3320
+ return t ? U$1(n(n({}, e.payloadify.call(this, t)), {
3321
+ message: t.message,
3322
+ translations: t.translations,
3323
+ message_survival_seconds: t.messageSurvivalSeconds,
3324
+ plugins: t.plugins.map((function (e) {
3325
+ return zt.payloadify(e)
3326
+ })),
3327
+ parent_message_info: Bt(t.parentMessage)
3328
+ })) : null
3329
+ }, o.prototype.getThreadedMessagesByTimestamp = function (e, t) {
3330
+ return r(this, void 0, void 0, (function () {
3331
+ return i(this, (function (r) {
3332
+ switch (r.label) {
3333
+ case 0:
3334
+ return t = n(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)];
3335
+ case 1:
3336
+ return [2, r.sent()]
3337
+ }
3338
+ }))
3339
+ }))
3340
+ }, o
3341
+ }(xt),
3342
+ Bt = function (e) {
3343
+ if (e) switch (e.messageType) {
3344
+ case ie$1.USER:
3345
+ return Vt.payloadify(e);
3346
+ case ie$1.FILE:
3347
+ return Wt.payloadify(e);
3348
+ case ie$1.ADMIN:
3349
+ return Kt.payloadify(e)
3350
+ }
3351
+ return null
3352
+ },
3353
+ Ht = function (e, t) {
3354
+ switch (t.type) {
3355
+ case "MESG":
3356
+ return new Vt(e, t);
3357
+ case "FILE":
3358
+ return new Wt(e, t);
3359
+ case "ADMM":
3360
+ case "BRDM":
3361
+ return new Kt(e, t)
3362
+ }
3363
+ return null
3364
+ },
3365
+ Wt = function (e) {
3366
+ function s(t, r) {
3367
+ var i, s, o, a, u, c, l, d, h, p, f, _, g, y, m, v = this;
3368
+ (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;
3369
+ var E = null !== (i = r.file) && void 0 !== i ? i : null;
3370
+ 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) {
3371
+ return new Gt(n(n({}, e), {
3372
+ url: "".concat(e.url.split("?auth=")[0]).concat(v.requireAuth ? "?auth=".concat(Me$1(v._iid)) : "")
3373
+ }))
3374
+ })) : [], v.messageSurvivalSeconds = null !== (g = r.message_survival_seconds) && void 0 !== g ? g : -1, r.parent_message_info) {
3375
+ var I = r.parent_message_info,
3376
+ S = n(n({}, I), {
3377
+ message_id: v.parentMessageId,
3378
+ channel_url: v.channelUrl,
3379
+ channel_type: v.channelType,
3380
+ file: I.file,
3381
+ url: null === (y = I.file) || void 0 === y ? void 0 : y.url,
3382
+ require_auth: null === (m = I.file) || void 0 === m ? void 0 : m.require_auth
3383
+ });
3384
+ v.parentMessage = Ht(t, S);
3385
+ }
3386
+ return v
3387
+ }
3388
+ return t(s, e), s.payloadify = function (t) {
3389
+ return t ? U$1(n(n({}, e.payloadify.call(this, t)), {
3390
+ url: t.plainUrl,
3391
+ require_auth: t.requireAuth,
3392
+ file: {
3393
+ name: t.name,
3394
+ size: t.size,
3395
+ type: t.type,
3396
+ data: t.data
3397
+ },
3398
+ thumbnails: t.thumbnails.map((function (e) {
3399
+ return {
3400
+ url: e.url,
3401
+ width: e.width,
3402
+ height: e.height,
3403
+ real_width: e.realWidth,
3404
+ real_height: e.realHeight
3405
+ }
3406
+ })),
3407
+ message_survival_seconds: t.messageSurvivalSeconds,
3408
+ parent_message_info: Bt(t.parentMessage)
3409
+ })) : null
3410
+ }, Object.defineProperty(s.prototype, "url", {
3411
+ get: function () {
3412
+ return this.requireAuth ? "".concat(this.plainUrl, "?auth=").concat(Me$1(this._iid)) : this.plainUrl
3413
+ },
3414
+ enumerable: !1,
3415
+ configurable: !0
3416
+ }), s.prototype.getThreadedMessagesByTimestamp = function (e, t) {
3417
+ return r(this, void 0, void 0, (function () {
3418
+ return i(this, (function (r) {
3419
+ switch (r.label) {
3420
+ case 0:
3421
+ return t = n(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)];
3422
+ case 1:
3423
+ return [2, r.sent()]
3424
+ }
3425
+ }))
3426
+ }))
3427
+ }, s
3428
+ }(xt),
3429
+ Xt = function (e) {
3430
+ function n(t) {
3431
+ var n, r, i, s = [];
3432
+ return t.mentionType === ae$1.USERS && (t.mentionedUserIds ? s = t.mentionedUserIds : t.mentionedUsers && (s = t.mentionedUsers.map((function (e) {
3433
+ return e.userId
3434
+ })))), e.call(this, {
3435
+ code: "FILE",
3436
+ ackRequired: !0,
3437
+ payload: U$1({
3438
+ channel_url: t.channelUrl,
3439
+ url: t.url,
3440
+ name: null !== (n = t.fileName) && void 0 !== n ? n : "",
3441
+ type: null !== (r = t.mimeType) && void 0 !== r ? r : "",
3442
+ size: null !== (i = t.fileSize) && void 0 !== i ? i : 0,
3443
+ custom: t.data,
3444
+ custom_type: t.customType,
3445
+ thumbnails: t.thumbnailSizes,
3446
+ require_auth: t.requireAuth,
3447
+ metaarray: t.metaArrays,
3448
+ mention_type: t.mentionType,
3449
+ mentioned_user_ids: s,
3450
+ push_option: t.pushNotificationDeliveryOption && t.pushNotificationDeliveryOption !== ce$2.DEFAULT ? t.pushNotificationDeliveryOption : void 0,
3451
+ apple_critical_alert_options: t.appleCriticalAlertOptions,
3452
+ silent: t.silent,
3453
+ reply_to_channel: t.isReplyToChannel,
3454
+ parent_message_id: t.parentMessageId > 0 ? t.parentMessageId : null,
3455
+ req_id: t.reqId
3456
+ })
3457
+ }) || this
3458
+ }
3459
+ return t(n, e), n
3460
+ }(H$2),
3461
+ Yt = function (e) {
3462
+ function n(t) {
3463
+ var n, r = this;
3464
+ r = e.call(this) || this;
3465
+ var i = [];
3466
+ return t.mentionType === ae$1.USERS && (t.mentionedUserIds ? i = t.mentionedUserIds : t.mentionedUsers && (i = t.mentionedUsers.map((function (e) {
3467
+ return e.userId
3468
+ })))), r.method = d$1.POST, r.path = "".concat(We$1(t.channelType), "/").concat(encodeURIComponent(t.channelUrl), "/messages"), r.params = U$1({
3469
+ message_type: ie$1.FILE,
3470
+ user_id: t.userId,
3471
+ url: t.fileUrl,
3472
+ mention_type: t.mentionType,
3473
+ mentioned_user_ids: i,
3474
+ file_name: t.fileName,
3475
+ file_size: t.fileSize,
3476
+ file_type: t.mimeType,
3477
+ data: t.data,
3478
+ custom_type: t.customType,
3479
+ thumbnails: t.thumbnailSizes.map((function (e) {
3480
+ return Gt.payloadify(e)
3481
+ })),
3482
+ require_auth: t.requireAuth,
3483
+ sorted_metaarray: null === (n = t.metaArrays) || void 0 === n ? void 0 : n.map((function (e) {
3484
+ return Dt$1.payloadify(e)
3485
+ })),
3486
+ push_option: t.pushNotificationDeliveryOption,
3487
+ parent_message_id: t.parentMessageId > 0 ? t.parentMessageId : null,
3488
+ apple_critical_alert_options: Lt.payloadify(t.appleCriticalAlertOptions),
3489
+ reply_to_channel: t.isReplyToChannel,
3490
+ req_id: t.reqId
3491
+ }), r
3492
+ }
3493
+ return t(n, e), n
3494
+ }(q$1),
3495
+ Jt = function (e) {
3496
+ function n(t, n, r) {
3497
+ var i, s, o, a = this;
3498
+ (a = e.call(this, t, "FILE", r) || this).message = new Wt(t, r);
3499
+ var u = St$1.of(t).sdkState;
3500
+ 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) {
3501
+ return e.userId
3502
+ })), u.userId), a.forceUpdateLastMessage = null !== (o = r.force_update_last_message) && void 0 !== o && o, a
3503
+ }
3504
+ return t(n, e), n
3505
+ }(B$1),
3506
+ Zt = function (e) {
3507
+ function n(t, n) {
3508
+ var r, i, s = this;
3509
+ (s = e.call(this, t, n) || this).message = new Wt(t, n);
3510
+ var o = St$1.of(t).sdkState;
3511
+ return s.isMentioned = Ye$1(s.message.mentionType, null !== (r = s.message.mentionedUserIds) && void 0 !== r ? r : s.message.mentionedUsers.map((function (e) {
3512
+ return e.userId
3513
+ })), o.userId), s.forceUpdateLastMessage = null !== (i = n.force_update_last_message) && void 0 !== i && i, s
3514
+ }
3515
+ return t(n, e), n
3516
+ }(F);
3517
+ ! function (e) {
3518
+ 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";
3519
+ }(Ut$1 || (Ut$1 = {}));
3520
+ var $t, en = function () {
3521
+ function e(e, t) {
3522
+ var n = t.sdkState,
3523
+ r = t.dispatcher,
3524
+ i = t.requestQueue,
3525
+ s = t.onlineDetector,
3526
+ o = t.cacheContext,
3527
+ a = this;
3528
+ 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) {
3529
+ e instanceof de$2 && (a._connectionState = e.stateType);
3530
+ })), this._onlineDetector = s;
3531
+ }
3532
+ return Object.defineProperty(e.prototype, "_shouldSendThroughWebSocket", {
3533
+ get: function () {
3534
+ return this._connectionState === J$1.CONNECTED || this._connectionState === J$1.CONNECTING || this._connectionState === J$1.RECONNECTING
3535
+ },
3536
+ enumerable: !1,
3537
+ configurable: !0
3538
+ }), e.prototype._sendFileMessage = function (e, t) {
3539
+ return r(this, void 0, void 0, (function () {
3540
+ var r, s;
3541
+ return i(this, (function (i) {
3542
+ switch (i.label) {
3543
+ case 0:
3544
+ return this._shouldSendThroughWebSocket ? (r = new Xt(n(n({
3545
+ channelUrl: e.url,
3546
+ channelType: e.channelType,
3547
+ url: t.params.fileUrl,
3548
+ requireAuth: t.requireAuth
3549
+ }, t.params), {
3550
+ reqId: t.requestId
3551
+ })), [4, this._requestQueue.send(r)]) : [3, 2];
3552
+ case 1:
3553
+ return s = i.sent(), [2, s.as(Jt).message];
3554
+ case 2:
3555
+ return r = new Yt(n(n({
3556
+ channelUrl: e.url,
3557
+ channelType: e.channelType,
3558
+ url: t.params.fileUrl,
3559
+ userId: this._sdkState.userId,
3560
+ requireAuth: t.requireAuth
3561
+ }, t.params), {
3562
+ reqId: t.requestId
3563
+ })), [4, this._requestQueue.send(r)];
3564
+ case 3:
3565
+ return s = i.sent(), [2, s.as(Zt).message]
3566
+ }
3567
+ }))
3568
+ }))
3569
+ }, e.prototype._resolveMessageQueue = function (e) {
3570
+ return r(this, void 0, void 0, (function () {
3571
+ var t, n, r, o, a, c, l, d, h, f, _, g;
3572
+ return i(this, (function (i) {
3573
+ switch (i.label) {
3574
+ case 0:
3575
+ if (!(t = this._queueMap.get(e.url))) return [3, 21];
3576
+ if (t.isResolving) return [3, 20];
3577
+ t.isResolving = !0, n = [], r = !0, i.label = 1;
3578
+ case 1:
3579
+ i.trys.push([1, 15, 16, 17]), o = s(t.messageQueue), a = o.next(), i.label = 2;
3580
+ case 2:
3581
+ if (a.done) return [3, 14];
3582
+ switch (c = a.value, c.state) {
3583
+ case Ut$1.PENDING:
3584
+ case Ut$1.UPLOADING:
3585
+ return [3, 3];
3586
+ case Ut$1.UPLOADED:
3587
+ return [3, 4];
3588
+ case Ut$1.FAILED:
3589
+ return [3, 12]
3590
+ }
3591
+ return [3, 13];
3592
+ case 3:
3593
+ return r = !1, n.push(c), [3, 13];
3594
+ case 4:
3595
+ if (!r) return [3, 10];
3596
+ i.label = 5;
3597
+ case 5:
3598
+ return i.trys.push([5, 8, , 9]), c.state = Ut$1.SENDING, [4, this._sendFileMessage(e, c)];
3599
+ case 6:
3600
+ return l = i.sent(), c.deferred.resolve(l), [4, me$2(100)];
3601
+ case 7:
3602
+ return i.sent(), [3, 9];
3603
+ case 8:
3604
+ return d = i.sent(), c.deferred.reject(d), [3, 9];
3605
+ case 9:
3606
+ return [3, 11];
3607
+ case 10:
3608
+ n.push(c), i.label = 11;
3609
+ case 11:
3610
+ return [3, 13];
3611
+ case 12:
3612
+ return c.deferred.reject(c.error.code === u.REQUEST_CANCELED ? p.fileUploadCanceled : c.error), [3, 13];
3613
+ case 13:
3614
+ return a = o.next(), [3, 2];
3615
+ case 14:
3616
+ return [3, 17];
3617
+ case 15:
3618
+ return h = i.sent(), _ = {
3619
+ error: h
3620
+ }, [3, 17];
3621
+ case 16:
3622
+ try {
3623
+ a && !a.done && (g = o.return) && g.call(o);
3624
+ } finally {
3625
+ if (_) throw _.error
3626
+ }
3627
+ return [7];
3628
+ case 17:
3629
+ return f = t.isResolveRequestPending, t.messageQueue = n, t.isResolving = !1, t.isResolveRequestPending = !1, f ? [4, this._resolveMessageQueue(e)] : [3, 19];
3630
+ case 18:
3631
+ i.sent(), i.label = 19;
3632
+ case 19:
3633
+ return [3, 21];
3634
+ case 20:
3635
+ t.isResolveRequestPending = !0, i.label = 21;
3636
+ case 21:
3637
+ return [2]
3638
+ }
3639
+ }))
3640
+ }))
3641
+ }, e.prototype._uploadNextPendingItem = function (e) {
3642
+ return r(this, void 0, void 0, (function () {
3643
+ var t, n, r, s, o, a, u, c, l, d, h, f, _, g;
3644
+ return i(this, (function (i) {
3645
+ switch (i.label) {
3646
+ case 0:
3647
+ return t = this._queueMap.get(e.url), (n = t.messageQueue.find((function (e) {
3648
+ return e.state === Ut$1.PENDING
3649
+ }))) ? 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];
3650
+ case 1:
3651
+ if (!i.sent()) return [3, 8];
3652
+ i.label = 2;
3653
+ case 2:
3654
+ return i.trys.push([2, 4, 5, 7]), r = new bt$1({
3655
+ file: n.params.file,
3656
+ channelUrl: e.url,
3657
+ thumbnailSizes: n.params.thumbnailSizes,
3658
+ requestId: n.requestId
3659
+ }), [4, this._requestQueue.send(r)];
3660
+ case 3:
3661
+ 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];
3662
+ case 4:
3663
+ return _ = i.sent(), n.state = Ut$1.FAILED, n.error = _, [3, 7];
3664
+ case 5:
3665
+ return (g = t.uploadQueue.findIndex((function (e) {
3666
+ return e.requestId === n.requestId
3667
+ }))) >= 0 && (t.uploadQueue.splice(g, 1), this._uploadNextPendingItem(e)), [4, this._resolveMessageQueue(e)];
3668
+ case 6:
3669
+ return i.sent(), [7];
3670
+ case 7:
3671
+ return [3, 10];
3672
+ case 8:
3673
+ return n.state = Ut$1.FAILED, n.error = p.connectionRequired, (g = t.uploadQueue.findIndex((function (e) {
3674
+ return e.requestId === n.requestId
3675
+ }))) >= 0 && (t.uploadQueue.splice(g, 1), this._uploadNextPendingItem(e)), [4, this._resolveMessageQueue(e)];
3676
+ case 9:
3677
+ i.sent(), i.label = 10;
3678
+ case 10:
3679
+ return [3, 13];
3680
+ case 11:
3681
+ return n.params.thumbnailSizes = [], n.state = Ut$1.UPLOADED, [4, this._resolveMessageQueue(e)];
3682
+ case 12:
3683
+ i.sent(), i.label = 13;
3684
+ case 13:
3685
+ return [2]
3686
+ }
3687
+ }))
3688
+ }))
3689
+ }, e.prototype.request = function (e, t, n) {
3690
+ var s, o, a;
3691
+ return r(this, void 0, void 0, (function () {
3692
+ var r;
3693
+ return i(this, (function (i) {
3694
+ 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, {
3695
+ messageQueue: [],
3696
+ uploadQueue: [],
3697
+ isResolving: !1,
3698
+ isResolveRequestPending: !1
3699
+ }), this._queueMap.get(e.url).messageQueue.push({
3700
+ requestId: t,
3701
+ params: n,
3702
+ state: Ut$1.PENDING,
3703
+ deferred: r,
3704
+ requireAuth: n.requireAuth
3705
+ }), this._uploadNextPendingItem(e), [2, r.promise]
3706
+ }))
3707
+ }))
3708
+ }, e.prototype.cancel = function (e, t) {
3709
+ var n, r;
3710
+ void 0 === t && (t = null);
3711
+ var i = this._queueMap.get(e.url);
3712
+ if (i) {
3713
+ var u = t ? [i.messageQueue.find((function (e) {
3714
+ return e.requestId === t
3715
+ }))] : a([], o(i.messageQueue), !1);
3716
+ try {
3717
+ for (var c = s(u), l = c.next(); !l.done; l = c.next()) {
3718
+ var d = l.value;
3719
+ if (d) switch (d.state) {
3720
+ case Ut$1.PENDING:
3721
+ d.state = Ut$1.FAILED, d.error = p.requestCanceled, this._resolveMessageQueue(e);
3722
+ break;
3723
+ case Ut$1.UPLOADING:
3724
+ this._requestQueue.cancel(d.requestId);
3725
+ }
3726
+ }
3727
+ } catch (e) {
3728
+ n = {
3729
+ error: e
3730
+ };
3731
+ } finally {
3732
+ try {
3733
+ l && !l.done && (r = c.return) && r.call(c);
3734
+ } finally {
3735
+ if (n) throw n.error
3736
+ }
3737
+ }
3738
+ }
3739
+ }, e
3740
+ }(),
3741
+ tn = {
3742
+ prevResultSize: 0,
3743
+ nextResultSize: 0,
3744
+ isInclusive: !1,
3745
+ reverse: !1,
3746
+ messageTypeFilter: se$1.ALL,
3747
+ customTypesFilter: null,
3748
+ senderUserIdsFilter: null,
3749
+ replyType: ue$2.NONE,
3750
+ includeReactions: !1,
3751
+ includeMetaArray: !1,
3752
+ includeParentMessageInfo: !1,
3753
+ includeThreadInfo: !1,
3754
+ showSubchannelMessagesOnly: !1
3755
+ },
3756
+ nn = function (e) {
3757
+ return y("number", e.prevResultSize) && y("number", e.nextResultSize) && y("boolean", e.isInclusive) && y("boolean", e.reverse) && y("string", e.messageTypeFilter) && m(se$1, e.messageTypeFilter) && E("string", e.customTypesFilter, !0) && E("string", e.senderUserIdsFilter, !0) && m(ue$2, e.replyType) && y("boolean", e.includeMetaArray) && y("boolean", e.includeReactions) && y("boolean", e.includeParentMessageInfo) && y("boolean", e.includeThreadInfo) && y("boolean", e.showSubchannelMessagesOnly)
3758
+ },
3759
+ rn = {
3760
+ replyType: ue$2.NONE,
3761
+ includeReactions: !1,
3762
+ includeThreadInfo: !1,
3763
+ includeMetaArray: !1,
3764
+ includeParentMessageInfo: !1,
3765
+ includePollDetails: !1
3766
+ },
3767
+ sn = function (e) {
3768
+ return m(ue$2, e.replyType) && y("boolean", e.includeReactions) && y("boolean", e.includeMetaArray) && y("boolean", e.includeParentMessageInfo) && y("boolean", e.includeThreadInfo) && y("boolean", e.includePollDetails)
3769
+ };
3770
+ ! function (e) {
3771
+ 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";
3772
+ }($t || ($t = {}));
3773
+ var on, an = function (e) {
3774
+ return e.startsWith("EVENT_") || e === $t.SYNC_MESSAGE_FILL || e === $t.SYNC_MESSAGE_CHANGELOGS
3775
+ },
3776
+ un = function (e) {
3777
+ function n(t) {
3778
+ var n = t.messages,
3779
+ r = t.source,
3780
+ i = e.call(this) || this;
3781
+ return i.messages = n, i.source = r, i
3782
+ }
3783
+ return t(n, e), n
3784
+ }(L),
3785
+ cn = function (e) {
3786
+ function n(t) {
3787
+ var n = t.messageIds,
3788
+ r = t.source,
3789
+ i = e.call(this) || this;
3790
+ return i.messageIds = n, i.source = r, i
3791
+ }
3792
+ return t(n, e), n
3793
+ }(L),
3794
+ ln = function (e) {
3795
+ function n(t) {
3796
+ var n = t.reqId,
3797
+ r = t.source,
3798
+ i = e.call(this) || this;
3799
+ return i.reqId = n, i.source = r, i
3800
+ }
3801
+ return t(n, e), n
3802
+ }(L),
3803
+ dn = function (e) {
3804
+ function n(t) {
3805
+ var n = t.channelType,
3806
+ r = t.channelUrl,
3807
+ i = t.messageId,
3808
+ s = t.includeMetaArray,
3809
+ o = t.includeReactions,
3810
+ a = t.includeThreadInfo,
3811
+ u = t.includeParentMessageInfo,
3812
+ c = t.includePollDetails,
3813
+ l = e.call(this) || this;
3814
+ return l.method = d$1.GET, l.path = "".concat(We$1(n), "/").concat(encodeURIComponent(r), "/messages/").concat(encodeURIComponent(i)), l.params = {
3815
+ is_sdk: !0,
3816
+ with_sorted_meta_array: s,
3817
+ include_reactions: o,
3818
+ include_thread_info: a,
3819
+ include_parent_message_info: u,
3820
+ include_poll_details: c
3821
+ }, l
3822
+ }
3823
+ return t(n, e), n
3824
+ }(q$1),
3825
+ hn = function (e) {
3826
+ function r(t, r) {
3827
+ var i = e.call(this, t, r) || this;
3828
+ return i.message = r ? Ht(t, n({}, r)) : null, i
3829
+ }
3830
+ return t(r, e), r
3831
+ }(F),
3832
+ pn = function (e) {
3833
+ function n(t) {
3834
+ var n = t.channelType,
3835
+ r = t.channelUrl,
3836
+ i = t.timestamp,
3837
+ s = void 0 === i ? null : i,
3838
+ o = t.token,
3839
+ a = void 0 === o ? null : o,
3840
+ u = t.prevResultSize,
3841
+ c = t.nextResultSize,
3842
+ l = t.isInclusive,
3843
+ h = t.reverse,
3844
+ p = t.messageTypeFilter,
3845
+ f = t.customTypesFilter,
3846
+ _ = t.senderUserIdsFilter,
3847
+ g = t.replyType,
3848
+ y = t.includeMetaArray,
3849
+ m = t.includeReactions,
3850
+ v = t.parentMessageId,
3851
+ E = t.includeThreadInfo,
3852
+ I = t.includeParentMessageInfo,
3853
+ S = t.showSubchannelMessagesOnly,
3854
+ T = t.includePollDetails,
3855
+ b = e.call(this) || this;
3856
+ return b.method = d$1.GET, b.path = "".concat(We$1(n), "/").concat(encodeURIComponent(r), "/messages"), b.params = U$1({
3857
+ is_sdk: !0,
3858
+ prev_limit: u,
3859
+ next_limit: c,
3860
+ include: l,
3861
+ reverse: h,
3862
+ message_ts: s,
3863
+ message_id: a,
3864
+ message_type: null != p ? p : null,
3865
+ custom_types: f,
3866
+ sender_ids: _,
3867
+ include_reply_type: g,
3868
+ with_sorted_meta_array: y,
3869
+ include_reactions: m,
3870
+ parent_message_id: v,
3871
+ include_thread_info: E,
3872
+ include_parent_message_info: I,
3873
+ show_subchannel_message_only: S,
3874
+ include_poll_details: T
3875
+ }), b
3876
+ }
3877
+ return t(n, e), n
3878
+ }(q$1),
3879
+ fn = function (e) {
3880
+ function n(t, n) {
3881
+ var r = e.call(this, t, n) || this;
3882
+ return r.messages = n.messages.map((function (e) {
3883
+ return Ht(t, e)
3884
+ })), r
3885
+ }
3886
+ return t(n, e), n
3887
+ }(F),
3888
+ _n = function (e) {
3889
+ function n(t) {
3890
+ var n = t.channelType,
3891
+ r = t.channelUrl,
3892
+ i = t.timestamp,
3893
+ s = t.token,
3894
+ o = t.replyType,
3895
+ a = t.includeMetaArray,
3896
+ u = t.includeReactions,
3897
+ c = t.includeThreadInfo,
3898
+ l = t.includeParentMessageInfo,
3899
+ h = t.includePollDetails,
3900
+ p = e.call(this) || this;
3901
+ return p.method = d$1.GET, p.path = "".concat(We$1(n), "/").concat(encodeURIComponent(r), "/messages/changelogs"), p.params = {
3902
+ change_ts: i,
3903
+ token: s,
3904
+ with_sorted_meta_array: a,
3905
+ include_reactions: u,
3906
+ include_thread_info: c,
3907
+ include_reply_type: o,
3908
+ include_parent_message_info: l,
3909
+ include_poll_details: h
3910
+ }, p
3911
+ }
3912
+ return t(n, e), n
3913
+ }(q$1),
3914
+ gn = function (e) {
3915
+ function n(t, n) {
3916
+ var r = e.call(this, t, n) || this;
3917
+ return r.updatedMessages = n.updated.map((function (e) {
3918
+ return Ht(t, e)
3919
+ })), r.deletedMessagesInfo = n.deleted.map((function (e) {
3920
+ return {
3921
+ messageId: e.message_id,
3922
+ deletedAt: e.deleted_at
3923
+ }
3924
+ })), r.hasMore = n.has_more, r.nextToken = n.next, r
3925
+ }
3926
+ return t(n, e), n
3927
+ }(F),
3928
+ yn = function (e) {
3929
+ function n(t) {
3930
+ var n = t.channelUrl,
3931
+ r = t.scheduledMessageId,
3932
+ i = e.call(this) || this;
3933
+ return i.method = d$1.GET, i.path = "".concat(qe$1, "/").concat(encodeURIComponent(n), "/scheduled_messages/").concat(encodeURIComponent(r)), i.params = {}, i
3934
+ }
3935
+ return t(n, e), n
3936
+ }(q$1),
3937
+ mn = function (e) {
3938
+ function r(t, r) {
3939
+ var i = e.call(this, t, r) || this;
3940
+ return i.message = r ? Ht(t, n({}, r)) : null, i
3941
+ }
3942
+ return t(r, e), r
3943
+ }(F),
3944
+ vn = {},
3945
+ En = function () {
3946
+ function e(e, t) {
3947
+ var n = t.sdkState,
3948
+ r = t.dispatcher,
3949
+ i = t.requestQueue,
3950
+ s = t.onlineDetector,
3951
+ o = t.cacheContext;
3952
+ this._iid = e, this._sdkState = n, this._requestQueue = i, this._dispatcher = r, this._onlineDetector = s, this._cacheContext = o, this.fileMessageQueue = new en(e, {
3953
+ sdkState: n,
3954
+ dispatcher: r,
3955
+ requestQueue: i,
3956
+ onlineDetector: s,
3957
+ cacheContext: o
3958
+ }), vn[e] = this;
3959
+ }
3960
+ return e.of = function (e) {
3961
+ return vn[e]
3962
+ }, e.prototype.buildMessageFromSerializedData = function (e) {
3963
+ var t = ot$1(e);
3964
+ switch (t.messageType) {
3965
+ case ie$1.USER:
3966
+ return new Vt(this._iid, Vt.payloadify(t));
3967
+ case ie$1.FILE:
3968
+ return new Wt(this._iid, Wt.payloadify(t));
3969
+ case ie$1.ADMIN:
3970
+ return new Kt(this._iid, Kt.payloadify(t))
3971
+ }
3972
+ return null
3973
+ }, e.prototype.buildUserMessageCreateParamsFromSerializedData = function (e, t) {
3974
+ return U$1({
3975
+ data: t.data,
3976
+ customType: t.customType,
3977
+ mentionType: t.mentionType,
3978
+ mentionedUserIds: t.mentionedUserIds,
3979
+ mentionedUsers: t.mentionedUsers,
3980
+ mentionedMessageTemplate: t.mentionedMessageTemplate,
3981
+ metaArrays: t.metaArrays,
3982
+ parentMessageId: t.parentMessageId,
3983
+ isReplyToChannel: e.isReplyToChannel,
3984
+ pushNotificationDeliveryOption: e.pushNotificationDeliveryOption,
3985
+ appleCriticalAlertOptions: t.appleCriticalAlertOptions,
3986
+ reqId: t.reqId,
3987
+ message: t.message,
3988
+ translationTargetLanguages: Object.keys(t.translations)
3989
+ })
3990
+ }, e.prototype.buildFileMessageCreateParamsFromSerializedData = function (e, t) {
3991
+ return U$1({
3992
+ data: t.data,
3993
+ customType: t.customType,
3994
+ mentionType: t.mentionType,
3995
+ mentionedUserIds: t.mentionedUserIds,
3996
+ mentionedUsers: t.mentionedUsers,
3997
+ mentionedMessageTemplate: t.mentionedMessageTemplate,
3998
+ metaArrays: t.metaArrays,
3999
+ parentMessageId: t.parentMessageId,
4000
+ isReplyToChannel: e.isReplyToChannel,
4001
+ pushNotificationDeliveryOption: e.pushNotificationDeliveryOption,
4002
+ appleCriticalAlertOptions: t.appleCriticalAlertOptions,
4003
+ reqId: t.reqId,
4004
+ file: e.file,
4005
+ fileKey: e.fileKey,
4006
+ fileUrl: t.url,
4007
+ fileName: t.name,
4008
+ fileSize: t.size,
4009
+ mimeType: t.type,
4010
+ thumbnailSizes: t.thumbnails.map((function (e) {
4011
+ return {
4012
+ maxWidth: e.width,
4013
+ maxHeight: e.height
4014
+ }
4015
+ })),
4016
+ fileType: e.fileType,
4017
+ requireAuth: t.requireAuth
4018
+ })
4019
+ }, e.prototype.buildScheduledUserMessageCreateParamsFromSerializedData = function (e, t) {
4020
+ return n(n({}, this.buildUserMessageCreateParamsFromSerializedData(e, t)), {
4021
+ scheduledAt: e.scheduledAt
4022
+ })
4023
+ }, e.prototype.buildScheduledFileMessageCreateParamsFromSerializedData = function (e, t) {
4024
+ return n(n({}, this.buildFileMessageCreateParamsFromSerializedData(e, t)), {
4025
+ scheduledAt: e.scheduledAt
4026
+ })
4027
+ }, e.prototype.buildSenderFromSerializedData = function (e) {
4028
+ var t = ot$1(e);
4029
+ return new Ft(this._iid, Ft.payloadify(t))
4030
+ }, e.prototype.getMessage = function (e) {
4031
+ return r(this, void 0, void 0, (function () {
4032
+ var t, n;
4033
+ return i(this, (function (r) {
4034
+ switch (r.label) {
4035
+ case 0:
4036
+ return t = new dn(e), [4, this._requestQueue.send(t)];
4037
+ case 1:
4038
+ return n = r.sent(), [2, n.as(hn).message]
4039
+ }
4040
+ }))
4041
+ }))
4042
+ }, e.prototype.getScheduledMessage = function (e) {
4043
+ return r(this, void 0, void 0, (function () {
4044
+ var t, n;
4045
+ return i(this, (function (r) {
4046
+ switch (r.label) {
4047
+ case 0:
4048
+ return t = new yn(e), [4, this._requestQueue.send(t)];
4049
+ case 1:
4050
+ return n = r.sent(), [2, n.as(mn).message]
4051
+ }
4052
+ }))
4053
+ }))
4054
+ }, e.prototype.getMessagesByTimestamp = function (e, t, s, o, a) {
4055
+ return void 0 === a && (a = $t.REQUEST_MESSAGE), r(this, void 0, void 0, (function () {
4056
+ var r, u, c;
4057
+ return i(this, (function (i) {
4058
+ switch (i.label) {
4059
+ case 0:
4060
+ return r = new pn(n(n({
4061
+ channelType: t,
4062
+ channelUrl: e,
4063
+ timestamp: s
4064
+ }, tn), o)), [4, this._requestQueue.send(r)];
4065
+ case 1:
4066
+ return u = i.sent(), c = u.as(fn).messages, this._dispatcher.dispatch(new un({
4067
+ messages: c,
4068
+ source: a
4069
+ })), [2, c]
4070
+ }
4071
+ }))
4072
+ }))
4073
+ }, e.prototype.getThreadedMessagesByTimestamp = function (e, t, s, o) {
4074
+ return void 0 === o && (o = $t.REQUEST_THREADED_MESSAGE), r(this, void 0, void 0, (function () {
4075
+ var r, a, u, c;
4076
+ return i(this, (function (i) {
4077
+ switch (i.label) {
4078
+ case 0:
4079
+ return r = new pn(n(n(n({
4080
+ channelUrl: e.channelUrl,
4081
+ channelType: e.channelType,
4082
+ timestamp: t
4083
+ }, Qt), s), {
4084
+ replyType: ue$2.ALL,
4085
+ parentMessageId: e.messageId,
4086
+ includeThreadInfo: !0
4087
+ })), [4, this._requestQueue.send(r)];
4088
+ case 1:
4089
+ return a = i.sent(), u = a.as(fn).messages, (c = u.slice(1)).forEach((function (t) {
4090
+ t.parentMessage = e;
4091
+ })), this._dispatcher.dispatch(new un({
4092
+ messages: c,
4093
+ source: o
4094
+ })), [2, {
4095
+ parentMessage: u[0],
4096
+ threadedMessages: c
4097
+ }]
4098
+ }
4099
+ }))
4100
+ }))
4101
+ }, e.prototype.getMessageChangelogs = function (e, t, s, o, a) {
4102
+ return void 0 === a && (a = $t.REQUEST_MESSAGE_CHANGELOGS), r(this, void 0, void 0, (function () {
4103
+ var r, u, c, l, d, h, p, f;
4104
+ return i(this, (function (i) {
4105
+ switch (i.label) {
4106
+ case 0:
4107
+ return r = new _n(U$1(n(n({
4108
+ channelType: t,
4109
+ channelUrl: e,
4110
+ timestamp: "number" == typeof s ? s : null,
4111
+ token: "string" == typeof s ? s : null
4112
+ }, rn), o))), [4, this._requestQueue.send(r)];
4113
+ case 1:
4114
+ 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) {
4115
+ return e.messageId
4116
+ })), l.length > 0 && this._dispatcher.dispatch(new un({
4117
+ messages: l,
4118
+ source: a
4119
+ })), f.length > 0 && this._dispatcher.dispatch(new cn({
4120
+ messageIds: f,
4121
+ source: a
4122
+ })), [2, {
4123
+ updatedMessages: l,
4124
+ deletedMessageIds: f,
4125
+ hasMore: h,
4126
+ token: p
4127
+ }]
4128
+ }
4129
+ }))
4130
+ }))
4131
+ }, e
4132
+ }(),
4133
+ In = function () {
4134
+ function e() {
4135
+ this._onPending = Y$1, this._onFailed = Y$1, this._onSucceeded = Y$1;
4136
+ }
4137
+ return e.prototype._trigger = function (e, t) {
4138
+ switch (t.sendingStatus) {
4139
+ case le$2.PENDING:
4140
+ this._onPending(t);
4141
+ break;
4142
+ case le$2.FAILED:
4143
+ case le$2.CANCELED:
4144
+ this._onFailed(e, t.isResendable ? t : null);
4145
+ break;
4146
+ case le$2.SCHEDULED:
4147
+ case le$2.SUCCEEDED:
4148
+ this._onSucceeded(t);
4149
+ }
4150
+ }, e.prototype.onPending = function (e) {
4151
+ return this._onPending = e, this
4152
+ }, e.prototype.onFailed = function (e) {
4153
+ return this._onFailed = e, this
4154
+ }, e.prototype.onSucceeded = function (e) {
4155
+ return this._onSucceeded = e, this
4156
+ }, e
4157
+ }(),
4158
+ Sn = function (e) {
4159
+ function n(t, n) {
4160
+ var r = e.call(this, t) || this;
4161
+ r.threadInfo = null, r.targetMessageId = 0, r.channelUrl = null, r.channelType = null;
4162
+ var i = n.thread_info,
4163
+ s = n.root_message_id,
4164
+ o = n.channel_url,
4165
+ a = n.channel_type;
4166
+ 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
4167
+ }
4168
+ return t(n, e), n
4169
+ }(Le$1),
4170
+ Tn = {
4171
+ channelUrl: null,
4172
+ channelType: null,
4173
+ messageId: 0,
4174
+ includeReactions: !1,
4175
+ includeMetaArray: !1,
4176
+ includeParentMessageInfo: !1,
4177
+ includeThreadInfo: !1,
4178
+ includePollDetails: !1
4179
+ },
4180
+ bn = function () {
4181
+ function e(e, t) {
4182
+ var n;
4183
+ 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;
4184
+ }
4185
+ return Object.defineProperty(e.prototype, "hasNext", {
4186
+ get: function () {
4187
+ return this._hasNext
4188
+ },
4189
+ enumerable: !1,
4190
+ configurable: !0
4191
+ }), Object.defineProperty(e.prototype, "isLoading", {
4192
+ get: function () {
4193
+ return this._isLoading
4194
+ },
4195
+ enumerable: !1,
4196
+ configurable: !0
4197
+ }), e.prototype._validate = function () {
4198
+ return y("number", this.limit) && this.limit > 0
4199
+ }, e
4200
+ }(),
4201
+ Nn = function (e) {
4202
+ function n(t) {
4203
+ var n = t.channelCustomType,
4204
+ r = t.keyword,
4205
+ i = t.limit,
4206
+ s = t.reverse,
4207
+ o = t.exactMatch,
4208
+ a = t.channelUrl,
4209
+ u = t.order,
4210
+ c = t.messageTimestampFrom,
4211
+ l = t.messageTimestampTo,
4212
+ h = t.advancedQuery,
4213
+ p = t.targetFields,
4214
+ f = t.nextToken,
4215
+ _ = e.call(this) || this;
4216
+ return _.method = d$1.GET, _.path = "".concat(Qe$1, "/messages"), _.params = {
4217
+ custom_type: n,
4218
+ query: r,
4219
+ limit: i,
4220
+ reverse: s,
4221
+ exact_match: o,
4222
+ channel_url: a,
4223
+ message_ts_from: c,
4224
+ message_ts_to: l,
4225
+ sort_field: u,
4226
+ advanced_query: h,
4227
+ target_fields: p,
4228
+ after: f
4229
+ }, _
4230
+ }
4231
+ return t(n, e), n
4232
+ }(q$1),
4233
+ An = function (e) {
4234
+ function n(t, n) {
4235
+ var r = e.call(this, t, n) || this;
4236
+ return r.messages = n.results.map((function (e) {
4237
+ return Ht(t, e)
4238
+ })), r.hasNext = n.has_next, r.nextToken = n.end_cursor, r
4239
+ }
4240
+ return t(n, e), n
4241
+ }(F);
4242
+ ! function (e) {
4243
+ e.SCORE = "score", e.TIMESTAMP = "ts";
4244
+ }(on || (on = {}));
4245
+ var Cn = function (e) {
4246
+ function s(t, n) {
4247
+ var r, i, s, o, a, u, c, l, d, h = this;
4248
+ 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
4249
+ }
4250
+ return t(s, e), s.prototype._validate = function () {
4251
+ 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)
4252
+ }, s.prototype.next = function () {
4253
+ return r(this, void 0, void 0, (function () {
4254
+ var e, t, r, s, o, a, u;
4255
+ return i(this, (function (i) {
4256
+ switch (i.label) {
4257
+ case 0:
4258
+ return this._validate() ? this._isLoading ? [3, 3] : this._hasNext ? (this._isLoading = !0, e = St$1.of(this._iid).requestQueue, t = new Nn(n(n({}, this), {
4259
+ nextToken: this._nextToken ? this._nextToken : null
4260
+ })), [4, e.send(t)]) : [3, 2] : [3, 5];
4261
+ case 1:
4262
+ 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];
4263
+ case 2:
4264
+ return [2, []];
4265
+ case 3:
4266
+ throw p.queryInProgress;
4267
+ case 4:
4268
+ return [3, 6];
4269
+ case 5:
4270
+ throw p.invalidParameters;
4271
+ case 6:
4272
+ return [2]
4273
+ }
4274
+ }))
4275
+ }))
4276
+ }, s
4277
+ }(bn),
4278
+ On = function (e) {
4279
+ function n(t, n, r, i) {
4280
+ var s = e.call(this, t, i) || this;
4281
+ return s.channelUrl = n, s.channelType = r, s
4282
+ }
4283
+ return t(n, e), n.prototype._validate = function () {
4284
+ return e.prototype._validate.call(this) && y("string", this.channelUrl) && m(ne$1, this.channelType)
4285
+ }, n
4286
+ }(bn),
4287
+ wn = function (e) {
4288
+ function n(t, n, r, i) {
4289
+ var s, o, a, u, c, l, d, h, p, f, _ = this;
4290
+ return (_ = e.call(this, t, n, r, i) || this).reverse = !1, _.messageTypeFilter = se$1.ALL, _.customTypesFilter = null, _.senderUserIdsFilter = null, _.replyType = ue$2.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 : 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 : ue$2.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, _
4291
+ }
4292
+ return t(n, e), n.prototype._validate = function () {
4293
+ return e.prototype._validate.call(this) && y("boolean", this.reverse) && m(se$1, this.messageTypeFilter) && m(ue$2, 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)
4294
+ }, n.prototype.load = function () {
4295
+ return r(this, void 0, void 0, (function () {
4296
+ var e;
4297
+ return i(this, (function (t) {
4298
+ switch (t.label) {
4299
+ case 0:
4300
+ return this._validate() ? this._isLoading ? [3, 3] : this._hasNext ? (this._isLoading = !0, [4, En.of(this._iid).getMessagesByTimestamp(this.channelUrl, this.channelType, this._edge, {
4301
+ prevResultSize: this.limit,
4302
+ nextResultSize: 0,
4303
+ isInclusive: !1,
4304
+ reverse: this.reverse,
4305
+ messageTypeFilter: this.messageTypeFilter,
4306
+ customTypesFilter: this.customTypesFilter,
4307
+ replyType: this.replyType,
4308
+ senderUserIdsFilter: this.senderUserIdsFilter,
4309
+ includeReactions: this.includeReactions,
4310
+ includeMetaArray: this.includeMetaArray,
4311
+ includeParentMessageInfo: this.includeParentMessageInfo,
4312
+ includeThreadInfo: this.includeThreadInfo,
4313
+ showSubchannelMessagesOnly: this.showSubchannelMessagesOnly
4314
+ })]) : [3, 2] : [3, 5];
4315
+ case 1:
4316
+ return e = t.sent(), this._edge = Math.min.apply(Math, a([Number.MAX_SAFE_INTEGER], o(e.map((function (e) {
4317
+ return e.createdAt
4318
+ }))), !1)), this._hasNext = e.length >= this.limit, this._isLoading = !1, [2, e];
4319
+ case 2:
4320
+ return [2, []];
4321
+ case 3:
4322
+ throw p.queryInProgress;
4323
+ case 4:
4324
+ return [3, 6];
4325
+ case 5:
4326
+ throw p.invalidParameters;
4327
+ case 6:
4328
+ return [2]
4329
+ }
4330
+ }))
4331
+ }))
4332
+ }, n
4333
+ }(On),
4334
+ Rn = {
4335
+ channelUrl: null,
4336
+ scheduledMessageId: 0
4337
+ },
4338
+ Dn = function (e) {
4339
+ function s() {
4340
+ var t = null !== e && e.apply(this, arguments) || this;
4341
+ return t.name = "message", t
4342
+ }
4343
+ return t(s, e), s.prototype.init = function (t, n) {
4344
+ var r = n.sdkState,
4345
+ i = n.dispatcher,
4346
+ s = n.sessionManager,
4347
+ o = n.requestQueue,
4348
+ a = n.logger,
4349
+ u = n.onlineDetector,
4350
+ c = n.cacheContext;
4351
+ e.prototype.init.call(this, t, {
4352
+ sdkState: r,
4353
+ dispatcher: i,
4354
+ sessionManager: s,
4355
+ requestQueue: o,
4356
+ logger: a,
4357
+ onlineDetector: u,
4358
+ cacheContext: c
4359
+ }), this._manager = new En(t, {
4360
+ sdkState: r,
4361
+ dispatcher: i,
4362
+ requestQueue: o,
4363
+ onlineDetector: u,
4364
+ cacheContext: c
4365
+ });
4366
+ }, s.prototype.buildMessageFromSerializedData = function (e) {
4367
+ return this._manager.buildMessageFromSerializedData(e)
4368
+ }, s.prototype.buildSenderFromSerializedData = function (e) {
4369
+ return this._manager.buildSenderFromSerializedData(e)
4370
+ }, s.prototype.getMessage = function (e) {
4371
+ return r(this, void 0, void 0, (function () {
4372
+ return i(this, (function (t) {
4373
+ return e = n(n({}, Tn), e), at$1(function (e) {
4374
+ return y("string", e.channelUrl) && y("string", e.channelType) && m(ne$1, e.channelType) && y("number", e.messageId) && y("boolean", e.includeMetaArray) && y("boolean", e.includeParentMessageInfo) && y("boolean", e.includeThreadInfo) && y("boolean", e.includePollDetails)
4375
+ }(e)).throw(p.invalidParameters), [2, this._manager.getMessage(e)]
4376
+ }))
4377
+ }))
4378
+ }, s.prototype.getScheduledMessage = function (e) {
4379
+ return r(this, void 0, void 0, (function () {
4380
+ return i(this, (function (t) {
4381
+ return e = n(n({}, Rn), e), at$1(function (e) {
4382
+ return y("string", e.channelUrl) && y("number", e.scheduledMessageId)
4383
+ }(e)).throw(p.invalidParameters), [2, this._manager.getScheduledMessage(e)]
4384
+ }))
4385
+ }))
4386
+ }, s
4387
+ }(Tt$1);
4388
+
4389
+ var oe$1,ue$1={data:null,customType:null,mentionType: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(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=n(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=n(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(n(n({},e.payloadify.call(this,t)),Te.payloadify(t.restrictionInfo))):null},t$1}(ct$1),Ie={data:null,customType:null,mentionType: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(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=n(n({},Ie),{message:null,translationTargetLanguages:null}),Me=function(e){return Ee$1(e)&&y("string",e.message,!0)&&E("string",e.translationTargetLanguages,!0)},Se=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=d$1.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$1),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$1,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$1=new Ce(n(n({},this),{channelUrl:this.channelUrl,token:this._token})),[4,t.send(n$1)]):[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=d$1.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$1),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$1,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(n(n({},this),{token:this._token})),[4,e.send(t)]):[3,2]:[3,5];case 1:return n$1=s.sent(),r=n$1.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=d$1.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$1),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$1,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(n(n({},this),{token:this._token})),[4,e.send(t)]):[3,2]:[3,5];case 1:return n$1=s.sent(),r=n$1.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=d$1.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$1);!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=d$1.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$1);!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=d$1.GET,n.path="".concat(We$1(i),"/").concat(encodeURIComponent(r),"/mute/").concat(a),n}return t(t$1,e),t$1}(q$1),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=d$1.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$1),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=d$1.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$1),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$1),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=d$1.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$1),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=d$1.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$1),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=d$1.GET,n.path="".concat(We$1(i),"/").concat(encodeURIComponent(r),"/metacounter"),n.params={keys:a},n}return t(t$1,e),t$1}(q$1),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=d$1.POST,n.path="".concat(We$1(i),"/").concat(encodeURIComponent(r),"/metacounter"),n.params={metacounter:a},n}return t(t$1,e),t$1}(q$1),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=d$1.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$1),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$1),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=d$1.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$1);!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=d$1.DELETE,n.path="".concat(We$1(i),"/").concat(encodeURIComponent(r),"/metacounter"),n.params=null,n}return t(t$1,e),t$1}(q$1);!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=d$1.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$1);!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$1),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=d$1.DELETE,n.path="".concat(We$1(i),"/").concat(encodeURIComponent(r),"/mute/").concat(encodeURIComponent(a)),n}return t(t$1,e),t$1}(q$1);!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$1),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=d$1.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$1);!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$1),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=d$1.DELETE,n.path="".concat(We$1(i),"/").concat(encodeURIComponent(r),"/ban/").concat(encodeURIComponent(a)),n}return t(t$1,e),t$1}(q$1);!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$1),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=d$1.PUT,n.path="".concat(We$1(i),"/").concat(encodeURIComponent(r),"/freeze"),n.params={freeze:a},n}return t(t$1,e),t$1}(q$1);!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$1),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=d$1.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$1),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=d$1.POST,n.path="/report/users/".concat(o),n.params={channel_url:r,channel_type:i===ne$1.OPEN?"open_channels":"group_channels",report_category:a,reporting_user_id:s,report_description:u},n}return t(t$1,e),t$1}(q$1),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=d$1.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$1),yt=function(t$1){function n(n){var r=[];return n.mentionType===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$2),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$1),_t=function(t$1){function n(n){var r=[];return n.mentionType===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$2),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$1),Ut=function(t$1){function n(n){var r=[];return n.mentionType===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$2),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$1),Et=function(e){function t$1(t){var n=e.call(this)||this;return n.method=d$1.DELETE,n.path="".concat(We$1(t.channelType),"/").concat(t.channelUrl,"/messages/").concat(t.messageId),n}return t(t$1,e),t$1}(q$1);!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$1),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=d$1.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$1),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=d$1.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$1),bt=function(e){function t$1(t,n$1){var r=e.call(this,t,n$1)||this;return r.reactionEvent=new wt$1(n({},n$1)),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=d$1.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$1),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===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=d$1.POST,i.path="".concat(We$1(u),"/").concat(encodeURIComponent(c),"/scheduled_messages"),i.params={req_id:n.reqId,scheduled_at:n.scheduledAt,message_type:oe$2.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$1),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===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=d$1.POST,i.path="".concat(We$1(u),"/").concat(encodeURIComponent(c),"/scheduled_messages"),i.params={req_id:n.reqId,scheduled_at:n.scheduledAt,message_type:oe$2.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$1),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=ne$1.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(n(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===ne$1.GROUP},l.prototype.isOpenChannel=function(){return this.channelType===ne$1.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$1){return r(this,void 0,void 0,(function(){return i(this,(function(r){switch(r.label){case 0:return n$1=n(n({},tn),n$1),at$1(y("number",e)&&nn(n$1)).throw(p.invalidParameters),[4,En.of(this._iid).getMessagesByTimestamp(this.url,this.channelType,e,n$1)];case 1:return [2,r.sent()]}}))}))},l.prototype.getMessageChangeLogsSinceTimestamp=function(e,n$1){return r(this,void 0,void 0,(function(){return i(this,(function(r){switch(r.label){case 0:return n$1=n(n({},rn),n$1),at$1(y("number",e)&&sn(n$1)).throw(p.invalidParameters),[4,En.of(this._iid).getMessageChangelogs(this.url,this.channelType,e,n$1)];case 1:return [2,r.sent()]}}))}))},l.prototype.getMessageChangeLogsSinceToken=function(e,n$1){return r(this,void 0,void 0,(function(){return i(this,(function(r){switch(r.label){case 0:return n$1=n(n({},rn),n$1),at$1(y("string",e)&&sn(n$1)).throw(p.invalidParameters),[4,En.of(this._iid).getMessageChangelogs(this.url,this.channelType,e,n$1)];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:le$2.PENDING,mentioned_user_ids:e.mentionedUserIds,mentioned_users:e.mentionedUsers})},l.prototype._createPendingUserMessage=function(e,t,n$1){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(n(n({},this._createPendingSendableMessagePayload(e,t,n$1)),{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$1){var r=U$1(n(n({},this._createPendingSendableMessagePayload(e,t,n$1)),{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=le$2.CANCELED:n||(e.sendingStatus=le$2.FAILED);},l.prototype.sendUserMessage=function(e){return e=n(n({},de$1),e),at$1(he$1(e)).throw(p.invalidParameters),this._sendUserMessage(e)},l.prototype._sendUserMessage=function(e,t,n$1){var r$1=this;void 0===t&&(t=Date.now()),void 0===n$1&&(n$1=null);var i$1=St$1.of(this._iid),a=i$1.dispatcher,s=i$1.requestQueue,o=n$1,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:$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(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:$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===le$2.PENDING?$t.REQUEST_RESEND_MESSAGE:$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$1){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$1=n(n({},we),n$1),at$1(y("number",e)&&Me(n$1)).throw(p.invalidParameters),r=St$1.of(this._iid),i$1=r.dispatcher,a=r.requestQueue,s=new _t(n({channelType:this.channelType,channelUrl:this.url,messageId:e},n$1)),[4,a.send(s)];case 1:return o=l.sent(),c=o.as(Tt).message,i$1.dispatch(new un({messages:[c],source:$t.EVENT_MESSAGE_UPDATED})),[2,c]}}))}))},l.prototype.copyUserMessage=function(e,t){var n$1,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===le$2.SUCCEEDED&&e.url===t.channelUrl&&!t.scheduledInfo).throw(p.invalidParameters),a=new ee$1,o=null!==(n$1=t.messageParams)&&void 0!==n$1?n$1:n(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$1=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$1._createPendingScheduledUserMessage(e,o,s);i$1.dispatch(new un({messages:[r$1],source:$t.EVENT_MESSAGE_SENT_PENDING})),Ie$1((function(){return r(n$1,void 0,void 0,(function(){return i(this,(function(e){return [2,t._trigger(null,r$1)]}))}))}));}));var c=new Dt(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:$t.EVENT_MESSAGE_SENT_SUCCESS})),Ie$1((function(){return r(n$1,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$1._createPendingScheduledUserMessage(e,o,s);n$1._markMessageAsFailed(a,r$1),i$1.dispatch(new un({messages:[a],source:$t.EVENT_MESSAGE_SENT_FAILED})),Ie$1((function(){return r(n$1,void 0,void 0,(function(){return i(this,(function(e){return [2,t._trigger(r$1,a)]}))}))}));}));}));},l.prototype.sendFileMessage=function(e){return e=n(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:$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:$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===le$2.PENDING?$t.REQUEST_RESEND_MESSAGE:$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$1,r$1){var i$1=this,a=St$1.of(this._iid),s=a.dispatcher,o=a.requestQueue,c=new Nt(n(n({reqId:n$1,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:$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$1,r$1);i$1._markMessageAsFailed(o,a),s.dispatch(new un({messages:[o],source:$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$1;at$1(e.every((function(e){return ge$1(n(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$1=i.return)&&n$1.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$1){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$1=n(n({},Se),n$1),at$1(y("number",e)&&function(e){return Ee$1(e)}(n$1)).throw(p.invalidParameters),r=St$1.of(this._iid),i$1=r.dispatcher,a=r.requestQueue,s=new Ut(n({channelType:this.channelType,channelUrl:this.url,messageId:e},n$1)),[4,a.send(s)];case 1:return o=l.sent(),c=o.as(It).message,i$1.dispatch(new un({messages:[c],source:$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$1,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===le$2.SUCCEEDED&&e.url===t.channelUrl&&!t.scheduledInfo).throw(p.invalidParameters),i$1=new ee$1,a=n(n({},t),{fileUrl:t.url,fileName:t.name,fileSize:t.size,mimeType:t.type,mentionType:t.mentionType,mentionedUserIds:null!==(n$1=t.mentionedUserIds)&&void 0!==n$1?n$1: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:$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);
4390
+
4391
+ var B,H$1,z,q;!function(e){e.SUCCESS="success",e.PENDING="pending",e.ERROR="error";}(B||(B={})),function(e){e.DEFAULT="default",e.ALL="all",e.MENTION_ONLY="mention_only",e.OFF="off";}(H$1||(H$1={})),function(e){e.FCM="gcm",e.APNS="apns",e.UNKNOWN="unknown";}(z||(z={})),function(e){e.ALTERNATIVE="alternative",e.DEFAULT="default";}(q||(q={}));var K,G,Q,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";}(K||(K={})),function(e){e.CHRONOLOGICAL="chronological",e.CHANNEL_NAME_ALPHABETICAL="channel_name_alphabetical",e.METADATA_VALUE_ALPHABETICAL="metadata_value_alphabetical";}(G||(G={})),function(e){e.CREATED_AT="created_at",e.SCHEDULED_AT="scheduled_at";}(Q||(Q={}));var Z,$=function(e){switch(e){case K.LATEST_LAST_MESSAGE:return ["-lastMessageUpdatedAt","-createdAt","syncIndex"];case K.CHRONOLOGICAL:return ["-createdAt","syncIndex"];case K.CHANNEL_NAME_ALPHABETICAL:return ["name"]}},ee=function(){function r(){this.messageTypeFilter=se$1.ALL,this.customTypesFilter=null,this.senderUserIdsFilter=null,this.replyType=ue$2.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 se$1.USER:if(r.messageType!==ie$1.USER)return !1;break;case se$1.FILE:if(r.messageType!==ie$1.FILE)return !1;break;case 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 ue$2.NONE:if(r.parentMessageId>0)return !1;break;case ue$2.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";}(Z||(Z={}));var te,se=function(e){switch(e){case Z.CHANNEL_LATEST:return ["channelUrl","-createdAt","-messageId"];case Z.NEWEST_CHILD_MESSAGE:return ["channelUrl","-parentMessageId","-createdAt","-messageId"]}},ne=n(n({},de$1),{scheduledAt:null}),re=function(e){return he$1(e)&&y("number",e.scheduledAt,!0)},ae=n(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=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,n(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 n(n({},ve$1(e)),{scheduledAt:e.scheduledAt})}(e.scheduledInfo.scheduledMessageParams))),s},t$1.prototype._deserialize=function(e){return e?(e=n(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?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!==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: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 n(n({},e.serialize()),{messageId:"".concat(e.messageId)})},t$1.prototype._deserialize=function(e){return e=n(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?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 Z.CHANNEL_LATEST:if(!g&&e.createdAt>s||g&&e.createdAt<s)return !1;break;case 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: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(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(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(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 J$1.CONNECTED:i._isProcessingAutoResend||i.processAutoResendRegisteredPendingMessages().then((function(){return i._processNextAutoResend()}));break;case 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=le$2.FAILED,n.errorCode=u.ACK_TIMEOUT,this._dispatcher.dispatch(new un({messages:[n],source:$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=le$2.FAILED,this._dispatcher.dispatch(new un({messages:[n],source:$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===le$2.SUCCEEDED||e.sendingStatus===le$2.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:le$2.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";}(te||(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$1),_e=function(e){function t$1(t){var s=t.userId,n=e.call(this)||this;return n.method=d$1.GET,n.path="".concat(Ue$1,"/").concat(encodeURIComponent(s),"/push_preference"),n}return t(t$1,e),t$1}(q$1),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=d$1.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$1),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);
4392
+
4393
+ var _;!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";}(_||(_={}));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===ne$1.GROUP},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isOpenChannelEvent",{get:function(){return this.channelType===ne$1.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$1),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$1),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$1),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$1),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$1),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$1),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;};
4394
+
4395
+ export { $$1 as $, me as A, B$1 as B, Cn as C, lt$1 as D, E, F, dt$1 as G, b as H, Ie$1 as I, Dn as J, Ke$1 as K, Le$1 as L, Me$1 as M, A$1 as N, N as O, ve as P, $ as Q, R, St$1 as S, K as T, Ue$1 as U, V, W, J as X, Y$1 as Y, X as Z, se as _, n as a, Q as a$, Z as a0, ce as a1, oe as a2, he as a3, ue as a4, S as a5, B as a6, m as a7, Ee as a8, _e as a9, T as aA, H as aB, wt as aC, Tt as aD, It as aE, c as aF, gt as aG, Jt as aH, A as aI, En as aJ, T$1 as aK, se$1 as aL, z$1 as aM, le$2 as aN, xt as aO, an as aP, $t as aQ, Ie as aR, we as aS, Bt as aT, ne as aU, re as aV, ae as aW, ie as aX, me$2 as aY, un as aZ, G as a_, ye as aa, H$1 as ab, Ae as ac, q as ad, On as ae, st$1 as af, Tt$1 as ag, Ge$1 as ah, xe$1 as ai, H$2 as aj, kt as ak, U as al, de$2 as am, J$1 as an, h$1 as ao, tt as ap, je as aq, pt as ar, _ as as, ct as at, dt as au, at as av, ot as aw, d as ax, C as ay, h as az, bn as b, Ct$1 as b0, re$1 as b1, Ue as b2, L as b3, Fe$1 as b4, qe$1 as b5, Ve$1 as b6, Ot$1 as b7, fe as b8, We$1 as b9, Ht as ba, ee as bb, Y as bc, ae$1 as bd, oe$2 as be, Gt as bf, Dt$1 as bg, Lt as bh, Wt as bi, In as bj, j as bk, Vt as bl, cn as bm, Se$1 as bn, Ee$2 as bo, ln as bp, Rt as bq, Me as br, Ot as bs, Ee$1 as bt, Nt$1 as bu, bt$1 as bv, c$1 as c, at$1 as d, ct$1 as e, M as f, d$1 as g, U$1 as h, i, j$1 as j, ze$1 as k, a as l, o as m, ne$1 as n, ot$1 as o, p, q$1 as q, r, s, t, ue$2 as u, pe as v, be as w, te as x, y, z };
4396
+ //# sourceMappingURL=__bundle-7dfccc8c-db2ded0f.js.map