@mtkruto/node 0.67.2 → 0.69.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1183) hide show
  1. package/esm/0_deps.d.ts +12 -12
  2. package/esm/0_deps.js +14 -14
  3. package/esm/0_errors.js +2 -6
  4. package/esm/3_errors.js +2 -12
  5. package/esm/3_types.d.ts +4 -0
  6. package/esm/3_types.d.ts.map +1 -1
  7. package/esm/3_types.js +4 -0
  8. package/esm/4_constants.d.ts +1 -1
  9. package/esm/4_constants.d.ts.map +1 -1
  10. package/esm/4_errors.d.ts +2 -2
  11. package/esm/4_errors.d.ts.map +1 -1
  12. package/esm/4_errors.js +2 -12
  13. package/esm/_dnt.polyfills.d.ts +99 -0
  14. package/esm/_dnt.polyfills.d.ts.map +1 -1
  15. package/esm/_dnt.polyfills.js +127 -1
  16. package/esm/_dnt.test_polyfills.d.ts.map +1 -0
  17. package/esm/client/0_client_abstract.d.ts +3 -3
  18. package/esm/client/0_client_abstract.d.ts.map +1 -1
  19. package/esm/client/0_filters.d.ts +1 -1
  20. package/esm/client/0_filters.d.ts.map +1 -1
  21. package/esm/client/0_filters.js +3 -3
  22. package/esm/client/0_filters_test.d.ts.map +1 -1
  23. package/esm/client/0_html.d.ts +1 -1
  24. package/esm/client/0_html.d.ts.map +1 -1
  25. package/esm/client/0_html.js +1 -1
  26. package/esm/client/0_markdown.d.ts +1 -1
  27. package/esm/client/0_markdown.d.ts.map +1 -1
  28. package/esm/client/0_markdown.js +8 -8
  29. package/esm/client/0_markdown_test.d.ts.map +1 -1
  30. package/esm/client/0_params.d.ts +44 -8
  31. package/esm/client/0_params.d.ts.map +1 -1
  32. package/esm/client/0_password.d.ts +5 -5
  33. package/esm/client/0_password.d.ts.map +1 -1
  34. package/esm/client/0_password.js +1 -1
  35. package/esm/client/0_password_test.d.ts.map +1 -1
  36. package/esm/client/0_storage_operations.d.ts +4 -4
  37. package/esm/client/0_storage_operations.d.ts.map +1 -1
  38. package/esm/client/0_storage_operations.js +159 -171
  39. package/esm/client/0_storage_operations_test.d.ts.map +1 -1
  40. package/esm/client/0_update_processor.d.ts +2 -2
  41. package/esm/client/0_update_processor.d.ts.map +1 -1
  42. package/esm/client/0_utilities.d.ts +1 -1
  43. package/esm/client/0_utilities.js +8 -8
  44. package/esm/client/0_utilities_test.d.ts.map +1 -1
  45. package/esm/client/1_client_plain.d.ts +3 -3
  46. package/esm/client/1_client_plain.d.ts.map +1 -1
  47. package/esm/client/1_client_plain.js +5 -23
  48. package/esm/client/1_composer.d.ts +3 -3
  49. package/esm/client/1_composer.d.ts.map +1 -1
  50. package/esm/client/1_composer.js +14 -27
  51. package/esm/client/1_types.d.ts +4 -4
  52. package/esm/client/1_types.d.ts.map +1 -1
  53. package/esm/client/2_account_manager.d.ts +3 -3
  54. package/esm/client/2_account_manager.d.ts.map +1 -1
  55. package/esm/client/2_account_manager.js +86 -98
  56. package/esm/client/2_bot_info_manager.d.ts +3 -3
  57. package/esm/client/2_bot_info_manager.d.ts.map +1 -1
  58. package/esm/client/2_bot_info_manager.js +26 -38
  59. package/esm/client/2_business_connection_manager.d.ts +3 -3
  60. package/esm/client/2_business_connection_manager.d.ts.map +1 -1
  61. package/esm/client/2_business_connection_manager.js +10 -23
  62. package/esm/client/2_client_encrypted.d.ts +2 -2
  63. package/esm/client/2_client_encrypted.d.ts.map +1 -1
  64. package/esm/client/2_client_encrypted.js +194 -211
  65. package/esm/client/2_file_manager.d.ts +7 -6
  66. package/esm/client/2_file_manager.d.ts.map +1 -1
  67. package/esm/client/2_file_manager.js +303 -245
  68. package/esm/client/2_file_manager_test.d.ts.map +1 -1
  69. package/esm/client/2_network_statistics_manager.d.ts +1 -1
  70. package/esm/client/2_network_statistics_manager.d.ts.map +1 -1
  71. package/esm/client/2_network_statistics_manager.js +8 -21
  72. package/esm/client/2_payment_manager.d.ts +4 -4
  73. package/esm/client/2_payment_manager.d.ts.map +1 -1
  74. package/esm/client/2_payment_manager.js +7 -20
  75. package/esm/client/2_reaction_manager.d.ts +3 -3
  76. package/esm/client/2_reaction_manager.d.ts.map +1 -1
  77. package/esm/client/2_reaction_manager.js +7 -20
  78. package/esm/client/2_translations_manager.d.ts +4 -4
  79. package/esm/client/2_translations_manager.d.ts.map +1 -1
  80. package/esm/client/2_translations_manager.js +97 -107
  81. package/esm/client/2_update_manager.d.ts +2 -2
  82. package/esm/client/2_update_manager.d.ts.map +1 -1
  83. package/esm/client/2_update_manager.js +766 -761
  84. package/esm/client/3_client_encrypted_pool.d.ts +1 -1
  85. package/esm/client/3_client_encrypted_pool.d.ts.map +1 -1
  86. package/esm/client/3_client_encrypted_pool.js +10 -26
  87. package/esm/client/3_client_encrypted_pool_test.d.ts.map +1 -1
  88. package/esm/client/3_message_manager.d.ts +11 -8
  89. package/esm/client/3_message_manager.d.ts.map +1 -1
  90. package/esm/client/3_message_manager.js +580 -466
  91. package/esm/client/3_message_manager_test.d.ts.map +1 -1
  92. package/esm/client/3_video_chat_manager.d.ts +6 -6
  93. package/esm/client/3_video_chat_manager.d.ts.map +1 -1
  94. package/esm/client/3_video_chat_manager.js +61 -72
  95. package/esm/client/4_callback_query_manager.d.ts +5 -5
  96. package/esm/client/4_callback_query_manager.d.ts.map +1 -1
  97. package/esm/client/4_callback_query_manager.js +18 -30
  98. package/esm/client/4_chat_list_manager.d.ts +6 -6
  99. package/esm/client/4_chat_list_manager.d.ts.map +1 -1
  100. package/esm/client/4_chat_list_manager.js +328 -324
  101. package/esm/client/4_chat_manager.d.ts +7 -7
  102. package/esm/client/4_chat_manager.d.ts.map +1 -1
  103. package/esm/client/4_chat_manager.js +120 -133
  104. package/esm/client/4_forum_manager.d.ts +4 -4
  105. package/esm/client/4_forum_manager.d.ts.map +1 -1
  106. package/esm/client/4_forum_manager.js +67 -73
  107. package/esm/client/4_gift_manager.d.ts +4 -4
  108. package/esm/client/4_gift_manager.d.ts.map +1 -1
  109. package/esm/client/4_gift_manager.js +17 -30
  110. package/esm/client/4_inline_query_manager.d.ts +5 -5
  111. package/esm/client/4_inline_query_manager.d.ts.map +1 -1
  112. package/esm/client/4_inline_query_manager.js +16 -28
  113. package/esm/client/4_link_preview_manager.d.ts +5 -5
  114. package/esm/client/4_link_preview_manager.d.ts.map +1 -1
  115. package/esm/client/4_link_preview_manager.js +6 -19
  116. package/esm/client/4_poll_manager.d.ts +4 -4
  117. package/esm/client/4_poll_manager.d.ts.map +1 -1
  118. package/esm/client/4_poll_manager.js +44 -57
  119. package/esm/client/4_story_manager.d.ts +7 -7
  120. package/esm/client/4_story_manager.d.ts.map +1 -1
  121. package/esm/client/4_story_manager.js +43 -55
  122. package/esm/client/5_client.d.ts +34 -15
  123. package/esm/client/5_client.d.ts.map +1 -1
  124. package/esm/client/5_client.js +1299 -1291
  125. package/esm/connection/0_connection.d.ts +1 -1
  126. package/esm/connection/0_connection.d.ts.map +1 -1
  127. package/esm/connection/1_connection_tcp.node.d.ts +1 -1
  128. package/esm/connection/1_connection_tcp.node.d.ts.map +1 -1
  129. package/esm/connection/1_connection_tcp.node.js +49 -66
  130. package/esm/connection/1_connection_web_socket.d.ts +1 -1
  131. package/esm/connection/1_connection_web_socket.d.ts.map +1 -1
  132. package/esm/connection/1_connection_web_socket.js +75 -91
  133. package/esm/deps/jsr.io/@roj/tgcrypto/1.0.1/dist/tgcrypto.js +3 -11
  134. package/{script/deps/jsr.io/@std/assert/1.0.13 → esm/deps/jsr.io/@std/assert/1.0.14}/assert.d.ts.map +1 -1
  135. package/esm/deps/jsr.io/@std/assert/1.0.14/assertion_error.d.ts +26 -0
  136. package/esm/deps/jsr.io/@std/assert/1.0.14/assertion_error.d.ts.map +1 -0
  137. package/esm/deps/jsr.io/@std/assert/1.0.14/assertion_error.js +30 -0
  138. package/esm/deps/jsr.io/@std/assert/{1.0.13 → 1.0.14}/equal.d.ts.map +1 -1
  139. package/esm/deps/jsr.io/@std/assert/{1.0.13 → 1.0.14}/equals.d.ts.map +1 -1
  140. package/esm/deps/jsr.io/@std/assert/{1.0.13 → 1.0.14}/false.d.ts.map +1 -1
  141. package/esm/deps/jsr.io/@std/assert/1.0.14/unreachable.d.ts +15 -0
  142. package/esm/deps/jsr.io/@std/assert/1.0.14/unreachable.d.ts.map +1 -0
  143. package/esm/deps/jsr.io/@std/assert/1.0.14/unreachable.js +20 -0
  144. package/esm/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/_util.d.ts.map +1 -1
  145. package/esm/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/abortable.d.ts.map +1 -1
  146. package/esm/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/deadline.d.ts.map +1 -1
  147. package/esm/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/debounce.d.ts.map +1 -1
  148. package/esm/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/delay.d.ts.map +1 -1
  149. package/esm/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/delay.js +17 -2
  150. package/esm/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/mod.d.ts.map +1 -1
  151. package/esm/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/mux_async_iterator.d.ts.map +1 -1
  152. package/esm/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/mux_async_iterator.js +31 -47
  153. package/esm/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/pool.d.ts.map +1 -1
  154. package/esm/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/retry.d.ts.map +1 -1
  155. package/esm/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/tee.d.ts.map +1 -1
  156. package/esm/deps/jsr.io/@std/async/1.0.14/tee.js +79 -0
  157. package/esm/deps/jsr.io/@std/datetime/0.225.5/_date_time_formatter.js +4 -17
  158. package/esm/deps/jsr.io/@std/internal/1.0.10/_os.d.ts +2 -0
  159. package/esm/deps/jsr.io/@std/internal/1.0.10/_os.d.ts.map +1 -0
  160. package/esm/deps/jsr.io/@std/internal/1.0.10/_os.js +12 -0
  161. package/esm/deps/jsr.io/@std/internal/1.0.10/os.d.ts +3 -0
  162. package/esm/deps/jsr.io/@std/internal/1.0.10/os.d.ts.map +1 -0
  163. package/esm/deps/jsr.io/@std/internal/1.0.10/os.js +5 -0
  164. package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/assert_path.d.ts.map +1 -1
  165. package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/basename.d.ts.map +1 -1
  166. package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/constants.d.ts.map +1 -1
  167. package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/from_file_url.d.ts.map +1 -1
  168. package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/normalize.d.ts.map +1 -1
  169. package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/normalize_string.d.ts.map +1 -1
  170. package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/strip_trailing_separators.d.ts.map +1 -1
  171. package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/to_file_url.d.ts.map +1 -1
  172. package/{script/deps/jsr.io/@std/path/1.1.0 → esm/deps/jsr.io/@std/path/1.1.2}/basename.d.ts.map +1 -1
  173. package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/basename.js +1 -1
  174. package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/extname.d.ts.map +1 -1
  175. package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/extname.js +1 -1
  176. package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/is_absolute.d.ts.map +1 -1
  177. package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/is_absolute.js +1 -1
  178. package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/join.d.ts.map +1 -1
  179. package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/join.js +1 -1
  180. package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/_util.d.ts.map +1 -1
  181. package/{script/deps/jsr.io/@std/path/1.1.0 → esm/deps/jsr.io/@std/path/1.1.2}/posix/basename.d.ts.map +1 -1
  182. package/{script/deps/jsr.io/@std/path/1.1.0 → esm/deps/jsr.io/@std/path/1.1.2}/posix/extname.d.ts.map +1 -1
  183. package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/from_file_url.d.ts.map +1 -1
  184. package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/is_absolute.d.ts.map +1 -1
  185. package/{script/deps/jsr.io/@std/path/1.1.0 → esm/deps/jsr.io/@std/path/1.1.2}/posix/join.d.ts.map +1 -1
  186. package/{script/deps/jsr.io/@std/path/1.1.0 → esm/deps/jsr.io/@std/path/1.1.2}/posix/normalize.d.ts.map +1 -1
  187. package/{script/deps/jsr.io/@std/path/1.1.0 → esm/deps/jsr.io/@std/path/1.1.2}/posix/to_file_url.d.ts.map +1 -1
  188. package/{script/deps/jsr.io/@std/path/1.1.0 → esm/deps/jsr.io/@std/path/1.1.2}/to_file_url.d.ts.map +1 -1
  189. package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/to_file_url.js +1 -1
  190. package/{script/deps/jsr.io/@std/path/1.1.0 → esm/deps/jsr.io/@std/path/1.1.2}/windows/_util.d.ts.map +1 -1
  191. package/{script/deps/jsr.io/@std/path/1.1.0 → esm/deps/jsr.io/@std/path/1.1.2}/windows/basename.d.ts.map +1 -1
  192. package/{script/deps/jsr.io/@std/path/1.1.0 → esm/deps/jsr.io/@std/path/1.1.2}/windows/extname.d.ts.map +1 -1
  193. package/{script/deps/jsr.io/@std/path/1.1.0 → esm/deps/jsr.io/@std/path/1.1.2}/windows/from_file_url.d.ts.map +1 -1
  194. package/{script/deps/jsr.io/@std/path/1.1.0 → esm/deps/jsr.io/@std/path/1.1.2}/windows/is_absolute.d.ts.map +1 -1
  195. package/{script/deps/jsr.io/@std/path/1.1.0 → esm/deps/jsr.io/@std/path/1.1.2}/windows/join.d.ts.map +1 -1
  196. package/{script/deps/jsr.io/@std/path/1.1.0 → esm/deps/jsr.io/@std/path/1.1.2}/windows/normalize.d.ts.map +1 -1
  197. package/{script/deps/jsr.io/@std/path/1.1.0 → esm/deps/jsr.io/@std/path/1.1.2}/windows/to_file_url.d.ts.map +1 -1
  198. package/esm/deps/jsr.io/@std/streams/{1.0.10 → 1.0.11}/to_array_buffer.d.ts.map +1 -1
  199. package/esm/mod.js +2 -12
  200. package/esm/session/0_session_state.js +12 -38
  201. package/esm/session/1_session.d.ts +2 -2
  202. package/esm/session/1_session.d.ts.map +1 -1
  203. package/esm/session/1_session.js +49 -72
  204. package/esm/session/2_session_encrypted.d.ts +2 -2
  205. package/esm/session/2_session_encrypted.d.ts.map +1 -1
  206. package/esm/session/2_session_encrypted.js +324 -320
  207. package/esm/session/2_session_plain.js +1 -1
  208. package/esm/storage/0_storage.d.ts +1 -1
  209. package/esm/storage/0_storage.d.ts.map +1 -1
  210. package/esm/storage/1_utilities.d.ts +14 -11
  211. package/esm/storage/1_utilities.d.ts.map +1 -1
  212. package/esm/storage/1_utilities.js +17 -17
  213. package/esm/storage/1_utilities_test.d.ts.map +1 -1
  214. package/esm/storage/2_storage_indexed_db.d.ts +1 -1
  215. package/esm/storage/2_storage_indexed_db.d.ts.map +1 -1
  216. package/esm/storage/2_storage_indexed_db.js +29 -47
  217. package/esm/storage/2_storage_local_storage.node.d.ts +1 -1
  218. package/esm/storage/2_storage_local_storage.node.d.ts.map +1 -1
  219. package/esm/storage/2_storage_local_storage.node.js +15 -28
  220. package/esm/storage/2_storage_memory.d.ts +2 -2
  221. package/esm/storage/2_storage_memory.d.ts.map +1 -1
  222. package/esm/storage/2_storage_memory.js +26 -43
  223. package/esm/storage/2_storage_session_storage.d.ts +2 -2
  224. package/esm/storage/2_storage_session_storage.d.ts.map +1 -1
  225. package/esm/storage/2_storage_session_storage.js +6 -19
  226. package/esm/tl/0_utilities.js +1 -1
  227. package/esm/tl/0_utilities_test.d.ts.map +1 -1
  228. package/esm/tl/1_tl_reader.d.ts +1 -1
  229. package/esm/tl/1_tl_reader.d.ts.map +1 -1
  230. package/esm/tl/1_tl_reader.js +82 -90
  231. package/esm/tl/1_tl_reader_test.d.ts.map +1 -1
  232. package/esm/tl/1_tl_writer.d.ts +1 -1
  233. package/esm/tl/1_tl_writer.d.ts.map +1 -1
  234. package/esm/tl/1_tl_writer.js +155 -164
  235. package/esm/tl/1_tl_writer_test.d.ts.map +1 -1
  236. package/esm/tl/1_utilities.d.ts +1 -1
  237. package/esm/tl/1_utilities.d.ts.map +1 -1
  238. package/esm/tl/1_utilities.js +2 -2
  239. package/esm/tl/2_message.js +1 -1
  240. package/esm/tl/2_mtproto.d.ts +1 -1
  241. package/esm/tl/2_mtproto.d.ts.map +1 -1
  242. package/esm/tl/2_telegram.d.ts +1 -1
  243. package/esm/tl/2_telegram.d.ts.map +1 -1
  244. package/esm/transport/0_obfuscation.d.ts +1 -1
  245. package/esm/transport/0_obfuscation.d.ts.map +1 -1
  246. package/esm/transport/0_obfuscation.js +2 -2
  247. package/esm/transport/0_transport.d.ts +1 -1
  248. package/esm/transport/0_transport.d.ts.map +1 -1
  249. package/esm/transport/0_transport.js +1 -8
  250. package/esm/transport/1_transport_abridged.d.ts +1 -1
  251. package/esm/transport/1_transport_abridged.d.ts.map +1 -1
  252. package/esm/transport/1_transport_abridged.js +11 -24
  253. package/esm/transport/1_transport_intermediate.d.ts +1 -1
  254. package/esm/transport/1_transport_intermediate.d.ts.map +1 -1
  255. package/esm/transport/1_transport_intermediate.js +10 -23
  256. package/esm/transport/1_transport_provider.d.ts +2 -2
  257. package/esm/transport/1_transport_provider.d.ts.map +1 -1
  258. package/esm/transport/2_transport_provider_tcp.d.ts +1 -1
  259. package/esm/transport/2_transport_provider_tcp.d.ts.map +1 -1
  260. package/esm/transport/2_transport_provider_web_socket.d.ts +1 -1
  261. package/esm/transport/2_transport_provider_web_socket.d.ts.map +1 -1
  262. package/esm/transport/2_transport_provider_web_socket.js +1 -1
  263. package/esm/types/0_birthday.d.ts +1 -1
  264. package/esm/types/0_birthday.d.ts.map +1 -1
  265. package/esm/types/0_callback_query_answer.d.ts +1 -1
  266. package/esm/types/0_callback_query_answer.d.ts.map +1 -1
  267. package/esm/types/0_callback_query_question.js +2 -2
  268. package/esm/types/0_chat_administrator_rights.d.ts +1 -1
  269. package/esm/types/0_chat_administrator_rights.d.ts.map +1 -1
  270. package/esm/types/0_chat_member_rights.d.ts +1 -1
  271. package/esm/types/0_chat_member_rights.d.ts.map +1 -1
  272. package/esm/types/0_contact.d.ts +1 -1
  273. package/esm/types/0_contact.d.ts.map +1 -1
  274. package/esm/types/0_dice.d.ts +1 -1
  275. package/esm/types/0_dice.d.ts.map +1 -1
  276. package/esm/types/0_failed_invitation.d.ts +1 -1
  277. package/esm/types/0_failed_invitation.d.ts.map +1 -1
  278. package/esm/types/0_invoice.d.ts +1 -1
  279. package/esm/types/0_invoice.d.ts.map +1 -1
  280. package/esm/types/0_live_stream_channel.d.ts +1 -1
  281. package/esm/types/0_live_stream_channel.d.ts.map +1 -1
  282. package/esm/types/0_mask_position.d.ts +1 -1
  283. package/esm/types/0_mask_position.d.ts.map +1 -1
  284. package/esm/types/0_mask_position.js +1 -1
  285. package/esm/types/0_message_entity.d.ts +1 -1
  286. package/esm/types/0_message_entity.d.ts.map +1 -1
  287. package/esm/types/0_message_entity.js +1 -1
  288. package/esm/types/0_message_search_filter.d.ts +1 -1
  289. package/esm/types/0_message_search_filter.d.ts.map +1 -1
  290. package/esm/types/0_opening_hours.d.ts +1 -1
  291. package/esm/types/0_opening_hours.d.ts.map +1 -1
  292. package/esm/types/0_reaction.js +5 -5
  293. package/esm/types/0_refunded_payment.d.ts +1 -1
  294. package/esm/types/0_refunded_payment.d.ts.map +1 -1
  295. package/esm/types/0_restriction_reason.d.ts +1 -1
  296. package/esm/types/0_restriction_reason.d.ts.map +1 -1
  297. package/esm/types/0_self_destruct_option.js +3 -3
  298. package/esm/types/0_shipping_address.d.ts +1 -1
  299. package/esm/types/0_shipping_address.d.ts.map +1 -1
  300. package/esm/types/0_slow_mode_duration.js +2 -2
  301. package/esm/types/0_upload_progress.d.ts +29 -0
  302. package/esm/types/0_upload_progress.d.ts.map +1 -0
  303. package/esm/types/0_upload_progress.js +20 -0
  304. package/esm/types/0_voice.d.ts +1 -1
  305. package/esm/types/0_voice.d.ts.map +1 -1
  306. package/esm/types/0_voice_transcription.d.ts +1 -1
  307. package/esm/types/0_voice_transcription.d.ts.map +1 -1
  308. package/esm/types/1_animation.d.ts +1 -1
  309. package/esm/types/1_animation.d.ts.map +1 -1
  310. package/esm/types/1_audio.d.ts +1 -1
  311. package/esm/types/1_audio.d.ts.map +1 -1
  312. package/esm/types/1_bot_command_scope.d.ts +2 -2
  313. package/esm/types/1_bot_command_scope.d.ts.map +1 -1
  314. package/esm/types/1_chat_p.d.ts +2 -2
  315. package/esm/types/1_chat_p.d.ts.map +1 -1
  316. package/esm/types/1_chat_p.js +2 -2
  317. package/esm/types/1_document.d.ts +1 -1
  318. package/esm/types/1_document.d.ts.map +1 -1
  319. package/esm/types/1_giveaway.d.ts +2 -2
  320. package/esm/types/1_giveaway.d.ts.map +1 -1
  321. package/esm/types/1_inline_keyboard_button.d.ts +3 -3
  322. package/esm/types/1_inline_keyboard_button.d.ts.map +1 -1
  323. package/esm/types/1_inline_keyboard_button.js +4 -4
  324. package/esm/types/1_inline_query_result_button.d.ts +1 -1
  325. package/esm/types/1_inline_query_result_button.d.ts.map +1 -1
  326. package/esm/types/1_input_media.d.ts +4 -4
  327. package/esm/types/1_input_media.d.ts.map +1 -1
  328. package/esm/types/1_input_story_content.d.ts +1 -1
  329. package/esm/types/1_input_story_content.d.ts.map +1 -1
  330. package/esm/types/1_keyboard_button.d.ts +3 -3
  331. package/esm/types/1_keyboard_button.d.ts.map +1 -1
  332. package/esm/types/1_keyboard_button.js +1 -1
  333. package/esm/types/1_message_reaction.d.ts +1 -1
  334. package/esm/types/1_message_reaction.d.ts.map +1 -1
  335. package/esm/types/1_message_reaction.js +2 -2
  336. package/esm/types/1_mini_app_info.d.ts +2 -2
  337. package/esm/types/1_mini_app_info.d.ts.map +1 -1
  338. package/esm/types/1_network_statistics.d.ts +1 -1
  339. package/esm/types/1_network_statistics.d.ts.map +1 -1
  340. package/esm/types/1_order_info.d.ts +2 -2
  341. package/esm/types/1_order_info.d.ts.map +1 -1
  342. package/esm/types/1_photo.d.ts +1 -1
  343. package/esm/types/1_photo.d.ts.map +1 -1
  344. package/esm/types/1_poll_option.d.ts +2 -2
  345. package/esm/types/1_poll_option.d.ts.map +1 -1
  346. package/esm/types/1_poll_option.js +2 -2
  347. package/esm/types/1_reaction_count.d.ts +2 -2
  348. package/esm/types/1_reaction_count.d.ts.map +1 -1
  349. package/esm/types/1_reply_quote.d.ts +2 -2
  350. package/esm/types/1_reply_quote.d.ts.map +1 -1
  351. package/esm/types/1_sticker.d.ts +4 -4
  352. package/esm/types/1_sticker.d.ts.map +1 -1
  353. package/esm/types/1_sticker.js +2 -2
  354. package/esm/types/1_story_privacy.d.ts +1 -1
  355. package/esm/types/1_story_privacy.d.ts.map +1 -1
  356. package/esm/types/1_story_reaction.d.ts +2 -2
  357. package/esm/types/1_story_reaction.d.ts.map +1 -1
  358. package/esm/types/1_user.d.ts +2 -2
  359. package/esm/types/1_user.d.ts.map +1 -1
  360. package/esm/types/1_user.js +1 -1
  361. package/esm/types/1_venue.d.ts +1 -1
  362. package/esm/types/1_venue.d.ts.map +1 -1
  363. package/esm/types/1_video.d.ts +1 -1
  364. package/esm/types/1_video.d.ts.map +1 -1
  365. package/esm/types/1_video_note.d.ts +1 -1
  366. package/esm/types/1_video_note.d.ts.map +1 -1
  367. package/esm/types/2_business_connection.d.ts +3 -3
  368. package/esm/types/2_business_connection.d.ts.map +1 -1
  369. package/esm/types/2_chat.d.ts +6 -6
  370. package/esm/types/2_chat.d.ts.map +1 -1
  371. package/esm/types/2_chat.js +3 -3
  372. package/esm/types/2_chat_member.d.ts +4 -4
  373. package/esm/types/2_chat_member.d.ts.map +1 -1
  374. package/esm/types/2_chat_member.js +1 -1
  375. package/esm/types/2_chat_settings.d.ts +1 -1
  376. package/esm/types/2_chat_settings.d.ts.map +1 -1
  377. package/esm/types/2_chat_settings.js +1 -1
  378. package/esm/types/2_chosen_inline_result.d.ts +3 -3
  379. package/esm/types/2_chosen_inline_result.d.ts.map +1 -1
  380. package/esm/types/2_forward_header.d.ts +4 -4
  381. package/esm/types/2_forward_header.d.ts.map +1 -1
  382. package/esm/types/2_forward_header.js +6 -6
  383. package/esm/types/2_game.d.ts +3 -3
  384. package/esm/types/2_game.d.ts.map +1 -1
  385. package/esm/types/2_gift_upgraded_component.d.ts +2 -2
  386. package/esm/types/2_gift_upgraded_component.d.ts.map +1 -1
  387. package/esm/types/2_inactive_chat.d.ts +1 -1
  388. package/esm/types/2_inactive_chat.d.ts.map +1 -1
  389. package/esm/types/2_inline_query.d.ts +3 -3
  390. package/esm/types/2_inline_query.d.ts.map +1 -1
  391. package/esm/types/2_inline_query.js +1 -1
  392. package/esm/types/2_invite_link.d.ts +3 -3
  393. package/esm/types/2_invite_link.d.ts.map +1 -1
  394. package/esm/types/2_message_interactions.d.ts +1 -1
  395. package/esm/types/2_message_interactions.d.ts.map +1 -1
  396. package/esm/types/2_message_reaction_count.d.ts +4 -4
  397. package/esm/types/2_message_reaction_count.d.ts.map +1 -1
  398. package/esm/types/2_message_reactions.d.ts +4 -4
  399. package/esm/types/2_message_reactions.d.ts.map +1 -1
  400. package/esm/types/2_poll.d.ts +3 -3
  401. package/esm/types/2_poll.d.ts.map +1 -1
  402. package/esm/types/2_poll.js +3 -3
  403. package/esm/types/2_poll_answer.d.ts +22 -3
  404. package/esm/types/2_poll_answer.d.ts.map +1 -1
  405. package/esm/types/2_poll_answer.js +19 -0
  406. package/esm/types/2_pre_checkout_query.d.ts +4 -4
  407. package/esm/types/2_pre_checkout_query.d.ts.map +1 -1
  408. package/esm/types/2_reply_markup.d.ts +3 -3
  409. package/esm/types/2_reply_markup.d.ts.map +1 -1
  410. package/esm/types/2_reply_to.d.ts +2 -2
  411. package/esm/types/2_reply_to.d.ts.map +1 -1
  412. package/esm/types/2_sticker_set.d.ts +51 -0
  413. package/esm/types/2_sticker_set.d.ts.map +1 -0
  414. package/esm/types/2_sticker_set.js +91 -0
  415. package/esm/types/2_story_content.d.ts +2 -2
  416. package/esm/types/2_story_content.d.ts.map +1 -1
  417. package/esm/types/2_story_interactions.d.ts +2 -2
  418. package/esm/types/2_story_interactions.d.ts.map +1 -1
  419. package/esm/types/2_story_interactive_area.d.ts +5 -5
  420. package/esm/types/2_story_interactive_area.d.ts.map +1 -1
  421. package/esm/types/2_successful_payment.d.ts +2 -2
  422. package/esm/types/2_successful_payment.d.ts.map +1 -1
  423. package/esm/types/3_chat_member_updated.d.ts +5 -5
  424. package/esm/types/3_chat_member_updated.d.ts.map +1 -1
  425. package/esm/types/3_gift.d.ts +4 -4
  426. package/esm/types/3_gift.d.ts.map +1 -1
  427. package/esm/types/3_join_request.d.ts +4 -4
  428. package/esm/types/3_join_request.d.ts.map +1 -1
  429. package/esm/types/3_story.d.ts +8 -8
  430. package/esm/types/3_story.d.ts.map +1 -1
  431. package/esm/types/4_claimed_gift.d.ts +4 -4
  432. package/esm/types/4_claimed_gift.d.ts.map +1 -1
  433. package/esm/types/4_link_preview.d.ts +5 -5
  434. package/esm/types/4_link_preview.d.ts.map +1 -1
  435. package/esm/types/5_claimed_gifts.d.ts +2 -2
  436. package/esm/types/5_claimed_gifts.d.ts.map +1 -1
  437. package/esm/types/5_claimed_gifts.js +3 -3
  438. package/esm/types/5_message.d.ts +29 -29
  439. package/esm/types/5_message.d.ts.map +1 -1
  440. package/esm/types/5_message.js +8 -8
  441. package/esm/types/5_message_content.d.ts +4 -4
  442. package/esm/types/5_message_content.d.ts.map +1 -1
  443. package/esm/types/6_callback_query.d.ts +3 -3
  444. package/esm/types/6_callback_query.d.ts.map +1 -1
  445. package/esm/types/6_callback_query.js +2 -2
  446. package/esm/types/6_chat_list_item.d.ts +4 -4
  447. package/esm/types/6_chat_list_item.d.ts.map +1 -1
  448. package/esm/types/6_chat_list_item.js +6 -6
  449. package/esm/types/6_inline_query_result.d.ts +6 -6
  450. package/esm/types/6_inline_query_result.d.ts.map +1 -1
  451. package/esm/types/6_inline_query_result.js +16 -16
  452. package/esm/types/6_saved_chat.d.ts +36 -0
  453. package/esm/types/6_saved_chat.d.ts.map +1 -0
  454. package/esm/types/6_saved_chat.js +43 -0
  455. package/esm/types/6_topic.d.ts +2 -2
  456. package/esm/types/6_topic.d.ts.map +1 -1
  457. package/esm/types/6_topic.js +1 -1
  458. package/esm/types/7_inline_query_answer.d.ts +2 -2
  459. package/esm/types/7_inline_query_answer.d.ts.map +1 -1
  460. package/esm/types/7_saved_chats.d.ts +33 -0
  461. package/esm/types/7_saved_chats.d.ts.map +1 -0
  462. package/esm/types/7_saved_chats.js +36 -0
  463. package/esm/types/7_update.d.ts +44 -25
  464. package/esm/types/7_update.d.ts.map +1 -1
  465. package/esm/types/_file_id.d.ts +60 -49
  466. package/esm/types/_file_id.d.ts.map +1 -1
  467. package/esm/types/_file_id.js +92 -73
  468. package/esm/types/_getters.d.ts +3 -3
  469. package/esm/types/_getters.d.ts.map +1 -1
  470. package/esm/utilities/0_bigint.js +5 -5
  471. package/esm/utilities/0_bigint_test.d.ts.map +1 -1
  472. package/esm/utilities/0_buffer.d.ts +1 -1
  473. package/esm/utilities/0_buffer.d.ts.map +1 -1
  474. package/esm/utilities/0_buffer.js +3 -3
  475. package/esm/utilities/0_buffer_test.d.ts.map +1 -1
  476. package/esm/utilities/0_env.js +1 -1
  477. package/esm/utilities/0_hash.d.ts +2 -2
  478. package/esm/utilities/0_hash.d.ts.map +1 -1
  479. package/esm/utilities/0_misc.d.ts.map +1 -1
  480. package/esm/utilities/0_misc.js +4 -3
  481. package/esm/utilities/0_mutex.js +4 -19
  482. package/esm/utilities/0_part_stream.js +11 -25
  483. package/esm/utilities/0_part_stream_test.d.ts.map +1 -1
  484. package/esm/utilities/0_rle.d.ts +2 -2
  485. package/esm/utilities/0_rle.d.ts.map +1 -1
  486. package/esm/utilities/0_rle.js +1 -1
  487. package/esm/utilities/0_rle_test.d.ts.map +1 -1
  488. package/esm/utilities/0_text.d.ts +20 -1
  489. package/esm/utilities/0_text.d.ts.map +1 -1
  490. package/esm/utilities/0_text.js +19 -0
  491. package/esm/utilities/1_auth.d.ts +1 -1
  492. package/esm/utilities/1_auth.d.ts.map +1 -1
  493. package/esm/utilities/1_auth.js +1 -1
  494. package/esm/utilities/1_base64.d.ts +1 -1
  495. package/esm/utilities/1_base64.d.ts.map +1 -1
  496. package/esm/utilities/1_base64.js +1 -1
  497. package/esm/utilities/1_base64_test.d.ts.map +1 -1
  498. package/esm/utilities/1_crypto.js +42 -53
  499. package/esm/utilities/1_crypto_test.d.ts.map +1 -1
  500. package/esm/utilities/1_logger.d.ts +2 -2
  501. package/esm/utilities/1_logger.js +2 -2
  502. package/esm/utilities/1_math.js +2 -2
  503. package/esm/utilities/1_math_test.d.ts.map +1 -1
  504. package/esm/utilities/2_queue.js +29 -47
  505. package/package.json +1 -1
  506. package/script/0_deps.d.ts +12 -12
  507. package/script/0_deps.js +14 -14
  508. package/script/0_errors.js +2 -6
  509. package/script/2_tl.js +17 -7
  510. package/script/3_errors.js +2 -12
  511. package/script/3_types.d.ts +4 -0
  512. package/script/3_types.d.ts.map +1 -1
  513. package/script/3_types.js +4 -0
  514. package/script/4_constants.d.ts +1 -1
  515. package/script/4_constants.d.ts.map +1 -1
  516. package/script/4_constants.js +17 -7
  517. package/script/4_errors.d.ts +2 -2
  518. package/script/4_errors.d.ts.map +1 -1
  519. package/script/4_errors.js +2 -12
  520. package/script/_dnt.polyfills.d.ts +99 -0
  521. package/script/_dnt.polyfills.d.ts.map +1 -1
  522. package/script/_dnt.polyfills.js +128 -0
  523. package/script/_dnt.test_polyfills.d.ts.map +1 -0
  524. package/script/client/0_client_abstract.d.ts +3 -3
  525. package/script/client/0_client_abstract.d.ts.map +1 -1
  526. package/script/client/0_filters.d.ts +1 -1
  527. package/script/client/0_filters.d.ts.map +1 -1
  528. package/script/client/0_filters.js +3 -3
  529. package/script/client/0_filters_test.d.ts.map +1 -1
  530. package/script/client/0_html.d.ts +1 -1
  531. package/script/client/0_html.d.ts.map +1 -1
  532. package/script/client/0_html.js +1 -1
  533. package/script/client/0_markdown.d.ts +1 -1
  534. package/script/client/0_markdown.d.ts.map +1 -1
  535. package/script/client/0_markdown.js +8 -8
  536. package/script/client/0_markdown_test.d.ts.map +1 -1
  537. package/script/client/0_params.d.ts +44 -8
  538. package/script/client/0_params.d.ts.map +1 -1
  539. package/script/client/0_password.d.ts +5 -5
  540. package/script/client/0_password.d.ts.map +1 -1
  541. package/script/client/0_password.js +18 -8
  542. package/script/client/0_password_test.d.ts.map +1 -1
  543. package/script/client/0_storage_operations.d.ts +4 -4
  544. package/script/client/0_storage_operations.d.ts.map +1 -1
  545. package/script/client/0_storage_operations.js +159 -171
  546. package/script/client/0_storage_operations_test.d.ts.map +1 -1
  547. package/script/client/0_update_processor.d.ts +2 -2
  548. package/script/client/0_update_processor.d.ts.map +1 -1
  549. package/script/client/0_utilities.d.ts +1 -1
  550. package/script/client/0_utilities.js +8 -8
  551. package/script/client/0_utilities_test.d.ts.map +1 -1
  552. package/script/client/1_client_plain.d.ts +3 -3
  553. package/script/client/1_client_plain.d.ts.map +1 -1
  554. package/script/client/1_client_plain.js +5 -23
  555. package/script/client/1_composer.d.ts +3 -3
  556. package/script/client/1_composer.d.ts.map +1 -1
  557. package/script/client/1_composer.js +14 -27
  558. package/script/client/1_types.d.ts +4 -4
  559. package/script/client/1_types.d.ts.map +1 -1
  560. package/script/client/2_account_manager.d.ts +3 -3
  561. package/script/client/2_account_manager.d.ts.map +1 -1
  562. package/script/client/2_account_manager.js +86 -98
  563. package/script/client/2_bot_info_manager.d.ts +3 -3
  564. package/script/client/2_bot_info_manager.d.ts.map +1 -1
  565. package/script/client/2_bot_info_manager.js +26 -38
  566. package/script/client/2_business_connection_manager.d.ts +3 -3
  567. package/script/client/2_business_connection_manager.d.ts.map +1 -1
  568. package/script/client/2_business_connection_manager.js +10 -23
  569. package/script/client/2_client_encrypted.d.ts +2 -2
  570. package/script/client/2_client_encrypted.d.ts.map +1 -1
  571. package/script/client/2_client_encrypted.js +195 -212
  572. package/script/client/2_file_manager.d.ts +7 -6
  573. package/script/client/2_file_manager.d.ts.map +1 -1
  574. package/script/client/2_file_manager.js +320 -252
  575. package/script/client/2_file_manager_test.d.ts.map +1 -1
  576. package/script/client/2_network_statistics_manager.d.ts +1 -1
  577. package/script/client/2_network_statistics_manager.d.ts.map +1 -1
  578. package/script/client/2_network_statistics_manager.js +8 -21
  579. package/script/client/2_payment_manager.d.ts +4 -4
  580. package/script/client/2_payment_manager.d.ts.map +1 -1
  581. package/script/client/2_payment_manager.js +7 -20
  582. package/script/client/2_reaction_manager.d.ts +3 -3
  583. package/script/client/2_reaction_manager.d.ts.map +1 -1
  584. package/script/client/2_reaction_manager.js +7 -20
  585. package/script/client/2_translations_manager.d.ts +4 -4
  586. package/script/client/2_translations_manager.d.ts.map +1 -1
  587. package/script/client/2_translations_manager.js +98 -108
  588. package/script/client/2_update_manager.d.ts +2 -2
  589. package/script/client/2_update_manager.d.ts.map +1 -1
  590. package/script/client/2_update_manager.js +766 -761
  591. package/script/client/3_client_encrypted_pool.d.ts +1 -1
  592. package/script/client/3_client_encrypted_pool.d.ts.map +1 -1
  593. package/script/client/3_client_encrypted_pool.js +10 -26
  594. package/script/client/3_client_encrypted_pool_test.d.ts.map +1 -1
  595. package/script/client/3_message_manager.d.ts +11 -8
  596. package/script/client/3_message_manager.d.ts.map +1 -1
  597. package/script/client/3_message_manager.js +580 -466
  598. package/script/client/3_message_manager_test.d.ts.map +1 -1
  599. package/script/client/3_video_chat_manager.d.ts +6 -6
  600. package/script/client/3_video_chat_manager.d.ts.map +1 -1
  601. package/script/client/3_video_chat_manager.js +61 -72
  602. package/script/client/4_callback_query_manager.d.ts +5 -5
  603. package/script/client/4_callback_query_manager.d.ts.map +1 -1
  604. package/script/client/4_callback_query_manager.js +18 -30
  605. package/script/client/4_chat_list_manager.d.ts +6 -6
  606. package/script/client/4_chat_list_manager.d.ts.map +1 -1
  607. package/script/client/4_chat_list_manager.js +328 -324
  608. package/script/client/4_chat_manager.d.ts +7 -7
  609. package/script/client/4_chat_manager.d.ts.map +1 -1
  610. package/script/client/4_chat_manager.js +120 -133
  611. package/script/client/4_forum_manager.d.ts +4 -4
  612. package/script/client/4_forum_manager.d.ts.map +1 -1
  613. package/script/client/4_forum_manager.js +67 -73
  614. package/script/client/4_gift_manager.d.ts +4 -4
  615. package/script/client/4_gift_manager.d.ts.map +1 -1
  616. package/script/client/4_gift_manager.js +17 -30
  617. package/script/client/4_inline_query_manager.d.ts +5 -5
  618. package/script/client/4_inline_query_manager.d.ts.map +1 -1
  619. package/script/client/4_inline_query_manager.js +16 -28
  620. package/script/client/4_link_preview_manager.d.ts +5 -5
  621. package/script/client/4_link_preview_manager.d.ts.map +1 -1
  622. package/script/client/4_link_preview_manager.js +6 -19
  623. package/script/client/4_poll_manager.d.ts +4 -4
  624. package/script/client/4_poll_manager.d.ts.map +1 -1
  625. package/script/client/4_poll_manager.js +44 -57
  626. package/script/client/4_story_manager.d.ts +7 -7
  627. package/script/client/4_story_manager.d.ts.map +1 -1
  628. package/script/client/4_story_manager.js +43 -55
  629. package/script/client/5_client.d.ts +34 -15
  630. package/script/client/5_client.d.ts.map +1 -1
  631. package/script/client/5_client.js +1299 -1291
  632. package/script/connection/0_connection.d.ts +1 -1
  633. package/script/connection/0_connection.d.ts.map +1 -1
  634. package/script/connection/1_connection_tcp.node.d.ts +1 -1
  635. package/script/connection/1_connection_tcp.node.d.ts.map +1 -1
  636. package/script/connection/1_connection_tcp.node.js +49 -66
  637. package/script/connection/1_connection_web_socket.d.ts +1 -1
  638. package/script/connection/1_connection_web_socket.d.ts.map +1 -1
  639. package/script/connection/1_connection_web_socket.js +92 -98
  640. package/script/deps/jsr.io/@roj/tgcrypto/1.0.1/dist/tgcrypto.js +3 -11
  641. package/{esm/deps/jsr.io/@std/assert/1.0.13 → script/deps/jsr.io/@std/assert/1.0.14}/assert.d.ts.map +1 -1
  642. package/script/deps/jsr.io/@std/assert/1.0.14/assertion_error.d.ts +26 -0
  643. package/script/deps/jsr.io/@std/assert/1.0.14/assertion_error.d.ts.map +1 -0
  644. package/script/deps/jsr.io/@std/assert/1.0.14/assertion_error.js +34 -0
  645. package/script/deps/jsr.io/@std/assert/{1.0.13 → 1.0.14}/equal.d.ts.map +1 -1
  646. package/script/deps/jsr.io/@std/assert/{1.0.13 → 1.0.14}/equal.js +17 -7
  647. package/script/deps/jsr.io/@std/assert/{1.0.13 → 1.0.14}/equals.d.ts.map +1 -1
  648. package/script/deps/jsr.io/@std/assert/{1.0.13 → 1.0.14}/false.d.ts.map +1 -1
  649. package/script/deps/jsr.io/@std/assert/1.0.14/unreachable.d.ts +15 -0
  650. package/script/deps/jsr.io/@std/assert/1.0.14/unreachable.d.ts.map +1 -0
  651. package/script/deps/jsr.io/@std/assert/1.0.14/unreachable.js +23 -0
  652. package/script/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/_util.d.ts.map +1 -1
  653. package/script/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/abortable.d.ts.map +1 -1
  654. package/script/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/deadline.d.ts.map +1 -1
  655. package/script/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/debounce.d.ts.map +1 -1
  656. package/script/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/delay.d.ts.map +1 -1
  657. package/script/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/delay.js +34 -9
  658. package/script/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/mod.d.ts.map +1 -1
  659. package/script/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/mux_async_iterator.d.ts.map +1 -1
  660. package/script/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/mux_async_iterator.js +31 -47
  661. package/script/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/pool.d.ts.map +1 -1
  662. package/script/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/retry.d.ts.map +1 -1
  663. package/script/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/tee.d.ts.map +1 -1
  664. package/script/deps/jsr.io/@std/async/1.0.14/tee.js +82 -0
  665. package/script/deps/jsr.io/@std/datetime/0.225.5/_date_time_formatter.js +4 -17
  666. package/script/deps/jsr.io/@std/internal/1.0.10/_os.d.ts +2 -0
  667. package/script/deps/jsr.io/@std/internal/1.0.10/_os.d.ts.map +1 -0
  668. package/script/deps/jsr.io/@std/internal/1.0.10/_os.js +48 -0
  669. package/script/deps/jsr.io/@std/internal/1.0.10/format.js +17 -7
  670. package/script/deps/jsr.io/@std/internal/1.0.10/os.d.ts +3 -0
  671. package/script/deps/jsr.io/@std/internal/1.0.10/os.d.ts.map +1 -0
  672. package/script/deps/jsr.io/@std/internal/1.0.10/os.js +8 -0
  673. package/script/deps/jsr.io/@std/internal/1.0.10/styles.js +17 -7
  674. package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/assert_path.d.ts.map +1 -1
  675. package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/basename.d.ts.map +1 -1
  676. package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/constants.d.ts.map +1 -1
  677. package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/from_file_url.d.ts.map +1 -1
  678. package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/normalize.d.ts.map +1 -1
  679. package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/normalize_string.d.ts.map +1 -1
  680. package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/strip_trailing_separators.d.ts.map +1 -1
  681. package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/to_file_url.d.ts.map +1 -1
  682. package/{esm/deps/jsr.io/@std/path/1.1.0 → script/deps/jsr.io/@std/path/1.1.2}/basename.d.ts.map +1 -1
  683. package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/basename.js +2 -2
  684. package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/extname.d.ts.map +1 -1
  685. package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/extname.js +2 -2
  686. package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/is_absolute.d.ts.map +1 -1
  687. package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/is_absolute.js +2 -2
  688. package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/join.d.ts.map +1 -1
  689. package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/join.js +2 -2
  690. package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/_util.d.ts.map +1 -1
  691. package/{esm/deps/jsr.io/@std/path/1.1.0 → script/deps/jsr.io/@std/path/1.1.2}/posix/basename.d.ts.map +1 -1
  692. package/{esm/deps/jsr.io/@std/path/1.1.0 → script/deps/jsr.io/@std/path/1.1.2}/posix/extname.d.ts.map +1 -1
  693. package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/from_file_url.d.ts.map +1 -1
  694. package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/is_absolute.d.ts.map +1 -1
  695. package/{esm/deps/jsr.io/@std/path/1.1.0 → script/deps/jsr.io/@std/path/1.1.2}/posix/join.d.ts.map +1 -1
  696. package/{esm/deps/jsr.io/@std/path/1.1.0 → script/deps/jsr.io/@std/path/1.1.2}/posix/normalize.d.ts.map +1 -1
  697. package/{esm/deps/jsr.io/@std/path/1.1.0 → script/deps/jsr.io/@std/path/1.1.2}/posix/to_file_url.d.ts.map +1 -1
  698. package/{esm/deps/jsr.io/@std/path/1.1.0 → script/deps/jsr.io/@std/path/1.1.2}/to_file_url.d.ts.map +1 -1
  699. package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/to_file_url.js +2 -2
  700. package/{esm/deps/jsr.io/@std/path/1.1.0 → script/deps/jsr.io/@std/path/1.1.2}/windows/_util.d.ts.map +1 -1
  701. package/{esm/deps/jsr.io/@std/path/1.1.0 → script/deps/jsr.io/@std/path/1.1.2}/windows/basename.d.ts.map +1 -1
  702. package/{esm/deps/jsr.io/@std/path/1.1.0 → script/deps/jsr.io/@std/path/1.1.2}/windows/extname.d.ts.map +1 -1
  703. package/{esm/deps/jsr.io/@std/path/1.1.0 → script/deps/jsr.io/@std/path/1.1.2}/windows/from_file_url.d.ts.map +1 -1
  704. package/{esm/deps/jsr.io/@std/path/1.1.0 → script/deps/jsr.io/@std/path/1.1.2}/windows/is_absolute.d.ts.map +1 -1
  705. package/{esm/deps/jsr.io/@std/path/1.1.0 → script/deps/jsr.io/@std/path/1.1.2}/windows/join.d.ts.map +1 -1
  706. package/{esm/deps/jsr.io/@std/path/1.1.0 → script/deps/jsr.io/@std/path/1.1.2}/windows/normalize.d.ts.map +1 -1
  707. package/{esm/deps/jsr.io/@std/path/1.1.0 → script/deps/jsr.io/@std/path/1.1.2}/windows/to_file_url.d.ts.map +1 -1
  708. package/script/deps/jsr.io/@std/streams/{1.0.10 → 1.0.11}/to_array_buffer.d.ts.map +1 -1
  709. package/script/mod.js +19 -19
  710. package/script/session/0_session_state.js +12 -38
  711. package/script/session/1_session.d.ts +2 -2
  712. package/script/session/1_session.d.ts.map +1 -1
  713. package/script/session/1_session.js +66 -79
  714. package/script/session/2_session_encrypted.d.ts +2 -2
  715. package/script/session/2_session_encrypted.d.ts.map +1 -1
  716. package/script/session/2_session_encrypted.js +325 -321
  717. package/script/session/2_session_plain.js +1 -1
  718. package/script/storage/0_storage.d.ts +1 -1
  719. package/script/storage/0_storage.d.ts.map +1 -1
  720. package/script/storage/1_utilities.d.ts +14 -11
  721. package/script/storage/1_utilities.d.ts.map +1 -1
  722. package/script/storage/1_utilities.js +39 -39
  723. package/script/storage/1_utilities_test.d.ts.map +1 -1
  724. package/script/storage/2_storage_indexed_db.d.ts +1 -1
  725. package/script/storage/2_storage_indexed_db.d.ts.map +1 -1
  726. package/script/storage/2_storage_indexed_db.js +29 -47
  727. package/script/storage/2_storage_local_storage.node.d.ts +1 -1
  728. package/script/storage/2_storage_local_storage.node.d.ts.map +1 -1
  729. package/script/storage/2_storage_local_storage.node.js +15 -28
  730. package/script/storage/2_storage_memory.d.ts +2 -2
  731. package/script/storage/2_storage_memory.d.ts.map +1 -1
  732. package/script/storage/2_storage_memory.js +26 -43
  733. package/script/storage/2_storage_session_storage.d.ts +2 -2
  734. package/script/storage/2_storage_session_storage.d.ts.map +1 -1
  735. package/script/storage/2_storage_session_storage.js +6 -19
  736. package/script/tl/0_utilities.js +1 -1
  737. package/script/tl/0_utilities_test.d.ts.map +1 -1
  738. package/script/tl/1_tl_reader.d.ts +1 -1
  739. package/script/tl/1_tl_reader.d.ts.map +1 -1
  740. package/script/tl/1_tl_reader.js +83 -91
  741. package/script/tl/1_tl_reader_test.d.ts.map +1 -1
  742. package/script/tl/1_tl_writer.d.ts +1 -1
  743. package/script/tl/1_tl_writer.d.ts.map +1 -1
  744. package/script/tl/1_tl_writer.js +156 -165
  745. package/script/tl/1_tl_writer_test.d.ts.map +1 -1
  746. package/script/tl/1_utilities.d.ts +1 -1
  747. package/script/tl/1_utilities.d.ts.map +1 -1
  748. package/script/tl/1_utilities.js +2 -2
  749. package/script/tl/2_message.js +1 -1
  750. package/script/tl/2_mtproto.d.ts +1 -1
  751. package/script/tl/2_mtproto.d.ts.map +1 -1
  752. package/script/tl/2_telegram.d.ts +1 -1
  753. package/script/tl/2_telegram.d.ts.map +1 -1
  754. package/script/tl/2_telegram.js +17 -7
  755. package/script/transport/0_obfuscation.d.ts +1 -1
  756. package/script/transport/0_obfuscation.d.ts.map +1 -1
  757. package/script/transport/0_obfuscation.js +19 -9
  758. package/script/transport/0_transport.d.ts +1 -1
  759. package/script/transport/0_transport.d.ts.map +1 -1
  760. package/script/transport/0_transport.js +1 -8
  761. package/script/transport/1_transport_abridged.d.ts +1 -1
  762. package/script/transport/1_transport_abridged.d.ts.map +1 -1
  763. package/script/transport/1_transport_abridged.js +11 -24
  764. package/script/transport/1_transport_intermediate.d.ts +1 -1
  765. package/script/transport/1_transport_intermediate.d.ts.map +1 -1
  766. package/script/transport/1_transport_intermediate.js +10 -23
  767. package/script/transport/1_transport_provider.d.ts +2 -2
  768. package/script/transport/1_transport_provider.d.ts.map +1 -1
  769. package/script/transport/2_transport_provider_tcp.d.ts +1 -1
  770. package/script/transport/2_transport_provider_tcp.d.ts.map +1 -1
  771. package/script/transport/2_transport_provider_web_socket.d.ts +1 -1
  772. package/script/transport/2_transport_provider_web_socket.d.ts.map +1 -1
  773. package/script/transport/2_transport_provider_web_socket.js +1 -1
  774. package/script/types/0_birthday.d.ts +1 -1
  775. package/script/types/0_birthday.d.ts.map +1 -1
  776. package/script/types/0_callback_query_answer.d.ts +1 -1
  777. package/script/types/0_callback_query_answer.d.ts.map +1 -1
  778. package/script/types/0_callback_query_question.js +2 -2
  779. package/script/types/0_chat_administrator_rights.d.ts +1 -1
  780. package/script/types/0_chat_administrator_rights.d.ts.map +1 -1
  781. package/script/types/0_chat_member_rights.d.ts +1 -1
  782. package/script/types/0_chat_member_rights.d.ts.map +1 -1
  783. package/script/types/0_contact.d.ts +1 -1
  784. package/script/types/0_contact.d.ts.map +1 -1
  785. package/script/types/0_dice.d.ts +1 -1
  786. package/script/types/0_dice.d.ts.map +1 -1
  787. package/script/types/0_failed_invitation.d.ts +1 -1
  788. package/script/types/0_failed_invitation.d.ts.map +1 -1
  789. package/script/types/0_invoice.d.ts +1 -1
  790. package/script/types/0_invoice.d.ts.map +1 -1
  791. package/script/types/0_live_stream_channel.d.ts +1 -1
  792. package/script/types/0_live_stream_channel.d.ts.map +1 -1
  793. package/script/types/0_mask_position.d.ts +1 -1
  794. package/script/types/0_mask_position.d.ts.map +1 -1
  795. package/script/types/0_mask_position.js +1 -1
  796. package/script/types/0_message_entity.d.ts +1 -1
  797. package/script/types/0_message_entity.d.ts.map +1 -1
  798. package/script/types/0_message_entity.js +1 -1
  799. package/script/types/0_message_search_filter.d.ts +1 -1
  800. package/script/types/0_message_search_filter.d.ts.map +1 -1
  801. package/script/types/0_opening_hours.d.ts +1 -1
  802. package/script/types/0_opening_hours.d.ts.map +1 -1
  803. package/script/types/0_reaction.js +5 -5
  804. package/script/types/0_refunded_payment.d.ts +1 -1
  805. package/script/types/0_refunded_payment.d.ts.map +1 -1
  806. package/script/types/0_restriction_reason.d.ts +1 -1
  807. package/script/types/0_restriction_reason.d.ts.map +1 -1
  808. package/script/types/0_self_destruct_option.js +3 -3
  809. package/script/types/0_shipping_address.d.ts +1 -1
  810. package/script/types/0_shipping_address.d.ts.map +1 -1
  811. package/script/types/0_slow_mode_duration.js +2 -2
  812. package/script/types/0_upload_progress.d.ts +29 -0
  813. package/script/types/0_upload_progress.d.ts.map +1 -0
  814. package/script/types/0_upload_progress.js +21 -0
  815. package/script/types/0_voice.d.ts +1 -1
  816. package/script/types/0_voice.d.ts.map +1 -1
  817. package/script/types/0_voice_transcription.d.ts +1 -1
  818. package/script/types/0_voice_transcription.d.ts.map +1 -1
  819. package/script/types/1_animation.d.ts +1 -1
  820. package/script/types/1_animation.d.ts.map +1 -1
  821. package/script/types/1_audio.d.ts +1 -1
  822. package/script/types/1_audio.d.ts.map +1 -1
  823. package/script/types/1_bot_command_scope.d.ts +2 -2
  824. package/script/types/1_bot_command_scope.d.ts.map +1 -1
  825. package/script/types/1_chat_p.d.ts +2 -2
  826. package/script/types/1_chat_p.d.ts.map +1 -1
  827. package/script/types/1_chat_p.js +2 -2
  828. package/script/types/1_document.d.ts +1 -1
  829. package/script/types/1_document.d.ts.map +1 -1
  830. package/script/types/1_giveaway.d.ts +2 -2
  831. package/script/types/1_giveaway.d.ts.map +1 -1
  832. package/script/types/1_inline_keyboard_button.d.ts +3 -3
  833. package/script/types/1_inline_keyboard_button.d.ts.map +1 -1
  834. package/script/types/1_inline_keyboard_button.js +4 -4
  835. package/script/types/1_inline_query_result_button.d.ts +1 -1
  836. package/script/types/1_inline_query_result_button.d.ts.map +1 -1
  837. package/script/types/1_input_media.d.ts +4 -4
  838. package/script/types/1_input_media.d.ts.map +1 -1
  839. package/script/types/1_input_story_content.d.ts +1 -1
  840. package/script/types/1_input_story_content.d.ts.map +1 -1
  841. package/script/types/1_keyboard_button.d.ts +3 -3
  842. package/script/types/1_keyboard_button.d.ts.map +1 -1
  843. package/script/types/1_keyboard_button.js +1 -1
  844. package/script/types/1_message_reaction.d.ts +1 -1
  845. package/script/types/1_message_reaction.d.ts.map +1 -1
  846. package/script/types/1_message_reaction.js +2 -2
  847. package/script/types/1_mini_app_info.d.ts +2 -2
  848. package/script/types/1_mini_app_info.d.ts.map +1 -1
  849. package/script/types/1_network_statistics.d.ts +1 -1
  850. package/script/types/1_network_statistics.d.ts.map +1 -1
  851. package/script/types/1_order_info.d.ts +2 -2
  852. package/script/types/1_order_info.d.ts.map +1 -1
  853. package/script/types/1_photo.d.ts +1 -1
  854. package/script/types/1_photo.d.ts.map +1 -1
  855. package/script/types/1_poll_option.d.ts +2 -2
  856. package/script/types/1_poll_option.d.ts.map +1 -1
  857. package/script/types/1_poll_option.js +2 -2
  858. package/script/types/1_reaction_count.d.ts +2 -2
  859. package/script/types/1_reaction_count.d.ts.map +1 -1
  860. package/script/types/1_reply_quote.d.ts +2 -2
  861. package/script/types/1_reply_quote.d.ts.map +1 -1
  862. package/script/types/1_sticker.d.ts +4 -4
  863. package/script/types/1_sticker.d.ts.map +1 -1
  864. package/script/types/1_sticker.js +2 -2
  865. package/script/types/1_story_privacy.d.ts +1 -1
  866. package/script/types/1_story_privacy.d.ts.map +1 -1
  867. package/script/types/1_story_reaction.d.ts +2 -2
  868. package/script/types/1_story_reaction.d.ts.map +1 -1
  869. package/script/types/1_user.d.ts +2 -2
  870. package/script/types/1_user.d.ts.map +1 -1
  871. package/script/types/1_user.js +1 -1
  872. package/script/types/1_venue.d.ts +1 -1
  873. package/script/types/1_venue.d.ts.map +1 -1
  874. package/script/types/1_video.d.ts +1 -1
  875. package/script/types/1_video.d.ts.map +1 -1
  876. package/script/types/1_video_note.d.ts +1 -1
  877. package/script/types/1_video_note.d.ts.map +1 -1
  878. package/script/types/2_business_connection.d.ts +3 -3
  879. package/script/types/2_business_connection.d.ts.map +1 -1
  880. package/script/types/2_chat.d.ts +6 -6
  881. package/script/types/2_chat.d.ts.map +1 -1
  882. package/script/types/2_chat.js +3 -3
  883. package/script/types/2_chat_member.d.ts +4 -4
  884. package/script/types/2_chat_member.d.ts.map +1 -1
  885. package/script/types/2_chat_member.js +1 -1
  886. package/script/types/2_chat_settings.d.ts +1 -1
  887. package/script/types/2_chat_settings.d.ts.map +1 -1
  888. package/script/types/2_chat_settings.js +1 -1
  889. package/script/types/2_chosen_inline_result.d.ts +3 -3
  890. package/script/types/2_chosen_inline_result.d.ts.map +1 -1
  891. package/script/types/2_forward_header.d.ts +4 -4
  892. package/script/types/2_forward_header.d.ts.map +1 -1
  893. package/script/types/2_forward_header.js +6 -6
  894. package/script/types/2_game.d.ts +3 -3
  895. package/script/types/2_game.d.ts.map +1 -1
  896. package/script/types/2_gift_upgraded_component.d.ts +2 -2
  897. package/script/types/2_gift_upgraded_component.d.ts.map +1 -1
  898. package/script/types/2_inactive_chat.d.ts +1 -1
  899. package/script/types/2_inactive_chat.d.ts.map +1 -1
  900. package/script/types/2_inline_query.d.ts +3 -3
  901. package/script/types/2_inline_query.d.ts.map +1 -1
  902. package/script/types/2_inline_query.js +1 -1
  903. package/script/types/2_invite_link.d.ts +3 -3
  904. package/script/types/2_invite_link.d.ts.map +1 -1
  905. package/script/types/2_message_interactions.d.ts +1 -1
  906. package/script/types/2_message_interactions.d.ts.map +1 -1
  907. package/script/types/2_message_reaction_count.d.ts +4 -4
  908. package/script/types/2_message_reaction_count.d.ts.map +1 -1
  909. package/script/types/2_message_reactions.d.ts +4 -4
  910. package/script/types/2_message_reactions.d.ts.map +1 -1
  911. package/script/types/2_poll.d.ts +3 -3
  912. package/script/types/2_poll.d.ts.map +1 -1
  913. package/script/types/2_poll.js +3 -3
  914. package/script/types/2_poll_answer.d.ts +22 -3
  915. package/script/types/2_poll_answer.d.ts.map +1 -1
  916. package/script/types/2_poll_answer.js +19 -0
  917. package/script/types/2_pre_checkout_query.d.ts +4 -4
  918. package/script/types/2_pre_checkout_query.d.ts.map +1 -1
  919. package/script/types/2_reply_markup.d.ts +3 -3
  920. package/script/types/2_reply_markup.d.ts.map +1 -1
  921. package/script/types/2_reply_to.d.ts +2 -2
  922. package/script/types/2_reply_to.d.ts.map +1 -1
  923. package/script/types/2_sticker_set.d.ts +51 -0
  924. package/script/types/2_sticker_set.d.ts.map +1 -0
  925. package/script/types/2_sticker_set.js +94 -0
  926. package/script/types/2_story_content.d.ts +2 -2
  927. package/script/types/2_story_content.d.ts.map +1 -1
  928. package/script/types/2_story_interactions.d.ts +2 -2
  929. package/script/types/2_story_interactions.d.ts.map +1 -1
  930. package/script/types/2_story_interactive_area.d.ts +5 -5
  931. package/script/types/2_story_interactive_area.d.ts.map +1 -1
  932. package/script/types/2_successful_payment.d.ts +2 -2
  933. package/script/types/2_successful_payment.d.ts.map +1 -1
  934. package/script/types/3_chat_member_updated.d.ts +5 -5
  935. package/script/types/3_chat_member_updated.d.ts.map +1 -1
  936. package/script/types/3_gift.d.ts +4 -4
  937. package/script/types/3_gift.d.ts.map +1 -1
  938. package/script/types/3_join_request.d.ts +4 -4
  939. package/script/types/3_join_request.d.ts.map +1 -1
  940. package/script/types/3_story.d.ts +8 -8
  941. package/script/types/3_story.d.ts.map +1 -1
  942. package/script/types/4_claimed_gift.d.ts +4 -4
  943. package/script/types/4_claimed_gift.d.ts.map +1 -1
  944. package/script/types/4_link_preview.d.ts +5 -5
  945. package/script/types/4_link_preview.d.ts.map +1 -1
  946. package/script/types/5_claimed_gifts.d.ts +2 -2
  947. package/script/types/5_claimed_gifts.d.ts.map +1 -1
  948. package/script/types/5_claimed_gifts.js +3 -3
  949. package/script/types/5_message.d.ts +29 -29
  950. package/script/types/5_message.d.ts.map +1 -1
  951. package/script/types/5_message.js +8 -8
  952. package/script/types/5_message_content.d.ts +4 -4
  953. package/script/types/5_message_content.d.ts.map +1 -1
  954. package/script/types/6_callback_query.d.ts +3 -3
  955. package/script/types/6_callback_query.d.ts.map +1 -1
  956. package/script/types/6_callback_query.js +2 -2
  957. package/script/types/6_chat_list_item.d.ts +4 -4
  958. package/script/types/6_chat_list_item.d.ts.map +1 -1
  959. package/script/types/6_chat_list_item.js +6 -6
  960. package/script/types/6_inline_query_result.d.ts +6 -6
  961. package/script/types/6_inline_query_result.d.ts.map +1 -1
  962. package/script/types/6_inline_query_result.js +16 -16
  963. package/script/types/6_saved_chat.d.ts +36 -0
  964. package/script/types/6_saved_chat.d.ts.map +1 -0
  965. package/script/types/6_saved_chat.js +46 -0
  966. package/script/types/6_topic.d.ts +2 -2
  967. package/script/types/6_topic.d.ts.map +1 -1
  968. package/script/types/6_topic.js +1 -1
  969. package/script/types/7_inline_query_answer.d.ts +2 -2
  970. package/script/types/7_inline_query_answer.d.ts.map +1 -1
  971. package/script/types/7_saved_chats.d.ts +33 -0
  972. package/script/types/7_saved_chats.d.ts.map +1 -0
  973. package/script/types/7_saved_chats.js +39 -0
  974. package/script/types/7_update.d.ts +44 -25
  975. package/script/types/7_update.d.ts.map +1 -1
  976. package/script/types/_file_id.d.ts +60 -49
  977. package/script/types/_file_id.d.ts.map +1 -1
  978. package/script/types/_file_id.js +155 -136
  979. package/script/types/_getters.d.ts +3 -3
  980. package/script/types/_getters.d.ts.map +1 -1
  981. package/script/utilities/0_bigint.js +22 -12
  982. package/script/utilities/0_bigint_test.d.ts.map +1 -1
  983. package/script/utilities/0_buffer.d.ts +1 -1
  984. package/script/utilities/0_buffer.d.ts.map +1 -1
  985. package/script/utilities/0_buffer.js +3 -3
  986. package/script/utilities/0_buffer_test.d.ts.map +1 -1
  987. package/script/utilities/0_env.js +18 -8
  988. package/script/utilities/0_hash.d.ts +2 -2
  989. package/script/utilities/0_hash.d.ts.map +1 -1
  990. package/script/utilities/0_hash.js +17 -7
  991. package/script/utilities/0_misc.d.ts.map +1 -1
  992. package/script/utilities/0_misc.js +21 -10
  993. package/script/utilities/0_mutex.js +4 -19
  994. package/script/utilities/0_part_stream.js +11 -25
  995. package/script/utilities/0_part_stream_test.d.ts.map +1 -1
  996. package/script/utilities/0_rle.d.ts +2 -2
  997. package/script/utilities/0_rle.d.ts.map +1 -1
  998. package/script/utilities/0_rle.js +1 -1
  999. package/script/utilities/0_rle_test.d.ts.map +1 -1
  1000. package/script/utilities/0_text.d.ts +20 -1
  1001. package/script/utilities/0_text.d.ts.map +1 -1
  1002. package/script/utilities/0_text.js +19 -0
  1003. package/script/utilities/1_auth.d.ts +1 -1
  1004. package/script/utilities/1_auth.d.ts.map +1 -1
  1005. package/script/utilities/1_auth.js +18 -8
  1006. package/script/utilities/1_base64.d.ts +1 -1
  1007. package/script/utilities/1_base64.d.ts.map +1 -1
  1008. package/script/utilities/1_base64.js +1 -1
  1009. package/script/utilities/1_base64_test.d.ts.map +1 -1
  1010. package/script/utilities/1_crypto.js +60 -61
  1011. package/script/utilities/1_crypto_test.d.ts.map +1 -1
  1012. package/script/utilities/1_logger.d.ts +2 -2
  1013. package/script/utilities/1_logger.js +2 -2
  1014. package/script/utilities/1_math.js +2 -2
  1015. package/script/utilities/1_math_test.d.ts.map +1 -1
  1016. package/script/utilities/2_queue.js +30 -48
  1017. package/esm/deps/jsr.io/@std/async/1.0.13/tee.js +0 -102
  1018. package/esm/deps/jsr.io/@std/path/1.1.0/_os.d.ts +0 -2
  1019. package/esm/deps/jsr.io/@std/path/1.1.0/_os.d.ts.map +0 -1
  1020. package/esm/deps/jsr.io/@std/path/1.1.0/_os.js +0 -9
  1021. package/script/deps/jsr.io/@std/async/1.0.13/tee.js +0 -105
  1022. package/script/deps/jsr.io/@std/path/1.1.0/_os.d.ts +0 -2
  1023. package/script/deps/jsr.io/@std/path/1.1.0/_os.d.ts.map +0 -1
  1024. package/script/deps/jsr.io/@std/path/1.1.0/_os.js +0 -35
  1025. /package/esm/deps/jsr.io/@std/assert/{1.0.13 → 1.0.14}/assert.d.ts +0 -0
  1026. /package/esm/deps/jsr.io/@std/assert/{1.0.13 → 1.0.14}/assert.js +0 -0
  1027. /package/esm/deps/jsr.io/@std/assert/{1.0.13 → 1.0.14}/equal.d.ts +0 -0
  1028. /package/esm/deps/jsr.io/@std/assert/{1.0.13 → 1.0.14}/equal.js +0 -0
  1029. /package/esm/deps/jsr.io/@std/assert/{1.0.13 → 1.0.14}/equals.d.ts +0 -0
  1030. /package/esm/deps/jsr.io/@std/assert/{1.0.13 → 1.0.14}/equals.js +0 -0
  1031. /package/esm/deps/jsr.io/@std/assert/{1.0.13 → 1.0.14}/false.d.ts +0 -0
  1032. /package/esm/deps/jsr.io/@std/assert/{1.0.13 → 1.0.14}/false.js +0 -0
  1033. /package/esm/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/_util.d.ts +0 -0
  1034. /package/esm/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/_util.js +0 -0
  1035. /package/esm/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/abortable.d.ts +0 -0
  1036. /package/esm/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/abortable.js +0 -0
  1037. /package/esm/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/deadline.d.ts +0 -0
  1038. /package/esm/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/deadline.js +0 -0
  1039. /package/esm/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/debounce.d.ts +0 -0
  1040. /package/esm/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/debounce.js +0 -0
  1041. /package/esm/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/delay.d.ts +0 -0
  1042. /package/esm/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/mod.d.ts +0 -0
  1043. /package/esm/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/mod.js +0 -0
  1044. /package/esm/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/mux_async_iterator.d.ts +0 -0
  1045. /package/esm/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/pool.d.ts +0 -0
  1046. /package/esm/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/pool.js +0 -0
  1047. /package/esm/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/retry.d.ts +0 -0
  1048. /package/esm/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/retry.js +0 -0
  1049. /package/esm/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/tee.d.ts +0 -0
  1050. /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/assert_path.d.ts +0 -0
  1051. /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/assert_path.js +0 -0
  1052. /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/basename.d.ts +0 -0
  1053. /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/basename.js +0 -0
  1054. /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/constants.d.ts +0 -0
  1055. /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/constants.js +0 -0
  1056. /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/from_file_url.d.ts +0 -0
  1057. /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/from_file_url.js +0 -0
  1058. /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/normalize.d.ts +0 -0
  1059. /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/normalize.js +0 -0
  1060. /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/normalize_string.d.ts +0 -0
  1061. /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/normalize_string.js +0 -0
  1062. /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/strip_trailing_separators.d.ts +0 -0
  1063. /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/strip_trailing_separators.js +0 -0
  1064. /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/to_file_url.d.ts +0 -0
  1065. /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/to_file_url.js +0 -0
  1066. /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/basename.d.ts +0 -0
  1067. /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/extname.d.ts +0 -0
  1068. /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/is_absolute.d.ts +0 -0
  1069. /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/join.d.ts +0 -0
  1070. /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/_util.d.ts +0 -0
  1071. /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/_util.js +0 -0
  1072. /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/basename.d.ts +0 -0
  1073. /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/basename.js +0 -0
  1074. /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/extname.d.ts +0 -0
  1075. /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/extname.js +0 -0
  1076. /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/from_file_url.d.ts +0 -0
  1077. /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/from_file_url.js +0 -0
  1078. /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/is_absolute.d.ts +0 -0
  1079. /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/is_absolute.js +0 -0
  1080. /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/join.d.ts +0 -0
  1081. /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/join.js +0 -0
  1082. /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/normalize.d.ts +0 -0
  1083. /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/normalize.js +0 -0
  1084. /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/to_file_url.d.ts +0 -0
  1085. /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/to_file_url.js +0 -0
  1086. /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/to_file_url.d.ts +0 -0
  1087. /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/windows/_util.d.ts +0 -0
  1088. /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/windows/_util.js +0 -0
  1089. /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/windows/basename.d.ts +0 -0
  1090. /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/windows/basename.js +0 -0
  1091. /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/windows/extname.d.ts +0 -0
  1092. /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/windows/extname.js +0 -0
  1093. /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/windows/from_file_url.d.ts +0 -0
  1094. /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/windows/from_file_url.js +0 -0
  1095. /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/windows/is_absolute.d.ts +0 -0
  1096. /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/windows/is_absolute.js +0 -0
  1097. /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/windows/join.d.ts +0 -0
  1098. /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/windows/join.js +0 -0
  1099. /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/windows/normalize.d.ts +0 -0
  1100. /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/windows/normalize.js +0 -0
  1101. /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/windows/to_file_url.d.ts +0 -0
  1102. /package/esm/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/windows/to_file_url.js +0 -0
  1103. /package/esm/deps/jsr.io/@std/streams/{1.0.10 → 1.0.11}/to_array_buffer.d.ts +0 -0
  1104. /package/esm/deps/jsr.io/@std/streams/{1.0.10 → 1.0.11}/to_array_buffer.js +0 -0
  1105. /package/script/deps/jsr.io/@std/assert/{1.0.13 → 1.0.14}/assert.d.ts +0 -0
  1106. /package/script/deps/jsr.io/@std/assert/{1.0.13 → 1.0.14}/assert.js +0 -0
  1107. /package/script/deps/jsr.io/@std/assert/{1.0.13 → 1.0.14}/equal.d.ts +0 -0
  1108. /package/script/deps/jsr.io/@std/assert/{1.0.13 → 1.0.14}/equals.d.ts +0 -0
  1109. /package/script/deps/jsr.io/@std/assert/{1.0.13 → 1.0.14}/equals.js +0 -0
  1110. /package/script/deps/jsr.io/@std/assert/{1.0.13 → 1.0.14}/false.d.ts +0 -0
  1111. /package/script/deps/jsr.io/@std/assert/{1.0.13 → 1.0.14}/false.js +0 -0
  1112. /package/script/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/_util.d.ts +0 -0
  1113. /package/script/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/_util.js +0 -0
  1114. /package/script/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/abortable.d.ts +0 -0
  1115. /package/script/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/abortable.js +0 -0
  1116. /package/script/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/deadline.d.ts +0 -0
  1117. /package/script/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/deadline.js +0 -0
  1118. /package/script/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/debounce.d.ts +0 -0
  1119. /package/script/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/debounce.js +0 -0
  1120. /package/script/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/delay.d.ts +0 -0
  1121. /package/script/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/mod.d.ts +0 -0
  1122. /package/script/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/mod.js +0 -0
  1123. /package/script/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/mux_async_iterator.d.ts +0 -0
  1124. /package/script/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/pool.d.ts +0 -0
  1125. /package/script/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/pool.js +0 -0
  1126. /package/script/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/retry.d.ts +0 -0
  1127. /package/script/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/retry.js +0 -0
  1128. /package/script/deps/jsr.io/@std/async/{1.0.13 → 1.0.14}/tee.d.ts +0 -0
  1129. /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/assert_path.d.ts +0 -0
  1130. /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/assert_path.js +0 -0
  1131. /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/basename.d.ts +0 -0
  1132. /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/basename.js +0 -0
  1133. /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/constants.d.ts +0 -0
  1134. /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/constants.js +0 -0
  1135. /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/from_file_url.d.ts +0 -0
  1136. /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/from_file_url.js +0 -0
  1137. /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/normalize.d.ts +0 -0
  1138. /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/normalize.js +0 -0
  1139. /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/normalize_string.d.ts +0 -0
  1140. /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/normalize_string.js +0 -0
  1141. /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/strip_trailing_separators.d.ts +0 -0
  1142. /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/strip_trailing_separators.js +0 -0
  1143. /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/to_file_url.d.ts +0 -0
  1144. /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/_common/to_file_url.js +0 -0
  1145. /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/basename.d.ts +0 -0
  1146. /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/extname.d.ts +0 -0
  1147. /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/is_absolute.d.ts +0 -0
  1148. /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/join.d.ts +0 -0
  1149. /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/_util.d.ts +0 -0
  1150. /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/_util.js +0 -0
  1151. /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/basename.d.ts +0 -0
  1152. /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/basename.js +0 -0
  1153. /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/extname.d.ts +0 -0
  1154. /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/extname.js +0 -0
  1155. /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/from_file_url.d.ts +0 -0
  1156. /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/from_file_url.js +0 -0
  1157. /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/is_absolute.d.ts +0 -0
  1158. /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/is_absolute.js +0 -0
  1159. /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/join.d.ts +0 -0
  1160. /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/join.js +0 -0
  1161. /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/normalize.d.ts +0 -0
  1162. /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/normalize.js +0 -0
  1163. /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/to_file_url.d.ts +0 -0
  1164. /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/posix/to_file_url.js +0 -0
  1165. /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/to_file_url.d.ts +0 -0
  1166. /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/windows/_util.d.ts +0 -0
  1167. /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/windows/_util.js +0 -0
  1168. /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/windows/basename.d.ts +0 -0
  1169. /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/windows/basename.js +0 -0
  1170. /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/windows/extname.d.ts +0 -0
  1171. /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/windows/extname.js +0 -0
  1172. /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/windows/from_file_url.d.ts +0 -0
  1173. /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/windows/from_file_url.js +0 -0
  1174. /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/windows/is_absolute.d.ts +0 -0
  1175. /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/windows/is_absolute.js +0 -0
  1176. /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/windows/join.d.ts +0 -0
  1177. /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/windows/join.js +0 -0
  1178. /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/windows/normalize.d.ts +0 -0
  1179. /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/windows/normalize.js +0 -0
  1180. /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/windows/to_file_url.d.ts +0 -0
  1181. /package/script/deps/jsr.io/@std/path/{1.1.0 → 1.1.2}/windows/to_file_url.js +0 -0
  1182. /package/script/deps/jsr.io/@std/streams/{1.0.10 → 1.0.11}/to_array_buffer.d.ts +0 -0
  1183. /package/script/deps/jsr.io/@std/streams/{1.0.10 → 1.0.11}/to_array_buffer.js +0 -0
