diff --git a/js/app.js b/js/app.js
index 8b1a1569..32fba9dc 100644
--- a/js/app.js
+++ b/js/app.js
@@ -68,12 +68,12 @@ var a;a=i>0?_.invokeApi("channels.getMessages",{channel:l.getChannelInput(i),id:
e.put("partials/mobile/channel_modal.html",'
\n\n
\n\n
\n\n
\n\n
\n\n
\n\n
\n\n
\n \n \n \n \n
\n
\n \n \n \n \n
\n\n
\n\n
\n\n
\n\n
\n\n
\n\n
\n\n
\n\n
\n'),e.put("partials/mobile/chat_create_modal.html",''),e.put("partials/mobile/chat_edit_modal.html",''),e.put("partials/mobile/chat_modal.html",'\n\n
\n\n
\n\n
\n\n
\n
\n
\n
\n \n \n \n \n
\n
\n \n \n \n \n
\n\n
\n\n
\n\n
\n\n
\n'),e.put("partials/mobile/contacts_modal.html",'\n'),e.put("partials/mobile/country_select_modal.html",'\n'),e.put("partials/mobile/dialog.html",'\n\n \n\n \n\n \n\n
\n \n
\n\n
\n\n
\n \n \n \n
\n\n
\n \n \n \n \n
\n\n
\n \n
\n\n
\n \n \n \n :\n \n \n \n \n :\n \n \n \n\n \n
\n
\n\n
\n\n\n'),e.put("partials/mobile/edit_contact_modal.html",''),e.put("partials/mobile/full_gif.html",'\n\n \n\n
\n\n
\n
\n
![]()
\n
\n
![]()
\n\n
\n\n'),e.put("partials/mobile/full_photo.html",''),e.put("partials/mobile/full_video.html",''),e.put("partials/mobile/game_modal.html",'\n'),
e.put("partials/mobile/head.html",'\n
\n
\n\n\n
\n\n
\n\n
\n \n \n\n \n\n \n\n
\n
\n
\n'),e.put("partials/mobile/im.html",'\n\n\n\n
\n\n
\n\n
\n\n
\n \n
\n\n
\n
\n\n
\n\n
\n\n
\n
\n
\n \n \n \n \n
\n\n
\n\n
\n\n
\n\n
\n\n
\n\n
\n
\n\n
\n\n
\n\n
\n\n\n'),e.put("partials/mobile/import_contact_modal.html",''),e.put("partials/mobile/login.html",'\n\n\n\n\n'),e.put("partials/mobile/message.html",'\n\n\n
\n\n
\n\n
\n\n
\n\n
\n\n
\n
\n\n
\n
\n
\n\n
\n\n \n\n
\n
\n
\n\n
\n\n
\n\n
\n\n
\n
\n\n
\n\n'),
e.put("partials/mobile/message_actions_modal.html",'\n\n
\n \n \n \n \n \n \n \n
\n\n
\n'),e.put("partials/mobile/message_attach_contact.html",''),e.put("partials/mobile/message_attach_document.html",'\n\n
\n \n
\n\n
\n\n
\n\n
\n\n
\n\n
\n
\n\n'),e.put("partials/mobile/message_attach_geo.html",'\n
\n'),e.put("partials/mobile/message_attach_pending.html",'\n'),e.put("partials/mobile/message_attach_photo.html",'\n\n
\n\n'),e.put("partials/mobile/message_attach_venue.html",'\n'),e.put("partials/mobile/message_attach_webpage.html",'\n
\n
\n
\n
\n
\n
\n \n
\n
\n
\n
\n
\n
\n \n \n
\n \n
\n\n
\n
\n
\n
\n \n
\n
\n
\n
\n'),e.put("partials/mobile/message_service.html",'\n \n \n \n «»\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n «»\n \n \n \n\n \n \n \n \n \n \n\n \n \n \n\n \n \n \n \n \n \n \n \n \n\n \n\n \n\n \n \n \n\n'),e.put("partials/mobile/password_recovery_modal.html",''),e.put("partials/mobile/password_update_modal.html",''),e.put("partials/mobile/peer_select.html",'\n'),e.put("partials/mobile/phonebook_modal.html",'\n'),e.put("partials/mobile/photo_modal.html",'\n\n\n\n\n\n'),e.put("partials/mobile/profile_edit_modal.html",''),
-e.put("partials/mobile/send_form.html",'\n'),e.put("partials/mobile/sessions_list_modal.html",'\n\n
\n\n
\n\n
\n\n
\n
\n\n
\n \n \n \n
\n\n
\n\n
\n
\n\n
\n\n
\n\n
\n'),e.put("partials/mobile/settings_modal.html",'\n\n
\n\n
\n\n
\n\n
\n \n \n \n \n \n \n \n \n
\n\n
\n\n
\n\n
\n\n
\n\n
\n\n
\n\n\n
\n\n
\n\n
\n\n
\n\n
\n\n
\n\n
\n
\n'),e.put("partials/mobile/stickerset_modal.html",'\n\n
\n\n
\n\n
\n\n
\n
\n\n
\n \n \n \n
\n\n
\n\n
\n
\n\n
\n\n
\n\n
'),e.put("partials/mobile/user_modal.html",'\n\n
\n\n
\n\n
\n\n
\n\n
\n\n
\n\n
\n\n
\n\n
\n\n
\n\n
\n\n\n
\n\n
\n\n
\n\n
\n'),e.put("partials/mobile/username_edit_modal.html",'\n\n
\n\n
\n\n
\n\n
\n\n
'),e.put("partials/mobile/video_modal.html",'\n\n\n\n\n\n'),e.put("partials/desktop/audio_player.html",''),e.put("partials/desktop/changelog_modal.html",'\n\n
\n
\n\n
\n
\n
\n
Telegram Web
\n
\n \n
\n
\n
\n
\n\n
\n\n
\n\n
'),
+e.put("partials/mobile/send_form.html",'\n'),e.put("partials/mobile/sessions_list_modal.html",'\n\n
\n\n
\n\n
\n\n
\n
\n\n
\n \n \n \n
\n\n
\n\n
\n
\n\n
\n\n
\n\n
\n'),e.put("partials/mobile/settings_modal.html",'\n\n
\n\n
\n\n
\n\n
\n \n \n \n \n \n \n \n \n
\n\n
\n\n
\n\n
\n\n
\n\n
\n\n
\n\n\n
\n\n
\n\n
\n\n
\n\n
\n\n
\n\n
\n
\n'),e.put("partials/mobile/stickerset_modal.html",'\n\n
\n\n
\n\n
\n\n
\n
\n\n
\n \n \n \n
\n\n
\n\n
\n
\n\n
\n\n
\n\n
'),e.put("partials/mobile/user_modal.html",'\n\n
\n\n
\n\n
\n\n
\n\n
\n\n
\n\n
\n\n
\n\n
\n\n
\n\n
\n\n\n
\n\n
\n\n
\n\n
\n'),e.put("partials/mobile/username_edit_modal.html",'\n\n
\n\n
\n\n
\n\n
\n\n
'),e.put("partials/mobile/video_modal.html",'\n\n\n\n\n\n'),e.put("partials/desktop/audio_player.html",''),e.put("partials/desktop/changelog_modal.html",'\n\n
\n
\n\n
\n
\n
\n
Telegram Web
\n
\n \n
\n
\n
\n
\n\n
\n\n
\n\n
'),
e.put("partials/desktop/channel_edit_modal.html",''),e.put("partials/desktop/channel_modal.html",'\n\n
\n\n
\n\n
\n\n
\n\n
\n\n
\n\n
\n\n
\n\n
\n\n
\n\n
\n
\n\n\n
\n'),e.put("partials/desktop/chat_create_modal.html",'\n\n
\n\n
\n\n
\n\n \n\n
'),e.put("partials/desktop/chat_edit_modal.html",'\n\n
\n\n
\n\n
\n\n \n\n
'),e.put("partials/desktop/chat_invite_link_modal.html",''),e.put("partials/desktop/chat_modal.html",'\n\n
\n\n
\n\n
\n\n
\n\n
\n\n
\n\n
\n\n
\n\n
\n\n
\n\n
\n
\n\n\n
\n'),e.put("partials/desktop/composer_dropdown.html",''),e.put("partials/desktop/confirm_modal.html",'\n\n
\n\n
\n
\n
\n
\n
\n
\n
\n
\n\n
\n \n \n \n
\n
\n
\n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n
\n
\n
\n
\n
\n
\n
\n
\n \n
\n
\n \n
\n
\n
\n
\n
\n
\n
\n
\n \n
\n
\n
\n
\n
\n
\n\n\n\n\n
\n \n \n \n
\n\n
\n\n \n\n
\n'),e.put("partials/desktop/contacts_modal.html",'\n'),
-e.put("partials/desktop/country_select_modal.html",'\n'),e.put("partials/desktop/dialog.html",'\n\n \n\n \n \n \n\n \n\n
\n \n
\n\n
\n\n
\n \n \n \n
\n\n
\n \n \n \n \n
\n\n
\n \n
\n\n
\n \n \n \n :\n \n \n \n \n :\n \n \n \n\n \n
\n
\n\n
\n\n\n'),e.put("partials/desktop/document_modal.html",'\n\n\n\n'),e.put("partials/desktop/edit_contact_modal.html",''),e.put("partials/desktop/embed_modal.html",'\n\n\n\n'),e.put("partials/desktop/emoji_btn_tooltip.html",''),e.put("partials/desktop/error_modal.html",'\n\n
\n\n \n \n\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n {0}\n \n\n
\n
\n
\n
\n
\n
\n
\n {0}\n \n
\n
\n \n \n
\n \n {0}\n \n \n\n
\n\n
\n \n \n\n\n\n
\n
\n
\n {0}\n \n
\n
\n
\n
\n
\n\n
\n\n
\n
\n
\n
\n\n
\n\n
\n\n \n\n
\n'),e.put("partials/desktop/footer.html",''),e.put("partials/desktop/forwarded_messages.html",'\n
\n
\n
![]()
\n
\n
\n \n
\n
\n
\n \n
\n
\n \n \n \n \n
\n
\n
'),e.put("partials/desktop/full_document.html",'\n
\n
\n
\n
![]()
\n
\n
\n
\n
![]()
\n
\n
'),e.put("partials/desktop/full_gif.html",'\n\n \n\n
\n\n
\n
\n
![]()
\n
\n
![]()
\n\n
\n\n'),e.put("partials/desktop/full_photo.html",''),e.put("partials/desktop/full_round.html",'\n\n \n\n
\n\n
\n
\n
![]()
\n
\n
![]()
\n\n
\n\n'),e.put("partials/desktop/full_video.html",''),e.put("partials/desktop/game_modal.html",'\n\n\n\n'),e.put("partials/desktop/head.html",'\n'),
+e.put("partials/desktop/country_select_modal.html",'\n'),e.put("partials/desktop/dialog.html",'\n\n \n\n \n \n \n\n \n\n
\n \n
\n\n
\n\n
\n \n \n \n
\n\n
\n \n \n \n \n
\n\n
\n \n
\n\n
\n \n \n \n :\n \n \n \n \n :\n \n \n \n\n \n
\n
\n\n
\n\n\n'),e.put("partials/desktop/document_modal.html",'\n\n\n\n'),e.put("partials/desktop/edit_contact_modal.html",''),e.put("partials/desktop/embed_modal.html",'\n\n\n\n'),e.put("partials/desktop/emoji_btn_tooltip.html",''),e.put("partials/desktop/error_modal.html",'\n\n
\n\n \n \n\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n {0}\n \n\n
\n
\n
\n
\n
\n
\n
\n {0}\n \n
\n
\n \n \n
\n \n {0}\n \n \n\n
\n\n
\n \n \n\n\n\n
\n
\n
\n {0}\n \n
\n
\n
\n
\n
\n\n
\n\n
\n
\n
\n
\n\n
\n\n
\n\n \n\n
\n'),e.put("partials/desktop/footer.html",''),e.put("partials/desktop/forwarded_messages.html",'\n
\n
\n
![]()
\n
\n
\n \n
\n
\n
\n \n
\n
\n \n \n \n \n
\n
\n
'),e.put("partials/desktop/full_document.html",'\n
\n
\n
\n
![]()
\n
\n
\n
\n
![]()
\n
\n
'),e.put("partials/desktop/full_gif.html",'\n\n \n\n
\n\n
\n
\n
![]()
\n
\n
![]()
\n\n
\n\n'),e.put("partials/desktop/full_photo.html",''),e.put("partials/desktop/full_round.html",'\n\n \n\n
\n\n
\n
\n
![]()
\n
\n
![]()
\n\n
\n\n'),e.put("partials/desktop/full_video.html",''),e.put("partials/desktop/game_modal.html",'\n\n\n\n'),e.put("partials/desktop/head.html",'\n'),
e.put("partials/desktop/im.html",'\n\n\n\n
\n\n
\n
\n\n
\n
\n
\n\n
\n\n
\n\n
\n\n
\n\n
\n\n
\n
\n
\n
\n\n
\n\n
\n\n
\n\n
\n
\n
\n\n
\n\n
\n\n
\n
\n\n
\n\n
\n
\n
\n
\n
\n
\n
\n
\n
{{historyState.typing.length - 2}}\n
\n
\n
\n\n
\n\n
\n\n
\n\n
\n\n
\n
\n\n
\n\n
\n\n
\n\n\n\n\n'),e.put("partials/desktop/import_contact_modal.html",''),e.put("partials/desktop/inactive.html",''),e.put("partials/desktop/inline_results.html",'\n\n'),e.put("partials/desktop/lang_footer.html",''),e.put("partials/desktop/login.html",'\n
\n
\n
\n\n
\n\n
\n \n \n\n
\n
\n\n
\n\n'),
-e.put("partials/desktop/media_modal_layout.html",''),e.put("partials/desktop/megagroup_edit_modal.html",''),e.put("partials/desktop/message.html",' \n\n
\n\n
\n\n
\n
\n\n
\n \n \n
\n\n
\n\n
\n\n
\n\n
\n [] :\n \n\n\n
\n\n
\n\n
\n\n\n
\n\n
\n
\n\n
\n\n'),e.put("partials/desktop/message_attach_contact.html",''),e.put("partials/desktop/message_attach_document.html",'\n\n
\n\n
\n\n
\n\n
\n\n
\n\n
\n\n
\n
\n\n'),e.put("partials/desktop/message_attach_game.html",'\n
\n
\n
\n
\n
\n
\n
\n \n
\n
\n
\n'),e.put("partials/desktop/message_attach_geo.html",'\n
\n'),e.put("partials/desktop/message_attach_pending.html",'\n'),e.put("partials/desktop/message_attach_photo.html",'\n
\n\n'),e.put("partials/desktop/message_attach_venue.html",'\n'),e.put("partials/desktop/message_attach_webpage.html",'\n
\n
\n
\n
\n
\n \n
\n
\n
\n
\n
\n
\n \n \n
\n \n
\n\n
\n\n
\n\n
\n
\n
\n \n
\n
\n
\n
\n
\n'),e.put("partials/desktop/message_media.html",'\n
\n
\n
\n
\n
\n
\n
\n
\n\n
\n\n
\n
'),e.put("partials/desktop/message_service.html",'\n \n \n \n «»\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n «»\n \n \n \n\n \n \n \n \n \n \n\n \n \n \n\n \n \n \n \n \n \n \n\n \n\n \n\n \n \n\n \n \n \n\n'),e.put("partials/desktop/password_recovery_modal.html",'\n\n
\n\n
\n\n
\n\n \n\n
'),e.put("partials/desktop/password_update_modal.html",''),e.put("partials/desktop/peer_pinned_message_bar.html",''),e.put("partials/desktop/peer_select.html",'\n'),
-e.put("partials/desktop/photo_modal.html",'\n\n\n\n\n\n\n\n'),e.put("partials/desktop/pinned_message.html",''),e.put("partials/desktop/profile_edit_modal.html",'\n'),e.put("partials/desktop/reply_markup.html",''),e.put("partials/desktop/reply_message.html",'\n
\n
\n \n
\n
\n
![]()
\n
\n
\n > \n \n \n
\n
\n > \n \n
\n
'),e.put("partials/desktop/report_msgs_modal.html",'\n\n
\n\n
\n\n
\n\n \n\n
'),e.put("partials/desktop/send_form.html",'\n'),e.put("partials/desktop/sessions_list_modal.html",'\n\n
\n\n
\n\n
\n\n
\n
\n\n
\n \n \n \n
\n\n
\n\n
\n
\n\n
\n\n
\n\n
\n'),e.put("partials/desktop/settings_modal.html",'\n\n
\n\n
\n\n
\n\n
\n\n
\n\n
\n\n
\n\n
\n
\n\n
\n\n
\n
\n \n
\n \n \n \n \n
\n\n
\n
\n
\n\n
\n \n \n \n\n \n\n
\n\n
\n\n
\n\n
\n\n
\n\n
\n'),e.put("partials/desktop/short_message.html",'\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n\n'),e.put("partials/desktop/slider.html",''),e.put("partials/desktop/stickerset_modal.html",'\n\n
\n\n
\n\n
\n\n
\n
\n\n
\n \n \n \n
\n\n
\n\n
\n
\n\n
\n\n
\n\n
\n\n
\n'),
+e.put("partials/desktop/media_modal_layout.html",''),e.put("partials/desktop/megagroup_edit_modal.html",''),e.put("partials/desktop/message.html",' \n\n
\n\n
\n\n
\n
\n\n
\n \n \n
\n\n
\n\n
\n\n
\n\n
\n [] :\n \n\n\n
\n\n
\n\n
\n\n\n
\n\n
\n
\n\n
\n\n'),e.put("partials/desktop/message_attach_contact.html",''),e.put("partials/desktop/message_attach_document.html",'\n\n
\n\n
\n\n
\n\n
\n\n
\n\n
\n\n
\n
\n\n'),e.put("partials/desktop/message_attach_game.html",'\n
\n
\n
\n
\n
\n
\n
\n \n
\n
\n
\n'),e.put("partials/desktop/message_attach_geo.html",'\n
\n'),e.put("partials/desktop/message_attach_pending.html",'\n'),e.put("partials/desktop/message_attach_photo.html",'\n
\n\n'),e.put("partials/desktop/message_attach_venue.html",'\n'),e.put("partials/desktop/message_attach_webpage.html",'\n
\n
\n
\n
\n
\n \n
\n
\n
\n
\n
\n
\n \n \n
\n \n
\n\n
\n\n
\n\n
\n
\n
\n \n
\n
\n
\n
\n
\n'),e.put("partials/desktop/message_media.html",'\n
\n
\n
\n
\n
\n
\n
\n
\n\n
\n\n
\n
'),e.put("partials/desktop/message_service.html",'\n \n \n \n «»\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n «»\n \n \n \n\n \n \n \n \n \n \n\n \n \n \n\n \n \n \n \n \n \n \n\n \n\n \n\n \n \n\n \n \n \n\n'),e.put("partials/desktop/password_recovery_modal.html",'\n\n
\n\n
\n\n
\n\n \n\n
'),e.put("partials/desktop/password_update_modal.html",''),e.put("partials/desktop/peer_pinned_message_bar.html",''),e.put("partials/desktop/peer_select.html",'\n'),
+e.put("partials/desktop/photo_modal.html",'\n\n\n\n\n\n\n\n'),e.put("partials/desktop/pinned_message.html",''),e.put("partials/desktop/profile_edit_modal.html",'\n'),e.put("partials/desktop/reply_markup.html",''),e.put("partials/desktop/reply_message.html",'\n
\n
\n \n
\n
\n
![]()
\n
\n
\n > \n \n \n
\n
\n > \n \n
\n
'),e.put("partials/desktop/report_msgs_modal.html",'\n\n
\n\n
\n\n
\n\n \n\n
'),e.put("partials/desktop/send_form.html",'\n'),e.put("partials/desktop/sessions_list_modal.html",'\n\n
\n\n
\n\n
\n\n
\n
\n\n
\n \n \n \n
\n\n
\n\n
\n
\n\n
\n\n
\n\n
\n'),e.put("partials/desktop/settings_modal.html",'\n\n
\n\n
\n\n
\n\n
\n\n
\n\n
\n\n
\n\n
\n
\n\n
\n\n
\n
\n \n
\n \n \n \n \n
\n\n
\n
\n
\n\n
\n \n \n \n\n \n\n
\n\n
\n\n
\n\n
\n\n
\n\n
\n'),e.put("partials/desktop/short_message.html",'\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n\n'),e.put("partials/desktop/slider.html",''),e.put("partials/desktop/stickerset_modal.html",'\n\n
\n\n
\n\n
\n\n
\n
\n\n
\n \n \n \n
\n\n
\n\n
\n
\n\n
\n\n
\n\n
\n\n
\n'),
e.put("partials/desktop/user_modal.html",'\n\n
\n\n
\n\n\n
\n\n
\n\n
\n\n
\n\n
\n
\n\n
\n\n
\n\n
\n\n
\n\n
\n\n
\n\n\n
\n\n
\n\n
\n\n
\n\n
\n\n
\n\n
\n\n
\n\n'),e.put("partials/desktop/username_edit_modal.html",'\n\n
\n\n
\n\n
\n\n \n\n
'),e.put("partials/desktop/video_modal.html",'\n\n\n\n')}]),function(e,t,n,i){function a(e){ConfigStorage.get("emojis_popular",function(t){var n=[];if(t&&t.length){for(var i=0,a=t.length;i41&&(a=a.slice(0,41)),a.push([e,1])),ConfigStorage.set({emojis_popular:a})})}function o(){if(b===!1){b=SearchIndexManager.createIndex();var e;for(e in _)_.hasOwnProperty(e)&&SearchIndexManager.indexObject(_[e],e,b)}}function s(e){o();var t,n=SearchIndexManager.search(e,b),i=[];for(t in n)n.hasOwnProperty(t)&&i.push(t);return i}var l,c,d,u,p,f,m,h,g={},_={},v={},y={},b=!1,w="joy,kissing_heart,heart,heart_eyes,blush,grin,+1,relaxed,pensive,smile,sob,kiss,unamused,flushed,stuck_out_tongue_winking_eye,see_no_evil,wink,smiley,cry,stuck_out_tongue_closed_eyes,scream,rage,smirk,disappointed,sweat_smile,kissing_closed_eyes,speak_no_evil,relieved,grinning,yum,laughing,ok_hand,neutral_face,confused".split(",");for(l=0,m=n.length;l '+this.langpack.im_stickers_tab+'
';e=e.replace(/>\s+<");var t=this;this.tooltipEl=$(e).appendTo(document.body),this.tabsEl=$(".composer_emoji_tooltip_tabs",this.tooltipEl),this.categoriesEl=$(".composer_emoji_tooltip_categories",this.tooltipEl),this.stickersCategoriesEl=$(".composer_emoji_tooltip_tab_stickers_content .composer_emoji_tooltip_categories",this.tooltipEl),this.contentEl=$(".composer_emoji_tooltip_content",this.tooltipEl),this.emojiContentEl=$(".composer_emoji_tooltip_content_emoji",this.tooltipEl),this.stickersContentEl=$(".composer_emoji_tooltip_content_stickers",this.tooltipEl),angular.forEach(["emoji","stickers"],function(e,n){var i=$(".composer_emoji_tooltip_tab_"+e,t.tabsEl).on("mousedown",function(e){return t.selectTab(n),cancelEvent(e)});Config.Navigator.touch||i.on("mouseenter mouseleave",function(e){clearTimeout(t.selectTabTimeout),"mouseenter"==e.type&&(t.selectTabTimeout=setTimeout(function(){t.selectTab(n)},300))})});var n="mousedown";return Config.Navigator.touch||(n+=" mouseover mouseout"),this.categoriesEl.on(n,function(e){e=e.originalEvent||e;var n=e.target;if("A"!=n.tagName&&(n=n.parentNode),"A"==n.tagName){var i=parseInt(n.getAttribute("data-category"));if("mousedown"==e.type)return t.selectCategory(i),cancelEvent(e);if(!t.tab){var a="mouseover"==e.type;a&&t.selectCategoryIndex==i||(clearTimeout(t.selectCategoryTimeout),delete t.selectCategoryTimeout,a?(t.selectCategoryIndex=i,t.selectCategoryTimeout=setTimeout(function(){delete t.selectCategoryIndex,delete t.selectCategoryTimeout,t.selectCategory(i)},300)):delete t.selectCategoryIndex)}}}),this.emojiScroller=new Scroller(this.emojiContentEl,{classPrefix:"composer_emoji_tooltip"}),this.stickersScroller=new Scroller(this.stickersContentEl,{classPrefix:"composer_emoji_tooltip"}),this.stickersScroller.onScroll(function(e,n){t.onStickersScroll(e,n)}),this.contentEl.on("mousedown",function(e){e=e.originalEvent||e;var n,i,a,r=$(e.target);return"A"!=r[0].tagName&&(r=$(r[0].parentNode)),(n=r.attr("data-code"))&&(t.onEmojiSelected&&t.onEmojiSelected(n),EmojiHelper.pushPopularEmoji(n)),(i=r.attr("data-sticker"))&&(t.onStickerSelected&&t.onStickerSelected(i),Config.Mobile&&t.hide()),(a=r.attr("data-stickerset"))&&(t.onStickersetSelected&&t.onStickersetSelected(a),t.hide()),cancelEvent(e)}),Config.Navigator.touch||this.tooltipEl.on("mouseenter mouseleave",function(e){"mouseenter"==e.type?t.onMouseEnter():t.onMouseLeave()}),this.selectTab(0),$(window).on("resize",this.updatePosition.bind(this)),!0},EmojiTooltip.prototype.selectCategory=function(e,t){return!(!this.tab&&this.cat===e&&!t)&&($(".active",this.categoriesEl).removeClass("active"),this.cat=e,void(this.tab?(this.activateStickerCategory(),this.updateStickersContents(t)):($(this.categoriesEl[this.tab].childNodes[e]).addClass("active"),this.updateEmojiContents())))},EmojiTooltip.prototype.selectTab=function(e,t){if(this.tab===e&&!t)return!1;this.tab=e,this.selectCategory(0,!0);var n=this;setTimeout(function(){$(n.tooltipEl).toggleClass("composer_emoji_tooltip_tabs_stickers_active",1==e)},0)},EmojiTooltip.prototype.updateEmojiContents=function(){var e=[],t=this,n=26,i=function(){t.emojiContentEl.html(e.join("")),t.emojiScroller.reinit()};if(this.cat>0){var a,r,o,s,l,c=this.cat-1,d=Config.EmojiCategories[c],u=Config.EmojiCategorySpritesheetDimens[c][1],p=d.length;for(o=0;o
');i()}else EmojiHelper.getPopularEmoji(function(t){var a,r,o,s,l,c,d,u,p=t.length;for(c=0;c'));i()})},EmojiTooltip.prototype.updateStickersContents=function(e){var t=[],n=[],i=this,a=function(){var t=i.cat?i.stickersetPositions[i.cat][0]:0;i.stickersScroller.scrollTo(t,e?0:200)};if(!e&&i.stickersetPositions.length)return void a();var r=function(e){var r,o,s,l,c,d;for(s=0,c=e.length;s'),r.title&&t.push('',encodeEntities(r.title),""),r.id?n.push(''):n.push(''),l=0,d=r.docIDs.length;l');t.push("")}i.stickersContentEl.html(t.join("")),i.stickersCategoriesEl.html(n.join("")),i.stickersScroller.reinit();var u=[];$(".composer_stickerset_wrap",i.stickersContentEl).each(function(e,t){var n=t.offsetHeight,i=t.offsetTop;u.push([i,n])}),i.stickersetPositions=u,a();var p=[];i.contentEl.find(".composer_sticker_btn").each(function(e,t){e<12?i.replaceStickerImage(t):p.push([t.offsetTop,t])}),i.stickersPreload=p,i.stickersCategoriesEl.find(".composer_sticker_btn").each(function(e,t){i.replaceStickerImage(t)})};this.getStickers(r)},EmojiTooltip.prototype.replaceStickerImage=function(e){e=$(e),this.getStickerImage(e,e.attr("data-sticker"))},EmojiTooltip.prototype.onStickersScroll=function(e,t){var n,i,a=e.clientHeight,r=e.scrollHeight,o=this.stickersetPositions.length,s=!1;if(t<20)s=0;else if(t>r-a-20)s=o-1;else for(i=0;i=n[0]&&t=t&&n[0]<=t+a&&(this.replaceStickerImage(n[1]),this.stickersPreload.splice(i,1),i--,o--);this.cat!==s&&s!==!1&&($(".active",this.categoriesEl).removeClass("active"),this.cat=s,this.activateStickerCategory())},EmojiTooltip.prototype.onStickersChanged=function(){this.tab&&this.updateStickersContents(!0)},EmojiTooltip.prototype.activateStickerCategory=function(){var e=this.categoriesEl[1],t=e.childNodes[this.cat];if(t){$(t).addClass("active");var n=t.offsetLeft,i=t.offsetWidth,a=e.clientWidth;$(e).stop(!0).animate({scrollLeft:n-(a-i)/2},200)}},EmojiTooltip.prototype.updatePosition=function(){var e=this.btnEl.offset();this.tooltipEl.css({top:e.top,left:e.left})},EmojiTooltip.prototype.show=function(){this.updatePosition(),this.tab?this.updateStickersContents(!0):this.updateEmojiContents(),this.tooltipEl.addClass("composer_emoji_tooltip_shown"),this.btnEl.addClass("composer_emoji_insert_btn_on"),delete this.showTimeout,this.shown=!0},EmojiTooltip.prototype.hide=function(){this.tooltipEl&&(this.tooltipEl.removeClass("composer_emoji_tooltip_shown"),this.btnEl.removeClass("composer_emoji_insert_btn_on")),delete this.hideTimeout,delete this.shown},EmojiPanel.prototype.update=function(){var e=[],t=this,n=Config.Mobile?26:20;EmojiHelper.getPopularEmoji(function(i){var a,r,o,s,l,c,d,u,p=i.length;for(c=0;c'));t.containerEl.html(e.join(""))})},MessageComposer.autoCompleteRegEx=/(\s|^)(:|@|\/)([\S]*)$/,MessageComposer.prototype.setUpInput=function(){if(this.inlinePlaceholderWrap=$('
').prependTo(this.textareaEl[0].parentNode),this.inlinePlaceholderPrefixEl=$('').appendTo(this.inlinePlaceholderWrap),this.inlinePlaceholderEl=$('').appendTo(this.inlinePlaceholderWrap),"contentEditable"in document.body?this.setUpRich():this.setUpPlaintext(),!Config.Mobile){var e=getScrollWidth();e&&(this.richTextareaEl||this.textareaEl).css({left:-e,width:"calc(100% + "+2*e+"px)","padding-left":e+2,"padding-right":e+28})}},MessageComposer.prototype.setInlinePlaceholder=function(e,t){this.inlinePlaceholderPrefix=e,this.inlinePlaceholderPrefixEl.html(encodeEntities(e)),this.inlinePlaceholderEl.html(encodeEntities(t)),this.onChange()},MessageComposer.prototype.updateInlinePlaceholder=function(){var e=this.inlinePlaceholderPrefix;if(e){var t=this.textareaEl.val();this.inlinePlaceholderWrap.toggleClass("active",t==e)}},MessageComposer.prototype.setUpAutoComplete=function(){this.scroller=new Scroller(this.autoCompleteEl,{maxHeight:180});var e=this;this.autoCompleteEl.on("mousedown",function(t){t=t.originalEvent||t;for(var n,i,a,r,o=t.target;o&&"A"!=o.tagName;)o=o.parentNode;return o?(o=$(o),(i=o.attr("data-code"))&&(e.onEmojiSelected&&e.onEmojiSelected(i,!0),EmojiHelper.pushPopularEmoji(i)),n=t.altKey||!o.attr("data-username")?o.attr("data-user-id"):o.attr("data-username"),n&&e.onMentionSelected(n,o.attr("data-name")),(a=o.attr("data-command"))&&(e.onCommandSelected&&e.onCommandSelected(a),e.hideSuggestions()),(r=o.attr("data-inlineid"))&&(e.onInlineResultSend&&e.onInlineResultSend(r),e.hideSuggestions()),cancelEvent(t)):cancelEvent(t)})},MessageComposer.prototype.setUpRich=function(){this.textareaEl.hide(),this.richTextareaEl=$(''),this.textareaEl[0].parentNode.insertBefore(this.richTextareaEl[0],this.textareaEl[0]),this.richTextareaEl.on("keyup keydown",this.onKeyEvent.bind(this)),this.richTextareaEl.on("focus blur",this.onFocusBlur.bind(this)),this.richTextareaEl.on("paste",this.onRichPaste.bind(this)),this.richTextareaEl.on("DOMNodeInserted",this.onRichPasteNode.bind(this)),$(document.body).on("keydown",this.backupSelection.bind(this))},MessageComposer.prototype.setUpPlaintext=function(){this.textareaEl.on("keyup keydown",this.onKeyEvent.bind(this)),this.textareaEl.on("focus blur",this.onFocusBlur.bind(this))},MessageComposer.prototype.onKeyEvent=function(e){var t=this;if("keyup"==e.type){this.checkAutocomplete();var n=!1;if(this.richTextareaEl){clearTimeout(this.updateValueTO);var i=tsNow();void 0===this.keyupStarted&&(this.keyupStarted=i),i-this.keyupStarted>3e3,this.onChange()}if(this.onTyping){var i=tsNow();i-this.lastTyping>5e3&&(n===!1&&(n=(this.richTextareaEl?this.richTextareaEl[0].textContent:this.textareaEl[0].value).length),n!=this.lastLength&&(this.lastTyping=i,this.lastLength=n,this.onTyping()))}}if("keydown"==e.type){var a=!this.autocompleteShown;if(this.autocompleteShown){if(38==e.keyCode||40==e.keyCode){var r,o=40==e.keyCode,s=$(this.autoCompleteEl).find("li.composer_autocomplete_option_active"),l=Array.prototype.slice.call($(this.autoCompleteEl).find("li"));if(s.length){var c=l.indexOf(s[0]),d=c+(o?1:-1);if(r=l[d],s.removeClass("composer_autocomplete_option_active"),r)return $(r).addClass("composer_autocomplete_option_active"),this.scroller.scrollToNode(r),cancelEvent(e)}return r=l[o?0:l.length-1],this.scroller.scrollToNode(r),$(r).addClass("composer_autocomplete_option_active"),cancelEvent(e)}if(13==e.keyCode||9==e.keyCode){var s=$(this.autoCompleteEl).find("li.composer_autocomplete_option_active");s.length||9!=e.keyCode||(s=$(this.autoCompleteEl).find("li:first")),s=s.find("a:first");var u,p,f,m;if(u=s.attr("data-code"))return this.onEmojiSelected(u,!0),EmojiHelper.pushPopularEmoji(u),cancelEvent(e);if(p=e.altKey||!s.attr("data-username")?s.attr("data-user-id"):s.attr("data-username"))return this.onMentionSelected(p,s.attr("data-name")),cancelEvent(e);if(f=s.attr("data-command"))return this.onCommandSelected&&this.onCommandSelected(f,9==e.keyCode),cancelEvent(e);if(m=s.attr("data-inlineid"))return t.onInlineResultSend&&t.onInlineResultSend(m),t.hideSuggestions(),cancelEvent(e);a=!0}}if(a&&13==e.keyCode){var h=!1,g=!0;if(this.getSendOnEnter&&!this.getSendOnEnter()&&(g=!1),g&&!e.shiftKey?h=!0:g||!e.ctrlKey&&!e.metaKey||(h=!0),h)return this.onMessageSubmit(e),cancelEvent(e)}if([33,34,35,36,38,39].indexOf(e.keyCode)!=-1&&!e.shiftKey&&!e.altKey&&!e.ctrlKey&&!e.metaKey&&this.richTextareaEl&&!this.richTextareaEl[0].textContent.length)return this.onDirectionKey(e)}},MessageComposer.prototype.backupSelection=function(){if(delete this.selection,this.isActive)if(window.getSelection){var e=window.getSelection();e.getRangeAt&&e.rangeCount&&(this.selection=e.getRangeAt(0))}else document.selection&&document.selection.createRange&&(this.selection=document.selection.createRange())},MessageComposer.prototype.restoreSelection=function(){if(!this.selection)return!1;var e=!1;if(window.getSelection){var t=window.getSelection();t.removeAllRanges(),t.addRange(this.selection),e=!0}else document.selection&&this.selection.select&&(this.selection.select(),e=!0);return delete this.selection,e},MessageComposer.prototype.checkAutocomplete=function(e){var t,n;if(this.richTextareaEl){var i=this.richTextareaEl[0],a=getRichValueWithCaret(i),n=a[0],t=a[1]>=0?a[1]:n.length;t||this.cleanRichTextarea(n,!0)}else var i=this.textareaEl[0],t=getFieldSelection(i),n=i.value;if(n&&this.curInlineResults&&this.curInlineResults.text==n)return void this.showInlineSuggestions(this.curInlineResults);e||(n=n.substr(0,t));var r=n.match(MessageComposer.autoCompleteRegEx);if(r){if(this.previousQuery==r[0])return;this.previousQuery=r[0];var o=SearchIndexManager.cleanSearchText(r[3]);if("@"==r[2])if(this.mentions&&this.mentions.index){if(o.length)for(var s,l=SearchIndexManager.search(o,this.mentions.index),c=[],d=0,u=this.mentions.users.length;d=0)||(a.push(n),t.splice(i,1),t.length));r++);this.showEmojiSuggestions(a.concat(t))}else this.hideSuggestions()}else this.showEmojiSuggestions(e)}.bind(this))}}else if(this.commands&&this.commands.index){if(o.length)for(var p,l=SearchIndexManager.search(o,this.commands.index),f=[],d=0,u=this.commands.list.length;d0&&(this.richTextareaEl.html(""),this.lastLength=0,this.wasEmpty=!0,t))){var n=this;setZeroTimeout(function(){n.focus()})}},MessageComposer.prototype.onRichPasteNode=function(e){var t=(e.originalEvent||e).target,n=(t||{}).src||"",i=!1;if("data:"==n.substr(0,5)){i=!0;var a=dataUrlToBlob(n);this.onFilePaste(a),setZeroTimeout(function(){t.parentNode.replaceChild(document.createTextNode(" Â "),t)})}else if(n&&!n.match(/img\/blank\.gif/)){var r=document.createTextNode(" "+n+" ");setTimeout(function(){t.parentNode.replaceChild(r,t)},100)}},MessageComposer.prototype.onEmojiSelected=function(e,t){if(this.richTextareaEl){var n=this.richTextareaEl[0];if(this.isActive||this.restoreSelection()||setRichFocus(n),t){var i,a=getRichValueWithCaret(n),r=a[0],o=a[1]>=0?a[1]:r.length,s=r.substr(o),l=r.substr(0,o),c=l.match(/:([\S]*)$/),d=EmojiHelper.emojis[e];i=c&&c[0]?l.substr(0,c.index)+":"+d[1]+":":l+":"+d[1]+":",n.value=g;var u;s.length?(this.selId=(this.selId||0)+1,u=this.getRichHtml(i)+' '+this.getRichHtml(s),this.richTextareaEl.html(u),setRichFocus(n,$("#composer_sel"+this.selId)[0])):(u=this.getRichHtml(i)+" ",this.richTextareaEl.html(u),setRichFocus(n))}else{var u=this.getEmojiHtml(e);if(window.getSelection){var p=window.getSelection();if(p.getRangeAt&&p.rangeCount){var f=document.createElement("div");f.innerHTML=u;var m=f.firstChild,h=p.getRangeAt(0);h.deleteContents(),h.insertNode(document.createTextNode(" ")),h.insertNode(m),h.setStart(m,0),setTimeout(function(){h=document.createRange(),h.setStartAfter(m),h.collapse(!0),p.removeAllRanges(),p.addRange(h)},0)}}else document.selection&&"Control"!=document.selection.type&&document.selection.createRange().pasteHTML(u)}}else{var n=this.textareaEl[0],r=n.value,o=this.isActive?getFieldSelection(n):r.length,s=r.substr(o),l=r.substr(0,o),c=t&&l.match(/:([\S]*)$/),d=EmojiHelper.emojis[e];if(c&&c[0])var g=l.substr(0,c.index)+":"+d[1]+": "+s,_=c.index+d[1].length+3;else var g=l+":"+d[1]+": "+s,_=l.length+d[1].length+3;n.value=g,setFieldSelection(n,_)}this.hideSuggestions(),this.onChange()},MessageComposer.prototype.onMentionsUpdated=function(e){delete this.previousQuery,this.isActive&&this.checkAutocomplete()},MessageComposer.prototype.onMentionSelected=function(e,t){var n=!0;if("#"==e.charAt(0)&&(n=!1,e=e.substr(1),t=t.replace(/\(\)@/,"")),this.richTextareaEl){var i=this.richTextareaEl[0];this.isActive||this.restoreSelection()||setRichFocus(i);var a,r=getRichValueWithCaret(i),o=r[0],s=r[1]>=0?r[1]:o.length,l=o.substr(s),c=o.substr(0,s),d=c.match(/@([\S]*)$/);a=d&&d[0]?c.substr(0,d.index)+"@"+e:c+"@"+e;var u;n?l.length?(this.selId=(this.selId||0)+1,u=this.getRichHtml(a)+' '+this.getRichHtml(l),this.richTextareaEl.html(u),setRichFocus(i,$("#composer_sel"+this.selId)[0])):(u=this.getRichHtml(a)+" ",this.richTextareaEl.html(u),setRichFocus(i)):(this.selId=(this.selId||0)+1,u=this.getRichHtml(a)+' ('+encodeEntities(t)+") "+this.getRichHtml(l),
this.richTextareaEl.html(u),setRichFocus(i,$("#composer_sel"+this.selId)[0],!0))}else{var a,p,f,m,i=this.textareaEl[0],o=i.value,s=this.isActive?getFieldSelection(i):o.length,l=o.substr(s),c=o.substr(0,s),d=c.match(/@([\S]*)$/);a=d&&d[0]?c.substr(0,d.index)+"@"+e:c+"@"+e,n?(p=a+"@"+e+" "+l,f=d.index+e.length+2):(p=a+"@"+e+" ("+t+") "+l,f=d.index+e.length+2,m=f+t.length),i.value=p,setFieldSelection(i,f,m)}this.hideSuggestions(),this.onChange()},MessageComposer.prototype.onCommandSelected=function(e,t){if(t)if(this.richTextareaEl)this.richTextareaEl.html(encodeEntities(e)+" "),setRichFocus(this.richTextareaEl[0]);else{var n=this.textareaEl[0];n.value=e+" ",setFieldSelection(n)}else this.onCommandSend(e);this.hideSuggestions(),this.onChange()},MessageComposer.prototype.onChange=function(e){if(this.richTextareaEl){delete this.keyupStarted;var t=getRichValue(this.richTextareaEl[0]);this.textareaEl.val(t).trigger("change")}this.updateInlinePlaceholder()},MessageComposer.prototype.getEmojiHtml=function(e,t){t=t||EmojiHelper.emojis[e];var n=20,i=EmojiHelper.spritesheetPositions[e],a=i[0],r=(i[1],n*i[3]),o=n*i[2];return'
'},MessageComposer.prototype.setValue=function(e){this.richTextareaEl?(this.richTextareaEl.html(this.getRichHtml(e)),this.lastLength=e.length,this.wasEmpty=!e.length,this.onKeyEvent({type:"keyup"})):this.textareaEl.val(e)},MessageComposer.prototype.setFocusedValue=function(e){var t=e[0],n=e[1],i=e[2];if(this.richTextareaEl){this.selId=(this.selId||0)+1;var a=this.getRichHtml(t)+''+this.getRichHtml(n)+""+this.getRichHtml(i);this.richTextareaEl.html(a),setRichFocus(this.richTextareaEl[0],$("#composer_sel"+this.selId)[0],!0)}else this.textareaEl.val(t+n+i),setFieldSelection(this.textareaEl[0],t.length,t.length+n.length)},MessageComposer.prototype.getRichHtml=function(e){var t=$("").text(e).html();return t=t.replace(/\n/g,"
"),t=t.replace(/:([A-Za-z0-9\-\+\*_]+?):/gi,function(e,t){var n=EmojiHelper.shortcuts[t];return void 0!==n?this.getEmojiHtml(n):e}.bind(this)),t=t.replace(/ /g," Â ").replace(/^ | $/g,"Â ")},MessageComposer.prototype.focus=function(){this.richTextareaEl?setZeroTimeout(function(){setRichFocus(this.richTextareaEl[0])}.bind(this)):setFieldSelection(this.textareaEl[0])},MessageComposer.prototype.blur=function(){this.richTextareaEl?this.richTextareaEl[0].blur():this.textareaEl[0].blur()},MessageComposer.prototype.renderSuggestions=function(){this.autoCompleteWrapEl.show(),this.scroller.reinit(),this.updatePosition(),this.autocompleteShown=!0},MessageComposer.prototype.showEmojiSuggestions=function(e){var t=++this.renderToggleCnt,n=this;setZeroTimeout(function(){n.autoCompleteScope.$apply(function(){n.autoCompleteScope.type="emoji",n.autoCompleteScope.emojiCodes=e}),onContentLoaded(function(){t==n.renderToggleCnt&&n.renderSuggestions()})})},MessageComposer.prototype.showMentionSuggestions=function(e){var t=++this.renderToggleCnt,n=this;setZeroTimeout(function(){n.autoCompleteScope.$apply(function(){n.autoCompleteScope.type="mentions",n.autoCompleteScope.mentionUsers=e}),onContentLoaded(function(){t==n.renderToggleCnt&&n.renderSuggestions()})})},MessageComposer.prototype.showCommandsSuggestions=function(e){var t=++this.renderToggleCnt,n=this;setZeroTimeout(function(){n.autoCompleteScope.$apply(function(){n.autoCompleteScope.type="commands",n.autoCompleteScope.commands=e}),onContentLoaded(function(){t==n.renderToggleCnt&&n.renderSuggestions()})})},MessageComposer.prototype.showInlineSuggestions=function(e){if(!e||!e.results.length)return void this.hideSuggestions();var t=++this.renderToggleCnt,n=this;"inline"==n.autoCompleteScope.type&&n.autoCompleteScope.botResults==e&&n.autocompleteShown||setZeroTimeout(function(){n.autoCompleteScope.$apply(function(){n.autoCompleteScope.type="inline",n.autoCompleteScope.botResults=e}),onContentLoaded(function(){t==n.renderToggleCnt&&n.renderSuggestions()})})},MessageComposer.prototype.setInlineSuggestions=function(e){this.curInlineResults=e,this.checkAutocomplete()},MessageComposer.prototype.updatePosition=function(){var e=(this.richTextareaEl||this.textareaEl).offset(),t=this.scroller.updateHeight(),n=$((this.richTextareaEl||this.textareaEl)[0].parentNode).outerWidth();this.autoCompleteWrapEl.css({top:e.top-t,left:Config.Mobile?0:e.left,width:Config.Mobile?"100%":n-2}),this.scroller.update()},MessageComposer.prototype.hideSuggestions=function(){++this.renderToggleCnt;this.autoCompleteWrapEl.hide(),delete this.autocompleteShown},MessageComposer.prototype.resetTyping=function(){this.lastTyping=0,this.lastLength=0},MessageComposer.prototype.setPlaceholder=function(e){(this.richTextareaEl||this.textareaEl).attr("placeholder",e)},Scroller.prototype.setUpNano=function(){this.content.wrap('
'),this.scrollable=$(this.content[0].parentNode),this.scroller=$(this.scrollable[0].parentNode),this.wrap=$(this.scroller[0].parentNode),this.scroller.nanoScroller({preventPageScrolling:!0,tabIndex:-1})},Scroller.prototype.setUpNative=function(){this.content.wrap('
'),this.scrollable=$(this.content[0].parentNode),this.scrollable.css({overflow:"auto"}),this.maxHeight&&this.scrollable.css({maxHeight:this.maxHeight}),this.minHeight&&this.scrollable.css({minHeight:this.minHeight})},Scroller.prototype.onScroll=function(e){var t=this,n=this.scrollable[0];this.scrollable.on("scroll",function(i){t.isAnimatedScroll||e(n,n.scrollTop)})},Scroller.prototype.update=function(){this.useNano&&$(this.scroller).nanoScroller()},Scroller.prototype.reinit=function(){this.scrollTo(0),this.useNano&&setTimeout(function(){this.updateHeight()}.bind(this),100)},Scroller.prototype.updateHeight=function(){var e;return this.useNano?(this.maxHeight||this.minHeight?(e=this.content[0].offsetHeight,this.maxHeight&&e>this.maxHeight&&(e=this.maxHeight),this.minHeight&&e
0){var i=this;this.isAnimatedScroll=!0,this.scrollable.animate({scrollTop:e},t,function(){delete i.isAnimatedScroll,i.useNano&&$(i.scroller).nanoScroller({flash:!0}),i.scrollable.trigger("scroll"),n&&n()})}else this.scrollable[0].scrollTop=e,this.useNano&&$(this.scroller).nanoScroller({flash:!0}),n&&n()},Scroller.prototype.scrollToNode=function(e){e=e[0]||e;var t=e.offsetTop-15,n=e.offsetHeight+30,i=this.scrollable[0].scrollTop,a=this.scrollable[0].clientHeight;i>t?this.scrollTo(t):i
--- ---
',r=''+t("unread_messages_split")+"
",o="im_message_selected",s="im_message_focus",l="im_message_unread",c="im_message_error",d="im_message_pending";return{templateUrl:templateUrl("message"),link:n}}]).directive("myMessageBody",["$compile","AppPeersManager","AppChatsManager","AppUsersManager","AppMessagesManager","AppInlineBotsManager","RichTextProcessor",function(e,t,n,i,a,r,o){function s(e,t,n){if(n.media&&n.media.handleMessage||"string"!=typeof n.message||!n.message.length)return void $(".im_message_text",t).hide();var i=a.wrapMessageText(n.mid);$(".im_message_text",t).html(i.valueOf())}function l(e,t,n){if(!n.media)return void $(".im_message_media",t).hide();var i=e.$new(!0);i.media=n.media,i.messageId=n.mid,f(i,function(e){$(".im_message_media",t).replaceWith(e)})}function c(e,t,n){var i=n.post_author||n.fwd_from&&n.fwd_from.post_author;if(!i)return void $(".im_message_sign",t).hide();var a=o.wrapRichText(i,{noLinks:!0,noLinebreaks:!0});$(".im_message_sign",t).html(''+a.valueOf()+"")}function d(e,t,n){if(!n.reply_markup||"replyInlineMarkup"!=n.reply_markup._)return void $(".im_message_keyboard",t).hide();var i=e.$new(!0);i.markup=a.wrapReplyMarkup(n.reply_markup,n.fromID),i.messageId=n.mid,m(i,function(e){$(".im_message_keyboard",t).replaceWith(e)}),i.$on("reply_inline_button_press",function(e,t){switch(t._){case"keyboardButtonSwitchInline":r.switchInlineButtonClick(n.mid,t);break;case"keyboardButtonCallback":r.callbackButtonClick(n.mid,t);break;case"keyboardButtonGame":r.gameButtonClick(n.mid)}})}function u(e,t,n){s(e,t,n),l(e,t,n),c(e,t,n),d(e,t,n)}function p(e,t,n){var i=e.message;i.dir=!0;var a=i.mid;if(u(e,t,i),i.pending)var r=e.$on("messages_pending",function(){i.mid!=a&&(u(e,t,i),r())});e.$on("message_edit",function(n,a){a.mid==i.mid&&(a.justMedia?l(e,t,i):u(e,t,i))})}var f=e(''),m=e('');e('
');return{link:p,scope:{message:"=myMessageBody"}}}]).directive("myMessageViews",["$filter","AppMessagesManager",function(e,t){function n(e,t){t.html(a(e))}function i(e,i,a){var r=e.$eval(a.myMessageViews),o=t.getMessage(r).views||0;n(o,i),e.$on("message_views",function(e,t){t.mid==r&&n(t.views,i)})}var a=e("formatShortNumber");return{link:i}}]).directive("myReplyMarkup",function(){function e(e,t,n){var i=$(".reply_markup",t),a=new Scroller(i,{classPrefix:"reply_markup",maxHeight:170});e.buttonClick=function(t){e.$emit("reply_button_press",t)},e.$on("ui_keyboard_update",function(t,n){onContentLoaded(function(){a.updateHeight(),a.scrollTo(0),e.$emit("ui_panel_update",{blur:n&&n.enabled})})}),onContentLoaded(function(){a.updateHeight(),e.$emit("ui_panel_update")})}return{templateUrl:templateUrl("reply_markup"),scope:{replyMarkup:"=myReplyMarkup"},link:e}}).directive("myMessageMedia",function(){return{scope:{media:"=myMessageMedia",messageId:"=messageId"},templateUrl:templateUrl("message_media")}}).directive("myMessagePhoto",["AppPhotosManager",function(e){return{scope:{media:"=myMessagePhoto",messageId:"=messageId"},templateUrl:templateUrl("message_attach_photo"),link:function(t,n,i){t.openPhoto=e.openPhoto,t.preloadPhoto=e.preloadPhoto}}}]).directive("myMessageDocument",["AppDocsManager",function(e){return{scope:{media:"=myMessageDocument",messageId:"=messageId"},templateUrl:templateUrl("message_attach_document"),link:function(t,n,i){if(e.updateDocDownloaded(t.media.document.id),t.docSave=function(){e.saveDocFile(t.media.document.id)},t.docOpen=function(){return t.media.document.withPreview?void e.openDoc(t.media.document.id,t.messageId):t.docSave()},t.videoOpen=function(){e.openVideo(t.media.document.id,t.messageId)},t.media.document.file_name){var a=t.media.document.file_name.split(".");a.length>1?(t.media_file_ext="."+a.pop(),t.media_file_name_without_ext=a.join("."),t.media_file_name_without_ext||(t.media_file_name_without_ext=t.media_file_ext,t.media_file_ext="")):(t.media_file_ext="",t.media_file_name_without_ext=a[0])}}}}]).directive("myMessageGeo",function(){return{scope:{media:"=myMessageGeo"},templateUrl:templateUrl("message_attach_geo")}}).directive("myMessageVenue",function(){return{scope:{media:"=myMessageVenue"},templateUrl:templateUrl("message_attach_venue")}}).directive("myMessageContact",function(){return{scope:{media:"=myMessageContact"},templateUrl:templateUrl("message_attach_contact")}}).directive("myMessageWebpage",["AppWebPagesManager","AppPhotosManager",function(e,t){return{scope:{media:"=myMessageWebpage",messageId:"=messageId"},templateUrl:templateUrl("message_attach_webpage"),link:function(n){n.openPhoto=t.openPhoto,n.openEmbed=function(t){if(n.media.webpage&&n.media.webpage.embed_url)return e.openEmbed(n.media.webpage.id,n.messageId),cancelEvent(t)},n.$on("webpage_updated",function(e,t){n.media.webpage&&n.media.webpage.id==t.id&&n.$emit("ui_height")})}}}]).directive("myMessageGame",["AppInlineBotsManager","AppMessagesManager",function(e,t){return{scope:{media:"=myMessageGame",messageId:"=messageId"},templateUrl:templateUrl("message_attach_game"),link:function(n,i){function a(e){var a=t.getMessage(n.messageId);if(a.message){var r=t.wrapMessageText(n.messageId);$(".im_message_game_message",i).html(r.valueOf()).show(),$(".im_message_game_description",i).hide()}else $(".im_message_game_message",i).html("").hide(),$(".im_message_game_description",i).show()}n.openGame=function(){e.gameButtonClick(n.messageId)},n.$on("message_edit",function(e,t){t.mid==n.messageId&&a()}),a()}}}]).directive("myMessagePending",function(){function e(e,t,n){if(e.media.file_name){var i=e.media.file_name.split(".");i.length>1?(e.media_file_ext="."+i.pop(),e.media_file_name_without_ext=i.join("."),e.media_file_name_without_ext||(e.media_file_name_without_ext=e.media_file_ext,e.media_file_ext="")):(e.media_file_ext="",e.media_file_name_without_ext=i[0])}}return{scope:{media:"=myMessagePending"},templateUrl:templateUrl("message_attach_pending"),link:e}}).directive("myInlineReplyMarkup",function(){function e(e,t,n){e.buttonClick=function(t){e.$emit("reply_inline_button_press",t)}}return{templateUrl:templateUrl("reply_markup"),scope:{replyMarkup:"=myInlineReplyMarkup"},link:e}}).directive("myServiceMessage",["ErrorService","AppMessagesManager",function(e,t){function n(n,i,a){n.phoneCallClick=function(n){var i=t.getMessage(n),a=t.getMessagePeer(i);e.show({error:{type:"PHONECALLS_NOT_SUPPORTED",userID:a}})}}return{templateUrl:templateUrl("message_service"),scope:{historyMessage:"=myServiceMessage"},link:n}}]).directive("myShortMessage",function(){return{scope:{message:"=myShortMessage"},templateUrl:templateUrl("short_message")}}).directive("myReplyMessage",["AppMessagesManager","AppPeersManager","$rootScope",function(e,t,n){function i(e,t,n){if(n.watch)e.$parent.$watch(n.myReplyMessage,function(i){var r=e.$parent.$eval(n.edit);a(e,t,i,r)});else{var i=e.$parent.$eval(n.myReplyMessage),r=e.$parent.$eval(n.edit);a(e,t,i,r)}}function a(t,n,i,a){var o=t.replyMessage=e.wrapSingleMessage(i);if(t.thumb=!1,t.isEdit=a||!1,o.loading)var s=t.$on("messages_downloaded",function(a,o){o.indexOf(i)!=-1&&(t.replyMessage=e.wrapForDialog(i),r(t,n),s())});else r(t,n)}function r(i,a){var r=i.replyMessage;return r&&!r.deleted&&r.to_id?(i.thumb=e.getMessageThumb(r,42,42),"A"==a[0].tagName&&a.on("click",function(){var i=e.getMessagePeer(r),a=t.getPeerString(i);n.$broadcast("history_focus",{peerString:a,messageID:r.mid})}),void onContentLoaded(function(){i.$emit("ui_height")})):void $(a).remove()}return{templateUrl:templateUrl("reply_message"),scope:{},link:i}}]).directive("myPinnedMessage",["AppMessagesManager","AppPeersManager","$rootScope",function(e,t,n){function i(t,n,i){var r=t.$parent.$eval(i.myPinnedMessage),o=t.pinnedMessage=e.wrapSingleMessage(r);if(o.loading)var s=t.$on("messages_downloaded",function(i,o){o.indexOf(r)!=-1&&(t.pinnedMessage=e.wrapForDialog(r),a(t,n),s())});else a(t,n)}function a(i,a){var r=i.pinnedMessage;return r&&!r.deleted&&r.to_id?("A"==a[0].tagName&&a.on("click",function(){var i=e.getMessagePeer(r),a=t.getPeerString(i);n.$broadcast("history_focus",{peerString:a,messageID:r.mid})}),void onContentLoaded(function(){i.$emit("ui_height")})):void $(a).remove()}return{templateUrl:templateUrl("pinned_message"),scope:{},link:i}}]).directive("myPeerPinnedMessageBar",["AppMessagesManager","AppPeersManager","AppProfileManager",function(e,t,n){function i(e,i,a){a&&(i.pinnedMessageID=0,i.$emit("ui_height"));var r=++i.jump;if(t.isChannel(e)){var o=-e;n.getChannelPinnedMessage(o).then(function(e){r==i.jump&&(i.pinnedMessageID=e||0,i.$emit("ui_height"))})}}function a(e,t,a){e.jump=0,e.$parent.$watch(a.myPeerPinnedMessageBar,function(t){e.peerID=t,i(t,e,!0)}),e.$on("peer_pinned_message",function(t,n){n==e.peerID&&i(e.peerID,e)}),e.$on("chat_full_update",function(t,n){n==-e.peerID&&i(e.peerID,e)}),e.hidePinned=function(){n.hideChannelPinnedMessage(-e.peerID,e.pinnedMessageID),e.pinnedMessageID=0,e.$emit("ui_height")}}return{templateUrl:templateUrl("peer_pinned_message_bar"),scope:{},link:a}}]).directive("myForwardedMessages",["AppPhotosManager","AppMessagesManager","AppPeersManager","$rootScope",function(e,t,n,i){function a(e,t,n){n.watch?e.$watch("forwardMessages",function(){r(e,t)}):r(e,t)}function r(e,n){var i=e.forwardMessages,a=i.length,r=!1,o=1==a;e.thumb=!1,e.singleMessage=!1,angular.forEach(i,function(n){var i=t.getMessage(n);r===!1?r=i.fromID:r!==i.fromID&&(r=t.getMessagePeer(i)),o&&(e.thumb=t.getMessageThumb(i,42,42),e.singleMessage=t.wrapForDialog(n))}),e.fromID=r,e.count=a,onContentLoaded(function(){e.$emit("ui_height")})}return{templateUrl:templateUrl("forwarded_messages"),scope:{forwardMessages:"=myForwardedMessages"},link:a}}]).directive("myMessageEdited",["_","$timeout","AppMessagesManager",function(e,t,n){function i(e,t,n){var i=e.$parent.$eval(n.myMessageEdited);a(e,t,i)&&e.$on("message_edit",function(i,r){var o=e.$parent.$eval(n.myMessageEdited);r.mid==o&&a(e,t,o)})}function a(e,i,a){var o=n.getMessage(a);return o.canBeEdited?!o.edit_date||(i.html(r).show(),t(function(){e.$destroy()}),!1):(t(function(){e.$destroy(),i.remove()}),!1)}var r=e("message_edited");return{scope:{},link:i}}]).directive("myMessageAdminBadge",["_","AppPeersManager","AppMessagesManager","AppProfileManager",function(e,t,n,i){function a(e,a,o){var s=e.$parent.$eval(o.myMessageAdminBadge),l=s&&s.fromID,c=s&&n.getMessagePeer(s);if(!l||!t.isMegagroup(c))return void a.hide();var d=-c;i.getChannelParticipants(d,{_:"channelParticipantsAdmins"}).then(function(e){for(var t=!1,n=0,i=e.length;n=49&&n.keyCode<=57||Config.Navigator.osX&&n.ctrlKey&&n.shiftKey&&!n.metaKey&&!n.altKey&&n.keyCode>=49&&n.keyCode<=57){var o=n.keyCode-49;return r=$(l).find(".im_dialog_wrap"),a=r[o],a&&($(a).find("a").trigger("mousedown"),scrollToNode(l,a,s)),cancelEvent(n)}var d,f,m,h=Config.Modes.packed;if(40==n.keyCode||38==n.keyCode?(d=40==n.keyCode,f=!d,m=!n.shiftKey&&n.altKey):h&&9==n.keyCode&&n.ctrlKey&&!n.metaKey&&(d=!n.shiftKey,f=!d,m=!0),d||f){if(!m&&(!p||n.metaKey))return!0;i=!m&&$(l).find(".im_dialog_selected")[0]||$(l).find(".active a.im_dialog")[0];var g=i&&i.parentNode;if(g){if(a=i[d?"nextSibling":"previousSibling"],!a||!a.className||a.className.indexOf("im_dialog_wrap")==-1){r=$(l).find(".im_dialog_wrap");var _=r.index(i.parentNode),v=_+(d?1:-1);a=r[v]}}else r=$(l).find(".im_dialog_wrap"),a=d?r[0]:r[r.length-1];return m?a&&$(a).find("a").trigger("mousedown"):(g&&a&&$(g).find("a").removeClass("im_dialog_selected"),a&&$(a).find("a").addClass("im_dialog_selected")),a&&scrollToNode(l,a,s),cancelEvent(n)}}var s=$(".im_dialogs_wrap",a)[0],l=$(".im_dialogs_scrollable_wrap",a)[0],c=$(".im_dialogs_search_field",a)[0],d=$(".im_dialogs_panel",a)[0],u=$(".im_dialogs_search_clear",a)[0],p=!1;$(c).on("focus blur",function(e){p="focus"==e.type,p||($(l).find(".im_dialog_selected").removeClass("im_dialog_selected"),c.value||t.$emit("ui_dialogs_search_clear"))}),t.$on("dialogs_search_toggle",function(){$(d).addClass("im_dialogs_panel_search"),t.$broadcast("ui_dialogs_search"),$(n).scrollTop(0),i(function(){setFieldSelection(c)})}),t.$on("search_clear",function(){$(d).removeClass("im_dialogs_panel_search"),t.$broadcast("ui_dialogs_search")}),$(document).on("keydown",o),t.$on("$destroy",function(){$(document).off("keydown",o)}),t.$on("ui_dialogs_change",function(){onContentLoaded(function(){var e=$(l).find(".active a.im_dialog")[0];e&&scrollToNode(l,e.parentNode,s)})})}return{link:a}}]).directive("myDialogsList",["$window","$timeout",function(e,t){function n(n,i,a){function r(){if(u&&u.offsetHeight||(u=$(d)[0]),a.modal){var t=$(e).height()-(u?u.offsetHeight:49)-(Config.Mobile?46:100);return t=Math.min(Config.Mobile?350:450,t),$(i).css({height:t}),void m()}c&&c.offsetHeight||(c=$(".tg_page_head")[0]),p&&p.offsetHeight||(p=$(".footer_wrap")[0]),s&&s.offsetHeight||(s=$(".im_dialogs_col_wrap")[0]);var n=p?p.offsetHeight:0;n&&n++,$(i).css({height:$(e).height()-n-(c?c.offsetHeight:48)-(u?u.offsetHeight:58)-parseInt($(s).css("paddingBottom")||0)}),m()}var o=$(".im_dialogs_wrap",i)[0],s=$(".im_dialogs_col_wrap")[0],l=$(".im_dialogs_scrollable_wrap",i)[0],c=$(".tg_page_head")[0],d=Config.Mobile&&a.modal?".mobile_modal_body .im_dialogs_panel":".im_dialogs_panel",u=$(d)[0],p=$(".footer_wrap")[0],f=!1;onContentLoaded(function(){$(o).nanoScroller({preventPageScrolling:!0,tabIndex:-1,iOSNativeScrolling:!0})});var m=function(){onContentLoaded(function(){$(o).nanoScroller()})};n.$on("ui_dialogs_prepend",m),n.$on("ui_dialogs_search",r),n.$on("ui_dialogs_update",r),n.$on("ui_dialogs_append",function(){onContentLoaded(function(){m(),f=!1,t(function(){$(l).trigger("scroll")})})}),n.$on("ui_dialogs_change",function(){onContentLoaded(function(){m(),f=!1,t(function(){$(l).trigger("scroll")})})}),$(l).on("scroll",function(e){i.is(":visible")&&!f&&l.scrollTop>=l.scrollHeight-l.clientHeight-300&&(n.$emit("dialogs_need_more"),f=!0)}),$(e).on("resize",r),r(),setTimeout(r,1e3)}return{link:n}}]).directive("myContactsList",["$window","$timeout",function(e,t){function n(t,n,i){function a(){$(n).css({height:$(e).height()-(o&&o.offsetHeight||0)-(r&&r.offsetHeight||0)-(Config.Mobile?64:200)}),$(s).nanoScroller()}var r=$(".contacts_modal_search")[0],o=$(".contacts_modal_panel")[0],s=$(".contacts_wrap",n)[0];onContentLoaded(function(){$(s).nanoScroller({preventPageScrolling:!0,tabIndex:-1,iOSNativeScrolling:!0}),a()}),$(e).on("resize",a),t.$on("contacts_change",function(){onContentLoaded(a)})}return{link:n}}]).directive("myCountriesList",["$window","$timeout",function(e,t){function n(t,n,i){function a(){$(n).css({height:$(e).height()-(o&&o.offsetHeight||0)-(r&&r.offsetHeight||0)-(Config.Mobile?64:200)}),$(s).nanoScroller()}var r=$(".countries_modal_search")[0],o=$(".countries_modal_panel")[0],s=$(".countries_wrap",n)[0];onContentLoaded(function(){$(s).nanoScroller({preventPageScrolling:!0,tabIndex:-1,iOSNativeScrolling:!0}),a()}),$(e).on("resize",a),t.$on("contacts_change",function(){onContentLoaded(a)})}return{link:n}}]).directive("mySessionsList",["$window","$timeout",function(e,t){function n(t,n,i){function a(){$(n).css({height:Math.min(760,$(e).height()-(Config.Mobile?64:200))}),$(r).nanoScroller()}var r=$(".sessions_wrap",n)[0];onContentLoaded(function(){$(r).nanoScroller({preventPageScrolling:!0,tabIndex:-1,iOSNativeScrolling:!0}),a()}),$(e).on("resize",a)}return{link:n}}]).directive("myStickersList",["$window","$timeout",function(e,t){function n(t,n,i){function a(){$(n).css({height:Math.min(600,$(e).height()-(Config.Mobile?64:200))}),$(r).nanoScroller()}var r=$(".stickerset_wrap",n)[0];onContentLoaded(function(){$(r).nanoScroller({preventPageScrolling:!0,tabIndex:-1,iOSNativeScrolling:!0}),a()}),$(e).on("resize",a)}return{link:n}}]).directive("myHistory",["$window","$timeout","$rootScope","$transition",function(e,t,n,i){function a(a,r,o){function s(e,n){var i,a,r,o=!1;if(!e&&(a=$(".im_message_focus:visible",p)[0])){var s=p.clientHeight,l=p.scrollTop,c=a.offsetTop,d=a.clientHeight;(!l||l+sc+d||n)&&(o=Math.max(0,c-Math.floor(s/2)+26)),I=!1,r=function(){var e=$(a).data("unfocus_promise");e&&(t.cancel(e),$(a).removeClass("im_message_focus_active")),t(function(){$(a).addClass("im_message_focus_active"),e=t(function(){$(a).removeClass("im_message_focus_active"),$(a).data("unfocus_promise",!1)},2800),$(a).data("unfocus_promise",e)})}}else(i=$(".im_message_unread_split:visible",p)[0])?(o=Math.max(0,i.offsetTop-52),I=!1):(o=p.scrollHeight,I=!0);if(o!==!1){var u=function(){S(),t(function(){$(p).trigger("scroll"),x=p.scrollTop}),r&&r()};n?$(p).animate({scrollTop:o},200,u):(p.scrollTop=o,u())}}function l(t){if(r.is(":visible")||$(r[0].parentNode.parentNode).is(":visible")){$(_).is(":visible")&&(b&&b.offsetHeight||(b=$(".im_send_form",r)[0]),$(_).css({height:$(b).height()})),v&&v.offsetHeight||(v=$(".tg_page_head")[0]),y&&y.offsetHeight||(y=$(".footer_wrap")[0]),h&&h.offsetHeight||(h=$(".im_history_pinned_panel",r)[0]);var n=y?y.offsetHeight:0;n&&n++;var i=h&&h.offsetHeight||0,a=$(e).height()-g.offsetHeight-(v?v.offsetHeight:48)-n-i;$(d).css({height:a}),c(),t!==!0&&(I&&onContentLoaded(function(){p.scrollTop=p.scrollHeight,S()}),S(100))}}function c(){$(u).css({marginTop:0});var e=p.offsetHeight-u.offsetHeight-m.offsetHeight-(Config.Mobile?0:39);u.offsetHeight>0&&e>0&&$(u).css({marginTop:e}),$(d).nanoScroller()}var d=$(".im_history_wrap",r)[0],u=$(".im_history_messages",r)[0],p=($(".im_history",r)[0],$(".im_history_scrollable_wrap",r)[0]),f=$(".im_history_scrollable",r)[0],m=$(".im_history_empty_wrap",r)[0],h=$(".im_history_pinned_panel",r)[0],g=$(".im_bottom_panel_wrap",r)[0],_=$(".im_send_form_wrap",r)[0],v=$(".tg_page_head")[0],y=$(".footer_wrap")[0],b=$(".im_send_form",r)[0],w=!1,k=!1;onContentLoaded(function(){p.scrollTop=p.scrollHeight}),$(d).nanoScroller({preventPageScrolling:!0,tabIndex:-1,iOSNativeScrolling:!0});var M,S=function(e){t(function(){$(p).hasClass("im_history_to_bottom")||$(d).nanoScroller()},e||0)},A=!1,C=["transform","webkitTransform","MozTransform","msTransform","OTransform"];for(M=0;M0;if(r)a=p.scrollHeight;else{var o=parseInt($(p).css("paddingRight"));$(f).css({bottom:0,paddingRight:o}),$(p).addClass("im_history_to_bottom")}onContentLoaded(function(){if(r){E=!0,$(u).removeClass("im_history_appending"),p.scrollTop=p.scrollHeight,$(u).css(A,"translate(0px, "+(p.scrollHeight-a)+"px)"),$(d).nanoScroller();var e={};e[A]="translate(0px, 0px)",$(u).addClass("im_history_appending"),i($(u),e).then(function(){E=!1,$(u).removeClass("im_history_appending"),c()})}else $(p).removeClass("im_history_to_bottom"),$(f).css({bottom:"",paddingRight:0}),p.scrollTop=p.scrollHeight,c()})}),a.$on("history_direction_key",function(e,t){var n=!1;switch(console.warn("scroll top",t.keyCode),t.keyCode){case 33:n=p.scrollTop-p.clientHeight;break;case 34:n=p.scrollTop+p.clientHeight;break;case 36:n=0;break;case 35:n=p.scrollHeight}n!==!1&&$(p).stop().animate({scrollTop:n},200)}),a.$on("ui_history_change",function(){var e=parseInt($(p).css("paddingRight"));$(p).addClass("im_history_to_bottom"),p.scrollHeight,$(f).css({bottom:0,paddingRight:e}),onContentLoaded(function(){$(p).removeClass("im_history_to_bottom"),$(f).css({bottom:"",paddingRight:""}),l(!0),w=!1,k=!1,s()})}),a.$on("ui_history_change_scroll",function(e,t){onContentLoaded(function(){s(!1,t)})}),a.$on("ui_history_focus",function(){I||(p.scrollTop=p.scrollHeight,S(),I=!0)}),a.$on("ui_history_prepend",function(){var e=p.scrollHeight,n=p.scrollTop,i=parseInt($(p).css("paddingRight")),r=p.clientHeight;$(p).addClass("im_history_to_bottom"),p.scrollHeight,$(f).css({bottom:-(e-n-r),paddingRight:i});var o=function(){$(p).removeClass("im_history_to_bottom"),$(f).css({bottom:"",paddingRight:""}),x>=0?s():p.scrollTop=n+p.scrollHeight-e,c(),w=!1,t(function(){p.scrollHeight!=e&&$(p).trigger("scroll")}),clearTimeout(l),d()},l=setTimeout(o,0),d=a.$on("$viewContentLoaded",o)}),a.$on("ui_history_append",function(){var e=p.scrollHeight;onContentLoaded(function(){I=!1,c(),k=!1,x>=0&&s(),t(function(){p.scrollHeight!=e&&$(p).trigger("scroll")})})}),a.$on("ui_panel_update",function(e,n){l(),onContentLoaded(function(){l(),n&&n.blur?a.$broadcast("ui_message_blur"):getSelectedText()||a.$broadcast("ui_message_send"),t(function(){$(p).trigger("scroll")})})}),a.$on("ui_selection_clear",function(){window.getSelection?window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().removeAllRanges():document.selection&&document.selection.empty()}),a.$on("ui_editor_resize",l),a.$on("ui_height",function(){onContentLoaded(l)});var I=!0,x=-1;$(p).on("scroll",function(e){if(r.is(":visible")&&!$(p).hasClass("im_history_to_bottom")&&!E){var t=p.scrollTop;I=t>=p.scrollHeight-p.clientHeight,x>=0&&x!=t&&(x=-1),!w&&t<=300?(w=!0,a.$emit("history_need_more")):!k&&t>=p.scrollHeight-p.clientHeight-300&&(k=!0,a.$emit("history_need_less"))}}),$(e).on("resize",l),l(),onContentLoaded(l)}return{link:a}}]).directive("mySendForm",["_","$q","$timeout","$interval","$window","$compile","$modalStack","$http","$interpolate","Storage","AppStickersManager","AppDocsManager","ErrorService","AppInlineBotsManager","FileManager","shouldFocusOnInteraction",function(e,t,n,i,a,r,o,s,l,c,d,u,p,f,m,h){function g(s,l,g){function _(){return ne?void(q&&(q.stop(),q.removeEventListener("streamReady",Z),q.removeEventListener("start",J),
q.audioContext&&(q.scriptProcessorNode&&q.scriptProcessorNode.disconnect(),q.clearStream(),q.audioContext.close(),q.audioContext=null))):void(ie=!0)}function v(){_(),s.voiceRecorder.recording&&(i.cancel(W),s.$apply(function(){s.voiceRecorder.recording=!1,s.voiceRecorder.duration=0}))}function y(){c.get("send_ctrlenter").then(function(e){ae=!e})}function b(e){return n(function(){M(),s.draftMessage.send(),Y.resetTyping(),K&&K.update(),Y.hideSuggestions()},h?0:100),cancelEvent(e)}function w(e){s.$apply(function(){s.draftMessage.inlineResultID=e})}function k(e){return 38==e.keyCode?(s.$emit("last_message_edit"),cancelEvent(e)):(s.$emit("history_direction_key",e),!0)}function M(){X&&(Y.onChange(),S())}function S(){var e=X.offsetHeight;re!=e&&(re=e,s.$emit("ui_editor_resize"))}function A(e){if(!(9!=e.keyCode||e.shiftKey||e.ctrlKey||e.metaKey||o.getTop()))return Y.focus(),cancelEvent(e)}function C(){onContentLoaded(function(){Y.focus()})}function T(e){var n=e.type||"",i=t.when(!1);["image/jpeg","image/gif","image/png","image/bmp"].indexOf(n)>=0&&(i=m.getFileCorrectUrl(e,n)),i.then(function(t){t=t||!1,p.confirm({type:"FILE_CLIPBOARD_PASTE",fileUrl:t}).then(function(){s.draftMessage.files=[e],s.draftMessage.isMedia=!0})})}function E(e){var t,n,i=(e.originalEvent||e).clipboardData,a=i&&i.items||[],r=[];for(t=0;t0){if(1==r.length)return T(r[0]);p.confirm({type:"FILES_CLIPBOARD_PASTE",files:r}).then(function(){s.draftMessage.files=r,s.draftMessage.isMedia=!0})}}function I(e){var t=!1;return x&&1!=x||(x=checkDragEvent(e)?2:1,t=!0),2==x&&(P&&setTimeout(function(){clearTimeout(P),P=!1},0),"dragenter"==e.type||"dragover"==e.type?t&&($(F).css({height:D.offsetHeight,width:D.offsetWidth}),l.addClass("im_send_form_dragging")):("drop"==e.type&&s.$apply(function(){s.draftMessage.files=Array.prototype.slice.call(e.originalEvent.dataTransfer.files),s.draftMessage.isMedia=!0}),P=setTimeout(function(){l.removeClass("im_send_form_dragging"),x=!1,P=!1},300))),cancelEvent(e)}var x,P,D=$(".im_send_field_wrap",l)[0],R=$("textarea",l)[0],O=$(".composer_emoji_insert_btn",l)[0],N=$(".composer_emoji_panel",l)[0],L=$("input",l),F=$(".im_send_dropbox_wrap",l)[0],U=$(".im_submit",l)[0],B=$(".im_voice_recorder_wrap",l)[0],H=$(".im_record",l)[0],j=r(''),V={},q=null,z=Recorder.isRecordingSupported(),W=null;z&&l.addClass("im_record_supported"),s.voiceRecorder={duration:0,recording:!1,processing:!1};var G=new EmojiTooltip(O,{getStickers:function(e){d.getStickers().then(e)},getStickerImage:function(e,t){var n=e.attr("data-category"),i=V[t];if(i&&!isInDOM(i[0]))return i.attr("data-category",n),void e.replaceWith(i);var a=s.$new(!0);a.document=u.getDoc(t),j(a,function(i){V[t]=i,i.attr("data-category",n),e.replaceWith(i)})},onStickersetSelected:function(e){d.openStickersetLink(e)},onEmojiSelected:function(e){s.$apply(function(){Y.onEmojiSelected(e)})},onStickerSelected:function(e){s.$apply(function(){s.draftMessage.sticker=e})},langpack:{im_emoji_tab:e("im_emoji_tab"),im_stickers_tab:e("im_stickers_tab")}});s.$on("stickers_changed",function(){G.onStickersChanged()});var K;N&&(K=new EmojiPanel(N,{onEmojiSelected:function(e){Y.onEmojiSelected(e)}}));var Y=new MessageComposer(R,{onTyping:function(){s.$emit("ui_typing")},getSendOnEnter:function(){return ae},dropdownDirective:function(e,t){var n=s.$new(!0);r("")(n,function(n,i){e.replaceWith(n),t(i,n)})},mentions:s.mentions,commands:s.commands,onMessageSubmit:b,onDirectionKey:k,onInlineResultSend:w,onFilePaste:T,onCommandSend:function(e){s.$apply(function(){s.draftMessage.command=e})}}),X=Y.richTextareaEl&&Y.richTextareaEl[0];X&&$(X).on("keydown keyup",S),s.$on("inline_results",function(e,t){var n=Config.Mobile?$(window).width():(D.offsetWidth||382)-2,i=80;t&&f.regroupWrappedResults(t.results,n,i),setZeroTimeout(function(){Y.setInlineSuggestions(t)})}),s.$on("inline_placeholder",function(e,t){Y.setInlinePlaceholder(t.prefix,t.placeholder)}),L.on("change",function(){var e=this;s.$apply(function(){s.draftMessage.files=Array.prototype.slice.call(e.files),s.draftMessage.isMedia=$(e).hasClass("im_media_attach_input")||Config.Mobile,setTimeout(function(){try{e.value=""}catch(t){}},1e3)})}),$(H).on("contextmenu",cancelEvent);var J,Z,Q,ee=!!Config.Navigator.touch,te={start:ee?"touchstart":"mousedown",move:ee?"touchmove":"mousemove",stop:ee?"touchend blur":"mouseup blur"},ne=!1,ie=!1;$(H).on(te.start,function(e){if(!s.voiceRecorder.processing){q=new Recorder({monitorGain:0,numberOfChannels:1,bitRate:64e3,encoderSampleRate:48e3,encoderPath:"vendor/recorderjs/encoder_worker.js"}),ne=!1,ie=!1,J=function(e){var t=tsNow(!0);W=i(function(){s.voiceRecorder.duration=tsNow(!0)-t},1e3),s.$apply(function(){s.voiceRecorder.recording=!0})},q.addEventListener("start",J),Z=function(e){return ne=!0,ie?void _():void q.start()},q.addEventListener("streamReady",Z),q.initStream();var t=!1,n={},r=function(){var e=$(".im_bottom_panel_wrap"),t=e.offset();n={top:t.top,left:t.left,width:e.outerWidth(),height:e.outerHeight()}},o=function(e,i){var a=e.originalEvent||e,r=ee?a.changedTouches&&a.changedTouches[0]:a,o=r&&r.pageX>=n.left&&r.pageX<=n.left+n.width&&r.pageY>=n.top&&r.pageY<=n.top+n.height;return t!=o&&(l.toggleClass("im_send_form_hover",o),t=o),i&&o};r(),o(e),Q=function(e){$(a).off(te.move,o),$(a).off(te.stop,Q);var t="blur"!=e&&o(e,!0);s.voiceRecorder.duration>0&&t&&(s.voiceRecorder.processing=!0,q.addEventListener("dataAvailable",function(e){var t=blobConstruct([e.detail],"audio/ogg");console.warn(dT(),"got audio",t),s.$apply(function(){void 0!==t.size&&t.size>1024&&(s.draftMessage.files=[t],s.draftMessage.isMedia=!0),s.voiceRecorder.processing=!1})})),v()},Config.Mobile||$(B).css({height:D.offsetHeight,width:D.offsetWidth}),$(a).on(te.move,o),$(a).one(te.stop,Q)}});var ae=!0;s.$on("settings_changed",y),y(),$(U).on("mousedown touchstart",b);var re=X&&X.offsetHeight;$(document).on("keydown",A),$("body").on("dragenter dragleave dragover drop",I),$(document).on("paste",E),h&&(s.$on("ui_peer_change",C),s.$on("ui_history_focus",C),s.$on("ui_history_change",C)),s.$on("ui_peer_change",Y.resetTyping.bind(Y)),s.$on("ui_peer_draft",function(t,n){n=n||{};var i=s.draftMessage.isBroadcast;Y.setPlaceholder(e(i?"im_broadcast_field_placeholder_raw":"im_message_field_placeholder_raw")),n.customSelection?(Y.setFocusedValue(n.customSelection),S()):(X&&(Y.setValue(s.draftMessage.text||""),S()),(h||n&&n.focus)&&Y.focus()),onContentLoaded(function(){Y.checkAutocomplete(!0)}),G&&Config.Mobile&&G.hide()}),s.$on("ui_peer_reply",function(){onContentLoaded(function(){s.$emit("ui_editor_resize"),h&&Y.focus()})}),s.$on("mentions_update",function(){Y.onMentionsUpdated()}),s.$on("ui_message_before_send",function(){M()}),s.$on("ui_message_send",function(){h&&C()}),s.$on("ui_message_blur",function(){Y.blur()}),s.$on("$destroy",function(){$(document).off("paste",E),$(document).off("keydown",A),$("body").off("dragenter dragleave dragover drop",I),$(U).off("mousedown touchstart"),L.off("change")}),h&&C()}return{link:g,templateUrl:templateUrl("send_form"),scope:{draftMessage:"=",replyKeyboard:"=",mentions:"=",commands:"="}}}]).directive("myLoadThumb",["MtpApiFileManager","FileManager",function(e,t){function n(n,i,a){var r=0,o=e.getCachedFile(n.thumb&&n.thumb.location&&!n.thumb.location.empty&&n.thumb.location);o&&i.attr("src",t.getUrl(o,"image/jpeg")),n.thumb&&n.thumb.width&&n.thumb.height&&(i.attr("width",n.thumb.width),i.attr("height",n.thumb.height));var s=n.$watchCollection("thumb.location",function(a){n.thumb&&n.thumb.width&&n.thumb.height&&(i.attr("width",n.thumb.width),i.attr("height",n.thumb.height),n.$emit("ui_height"));var o=++r;if(!a||a.empty)return i.attr("src",n.thumb&&n.thumb.placeholder||"img/blank.gif"),void l();var s=e.getCachedFile(a);return s?(i.attr("src",t.getUrl(s,"image/jpeg")),void l()):(i.attr("src")||i.attr("src",n.thumb.placeholder||"img/blank.gif"),void e.downloadSmallFile(n.thumb.location).then(function(e){o==r&&(i.attr("src",t.getUrl(e,"image/jpeg")),l())},function(e){console.log("Download image failed",e,n.thumb.location,i[0]),o==r&&(i.attr("src",n.thumb.placeholder||"img/blank.gif"),l())}))}),l=a.watch?angular.noop:function(){setTimeout(function(){n.$destroy(),s()},0)}}return{link:n,scope:{thumb:"="}}}]).directive("myLoadFullPhoto",["MtpApiFileManager","FileManager","_",function(e,t,n){function i(i,a,r){var o=$("img",a)[0],s=$(".img_fullsize_with_progress_wrap",a).add(".img_fullsize_progress_wrap",a).add($(o)),l=function(){s.css({width:i.fullPhoto.width,height:i.fullPhoto.height}),i.$emit("ui_height",!0)},c=0;i.$watchCollection("fullPhoto.location",function(){var a=e.getCachedFile(i.thumbLocation),r=++c;if(a?(o.src=t.getUrl(a,"image/jpeg"),l()):o.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",i.fullPhoto.location){var s;if(i.fullPhoto.size){var d={_:"inputFileLocation",volume_id:i.fullPhoto.location.volume_id,local_id:i.fullPhoto.location.local_id,secret:i.fullPhoto.location.secret};s=e.downloadFile(i.fullPhoto.location.dc_id,d,i.fullPhoto.size)}else s=e.downloadSmallFile(i.fullPhoto.location);i.progress={enabled:!0,percent:0},s.then(function(e){r==c&&(i.progress.enabled=!1,o.src=t.getUrl(e,"image/jpeg"),l())},function(e){console.log("Download image failed",e,i.fullPhoto.location),i.progress.enabled=!1,e&&"FS_BROWSER_UNSUPPORTED"==e.type?i.error={html:n("error_browser_no_local_file_system_image_md",{"moz-link":'{1}',"chrome-link":'{1}',"telegram-link":'{1}'})}:i.error={text:n("error_image_download_failed"),error:e}},function(e){i.progress.percent=Math.max(1,Math.floor(100*e.done/e.total))})}}),l()}return{link:i,transclude:!0,templateUrl:templateUrl("full_photo"),scope:{fullPhoto:"=",thumbLocation:"="}}}]).directive("myLoadVideo",["$sce","AppDocsManager","ErrorService","_",function(e,t,n,i){function a(e,a,r){var o=t.downloadDoc(e.video.id);o.then(function(){e.$emit("ui_height"),onContentLoaded(function(){var e=$("video",a)[0];if(e){var t=!1,i=function(e){t||e.target&&e.target.error&&e.target.error.code!=e.target.error.MEDIA_ERR_DECODE&&e.target.error.code!=e.target.error.MEDIA_ERR_SRC_NOT_SUPPORTED||(t=!0,n.show({error:{type:"MEDIA_TYPE_NOT_SUPPORTED",originalError:e.target&&e.target.error}}))};e.addEventListener("error",i,!0),$(e).on("$destroy",function(){t=!0,e.removeEventListener("error",i)})}})},function(t){console.log("Download video failed",t,e.video),t&&"FS_BROWSER_UNSUPPORTED"==t.type?e.error={html:i("error_browser_no_local_file_system_video_md",{"moz-link":'{1}',"chrome-link":'{1}',"telegram-link":'{1}'})}:e.error={text:i("error_video_download_failed"),error:t}}),e.$emit("ui_height"),e.$on("$destroy",function(){o.cancel()})}return{link:a,transclude:!0,templateUrl:templateUrl("full_video"),scope:{video:"="}}}]).directive("myLoadGif",["AppDocsManager","$timeout",function(e,t){function n(e,t){return r!==e&&(r&&(r.pause(),r.currentTime=0,o.isActive=!1),r=e,void(o=t))}function i(e,t){var i=$("video",t)[0];if(i){if(e.isActive){n(i,e);var a=i.play();a&&a.then&&a.then(function(){e.needClick=!1},function(){e.needClick=!0})}else i.pause(),i.currentTime=0;return i}return!1}function a(n,a,r){var o=$(".img_gif_image_wrap",a);o.css({width:n.document.thumb.width,height:n.document.thumb.height});var s=!1,l=!1;n.isActive=!1,n.toggle=function(r){if(r&&checkClick(r,!0))return e.saveDocFile(n.document.id),!1;if(n.document.url){if(n.needClick&&i(n,a))return;return n.isActive=!n.isActive,void onContentLoaded(function(){n.$emit("ui_height"),i(n,a)})}return s?(s.cancel(),void(s=!1)):(l=!1,s=e.downloadDoc(n.document.id),void s.then(function(){t(function(){l||(n.isActive=!0);var e=i(n,a);e&&$(e).on("ended",function(){n.isActive&&n.toggle()})},200)}))},n.$on("ui_history_change",function(){n.isActive&&n.toggle(),l=!0}),n.$on("$destroy",function(){s&&(s.cancel(),s=!1)})}var r=!1,o=!1;return{link:a,templateUrl:templateUrl("full_gif"),scope:{document:"="}}}]).directive("myLoadRound",["AppMessagesManager","AppDocsManager","$timeout",function(e,t,n){function i(e,t){return s!==e&&(s&&(s.pause(),s.currentTime=0,l.isActive=!1),s=e,void(l=t))}function a(t){t.message&&!t.message.pFlags.out&&t.message.pFlags.media_unread&&e.readMessages([t.message.mid])}function r(e,t){var n=$("video",t)[0];if(n){if(e.isActive){i(n,e);var r=n.play();r&&r.then?r.then(function(){e.needClick=!1,a(e)},function(){e.needClick=!0}):a(e)}else n.pause(),n.currentTime=0;return n}return!1}function o(i,a,o){var s=$(".img_round_image_wrap",a);s.css({width:i.document.thumb.width,height:i.document.thumb.height});var l=!1,c=!1;i.isActive=!1,i.$parent.messageId&&(i.message=e.wrapForHistory(i.$parent.messageId)),i.toggle=function(e){if(e&&checkClick(e,!0))return t.saveDocFile(i.document.id),!1;if(i.document.url){if(i.needClick&&r(i,a))return;return i.isActive=!i.isActive,void onContentLoaded(function(){i.$emit("ui_height"),r(i,a)})}return l?(l.cancel(),void(l=!1)):(c=!1,l=t.downloadDoc(i.document.id),void l.then(function(){n(function(){c||(i.isActive=!0);var e=r(i,a);e&&$(e).on("ended",function(){i.isActive&&i.toggle()})},200)}))},i.$on("ui_history_change",function(){i.isActive&&i.toggle(),c=!0}),i.$on("$destroy",function(){l&&(l.cancel(),l=!1)})}var s=!1,l=!1;return{link:o,templateUrl:templateUrl("full_round"),scope:{document:"="}}}]).directive("myLoadSticker",["_","MtpApiFileManager","FileManager","AppStickersManager",function(e,t,n,i){function a(a,o,s){var l=$("
").addClass(s.imgClass),c=!1;l.attr("alt","["+(a.document.stickerEmojiRaw||"")+" "+e("conversation_media_sticker")+"]");var d=s.dim&&a.$parent.$eval(s.dim)||a.document.thumb;s.open&&a.document.stickerSetInput&&o.addClass("clickable").on("click",function(){i.openStickerset(a.document.stickerSetInput)});var u=function(e){l.attr("src",n.getUrl(e)),c||(c=!0,l.appendTo(o))};l.css({width:d.width,height:d.height}),o.css({width:d.width,height:d.height});var p=!1;a.document.thumb.location&&(p=angular.copy(a.document.thumb.location),p.sticker=!0);var f={_:"inputDocumentFileLocation",id:a.document.id,access_hash:a.document.access_hash,dc_id:a.document.dc_id,file_name:a.document.file_name,version:a.document.version,sticker:!0},m=t.getCachedFile(f),h=!1;if(m?h=!0:m=t.getCachedFile(p),m){if(u(m),h)return}else c=!0,l.attr("src",r).appendTo(o);s.thumb&&p?t.downloadSmallFile(p).then(function(e){u(e)},function(e){console.log("Download sticker failed",e,f)}):t.downloadFile(a.document.dc_id,f,a.document.size).then(function(e){u(e)},function(e){console.log("Download sticker failed",e,f)})}var r="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";return{link:a,scope:{document:"="}}}]).directive("myLoadDocument",["MtpApiFileManager","AppDocsManager","FileManager",function(e,t,n){function i(e,t){for(;e&&!$(e).hasClass("modal-dialog");)e=e.parentNode;e&&$(e).width(t+(Config.Mobile?0:32))}function a(a,r,o){var s=$(".document_fullsize_with_progress_wrap",r),l=$(".document_fullsize_wrap",r),c=$(".document_fullsize_img",r),d=$(window).width()-(Config.Mobile?20:32),u=$(window).height()-150;d>800&&(d-=208),a.imageWidth=d,a.imageHeight=u;var p=a.document.thumb;if(p&&"photoSizeEmpty"!=p._){var f=calcImageInBox(p.width,p.height,d,u);a.imageWidth=f.w,a.imageHeight=f.h;var m=e.getCachedFile(p.location);m&&(a.thumbSrc=n.getUrl(m,"image/jpeg"))}a.frameWidth=Math.max(a.imageWidth,Math.min(600,d)),a.frameHeight=a.imageHeight,onContentLoaded(function(){a.$emit("ui_height")}),i(r[0],a.frameWidth);var h,g,_;t.downloadDoc(a.document.id).then(function(e){var t=n.getUrl(e,a.document.mime_type),i=new Image,r=100,o=function(e){if(i.height&&i.width||!--r){g=i.width,_=i.height,clearInterval(h);var n=calcImageInBox(i.width,i.height,d,u,!0),o={w:g,h:_};n.w>=o.w&&n.h>=o.h&&(o.w*=4,o.h*=4);var p=!0;a.toggleZoom=function(){p=!p;var e=(p?o:n).w,t=(p?o:n).h;c.css({width:e,height:t,marginTop:a.frameHeight>t?Math.floor((a.frameHeight-t)/2):0}),l.toggleClass("document_fullsize_zoomed",p)},a.toggleZoom(!1),c.attr("src",t),s.hide(),l.css({width:a.frameWidth,height:a.frameHeight}).show()}};h=setInterval(o,20),i.onload=o,i.src=t,setZeroTimeout(o)})}return{link:a,templateUrl:templateUrl("full_document"),scope:{document:"=myLoadDocument"}}}]).directive("myGeoPointMap",["ExternalResourcesManager",function(e){function t(t,n,i){var a,r=n.attr("width")||200,o=n.attr("height")||200,s=r>200?15:13,l=!1;if(l){var c=Config.ExtCredentials.gmaps.api_key,d=!0;a="https://maps.googleapis.com/maps/api/staticmap?sensor=false¢er="+t.point.lat+","+t.point["long"]+"&zoom="+s+"&size="+r+"x"+o+"&scale=2&markers=color:red|size:big|"+t.point.lat+","+t.point["long"],d&&(a+="&key="+c)}else a="https://static-maps.yandex.ru/1.x/?l=map&ll="+t.point["long"]+","+t.point.lat+"&z="+s+"&size="+r+","+o+"&scale=1&pt="+t.point["long"]+","+t.point.lat+",pm2rdm&lang=en_US";n.attr("src","img/blank.gif"),e.downloadByURL(a).then(function(e){n.attr("src",e.valueOf())})}return{link:t,scope:{point:"=myGeoPointMap"}}}]).directive("myLoadingDots",["$interval",function(e){function t(e,t,i){t.html(n(t[0])?'
':"...")}function n(e){if(void 0===i&&(i=void 0!==e.style.animationName,i===!1)){var t,n="Webkit Moz O ms Khtml".split(" ");for(t=0;t=i.scrollHeight-i.clientHeight-300&&(a=!0,e.$apply(function(){e.slice.limit+=e.slice.limitDelta||20}),onContentLoaded(function(){a=!1,$(t).nanoScroller()}))})}return{link:e,scope:!0}}).directive("myModalPosition",["$window","$timeout",function(e,t){function n(n,i,a){var r=function(){if(!Config.Mobile||!$(i[0].parentNode.parentNode.parentNode).hasClass("mobile_modal")){var e=i[0].parentNode.offsetHeight,n=i[0].parentNode.parentNode.parentNode,r=$(".media_modal_bottom_panel_wrap",n)[0],o=n.offsetHeight-(r&&r.offsetHeight||0);e1||1==n&&!r)&&(e=t("group_modal_participants",{total:e,online:u(n)}))}n||_||(e=""),o.html(e)};n.$watch(s.myChatStatus,function(e){m=e,y()}),e.$on("chat_full_update",function(e,t){m==t&&y()}),e.$on("user_update",function(e,t){v[t]&&b()}),c[h]=b,n.$on("$destroy",function(){delete c[h]})}var l=0,c={},d=t.pluralize("group_modal_pluralize_participants"),u=t.pluralize("group_modal_pluralize_online_participants"),p=t.pluralize("group_modal_pluralize_subscribers"),f=0;return n.getUserID().then(function(e){f=e}),setInterval(o,9e4),{link:s}}]).directive("myPeerMuted",["$rootScope","NotificationsManager",function(e,t){function n(t,n,a){var r=t.$eval(a.myPeerMuted),o=a.mutedClass||"muted",s=e.$on("notify_settings",function(e,t){t.peerID==r&&i(r,n,o)});i(r,n,o),t.$on("$destroy",s)}function i(e,n,i){t.getPeerMuted(e).then(function(e){n.toggleClass(i,e)})}return{link:n}}]).directive("myPeerLink",["_","$rootScope","AppPeersManager","AppChatsManager","AppUsersManager","AppMessagesIDsManager",function(e,t,n,i,a,r){function o(o,s,l){var c,d=l.userOverride&&o.$eval(l.userOverride)||{},u=l["short"]&&o.$eval(l["short"]),p=l.username&&o.$eval(l.username),f=l.forDialog&&o.$eval(l.forDialog),m=function(){if(s[0].className.indexOf("user_color_")!=-1&&(s[0].className=s[0].className.replace(/user_color_\d+/g,"")),c>0){var t=a.getUser(c);if(f&&t.pFlags.self)s.text(e("user_name_saved_msgs_raw"));else{var n=p?"@":"",r=p?"username":u?"rFirstName":"rFullName";s.html(n+(d[r]||t[r]||"").valueOf()+(l.verified&&t.pFlags&&t.pFlags.verified?' ':"")),l.color&&o.$eval(l.color)&&s.addClass("user_color_"+t.num)}}else{var m=i.getChat(-c);s.html((m.rTitle||"").valueOf()+(l.verified&&m.pFlags&&m.pFlags.verified?' ':""))}};"A"!=s[0].tagName||hasOnclick(s[0])||s.on("click",function(){if(c>0)a.openUser(c,d);else{var e=-c,s=l.postId&&o.$eval(l.postId),u=l.savedFrom&&o.$eval(l.savedFrom);if(s)t.$broadcast("history_focus",{peerString:i.getChatString(e),messageID:r.getFullMessageID(parseInt(s),e)});else if(u){var p=u.split("_");t.$broadcast("history_focus",{peerString:n.getPeerString(p[0]),messageID:p[1]})}else i.openChat(e)}}),l.peerWatch?o.$watch(l.myPeerLink,function(e){c=e,m()}):(c=o.$eval(l.myPeerLink),m()),l.noWatch||(o.$on("user_update",function(e,t){c==t&&m()}),o.$on("chat_update",function(e,t){c==-t&&m()}))}return{link:o}}]).directive("myPeerPhotolink",["AppPeersManager","AppUsersManager","AppChatsManager","MtpApiFileManager","FileManager",function(e,t,n,i,a){function r(r,o,s){o.addClass("peer_photo_init");var l,c,d,u=$('
'),p=$(''),f=0,m=!1,h=s.forDialog&&r.$eval(s.forDialog),g=function(t){if(l==t)return!1;l=t,c=e.getPeer(l);var n="user_bgcolor_"+(c.num||1);return n!=m&&(m&&p.removeClass(m),p.addClass(n),m=n),_(),!0},_=function(){var e=++f;if(d=c.photo&&angular.copy(c.photo.photo_small),h&&c.pFlags&&c.pFlags.self)return p.remove(),void u.prependTo(o).attr("src","img/placeholders/Fave.png");var t=void 0!==d;if(t){var n=i.getCachedFile(c.photo.photo_small);if(n)return p.remove(),void u.prependTo(o).attr("src",a.getUrl(n,"image/jpeg"))}p.attr("data-content",c.initials||"").prependTo(o),u.remove(),t&&i.downloadSmallFile(c.photo.photo_small).then(function(t){e==f&&(p.remove(),u.prependTo(o).attr("src",a.getUrl(t,"image/jpeg")))},function(e){console.log("Download image failed",e,c.photo.photo_small,o[0])})};"A"!=o[0].tagName||s.noOpen||o.on("click",function(e){l>0?t.openUser(l,s.userOverride&&r.$eval(s.userOverride)):n.openChat(-l)}),r.$watch(s.myPeerPhotolink,g),g(r.$eval(s.myPeerPhotolink)),s.watch&&(r.$on("user_update",function(t,n){l==n&&(c=e.getPeer(l),angular.equals(c.photo&&c.photo.photo_small,d)&&d||_())}),r.$on("chat_update",function(e,t){l==-t&&(angular.equals(c.photo&&c.photo.photo_small,d)||_())}))}return{link:r}}]).directive("myOgvPlayer",["$compile",function(e){return{link:function(t,n,i){var a,r=t.audio;a="audio/ogg"==r.mime_type&&OGVCompat.hasWebAudio()&&OGVCompat.supported("OGVPlayer")?new OGVPlayer({debug:!1,worker:!1}):document.createElement("audio"),$(a).attr("media-player",i.myOgvPlayer),$(a).attr("src","{{::"+i.src+"}}"),e(a)(t),$(n).append(a)}}}]).directive("myAudioPlayer",["$timeout","$q","Storage","AppDocsManager","AppMessagesManager","ErrorService",function(e,t,n,i,a,r){function o(e){return e!==l&&(l&&!function(e){setZeroTimeout(function(){e.mediaPlayer.player.pause()})}(l),void(l=e))}function s(e,t,s){i.updateDocDownloaded(e.audio.id),e.volume=c,e.mediaPlayer={},e.$parent.messageId&&(e.message=a.wrapForHistory(e.$parent.messageId)),e.download=function(){i.saveDocFile(e.audio.id)},e.duration=function(){return e.mediaPlayer.player&&e.mediaPlayer.player.duration>0&&e.mediaPlayer.player.duration<1/0?e.mediaPlayer.player.duration:e.audio&&e.audio.duration||0},e.togglePlay=function(){e.audio.url?(o(e),setZeroTimeout(function(){e.mediaPlayer.player.playPause()})):e.audio.progress&&e.audio.progress.enabled||i.downloadDoc(e.audio.id).then(function(){onContentLoaded(function(){var n=$("audio, ogvjs",t)[0]||t[0];if(n){var i=!1,s=function(e){i||e.target&&e.target.error&&e.target.error.code!=e.target.error.MEDIA_ERR_DECODE&&e.target.error.code!=e.target.error.MEDIA_ERR_SRC_NOT_SUPPORTED||(i=!0,r.show({error:{type:"MEDIA_TYPE_NOT_SUPPORTED",originalError:e.target&&e.target.error}}))};n.addEventListener("error",s,!0),e.$on("$destroy",function(){i=!0,n.removeEventListener("error",s)})}setTimeout(function(){o(e),e.mediaPlayer.player.setVolume(c),e.mediaPlayer.player.play(),e.message&&!e.message.pFlags.out&&e.message.pFlags.media_unread&&a.readMessages([e.message.mid])},300)})})},e.seek=function(t){e.mediaPlayer&&e.mediaPlayer.player?e.mediaPlayer.player.seek(t):e.togglePlay()},e.setVolume=function(t){c=t,n.set({audio_volume:t}),e.mediaPlayer&&e.mediaPlayer.player&&e.mediaPlayer.player.setVolume(t)}}var l=!1,c=.5;n.get("audio_volume").then(function(e){e>0&&e<=1&&(c=e)});return{link:s,scope:{audio:"="},templateUrl:templateUrl("audio_player")}}]).directive("mySlider",["$window",function(e){function t(t,n,i){var a=$(".tg_slider_wrap",n),r=$(".tg_slider_track_fill",n),o=$(".tg_slider_thumb",n),s=a.width(),l=Math.ceil(o.width()),c=i.sliderModel,d=i.sliderOnchange,u=0,p=1,f=!1,m=!1;i.sliderMin&&t.$watch(i.sliderMin,function(e){u=e||0}),i.sliderMax&&t.$watch(i.sliderMax,function(e){p=e||1});var h=function(e){e=e.originalEvent||e;var n=(e.touches&&e.touches[0]?e.touches[0].pageX:e.pageX)-m;return n=Math.min(s,Math.max(0,n)),f=u+n/s*(p-u),d?t.$eval(d,{value:f}):t.$eval(c+"="+f),o.css("left",Math.max(0,n-l)),r.css("width",n),cancelEvent(e)},g=function(){$(e).off("mousemove touchmove",h),$(e).off("mouseup touchend touchcancel touchleave",g)};t.$watch(c,function(e){if(e!=f&&void 0!==e){var t=Math.max(0,(e-u)/(p-u));if(s){var n=Math.ceil(s*t);n=Math.min(s,Math.max(0,n)),o.css("left",Math.max(0,n-l)),r.css("width",n)}else o.css("left",100*t+"%"),r.css("width",100*t+"%");f=!1}}),n.on("dragstart selectstart",cancelEvent),n.on("mousedown touchstart",function(i){if(!s&&(s=a.width(),!s))return console.error("empty width"),cancelEvent(i);g(),i=i.originalEvent||i;var _;if(i.touches&&i.touches[0])m=n.position().left,_=i.touches[0].pageX-m;else if(void 0!==i.offsetX)_=i.offsetX,m=i.pageX-_;else{if(void 0===i.layerX)return cancelEvent(i);_=i.layerX,m=i.pageX-_}return f=u+_/s*(p-u),d?t.$eval(d,{value:f}):t.$eval(c+"="+f),o.css("left",Math.max(0,_-l)),r.css("width",_),$(e).on("mousemove touchmove",h),$(e).on("mouseup touchend touchcancel touchleave",g),cancelEvent(i)})}return{link:t,templateUrl:templateUrl("slider")}}]).directive("myLabeledInput",function(){function e(e,t,n){var i=$(".md-input:first",t),a=($(".md-input-label:first",t),i[0]&&"SPAN"==i[0].tagName),r=!1,o=function(){a?t.toggleClass("md-input-has-value",i.html().length>0):t.toggleClass("md-input-has-value",r||i.val().length>0)};o(),onContentLoaded(function(){o(),setZeroTimeout(function(){t.addClass("md-input-animated")})}),a||i.on("blur focus change",function(e){r="focus"==e.type,t.toggleClass("md-input-focused",r),o()}),e.$on("value_updated",function(){setZeroTimeout(function(){o()})})}return{link:e}}).directive("myCopyField",["toaster","_",function(e,t){function n(e,t,n){t.attr("readonly","true"),t[0].readonly=!0,t.on("click",function(){this.select()}),e.selectEvent&&e.$on(e.selectEvent,function(){setTimeout(function(){t[0].focus(),t[0].select()},100)})}return{scope:{selectEvent:"=myCopyField"},link:n}}]).directive("myCopyLink",["$compile","$timeout","_",function(e,t,n){function i(i,a,r){a.attr("tooltip","{{ttLabel}}"),a.removeAttr("my-copy-link"),a.removeAttr("data-my-copy-link");var o=!1,s=function(){t.cancel(o),o=!1,i.ttLabel=n("conversations_modal_share_url_copy_raw")};s(),e(a)(i);var l=new Clipboard(a[0]);l.on("success",function(e){t.cancel(o),i.$apply(function(){i.ttLabel=n("clipboard_copied_raw")}),o=t(s,2e3)}),l.on("error",function(e){t.cancel(o);var a=Config.Navigator.osX?"clipboard_press_cmd_c":"clipboard_press_ctrl_c";i.$apply(function(){i.ttLabel=n(a+"_raw")}),o=t(s,5e3)}),i.$on("$destroy",function(){l.destroy()})}return{restrict:"A",replace:!1,terminal:!0,priority:1e3,link:i}}]).directive("mySubmitOnEnter",function(){function e(e,t,n){t.on("keydown",function(e){if(13==e.keyCode)return t.trigger("submit"),cancelEvent(e)})}return{link:e}}).directive("myArcProgress",function(){function e(e,t,n){t=Math.max(0,Math.min(t,1));var i=.2;t=i+(1-i)*t,e.css({strokeDasharray:t*n+", "+(1-t)*n})}var t='',n=0;return{scope:{progress:"=myArcProgress"
diff --git a/js/locales/en-us.json b/js/locales/en-us.json
index 9ea8411b..ff5baa95 100644
--- a/js/locales/en-us.json
+++ b/js/locales/en-us.json
@@ -633,7 +633,8 @@
"message_attach_video_save": "Save file",
"message_attach_video_play": "Play video",
- "message_attach_unsupported": "The message is not supported on your version of Telegram Web. Update the app to view: {link}.",
+ "message_attach_unsupported": "The message is not supported on your version of Telegram Web. Update the app to view: {link}.",
+ "message_attach_unsupported_desktop": "This message is currently not supported on Telegram Web. Try {link}.",
"message_attach_notweb": "The message is not supported on Telegram Web yet. Use Telegram mobile apps to view: {link}.",
"conversation_select_modal_title": "Select conversation",
diff --git a/service_worker.js b/service_worker.js
index 1580f9a4..26b2affd 100644
--- a/service_worker.js
+++ b/service_worker.js
@@ -31,7 +31,7 @@ importScripts("js/lib/push_worker.js");
/* eslint-disable quotes, comma-spacing */
-var PrecacheConfig = [["badbrowser.html","cfb725c2ffb8df1fdf3efad6c69f7aa4"],["css/app.css","0471a5be5d85c01c9b1cb9568f1cbafc"],["css/badbrowser.css","82c1dcb9118aa0c7ed9683ca21f796f9"],["css/desktop.css","22382d4f647e1e11c12881d993fc5713"],["css/mobile.css","3158f4c501771c3827dda05fd684e4cc"],["favicon.ico","fb606fe0a27a1c62bdfc48561d908f39"],["favicon_unread.ico","b3a7e3414d29305250f377be7ab1e3e2"],["img/Manytabs.png","2bbd15e6ddf8c0212ccbedf7abd1c77e"],["img/Manytabs_2x.png","7a71629a5e4f7482b6320b103f1d543c"],["img/Telegram.png","85cd9ed3491576ba5e6ed3a9336f116f"],["img/Telegram.svg","4964c9bbfba510f495319c52562d70d4"],["img/Telegram72.png","1125082924531bd25844bc89a8f394e3"],["img/Telegram72_2x.png","0e7d8c7a5ba3f56eaa3123b97b8922b0"],["img/Telegram_2x.png","5f9f549b9d6bee5b0e4ac2141621b632"],["img/blank.gif","56398e76be6355ad5999b262208a17c9"],["img/changelog/card_wecandoit.png","3a0e66db81d0ea06166dd13fd8029aed"],["img/emojisprite_0.png","a279a9ce5721c10b6908b5f20cf5dda2"],["img/emojisprite_1.png","8db4db65bc5526baae9fb363d2ba3827"],["img/emojisprite_2.png","ff3a6afdb36b22d428aaebda31c8f2d7"],["img/emojisprite_3.png","54af1766e3f6ac1a79d8342c869ae3e7"],["img/emojisprite_4.png","e21d1b6c310a5bdfea043093623c270e"],["img/icons/AboutLogos.png","35d8405d003067c9d707bc5d65152d67"],["img/icons/AboutLogos_2x.png","b9e82c6df1d0782b45eb3d6a3461e5cc"],["img/icons/General.png","10639598adc8046b54dfa15d2e6443d0"],["img/icons/General_2x.png","5270d71cd78fd282a3736b0e6ae7f048"],["img/icons/IconsetSmiles.png","b639ed6a2b91d707dafe7861e0aee93b"],["img/icons/IconsetSmiles_2x.png","f9385d002e9cd787d704c26eaa4e6b9b"],["img/icons/IconsetW.png","1afbc8040b6c671431d27c3e25e84545"],["img/icons/IconsetW_2x.png","f01cec9bccc80a678ed0ec04acecade2"],["img/icons/Major.png","f647639ac513b1b536ada5a0c8771a7b"],["img/icons/Major_2x.png","73ed42f9ad14e613c20b4fbaaa566cc1"],["img/icons/MobileIcons.png","98d22350c7a4a25456074b40509fa954"],["img/icons/MobileIcons_2x.png","4bd2be1096ac23847a1ac6981a666652"],["img/icons/PhotoIcons.png","23a876a0e0c97b8e63be3c03bc372c24"],["img/icons/PhotoIcons_2x.png","292582f6e1b991b28242dfaf0b6b3667"],["img/icons/ProfileIcons.png","e94f10d7230ce03b5b961055aec1072d"],["img/icons/ProfileIcons_2x.png","11e2549774d7e05bf82448f15838572e"],["img/icons/icon.svg","a0cd37dd90703fc27a9bc98e076c5158"],["img/icons/icon120.png","f5856bbec8d918d921e7ab733319b24e"],["img/icons/icon128.png","e89aea693493e8a6b727417d99c3345c"],["img/icons/icon16.png","78b34ae9efbd05a8588040649a01b8de"],["img/icons/icon192.png","7316e15eb09d45413b65bad597c0762e"],["img/icons/icon32.png","0843d36cbaf7172c87b27aba4a1a3787"],["img/icons/icon512.png","73a8fe87836f0916d61a89f96a223189"],["img/icons/icon60.png","0e99d9872818ad3bf80a57c65f7ab01f"],["img/icons/icon64.png","30bd04ee092bde79aaf61a09e0d2ac8f"],["img/icons/icon90.png","ec811df90200dc5ca319629ed9a26eb6"],["img/iphone_home120.png","86b05c2c7e8ad0de8204789716898da4"],["img/iphone_startup.png","435b6009c9339a57dd4092e57ea466df"],["img/logo_share.png","ddf6cddc068b7cc2eac1af77ad9da4be"],["img/placeholders/DialogListAvatarSystem@2x.png","4f9f71e3b925ffc22994ad369c6e89d2"],["img/placeholders/Fave.png","975c515598a947c2885378e599898d31"],["img/placeholders/GroupAvatar1@2x.png","6b03ad1a83390a7833d053e61489accb"],["img/placeholders/GroupAvatar2@2x.png","cc24ed051254b8fd7c4d922c00fd226c"],["img/placeholders/GroupAvatar3@2x.png","bdfbb7e8c41efb40a8f73763f9d0c87b"],["img/placeholders/GroupAvatar4@2x.png","d2331f23158ae401b5b44cc135cb7c29"],["img/placeholders/PhotoThumbConversation.gif","56398e76be6355ad5999b262208a17c9"],["img/placeholders/PhotoThumbModal.gif","56398e76be6355ad5999b262208a17c9"],["img/placeholders/UserAvatar1@2x.png","27be09024c0bc78aa6469c7b2179400b"],["img/placeholders/UserAvatar2@2x.png","9ccf627d5bd7319e01e973584cd4441f"],["img/placeholders/UserAvatar3@2x.png","14b44e53a00014723acabee293c1e35a"],["img/placeholders/UserAvatar4@2x.png","b4fab5ac3d9100e8aa4670cfed4ada37"],["img/placeholders/UserAvatar5@2x.png","311ffa6462b8978e12b66e3902549e1d"],["img/placeholders/UserAvatar6@2x.png","3a52d80f3d3356e4051350dd1939982f"],["img/placeholders/UserAvatar7@2x.png","7135b26aacaaae0a59a2c32e8096fbc6"],["img/placeholders/UserAvatar8@2x.png","13f581d89c13b7c27338a548390d6765"],["img/placeholders/VideoThumbConversation.gif","56398e76be6355ad5999b262208a17c9"],["img/placeholders/VideoThumbModal.gif","56398e76be6355ad5999b262208a17c9"],["img/sound_a.mp3","eba09b6a457792c52fc610b5f9f974b3"],["index.html","ea4531e88ad98bd951ca1643e5c3de2f"],["js/app.js","efcda50865c31aed95bcb4850456a6a9"],["js/background.js","2e1ffcadaa805787c87dcaa237f2f273"],["js/lib/bin_utils.js","ff3766aeac6bdf4b355f93dba1b7d6f9"],["js/lib/crypto_worker.js","71e05d663296e5122981424d5b8f756f"],["js/lib/polyfill.js","b530810019a85da1b809ad5ca05b9d78"],["js/lib/push_worker.js","bae305ef892d7ba150d42872ae7c6bb5"],["js/locales/de-de.json","e8398b8ff4b6f72b449ebf161452b30b"],["js/locales/en-us.json","03b6dec32a738c556d09b844fcc079a7"],["js/locales/es-es.json","bb845280c526ae162b57340c0252cf36"],["js/locales/it-it.json","8540cc7ac5f89aae777fc25e5c8f33ed"],["js/locales/nl-nl.json","4f2e73781a3ebf733298c13452e6abde"],["js/locales/pt-br.json","4fe324abb20ec46707edb7887274e7ab"],["js/locales/ru-ru.json","525c8201ed7111ded60b2a15e49d3833"],["manifest.json","75b0e7a773b88207055388a288b36d62"],["manifest.webapp","9e1be09e21cbd22905fa173f06e57489"],["manifest.webapp.json","3351cf52919fd437e806a1b5becd50eb"],["nacl/mtproto_crypto.nmf","f7cbc5ecce97f184041bf7e56e30a925"],["nacl/mtproto_crypto.pexe","9b0030189b74b07a96908bc00ca2df54"],["vendor/angular/i18n/angular-locale_de-de.js","bef8329c258f22d04189439c38321ad6"],["vendor/angular/i18n/angular-locale_en-us.js","4e84db290d2e1743fa3b8a199683c146"],["vendor/angular/i18n/angular-locale_es-es.js","41df311f4b8636ddfdb00c208fe45807"],["vendor/angular/i18n/angular-locale_it-it.js","d815dcace0dd229b80696667b5d3d726"],["vendor/angular/i18n/angular-locale_nl-nl.js","98dc8669ccade4770fa2cab8f1a268f6"],["vendor/angular/i18n/angular-locale_pt-br.js","dbed1f6590bd8bf66091a70735e65071"],["vendor/angular/i18n/angular-locale_ru-ru.js","cdc2df0db5f61476579d189b59d4dc3c"],["vendor/closure/long.js","b0a35c095dc09f1fd10de13953946b82"],["vendor/cryptoJS/crypto.js","6d1ac0184656afab590fbf06e7bc8c5d"],["vendor/jsbn/jsbn_combined.js","d7eb1b82e658eef11ce3d8fd9caf10d5"],["vendor/leemon_bigint/bigint.js","99290db3a3369437ba0d44152dc36ba1"],["vendor/recorderjs/encoder_worker.js","bc93f3c524cb7e8965283c14203b6783"],["vendor/rusha/rusha.js","779d54331470a66576a5292e61fc1680"]];
+var PrecacheConfig = [["badbrowser.html","cfb725c2ffb8df1fdf3efad6c69f7aa4"],["css/app.css","0471a5be5d85c01c9b1cb9568f1cbafc"],["css/badbrowser.css","82c1dcb9118aa0c7ed9683ca21f796f9"],["css/desktop.css","22382d4f647e1e11c12881d993fc5713"],["css/mobile.css","3158f4c501771c3827dda05fd684e4cc"],["favicon.ico","fb606fe0a27a1c62bdfc48561d908f39"],["favicon_unread.ico","b3a7e3414d29305250f377be7ab1e3e2"],["img/Manytabs.png","2bbd15e6ddf8c0212ccbedf7abd1c77e"],["img/Manytabs_2x.png","7a71629a5e4f7482b6320b103f1d543c"],["img/Telegram.png","85cd9ed3491576ba5e6ed3a9336f116f"],["img/Telegram.svg","4964c9bbfba510f495319c52562d70d4"],["img/Telegram72.png","1125082924531bd25844bc89a8f394e3"],["img/Telegram72_2x.png","0e7d8c7a5ba3f56eaa3123b97b8922b0"],["img/Telegram_2x.png","5f9f549b9d6bee5b0e4ac2141621b632"],["img/blank.gif","56398e76be6355ad5999b262208a17c9"],["img/changelog/card_wecandoit.png","3a0e66db81d0ea06166dd13fd8029aed"],["img/emojisprite_0.png","a279a9ce5721c10b6908b5f20cf5dda2"],["img/emojisprite_1.png","8db4db65bc5526baae9fb363d2ba3827"],["img/emojisprite_2.png","ff3a6afdb36b22d428aaebda31c8f2d7"],["img/emojisprite_3.png","54af1766e3f6ac1a79d8342c869ae3e7"],["img/emojisprite_4.png","e21d1b6c310a5bdfea043093623c270e"],["img/icons/AboutLogos.png","35d8405d003067c9d707bc5d65152d67"],["img/icons/AboutLogos_2x.png","b9e82c6df1d0782b45eb3d6a3461e5cc"],["img/icons/General.png","10639598adc8046b54dfa15d2e6443d0"],["img/icons/General_2x.png","5270d71cd78fd282a3736b0e6ae7f048"],["img/icons/IconsetSmiles.png","b639ed6a2b91d707dafe7861e0aee93b"],["img/icons/IconsetSmiles_2x.png","f9385d002e9cd787d704c26eaa4e6b9b"],["img/icons/IconsetW.png","1afbc8040b6c671431d27c3e25e84545"],["img/icons/IconsetW_2x.png","f01cec9bccc80a678ed0ec04acecade2"],["img/icons/Major.png","f647639ac513b1b536ada5a0c8771a7b"],["img/icons/Major_2x.png","73ed42f9ad14e613c20b4fbaaa566cc1"],["img/icons/MobileIcons.png","98d22350c7a4a25456074b40509fa954"],["img/icons/MobileIcons_2x.png","4bd2be1096ac23847a1ac6981a666652"],["img/icons/PhotoIcons.png","23a876a0e0c97b8e63be3c03bc372c24"],["img/icons/PhotoIcons_2x.png","292582f6e1b991b28242dfaf0b6b3667"],["img/icons/ProfileIcons.png","e94f10d7230ce03b5b961055aec1072d"],["img/icons/ProfileIcons_2x.png","11e2549774d7e05bf82448f15838572e"],["img/icons/icon.svg","a0cd37dd90703fc27a9bc98e076c5158"],["img/icons/icon120.png","f5856bbec8d918d921e7ab733319b24e"],["img/icons/icon128.png","e89aea693493e8a6b727417d99c3345c"],["img/icons/icon16.png","78b34ae9efbd05a8588040649a01b8de"],["img/icons/icon192.png","7316e15eb09d45413b65bad597c0762e"],["img/icons/icon32.png","0843d36cbaf7172c87b27aba4a1a3787"],["img/icons/icon512.png","73a8fe87836f0916d61a89f96a223189"],["img/icons/icon60.png","0e99d9872818ad3bf80a57c65f7ab01f"],["img/icons/icon64.png","30bd04ee092bde79aaf61a09e0d2ac8f"],["img/icons/icon90.png","ec811df90200dc5ca319629ed9a26eb6"],["img/iphone_home120.png","86b05c2c7e8ad0de8204789716898da4"],["img/iphone_startup.png","435b6009c9339a57dd4092e57ea466df"],["img/logo_share.png","ddf6cddc068b7cc2eac1af77ad9da4be"],["img/placeholders/DialogListAvatarSystem@2x.png","4f9f71e3b925ffc22994ad369c6e89d2"],["img/placeholders/Fave.png","975c515598a947c2885378e599898d31"],["img/placeholders/GroupAvatar1@2x.png","6b03ad1a83390a7833d053e61489accb"],["img/placeholders/GroupAvatar2@2x.png","cc24ed051254b8fd7c4d922c00fd226c"],["img/placeholders/GroupAvatar3@2x.png","bdfbb7e8c41efb40a8f73763f9d0c87b"],["img/placeholders/GroupAvatar4@2x.png","d2331f23158ae401b5b44cc135cb7c29"],["img/placeholders/PhotoThumbConversation.gif","56398e76be6355ad5999b262208a17c9"],["img/placeholders/PhotoThumbModal.gif","56398e76be6355ad5999b262208a17c9"],["img/placeholders/UserAvatar1@2x.png","27be09024c0bc78aa6469c7b2179400b"],["img/placeholders/UserAvatar2@2x.png","9ccf627d5bd7319e01e973584cd4441f"],["img/placeholders/UserAvatar3@2x.png","14b44e53a00014723acabee293c1e35a"],["img/placeholders/UserAvatar4@2x.png","b4fab5ac3d9100e8aa4670cfed4ada37"],["img/placeholders/UserAvatar5@2x.png","311ffa6462b8978e12b66e3902549e1d"],["img/placeholders/UserAvatar6@2x.png","3a52d80f3d3356e4051350dd1939982f"],["img/placeholders/UserAvatar7@2x.png","7135b26aacaaae0a59a2c32e8096fbc6"],["img/placeholders/UserAvatar8@2x.png","13f581d89c13b7c27338a548390d6765"],["img/placeholders/VideoThumbConversation.gif","56398e76be6355ad5999b262208a17c9"],["img/placeholders/VideoThumbModal.gif","56398e76be6355ad5999b262208a17c9"],["img/sound_a.mp3","eba09b6a457792c52fc610b5f9f974b3"],["index.html","ea4531e88ad98bd951ca1643e5c3de2f"],["js/app.js","0c39094ddb8c652451c4ac8b12e55f3b"],["js/background.js","2e1ffcadaa805787c87dcaa237f2f273"],["js/lib/bin_utils.js","ff3766aeac6bdf4b355f93dba1b7d6f9"],["js/lib/crypto_worker.js","71e05d663296e5122981424d5b8f756f"],["js/lib/polyfill.js","b530810019a85da1b809ad5ca05b9d78"],["js/lib/push_worker.js","bae305ef892d7ba150d42872ae7c6bb5"],["js/locales/de-de.json","e8398b8ff4b6f72b449ebf161452b30b"],["js/locales/en-us.json","8f10f83cd97d116f8b0e050e44098410"],["js/locales/es-es.json","bb845280c526ae162b57340c0252cf36"],["js/locales/it-it.json","8540cc7ac5f89aae777fc25e5c8f33ed"],["js/locales/nl-nl.json","4f2e73781a3ebf733298c13452e6abde"],["js/locales/pt-br.json","4fe324abb20ec46707edb7887274e7ab"],["js/locales/ru-ru.json","525c8201ed7111ded60b2a15e49d3833"],["manifest.json","75b0e7a773b88207055388a288b36d62"],["manifest.webapp","9e1be09e21cbd22905fa173f06e57489"],["manifest.webapp.json","3351cf52919fd437e806a1b5becd50eb"],["nacl/mtproto_crypto.nmf","f7cbc5ecce97f184041bf7e56e30a925"],["nacl/mtproto_crypto.pexe","9b0030189b74b07a96908bc00ca2df54"],["vendor/angular/i18n/angular-locale_de-de.js","bef8329c258f22d04189439c38321ad6"],["vendor/angular/i18n/angular-locale_en-us.js","4e84db290d2e1743fa3b8a199683c146"],["vendor/angular/i18n/angular-locale_es-es.js","41df311f4b8636ddfdb00c208fe45807"],["vendor/angular/i18n/angular-locale_it-it.js","d815dcace0dd229b80696667b5d3d726"],["vendor/angular/i18n/angular-locale_nl-nl.js","98dc8669ccade4770fa2cab8f1a268f6"],["vendor/angular/i18n/angular-locale_pt-br.js","dbed1f6590bd8bf66091a70735e65071"],["vendor/angular/i18n/angular-locale_ru-ru.js","cdc2df0db5f61476579d189b59d4dc3c"],["vendor/closure/long.js","b0a35c095dc09f1fd10de13953946b82"],["vendor/cryptoJS/crypto.js","6d1ac0184656afab590fbf06e7bc8c5d"],["vendor/jsbn/jsbn_combined.js","d7eb1b82e658eef11ce3d8fd9caf10d5"],["vendor/leemon_bigint/bigint.js","99290db3a3369437ba0d44152dc36ba1"],["vendor/recorderjs/encoder_worker.js","bc93f3c524cb7e8965283c14203b6783"],["vendor/rusha/rusha.js","779d54331470a66576a5292e61fc1680"]];
/* eslint-enable quotes, comma-spacing */
var CacheNamePrefix = 'sw-precache-v1-Telegram-' + (self.registration ? self.registration.scope : '') + '-';