@@ -18,18 +18,6 @@
18
18
  * You should have received a copy of the GNU Lesser General Public License
19
19
  * along with this program. If not, see <https://www.gnu.org/licenses/>.
20
20
  */
21
- var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
22
- if (kind === "m") throw new TypeError("Private method is not writable");
23
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
24
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
25
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
26
- };
27
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
28
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
29
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
30
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
31
- };
32
- var _ChatListManager_instances, _ChatListManager_c, _ChatListManager_sendChatUpdate, _ChatListManager_chats, _ChatListManager_archivedChats, _ChatListManager_getChatAnywhere, _ChatListManager_getChatList, _ChatListManager_pinnedChats, _ChatListManager_pinnedArchiveChats, _ChatListManager_storageHadPinnedChats, _ChatListManager_pinnedChatsLoaded, _ChatListManager_loadPinnedChats, _ChatListManager_fetchPinnedChats, _ChatListManager_getPinnedChats, _ChatListManager_updateOrAddChat, _ChatListManager_removeChat, _ChatListManager_handleUpdateFolderPeers, _ChatListManager_handleUpdatePinnedDialogs, _ChatListManager_handleUpdateChannel, _ChatListManager_handleUpdateChat, _ChatListManager_handleUpdateUser, _ChatListManager_getFullChat, _ChatListManager_checkChatTitle, _ChatListManager_createChannel, _ChatListManager_moveChatsToFolder, _ChatListManager_toggleBusinessBotsPaused;
33
21
  Object.defineProperty(exports, "__esModule", { value: true });
34
22
  exports.ChatListManager = void 0;
35
23
  const _0_deps_js_1 = require("../0_deps.js");
@@ -49,67 +37,71 @@ const chatListManagerUpdates = [
49
37
  "updateUserName",
50
38
  ];
51
39
  class ChatListManager {
40
+ #c;
52
41
  constructor(c) {
53
- _ChatListManager_instances.add(this);
54
- _ChatListManager_c.set(this, void 0);
55
- _ChatListManager_chats.set(this, new Map());
56
- _ChatListManager_archivedChats.set(this, new Map());
57
- _ChatListManager_pinnedChats.set(this, new Array());
58
- _ChatListManager_pinnedArchiveChats.set(this, new Array());
59
- _ChatListManager_storageHadPinnedChats.set(this, false);
60
- _ChatListManager_pinnedChatsLoaded.set(this, false);
61
- __classPrivateFieldSet(this, _ChatListManager_c, c, "f");
42
+ this.#c = c;
43
+ }
44
+ #sendChatUpdate(chatId, added) {
45
+ try {
46
+ this.#c.storage.assertUser("");
47
+ }
48
+ catch {
49
+ return;
50
+ }
51
+ const [chat] = this.#getChatAnywhere(chatId);
52
+ const update = chat === undefined ? { deletedChat: { chatId } } : added ? { newChat: chat } : { editedChat: chat };
53
+ this.#c.handleUpdate(update);
62
54
  }
63
55
  async reassignChatLastMessage(chatId, add = false, sendUpdate = true) {
64
56
  try {
65
- __classPrivateFieldGet(this, _ChatListManager_c, "f").storage.assertUser("");
57
+ this.#c.storage.assertUser("");
66
58
  }
67
59
  catch {
68
60
  return () => Promise.resolve();
69
61
  }
70
- const [chat, listId] = __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_getChatAnywhere).call(this, chatId);
62
+ const [chat, listId] = this.#getChatAnywhere(chatId);
71
63
  if (!chat && !add) {
72
64
  return () => Promise.resolve();
73
65
  }
74
- const message_ = await __classPrivateFieldGet(this, _ChatListManager_c, "f").messageStorage.getLastMessage(chatId);
75
- if (message_ != null) {
76
- const message = await __classPrivateFieldGet(this, _ChatListManager_c, "f").messageManager.constructMessage(message_);
66
+ const message_ = await this.#c.messageStorage.getLastMessage(chatId);
67
+ if (message_ !== null) {
68
+ const message = await this.#c.messageManager.constructMessage(message_);
77
69
  if (chat) {
78
70
  chat.order = (0, _3_types_js_1.getChatListItemOrder)(message, chat.pinned);
79
71
  chat.lastMessage = message;
80
- await __classPrivateFieldGet(this, _ChatListManager_c, "f").storage.setChat(listId, chatId, chat.pinned, message.id, (0, _1_utilities_js_1.fromUnixTimestamp)(message.date));
72
+ await this.#c.storage.setChat(listId, chatId, chat.pinned, message.id, (0, _1_utilities_js_1.fromUnixTimestamp)(message.date));
81
73
  }
82
74
  else {
83
- const pinnedChats = await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_getPinnedChats).call(this, listId);
84
- const chat = await (0, _3_types_js_1.constructChatListItem3)(chatId, pinnedChats.indexOf(chatId), message, __classPrivateFieldGet(this, _ChatListManager_c, "f").getEntity);
85
- if (chat == null) {
75
+ const pinnedChats = await this.#getPinnedChats(listId);
76
+ const chat = await (0, _3_types_js_1.constructChatListItem3)(chatId, pinnedChats.indexOf(chatId), message, this.#c.getEntity);
77
+ if (chat === null) {
86
78
  (0, _0_deps_js_1.unreachable)();
87
79
  }
88
- __classPrivateFieldGet(this, _ChatListManager_chats, "f").set(chatId, chat);
89
- await __classPrivateFieldGet(this, _ChatListManager_c, "f").storage.setChat(listId, chatId, chat.pinned, chat.lastMessage?.id ?? 0, (0, _1_utilities_js_1.fromUnixTimestamp)(chat.lastMessage?.date ?? 0));
80
+ this.#chats.set(chatId, chat);
81
+ await this.#c.storage.setChat(listId, chatId, chat.pinned, chat.lastMessage?.id ?? 0, (0, _1_utilities_js_1.fromUnixTimestamp)(chat.lastMessage?.date ?? 0));
90
82
  }
91
83
  if (sendUpdate) {
92
- return () => __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_sendChatUpdate).call(this, chatId, !chat);
84
+ return () => this.#sendChatUpdate(chatId, !chat);
93
85
  }
94
86
  return () => Promise.resolve();
95
87
  }
96
- const message = (await __classPrivateFieldGet(this, _ChatListManager_c, "f").messageManager.getHistory(chatId, { limit: 1 }))[0];
88
+ const message = (await this.#c.messageManager.getHistory(chatId, { limit: 1 }))[0];
97
89
  if (message) {
98
90
  if (chat) {
99
91
  chat.order = (0, _3_types_js_1.getChatListItemOrder)(message, chat.pinned);
100
92
  chat.lastMessage = message;
101
- await __classPrivateFieldGet(this, _ChatListManager_c, "f").storage.setChat(listId, chatId, chat.pinned, message.id, (0, _1_utilities_js_1.fromUnixTimestamp)(message.date));
93
+ await this.#c.storage.setChat(listId, chatId, chat.pinned, message.id, (0, _1_utilities_js_1.fromUnixTimestamp)(message.date));
102
94
  }
103
95
  else {
104
- const pinnedChats = await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_getPinnedChats).call(this, listId);
105
- const chat = await (0, _3_types_js_1.constructChatListItem3)(chatId, pinnedChats.indexOf(chatId), message, __classPrivateFieldGet(this, _ChatListManager_c, "f").getEntity);
106
- if (chat == null) {
96
+ const pinnedChats = await this.#getPinnedChats(listId);
97
+ const chat = await (0, _3_types_js_1.constructChatListItem3)(chatId, pinnedChats.indexOf(chatId), message, this.#c.getEntity);
98
+ if (chat === null) {
107
99
  (0, _0_deps_js_1.unreachable)();
108
100
  }
109
- __classPrivateFieldGet(this, _ChatListManager_chats, "f").set(chatId, chat);
101
+ this.#chats.set(chatId, chat);
110
102
  }
111
103
  if (sendUpdate) {
112
- return () => __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_sendChatUpdate).call(this, chatId, !chat);
104
+ return () => this.#sendChatUpdate(chatId, !chat);
113
105
  }
114
106
  return () => Promise.resolve();
115
107
  }
@@ -117,33 +109,205 @@ class ChatListManager {
117
109
  chat.order = (0, _3_types_js_1.getChatListItemOrder)(undefined, chat.pinned);
118
110
  chat.lastMessage = undefined;
119
111
  if (sendUpdate) {
120
- return () => __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_sendChatUpdate).call(this, chatId, false);
112
+ return () => this.#sendChatUpdate(chatId, false);
121
113
  }
122
114
  }
123
115
  return () => Promise.resolve();
124
116
  }
117
+ #chats = new Map();
118
+ #archivedChats = new Map();
119
+ #getChatAnywhere(chatId) {
120
+ let chat = this.#chats.get(chatId);
121
+ if (chat) {
122
+ return [chat, 0];
123
+ }
124
+ chat = this.#archivedChats.get(chatId);
125
+ if (chat) {
126
+ return [chat, 1];
127
+ }
128
+ return [undefined, -1];
129
+ }
130
+ #getChatList(listId) {
131
+ switch (listId) {
132
+ case 0:
133
+ return this.#chats;
134
+ case 1:
135
+ return this.#archivedChats;
136
+ default:
137
+ throw new Error(`Invalid chat list: ${listId}`);
138
+ }
139
+ }
140
+ #pinnedChats = new Array();
141
+ #pinnedArchiveChats = new Array();
142
+ #storageHadPinnedChats = false;
143
+ #pinnedChatsLoaded = false;
144
+ async #loadPinnedChats() {
145
+ const [pinnedChats, pinnedArchiveChats] = await Promise.all([this.#c.storage.getPinnedChats(0), this.#c.storage.getPinnedChats(1)]);
146
+ if (pinnedChats !== null && pinnedArchiveChats !== null) {
147
+ this.#pinnedChats = pinnedChats;
148
+ this.#pinnedArchiveChats = pinnedArchiveChats;
149
+ this.#storageHadPinnedChats = true;
150
+ }
151
+ this.#pinnedChatsLoaded = true;
152
+ }
153
+ async #fetchPinnedChats(listId = null) {
154
+ if (listId === null || listId === 0) {
155
+ const dialogs = await this.#c.invoke({ _: "messages.getPinnedDialogs", folder_id: 0 });
156
+ const pinnedChats = new Array();
157
+ for (const dialog of dialogs.dialogs) {
158
+ pinnedChats.push(_2_tl_js_1.Api.peerToChatId(dialog.peer));
159
+ }
160
+ this.#pinnedChats = pinnedChats;
161
+ await this.#c.storage.setPinnedChats(0, this.#pinnedChats);
162
+ }
163
+ if (listId === null || listId === 1) {
164
+ const dialogs = await this.#c.invoke({ _: "messages.getPinnedDialogs", folder_id: 1 });
165
+ const pinnedArchiveChats = new Array();
166
+ for (const dialog of dialogs.dialogs) {
167
+ pinnedArchiveChats.push(_2_tl_js_1.Api.peerToChatId(dialog.peer));
168
+ }
169
+ this.#pinnedArchiveChats = pinnedArchiveChats;
170
+ await this.#c.storage.setPinnedChats(1, this.#pinnedArchiveChats);
171
+ }
172
+ if (listId !== null && listId !== 0 && listId !== 1) {
173
+ (0, _0_deps_js_1.unreachable)();
174
+ }
175
+ }
176
+ async #getPinnedChats(listId) {
177
+ if (!this.#pinnedChatsLoaded) {
178
+ await this.#loadPinnedChats();
179
+ }
180
+ if (!this.#storageHadPinnedChats) {
181
+ await this.#fetchPinnedChats();
182
+ }
183
+ switch (listId) {
184
+ case 0:
185
+ return this.#pinnedChats;
186
+ case 1:
187
+ return this.#pinnedArchiveChats;
188
+ default:
189
+ (0, _0_deps_js_1.unreachable)();
190
+ }
191
+ }
192
+ async #updateOrAddChat(chatId) {
193
+ const [chat, listId] = this.#getChatAnywhere(chatId);
194
+ if (chat !== undefined) {
195
+ const newChat = await (0, _3_types_js_1.constructChatListItem3)(chatId, chat.pinned, chat.lastMessage, this.#c.getEntity);
196
+ if (newChat !== null) {
197
+ this.#getChatList(listId).set(chatId, newChat);
198
+ this.#sendChatUpdate(chatId, false);
199
+ }
200
+ }
201
+ else {
202
+ const chat = await (0, _3_types_js_1.constructChatListItem)(chatId, -1, -1, this.#c.getEntity, this.#c.messageManager.getMessage.bind(this.#c.messageManager));
203
+ if (chat !== null) {
204
+ this.#getChatList(0).set(chatId, chat);
205
+ await this.reassignChatLastMessage(chatId, false, false);
206
+ this.#sendChatUpdate(chatId, true);
207
+ }
208
+ }
209
+ }
210
+ #removeChat(chatId) {
211
+ const [chat, listId] = this.#getChatAnywhere(chatId);
212
+ if (chat !== undefined) {
213
+ this.#getChatList(listId).delete(chatId);
214
+ this.#sendChatUpdate(chatId, false);
215
+ }
216
+ }
217
+ #handleUpdateFolderPeers(update) {
218
+ for (const { peer, folder_id: listId } of update.folder_peers) {
219
+ const chatId = _2_tl_js_1.Api.peerToChatId(peer);
220
+ const [chat, currentListId] = this.#getChatAnywhere(chatId);
221
+ if (chat !== undefined && listId !== currentListId) {
222
+ this.#getChatList(currentListId).delete(chatId);
223
+ this.#getChatList(listId).set(chatId, chat);
224
+ this.#sendChatUpdate(chatId, true);
225
+ }
226
+ }
227
+ }
228
+ async #handleUpdatePinnedDialogs(update) {
229
+ const listId = update.folder_id ?? 0;
230
+ await this.#fetchPinnedChats(update.folder_id);
231
+ const chats = this.#getChatList(listId);
232
+ const pinnedChats = await this.#getPinnedChats(listId);
233
+ for (const [i, chatId] of pinnedChats.entries()) {
234
+ const chat = chats.get(chatId);
235
+ if (chat !== undefined) {
236
+ chat.order = (0, _3_types_js_1.getChatListItemOrder)(chat.lastMessage, i);
237
+ chat.pinned = i;
238
+ await this.#sendChatUpdate(chatId, false);
239
+ }
240
+ }
241
+ for (const chat of chats.values()) {
242
+ if (chat.pinned !== -1 && pinnedChats.indexOf(chat.chat.id) === -1) {
243
+ chat.order = (0, _3_types_js_1.getChatListItemOrder)(chat.lastMessage, -1);
244
+ chat.pinned = -1;
245
+ await this.#sendChatUpdate(chat.chat.id, false);
246
+ }
247
+ }
248
+ await this.#c.storage.setPinnedChats(listId, await this.#getPinnedChats(listId));
249
+ }
250
+ async #handleUpdateChannel(update) {
251
+ const peer = { ...update, _: "peerChannel" };
252
+ const channel = await this.#c.getEntity(peer);
253
+ const chatId = _2_tl_js_1.Api.peerToChatId(peer);
254
+ await this.#c.storage.setFullChat(chatId, null);
255
+ if (channel !== null && "left" in channel && channel.left) {
256
+ this.#removeChat(chatId);
257
+ }
258
+ else if (_2_tl_js_1.Api.is("channelForbidden", channel)) {
259
+ this.#removeChat(chatId);
260
+ }
261
+ else if (_2_tl_js_1.Api.is("channel", channel)) {
262
+ await this.#updateOrAddChat(chatId);
263
+ }
264
+ }
265
+ async #handleUpdateChat(update) {
266
+ const peer = { ...update, _: "peerChat" };
267
+ const chat = await this.#c.getEntity(peer);
268
+ const chatId = _2_tl_js_1.Api.peerToChatId(peer);
269
+ await this.#c.storage.setFullChat(chatId, null);
270
+ if (chat !== null && "left" in chat && chat.left) {
271
+ await this.#removeChat(chatId);
272
+ }
273
+ else if (_2_tl_js_1.Api.is("chatForbidden", chat)) {
274
+ await this.#removeChat(chatId);
275
+ }
276
+ else if (_2_tl_js_1.Api.is("chat", chat)) {
277
+ await this.#updateOrAddChat(chatId);
278
+ }
279
+ }
280
+ async #handleUpdateUser(update) {
281
+ const peer = { ...update, _: "peerUser" };
282
+ const chat = await this.#c.getEntity(peer);
283
+ const chatId = _2_tl_js_1.Api.peerToChatId(peer);
284
+ await this.#c.storage.setFullChat(chatId, null);
285
+ if (chat !== null) {
286
+ await this.#updateOrAddChat(chatId);
287
+ }
288
+ }
125
289
  async getChats(from = "main", after, limit = 100) {
126
- __classPrivateFieldGet(this, _ChatListManager_c, "f").storage.assertUser("getChats");
127
- if (after && !__classPrivateFieldGet(this, _ChatListManager_chats, "f").get(after.chat.id)) {
290
+ this.#c.storage.assertUser("getChats");
291
+ if (after && !this.#chats.get(after.chat.id)) {
128
292
  throw new _0_errors_js_1.InputError("Invalid after");
129
293
  }
130
294
  if (limit <= 0 || limit > 100) {
131
295
  limit = 100;
132
296
  }
133
297
  const listId = (0, _0_utilities_js_1.getChatListId)(from);
134
- const dialogs = await __classPrivateFieldGet(this, _ChatListManager_c, "f").invoke({ _: "messages.getDialogs", limit, offset_id: after?.lastMessage?.id ?? 0, offset_date: after?.lastMessage?.date ?? 0, offset_peer: after ? await __classPrivateFieldGet(this, _ChatListManager_c, "f").getInputPeer(after.chat.id) : { _: "inputPeerEmpty" }, hash: 0n, folder_id: listId });
135
- const pinnedChats = await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_getPinnedChats).call(this, listId);
298
+ const dialogs = await this.#c.invoke({ _: "messages.getDialogs", limit, offset_id: after?.lastMessage?.id ?? 0, offset_date: after?.lastMessage?.date ?? 0, offset_peer: after ? await this.#c.getInputPeer(after.chat.id) : { _: "inputPeerEmpty" }, hash: 0n, folder_id: listId });
299
+ const pinnedChats = await this.#getPinnedChats(listId);
136
300
  if (!(_2_tl_js_1.Api.is("messages.dialogs", dialogs)) && !(_2_tl_js_1.Api.is("messages.dialogsSlice", dialogs))) {
137
301
  (0, _0_deps_js_1.unreachable)();
138
302
  }
139
303
  if (dialogs.dialogs.length < limit) {
140
- await __classPrivateFieldGet(this, _ChatListManager_c, "f").storage.setHasAllChats(listId, true);
304
+ await this.#c.storage.setHasAllChats(listId, true);
141
305
  }
142
306
  const chats = new Array();
143
307
  for (const dialog of dialogs.dialogs) {
144
- const chat = await (0, _3_types_js_1.constructChatListItem4)(dialog, dialogs, pinnedChats, __classPrivateFieldGet(this, _ChatListManager_c, "f").getEntity, __classPrivateFieldGet(this, _ChatListManager_c, "f").messageManager.getMessage.bind(__classPrivateFieldGet(this, _ChatListManager_c, "f").messageManager), __classPrivateFieldGet(this, _ChatListManager_c, "f").fileManager.getStickerSetName.bind(__classPrivateFieldGet(this, _ChatListManager_c, "f").fileManager));
308
+ const chat = await (0, _3_types_js_1.constructChatListItem4)(dialog, dialogs, pinnedChats, this.#c.getEntity, this.#c.messageManager.getMessage.bind(this.#c.messageManager), this.#c.fileManager.getStickerSetName.bind(this.#c.fileManager));
145
309
  chats.push(chat);
146
- await __classPrivateFieldGet(this, _ChatListManager_c, "f").storage.setChat(listId, chat.chat.id, chat.pinned, chat.lastMessage?.id ?? 0, (0, _1_utilities_js_1.fromUnixTimestamp)(chat.lastMessage?.date ?? 0));
310
+ await this.#c.storage.setChat(listId, chat.chat.id, chat.pinned, chat.lastMessage?.id ?? 0, (0, _1_utilities_js_1.fromUnixTimestamp)(chat.lastMessage?.date ?? 0));
147
311
  }
148
312
  return chats;
149
313
  }
@@ -158,54 +322,76 @@ class ChatListManager {
158
322
  }
159
323
  }
160
324
  else if (_2_tl_js_1.Api.is("updatePinnedDialogs", update)) {
161
- await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_handleUpdatePinnedDialogs).call(this, update);
325
+ await this.#handleUpdatePinnedDialogs(update);
162
326
  }
163
327
  else if (_2_tl_js_1.Api.is("updateFolderPeers", update)) {
164
- __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_handleUpdateFolderPeers).call(this, update);
328
+ this.#handleUpdateFolderPeers(update);
165
329
  }
166
330
  else if (_2_tl_js_1.Api.is("updateChannel", update)) {
167
- await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_handleUpdateChannel).call(this, update);
331
+ await this.#handleUpdateChannel(update);
168
332
  }
169
333
  else if (_2_tl_js_1.Api.is("updateChat", update)) {
170
- await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_handleUpdateChat).call(this, update);
334
+ await this.#handleUpdateChat(update);
171
335
  }
172
336
  else if (_2_tl_js_1.Api.is("updateUser", update) || _2_tl_js_1.Api.is("updateUserName", update)) {
173
- await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_handleUpdateUser).call(this, update);
337
+ await this.#handleUpdateUser(update);
174
338
  }
175
339
  else {
176
340
  (0, _0_deps_js_1.unreachable)();
177
341
  }
178
342
  return null;
179
343
  }
344
+ async #getFullChat(chatId) {
345
+ const inputPeer = await this.#c.getInputPeer(chatId);
346
+ const chatId_ = await this.#c.getInputPeerChatId(inputPeer);
347
+ let fullChat = await this.#c.storage.getFullChat(chatId_);
348
+ if (fullChat !== null) {
349
+ return fullChat;
350
+ }
351
+ if ((0, _0_utilities_js_1.canBeInputUser)(inputPeer)) {
352
+ fullChat = (await this.#c.invoke({ _: "users.getFullUser", id: (0, _0_utilities_js_1.toInputUser)(inputPeer) })).full_user;
353
+ }
354
+ else if (_2_tl_js_1.Api.is("inputPeerChat", inputPeer)) {
355
+ fullChat = (await this.#c.invoke({ ...inputPeer, _: "messages.getFullChat" })).full_chat;
356
+ }
357
+ else if ((0, _0_utilities_js_1.canBeInputChannel)(inputPeer)) {
358
+ fullChat = (await this.#c.invoke({ _: "channels.getFullChannel", channel: (0, _0_utilities_js_1.toInputChannel)(inputPeer) })).full_chat;
359
+ }
360
+ await this.#c.storage.setFullChat(chatId_, fullChat);
361
+ if (fullChat !== null && "call" in fullChat && _2_tl_js_1.Api.is("inputGroupCall", fullChat.call)) {
362
+ await this.#c.storage.setGroupCallAccessHash(fullChat.call.id, fullChat.call.access_hash);
363
+ }
364
+ return fullChat;
365
+ }
180
366
  async getChat(chatId) {
181
- const fullChat = await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_getFullChat).call(this, chatId);
182
- if (fullChat == null) {
367
+ const fullChat = await this.#getFullChat(chatId);
368
+ if (fullChat === null) {
183
369
  throw new _0_errors_js_1.InputError("Chat not found.");
184
370
  }
185
- return await (0, _3_types_js_1.constructChat)(fullChat, __classPrivateFieldGet(this, _ChatListManager_c, "f").getEntity);
371
+ return await (0, _3_types_js_1.constructChat)(fullChat, this.#c.getEntity);
186
372
  }
187
373
  async getChatAdministrators(chatId) {
188
- const peer = await __classPrivateFieldGet(this, _ChatListManager_c, "f").getInputPeer(chatId);
374
+ const peer = await this.#c.getInputPeer(chatId);
189
375
  if ((0, _0_utilities_js_1.canBeInputChannel)(peer)) {
190
376
  const channel = (0, _0_utilities_js_1.toInputChannel)(peer);
191
- const participants = await __classPrivateFieldGet(this, _ChatListManager_c, "f").invoke({ _: "channels.getParticipants", channel, filter: { _: "channelParticipantsAdmins" }, offset: 0, limit: 100, hash: 0n });
377
+ const participants = await this.#c.invoke({ _: "channels.getParticipants", channel, filter: { _: "channelParticipantsAdmins" }, offset: 0, limit: 100, hash: 0n });
192
378
  if (_2_tl_js_1.Api.is("channels.channelParticipantsNotModified", participants)) {
193
379
  (0, _0_deps_js_1.unreachable)();
194
380
  }
195
381
  const chatMembers = new Array();
196
382
  for (const p of participants.participants) {
197
- chatMembers.push(await (0, _3_types_js_1.constructChatMember)(p, __classPrivateFieldGet(this, _ChatListManager_c, "f").getEntity));
383
+ chatMembers.push(await (0, _3_types_js_1.constructChatMember)(p, this.#c.getEntity));
198
384
  }
199
385
  return chatMembers;
200
386
  }
201
387
  else if (_2_tl_js_1.Api.is("inputPeerChat", peer)) {
202
- const fullChat = await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_getFullChat).call(this, chatId);
388
+ const fullChat = await this.#getFullChat(chatId);
203
389
  if (!fullChat || !("participants" in fullChat) || !_2_tl_js_1.Api.is("chatParticipants", fullChat.participants)) {
204
390
  (0, _0_deps_js_1.unreachable)();
205
391
  }
206
392
  const chatMembers = new Array();
207
393
  for (const p of fullChat.participants.participants) {
208
- chatMembers.push(await (0, _3_types_js_1.constructChatMember)(p, __classPrivateFieldGet(this, _ChatListManager_c, "f").getEntity));
394
+ chatMembers.push(await (0, _3_types_js_1.constructChatMember)(p, this.#c.getEntity));
209
395
  }
210
396
  return chatMembers;
211
397
  }
@@ -214,44 +400,44 @@ class ChatListManager {
214
400
  }
215
401
  }
216
402
  async getChatMember(chatId, userId) {
217
- const peer = await __classPrivateFieldGet(this, _ChatListManager_c, "f").getInputPeer(chatId);
403
+ const peer = await this.#c.getInputPeer(chatId);
218
404
  if ((0, _0_utilities_js_1.canBeInputChannel)(peer)) {
219
- const { participant } = await __classPrivateFieldGet(this, _ChatListManager_c, "f").invoke({ _: "channels.getParticipant", channel: (0, _0_utilities_js_1.toInputChannel)(peer), participant: await __classPrivateFieldGet(this, _ChatListManager_c, "f").getInputPeer(userId) });
220
- return await (0, _3_types_js_1.constructChatMember)(participant, __classPrivateFieldGet(this, _ChatListManager_c, "f").getEntity);
405
+ const { participant } = await this.#c.invoke({ _: "channels.getParticipant", channel: (0, _0_utilities_js_1.toInputChannel)(peer), participant: await this.#c.getInputPeer(userId) });
406
+ return await (0, _3_types_js_1.constructChatMember)(participant, this.#c.getEntity);
221
407
  }
222
408
  else if (_2_tl_js_1.Api.is("inputPeerChat", peer)) {
223
- const user = await __classPrivateFieldGet(this, _ChatListManager_c, "f").getInputUser(userId);
224
- const userId_ = BigInt(await __classPrivateFieldGet(this, _ChatListManager_c, "f").getInputPeerChatId(user));
225
- const fullChat = await __classPrivateFieldGet(this, _ChatListManager_c, "f").invoke({ ...peer, _: "messages.getFullChat" }).then((v) => _2_tl_js_1.Api.as("chatFull", v.full_chat));
226
- const participant = _2_tl_js_1.Api.as("chatParticipants", fullChat.participants).participants.find((v) => v.user_id == userId_);
227
- return await (0, _3_types_js_1.constructChatMember)(participant, __classPrivateFieldGet(this, _ChatListManager_c, "f").getEntity);
409
+ const user = await this.#c.getInputUser(userId);
410
+ const userId_ = BigInt(await this.#c.getInputPeerChatId(user));
411
+ const fullChat = await this.#c.invoke({ ...peer, _: "messages.getFullChat" }).then((v) => _2_tl_js_1.Api.as("chatFull", v.full_chat));
412
+ const participant = _2_tl_js_1.Api.as("chatParticipants", fullChat.participants).participants.find((v) => v.user_id === userId_);
413
+ return await (0, _3_types_js_1.constructChatMember)(participant, this.#c.getEntity);
228
414
  }
229
415
  else {
230
416
  throw new _0_errors_js_1.InputError("Expected a channel, supergroup, or group ID. Got a user ID instead.");
231
417
  }
232
418
  }
233
419
  async getChatMembers(chatId, params) {
234
- const peer = await __classPrivateFieldGet(this, _ChatListManager_c, "f").getInputPeer(chatId);
420
+ const peer = await this.#c.getInputPeer(chatId);
235
421
  if ((0, _0_utilities_js_1.canBeInputChannel)(peer)) {
236
422
  const channel = (0, _0_utilities_js_1.toInputChannel)(peer);
237
- const participants = await __classPrivateFieldGet(this, _ChatListManager_c, "f").invoke({ _: "channels.getParticipants", channel, filter: { _: "channelParticipantsRecent" }, offset: params?.offset ?? 0, limit: (0, _0_utilities_js_1.getLimit)(params?.limit), hash: 0n });
423
+ const participants = await this.#c.invoke({ _: "channels.getParticipants", channel, filter: { _: "channelParticipantsRecent" }, offset: params?.offset ?? 0, limit: (0, _0_utilities_js_1.getLimit)(params?.limit), hash: 0n });
238
424
  if (_2_tl_js_1.Api.is("channels.channelParticipantsNotModified", participants)) {
239
425
  (0, _0_deps_js_1.unreachable)();
240
426
  }
241
427
  const chatMembers = new Array();
242
428
  for (const p of participants.participants) {
243
- chatMembers.push(await (0, _3_types_js_1.constructChatMember)(p, __classPrivateFieldGet(this, _ChatListManager_c, "f").getEntity));
429
+ chatMembers.push(await (0, _3_types_js_1.constructChatMember)(p, this.#c.getEntity));
244
430
  }
245
431
  return chatMembers;
246
432
  }
247
433
  else if (_2_tl_js_1.Api.is("inputPeerChat", peer)) {
248
- const fullChat = await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_getFullChat).call(this, chatId);
434
+ const fullChat = await this.#getFullChat(chatId);
249
435
  if (!fullChat || !("participants" in fullChat) || !_2_tl_js_1.Api.is("chatParticipants", fullChat.participants)) {
250
436
  (0, _0_deps_js_1.unreachable)();
251
437
  }
252
438
  const chatMembers = new Array();
253
439
  for (const p of fullChat.participants.participants) {
254
- chatMembers.push(await (0, _3_types_js_1.constructChatMember)(p, __classPrivateFieldGet(this, _ChatListManager_c, "f").getEntity));
440
+ chatMembers.push(await (0, _3_types_js_1.constructChatMember)(p, this.#c.getEntity));
255
441
  }
256
442
  return chatMembers;
257
443
  }
@@ -259,63 +445,95 @@ class ChatListManager {
259
445
  (0, _0_deps_js_1.unreachable)();
260
446
  }
261
447
  }
448
+ #checkChatTitle(title) {
449
+ title = title.trim();
450
+ if (!title) {
451
+ throw new _0_errors_js_1.InputError("Title cannot be empty.");
452
+ }
453
+ return title;
454
+ }
262
455
  async createGroup(title, params) {
263
- __classPrivateFieldGet(this, _ChatListManager_c, "f").storage.assertUser("createGroup");
264
- title = __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_checkChatTitle).call(this, title);
265
- const { updates } = await __classPrivateFieldGet(this, _ChatListManager_c, "f").invoke({
456
+ this.#c.storage.assertUser("createGroup");
457
+ title = this.#checkChatTitle(title);
458
+ const { updates } = await this.#c.invoke({
266
459
  _: "messages.createChat",
267
460
  title,
268
- users: await Promise.all((params?.users ?? []).map((v) => __classPrivateFieldGet(this, _ChatListManager_c, "f").getInputUser(v))),
461
+ users: await Promise.all((params?.users ?? []).map((v) => this.#c.getInputUser(v))),
269
462
  ttl_period: params?.messageTtl || undefined,
270
463
  });
271
464
  if (!("chats" in updates) || updates.chats.length < 1) {
272
465
  (0, _0_deps_js_1.unreachable)();
273
466
  }
274
467
  const chat = updates.chats[0];
275
- if (chat._ != "chat") {
468
+ if (chat._ !== "chat") {
469
+ (0, _0_deps_js_1.unreachable)();
470
+ }
471
+ return (0, _3_types_js_1.constructChatP)(chat);
472
+ }
473
+ async #createChannel(type, title, params) {
474
+ title = this.#checkChatTitle(title);
475
+ const updates = await this.#c.invoke({
476
+ _: "channels.createChannel",
477
+ broadcast: type === "channel" ? true : undefined,
478
+ megagroup: type === "supergroup" ? true : undefined,
479
+ forum: params && ("forum" in params) && params.forum ? true : undefined,
480
+ title,
481
+ about: params?.description || "",
482
+ ttl_period: params?.messageTtl || undefined,
483
+ });
484
+ if (!("chats" in updates) || updates.chats.length < 1) {
485
+ (0, _0_deps_js_1.unreachable)();
486
+ }
487
+ const chat = updates.chats[0];
488
+ if (chat._ !== "channel") {
276
489
  (0, _0_deps_js_1.unreachable)();
277
490
  }
278
491
  return (0, _3_types_js_1.constructChatP)(chat);
279
492
  }
280
493
  async createSupergroup(title, params) {
281
- __classPrivateFieldGet(this, _ChatListManager_c, "f").storage.assertUser("createSupergroup");
282
- return (await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_createChannel).call(this, "supergroup", title, params));
494
+ this.#c.storage.assertUser("createSupergroup");
495
+ return (await this.#createChannel("supergroup", title, params));
283
496
  }
284
497
  async createChannel(title, params) {
285
- __classPrivateFieldGet(this, _ChatListManager_c, "f").storage.assertUser("createChannel");
286
- return (await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_createChannel).call(this, "channel", title, params));
498
+ this.#c.storage.assertUser("createChannel");
499
+ return (await this.#createChannel("channel", title, params));
287
500
  }
288
501
  async setMessageTtl(chatId, messageTtl) {
289
- __classPrivateFieldGet(this, _ChatListManager_c, "f").storage.assertUser("setMessageTtl");
290
- const peer = await __classPrivateFieldGet(this, _ChatListManager_c, "f").getInputPeer(chatId);
502
+ this.#c.storage.assertUser("setMessageTtl");
503
+ const peer = await this.#c.getInputPeer(chatId);
291
504
  const period = messageTtl;
292
- await __classPrivateFieldGet(this, _ChatListManager_c, "f").invoke({ _: "messages.setHistoryTTL", peer, period });
505
+ await this.#c.invoke({ _: "messages.setHistoryTTL", peer, period });
506
+ }
507
+ async #moveChatsToFolder(chatIds, folderId) {
508
+ const peers = await Promise.all(chatIds.map((v) => this.#c.getInputPeer(v)));
509
+ const inputFolderPeers = peers.map((v) => ({ _: "inputFolderPeer", peer: v, folder_id: folderId }));
510
+ await this.#c.invoke({ _: "folders.editPeerFolders", folder_peers: inputFolderPeers });
293
511
  }
294
512
  async archiveChats(chatIds) {
295
- __classPrivateFieldGet(this, _ChatListManager_c, "f").storage.assertUser("archiveChats");
296
- await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_moveChatsToFolder).call(this, chatIds, 1);
513
+ this.#c.storage.assertUser("archiveChats");
514
+ await this.#moveChatsToFolder(chatIds, 1);
297
515
  }
298
516
  async archiveChat(chatId) {
299
- __classPrivateFieldGet(this, _ChatListManager_c, "f").storage.assertUser("archiveChat");
517
+ this.#c.storage.assertUser("archiveChat");
300
518
  await this.archiveChats([chatId]);
301
519
  }
302
520
  async unarchiveChats(chatIds) {
303
- __classPrivateFieldGet(this, _ChatListManager_c, "f").storage.assertUser("unarchiveChats");
304
- await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_moveChatsToFolder).call(this, chatIds, 0);
521
+ this.#c.storage.assertUser("unarchiveChats");
522
+ await this.#moveChatsToFolder(chatIds, 0);
305
523
  }
306
524
  async unarchiveChat(chatId) {
307
- __classPrivateFieldGet(this, _ChatListManager_c, "f").storage.assertUser("unarchiveChat");
525
+ this.#c.storage.assertUser("unarchiveChat");
308
526
  await this.unarchiveChats([chatId]);
309
527
  }
310
528
  async getCommonChats(userId, params) {
311
- __classPrivateFieldGet(this, _ChatListManager_c, "f").storage.assertUser("getCommonChats");
312
- const max_id = params?.fromChatId ? await __classPrivateFieldGet(this, _ChatListManager_c, "f").getInputPeerChatId(await __classPrivateFieldGet(this, _ChatListManager_c, "f").getInputPeer(params.fromChatId)) : 0;
529
+ this.#c.storage.assertUser("getCommonChats");
530
+ const max_id = params?.fromChatId ? await this.#c.getInputPeerChatId(await this.#c.getInputPeer(params.fromChatId)) : 0;
313
531
  if (max_id < 0) {
314
532
  throw new _0_errors_js_1.InputError("fromChatId must be a chat identifier.");
315
533
  }
316
- const user_id = await __classPrivateFieldGet(this, _ChatListManager_c, "f").getInputUser(userId);
534
+ const user_id = await this.#c.getInputUser(userId);
317
535
  const limit = (0, _0_utilities_js_1.getLimit)(params?.limit);
318
- const result = await __classPrivateFieldGet(this, _ChatListManager_c, "f").invoke({ _: "messages.getCommonChats", user_id, max_id: _2_tl_js_1.Api.chatIdToPeerId(max_id), limit });
536
+ const result = await this.#c.invoke({ _: "messages.getCommonChats", user_id, max_id: _2_tl_js_1.Api.chatIdToPeerId(max_id), limit });
319
537
  const chats = new Array();
320
538
  for (const chat of result.chats) {
321
539
  if (!_2_tl_js_1.Api.is("chatEmpty", chat)) {
@@ -325,239 +543,25 @@ class ChatListManager {
325
543
  return chats;
326
544
  }
327
545
  async getChatSettings(chatId) {
328
- __classPrivateFieldGet(this, _ChatListManager_c, "f").storage.assertUser("getChatSettings");
329
- const peer = await __classPrivateFieldGet(this, _ChatListManager_c, "f").getInputPeer(chatId);
330
- const settings = await __classPrivateFieldGet(this, _ChatListManager_c, "f").invoke({ _: "messages.getPeerSettings", peer });
546
+ this.#c.storage.assertUser("getChatSettings");
547
+ const peer = await this.#c.getInputPeer(chatId);
548
+ const settings = await this.#c.invoke({ _: "messages.getPeerSettings", peer });
331
549
  return (0, _3_types_js_1.constructChatSettings)(settings);
332
550
  }
551
+ async #toggleBusinessBotsPaused(chatId, paused) {
552
+ const peer = await this.#c.getInputPeer(chatId);
553
+ if (!(0, _0_utilities_js_1.canBeInputUser)(peer)) {
554
+ throw new _0_errors_js_1.InputError("A private chat was expected.");
555
+ }
556
+ await this.#c.invoke({ _: "account.toggleConnectedBotPaused", peer, paused });
557
+ }
333
558
  async disableBusinessBots(chatId) {
334
- __classPrivateFieldGet(this, _ChatListManager_c, "f").storage.assertUser("disableBusinessBots");
335
- await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_toggleBusinessBotsPaused).call(this, chatId, true);
559
+ this.#c.storage.assertUser("disableBusinessBots");
560
+ await this.#toggleBusinessBotsPaused(chatId, true);
336
561
  }
337
562
  async enableBusinessBots(chatId) {
338
- __classPrivateFieldGet(this, _ChatListManager_c, "f").storage.assertUser("enableBusinessBots");
339
- await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_toggleBusinessBotsPaused).call(this, chatId, false);
563
+ this.#c.storage.assertUser("enableBusinessBots");
564
+ await this.#toggleBusinessBotsPaused(chatId, false);
340
565
  }
341
566
  }
342
567
  exports.ChatListManager = ChatListManager;
343
- _ChatListManager_c = new WeakMap(), _ChatListManager_chats = new WeakMap(), _ChatListManager_archivedChats = new WeakMap(), _ChatListManager_pinnedChats = new WeakMap(), _ChatListManager_pinnedArchiveChats = new WeakMap(), _ChatListManager_storageHadPinnedChats = new WeakMap(), _ChatListManager_pinnedChatsLoaded = new WeakMap(), _ChatListManager_instances = new WeakSet(), _ChatListManager_sendChatUpdate = function _ChatListManager_sendChatUpdate(chatId, added) {
344
- try {
345
- __classPrivateFieldGet(this, _ChatListManager_c, "f").storage.assertUser("");
346
- }
347
- catch {
348
- return;
349
- }
350
- const [chat] = __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_getChatAnywhere).call(this, chatId);
351
- const update = chat === undefined ? { deletedChat: { chatId } } : added ? { newChat: chat } : { editedChat: chat };
352
- __classPrivateFieldGet(this, _ChatListManager_c, "f").handleUpdate(update);
353
- }, _ChatListManager_getChatAnywhere = function _ChatListManager_getChatAnywhere(chatId) {
354
- let chat = __classPrivateFieldGet(this, _ChatListManager_chats, "f").get(chatId);
355
- if (chat) {
356
- return [chat, 0];
357
- }
358
- chat = __classPrivateFieldGet(this, _ChatListManager_archivedChats, "f").get(chatId);
359
- if (chat) {
360
- return [chat, 1];
361
- }
362
- return [undefined, -1];
363
- }, _ChatListManager_getChatList = function _ChatListManager_getChatList(listId) {
364
- switch (listId) {
365
- case 0:
366
- return __classPrivateFieldGet(this, _ChatListManager_chats, "f");
367
- case 1:
368
- return __classPrivateFieldGet(this, _ChatListManager_archivedChats, "f");
369
- default:
370
- throw new Error(`Invalid chat list: ${listId}`);
371
- }
372
- }, _ChatListManager_loadPinnedChats = async function _ChatListManager_loadPinnedChats() {
373
- const [pinnedChats, pinnedArchiveChats] = await Promise.all([__classPrivateFieldGet(this, _ChatListManager_c, "f").storage.getPinnedChats(0), __classPrivateFieldGet(this, _ChatListManager_c, "f").storage.getPinnedChats(1)]);
374
- if (pinnedChats != null && pinnedArchiveChats != null) {
375
- __classPrivateFieldSet(this, _ChatListManager_pinnedChats, pinnedChats, "f");
376
- __classPrivateFieldSet(this, _ChatListManager_pinnedArchiveChats, pinnedArchiveChats, "f");
377
- __classPrivateFieldSet(this, _ChatListManager_storageHadPinnedChats, true, "f");
378
- }
379
- __classPrivateFieldSet(this, _ChatListManager_pinnedChatsLoaded, true, "f");
380
- }, _ChatListManager_fetchPinnedChats = async function _ChatListManager_fetchPinnedChats(listId = null) {
381
- if (listId == null || listId == 0) {
382
- const dialogs = await __classPrivateFieldGet(this, _ChatListManager_c, "f").invoke({ _: "messages.getPinnedDialogs", folder_id: 0 });
383
- const pinnedChats = new Array();
384
- for (const dialog of dialogs.dialogs) {
385
- pinnedChats.push(_2_tl_js_1.Api.peerToChatId(dialog.peer));
386
- }
387
- __classPrivateFieldSet(this, _ChatListManager_pinnedChats, pinnedChats, "f");
388
- await __classPrivateFieldGet(this, _ChatListManager_c, "f").storage.setPinnedChats(0, __classPrivateFieldGet(this, _ChatListManager_pinnedChats, "f"));
389
- }
390
- if (listId == null || listId == 1) {
391
- const dialogs = await __classPrivateFieldGet(this, _ChatListManager_c, "f").invoke({ _: "messages.getPinnedDialogs", folder_id: 1 });
392
- const pinnedArchiveChats = new Array();
393
- for (const dialog of dialogs.dialogs) {
394
- pinnedArchiveChats.push(_2_tl_js_1.Api.peerToChatId(dialog.peer));
395
- }
396
- __classPrivateFieldSet(this, _ChatListManager_pinnedArchiveChats, pinnedArchiveChats, "f");
397
- await __classPrivateFieldGet(this, _ChatListManager_c, "f").storage.setPinnedChats(1, __classPrivateFieldGet(this, _ChatListManager_pinnedArchiveChats, "f"));
398
- }
399
- if (listId != null && listId != 0 && listId != 1) {
400
- (0, _0_deps_js_1.unreachable)();
401
- }
402
- }, _ChatListManager_getPinnedChats = async function _ChatListManager_getPinnedChats(listId) {
403
- if (!__classPrivateFieldGet(this, _ChatListManager_pinnedChatsLoaded, "f")) {
404
- await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_loadPinnedChats).call(this);
405
- }
406
- if (!__classPrivateFieldGet(this, _ChatListManager_storageHadPinnedChats, "f")) {
407
- await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_fetchPinnedChats).call(this);
408
- }
409
- switch (listId) {
410
- case 0:
411
- return __classPrivateFieldGet(this, _ChatListManager_pinnedChats, "f");
412
- case 1:
413
- return __classPrivateFieldGet(this, _ChatListManager_pinnedArchiveChats, "f");
414
- default:
415
- (0, _0_deps_js_1.unreachable)();
416
- }
417
- }, _ChatListManager_updateOrAddChat = async function _ChatListManager_updateOrAddChat(chatId) {
418
- const [chat, listId] = __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_getChatAnywhere).call(this, chatId);
419
- if (chat !== undefined) {
420
- const newChat = await (0, _3_types_js_1.constructChatListItem3)(chatId, chat.pinned, chat.lastMessage, __classPrivateFieldGet(this, _ChatListManager_c, "f").getEntity);
421
- if (newChat != null) {
422
- __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_getChatList).call(this, listId).set(chatId, newChat);
423
- __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_sendChatUpdate).call(this, chatId, false);
424
- }
425
- }
426
- else {
427
- const chat = await (0, _3_types_js_1.constructChatListItem)(chatId, -1, -1, __classPrivateFieldGet(this, _ChatListManager_c, "f").getEntity, __classPrivateFieldGet(this, _ChatListManager_c, "f").messageManager.getMessage.bind(__classPrivateFieldGet(this, _ChatListManager_c, "f").messageManager));
428
- if (chat != null) {
429
- __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_getChatList).call(this, 0).set(chatId, chat);
430
- await this.reassignChatLastMessage(chatId, false, false);
431
- __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_sendChatUpdate).call(this, chatId, true);
432
- }
433
- }
434
- }, _ChatListManager_removeChat = function _ChatListManager_removeChat(chatId) {
435
- const [chat, listId] = __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_getChatAnywhere).call(this, chatId);
436
- if (chat !== undefined) {
437
- __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_getChatList).call(this, listId).delete(chatId);
438
- __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_sendChatUpdate).call(this, chatId, false);
439
- }
440
- }, _ChatListManager_handleUpdateFolderPeers = function _ChatListManager_handleUpdateFolderPeers(update) {
441
- for (const { peer, folder_id: listId } of update.folder_peers) {
442
- const chatId = _2_tl_js_1.Api.peerToChatId(peer);
443
- const [chat, currentListId] = __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_getChatAnywhere).call(this, chatId);
444
- if (chat !== undefined && listId != currentListId) {
445
- __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_getChatList).call(this, currentListId).delete(chatId);
446
- __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_getChatList).call(this, listId).set(chatId, chat);
447
- __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_sendChatUpdate).call(this, chatId, true);
448
- }
449
- }
450
- }, _ChatListManager_handleUpdatePinnedDialogs = async function _ChatListManager_handleUpdatePinnedDialogs(update) {
451
- const listId = update.folder_id ?? 0;
452
- await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_fetchPinnedChats).call(this, update.folder_id);
453
- const chats = __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_getChatList).call(this, listId);
454
- const pinnedChats = await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_getPinnedChats).call(this, listId);
455
- for (const [i, chatId] of pinnedChats.entries()) {
456
- const chat = chats.get(chatId);
457
- if (chat !== undefined) {
458
- chat.order = (0, _3_types_js_1.getChatListItemOrder)(chat.lastMessage, i);
459
- chat.pinned = i;
460
- await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_sendChatUpdate).call(this, chatId, false);
461
- }
462
- }
463
- for (const chat of chats.values()) {
464
- if (chat.pinned != -1 && pinnedChats.indexOf(chat.chat.id) == -1) {
465
- chat.order = (0, _3_types_js_1.getChatListItemOrder)(chat.lastMessage, -1);
466
- chat.pinned = -1;
467
- await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_sendChatUpdate).call(this, chat.chat.id, false);
468
- }
469
- }
470
- await __classPrivateFieldGet(this, _ChatListManager_c, "f").storage.setPinnedChats(listId, await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_getPinnedChats).call(this, listId));
471
- }, _ChatListManager_handleUpdateChannel = async function _ChatListManager_handleUpdateChannel(update) {
472
- const peer = { ...update, _: "peerChannel" };
473
- const channel = await __classPrivateFieldGet(this, _ChatListManager_c, "f").getEntity(peer);
474
- const chatId = _2_tl_js_1.Api.peerToChatId(peer);
475
- await __classPrivateFieldGet(this, _ChatListManager_c, "f").storage.setFullChat(chatId, null);
476
- if (channel != null && "left" in channel && channel.left) {
477
- __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_removeChat).call(this, chatId);
478
- }
479
- else if (_2_tl_js_1.Api.is("channelForbidden", channel)) {
480
- __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_removeChat).call(this, chatId);
481
- }
482
- else if (_2_tl_js_1.Api.is("channel", channel)) {
483
- await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_updateOrAddChat).call(this, chatId);
484
- }
485
- }, _ChatListManager_handleUpdateChat = async function _ChatListManager_handleUpdateChat(update) {
486
- const peer = { ...update, _: "peerChat" };
487
- const chat = await __classPrivateFieldGet(this, _ChatListManager_c, "f").getEntity(peer);
488
- const chatId = _2_tl_js_1.Api.peerToChatId(peer);
489
- await __classPrivateFieldGet(this, _ChatListManager_c, "f").storage.setFullChat(chatId, null);
490
- if (chat != null && "left" in chat && chat.left) {
491
- await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_removeChat).call(this, chatId);
492
- }
493
- else if (_2_tl_js_1.Api.is("chatForbidden", chat)) {
494
- await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_removeChat).call(this, chatId);
495
- }
496
- else if (_2_tl_js_1.Api.is("chat", chat)) {
497
- await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_updateOrAddChat).call(this, chatId);
498
- }
499
- }, _ChatListManager_handleUpdateUser = async function _ChatListManager_handleUpdateUser(update) {
500
- const peer = { ...update, _: "peerUser" };
501
- const chat = await __classPrivateFieldGet(this, _ChatListManager_c, "f").getEntity(peer);
502
- const chatId = _2_tl_js_1.Api.peerToChatId(peer);
503
- await __classPrivateFieldGet(this, _ChatListManager_c, "f").storage.setFullChat(chatId, null);
504
- if (chat != null) {
505
- await __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_updateOrAddChat).call(this, chatId);
506
- }
507
- }, _ChatListManager_getFullChat = async function _ChatListManager_getFullChat(chatId) {
508
- const inputPeer = await __classPrivateFieldGet(this, _ChatListManager_c, "f").getInputPeer(chatId);
509
- const chatId_ = await __classPrivateFieldGet(this, _ChatListManager_c, "f").getInputPeerChatId(inputPeer);
510
- let fullChat = await __classPrivateFieldGet(this, _ChatListManager_c, "f").storage.getFullChat(chatId_);
511
- if (fullChat != null) {
512
- return fullChat;
513
- }
514
- if ((0, _0_utilities_js_1.canBeInputUser)(inputPeer)) {
515
- fullChat = (await __classPrivateFieldGet(this, _ChatListManager_c, "f").invoke({ _: "users.getFullUser", id: (0, _0_utilities_js_1.toInputUser)(inputPeer) })).full_user;
516
- }
517
- else if (_2_tl_js_1.Api.is("inputPeerChat", inputPeer)) {
518
- fullChat = (await __classPrivateFieldGet(this, _ChatListManager_c, "f").invoke({ ...inputPeer, _: "messages.getFullChat" })).full_chat;
519
- }
520
- else if ((0, _0_utilities_js_1.canBeInputChannel)(inputPeer)) {
521
- fullChat = (await __classPrivateFieldGet(this, _ChatListManager_c, "f").invoke({ _: "channels.getFullChannel", channel: (0, _0_utilities_js_1.toInputChannel)(inputPeer) })).full_chat;
522
- }
523
- await __classPrivateFieldGet(this, _ChatListManager_c, "f").storage.setFullChat(chatId_, fullChat);
524
- if (fullChat != null && "call" in fullChat && _2_tl_js_1.Api.is("inputGroupCall", fullChat.call)) {
525
- await __classPrivateFieldGet(this, _ChatListManager_c, "f").storage.setGroupCallAccessHash(fullChat.call.id, fullChat.call.access_hash);
526
- }
527
- return fullChat;
528
- }, _ChatListManager_checkChatTitle = function _ChatListManager_checkChatTitle(title) {
529
- title = title.trim();
530
- if (!title) {
531
- throw new _0_errors_js_1.InputError("Title cannot be empty.");
532
- }
533
- return title;
534
- }, _ChatListManager_createChannel = async function _ChatListManager_createChannel(type, title, params) {
535
- title = __classPrivateFieldGet(this, _ChatListManager_instances, "m", _ChatListManager_checkChatTitle).call(this, title);
536
- const updates = await __classPrivateFieldGet(this, _ChatListManager_c, "f").invoke({
537
- _: "channels.createChannel",
538
- broadcast: type == "channel" ? true : undefined,
539
- megagroup: type == "supergroup" ? true : undefined,
540
- forum: params && ("forum" in params) && params.forum ? true : undefined,
541
- title,
542
- about: params?.description || "",
543
- ttl_period: params?.messageTtl || undefined,
544
- });
545
- if (!("chats" in updates) || updates.chats.length < 1) {
546
- (0, _0_deps_js_1.unreachable)();
547
- }
548
- const chat = updates.chats[0];
549
- if (chat._ != "channel") {
550
- (0, _0_deps_js_1.unreachable)();
551
- }
552
- return (0, _3_types_js_1.constructChatP)(chat);
553
- }, _ChatListManager_moveChatsToFolder = async function _ChatListManager_moveChatsToFolder(chatIds, folderId) {
554
- const peers = await Promise.all(chatIds.map((v) => __classPrivateFieldGet(this, _ChatListManager_c, "f").getInputPeer(v)));
555
- const inputFolderPeers = peers.map((v) => ({ _: "inputFolderPeer", peer: v, folder_id: folderId }));
556
- await __classPrivateFieldGet(this, _ChatListManager_c, "f").invoke({ _: "folders.editPeerFolders", folder_peers: inputFolderPeers });
557
- }, _ChatListManager_toggleBusinessBotsPaused = async function _ChatListManager_toggleBusinessBotsPaused(chatId, paused) {
558
- const peer = await __classPrivateFieldGet(this, _ChatListManager_c, "f").getInputPeer(chatId);
559
- if (!(0, _0_utilities_js_1.canBeInputUser)(peer)) {
560
- throw new _0_errors_js_1.InputError("A private chat was expected.");
561
- }
562
- await __classPrivateFieldGet(this, _ChatListManager_c, "f").invoke({ _: "account.toggleConnectedBotPaused", peer, paused });
563
- };