🔎 Rubika Web API Discovery V3

گزارش فقط برای تحلیل و شناسایی ساختار عمومی Web Rubika تولید شده است.

✅ بدون Login / Token / ارسال پیام / Upload

📊 خلاصه

Web Rubika200
JS پیدا شده7
JS دریافت شده7
JS ناموفق0
حجم کل JS7,704,211 bytes
API Methodهای پیدا شده19
فیلدهای Media13
Contextهای استخراج‌شده1394

🔐 وضعیت امنیتی تست

Login: ❌Token: ❌Send Message: ❌Upload: ❌Account Change: ❌

🧩 API Methodهای پیدا شده

getMessagesgetMessagesByIDgetMessagesIntervalgetMessagesUpdatesgetChatsgetChatsUpdatesgetChannelInfogetObjectByUsernamegetDatagetDCgetDcsgetDefaultGetMessagesGetMessagesByIDGetMessagesIntervalGetMessagesUpdatesGetChatsGetChatsUpdatesGetChannelInfo

🎞 فیلدهای Media

mimesizedurationtimewidthheightfile_inlinethumb_inlinefile_idfile_nameaccess_hashaccess_hash_recdc_id

🚚 Transport / API Hints

methodinputencryptdecryptaesdata_encapi_versionplatformpackagelang_codeobject_guidmessage_idmessage_idsmiddle_message_idauthauthorizationnonceaccess_hashaccess_hash_rec

🌐 Hosts

www.w3.orgleafletjs.commomentjs.comg.cogetdcmess.iranlms.irservicesbase.iranlms.irmessengerg2c1.iranlms.irbarcode.iranlms.irrubino1.iranlms.irwallet1.iranlms.irrubika.irgo.rubika.irservices.iranlms.irwebapp1.iranlms.irurl.rubika.irangular.iotwitter.cominstagram.complus.google.comgithub.com{s}.tile.openstreetmap.orgpanel.iranlms.irwww.google.com

🔗 Rubika Schemes

rubika://g.rubika.ir/
rubika://c.rubika.ir/
rubika://s.rubika.ir/
rubika://l.rubika.ir/
rubika://r.rubika.ir/
rubika://b.rubika.ir/
rubika://w.rubika.ir/
rubika://o.rubika.ir/

🌍 URLهای مهم

https://getdcmess.iranlms.ir/
https://servicesbase.iranlms.ir/
https://messengerg2c1.iranlms.ir
https://barcode.iranlms.ir/
https://rubino1.iranlms.ir/
https://wallet1.iranlms.ir/
https://rubika.ir
https://go.rubika.ir/
https://services.iranlms.ir
https://webapp1.iranlms.ir
https://url.rubika.ir
https://angular.io/api/common/NgForOf#change-propagation
https://panel.iranlms.ir/api/v3.0/getlinkObject
https://rubika.ir/

📦 فایل‌های JavaScript

#نوعوضعیتحجمAPIMedia
1runtime✅1,485
2runtime✅1,485
3polyfills✅132,967mime, size, duration, time
4polyfills✅37,638size, duration, time
5scripts✅239,152mime, size, width, height, duration, time
6main-es2015✅3,472,393getMessages, getMessagesByID, getMessagesInterval, getMessagesUpdates, getChats, getChatsUpdates, getChannelInfo, getObjectByUsername, getData, getDC, getDcs, getDefault, GetMessages, GetMessagesByID, GetMessagesInterval, GetMessagesUpdates, GetChats, GetChatsUpdates, GetChannelInfofile_inline, thumb_inline, file_id, file_name, access_hash, access_hash_rec, dc_id, mime, size, width, height, duration, time
7main-es5✅3,819,091getMessages, getMessagesByID, getMessagesInterval, getMessagesUpdates, getChats, getChatsUpdates, getChannelInfo, getObjectByUsername, getData, getDC, getDcs, getDefault, GetMessages, GetMessagesByID, GetMessagesInterval, GetMessagesUpdates, GetChats, GetChatsUpdates, GetChannelInfofile_inline, thumb_inline, file_id, file_name, access_hash, access_hash_rec, dc_id, mime, size, width, height, duration, time

🎯 Endpoint Contexts

getMessages

_id)?this.onReadyChanged.next({object_guid:t.object_guid,action:e,message_id:t.middle_message_id,filter_type:t.filter_type}):yield this.getAndSyncMessagesInterval(n,e,t,i)}catch(n){throw n}}))}getLastSendTime(e){const t=this.getConv(e,!0);for(let i=(t.hole.items||[]).length-1;i>=0;i--){const e=t.hole.items[i];if(e.author_object_guid==this.me.user_guid)return e.time}}clearHistory(e){const t=this.getConv(e,!0);t.messages={},t.hole.items=[],this.onReadyChanged.next({object_guid:e,action:jm.Renew})}getMessagesFromMiddle(e){const t=this.getConv(e.object_guid,!0),i=this.getHole(t,e.filter_type);this.setHoleFilterType(i,e.filter_type),this.checkSyncedMinMax(t,i);const n=i.items.length,s=i.items.findIndex(t=>toInt(t.message_id)>=toInt(e.middle_message_id));let r,a;s<0?(r=n-e.limit>0?n-e.limit:0,a=r+e.limit):(a=s+e.limit-toInt(.3*e.limit),a=a>n-1?n:a+1,r=a-e.limit>0?a-e.limit:0);const o=i.items.slice(r,a),c=this.getReferedMessageIds(o);return toInt(e.pin_mid||0)&&c.push(e.pin_mid),this.getIfNotExist(t,c),t.related&&(o.findIndex(e=>e.message_id===t.related.message_id),o.push(t.related.msg)),{messages:o,reachstart:i.reachstart&&r<=0,reachend:i.reachend&&a>=n-1}}getMessages(e,t){return gh(this,void 0,void 0,(function*(){try{e.limit=e.limit||20;const i=this.getConv(e.object_guid,!0),n=this.getHole(i,e.filter_type);this.setHoleFilterType(n,e.filter_type);let s=this.getMessageSlice(i,n,e);return e.limit===s.messages.length?s:(this.checkSyncedMinMax(i,n),s=this.getMessageSlice(i,n,e),s.messages.length>0?s:"FromMax"===e.sort&&n.reachstart||"FromMin"===e.sort&&n.reachend?{messages:[],has_continue:!1}:((yield this.getAndSyncMessages(i,{object_guid:e.object_guid,sort:e.sort,filter_type:e.filter_type},t
 n=i.items.length,s=i.items.findIndex(t=>toInt(t.message_id)>=toInt(e.middle_message_id));let r,a;s<0?(r=n-e.limit>0?n-e.limit:0,a=r+e.limit):(a=s+e.limit-toInt(.3*e.limit),a=a>n-1?n:a+1,r=a-e.limit>0?a-e.limit:0);const o=i.items.slice(r,a),c=this.getReferedMessageIds(o);return toInt(e.pin_mid||0)&&c.push(e.pin_mid),this.getIfNotExist(t,c),t.related&&(o.findIndex(e=>e.message_id===t.related.message_id),o.push(t.related.msg)),{messages:o,reachstart:i.reachstart&&r<=0,reachend:i.reachend&&a>=n-1}}getMessages(e,t){return gh(this,void 0,void 0,(function*(){try{e.limit=e.limit||20;const i=this.getConv(e.object_guid,!0),n=this.getHole(i,e.filter_type);this.setHoleFilterType(n,e.filter_type);let s=this.getMessageSlice(i,n,e);return e.limit===s.messages.length?s:(this.checkSyncedMinMax(i,n),s=this.getMessageSlice(i,n,e),s.messages.length>0?s:"FromMax"===e.sort&&n.reachstart||"FromMin"===e.sort&&n.reachend?{messages:[],has_continue:!1}:((yield this.getAndSyncMessages(i,{object_guid:e.object_guid,sort:e.sort,filter_type:e.filter_type},t)).length>0&&this.resort(i,n),this.getMessageSlice(i,n,e)))}catch(i){throw i}}))}getMessagesUpdate(e,t){return gh(this,void 0,void 0,(function*(){try{const i=this.getConv(e);if(!i||!i.hole.state)return!1;const n=yield this.dcService.getResponsePost({method:"getMessagesUpdates",model:{object_guid:e,state:i.hole.state}}).success(t);return"OldState"===n.status?(this.resetConv(i),void this.onReadyChanged.next({object_guid:e,action:jm.Renew})):(i.hole.state=n.new_state,n.updated_messages.forEach(e=>{this.updateMessage(i,e)}),!0)}catch(i){throw i}}))}getMessageById(e,t){const i=this.getConv(e);if(i)return i.messages[t]}checkReachend(e){e.forEach(e=>{const t=this.getC
limit:0);const o=i.items.slice(r,a),c=this.getReferedMessageIds(o);return toInt(e.pin_mid||0)&&c.push(e.pin_mid),this.getIfNotExist(t,c),t.related&&(o.findIndex(e=>e.message_id===t.related.message_id),o.push(t.related.msg)),{messages:o,reachstart:i.reachstart&&r<=0,reachend:i.reachend&&a>=n-1}}getMessages(e,t){return gh(this,void 0,void 0,(function*(){try{e.limit=e.limit||20;const i=this.getConv(e.object_guid,!0),n=this.getHole(i,e.filter_type);this.setHoleFilterType(n,e.filter_type);let s=this.getMessageSlice(i,n,e);return e.limit===s.messages.length?s:(this.checkSyncedMinMax(i,n),s=this.getMessageSlice(i,n,e),s.messages.length>0?s:"FromMax"===e.sort&&n.reachstart||"FromMin"===e.sort&&n.reachend?{messages:[],has_continue:!1}:((yield this.getAndSyncMessages(i,{object_guid:e.object_guid,sort:e.sort,filter_type:e.filter_type},t)).length>0&&this.resort(i,n),this.getMessageSlice(i,n,e)))}catch(i){throw i}}))}getMessagesUpdate(e,t){return gh(this,void 0,void 0,(function*(){try{const i=this.getConv(e);if(!i||!i.hole.state)return!1;const n=yield this.dcService.getResponsePost({method:"getMessagesUpdates",model:{object_guid:e,state:i.hole.state}}).success(t);return"OldState"===n.status?(this.resetConv(i),void this.onReadyChanged.next({object_guid:e,action:jm.Renew})):(i.hole.state=n.new_state,n.updated_messages.forEach(e=>{this.updateMessage(i,e)}),!0)}catch(i){throw i}}))}getMessageById(e,t){const i=this.getConv(e);if(i)return i.messages[t]}checkReachend(e){e.forEach(e=>{const t=this.getConv(e.object_guid);t&&t.hole.max_id&&t.hole.max_id<toInt(e.last_message_id)&&(t.hole.reachend=!1)})}getFileMessages(e,t){const i=this.getConv(e);let n=i.media_hole.items;return n=n.length>0?n:i.hole.items,
.push(e.pin_mid),this.getIfNotExist(t,c),t.related&&(o.findIndex(e=>e.message_id===t.related.message_id),o.push(t.related.msg)),{messages:o,reachstart:i.reachstart&&r<=0,reachend:i.reachend&&a>=n-1}}getMessages(e,t){return gh(this,void 0,void 0,(function*(){try{e.limit=e.limit||20;const i=this.getConv(e.object_guid,!0),n=this.getHole(i,e.filter_type);this.setHoleFilterType(n,e.filter_type);let s=this.getMessageSlice(i,n,e);return e.limit===s.messages.length?s:(this.checkSyncedMinMax(i,n),s=this.getMessageSlice(i,n,e),s.messages.length>0?s:"FromMax"===e.sort&&n.reachstart||"FromMin"===e.sort&&n.reachend?{messages:[],has_continue:!1}:((yield this.getAndSyncMessages(i,{object_guid:e.object_guid,sort:e.sort,filter_type:e.filter_type},t)).length>0&&this.resort(i,n),this.getMessageSlice(i,n,e)))}catch(i){throw i}}))}getMessagesUpdate(e,t){return gh(this,void 0,void 0,(function*(){try{const i=this.getConv(e);if(!i||!i.hole.state)return!1;const n=yield this.dcService.getResponsePost({method:"getMessagesUpdates",model:{object_guid:e,state:i.hole.state}}).success(t);return"OldState"===n.status?(this.resetConv(i),void this.onReadyChanged.next({object_guid:e,action:jm.Renew})):(i.hole.state=n.new_state,n.updated_messages.forEach(e=>{this.updateMessage(i,e)}),!0)}catch(i){throw i}}))}getMessageById(e,t){const i=this.getConv(e);if(i)return i.messages[t]}checkReachend(e){e.forEach(e=>{const t=this.getConv(e.object_guid);t&&t.hole.max_id&&t.hole.max_id<toInt(e.last_message_id)&&(t.hole.reachend=!1)})}getFileMessages(e,t){const i=this.getConv(e);let n=i.media_hole.items;return n=n.length>0?n:i.hole.items,n.filter(e=>e.file_inline&&e.file_inline.type===t)}getNextPrevVoiceMessage(e,t,i){const n=this.g
t||20;const i=this.getConv(e.object_guid,!0),n=this.getHole(i,e.filter_type);this.setHoleFilterType(n,e.filter_type);let s=this.getMessageSlice(i,n,e);return e.limit===s.messages.length?s:(this.checkSyncedMinMax(i,n),s=this.getMessageSlice(i,n,e),s.messages.length>0?s:"FromMax"===e.sort&&n.reachstart||"FromMin"===e.sort&&n.reachend?{messages:[],has_continue:!1}:((yield this.getAndSyncMessages(i,{object_guid:e.object_guid,sort:e.sort,filter_type:e.filter_type},t)).length>0&&this.resort(i,n),this.getMessageSlice(i,n,e)))}catch(i){throw i}}))}getMessagesUpdate(e,t){return gh(this,void 0,void 0,(function*(){try{const i=this.getConv(e);if(!i||!i.hole.state)return!1;const n=yield this.dcService.getResponsePost({method:"getMessagesUpdates",model:{object_guid:e,state:i.hole.state}}).success(t);return"OldState"===n.status?(this.resetConv(i),void this.onReadyChanged.next({object_guid:e,action:jm.Renew})):(i.hole.state=n.new_state,n.updated_messages.forEach(e=>{this.updateMessage(i,e)}),!0)}catch(i){throw i}}))}getMessageById(e,t){const i=this.getConv(e);if(i)return i.messages[t]}checkReachend(e){e.forEach(e=>{const t=this.getConv(e.object_guid);t&&t.hole.max_id&&t.hole.max_id<toInt(e.last_message_id)&&(t.hole.reachend=!1)})}getFileMessages(e,t){const i=this.getConv(e);let n=i.media_hole.items;return n=n.length>0?n:i.hole.items,n.filter(e=>e.file_inline&&e.file_inline.type===t)}getNextPrevVoiceMessage(e,t,i){const n=this.getConv(e);let s=n.media_hole.items;s=s.length>0?s:n.hole.items;const r=s.filter(e=>e.file_inline&&e.file_inline.type===t),a=r.findIndex(e=>e.message_id==i);return[r[a-1],r[a+1]]}getLastMessageId(e){const t=this.getLastMessage(e);return null==t?void 0:t.message_id}getLastMessa
=this.getHole(i,e.filter_type);this.setHoleFilterType(n,e.filter_type);let s=this.getMessageSlice(i,n,e);return e.limit===s.messages.length?s:(this.checkSyncedMinMax(i,n),s=this.getMessageSlice(i,n,e),s.messages.length>0?s:"FromMax"===e.sort&&n.reachstart||"FromMin"===e.sort&&n.reachend?{messages:[],has_continue:!1}:((yield this.getAndSyncMessages(i,{object_guid:e.object_guid,sort:e.sort,filter_type:e.filter_type},t)).length>0&&this.resort(i,n),this.getMessageSlice(i,n,e)))}catch(i){throw i}}))}getMessagesUpdate(e,t){return gh(this,void 0,void 0,(function*(){try{const i=this.getConv(e);if(!i||!i.hole.state)return!1;const n=yield this.dcService.getResponsePost({method:"getMessagesUpdates",model:{object_guid:e,state:i.hole.state}}).success(t);return"OldState"===n.status?(this.resetConv(i),void this.onReadyChanged.next({object_guid:e,action:jm.Renew})):(i.hole.state=n.new_state,n.updated_messages.forEach(e=>{this.updateMessage(i,e)}),!0)}catch(i){throw i}}))}getMessageById(e,t){const i=this.getConv(e);if(i)return i.messages[t]}checkReachend(e){e.forEach(e=>{const t=this.getConv(e.object_guid);t&&t.hole.max_id&&t.hole.max_id<toInt(e.last_message_id)&&(t.hole.reachend=!1)})}getFileMessages(e,t){const i=this.getConv(e);let n=i.media_hole.items;return n=n.length>0?n:i.hole.items,n.filter(e=>e.file_inline&&e.file_inline.type===t)}getNextPrevVoiceMessage(e,t,i){const n=this.getConv(e);let s=n.media_hole.items;s=s.length>0?s:n.hole.items;const r=s.filter(e=>e.file_inline&&e.file_inline.type===t),a=r.findIndex(e=>e.message_id==i);return[r[a-1],r[a+1]]}getLastMessageId(e){const t=this.getLastMessage(e);return null==t?void 0:t.message_id}getLastMessage(e){const t=this.getConv(e),i=t?t.hole.items
.getMessageSlice(i,n,e),s.messages.length>0?s:"FromMax"===e.sort&&n.reachstart||"FromMin"===e.sort&&n.reachend?{messages:[],has_continue:!1}:((yield this.getAndSyncMessages(i,{object_guid:e.object_guid,sort:e.sort,filter_type:e.filter_type},t)).length>0&&this.resort(i,n),this.getMessageSlice(i,n,e)))}catch(i){throw i}}))}getMessagesUpdate(e,t){return gh(this,void 0,void 0,(function*(){try{const i=this.getConv(e);if(!i||!i.hole.state)return!1;const n=yield this.dcService.getResponsePost({method:"getMessagesUpdates",model:{object_guid:e,state:i.hole.state}}).success(t);return"OldState"===n.status?(this.resetConv(i),void this.onReadyChanged.next({object_guid:e,action:jm.Renew})):(i.hole.state=n.new_state,n.updated_messages.forEach(e=>{this.updateMessage(i,e)}),!0)}catch(i){throw i}}))}getMessageById(e,t){const i=this.getConv(e);if(i)return i.messages[t]}checkReachend(e){e.forEach(e=>{const t=this.getConv(e.object_guid);t&&t.hole.max_id&&t.hole.max_id<toInt(e.last_message_id)&&(t.hole.reachend=!1)})}getFileMessages(e,t){const i=this.getConv(e);let n=i.media_hole.items;return n=n.length>0?n:i.hole.items,n.filter(e=>e.file_inline&&e.file_inline.type===t)}getNextPrevVoiceMessage(e,t,i){const n=this.getConv(e);let s=n.media_hole.items;s=s.length>0?s:n.hole.items;const r=s.filter(e=>e.file_inline&&e.file_inline.type===t),a=r.findIndex(e=>e.message_id==i);return[r[a-1],r[a+1]]}getLastMessageId(e){const t=this.getLastMessage(e);return null==t?void 0:t.message_id}getLastMessage(e){const t=this.getConv(e),i=t?t.hole.items:[];if(i)return i.last()}isDeleted(e,t){const i=this.getConv(e,!0);return i.deleted&&i.deleted[t+""]}forwardMessages(e,t){return gh(this,void 0,void 0,(function*(){try{const e=t
age(e){const t=this.pendingMessages.find(t=>t.message_id===e);if(t){if("pending"===t.status)return;t.status="pending",this.messageEvent.emit({object_guid:t.object_guid,action:Im.Update,message_ids:[t.message_id]}),this.callSendMessageApi(t)}}sendMessage(e){if(e.slow_mode_duration>0){const t=this.getLastSendTime(e.object_guid);if(t){const i=this.timeService.getNow(),n=e.slow_mode_duration-toInt(i-t);if(n>0){const e=new Error("SLOW_SEND_DURATION_ERROR");throw e.stack=n.toString(),e}}}const t=this.getMessageSlices(e.text),i=[];t.forEach(t=>{e.rnd=this.newRnd(),i.push(e.rnd);const n={message_id:e.rnd,trackBy:e.rnd,type:e.type||(e.file_inline?t?"FileInlineCaption":"FileInline":"Text"),author_type:"User",author_object_guid:this.me.user_guid,object_guid:e.object_guid,text:t,time:this.timeService.getNow(),reply_to_message_id:e.reply_to_message_id,metadata:e.metadata,file_inline:e.file_inline,save_draft_status:e.save_draft_status,aux_data:e.aux_data,sticker:e.sticker,location:e.location,is_mute:e.is_mute,status:"pending"};this.pendingMessages.push(n),this.callSendMessageApi(n)}),this.messageEvent.emit({object_guid:e.object_guid,action:Im.SendingMessage,message_ids:i})}cancelSending(e,t){var i;this.apiQService.abortRequest(t);const n=this.pendingMessages.findIndex(e=>e.message_id===t);if(n>=0){const e=this.pendingMessages[n];e.file_inline&&(null===(i=e.cancelUpload)||void 0===i||i.call(e,"canceled")),this.pendingMessages.splice(n,1)}this.messageEvent.emit({object_guid:e,action:Im.Deleted,message_ids:[t]})}updateMessageByGuid(e,t){const i=this.getConv(e);this.updateMessage(i,t,"Update")}searchChatMessages(e,t){return gh(this,void 0,void 0,(function*(){try{return(yield this.dcService.getRespons
dateMessageByGuid(e,t){const i=this.getConv(e);this.updateMessage(i,t,"Update")}searchChatMessages(e,t){return gh(this,void 0,void 0,(function*(){try{return(yield this.dcService.getResponsePost({method:"searchChatMessages",model:e}).success(t,"message_search")).message_ids}catch(i){throw i}}))}searchGlobalMessage(e,t){return gh(this,void 0,void 0,(function*(){try{return yield this.dcService.getResponsePost({method:"searchGlobalMessages",model:e}).success(t,"message_search")}catch(i){throw i}}))}getMessagesById(e,t){return gh(this,void 0,void 0,(function*(){try{const i=this.getConv(e,!0),n={},s=[];if((t||[]).forEach(e=>{i.messages[e]?n[e]=i.messages[e]:s.push(e)}),s.length>0){const e=yield this.dcService.getResponsePost({method:"getMessagesByID",model:{object_guid:i.object_guid,message_ids:s}}).success();(e.messages||[]).length>0&&e.messages.forEach(e=>{n[e.message_id]=e})}return t.map(e=>n[e])}catch(i){throw i}}))}reportObject(e){return gh(this,void 0,void 0,(function*(){try{return yield this.dcService.getResponsePost({method:"reportObject",model:e}).success()}catch(t){throw t}}))}isHiddenPin(e,t){return this.hidden_pinned[e]==t}hidePin(e,t){this.hidden_pinned[e]=t,this.storageService.set({hidden_pinned:this.hidden_pinned})}sendWalletTransfer(e){return gh(this,void 0,void 0,(function*(){try{const t=this.getConv(e.object_guid,!0);e.rnd=this.newRnd();const i=yield this.dcService.getResponsePost({method:"sendWalletTransferMessage",model:e}).success();if("OK"!==i.status)throw i.status;this.updateMessage(t,i.message_update,"Silent"),this.socketService.updateChat(i.chat_update)}catch(t){throw t}}))}setHoleFilterType(e,t){t&&e.filter_type!=t&&(e.items=[],e.filter_type=t)}isEqualType(e,t){i
ss(t,"message_search")).message_ids}catch(i){throw i}}))}searchGlobalMessage(e,t){return gh(this,void 0,void 0,(function*(){try{return yield this.dcService.getResponsePost({method:"searchGlobalMessages",model:e}).success(t,"message_search")}catch(i){throw i}}))}getMessagesById(e,t){return gh(this,void 0,void 0,(function*(){try{const i=this.getConv(e,!0),n={},s=[];if((t||[]).forEach(e=>{i.messages[e]?n[e]=i.messages[e]:s.push(e)}),s.length>0){const e=yield this.dcService.getResponsePost({method:"getMessagesByID",model:{object_guid:i.object_guid,message_ids:s}}).success();(e.messages||[]).length>0&&e.messages.forEach(e=>{n[e.message_id]=e})}return t.map(e=>n[e])}catch(i){throw i}}))}reportObject(e){return gh(this,void 0,void 0,(function*(){try{return yield this.dcService.getResponsePost({method:"reportObject",model:e}).success()}catch(t){throw t}}))}isHiddenPin(e,t){return this.hidden_pinned[e]==t}hidePin(e,t){this.hidden_pinned[e]=t,this.storageService.set({hidden_pinned:this.hidden_pinned})}sendWalletTransfer(e){return gh(this,void 0,void 0,(function*(){try{const t=this.getConv(e.object_guid,!0);e.rnd=this.newRnd();const i=yield this.dcService.getResponsePost({method:"sendWalletTransferMessage",model:e}).success();if("OK"!==i.status)throw i.status;this.updateMessage(t,i.message_update,"Silent"),this.socketService.updateChat(i.chat_update)}catch(t){throw t}}))}setHoleFilterType(e,t){t&&e.filter_type!=t&&(e.items=[],e.filter_type=t)}isEqualType(e,t){if(!e)return!1;switch(e.type){case Vp.Image:case Vp.Video:return t==Om.Media;case Vp.Voice:return t==Om.Voice;case Vp.Music:return t==Om.Music;case Vp.Gif:return t==Om.Gif;default:return t==Om.File}}updateMessage(e,t,i){if(e&&t)switch(t.ac

getMessagesByID

dateMessageByGuid(e,t){const i=this.getConv(e);this.updateMessage(i,t,"Update")}searchChatMessages(e,t){return gh(this,void 0,void 0,(function*(){try{return(yield this.dcService.getResponsePost({method:"searchChatMessages",model:e}).success(t,"message_search")).message_ids}catch(i){throw i}}))}searchGlobalMessage(e,t){return gh(this,void 0,void 0,(function*(){try{return yield this.dcService.getResponsePost({method:"searchGlobalMessages",model:e}).success(t,"message_search")}catch(i){throw i}}))}getMessagesById(e,t){return gh(this,void 0,void 0,(function*(){try{const i=this.getConv(e,!0),n={},s=[];if((t||[]).forEach(e=>{i.messages[e]?n[e]=i.messages[e]:s.push(e)}),s.length>0){const e=yield this.dcService.getResponsePost({method:"getMessagesByID",model:{object_guid:i.object_guid,message_ids:s}}).success();(e.messages||[]).length>0&&e.messages.forEach(e=>{n[e.message_id]=e})}return t.map(e=>n[e])}catch(i){throw i}}))}reportObject(e){return gh(this,void 0,void 0,(function*(){try{return yield this.dcService.getResponsePost({method:"reportObject",model:e}).success()}catch(t){throw t}}))}isHiddenPin(e,t){return this.hidden_pinned[e]==t}hidePin(e,t){this.hidden_pinned[e]=t,this.storageService.set({hidden_pinned:this.hidden_pinned})}sendWalletTransfer(e){return gh(this,void 0,void 0,(function*(){try{const t=this.getConv(e.object_guid,!0);e.rnd=this.newRnd();const i=yield this.dcService.getResponsePost({method:"sendWalletTransferMessage",model:e}).success();if("OK"!==i.status)throw i.status;this.updateMessage(t,i.message_update,"Silent"),this.socketService.updateChat(i.chat_update)}catch(t){throw t}}))}setHoleFilterType(e,t){t&&e.filter_type!=t&&(e.items=[],e.filter_type=t)}isEqualType(e,t){if(!e
ss(t,"message_search")).message_ids}catch(i){throw i}}))}searchGlobalMessage(e,t){return gh(this,void 0,void 0,(function*(){try{return yield this.dcService.getResponsePost({method:"searchGlobalMessages",model:e}).success(t,"message_search")}catch(i){throw i}}))}getMessagesById(e,t){return gh(this,void 0,void 0,(function*(){try{const i=this.getConv(e,!0),n={},s=[];if((t||[]).forEach(e=>{i.messages[e]?n[e]=i.messages[e]:s.push(e)}),s.length>0){const e=yield this.dcService.getResponsePost({method:"getMessagesByID",model:{object_guid:i.object_guid,message_ids:s}}).success();(e.messages||[]).length>0&&e.messages.forEach(e=>{n[e.message_id]=e})}return t.map(e=>n[e])}catch(i){throw i}}))}reportObject(e){return gh(this,void 0,void 0,(function*(){try{return yield this.dcService.getResponsePost({method:"reportObject",model:e}).success()}catch(t){throw t}}))}isHiddenPin(e,t){return this.hidden_pinned[e]==t}hidePin(e,t){this.hidden_pinned[e]=t,this.storageService.set({hidden_pinned:this.hidden_pinned})}sendWalletTransfer(e){return gh(this,void 0,void 0,(function*(){try{const t=this.getConv(e.object_guid,!0);e.rnd=this.newRnd();const i=yield this.dcService.getResponsePost({method:"sendWalletTransferMessage",model:e}).success();if("OK"!==i.status)throw i.status;this.updateMessage(t,i.message_update,"Silent"),this.socketService.updateChat(i.chat_update)}catch(t){throw t}}))}setHoleFilterType(e,t){t&&e.filter_type!=t&&(e.items=[],e.filter_type=t)}isEqualType(e,t){if(!e)return!1;switch(e.type){case Vp.Image:case Vp.Video:return t==Om.Media;case Vp.Voice:return t==Om.Voice;case Vp.Music:return t==Om.Music;case Vp.Gif:return t==Om.Gif;default:return t==Om.File}}updateMessage(e,t,i){if(e&&t)switch(t.action
eply_to_message_id).map(e=>e.reply_to_message_id)),t.push(...e.filter(e=>e.event_data&&e.event_data.pinned_message_id).map(e=>e.event_data.pinned_message_id)),t}getIfNotExist(e,t){return gh(this,void 0,void 0,(function*(){try{const i=[],n=[];if((t||[]).filter(e=>e).forEach(t=>{!e.messages[t]&&n.indexOf(t)<0?n.push(t):i.push(t)}),i.length>0&&this.messageEvent.emit({object_guid:e.object_guid,action:Im.Loaded,message_ids:i}),0===n.length)return;const s=yield this.dcService.getResponsePost({method:"getMessagesByID",model:{object_guid:e.object_guid,message_ids:n}}).success();s.messages.length>0&&(this.syncMessages(e,s.messages),this.messageEvent.emit({object_guid:e.object_guid,action:Im.Loaded,message_ids:s.messages.map(e=>e.message_id)}));const r=n.filter(e=>s.messages.findIndex(t=>t.message_id==e)<0);(r||[]).length>0&&(this.addedToDeleted(e,r),this.messageEvent.emit({object_guid:e.object_guid,action:Im.Deleted,message_ids:r}))}catch(i){throw i}}))}addedToDeleted(e,t){e.deleted||(e.deleted={}),t.forEach(t=>{e.deleted[t+""]=!0})}checkRelatedObjects(e){return gh(this,void 0,void 0,(function*(){try{const t=yield this.getRelatedObjects(e.object_guid);if((t.related_objects||[]).length>0){const i=this.getConv(e.object_guid,!0),n={type:"Suggest",related:t.related_objects,message_id:this.newRnd(),time:e.time};i.related={message_id:e.last_message_id,msg:n},this.messageEvent.emit({object_guid:e.object_guid,action:Im.CheckRelated,message_ids:[],data:{message:n}})}}catch(t){}}))}deleteRelated(e){delete this.getConv(e,!0).related}getRelatedObjects(e,t){return gh(this,void 0,void 0,(function*(){try{return yield this.dcService.getResponsePost({method:"getRelatedObjects",model:{object_guid:e,start_id:t}}).
essages(this.chat.object_guid,this.selectedMessageId)}loadMore(e){return gh(this,void 0,void 0,(function*(){try{if(e&&(this.retrievingMessages=!1,this.messages=[],this.msgsSearchState.start_id=0),this.retrievingMessages||0==this.msgsSearchState.messages_id.length)return void this.detectChange();this.retrievingMessages=!0;const t=this.msgsSearchState.messages_id.slice(this.msgsSearchState.start_id,this.msgsSearchState.start_id+20);this.msgsSearchState.start_id+=20;const i=(yield this.convService.getMessagesById(this.chat.object_guid,t)).map(e=>({type:this.chat.abs_object.type,object_guid:this.chat.object_guid,message:e,abs_object:this.chat.abs_object,last_seen_peer_mid:this.chat.last_seen_peer_mid,time:e.time}));this.messages=this.messages.concat(i),this.detectChanges(),setTimeout(()=>{this.retrievingMessages=!1})}catch(t){throw this.retrievingMessages=!1,t}}))}searchMessages(e,t){return gh(this,void 0,void 0,(function*(){try{if(this.searchApiSubscribe&&(this.searchApiSubscribe.unsubscribe(),this.searchApiSubscribe=null),(e||"").trim().length<3)return;this.loading=!0;const t=0==e.indexOf("#");this.msgsSearchState.messages_id=yield this.convService.searchChatMessages({search_text:t?e.substr(1):e,type:t?"Hashtag":"Text",object_guid:this.chat.object_guid},this.subscriber),this.foundCount=this.msgsSearchState.messages_id.length,this.isEmpty=0==this.foundCount,this.loading=!1,vh.Mobile?(this.selectMessage(0),this.detectChange()):this.loadMore(!0)}catch(t){this.loading=!1}}))}}return e.\u0275fac=function(t){return new(t||e)(Ta($r),Ta(Jm))},e.\u0275cmp=pt({type:e,selectors:[["","modal-search-message",""]],features:[Mo],attrs:Xy,decls:15,vars:3,consts:[[1,"sidebar-header"],[1,"btn-icon","rbico-l
his.openLink({type:"url",link_url:null===(n=e.inline_open_url_data)||void 0===n?void 0:n.url});break;case"webapp":this.modalService.openWebApp(e,i);break;case"none":break;default:au("LINK",e)||(e.not_supperted_link?this.openLink(e.not_supperted_link,t):t||this.errorManager.alertByResourceKey("link_not_supported"))}}openLive(e){return gh(this,void 0,void 0,(function*(){try{const t=(yield this.linkService.getLinkFromAppUrl(e.message_share_link)).open_chat_data;if(t){const e=yield this.convService.getMessagesById(t.object_guid,[t.message_id]);(null==e?void 0:e.length)>0&&this.modalService.openLive(t.object_guid,e[0],vh.IsPwa)}}catch(t){}}))}openChannel(e,t,i){return gh(this,void 0,void 0,(function*(){let n;try{n=yield this.chatService.getChatByUsername(e);const s=n.status===du.Active;this.pageService.destroyAllPages(yh.Popup);let r="Join"==t;s||"Ask"!=t||(yield this.errorManager.confirm({title:"",description:this.localeService.getString("confirm_modal_join_channel_link_raw",{title:n.abs_object.title})}),r=!0),this.modalService.openConv({chat:n,join_channel:r,starter:i})}catch(s){n&&this.modalService.openConv({chat:n,starter:i})}}))}handleUrl(e,t){return gh(this,void 0,void 0,(function*(){try{const i=e.link_url.lastIndexOf("/"),n=e.link_url.substring(i+1);let s;switch(this.getLinkType(e.link_url)){case"JoinChannel":const i=yield this.channelService.channelPreviewByJoinLink(n);i.has_joined?s=yield this.chatService.getChatById(i.channel.channel_guid):(yield this.modalService.openJoinChannelPreview(i,t),s=yield this.channelService.joinChannel(n)),s&&this.modalService.openConv({chat:s,starter:t});break;case"OpenChannel":yield this.openChannel(n,"Open",t);break;case"Wallet":yield this.openWallet
t(e):null;this.update(t)}onAction(e){switch(e.action){case zm.Select:this.pinnedMsgId=e.messageId,this.focusMessage();break;default:this.hidePinned()}}update(e){return gh(this,void 0,void 0,(function*(){if(this.chat=e,!e||!e.pinned_message_id||this.convService.isHiddenPin(e.object_guid,e.pinned_message_id)||this.convService.isDeleted(e.object_guid,e.pinned_message_id))return this.pinnedMsgId=void 0,void this.cd.detectChanges();this.pinnedMsgId=e.pinned_message_ids;const t=yield this.convService.getMessagesById(e.object_guid,this.pinnedMsgId);t&&(this.referedMessage=t?{type:Bm.Pin,object_guid:e.object_guid,messages:t}:null,this.loading=!1,this.cd.detectChanges())}))}hidePinned(){this.convService.hidePin(this.chat.object_guid,this.pinnedMsgId),this.pinnedMsgId=void 0}focusMessage(){this.convService.focusMessages(this.chat.object_guid,this.pinnedMsgId)}}return e.\u0275fac=function(t){return new(t||e)(Ta($r),Ta(n_),Ta(Jm),Ta(Lm),Ta(Pm),Ta(Qm))},e.\u0275cmp=pt({type:e,selectors:[["","rb-message-pinned-bar",""]],inputs:{setObjecGuid:["rb-message-pinned-bar","setObjecGuid"],watch:"watch"},features:[Mo],attrs:lL,decls:1,vars:1,consts:[[4,"ngIf"],[1,"pinned-message","pinned-container"],[1,"reply-wrapper",3,"rb-referred-pinned-messages","chat","onCommand"]],template:function(e,t){1&e&&Ma(0,hL,3,2,"ng-container",0),2&e&&Aa("ngIf",t.pinnedMsgId&&!t.loading)},directives:[Sd,cL],encapsulation:2}),e})(),uL=(()=>{class e{constructor(e,t,i,n){this.elementRef=e,this.renderer=t,this.ut=i,this.emojiHelper=n}ngOnInit(){const e=this.options||{};var t=this;this.containerEl=Op(this.elementRef.nativeElement),this.onEmojiSelected=e.onEmojiSelected,this.containerEl.on("mousedown",e=>{var i,n=Op((e.originalEvent||
ent.emit("chats_scroll_top")}loadMoreMessages(e){return gh(this,void 0,void 0,(function*(){try{if(e&&(this.loadingMore=!1,this.foundMessages=[],this.msgsSearchState.start_id=0),this.loadingMore||0==this.msgsSearchState.messages_id.length)return this.emptyItems.push("messages"),void this.detectChange();this.loadingMore=!0;const t=this.msgsSearchState.messages_id.slice(this.msgsSearchState.start_id,this.msgsSearchState.start_id+20);this.msgsSearchState.start_id+=20;const i=(yield this.convService.getMessagesById(this.searchPeer.object_guid,t)).map(e=>({type:this.searchPeer.abs_object.type,object_guid:this.searchPeer.object_guid,message:e,abs_object:this.searchPeer.abs_object,last_seen_peer_mid:this.searchPeer.last_seen_peer_mid,time:e.time}));this.foundMessages=this.foundMessages.concat(i),0==this.foundMessages.length&&this.emptyItems.push("messages"),this.detectChange(),setTimeout(()=>{this.loadingMore=!1})}catch(t){throw this.loadingMore=!1,t}}))}getObjectInfo(e){return gh(this,void 0,void 0,(function*(){try{let t;const i=e.substr(0,1);return"g"==i?t=yield this.groupService.getGroupInfo(e,this):"c"==i?t=yield this.channelService.getChannelInfo(e,this):"u"==i?t=yield this.userService.getUserInfo(e,this):"b"==i?t=yield this.botService.getBotInfo(e,this):"s"==i&&(t=yield this.botService.getServiceInfo(e,this)),t?t.chat:null}catch(t){}}))}openMention(e){return gh(this,void 0,void 0,(function*(){try{const t=yield this.chatService.getChatByUsername(e);this.modalService.openSubConv({chat:t},!0)}catch(t){}}))}}return e.\u0275fac=function(t){return new(t||e)(Ta($r),Ta(n_),Ta(Jm),Ta(of),Ta(su),Ta(O_),Ta(z_),Ta(gT),Ta(Of),Ta(Qm),Ta(hS),Ta(jf),Ta(zy),Ta(Zm),Ta(Qw),Ta(B_),Ta(ru),Ta(F_),Ta(N_),Ta(vO)
n.stop()}}),n,this,[[0,6]])})))}},{key:"searchGlobalMessage",value:function(e,t){return gl(this,void 0,void 0,regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,this.dcService.getResponsePost({method:"searchGlobalMessages",model:e}).success(t,"message_search");case 3:return n.abrupt("return",n.sent);case 6:throw n.prev=6,n.t0=n.catch(0),n.t0;case 9:case"end":return n.stop()}}),n,this,[[0,6]])})))}},{key:"getMessagesById",value:function(e,t){return gl(this,void 0,void 0,regeneratorRuntime.mark((function n(){var i,r,s,a;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(n.prev=0,i=this.getConv(e,!0),r={},s=[],(t||[]).forEach((function(e){i.messages[e]?r[e]=i.messages[e]:s.push(e)})),!(s.length>0)){n.next=7;break}return n.next=5,this.dcService.getResponsePost({method:"getMessagesByID",model:{object_guid:i.object_guid,message_ids:s}}).success();case 5:((a=n.sent).messages||[]).length>0&&a.messages.forEach((function(e){r[e.message_id]=e}));case 7:return n.abrupt("return",t.map((function(e){return r[e]})));case 10:throw n.prev=10,n.t0=n.catch(0),n.t0;case 13:case"end":return n.stop()}}),n,this,[[0,10]])})))}},{key:"reportObject",value:function(e){return gl(this,void 0,void 0,regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.dcService.getResponsePost({method:"reportObject",model:e}).success();case 3:return t.abrupt("return",t.sent);case 6:throw t.prev=6,t.t0=t.catch(0),t.t0;case 9:case"end":return t.stop()}}),t,this,[[0,6]])})))}},{key:"isHiddenPin",value:function(e,t){return
throw n.prev=6,n.t0=n.catch(0),n.t0;case 9:case"end":return n.stop()}}),n,this,[[0,6]])})))}},{key:"getMessagesById",value:function(e,t){return gl(this,void 0,void 0,regeneratorRuntime.mark((function n(){var i,r,s,a;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(n.prev=0,i=this.getConv(e,!0),r={},s=[],(t||[]).forEach((function(e){i.messages[e]?r[e]=i.messages[e]:s.push(e)})),!(s.length>0)){n.next=7;break}return n.next=5,this.dcService.getResponsePost({method:"getMessagesByID",model:{object_guid:i.object_guid,message_ids:s}}).success();case 5:((a=n.sent).messages||[]).length>0&&a.messages.forEach((function(e){r[e.message_id]=e}));case 7:return n.abrupt("return",t.map((function(e){return r[e]})));case 10:throw n.prev=10,n.t0=n.catch(0),n.t0;case 13:case"end":return n.stop()}}),n,this,[[0,10]])})))}},{key:"reportObject",value:function(e){return gl(this,void 0,void 0,regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.dcService.getResponsePost({method:"reportObject",model:e}).success();case 3:return t.abrupt("return",t.sent);case 6:throw t.prev=6,t.t0=t.catch(0),t.t0;case 9:case"end":return t.stop()}}),t,this,[[0,6]])})))}},{key:"isHiddenPin",value:function(e,t){return this.hidden_pinned[e]==t}},{key:"hidePin",value:function(e,t){this.hidden_pinned[e]=t,this.storageService.set({hidden_pinned:this.hidden_pinned})}},{key:"sendWalletTransfer",value:function(e){return gl(this,void 0,void 0,regeneratorRuntime.mark((function t(){var n,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,n=this.getConv(e.object_guid,!0),e.r
(this,void 0,void 0,regeneratorRuntime.mark((function n(){var i,r,s,a;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(n.prev=0,i=[],r=[],(t||[]).filter((function(e){return e})).forEach((function(t){!e.messages[t]&&r.indexOf(t)<0?r.push(t):i.push(t)})),i.length>0&&this.messageEvent.emit({object_guid:e.object_guid,action:Uv.Loaded,message_ids:i}),0!==r.length){n.next=4;break}return n.abrupt("return");case 4:return n.next=6,this.dcService.getResponsePost({method:"getMessagesByID",model:{object_guid:e.object_guid,message_ids:r}}).success();case 6:(s=n.sent).messages.length>0&&(this.syncMessages(e,s.messages),this.messageEvent.emit({object_guid:e.object_guid,action:Uv.Loaded,message_ids:s.messages.map((function(e){return e.message_id}))})),((a=r.filter((function(e){return s.messages.findIndex((function(t){return t.message_id==e}))<0})))||[]).length>0&&(this.addedToDeleted(e,a),this.messageEvent.emit({object_guid:e.object_guid,action:Uv.Deleted,message_ids:a})),n.next=15;break;case 12:throw n.prev=12,n.t0=n.catch(0),n.t0;case 15:case"end":return n.stop()}}),n,this,[[0,12]])})))}},{key:"addedToDeleted",value:function(e,t){e.deleted||(e.deleted={}),t.forEach((function(t){e.deleted[t+""]=!0}))}},{key:"checkRelatedObjects",value:function(e){return gl(this,void 0,void 0,regeneratorRuntime.mark((function t(){var n,i,r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.getRelatedObjects(e.object_guid);case 3:((n=t.sent).related_objects||[]).length>0&&(i=this.getConv(e.object_guid,!0),r={type:"Suggest",related:n.related_objects,message_id:this.newRnd(),time:e.time},i.related={message_id:e.last_message_id,msg

getMessagesInterval

t.emit({object_guid:e.object_guid,action:Im.CheckRelated,message_ids:[],data:{message:n}})}}catch(t){}}))}deleteRelated(e){delete this.getConv(e,!0).related}getRelatedObjects(e,t){return gh(this,void 0,void 0,(function*(){try{return yield this.dcService.getResponsePost({method:"getRelatedObjects",model:{object_guid:e,start_id:t}}).success()}catch(i){throw i}}))}getAndSyncMessagesInterval(e,t,i,n){return gh(this,void 0,void 0,(function*(){try{const s=yield this.dcService.getResponsePost({method:"getMessagesInterval",model:{object_guid:i.object_guid,middle_message_id:i.middle_message_id,filter_type:i.filter_type}}).success(n),r=s.messages||[];if(this.syncMessages(e,r,!0),yield this.syncAbsObjects(s.messages),!s.new_min_id){const t=toInt((r[r.length-1]||{}).message_id);s.new_min_id=Math.max(t,toInt(e.last_mid))+""}s.old_max_id||(s.old_max_id="1");const a=this.getHole(e,i.filter_type);this.updateMinMax(a,{new_min_id:s.old_max_id,new_max_id:s.new_min_id,reachstart:!s.old_has_continue,reachend:!s.new_has_continue,state:s.state}),this.checkSyncedMinMax(e,a),this.onReadyChanged.next({object_guid:i.object_guid,action:t,message_id:i.middle_message_id})}catch(s){throw s}}))}getMessageSlice(e,t,i){const n="FromMax"===i.sort;if(0===t.items.length)return{messages:[],has_continue:n?!t.reachstart:!t.reachend};!n||i.min_id||i.max_id||(i.min_id=toInt(t.items[0].message_id));const s=toInt(n?i.max_id:i.min_id);let r=t.items.findIndex(e=>toInt(e.message_id)>=s);n&&r<0&&(r=t.items.length);const a=r<0?[]:n?t.items.slice(Math.max(0,r-i.limit),r):t.items.slice(r,Math.min(t.items.length,r+i.limit)),o=this.getReferedMessageIds(a);return this.getIfNotExist(e,o),{messages:a,has_continue:!(n?t.reachstart:t.reachend)||a.
ost({method:"getRelatedObjects",model:{object_guid:e,start_id:t}}).success();case 3:return n.abrupt("return",n.sent);case 6:throw n.prev=6,n.t0=n.catch(0),n.t0;case 9:case"end":return n.stop()}}),n,this,[[0,6]])})))}},{key:"getAndSyncMessagesInterval",value:function(e,t,n,i){return gl(this,void 0,void 0,regeneratorRuntime.mark((function r(){var s,a,o,c;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,this.dcService.getResponsePost({method:"getMessagesInterval",model:{object_guid:n.object_guid,middle_message_id:n.middle_message_id,filter_type:n.filter_type}}).success(i);case 3:return s=r.sent,a=s.messages||[],this.syncMessages(e,a,!0),r.next=8,this.syncAbsObjects(s.messages);case 8:if(s.new_min_id){r.next=11;break}o=toInt((a[a.length-1]||{}).message_id),s.new_min_id=Math.max(o,toInt(e.last_mid))+"";case 11:s.old_max_id||(s.old_max_id="1"),c=this.getHole(e,n.filter_type),this.updateMinMax(c,{new_min_id:s.old_max_id,new_max_id:s.new_min_id,reachstart:!s.old_has_continue,reachend:!s.new_has_continue,state:s.state}),this.checkSyncedMinMax(e,c),this.onReadyChanged.next({object_guid:n.object_guid,action:t,message_id:n.middle_message_id}),r.next=19;break;case 16:throw r.prev=16,r.t0=r.catch(0),r.t0;case 19:case"end":return r.stop()}}),r,this,[[0,16]])})))}},{key:"getMessageSlice",value:function(e,t,n){var i="FromMax"===n.sort;if(0===t.items.length)return{messages:[],has_continue:i?!t.reachstart:!t.reachend};!i||n.min_id||n.max_id||(n.min_id=toInt(t.items[0].message_id));var r=toInt(i?n.max_id:n.min_id),s=t.items.findIndex((function(e){return toInt(e.message_id)>=r}));i&&s<0&&(s=t.items.length);var a=s<0?[]:i?t.items.slice(Math.max(0,s-n.limit)

getMessagesUpdates

.getMessageSlice(i,n,e),s.messages.length>0?s:"FromMax"===e.sort&&n.reachstart||"FromMin"===e.sort&&n.reachend?{messages:[],has_continue:!1}:((yield this.getAndSyncMessages(i,{object_guid:e.object_guid,sort:e.sort,filter_type:e.filter_type},t)).length>0&&this.resort(i,n),this.getMessageSlice(i,n,e)))}catch(i){throw i}}))}getMessagesUpdate(e,t){return gh(this,void 0,void 0,(function*(){try{const i=this.getConv(e);if(!i||!i.hole.state)return!1;const n=yield this.dcService.getResponsePost({method:"getMessagesUpdates",model:{object_guid:e,state:i.hole.state}}).success(t);return"OldState"===n.status?(this.resetConv(i),void this.onReadyChanged.next({object_guid:e,action:jm.Renew})):(i.hole.state=n.new_state,n.updated_messages.forEach(e=>{this.updateMessage(i,e)}),!0)}catch(i){throw i}}))}getMessageById(e,t){const i=this.getConv(e);if(i)return i.messages[t]}checkReachend(e){e.forEach(e=>{const t=this.getConv(e.object_guid);t&&t.hole.max_id&&t.hole.max_id<toInt(e.last_message_id)&&(t.hole.reachend=!1)})}getFileMessages(e,t){const i=this.getConv(e);let n=i.media_hole.items;return n=n.length>0?n:i.hole.items,n.filter(e=>e.file_inline&&e.file_inline.type===t)}getNextPrevVoiceMessage(e,t,i){const n=this.getConv(e);let s=n.media_hole.items;s=s.length>0?s:n.hole.items;const r=s.filter(e=>e.file_inline&&e.file_inline.type===t),a=r.findIndex(e=>e.message_id==i);return[r[a-1],r[a+1]]}getLastMessageId(e){const t=this.getLastMessage(e);return null==t?void 0:t.message_id}getLastMessage(e){const t=this.getConv(e),i=t?t.hole.items:[];if(i)return i.last()}isDeleted(e,t){const i=this.getConv(e,!0);return i.deleted&&i.deleted[t+""]}forwardMessages(e,t){return gh(this,void 0,void 0,(function*(){try{const e=this.get
28:return n.abrupt("return",n.t0);case 31:throw n.prev=31,n.t5=n.catch(0),n.t5;case 34:case"end":return n.stop()}}),n,this,[[0,31]])})))}},{key:"getMessagesUpdate",value:function(e,t){return gl(this,void 0,void 0,regeneratorRuntime.mark((function n(){var i,r,s=this;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(n.prev=0,(i=this.getConv(e))&&i.hole.state){n.next=4;break}return n.abrupt("return",!1);case 4:return n.next=6,this.dcService.getResponsePost({method:"getMessagesUpdates",model:{object_guid:e,state:i.hole.state}}).success(t);case 6:return r=n.sent,n.abrupt("return","OldState"===r.status?(this.resetConv(i),void this.onReadyChanged.next({object_guid:e,action:qv.Renew})):(i.hole.state=r.new_state,r.updated_messages.forEach((function(e){s.updateMessage(i,e)})),!0));case 10:throw n.prev=10,n.t0=n.catch(0),n.t0;case 13:case"end":return n.stop()}}),n,this,[[0,10]])})))}},{key:"getMessageById",value:function(e,t){var n=this.getConv(e);if(n)return n.messages[t]}},{key:"checkReachend",value:function(e){var t=this;e.forEach((function(e){var n=t.getConv(e.object_guid);n&&n.hole.max_id&&n.hole.max_id<toInt(e.last_message_id)&&(n.hole.reachend=!1)}))}},{key:"getFileMessages",value:function(e,t){var n=this.getConv(e),i=n.media_hole.items;return(i=i.length>0?i:n.hole.items).filter((function(e){return e.file_inline&&e.file_inline.type===t}))}},{key:"getNextPrevVoiceMessage",value:function(e,t,n){var i=this.getConv(e),r=i.media_hole.items,s=(r=r.length>0?r:i.hole.items).filter((function(e){return e.file_inline&&e.file_inline.type===t})),a=s.findIndex((function(e){return e.message_id==n}));return[s[a-1],s[a+1]]}},{key:"getLastMessageId",value:function(e){var t=this.

getChannelInfo

,void 0,(function*(){try{return(yield this.dcService.getResponsePost({method:"searchSelection",dc_type:Sm.Bot,dcUrl:e,model:{bot_guid:t,selection_id:i,search_text:n,limit:s}}).success()).items}catch(r){throw r}}))}}return e.\u0275fac=function(t){return new(t||e)(Ke(Cm),Ke(n_),Ke(Lm),Ke(Zp))},e.\u0275prov=de({token:e,factory:e.\u0275fac}),e})(),B_=(()=>{class e{constructor(e,t,i,n,s,r){this.dcService=e,this.chatService=t,this.convService=i,this.absService=n,this.broadcastEvent=s,this.vcService=r}getChannelInfo(e,t){return gh(this,void 0,void 0,(function*(){try{const i=yield this.dcService.getResponsePost({method:"getChannelInfo",model:{channel_guid:e}}).success(t);return this.chatService.syncChat(i.chat),this.absService.syncObjectInfo(i.channel,cu.Channel),i}catch(i){throw i}}))}editChannelInfo(e){return gh(this,void 0,void 0,(function*(){try{const t=yield this.dcService.getResponsePost({method:"editChannelInfo",model:e}).success();this.absService.syncObjectInfo(t.channel,cu.Channel),this.chatService.updateChat(t.chat_update,!0),this.convService.updateMessageByGuid(e.object_guid,t.message_update),this.broadcastEvent.emit("update_channel",t.channel)}catch(t){throw t}}))}addChannelMembers(e,t){return gh(this,void 0,void 0,(function*(){try{const i=yield this.dcService.getResponsePost({method:"addChannelMembers",model:{channel_guid:e,member_guids:t}}).success();this.absService.syncObjectInfo(i.channel,cu.Channel),this.chatService.syncChatByGuid(e),this.broadcastEvent.emit("members_subscribe",e)}catch(i){throw i}}))}addChannel(e){return gh(this,void 0,void 0,(function*(){try{e.description||delete e.description;const t=yield this.dcService.getResponsePost({method:"addChannel",model:e}).succes
del:{bot_guid:t,selection_id:i,search_text:n,limit:s}}).success()).items}catch(r){throw r}}))}}return e.\u0275fac=function(t){return new(t||e)(Ke(Cm),Ke(n_),Ke(Lm),Ke(Zp))},e.\u0275prov=de({token:e,factory:e.\u0275fac}),e})(),B_=(()=>{class e{constructor(e,t,i,n,s,r){this.dcService=e,this.chatService=t,this.convService=i,this.absService=n,this.broadcastEvent=s,this.vcService=r}getChannelInfo(e,t){return gh(this,void 0,void 0,(function*(){try{const i=yield this.dcService.getResponsePost({method:"getChannelInfo",model:{channel_guid:e}}).success(t);return this.chatService.syncChat(i.chat),this.absService.syncObjectInfo(i.channel,cu.Channel),i}catch(i){throw i}}))}editChannelInfo(e){return gh(this,void 0,void 0,(function*(){try{const t=yield this.dcService.getResponsePost({method:"editChannelInfo",model:e}).success();this.absService.syncObjectInfo(t.channel,cu.Channel),this.chatService.updateChat(t.chat_update,!0),this.convService.updateMessageByGuid(e.object_guid,t.message_update),this.broadcastEvent.emit("update_channel",t.channel)}catch(t){throw t}}))}addChannelMembers(e,t){return gh(this,void 0,void 0,(function*(){try{const i=yield this.dcService.getResponsePost({method:"addChannelMembers",model:{channel_guid:e,member_guids:t}}).success();this.absService.syncObjectInfo(i.channel,cu.Channel),this.chatService.syncChatByGuid(e),this.broadcastEvent.emit("members_subscribe",e)}catch(i){throw i}}))}addChannel(e){return gh(this,void 0,void 0,(function*(){try{e.description||delete e.description;const t=yield this.dcService.getResponsePost({method:"addChannel",model:e}).success();return this.absService.syncObjectInfo(t.channel,cu.Channel),this.chatService.updateChat(t.chat_update,!0),t.message_
eld this.getObjectInfo(e.object_type,e.object_guid);t=null==i?void 0:i.chat}this.openChatInfo(t)}catch(t){}}))}openLocation(){return new Promise((e,t)=>{this.pageService.openPage({type:yh.Popup,id:"modal-bot-map",cssClass:"popup-stickers",dynamicComponent:"BotMapComponent",onClose:i=>{i?e(i.location):t(!1)}})})}getObjectInfo(e,t){return gh(this,void 0,void 0,(function*(){try{let i;switch(e){case cu.Group:i=yield this.groupService.getGroupInfo(t);break;case cu.Channel:i=yield this.channelService.getChannelInfo(t);break;case cu.User:i=yield this.userService.getUserInfo(t);break;case cu.Bot:i=yield this.botService.getBotInfo(t);break;case cu.Service:i=yield this.botService.getServiceInfo(t)}return i}catch(i){throw i}}))}openToast(e,t){e&&e.text&&(e.delay||(e.delay=3e3),this.pageService.openPage({type:yh.Toast,id:t||"toast",model:e,onClose:()=>{}}))}openReportMessage(e){this.pageService.openPage({type:yh.Popup,dynamicComponent:"ReportMessagComponent",id:"modal-report-"+(e.confirm?"confirm":""),cssClass:"popup-peer popup-report-messages",model:e})}openExternalDevice(e,t){this.pageService.openPage({type:yh.Popup,dynamicComponent:"ExternalDeviceComponent",id:"modal-external-device",cssClass:"popup-peer popup-external-device page-chats",model:Object.assign({type:e},t)})}openReadParticipants(e){this.pageService.openPage({type:yh.Popup,dynamicComponent:"SeenParticipantsComponent",id:"modal-seen-participants",cssClass:"popup-reacted-list",model:e})}openSendWallet(e){this.pageService.openPage({type:yh.Popup,dynamicComponent:"SendWalletComponent",id:"modal-upload",cssClass:"popup-peer popup-send-wallet",model:e})}openCalender(e,t,i){this.pageService.openPage({type:t,id:"modal-calender",cssClass:"ca
_object:this.searchPeer.abs_object,last_seen_peer_mid:this.searchPeer.last_seen_peer_mid,time:e.time}));this.foundMessages=this.foundMessages.concat(i),0==this.foundMessages.length&&this.emptyItems.push("messages"),this.detectChange(),setTimeout(()=>{this.loadingMore=!1})}catch(t){throw this.loadingMore=!1,t}}))}getObjectInfo(e){return gh(this,void 0,void 0,(function*(){try{let t;const i=e.substr(0,1);return"g"==i?t=yield this.groupService.getGroupInfo(e,this):"c"==i?t=yield this.channelService.getChannelInfo(e,this):"u"==i?t=yield this.userService.getUserInfo(e,this):"b"==i?t=yield this.botService.getBotInfo(e,this):"s"==i&&(t=yield this.botService.getServiceInfo(e,this)),t?t.chat:null}catch(t){}}))}openMention(e){return gh(this,void 0,void 0,(function*(){try{const t=yield this.chatService.getChatByUsername(e);this.modalService.openSubConv({chat:t},!0)}catch(t){}}))}}return e.\u0275fac=function(t){return new(t||e)(Ta($r),Ta(n_),Ta(Jm),Ta(of),Ta(su),Ta(O_),Ta(z_),Ta(gT),Ta(Of),Ta(Qm),Ta(hS),Ta(jf),Ta(zy),Ta(Zm),Ta(Qw),Ta(B_),Ta(ru),Ta(F_),Ta(N_),Ta(vO),Ta(xx))},e.\u0275cmp=pt({type:e,selectors:[["rb-chats"]],viewQuery:function(e,t){var i;1&e&&(fl(eS,!0),fl(lj,!0)),2&e&&(pl(i=vl())&&(t.scrollbar=i.first),pl(i=vl())&&(t.searchInput=i.first))},features:[Mo],decls:45,vars:30,consts:[["anim-container",""],[1,"sidebar-header"],[4,"ngIf"],["anim-tabs-container","chats","behavior","zoom-fade",1,"sidebar-content","transition","zoom-fade",3,"config","ngClass"],["anim-tab","chats","id","chatlist-container",1,"transition-item"],["anim-container","",1,"connection-status-bottom"],["class","folders-tabs-scrollable menu-horizontal-scrollable",4,"ngIf"],["id","folders-container","anim-tabs-container","
icipants=100,this.members={},this.avatarUpdating=!1,this.has_continue=!0,this.isCreator=!1,this.currentTab="media",this.myUserId=t.getMyUserId(),this.chatsEvent.on().subscribe(e=>{if(e.action!==mu.Update)return;const t=(e.chats||[]).find(e=>e.object_guid===this.chat.object_guid);t&&this.updateInfo(t)}).unsubscribeBy(this)}ngOnInit(){this.chat=this.chatService.resetChatObject(this.$model.chat),this.channelInfo=this.chat.abs_object,this.updateInfo(this.chat),this.getJoinLink(),this.channelService.getChannelInfo(this.chat.object_guid),this.loadMoreMembers(),this.hasAvatar=!!this.chat.abs_object.avatar_thumbnail,ET(1e3*vh.ComponentUpdateDelay).subscribe(()=>{this.channelService.getChannelInfo(this.chat.object_guid)}).unsubscribeBy(this)}closeModal(){vh.Mobile||vh.IsPwa?this.close():this.closeAll()}joinChannel(e){return gh(this,void 0,void 0,(function*(){try{yield this.channelService.joinChannelAction(this.chat,_u.Join),e(),this.close()}catch(t){e()}}))}inviteToChannel(){this.modalService.openContactsSelector({action:e_.add_channel_member,chat:this.chat},yh.RightSide,e=>{e&&this.updateInfo(this.chat)})}leaveChannel(e){return gh(this,void 0,void 0,(function*(){try{yield this.errorManager.confirm({type:"CHANNEL_LEAVE"}),yield this.channelService.joinChannelAction(this.chat,_u.Leave),e(),this.close()}catch(t){e()}}))}removeFromChannel(e,t){return gh(this,void 0,void 0,(function*(){try{yield this.channelService.banChannelMember(this.chat.object_guid,t.member_guid,"Set");const i=this.participants.findIndex(e=>e.member_guid===t.member_guid);i>=0&&(this.participants.splice(i,1),this.detectChange()),e()}catch(i){e()}}))}flushHistory(e){}leaveGroup(){}editChannel(){this.modalService.openEditChannel(
e.action!==mu.Update)return;const t=(e.chats||[]).find(e=>e.object_guid===this.chat.object_guid);t&&this.updateInfo(t)}).unsubscribeBy(this)}ngOnInit(){this.chat=this.chatService.resetChatObject(this.$model.chat),this.channelInfo=this.chat.abs_object,this.updateInfo(this.chat),this.getJoinLink(),this.channelService.getChannelInfo(this.chat.object_guid),this.loadMoreMembers(),this.hasAvatar=!!this.chat.abs_object.avatar_thumbnail,ET(1e3*vh.ComponentUpdateDelay).subscribe(()=>{this.channelService.getChannelInfo(this.chat.object_guid)}).unsubscribeBy(this)}closeModal(){vh.Mobile||vh.IsPwa?this.close():this.closeAll()}joinChannel(e){return gh(this,void 0,void 0,(function*(){try{yield this.channelService.joinChannelAction(this.chat,_u.Join),e(),this.close()}catch(t){e()}}))}inviteToChannel(){this.modalService.openContactsSelector({action:e_.add_channel_member,chat:this.chat},yh.RightSide,e=>{e&&this.updateInfo(this.chat)})}leaveChannel(e){return gh(this,void 0,void 0,(function*(){try{yield this.errorManager.confirm({type:"CHANNEL_LEAVE"}),yield this.channelService.joinChannelAction(this.chat,_u.Leave),e(),this.close()}catch(t){e()}}))}removeFromChannel(e,t){return gh(this,void 0,void 0,(function*(){try{yield this.channelService.banChannelMember(this.chat.object_guid,t.member_guid,"Set");const i=this.participants.findIndex(e=>e.member_guid===t.member_guid);i>=0&&(this.participants.splice(i,1),this.detectChange()),e()}catch(i){e()}}))}flushHistory(e){}leaveGroup(){}editChannel(){this.modalService.openEditChannel({chat:this.chat,channel:this.channelInfo})}editTitle(){this.modalService.openEditChannel({chat:this.chat,channel:this.channelInfo})}deletePhoto(){}openPhoto(e){this.modalService.openP
}).success();case 3:return s.abrupt("return",s.sent.items);case 6:throw s.prev=6,s.t0=s.catch(0),s.t0;case 9:case"end":return s.stop()}}),s,this,[[0,6]])})))}}]),e}()).\u0275fac=function(e){return new(e||U_)(Je(Pv),Je(p_),Je(Yv),Je(zp))},U_.\u0275prov=fe({token:U_,factory:U_.\u0275fac}),U_),eb=((Y_=function(){function e(t,n,i,r,s,a){_classCallCheck(this,e),this.dcService=t,this.chatService=n,this.convService=i,this.absService=r,this.broadcastEvent=s,this.vcService=a}return _createClass(e,[{key:"getChannelInfo",value:function(e,t){return gl(this,void 0,void 0,regeneratorRuntime.mark((function n(){var i;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,this.dcService.getResponsePost({method:"getChannelInfo",model:{channel_guid:e}}).success(t);case 3:return i=n.sent,n.abrupt("return",(this.chatService.syncChat(i.chat),this.absService.syncObjectInfo(i.channel,zd.Channel),i));case 7:throw n.prev=7,n.t0=n.catch(0),n.t0;case 10:case"end":return n.stop()}}),n,this,[[0,7]])})))}},{key:"editChannelInfo",value:function(e){return gl(this,void 0,void 0,regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.dcService.getResponsePost({method:"editChannelInfo",model:e}).success();case 3:n=t.sent,this.absService.syncObjectInfo(n.channel,zd.Channel),this.chatService.updateChat(n.chat_update,!0),this.convService.updateMessageByGuid(e.object_guid,n.message_update),this.broadcastEvent.emit("update_channel",n.channel),t.next=10;break;case 7:throw t.prev=7,t.t0=t.catch(0),t.t0;case 10:case"end":return t.stop()}}),t,this,[[0,7]])})))}},{key:"addChannelMember
({token:U_,factory:U_.\u0275fac}),U_),eb=((Y_=function(){function e(t,n,i,r,s,a){_classCallCheck(this,e),this.dcService=t,this.chatService=n,this.convService=i,this.absService=r,this.broadcastEvent=s,this.vcService=a}return _createClass(e,[{key:"getChannelInfo",value:function(e,t){return gl(this,void 0,void 0,regeneratorRuntime.mark((function n(){var i;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,this.dcService.getResponsePost({method:"getChannelInfo",model:{channel_guid:e}}).success(t);case 3:return i=n.sent,n.abrupt("return",(this.chatService.syncChat(i.chat),this.absService.syncObjectInfo(i.channel,zd.Channel),i));case 7:throw n.prev=7,n.t0=n.catch(0),n.t0;case 10:case"end":return n.stop()}}),n,this,[[0,7]])})))}},{key:"editChannelInfo",value:function(e){return gl(this,void 0,void 0,regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.dcService.getResponsePost({method:"editChannelInfo",model:e}).success();case 3:n=t.sent,this.absService.syncObjectInfo(n.channel,zd.Channel),this.chatService.updateChat(n.chat_update,!0),this.convService.updateMessageByGuid(e.object_guid,n.message_update),this.broadcastEvent.emit("update_channel",n.channel),t.next=10;break;case 7:throw t.prev=7,t.t0=t.catch(0),t.t0;case 10:case"end":return t.stop()}}),t,this,[[0,7]])})))}},{key:"addChannelMembers",value:function(e,t){return gl(this,void 0,void 0,regeneratorRuntime.mark((function n(){var i;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,this.dcService.getResponsePost({method:"addChannelMem
n(e){e?t(e.location):n(!1)}})}))}},{key:"getObjectInfo",value:function(e,t){return gl(this,void 0,void 0,regeneratorRuntime.mark((function n(){var i;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:n.prev=0,n.t0=e,n.next=n.t0===zd.Group?4:n.t0===zd.Channel?8:n.t0===zd.User?12:n.t0===zd.Bot?16:n.t0===zd.Service?20:23;break;case 4:return n.next=6,this.groupService.getGroupInfo(t);case 6:return i=n.sent,n.abrupt("break",23);case 8:return n.next=10,this.channelService.getChannelInfo(t);case 10:return i=n.sent,n.abrupt("break",23);case 12:return n.next=14,this.userService.getUserInfo(t);case 14:return i=n.sent,n.abrupt("break",23);case 16:return n.next=18,this.botService.getBotInfo(t);case 18:return i=n.sent,n.abrupt("break",23);case 20:return n.next=22,this.botService.getServiceInfo(t);case 22:i=n.sent;case 23:return n.abrupt("return",i);case 26:throw n.prev=26,n.t1=n.catch(0),n.t1;case 29:case"end":return n.stop()}}),n,this,[[0,26]])})))}},{key:"openToast",value:function(e,t){e&&e.text&&(e.delay||(e.delay=3e3),this.pageService.openPage({type:kl.Toast,id:t||"toast",model:e,onClose:function(){}}))}},{key:"openReportMessage",value:function(e){this.pageService.openPage({type:kl.Popup,dynamicComponent:"ReportMessagComponent",id:"modal-report-"+(e.confirm?"confirm":""),cssClass:"popup-peer popup-report-messages",model:e})}},{key:"openExternalDevice",value:function(e,t){this.pageService.openPage({type:kl.Popup,dynamicComponent:"ExternalDeviceComponent",id:"modal-external-device",cssClass:"popup-peer popup-external-device page-chats",model:Object.assign({type:e},t)})}},{key:"openReadParticipants",value:function(e){this.pageService.openPage({type:kl.Popup,dynamicComp
=t.catch(0),this.loadingMore=!1,t.t0;case 15:case"end":return t.stop()}}),t,this,[[0,12]])})))}},{key:"getObjectInfo",value:function(e){return gl(this,void 0,void 0,regeneratorRuntime.mark((function t(){var n,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,"g"!=(i=e.substr(0,1))){t.next=8;break}return t.next=5,this.groupService.getGroupInfo(e,this);case 5:n=t.sent,t.next=31;break;case 8:if("c"!=i){t.next=14;break}return t.next=11,this.channelService.getChannelInfo(e,this);case 11:n=t.sent,t.next=31;break;case 14:if("u"!=i){t.next=20;break}return t.next=17,this.userService.getUserInfo(e,this);case 17:n=t.sent,t.next=31;break;case 20:if("b"!=i){t.next=26;break}return t.next=23,this.botService.getBotInfo(e,this);case 23:n=t.sent,t.next=31;break;case 26:if(t.t0="s"==i,!t.t0){t.next=31;break}return t.next=30,this.botService.getServiceInfo(e,this);case 30:n=t.sent;case 31:return t.abrupt("return",n?n.chat:null);case 34:t.prev=34,t.t1=t.catch(0);case 36:case"end":return t.stop()}}),t,this,[[0,34]])})))}},{key:"openMention",value:function(e){return gl(this,void 0,void 0,regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.chatService.getChatByUsername(e);case 3:n=t.sent,this.modalService.openSubConv({chat:n},!0),t.next=9;break;case 7:t.prev=7,t.t0=t.catch(0);case 9:case"end":return t.stop()}}),t,this,[[0,7]])})))}}]),n}(Bd)).\u0275fac=function(e){return new(e||UY)(Da(Zs),Da(p_),Da(c_),Da($p),Da(Pd),Da(Z_),Da(tb),Da(zR),Da(Rg),Da(u_),Da(ux),Da(Ig),Da(vS),Da(o_),Da(WC),Da(eb),Da(Od),Da(Q_),Da(X_),Da(uH),Da(mA))},UY.\u0275cmp=gt({type:UY,selectors:[["r

getObjectByUsername

atch(t){throw t}}))}deleteUserChat(e){return gh(this,void 0,void 0,(function*(){try{const t=this.convService.getLastMessageId(e),i=yield this.dcService.getResponsePost({method:"deleteUserChat",model:{user_guid:e,last_deleted_message_id:t||"0"}}).success();this.convService.clearHistory(e),this.updateChat(i.chat_update)}catch(t){throw t}}))}getChatByUsername(e){return gh(this,void 0,void 0,(function*(){try{if(e.length<4)throw"INVALID_USERNAME";const t=yield this.dcService.getResponsePost({method:"getObjectByUsername",model:{username:e}}).success();if(!t.exist)throw"error_modal_username_not_found_description";return t.chat}catch(t){throw t}}))}updateActivities(e){}updateChat(e,t){e&&this.updateChats([e],t)}updateDrafts(e){if(!e)return;const t=e.filter(e=>"Delete"===e.action).map(e=>e.draft_message.chat_object_guid);this.draftService.removeDraft(t),this.draftService.saveDraft(e.filter(e=>"New"===e.action).map(e=>e.draft_message)),this.notifyDrafts(e.map(e=>e.draft_message))}updateChats(e,t){const i=e.filter(e=>e.action===lu.Delete).map(e=>e.object_guid),n=e.filter(e=>e.action===lu.New).map(e=>e.chat),s=[];e.filter(e=>e.action===lu.Edit).forEach(e=>{const t=this.getAndUpdate(e);t?n.push(t):s.push(e.object_guid)}),this.convService.checkReachend(n),s.length&&!t&&this.getChatsById(s).catch(e=>{}),this.syncChanges(n,i,!1)}searchGlobalObjects(e,t,i){return gh(this,void 0,void 0,(function*(){try{const n={search_text:e};return t&&(n.filter_types=t),(yield this.dcService.getResponsePost({method:"searchGlobalObjects",model:n}).success(i,"global_search")).objects.map(e=>({object_guid:e.object_guid,type:e.type,abs_object:e}))}catch(n){throw n}}))}searchChats(e,t,i){return gh(this,void 0,void 0,(function*()
nvService.clearHistory(e),this.updateChat(i.chat_update),t.next=11;break;case 8:throw t.prev=8,t.t0=t.catch(0),t.t0;case 11:case"end":return t.stop()}}),t,this,[[0,8]])})))}},{key:"getChatByUsername",value:function(e){return gl(this,void 0,void 0,regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,!(e.length<4)){t.next=3;break}throw"INVALID_USERNAME";case 3:return t.next=5,this.dcService.getResponsePost({method:"getObjectByUsername",model:{username:e}}).success();case 5:if((n=t.sent).exist){t.next=8;break}throw"error_modal_username_not_found_description";case 8:return t.abrupt("return",n.chat);case 11:throw t.prev=11,t.t0=t.catch(0),t.t0;case 14:case"end":return t.stop()}}),t,this,[[0,11]])})))}},{key:"updateActivities",value:function(e){}},{key:"updateChat",value:function(e,t){e&&this.updateChats([e],t)}},{key:"updateDrafts",value:function(e){if(e){var t=e.filter((function(e){return"Delete"===e.action})).map((function(e){return e.draft_message.chat_object_guid}));this.draftService.removeDraft(t),this.draftService.saveDraft(e.filter((function(e){return"New"===e.action})).map((function(e){return e.draft_message}))),this.notifyDrafts(e.map((function(e){return e.draft_message})))}}},{key:"updateChats",value:function(e,t){var n=this,i=e.filter((function(e){return e.action===Hd.Delete})).map((function(e){return e.object_guid})),r=e.filter((function(e){return e.action===Hd.New})).map((function(e){return e.chat})),s=[];e.filter((function(e){return e.action===Hd.Edit})).forEach((function(e){var t=n.getAndUpdate(e);t?r.push(t):s.push(e.object_guid)})),this.convService.checkReachend(r),s.length&&!t&&this.getChatsById(

🎬 Media Contexts

file_inline

eExactCropImage(e,a);let c;if(o.width=a.width,o.height=a.height,i){const n=this.getSizeInRegion(r,i,t.enabledCrop);c=yield this.resizeExactCropImage(e,n),c.width=n.width,c.height=n.height}return{image:o,thumb:c}}catch(n){throw n}}))}uploadFile(e,t){return gh(this,void 0,void 0,(function*(){try{let i,n=!1,s=!1;const r=new cf;if(i=new d,t){const e=e=>{s=!0,r.reject(e)};t.cancelUpload=t=>{i&&(i.unsubscribe(),i=!1),s||n||e("UPLOAD_CANCELED")}}if(!e.file_id){const n=yield this.forceRequestSendFile(t.file_inline.file_data,{addSubscribe:e=>{i.add(e)}});this.uploadRequest(e.file_data,Vp.File,n,{addSubscribe:e=>{i.add(e)},unsubByKey:e=>{}}),e.access_hash_send=n.access_hash_send,e.dc_id=n.dc_id,e.file_id=n.id,e.dc_url=n.upload_url,e.mime=this.getExt(e.file_name)}const a=e.file_data,o=a.size,c=o>=10485760,l=131072,h=Math.ceil(o/l);let u=0,p=0;const f={_:c?"inputFileBig":"inputFile",id:e.file_id,parts:h,name:a.name,access_hash_rec:""};return this.uploadQueue.next({file_id:e.file_id,uploaded_size:0,percent:0,total_size:o}),this.startRequests(e.file_id,"upload",()=>{for(let i=0;i<o;i+=l)((i,c)=>{this.filePartRequest(e.file_id,()=>gh(this,void 0,void 0,(function*(){try{const d=a.slice(i,i+l),p=yield this.getFilePart(a,i,l);if(s)return void Pu("FAILED_AND_CANCELED");const g=yield this.sendFile({access_hash_send:e.access_hash_send,file_id:e.file_id,part_number:(c+1).toString(),total_part:h.toString(),bytes:p.result,dc_url:e.dc_url,size:p.result.byteLength||d.size});if(u++,g.data&&g.data.access_hash_rec&&(f.access_hash_rec=g.data.access_hash_rec),u>=h)delete this.progressFiles[e.file_id],this.uploadQueue.next({file_id:e.file_id,percent:100,is_done:!0,blob:e.file_data}),r.resolve(f),this.removeFromQue
||t.forEach(e=>{const t=this.getConv(e.object_guid);t&&this.updateMessage(t,e)})}),this.storageService.get("hidden_pinned",e=>{this.hidden_pinned=e||{}}),this.me=this.profileService.getUser(),vh.IsServiceWorkerSupport&&navigator.serviceWorker.addEventListener("message",e=>gh(this,void 0,void 0,(function*(){const{type:t,messageId:i,params:n}=e.data;if("requestPart"!==t)return;const r=n.url.split("?")[0].split("/").filter(e=>e),a=this.getMessageById(r[r.length-2],r[r.length-1]),o=null==a?void 0:a.file_inline;if(!o)return;const c=yield this.dcService.getStorageDcUrl(o.dc_id),l=yield s.getFile({start_index:n.start+"",last_index:n.end+"",access_hash_rec:o.access_hash_rec,file_id:o.file_id,cdn_tag:o.cdn_tag,dc_url:c});if(!l)return;const h=l.bytes;navigator.serviceWorker.controller.postMessage({type:"partResponse",messageId:i,result:{arrayBuffer:h,mimeType:o.mime,fullSize:l.total_length||o.size}},[h])})))}focusMessages(e,t){this.onReadyChanged.next({object_guid:e,message_id:t,action:jm.Focus})}filterSharedFiles(e,t){this.onReadyChanged.next({object_guid:e,filter_type:t,action:jm.GoToSharedFiles})}gotoMessages(e,t,i){return gh(this,void 0,void 0,(function*(){try{const n=this.getConv(t.object_guid,!0);t.middle_message_id||(t.middle_message_id=this.getMaxId(n.hole.items)),this.isInHole(n.hole,t.middle_message_id)?this.onReadyChanged.next({object_guid:t.object_guid,action:e,message_id:t.middle_message_id,filter_type:t.filter_type}):yield this.getAndSyncMessagesInterval(n,e,t,i)}catch(n){throw n}}))}getLastSendTime(e){const t=this.getConv(e,!0);for(let i=(t.hole.items||[]).length-1;i>=0;i--){const e=t.hole.items[i];if(e.author_object_guid==this.me.user_guid)return e.time}}clearHistory(e){const 
.onReadyChanged.next({object_guid:e,action:jm.Renew})):(i.hole.state=n.new_state,n.updated_messages.forEach(e=>{this.updateMessage(i,e)}),!0)}catch(i){throw i}}))}getMessageById(e,t){const i=this.getConv(e);if(i)return i.messages[t]}checkReachend(e){e.forEach(e=>{const t=this.getConv(e.object_guid);t&&t.hole.max_id&&t.hole.max_id<toInt(e.last_message_id)&&(t.hole.reachend=!1)})}getFileMessages(e,t){const i=this.getConv(e);let n=i.media_hole.items;return n=n.length>0?n:i.hole.items,n.filter(e=>e.file_inline&&e.file_inline.type===t)}getNextPrevVoiceMessage(e,t,i){const n=this.getConv(e);let s=n.media_hole.items;s=s.length>0?s:n.hole.items;const r=s.filter(e=>e.file_inline&&e.file_inline.type===t),a=r.findIndex(e=>e.message_id==i);return[r[a-1],r[a+1]]}getLastMessageId(e){const t=this.getLastMessage(e);return null==t?void 0:t.message_id}getLastMessage(e){const t=this.getConv(e),i=t?t.hole.items:[];if(i)return i.last()}isDeleted(e,t){const i=this.getConv(e,!0);return i.deleted&&i.deleted[t+""]}forwardMessages(e,t){return gh(this,void 0,void 0,(function*(){try{const e=this.getConv(t.to_object_guid);t.rnd=this.newRnd();const i=yield this.dcService.getResponsePost({method:"forwardMessages",model:t}).success();if("OK"===i.status){let t=0;i.message_updates.forEach(n=>{t++,this.updateMessage(e,n,t===i.message_updates.length?"SentMessage":"Silent")}),this.socketService.updateChat(i.chat_update)}}catch(e){throw e}}))}sendSimpleMessage(e){return gh(this,void 0,void 0,(function*(){try{e.rnd=this.newRnd();const t=yield this.dcService.getResponsePost({method:"sendMessage",model:e}).success();if("OK"===t.status){const i=this.getConv(e.object_guid);this.updateMessage(i,t.message_update,"SentMessage")
.next({object_guid:e,action:jm.Renew})):(i.hole.state=n.new_state,n.updated_messages.forEach(e=>{this.updateMessage(i,e)}),!0)}catch(i){throw i}}))}getMessageById(e,t){const i=this.getConv(e);if(i)return i.messages[t]}checkReachend(e){e.forEach(e=>{const t=this.getConv(e.object_guid);t&&t.hole.max_id&&t.hole.max_id<toInt(e.last_message_id)&&(t.hole.reachend=!1)})}getFileMessages(e,t){const i=this.getConv(e);let n=i.media_hole.items;return n=n.length>0?n:i.hole.items,n.filter(e=>e.file_inline&&e.file_inline.type===t)}getNextPrevVoiceMessage(e,t,i){const n=this.getConv(e);let s=n.media_hole.items;s=s.length>0?s:n.hole.items;const r=s.filter(e=>e.file_inline&&e.file_inline.type===t),a=r.findIndex(e=>e.message_id==i);return[r[a-1],r[a+1]]}getLastMessageId(e){const t=this.getLastMessage(e);return null==t?void 0:t.message_id}getLastMessage(e){const t=this.getConv(e),i=t?t.hole.items:[];if(i)return i.last()}isDeleted(e,t){const i=this.getConv(e,!0);return i.deleted&&i.deleted[t+""]}forwardMessages(e,t){return gh(this,void 0,void 0,(function*(){try{const e=this.getConv(t.to_object_guid);t.rnd=this.newRnd();const i=yield this.dcService.getResponsePost({method:"forwardMessages",model:t}).success();if("OK"===i.status){let t=0;i.message_updates.forEach(n=>{t++,this.updateMessage(e,n,t===i.message_updates.length?"SentMessage":"Silent")}),this.socketService.updateChat(i.chat_update)}}catch(e){throw e}}))}sendSimpleMessage(e){return gh(this,void 0,void 0,(function*(){try{e.rnd=this.newRnd();const t=yield this.dcService.getResponsePost({method:"sendMessage",model:e}).success();if("OK"===t.status){const i=this.getConv(e.object_guid);this.updateMessage(i,t.message_update,"SentMessage"),this.socketSer
essageById(e,t){const i=this.getConv(e);if(i)return i.messages[t]}checkReachend(e){e.forEach(e=>{const t=this.getConv(e.object_guid);t&&t.hole.max_id&&t.hole.max_id<toInt(e.last_message_id)&&(t.hole.reachend=!1)})}getFileMessages(e,t){const i=this.getConv(e);let n=i.media_hole.items;return n=n.length>0?n:i.hole.items,n.filter(e=>e.file_inline&&e.file_inline.type===t)}getNextPrevVoiceMessage(e,t,i){const n=this.getConv(e);let s=n.media_hole.items;s=s.length>0?s:n.hole.items;const r=s.filter(e=>e.file_inline&&e.file_inline.type===t),a=r.findIndex(e=>e.message_id==i);return[r[a-1],r[a+1]]}getLastMessageId(e){const t=this.getLastMessage(e);return null==t?void 0:t.message_id}getLastMessage(e){const t=this.getConv(e),i=t?t.hole.items:[];if(i)return i.last()}isDeleted(e,t){const i=this.getConv(e,!0);return i.deleted&&i.deleted[t+""]}forwardMessages(e,t){return gh(this,void 0,void 0,(function*(){try{const e=this.getConv(t.to_object_guid);t.rnd=this.newRnd();const i=yield this.dcService.getResponsePost({method:"forwardMessages",model:t}).success();if("OK"===i.status){let t=0;i.message_updates.forEach(n=>{t++,this.updateMessage(e,n,t===i.message_updates.length?"SentMessage":"Silent")}),this.socketService.updateChat(i.chat_update)}}catch(e){throw e}}))}sendSimpleMessage(e){return gh(this,void 0,void 0,(function*(){try{e.rnd=this.newRnd();const t=yield this.dcService.getResponsePost({method:"sendMessage",model:e}).success();if("OK"===t.status){const i=this.getConv(e.object_guid);this.updateMessage(i,t.message_update,"SentMessage"),this.socketService.updateChatDraft(t.draft_message_update),this.socketService.updateChat(t.chat_update)}}catch(t){throw t}}))}editMessage(e){return gh(this,void 0,voi

thumb_inline

ploadRequest(e,t,i,n){return gh(this,void 0,void 0,(function*(){let s;try{let r,a;t===Vp.Image?(s=i.resizedImage?i.resizedImage:yield this.resizeImageFile(e,i.imageSize,i.thumbSize),r=s.image,s.thumb&&(a=yield this.getThumbnail(s.thumb))):r=e,r||(r=e);const o=yield this.requestSendFile(r,n),c={file_data:r,access_hash_send:o.access_hash_send,dc_id:o.dc_id,file_id:o.id,type:t===Vp.Video||t===Vp.Image||t===Vp.Music?t:Vp.File,file_name:r.name,size:r.size,dc_url:o.upload_url,mime:this.getExt(e.name),thumb_inline:a};return yield this.saveInputFile(r,c.mime,c.file_id),s&&(c.width=s.image.width,c.height=s.image.height),c}catch(r){throw r}}))}getDownloadedFile(e,t){return gh(this,void 0,void 0,(function*(){try{const i=this.cachedDownloads[e];if(i)return i;const n=this.getFileStorage();return yield n.getFile(e+"",t)}catch(i){throw i}}))}isInProgress(e){return this.progressFiles[e]}getProgressPercent(e){var t;return(null===(t=this.progressFiles[e])||void 0===t?void 0:t.percent)||0}cancelDownload(e){const t=this.progressFiles[e];t&&t.cancel&&t.cancel()}getFileBlobUrl(e){return gh(this,void 0,void 0,(function*(){try{const t=yield this.getFileBlob(e);return URL.createObjectURL(t)}catch(t){console.error(t)}}))}getFileBlob(e){return gh(this,void 0,void 0,(function*(){try{const t=yield this.getDownloadedFile(e.file_id,e.size);return new Blob([t],{type:this.getMimeType(e.mime)})}catch(t){console.error(t)}}))}downloadFile(e,t){const i=this.cachedDownloads[e.file_id||e.file_name];return i?Promise.resolve(i):this.fileManager.isAvailable()?this.progressFiles[e.file_id]?Promise.reject({type:"DUPLICATE_FILE_REQUEST"}):(t||(t={}),new Promise((i,n)=>{this.dcService.getStorageDcUrl(e.dc_id).then(s=>{e.file_id=
pendChild(this.parentEl,a),this.renderer2.appendChild(a,this.imgEl)),this.autoSize||(this.setStyle(a,"width",(this.noContainer?this.dim.w:Math.max(320,this.dim.w))+"px"),this.setStyle(a,"height",(this.noZoom?this.dim.h:this.dim.w)+"px")),this.downloadIfIsImage(e,null!=a?a:this.imgEl)}downloadIfIsImage(e,t){(e.type||Vp.Image)===Vp.Image&&this.fileService.getDownloadedFile(this.imageFile.file_id,e.size).then(e=>{this.setBlob(this.imgEl,e)}).catch(e=>{this.observe(this.imgEl)})}setThumb(e,t){if(!t.thumb_inline)return;const i=this.fileService.b64toBlob(t.thumb_inline,"image/jpeg",128),n=URL.createObjectURL(i);e.src=n}observe(e){this.autoDownload&&("undefined"!=typeof IntersectionObserver?(this.intersectionObserver=new IntersectionObserver(t=>{t[0].isIntersecting&&(this.unobserve(e),this.download(e,this.imageFile))},void 0),this.intersectionObserver.observe(e)):this.download(e,this.imageFile))}unobserve(e){this.intersectionObserver&&(this.intersectionObserver.unobserve(e),this.intersectionObserver.disconnect())}download(e,t){return gh(this,void 0,void 0,(function*(){if(!this.isDownloading){this.preloadEl&&this.renderer2.removeClass(this.preloadEl,"manual"),this.isDownloading=!0;try{const i=yield this.fileService.downloadFile(t,{progress:!0});this.preloadEl&&this.renderer2.removeClass(this.preloadEl,"is-visible"),this.isDownloading=!1,this.setBlob(e,i)}catch(i){this.isDownloading=!1,t.thumb_inline||this.renderer2.setAttribute(e,"src","/assets/img/blank.gif"),this.preloadEl&&this.renderer2.addClass(this.preloadEl,"manual")}}}))}setBlob(e,t){const i=new Image;i.src=URL.createObjectURL(t),i.onload=()=>{this.renderer2.setAttribute(e,"src",i.src),this.setStyle(e,"visibility","visible")}}setStyl
his.imgEl)),this.autoSize||(this.setStyle(a,"width",(this.noContainer?this.dim.w:Math.max(320,this.dim.w))+"px"),this.setStyle(a,"height",(this.noZoom?this.dim.h:this.dim.w)+"px")),this.downloadIfIsImage(e,null!=a?a:this.imgEl)}downloadIfIsImage(e,t){(e.type||Vp.Image)===Vp.Image&&this.fileService.getDownloadedFile(this.imageFile.file_id,e.size).then(e=>{this.setBlob(this.imgEl,e)}).catch(e=>{this.observe(this.imgEl)})}setThumb(e,t){if(!t.thumb_inline)return;const i=this.fileService.b64toBlob(t.thumb_inline,"image/jpeg",128),n=URL.createObjectURL(i);e.src=n}observe(e){this.autoDownload&&("undefined"!=typeof IntersectionObserver?(this.intersectionObserver=new IntersectionObserver(t=>{t[0].isIntersecting&&(this.unobserve(e),this.download(e,this.imageFile))},void 0),this.intersectionObserver.observe(e)):this.download(e,this.imageFile))}unobserve(e){this.intersectionObserver&&(this.intersectionObserver.unobserve(e),this.intersectionObserver.disconnect())}download(e,t){return gh(this,void 0,void 0,(function*(){if(!this.isDownloading){this.preloadEl&&this.renderer2.removeClass(this.preloadEl,"manual"),this.isDownloading=!0;try{const i=yield this.fileService.downloadFile(t,{progress:!0});this.preloadEl&&this.renderer2.removeClass(this.preloadEl,"is-visible"),this.isDownloading=!1,this.setBlob(e,i)}catch(i){this.isDownloading=!1,t.thumb_inline||this.renderer2.setAttribute(e,"src","/assets/img/blank.gif"),this.preloadEl&&this.renderer2.addClass(this.preloadEl,"manual")}}}))}setBlob(e,t){const i=new Image;i.src=URL.createObjectURL(t),i.onload=()=>{this.renderer2.setAttribute(e,"src",i.src),this.setStyle(e,"visibility","visible")}}setStyle(e,t,i){this.renderer2.setStyle(e,t,i)}}return e.\u0275f
unobserve(e){this.intersectionObserver&&(this.intersectionObserver.unobserve(e),this.intersectionObserver.disconnect())}download(e,t){return gh(this,void 0,void 0,(function*(){if(!this.isDownloading){this.preloadEl&&this.renderer2.removeClass(this.preloadEl,"manual"),this.isDownloading=!0;try{const i=yield this.fileService.downloadFile(t,{progress:!0});this.preloadEl&&this.renderer2.removeClass(this.preloadEl,"is-visible"),this.isDownloading=!1,this.setBlob(e,i)}catch(i){this.isDownloading=!1,t.thumb_inline||this.renderer2.setAttribute(e,"src","/assets/img/blank.gif"),this.preloadEl&&this.renderer2.addClass(this.preloadEl,"manual")}}}))}setBlob(e,t){const i=new Image;i.src=URL.createObjectURL(t),i.onload=()=>{this.renderer2.setAttribute(e,"src",i.src),this.setStyle(e,"visibility","visible")}}setStyle(e,t,i){this.renderer2.setStyle(e,t,i)}}return e.\u0275fac=function(t){return new(t||e)(Ta(Go),Ta(Zo),Ta(Rf))},e.\u0275dir=bt({type:e,selectors:[["","rb-thumbnail",""]],inputs:{imageFile:["rb-thumbnail","imageFile"],width:"width",height:"height",noContainer:["no-container","noContainer"],selfThumb:["self-thumb","selfThumb"],noZoom:["no-zoom","noZoom"],autoDownload:["auto-download","autoDownload"],autoSize:["auto-size","autoSize"],parentClass:["parent-class","parentClass"]}}),e})(),Kw=(()=>{class e{constructor(e,t){this.elementRef=e,this.renderer2=t,this.htmlContent='\n  <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"\n    preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24">\n    <defs>\n      <path\n        d="M13.55 3.24L13.64 3.25L13.73 3.27L13.81 3.29L13.9 3.32L13.98 3.35L14.06 3.39L14.14 3.43L14.22 3.48L14.29 3.53L14.36 3.59L14.43 3
l"),this.renderer2.addClass(this.preloadEl,"is-visible"),this.listenProgress(!0),r&&this.downloadFile(t,e,!0)}).finally(()=>{a()})}getVideoTimeEl(e){if(e.type!==Vp.Video)return;const t=this.timeEl=document.createElement("span");return t.className="pre-time",this.setVideoProgress(e),t}setVideoProgress(e,t){if(!this.isVideo||!this.timeEl)return;let i="";t&&(i=C_(e.size*t/100));let n=m_(e.time/1e3);"downloaded"!==this.status&&(n+=" ("+(i||C_(e.size))+")"),this.timeEl.innerText=n}setThumb(e,t){if(t.thumb_inline)try{const i=this.fileService.b64toBlob(t.thumb_inline,"image/jpeg",128);e.src=URL.createObjectURL(i)}catch(i){e.src="/assets/img/blank.gif"}}downloadFile(e,t,i){return gh(this,void 0,void 0,(function*(){if("downloading"!==this.status){this.renderer2.removeClass(this.preloadEl,"manual"),this.setStatus("downloading");try{yield this.fileService.downloadFile(t,{progress:!0})}catch(i){this.setStatus("failed"),this.renderer2.addClass(this.preloadEl,"manual"),t.thumb_inline||this.renderer2.setAttribute(e,"src","/assets/img/blank.gif")}}}))}loadMedia(e,t,i){switch(e.type){case Vp.Video:case Vp.Gif:this.loadVideo(t,URL.createObjectURL(i),!0);case Vp.Image:default:this.loadImage(t,i)}}loadVideo(e,t,i){try{if(this.loadedVideo)return;e.style.display="none";const n=this.videoEl=document.createElement("video");n.src=t,n.controls=!1,n.autoplay=i,n.loop=!0,n.className="media-video",n.muted=!0,n.width=this.dim.w,n.height=this.dim.h,this.renderer2.setAttribute(n,"playsinline","true"),n.onwaiting=()=>{this.renderer2.removeClass(this.preloadEl2||this.preloadEl,"manual"),this.renderer2.addClass(this.preloadEl2||this.preloadEl,"is-visible")},n.oncanplay=()=>{},n.onplaying=()=>{const e=this.preloadEl2;e

file_id

tSizeInRegion(r,t,t.enabledCrop),o=yield this.resizeExactCropImage(e,a);let c;if(o.width=a.width,o.height=a.height,i){const n=this.getSizeInRegion(r,i,t.enabledCrop);c=yield this.resizeExactCropImage(e,n),c.width=n.width,c.height=n.height}return{image:o,thumb:c}}catch(n){throw n}}))}uploadFile(e,t){return gh(this,void 0,void 0,(function*(){try{let i,n=!1,s=!1;const r=new cf;if(i=new d,t){const e=e=>{s=!0,r.reject(e)};t.cancelUpload=t=>{i&&(i.unsubscribe(),i=!1),s||n||e("UPLOAD_CANCELED")}}if(!e.file_id){const n=yield this.forceRequestSendFile(t.file_inline.file_data,{addSubscribe:e=>{i.add(e)}});this.uploadRequest(e.file_data,Vp.File,n,{addSubscribe:e=>{i.add(e)},unsubByKey:e=>{}}),e.access_hash_send=n.access_hash_send,e.dc_id=n.dc_id,e.file_id=n.id,e.dc_url=n.upload_url,e.mime=this.getExt(e.file_name)}const a=e.file_data,o=a.size,c=o>=10485760,l=131072,h=Math.ceil(o/l);let u=0,p=0;const f={_:c?"inputFileBig":"inputFile",id:e.file_id,parts:h,name:a.name,access_hash_rec:""};return this.uploadQueue.next({file_id:e.file_id,uploaded_size:0,percent:0,total_size:o}),this.startRequests(e.file_id,"upload",()=>{for(let i=0;i<o;i+=l)((i,c)=>{this.filePartRequest(e.file_id,()=>gh(this,void 0,void 0,(function*(){try{const d=a.slice(i,i+l),p=yield this.getFilePart(a,i,l);if(s)return void Pu("FAILED_AND_CANCELED");const g=yield this.sendFile({access_hash_send:e.access_hash_send,file_id:e.file_id,part_number:(c+1).toString(),total_part:h.toString(),bytes:p.result,dc_url:e.dc_url,size:p.result.byteLength||d.size});if(u++,g.data&&g.data.access_hash_rec&&(f.access_hash_rec=g.data.access_hash_rec),u>=h)delete this.progressFiles[e.file_id],this.uploadQueue.next({file_id:e.file_id,percent:100,is_don
mage:o,thumb:c}}catch(n){throw n}}))}uploadFile(e,t){return gh(this,void 0,void 0,(function*(){try{let i,n=!1,s=!1;const r=new cf;if(i=new d,t){const e=e=>{s=!0,r.reject(e)};t.cancelUpload=t=>{i&&(i.unsubscribe(),i=!1),s||n||e("UPLOAD_CANCELED")}}if(!e.file_id){const n=yield this.forceRequestSendFile(t.file_inline.file_data,{addSubscribe:e=>{i.add(e)}});this.uploadRequest(e.file_data,Vp.File,n,{addSubscribe:e=>{i.add(e)},unsubByKey:e=>{}}),e.access_hash_send=n.access_hash_send,e.dc_id=n.dc_id,e.file_id=n.id,e.dc_url=n.upload_url,e.mime=this.getExt(e.file_name)}const a=e.file_data,o=a.size,c=o>=10485760,l=131072,h=Math.ceil(o/l);let u=0,p=0;const f={_:c?"inputFileBig":"inputFile",id:e.file_id,parts:h,name:a.name,access_hash_rec:""};return this.uploadQueue.next({file_id:e.file_id,uploaded_size:0,percent:0,total_size:o}),this.startRequests(e.file_id,"upload",()=>{for(let i=0;i<o;i+=l)((i,c)=>{this.filePartRequest(e.file_id,()=>gh(this,void 0,void 0,(function*(){try{const d=a.slice(i,i+l),p=yield this.getFilePart(a,i,l);if(s)return void Pu("FAILED_AND_CANCELED");const g=yield this.sendFile({access_hash_send:e.access_hash_send,file_id:e.file_id,part_number:(c+1).toString(),total_part:h.toString(),bytes:p.result,dc_url:e.dc_url,size:p.result.byteLength||d.size});if(u++,g.data&&g.data.access_hash_rec&&(f.access_hash_rec=g.data.access_hash_rec),u>=h)delete this.progressFiles[e.file_id],this.uploadQueue.next({file_id:e.file_id,percent:100,is_done:!0,blob:e.file_data}),r.resolve(f),this.removeFromQueue(e.file_id),n=!0;else{const i=Math.min(100,Math.floor(u*l*100/(o||0)));this.progressFiles[e.file_id]={percent:i},this.uploadQueue.next({object_guid:t.object_guid,file_id:e.file_id,uploaded_s
i&&(i.unsubscribe(),i=!1),s||n||e("UPLOAD_CANCELED")}}if(!e.file_id){const n=yield this.forceRequestSendFile(t.file_inline.file_data,{addSubscribe:e=>{i.add(e)}});this.uploadRequest(e.file_data,Vp.File,n,{addSubscribe:e=>{i.add(e)},unsubByKey:e=>{}}),e.access_hash_send=n.access_hash_send,e.dc_id=n.dc_id,e.file_id=n.id,e.dc_url=n.upload_url,e.mime=this.getExt(e.file_name)}const a=e.file_data,o=a.size,c=o>=10485760,l=131072,h=Math.ceil(o/l);let u=0,p=0;const f={_:c?"inputFileBig":"inputFile",id:e.file_id,parts:h,name:a.name,access_hash_rec:""};return this.uploadQueue.next({file_id:e.file_id,uploaded_size:0,percent:0,total_size:o}),this.startRequests(e.file_id,"upload",()=>{for(let i=0;i<o;i+=l)((i,c)=>{this.filePartRequest(e.file_id,()=>gh(this,void 0,void 0,(function*(){try{const d=a.slice(i,i+l),p=yield this.getFilePart(a,i,l);if(s)return void Pu("FAILED_AND_CANCELED");const g=yield this.sendFile({access_hash_send:e.access_hash_send,file_id:e.file_id,part_number:(c+1).toString(),total_part:h.toString(),bytes:p.result,dc_url:e.dc_url,size:p.result.byteLength||d.size});if(u++,g.data&&g.data.access_hash_rec&&(f.access_hash_rec=g.data.access_hash_rec),u>=h)delete this.progressFiles[e.file_id],this.uploadQueue.next({file_id:e.file_id,percent:100,is_done:!0,blob:e.file_data}),r.resolve(f),this.removeFromQueue(e.file_id),n=!0;else{const i=Math.min(100,Math.floor(u*l*100/(o||0)));this.progressFiles[e.file_id]={percent:i},this.uploadQueue.next({object_guid:t.object_guid,file_id:e.file_id,uploaded_size:u*l,percent:i,total_size:o})}}catch(d){throw d}})))})(i,p++)}),r.promise}catch(i){throw delete this.progressFiles[e.file_id],i}}))}getThumbnail(e){return new Promise((t,i)=>{this.getBase64(
ield this.forceRequestSendFile(t.file_inline.file_data,{addSubscribe:e=>{i.add(e)}});this.uploadRequest(e.file_data,Vp.File,n,{addSubscribe:e=>{i.add(e)},unsubByKey:e=>{}}),e.access_hash_send=n.access_hash_send,e.dc_id=n.dc_id,e.file_id=n.id,e.dc_url=n.upload_url,e.mime=this.getExt(e.file_name)}const a=e.file_data,o=a.size,c=o>=10485760,l=131072,h=Math.ceil(o/l);let u=0,p=0;const f={_:c?"inputFileBig":"inputFile",id:e.file_id,parts:h,name:a.name,access_hash_rec:""};return this.uploadQueue.next({file_id:e.file_id,uploaded_size:0,percent:0,total_size:o}),this.startRequests(e.file_id,"upload",()=>{for(let i=0;i<o;i+=l)((i,c)=>{this.filePartRequest(e.file_id,()=>gh(this,void 0,void 0,(function*(){try{const d=a.slice(i,i+l),p=yield this.getFilePart(a,i,l);if(s)return void Pu("FAILED_AND_CANCELED");const g=yield this.sendFile({access_hash_send:e.access_hash_send,file_id:e.file_id,part_number:(c+1).toString(),total_part:h.toString(),bytes:p.result,dc_url:e.dc_url,size:p.result.byteLength||d.size});if(u++,g.data&&g.data.access_hash_rec&&(f.access_hash_rec=g.data.access_hash_rec),u>=h)delete this.progressFiles[e.file_id],this.uploadQueue.next({file_id:e.file_id,percent:100,is_done:!0,blob:e.file_data}),r.resolve(f),this.removeFromQueue(e.file_id),n=!0;else{const i=Math.min(100,Math.floor(u*l*100/(o||0)));this.progressFiles[e.file_id]={percent:i},this.uploadQueue.next({object_guid:t.object_guid,file_id:e.file_id,uploaded_size:u*l,percent:i,total_size:o})}}catch(d){throw d}})))})(i,p++)}),r.promise}catch(i){throw delete this.progressFiles[e.file_id],i}}))}getThumbnail(e){return new Promise((t,i)=>{this.getBase64(e).then(e=>{t(e)})})}requestSendFile(e,t){return this.dcService.getResponsePos
forceRequestSendFile(t.file_inline.file_data,{addSubscribe:e=>{i.add(e)}});this.uploadRequest(e.file_data,Vp.File,n,{addSubscribe:e=>{i.add(e)},unsubByKey:e=>{}}),e.access_hash_send=n.access_hash_send,e.dc_id=n.dc_id,e.file_id=n.id,e.dc_url=n.upload_url,e.mime=this.getExt(e.file_name)}const a=e.file_data,o=a.size,c=o>=10485760,l=131072,h=Math.ceil(o/l);let u=0,p=0;const f={_:c?"inputFileBig":"inputFile",id:e.file_id,parts:h,name:a.name,access_hash_rec:""};return this.uploadQueue.next({file_id:e.file_id,uploaded_size:0,percent:0,total_size:o}),this.startRequests(e.file_id,"upload",()=>{for(let i=0;i<o;i+=l)((i,c)=>{this.filePartRequest(e.file_id,()=>gh(this,void 0,void 0,(function*(){try{const d=a.slice(i,i+l),p=yield this.getFilePart(a,i,l);if(s)return void Pu("FAILED_AND_CANCELED");const g=yield this.sendFile({access_hash_send:e.access_hash_send,file_id:e.file_id,part_number:(c+1).toString(),total_part:h.toString(),bytes:p.result,dc_url:e.dc_url,size:p.result.byteLength||d.size});if(u++,g.data&&g.data.access_hash_rec&&(f.access_hash_rec=g.data.access_hash_rec),u>=h)delete this.progressFiles[e.file_id],this.uploadQueue.next({file_id:e.file_id,percent:100,is_done:!0,blob:e.file_data}),r.resolve(f),this.removeFromQueue(e.file_id),n=!0;else{const i=Math.min(100,Math.floor(u*l*100/(o||0)));this.progressFiles[e.file_id]={percent:i},this.uploadQueue.next({object_guid:t.object_guid,file_id:e.file_id,uploaded_size:u*l,percent:i,total_size:o})}}catch(d){throw d}})))})(i,p++)}),r.promise}catch(i){throw delete this.progressFiles[e.file_id],i}}))}getThumbnail(e){return new Promise((t,i)=>{this.getBase64(e).then(e=>{t(e)})})}requestSendFile(e,t){return this.dcService.getResponsePost({method:

dc_id

.height}return{image:o,thumb:c}}catch(n){throw n}}))}uploadFile(e,t){return gh(this,void 0,void 0,(function*(){try{let i,n=!1,s=!1;const r=new cf;if(i=new d,t){const e=e=>{s=!0,r.reject(e)};t.cancelUpload=t=>{i&&(i.unsubscribe(),i=!1),s||n||e("UPLOAD_CANCELED")}}if(!e.file_id){const n=yield this.forceRequestSendFile(t.file_inline.file_data,{addSubscribe:e=>{i.add(e)}});this.uploadRequest(e.file_data,Vp.File,n,{addSubscribe:e=>{i.add(e)},unsubByKey:e=>{}}),e.access_hash_send=n.access_hash_send,e.dc_id=n.dc_id,e.file_id=n.id,e.dc_url=n.upload_url,e.mime=this.getExt(e.file_name)}const a=e.file_data,o=a.size,c=o>=10485760,l=131072,h=Math.ceil(o/l);let u=0,p=0;const f={_:c?"inputFileBig":"inputFile",id:e.file_id,parts:h,name:a.name,access_hash_rec:""};return this.uploadQueue.next({file_id:e.file_id,uploaded_size:0,percent:0,total_size:o}),this.startRequests(e.file_id,"upload",()=>{for(let i=0;i<o;i+=l)((i,c)=>{this.filePartRequest(e.file_id,()=>gh(this,void 0,void 0,(function*(){try{const d=a.slice(i,i+l),p=yield this.getFilePart(a,i,l);if(s)return void Pu("FAILED_AND_CANCELED");const g=yield this.sendFile({access_hash_send:e.access_hash_send,file_id:e.file_id,part_number:(c+1).toString(),total_part:h.toString(),bytes:p.result,dc_url:e.dc_url,size:p.result.byteLength||d.size});if(u++,g.data&&g.data.access_hash_rec&&(f.access_hash_rec=g.data.access_hash_rec),u>=h)delete this.progressFiles[e.file_id],this.uploadQueue.next({file_id:e.file_id,percent:100,is_done:!0,blob:e.file_data}),r.resolve(f),this.removeFromQueue(e.file_id),n=!0;else{const i=Math.min(100,Math.floor(u*l*100/(o||0)));this.progressFiles[e.file_id]={percent:i},this.uploadQueue.next({object_guid:t.object_guid,file_id:e.
return{image:o,thumb:c}}catch(n){throw n}}))}uploadFile(e,t){return gh(this,void 0,void 0,(function*(){try{let i,n=!1,s=!1;const r=new cf;if(i=new d,t){const e=e=>{s=!0,r.reject(e)};t.cancelUpload=t=>{i&&(i.unsubscribe(),i=!1),s||n||e("UPLOAD_CANCELED")}}if(!e.file_id){const n=yield this.forceRequestSendFile(t.file_inline.file_data,{addSubscribe:e=>{i.add(e)}});this.uploadRequest(e.file_data,Vp.File,n,{addSubscribe:e=>{i.add(e)},unsubByKey:e=>{}}),e.access_hash_send=n.access_hash_send,e.dc_id=n.dc_id,e.file_id=n.id,e.dc_url=n.upload_url,e.mime=this.getExt(e.file_name)}const a=e.file_data,o=a.size,c=o>=10485760,l=131072,h=Math.ceil(o/l);let u=0,p=0;const f={_:c?"inputFileBig":"inputFile",id:e.file_id,parts:h,name:a.name,access_hash_rec:""};return this.uploadQueue.next({file_id:e.file_id,uploaded_size:0,percent:0,total_size:o}),this.startRequests(e.file_id,"upload",()=>{for(let i=0;i<o;i+=l)((i,c)=>{this.filePartRequest(e.file_id,()=>gh(this,void 0,void 0,(function*(){try{const d=a.slice(i,i+l),p=yield this.getFilePart(a,i,l);if(s)return void Pu("FAILED_AND_CANCELED");const g=yield this.sendFile({access_hash_send:e.access_hash_send,file_id:e.file_id,part_number:(c+1).toString(),total_part:h.toString(),bytes:p.result,dc_url:e.dc_url,size:p.result.byteLength||d.size});if(u++,g.data&&g.data.access_hash_rec&&(f.access_hash_rec=g.data.access_hash_rec),u>=h)delete this.progressFiles[e.file_id],this.uploadQueue.next({file_id:e.file_id,percent:100,is_done:!0,blob:e.file_data}),r.resolve(f),this.removeFromQueue(e.file_id),n=!0;else{const i=Math.min(100,Math.floor(u*l*100/(o||0)));this.progressFiles[e.file_id]={percent:i},this.uploadQueue.next({object_guid:t.object_guid,file_id:e.file_id,
{error:`Failed after ${this.retryDelays.length} retries`}):Wu(e).pipe(qu(1e3*this.retryDelays[t]))))),ju(e=>Pu("FAILED"))).subscribe(e=>{t(e)},e=>{i(e)})})}uploadRequest(e,t,i,n){return gh(this,void 0,void 0,(function*(){let s;try{let r,a;t===Vp.Image?(s=i.resizedImage?i.resizedImage:yield this.resizeImageFile(e,i.imageSize,i.thumbSize),r=s.image,s.thumb&&(a=yield this.getThumbnail(s.thumb))):r=e,r||(r=e);const o=yield this.requestSendFile(r,n),c={file_data:r,access_hash_send:o.access_hash_send,dc_id:o.dc_id,file_id:o.id,type:t===Vp.Video||t===Vp.Image||t===Vp.Music?t:Vp.File,file_name:r.name,size:r.size,dc_url:o.upload_url,mime:this.getExt(e.name),thumb_inline:a};return yield this.saveInputFile(r,c.mime,c.file_id),s&&(c.width=s.image.width,c.height=s.image.height),c}catch(r){throw r}}))}getDownloadedFile(e,t){return gh(this,void 0,void 0,(function*(){try{const i=this.cachedDownloads[e];if(i)return i;const n=this.getFileStorage();return yield n.getFile(e+"",t)}catch(i){throw i}}))}isInProgress(e){return this.progressFiles[e]}getProgressPercent(e){var t;return(null===(t=this.progressFiles[e])||void 0===t?void 0:t.percent)||0}cancelDownload(e){const t=this.progressFiles[e];t&&t.cancel&&t.cancel()}getFileBlobUrl(e){return gh(this,void 0,void 0,(function*(){try{const t=yield this.getFileBlob(e);return URL.createObjectURL(t)}catch(t){console.error(t)}}))}getFileBlob(e){return gh(this,void 0,void 0,(function*(){try{const t=yield this.getDownloadedFile(e.file_id,e.size);return new Blob([t],{type:this.getMimeType(e.mime)})}catch(t){console.error(t)}}))}downloadFile(e,t){const i=this.cachedDownloads[e.file_id||e.file_name];return i?Promise.resolve(i):this.fileManager.isAvailable()?this
Failed after ${this.retryDelays.length} retries`}):Wu(e).pipe(qu(1e3*this.retryDelays[t]))))),ju(e=>Pu("FAILED"))).subscribe(e=>{t(e)},e=>{i(e)})})}uploadRequest(e,t,i,n){return gh(this,void 0,void 0,(function*(){let s;try{let r,a;t===Vp.Image?(s=i.resizedImage?i.resizedImage:yield this.resizeImageFile(e,i.imageSize,i.thumbSize),r=s.image,s.thumb&&(a=yield this.getThumbnail(s.thumb))):r=e,r||(r=e);const o=yield this.requestSendFile(r,n),c={file_data:r,access_hash_send:o.access_hash_send,dc_id:o.dc_id,file_id:o.id,type:t===Vp.Video||t===Vp.Image||t===Vp.Music?t:Vp.File,file_name:r.name,size:r.size,dc_url:o.upload_url,mime:this.getExt(e.name),thumb_inline:a};return yield this.saveInputFile(r,c.mime,c.file_id),s&&(c.width=s.image.width,c.height=s.image.height),c}catch(r){throw r}}))}getDownloadedFile(e,t){return gh(this,void 0,void 0,(function*(){try{const i=this.cachedDownloads[e];if(i)return i;const n=this.getFileStorage();return yield n.getFile(e+"",t)}catch(i){throw i}}))}isInProgress(e){return this.progressFiles[e]}getProgressPercent(e){var t;return(null===(t=this.progressFiles[e])||void 0===t?void 0:t.percent)||0}cancelDownload(e){const t=this.progressFiles[e];t&&t.cancel&&t.cancel()}getFileBlobUrl(e){return gh(this,void 0,void 0,(function*(){try{const t=yield this.getFileBlob(e);return URL.createObjectURL(t)}catch(t){console.error(t)}}))}getFileBlob(e){return gh(this,void 0,void 0,(function*(){try{const t=yield this.getDownloadedFile(e.file_id,e.size);return new Blob([t],{type:this.getMimeType(e.mime)})}catch(t){console.error(t)}}))}downloadFile(e,t){const i=this.cachedDownloads[e.file_id||e.file_name];return i?Promise.resolve(i):this.fileManager.isAvailable()?this.progres
atch(t){console.error(t)}}))}getFileBlob(e){return gh(this,void 0,void 0,(function*(){try{const t=yield this.getDownloadedFile(e.file_id,e.size);return new Blob([t],{type:this.getMimeType(e.mime)})}catch(t){console.error(t)}}))}downloadFile(e,t){const i=this.cachedDownloads[e.file_id||e.file_name];return i?Promise.resolve(i):this.fileManager.isAvailable()?this.progressFiles[e.file_id]?Promise.reject({type:"DUPLICATE_FILE_REQUEST"}):(t||(t={}),new Promise((i,n)=>{this.dcService.getStorageDcUrl(e.dc_id).then(s=>{e.file_id=e.file_id+"",this.downloadFileByUrl(e.dc_id,s,e,t).then(e=>{i(e)}).catch(t=>{this.progressFiles[e.file_id].cancel(),n(t)}).finally(()=>{delete this.progressFiles[e.file_id]})}).catch(e=>n({type:"DC_NOT_FOUND"}))})):Promise.reject({type:"BROWSER_BLOB_NOT_SUPPORTED"})}downloadFileByUrl(e,t,i,n){const s=new cf;let r=!1,a=!1;const o=this.getMimeType(i.mime);let c;const l=i.file_id;i.size=i.size||0;const h=e=>{delete this.cachedDownloadPromises[l],r=!0,s.reject(e),this.downloadProgress.next({file_id:i.file_id,percent:0,canceled:!0}),!c||e&&"DOWNLOAD_CANCELED"==e||c.truncate(0)};(n=n||{}).progress&&(this.progressFiles[i.file_id]={percent:0,cancel:()=>{a||(delete this.progressFiles[i.file_id],delete this.requestPulls[i.file_id],n.progress&&this.downloadProgress.next({file_id:i.file_id,percent:0,canceled:!0}),h("DOWNLOAD_CANCELED"))}});const d=n.toFileEntry||null,u=this.cachedSavePromises[l]||this.cachedDownloadPromises[l],p=this.getFileStorage();return u?d?u.then(e=>this.fileManager.fileCopyTo(e,d)):u:(p.getFile(l,i.size).then(e=>{d?this.fileManager.fileCopyTo(e,d).then(()=>{s.resolve()},h):s.resolve(this.cachedDownloads[l]=e)},()=>{n.progress&&this.downloadProgress.n

access_hash

pImage(e,n),c.width=n.width,c.height=n.height}return{image:o,thumb:c}}catch(n){throw n}}))}uploadFile(e,t){return gh(this,void 0,void 0,(function*(){try{let i,n=!1,s=!1;const r=new cf;if(i=new d,t){const e=e=>{s=!0,r.reject(e)};t.cancelUpload=t=>{i&&(i.unsubscribe(),i=!1),s||n||e("UPLOAD_CANCELED")}}if(!e.file_id){const n=yield this.forceRequestSendFile(t.file_inline.file_data,{addSubscribe:e=>{i.add(e)}});this.uploadRequest(e.file_data,Vp.File,n,{addSubscribe:e=>{i.add(e)},unsubByKey:e=>{}}),e.access_hash_send=n.access_hash_send,e.dc_id=n.dc_id,e.file_id=n.id,e.dc_url=n.upload_url,e.mime=this.getExt(e.file_name)}const a=e.file_data,o=a.size,c=o>=10485760,l=131072,h=Math.ceil(o/l);let u=0,p=0;const f={_:c?"inputFileBig":"inputFile",id:e.file_id,parts:h,name:a.name,access_hash_rec:""};return this.uploadQueue.next({file_id:e.file_id,uploaded_size:0,percent:0,total_size:o}),this.startRequests(e.file_id,"upload",()=>{for(let i=0;i<o;i+=l)((i,c)=>{this.filePartRequest(e.file_id,()=>gh(this,void 0,void 0,(function*(){try{const d=a.slice(i,i+l),p=yield this.getFilePart(a,i,l);if(s)return void Pu("FAILED_AND_CANCELED");const g=yield this.sendFile({access_hash_send:e.access_hash_send,file_id:e.file_id,part_number:(c+1).toString(),total_part:h.toString(),bytes:p.result,dc_url:e.dc_url,size:p.result.byteLength||d.size});if(u++,g.data&&g.data.access_hash_rec&&(f.access_hash_rec=g.data.access_hash_rec),u>=h)delete this.progressFiles[e.file_id],this.uploadQueue.next({file_id:e.file_id,percent:100,is_done:!0,blob:e.file_data}),r.resolve(f),this.removeFromQueue(e.file_id),n=!0;else{const i=Math.min(100,Math.floor(u*l*100/(o||0)));this.progressFiles[e.file_id]={percent:i},this.uploadQueue.next({obje
=n.width,c.height=n.height}return{image:o,thumb:c}}catch(n){throw n}}))}uploadFile(e,t){return gh(this,void 0,void 0,(function*(){try{let i,n=!1,s=!1;const r=new cf;if(i=new d,t){const e=e=>{s=!0,r.reject(e)};t.cancelUpload=t=>{i&&(i.unsubscribe(),i=!1),s||n||e("UPLOAD_CANCELED")}}if(!e.file_id){const n=yield this.forceRequestSendFile(t.file_inline.file_data,{addSubscribe:e=>{i.add(e)}});this.uploadRequest(e.file_data,Vp.File,n,{addSubscribe:e=>{i.add(e)},unsubByKey:e=>{}}),e.access_hash_send=n.access_hash_send,e.dc_id=n.dc_id,e.file_id=n.id,e.dc_url=n.upload_url,e.mime=this.getExt(e.file_name)}const a=e.file_data,o=a.size,c=o>=10485760,l=131072,h=Math.ceil(o/l);let u=0,p=0;const f={_:c?"inputFileBig":"inputFile",id:e.file_id,parts:h,name:a.name,access_hash_rec:""};return this.uploadQueue.next({file_id:e.file_id,uploaded_size:0,percent:0,total_size:o}),this.startRequests(e.file_id,"upload",()=>{for(let i=0;i<o;i+=l)((i,c)=>{this.filePartRequest(e.file_id,()=>gh(this,void 0,void 0,(function*(){try{const d=a.slice(i,i+l),p=yield this.getFilePart(a,i,l);if(s)return void Pu("FAILED_AND_CANCELED");const g=yield this.sendFile({access_hash_send:e.access_hash_send,file_id:e.file_id,part_number:(c+1).toString(),total_part:h.toString(),bytes:p.result,dc_url:e.dc_url,size:p.result.byteLength||d.size});if(u++,g.data&&g.data.access_hash_rec&&(f.access_hash_rec=g.data.access_hash_rec),u>=h)delete this.progressFiles[e.file_id],this.uploadQueue.next({file_id:e.file_id,percent:100,is_done:!0,blob:e.file_data}),r.resolve(f),this.removeFromQueue(e.file_id),n=!0;else{const i=Math.min(100,Math.floor(u*l*100/(o||0)));this.progressFiles[e.file_id]={percent:i},this.uploadQueue.next({object_guid:t.object_gu
|n||e("UPLOAD_CANCELED")}}if(!e.file_id){const n=yield this.forceRequestSendFile(t.file_inline.file_data,{addSubscribe:e=>{i.add(e)}});this.uploadRequest(e.file_data,Vp.File,n,{addSubscribe:e=>{i.add(e)},unsubByKey:e=>{}}),e.access_hash_send=n.access_hash_send,e.dc_id=n.dc_id,e.file_id=n.id,e.dc_url=n.upload_url,e.mime=this.getExt(e.file_name)}const a=e.file_data,o=a.size,c=o>=10485760,l=131072,h=Math.ceil(o/l);let u=0,p=0;const f={_:c?"inputFileBig":"inputFile",id:e.file_id,parts:h,name:a.name,access_hash_rec:""};return this.uploadQueue.next({file_id:e.file_id,uploaded_size:0,percent:0,total_size:o}),this.startRequests(e.file_id,"upload",()=>{for(let i=0;i<o;i+=l)((i,c)=>{this.filePartRequest(e.file_id,()=>gh(this,void 0,void 0,(function*(){try{const d=a.slice(i,i+l),p=yield this.getFilePart(a,i,l);if(s)return void Pu("FAILED_AND_CANCELED");const g=yield this.sendFile({access_hash_send:e.access_hash_send,file_id:e.file_id,part_number:(c+1).toString(),total_part:h.toString(),bytes:p.result,dc_url:e.dc_url,size:p.result.byteLength||d.size});if(u++,g.data&&g.data.access_hash_rec&&(f.access_hash_rec=g.data.access_hash_rec),u>=h)delete this.progressFiles[e.file_id],this.uploadQueue.next({file_id:e.file_id,percent:100,is_done:!0,blob:e.file_data}),r.resolve(f),this.removeFromQueue(e.file_id),n=!0;else{const i=Math.min(100,Math.floor(u*l*100/(o||0)));this.progressFiles[e.file_id]={percent:i},this.uploadQueue.next({object_guid:t.object_guid,file_id:e.file_id,uploaded_size:u*l,percent:i,total_size:o})}}catch(d){throw d}})))})(i,p++)}),r.promise}catch(i){throw delete this.progressFiles[e.file_id],i}}))}getThumbnail(e){return new Promise((t,i)=>{this.getBase64(e).then(e=>{t(e)})})}requestSend
85760,l=131072,h=Math.ceil(o/l);let u=0,p=0;const f={_:c?"inputFileBig":"inputFile",id:e.file_id,parts:h,name:a.name,access_hash_rec:""};return this.uploadQueue.next({file_id:e.file_id,uploaded_size:0,percent:0,total_size:o}),this.startRequests(e.file_id,"upload",()=>{for(let i=0;i<o;i+=l)((i,c)=>{this.filePartRequest(e.file_id,()=>gh(this,void 0,void 0,(function*(){try{const d=a.slice(i,i+l),p=yield this.getFilePart(a,i,l);if(s)return void Pu("FAILED_AND_CANCELED");const g=yield this.sendFile({access_hash_send:e.access_hash_send,file_id:e.file_id,part_number:(c+1).toString(),total_part:h.toString(),bytes:p.result,dc_url:e.dc_url,size:p.result.byteLength||d.size});if(u++,g.data&&g.data.access_hash_rec&&(f.access_hash_rec=g.data.access_hash_rec),u>=h)delete this.progressFiles[e.file_id],this.uploadQueue.next({file_id:e.file_id,percent:100,is_done:!0,blob:e.file_data}),r.resolve(f),this.removeFromQueue(e.file_id),n=!0;else{const i=Math.min(100,Math.floor(u*l*100/(o||0)));this.progressFiles[e.file_id]={percent:i},this.uploadQueue.next({object_guid:t.object_guid,file_id:e.file_id,uploaded_size:u*l,percent:i,total_size:o})}}catch(d){throw d}})))})(i,p++)}),r.promise}catch(i){throw delete this.progressFiles[e.file_id],i}}))}getThumbnail(e){return new Promise((t,i)=>{this.getBase64(e).then(e=>{t(e)})})}requestSendFile(e,t){return this.dcService.getResponsePost({method:"requestSendFile",model:{file_name:e.name,size:e.size,mime:this.getExt(e.name)}}).success()}getFile(e){return new Promise((t,i)=>{const n=e.dc_url;let s=new np;s=s.set("access-hash-rec",e.access_hash_rec);const r=yu.GetAuth();return s=s.set("auth",r),s=s.set("file-id",e.file_id+""),s=s.set("start-index",e.start_index),s=s.set
th.ceil(o/l);let u=0,p=0;const f={_:c?"inputFileBig":"inputFile",id:e.file_id,parts:h,name:a.name,access_hash_rec:""};return this.uploadQueue.next({file_id:e.file_id,uploaded_size:0,percent:0,total_size:o}),this.startRequests(e.file_id,"upload",()=>{for(let i=0;i<o;i+=l)((i,c)=>{this.filePartRequest(e.file_id,()=>gh(this,void 0,void 0,(function*(){try{const d=a.slice(i,i+l),p=yield this.getFilePart(a,i,l);if(s)return void Pu("FAILED_AND_CANCELED");const g=yield this.sendFile({access_hash_send:e.access_hash_send,file_id:e.file_id,part_number:(c+1).toString(),total_part:h.toString(),bytes:p.result,dc_url:e.dc_url,size:p.result.byteLength||d.size});if(u++,g.data&&g.data.access_hash_rec&&(f.access_hash_rec=g.data.access_hash_rec),u>=h)delete this.progressFiles[e.file_id],this.uploadQueue.next({file_id:e.file_id,percent:100,is_done:!0,blob:e.file_data}),r.resolve(f),this.removeFromQueue(e.file_id),n=!0;else{const i=Math.min(100,Math.floor(u*l*100/(o||0)));this.progressFiles[e.file_id]={percent:i},this.uploadQueue.next({object_guid:t.object_guid,file_id:e.file_id,uploaded_size:u*l,percent:i,total_size:o})}}catch(d){throw d}})))})(i,p++)}),r.promise}catch(i){throw delete this.progressFiles[e.file_id],i}}))}getThumbnail(e){return new Promise((t,i)=>{this.getBase64(e).then(e=>{t(e)})})}requestSendFile(e,t){return this.dcService.getResponsePost({method:"requestSendFile",model:{file_name:e.name,size:e.size,mime:this.getExt(e.name)}}).success()}getFile(e){return new Promise((t,i)=>{const n=e.dc_url;let s=new np;s=s.set("access-hash-rec",e.access_hash_rec);const r=yu.GetAuth();return s=s.set("auth",r),s=s.set("file-id",e.file_id+""),s=s.set("start-index",e.start_index),s=s.set("last-index",e.las

access_hash_rec

|n||e("UPLOAD_CANCELED")}}if(!e.file_id){const n=yield this.forceRequestSendFile(t.file_inline.file_data,{addSubscribe:e=>{i.add(e)}});this.uploadRequest(e.file_data,Vp.File,n,{addSubscribe:e=>{i.add(e)},unsubByKey:e=>{}}),e.access_hash_send=n.access_hash_send,e.dc_id=n.dc_id,e.file_id=n.id,e.dc_url=n.upload_url,e.mime=this.getExt(e.file_name)}const a=e.file_data,o=a.size,c=o>=10485760,l=131072,h=Math.ceil(o/l);let u=0,p=0;const f={_:c?"inputFileBig":"inputFile",id:e.file_id,parts:h,name:a.name,access_hash_rec:""};return this.uploadQueue.next({file_id:e.file_id,uploaded_size:0,percent:0,total_size:o}),this.startRequests(e.file_id,"upload",()=>{for(let i=0;i<o;i+=l)((i,c)=>{this.filePartRequest(e.file_id,()=>gh(this,void 0,void 0,(function*(){try{const d=a.slice(i,i+l),p=yield this.getFilePart(a,i,l);if(s)return void Pu("FAILED_AND_CANCELED");const g=yield this.sendFile({access_hash_send:e.access_hash_send,file_id:e.file_id,part_number:(c+1).toString(),total_part:h.toString(),bytes:p.result,dc_url:e.dc_url,size:p.result.byteLength||d.size});if(u++,g.data&&g.data.access_hash_rec&&(f.access_hash_rec=g.data.access_hash_rec),u>=h)delete this.progressFiles[e.file_id],this.uploadQueue.next({file_id:e.file_id,percent:100,is_done:!0,blob:e.file_data}),r.resolve(f),this.removeFromQueue(e.file_id),n=!0;else{const i=Math.min(100,Math.floor(u*l*100/(o||0)));this.progressFiles[e.file_id]={percent:i},this.uploadQueue.next({object_guid:t.object_guid,file_id:e.file_id,uploaded_size:u*l,percent:i,total_size:o})}}catch(d){throw d}})))})(i,p++)}),r.promise}catch(i){throw delete this.progressFiles[e.file_id],i}}))}getThumbnail(e){return new Promise((t,i)=>{this.getBase64(e).then(e=>{t(e)})})}requestSendFile
ize:0,percent:0,total_size:o}),this.startRequests(e.file_id,"upload",()=>{for(let i=0;i<o;i+=l)((i,c)=>{this.filePartRequest(e.file_id,()=>gh(this,void 0,void 0,(function*(){try{const d=a.slice(i,i+l),p=yield this.getFilePart(a,i,l);if(s)return void Pu("FAILED_AND_CANCELED");const g=yield this.sendFile({access_hash_send:e.access_hash_send,file_id:e.file_id,part_number:(c+1).toString(),total_part:h.toString(),bytes:p.result,dc_url:e.dc_url,size:p.result.byteLength||d.size});if(u++,g.data&&g.data.access_hash_rec&&(f.access_hash_rec=g.data.access_hash_rec),u>=h)delete this.progressFiles[e.file_id],this.uploadQueue.next({file_id:e.file_id,percent:100,is_done:!0,blob:e.file_data}),r.resolve(f),this.removeFromQueue(e.file_id),n=!0;else{const i=Math.min(100,Math.floor(u*l*100/(o||0)));this.progressFiles[e.file_id]={percent:i},this.uploadQueue.next({object_guid:t.object_guid,file_id:e.file_id,uploaded_size:u*l,percent:i,total_size:o})}}catch(d){throw d}})))})(i,p++)}),r.promise}catch(i){throw delete this.progressFiles[e.file_id],i}}))}getThumbnail(e){return new Promise((t,i)=>{this.getBase64(e).then(e=>{t(e)})})}requestSendFile(e,t){return this.dcService.getResponsePost({method:"requestSendFile",model:{file_name:e.name,size:e.size,mime:this.getExt(e.name)}}).success()}getFile(e){return new Promise((t,i)=>{const n=e.dc_url;let s=new np;s=s.set("access-hash-rec",e.access_hash_rec);const r=yu.GetAuth();return s=s.set("auth",r),s=s.set("file-id",e.file_id+""),s=s.set("start-index",e.start_index),s=s.set("last-index",e.last_index),s=s.set("Content-Type","text/plain"),(()=>Ju(()=>(this.totalActiveRequestCount++,this.http.post(n,null,{headers:s,responseType:"arraybuffer",observe:"response"}).pipe(Ou(1
l_size:o}),this.startRequests(e.file_id,"upload",()=>{for(let i=0;i<o;i+=l)((i,c)=>{this.filePartRequest(e.file_id,()=>gh(this,void 0,void 0,(function*(){try{const d=a.slice(i,i+l),p=yield this.getFilePart(a,i,l);if(s)return void Pu("FAILED_AND_CANCELED");const g=yield this.sendFile({access_hash_send:e.access_hash_send,file_id:e.file_id,part_number:(c+1).toString(),total_part:h.toString(),bytes:p.result,dc_url:e.dc_url,size:p.result.byteLength||d.size});if(u++,g.data&&g.data.access_hash_rec&&(f.access_hash_rec=g.data.access_hash_rec),u>=h)delete this.progressFiles[e.file_id],this.uploadQueue.next({file_id:e.file_id,percent:100,is_done:!0,blob:e.file_data}),r.resolve(f),this.removeFromQueue(e.file_id),n=!0;else{const i=Math.min(100,Math.floor(u*l*100/(o||0)));this.progressFiles[e.file_id]={percent:i},this.uploadQueue.next({object_guid:t.object_guid,file_id:e.file_id,uploaded_size:u*l,percent:i,total_size:o})}}catch(d){throw d}})))})(i,p++)}),r.promise}catch(i){throw delete this.progressFiles[e.file_id],i}}))}getThumbnail(e){return new Promise((t,i)=>{this.getBase64(e).then(e=>{t(e)})})}requestSendFile(e,t){return this.dcService.getResponsePost({method:"requestSendFile",model:{file_name:e.name,size:e.size,mime:this.getExt(e.name)}}).success()}getFile(e){return new Promise((t,i)=>{const n=e.dc_url;let s=new np;s=s.set("access-hash-rec",e.access_hash_rec);const r=yu.GetAuth();return s=s.set("auth",r),s=s.set("file-id",e.file_id+""),s=s.set("start-index",e.start_index),s=s.set("last-index",e.last_index),s=s.set("Content-Type","text/plain"),(()=>Ju(()=>(this.totalActiveRequestCount++,this.http.post(n,null,{headers:s,responseType:"arraybuffer",observe:"response"}).pipe(Ou(1e3*vh.FileRequestTim
quests(e.file_id,"upload",()=>{for(let i=0;i<o;i+=l)((i,c)=>{this.filePartRequest(e.file_id,()=>gh(this,void 0,void 0,(function*(){try{const d=a.slice(i,i+l),p=yield this.getFilePart(a,i,l);if(s)return void Pu("FAILED_AND_CANCELED");const g=yield this.sendFile({access_hash_send:e.access_hash_send,file_id:e.file_id,part_number:(c+1).toString(),total_part:h.toString(),bytes:p.result,dc_url:e.dc_url,size:p.result.byteLength||d.size});if(u++,g.data&&g.data.access_hash_rec&&(f.access_hash_rec=g.data.access_hash_rec),u>=h)delete this.progressFiles[e.file_id],this.uploadQueue.next({file_id:e.file_id,percent:100,is_done:!0,blob:e.file_data}),r.resolve(f),this.removeFromQueue(e.file_id),n=!0;else{const i=Math.min(100,Math.floor(u*l*100/(o||0)));this.progressFiles[e.file_id]={percent:i},this.uploadQueue.next({object_guid:t.object_guid,file_id:e.file_id,uploaded_size:u*l,percent:i,total_size:o})}}catch(d){throw d}})))})(i,p++)}),r.promise}catch(i){throw delete this.progressFiles[e.file_id],i}}))}getThumbnail(e){return new Promise((t,i)=>{this.getBase64(e).then(e=>{t(e)})})}requestSendFile(e,t){return this.dcService.getResponsePost({method:"requestSendFile",model:{file_name:e.name,size:e.size,mime:this.getExt(e.name)}}).success()}getFile(e){return new Promise((t,i)=>{const n=e.dc_url;let s=new np;s=s.set("access-hash-rec",e.access_hash_rec);const r=yu.GetAuth();return s=s.set("auth",r),s=s.set("file-id",e.file_id+""),s=s.set("start-index",e.start_index),s=s.set("last-index",e.last_index),s=s.set("Content-Type","text/plain"),(()=>Ju(()=>(this.totalActiveRequestCount++,this.http.post(n,null,{headers:s,responseType:"arraybuffer",observe:"response"}).pipe(Ou(1e3*vh.FileRequestTimeout),Bu(e=>200===e.sta
id,file_id:e.file_id,uploaded_size:u*l,percent:i,total_size:o})}}catch(d){throw d}})))})(i,p++)}),r.promise}catch(i){throw delete this.progressFiles[e.file_id],i}}))}getThumbnail(e){return new Promise((t,i)=>{this.getBase64(e).then(e=>{t(e)})})}requestSendFile(e,t){return this.dcService.getResponsePost({method:"requestSendFile",model:{file_name:e.name,size:e.size,mime:this.getExt(e.name)}}).success()}getFile(e){return new Promise((t,i)=>{const n=e.dc_url;let s=new np;s=s.set("access-hash-rec",e.access_hash_rec);const r=yu.GetAuth();return s=s.set("auth",r),s=s.set("file-id",e.file_id+""),s=s.set("start-index",e.start_index),s=s.set("last-index",e.last_index),s=s.set("Content-Type","text/plain"),(()=>Ju(()=>(this.totalActiveRequestCount++,this.http.post(n,null,{headers:s,responseType:"arraybuffer",observe:"response"}).pipe(Ou(1e3*vh.FileRequestTimeout),Bu(e=>200===e.status?e.body?e.status_det?Pu("RETRY"):Wu(e):Pu("FAILED_GET_FILE"):Pu("FAILED")),ju(e=>Pu(0===e.status||!e.status||e.status>=500&&e.status<600?"RETRY":"FAILED")),lf(()=>{this.totalActiveRequestCount--})))))().pipe(zu(e=>e.pipe(Bu((e,t)=>"FAILED"===e||t>=this.retryDelays.length?Pu({error:`Failed after ${this.retryDelays.length} retries`}):Wu(e).pipe(qu(1e3*this.retryDelays[t]))))),ju(e=>(i(e),Wu()))).subscribe(e=>{var i,n;const s={bytes:e.body,size:null===(i=e.body)||void 0===i?void 0:i.byteLength,total_length:null===(n=e.headers)||void 0===n?void 0:n.get("total_length")};t(s)})})}sendFile(e){return new Promise((t,i)=>{let n=new np;const s=yu.GetAuth();n=n.set("access-hash-send",e.access_hash_send),n=n.set("auth",s),n=n.set("file-id",e.file_id),n=n.set("part-number",e.part_number),n=n.set("total-part",e.total_part),n=n.set("ch

mime

a=function(t){return function(e,n,a){var c,u=r(e),s=o(u.length),f=i(a,s);if(t&&n!=n){for(;s>f;)if((c=u[f++])!=c)return!0}else for(;s>f;f++)if((t||f in u)&&u[f]===n)return t||f||0;return!t&&-1}};t.exports={includes:a(!0),indexOf:a(!1)}},OjQg:function(t,e){t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},Ox9q:function(t,e,n){var r,o,i,a=n("ocAm"),c=n("rG8t"),u=n("ezU2"),s=n("tcQx"),f=n("149L"),l=n("qx7X"),p=n("tuHh"),h=a.location,v=a.setImmediate,d=a.clearImmediate,g=a.process,y=a.MessageChannel,m=a.Dispatch,b=0,k={},w=function(t){if(k.hasOwnProperty(t)){var e=k[t];delete k[t],e()}},E=function(t){return function(){w(t)}},S=function(t){w(t.data)},x=function(t){a.postMessage(t+"",h.protocol+"//"+h.host)};v&&d||(v=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return k[++b]=function(){("function"==typeof t?t:Function(t)).apply(void 0,e)},r(b),b},d=function(t){delete k[t]},"process"==u(g)?r=function(t){g.nextTick(E(t))}:m&&m.now?r=function(t){m.now(E(t))}:y&&!p?(i=(o=new y).port2,o.port1.onmessage=S,r=s(i.postMessage,i,1)):!a.addEventListener||"function"!=typeof postMessage||a.importScripts||c(x)?r="onreadystatechange"in l("script")?function(t){f.appendChild(l("script")).onreadystatechange=function(){f
s not");var n=a.levelCodec||a.codec,s=a.container+";codecs="+n;u.b.log("creating sourceBuffer("+s+")");try{var l=t[i]=r.addSourceBuffer(s);l.addEventListener("updateend",this._onSBUpdateEnd),l.addEventListener("error",this._onSBUpdateError),this.tracks[i]={buffer:l,codec:n,id:a.id,container:a.container,levelCodec:a.levelCodec}}catch(e){u.b.error("error while trying to add sourceBuffer:"+e.message),this.hls.trigger(d.a.ERROR,{type:o.b.MEDIA_ERROR,details:o.a.BUFFER_ADD_CODEC_ERROR,fatal:!1,err:e,mimeType:s})}}this.hls.trigger(d.a.BUFFER_CREATED,{tracks:this.tracks})},a.onBufferAppending=function(e){this._needsFlush||(this.segments?this.segments.push(e):this.segments=[e],this.doAppending())},a.onBufferEos=function(e){for(var t in this.sourceBuffer)if(!e.type||e.type===t){var r=this.sourceBuffer[t];r&&!r.ended&&(r.ended=!0,u.b.log(t+" sourceBuffer now EOS"))}this.checkEos()},a.checkEos=function(){var e=this.sourceBuffer,t=this.mediaSource;if(t&&"open"===t.readyState){for(var r in e){var i=e[r];if(i){if(!i.ended)return;if(i.updating)return void(this._needsEos=!0)}}u.b.log("all media data are available, signal endOfStream() to MediaSource and stop loading fragment");try{t.endOfStream()}catch(e){u.b.warn("exception while calling mediaSource.endOfStream()")}this._needsEos=!1}else this._needsEos=!1},a.onBufferFlushing=function(e){e.type?this.flushRange.push({start:e.startOffset,end:e.endOffset,type:e.type}):(this.flushRange.push({start:e.startOffset,end:e.endOffset,type:"video"}),this.flushRange.push({start:e.startOffset,end:e.endOffset,type:"audio"})),this.flushBufferCounter=0,this.doFlush()},a.flushLiveBackBuffer=function(){if(this._live){var e=this.config.liveBackBufferLength;if(i
.nodeType||f.jquery)?C(f):C.event,m=C.Deferred(),_=C.Callbacks("once memory"),v=p.statusCode||{},y={},w={},S="canceled",k={readyState:0,getResponseHeader:function(e){var t;if(l){if(!a)for(a={};t=Ot.exec(r);)a[t[1].toLowerCase()+" "]=(a[t[1].toLowerCase()+" "]||[]).concat(t[2]);t=a[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return l?r:null},setRequestHeader:function(e,t){return null==l&&(e=w[e.toLowerCase()]=w[e.toLowerCase()]||e,y[e]=t),this},overrideMimeType:function(e){return null==l&&(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(l)k.always(e[k.status]);else for(t in e)v[t]=[v[t],e[t]];return this},abort:function(e){var t=e||S;return n&&n.abort(t),x(0,t),this}};if(m.promise(k),p.url=((e||p.url||kt.href)+"").replace(Ft,kt.protocol+"//"),p.type=t.method||t.type||p.method||p.type,p.dataTypes=(p.dataType||"*").toLowerCase().match(F)||[""],null==p.crossDomain){c=b.createElement("a");try{c.href=p.url,c.href=c.href,p.crossDomain=Ht.protocol+"//"+Ht.host!=c.protocol+"//"+c.host}catch(M){p.crossDomain=!0}}if(p.data&&p.processData&&"string"!=typeof p.data&&(p.data=C.param(p.data,p.traditional)),Ut(Nt,p,t,k),l)return k;for(d in(h=C.event&&p.global)&&0==C.active++&&C.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!jt.test(p.type),s=p.url.replace(Pt,""),p.hasContent?p.data&&p.processData&&0===(p.contentType||"").indexOf("application/x-www-form-urlencoded")&&(p.data=p.data.replace(It,"+")):(u=p.url.slice(s.length),p.data&&(p.processData||"string"==typeof p.data)&&(s+=(Mt.test(s)?"&":"?")+p.data,delete p.data),!1===p.cache&&(s=s.replace(Rt,"$1"),u=(Mt.test(s)?"&":"?")+"_="+xt.guid+++u),p.url=s+u),p.ifModified&&(
ferred(),_=C.Callbacks("once memory"),v=p.statusCode||{},y={},w={},S="canceled",k={readyState:0,getResponseHeader:function(e){var t;if(l){if(!a)for(a={};t=Ot.exec(r);)a[t[1].toLowerCase()+" "]=(a[t[1].toLowerCase()+" "]||[]).concat(t[2]);t=a[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return l?r:null},setRequestHeader:function(e,t){return null==l&&(e=w[e.toLowerCase()]=w[e.toLowerCase()]||e,y[e]=t),this},overrideMimeType:function(e){return null==l&&(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(l)k.always(e[k.status]);else for(t in e)v[t]=[v[t],e[t]];return this},abort:function(e){var t=e||S;return n&&n.abort(t),x(0,t),this}};if(m.promise(k),p.url=((e||p.url||kt.href)+"").replace(Ft,kt.protocol+"//"),p.type=t.method||t.type||p.method||p.type,p.dataTypes=(p.dataType||"*").toLowerCase().match(F)||[""],null==p.crossDomain){c=b.createElement("a");try{c.href=p.url,c.href=c.href,p.crossDomain=Ht.protocol+"//"+Ht.host!=c.protocol+"//"+c.host}catch(M){p.crossDomain=!0}}if(p.data&&p.processData&&"string"!=typeof p.data&&(p.data=C.param(p.data,p.traditional)),Ut(Nt,p,t,k),l)return k;for(d in(h=C.event&&p.global)&&0==C.active++&&C.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!jt.test(p.type),s=p.url.replace(Pt,""),p.hasContent?p.data&&p.processData&&0===(p.contentType||"").indexOf("application/x-www-form-urlencoded")&&(p.data=p.data.replace(It,"+")):(u=p.url.slice(s.length),p.data&&(p.processData||"string"==typeof p.data)&&(s+=(Mt.test(s)?"&":"?")+p.data,delete p.data),!1===p.cache&&(s=s.replace(Rt,"$1"),u=(Mt.test(s)?"&":"?")+"_="+xt.guid+++u),p.url=s+u),p.ifModified&&(C.lastModified[s]&&k.setRequestHeader("I
(p.success),k.fail(p.error),n=Ut(Bt,p,t,k)){if(k.readyState=1,h&&g.trigger("ajaxSend",[k,p]),l)return k;p.async&&p.timeout>0&&(o=i.setTimeout((function(){k.abort("timeout")}),p.timeout));try{l=!1,n.send(y,x)}catch(M){if(l)throw M;x(-1,M)}}else x(-1,"No Transport");function x(e,t,a,c){var d,u,b,y,w,S=t;l||(l=!0,o&&i.clearTimeout(o),n=void 0,r=c||"",k.readyState=e>0?4:0,d=e>=200&&e<300||304===e,a&&(y=function(e,t,i){for(var n,s,r,a,o=e.contents,c=e.dataTypes;"*"===c[0];)c.shift(),void 0===n&&(n=e.mimeType||t.getResponseHeader("Content-Type"));if(n)for(s in o)if(o[s]&&o[s].test(n)){c.unshift(s);break}if(c[0]in i)r=c[0];else{for(s in i){if(!c[0]||e.converters[s+" "+c[0]]){r=s;break}a||(a=s)}r=r||a}if(r)return r!==c[0]&&c.unshift(r),i[r]}(p,k,a)),!d&&C.inArray("script",p.dataTypes)>-1&&(p.converters["text script"]=function(){}),y=function(e,t,i,n){var s,r,a,o,c,l={},h=e.dataTypes.slice();if(h[1])for(a in e.converters)l[a.toLowerCase()]=e.converters[a];for(r=h.shift();r;)if(e.responseFields[r]&&(i[e.responseFields[r]]=t),!c&&n&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),c=r,r=h.shift())if("*"===r)r=c;else if("*"!==c&&c!==r){if(!(a=l[c+" "+r]||l["* "+r]))for(s in l)if((o=s.split(" "))[1]===r&&(a=l[c+" "+o[0]]||l["* "+o[0]])){!0===a?a=l[s]:!0!==l[s]&&(r=o[0],h.unshift(o[1]));break}if(!0!==a)if(a&&e.throws)t=a(t);else try{t=a(t)}catch(M){return{state:"parsererror",error:a?M:"No conversion from "+c+" to "+r}}}return{state:"success",data:t}}(p,y,k,d),d?(p.ifModified&&((w=k.getResponseHeader("Last-Modified"))&&(C.lastModified[s]=w),(w=k.getResponseHeader("etag"))&&(C.etag[s]=w)),204===e||"HEAD"===p.type?S="nocontent":304===e?S="notmodified":(S=y.state,u=y.data,d=!(b=y.error))):(b=S,!e&

size

t))}},Vi1R:function(t,e,n){n("94Vg")("split")},ViWx:function(t,e,n){"use strict";var r=n("wdMf"),o=n("nIH4");t.exports=r("Set",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),o)},VmbE:function(t,e,n){"use strict";var r=n("wA6s"),o=n("uoca");r({target:"String",proto:!0,forced:n("d8Sw")("strike")},{strike:function(){return o(this,"strike","","")}})},W0ke:function(t,e,n){"use strict";var r=n("wA6s"),o=n("uoca");r({target:"String",proto:!0,forced:n("d8Sw")("fontsize")},{fontsize:function(t){return o(this,"font","size",t)}})},WEX0:function(t,e,n){"use strict";var r=n("wA6s"),o=n("uoca");r({target:"String",proto:!0,forced:n("d8Sw")("link")},{link:function(t){return o(this,"a","href",t)}})},WEpO:function(t,e,n){var r=n("wA6s"),o=Math.log,i=Math.LOG10E;r({target:"Math",stat:!0},{log10:function(t){return o(t)*i}})},WKvG:function(t,e,n){"use strict";var r=n("wA6s"),o=n("uoca");r({target:"String",proto:!0,forced:n("d8Sw")("fontcolor")},{fontcolor:function(t){return o(this,"font","color",t)}})},WLa2:function(t,e,n){var r=n("wA6s"),o=n("6XUM"),i=n("M7Xk").onFreeze,a=n("cZY6"),c=n("rG8t"),u=Object.preventExtensions;r({target:"Object",stat:!0,forced:c((function(){u(1)})),sham:!a},{preventExtensions:function(t){return u&&o(t)?u(i(t)):t}})},WijE:function(t,e,n){"use strict";var r=n("wA6s"),o=n("ZJLg"),i=n("wIVT"),a=n("7/lX"),c=n("shqn"),u=n("aJMj"),s=n("2MGJ"),f=n("m41k"),l=n("g9hI"),p=n("pz+c"),h=n("G1Vw"),v=h.IteratorPrototype,d=h.BUGGY_SAFARI_ITERATORS,g=f("iterator"),y=function(){return this};t.exports=function(t,e,n,f,h,m,b){o(n,e,f);var k,w,E,S=function(t){if(t===h&&A)return A;if(!d&&t in T)return T[t];switch(t){case"keys":case"values":case"entries"
nction(t,e,n){n("94Vg")("split")},ViWx:function(t,e,n){"use strict";var r=n("wdMf"),o=n("nIH4");t.exports=r("Set",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),o)},VmbE:function(t,e,n){"use strict";var r=n("wA6s"),o=n("uoca");r({target:"String",proto:!0,forced:n("d8Sw")("strike")},{strike:function(){return o(this,"strike","","")}})},W0ke:function(t,e,n){"use strict";var r=n("wA6s"),o=n("uoca");r({target:"String",proto:!0,forced:n("d8Sw")("fontsize")},{fontsize:function(t){return o(this,"font","size",t)}})},WEX0:function(t,e,n){"use strict";var r=n("wA6s"),o=n("uoca");r({target:"String",proto:!0,forced:n("d8Sw")("link")},{link:function(t){return o(this,"a","href",t)}})},WEpO:function(t,e,n){var r=n("wA6s"),o=Math.log,i=Math.LOG10E;r({target:"Math",stat:!0},{log10:function(t){return o(t)*i}})},WKvG:function(t,e,n){"use strict";var r=n("wA6s"),o=n("uoca");r({target:"String",proto:!0,forced:n("d8Sw")("fontcolor")},{fontcolor:function(t){return o(this,"font","color",t)}})},WLa2:function(t,e,n){var r=n("wA6s"),o=n("6XUM"),i=n("M7Xk").onFreeze,a=n("cZY6"),c=n("rG8t"),u=Object.preventExtensions;r({target:"Object",stat:!0,forced:c((function(){u(1)})),sham:!a},{preventExtensions:function(t){return u&&o(t)?u(i(t)):t}})},WijE:function(t,e,n){"use strict";var r=n("wA6s"),o=n("ZJLg"),i=n("wIVT"),a=n("7/lX"),c=n("shqn"),u=n("aJMj"),s=n("2MGJ"),f=n("m41k"),l=n("g9hI"),p=n("pz+c"),h=n("G1Vw"),v=h.IteratorPrototype,d=h.BUGGY_SAFARI_ITERATORS,g=f("iterator"),y=function(){return this};t.exports=function(t,e,n,f,h,m,b){o(n,e,f);var k,w,E,S=function(t){if(t===h&&A)return A;if(!d&&t in T)return T[t];switch(t){case"keys":case"values":case"entries":return funct
function(t,e,n){"use strict";var r=n("wdMf"),o=n("nIH4");t.exports=r("Set",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),o)},VmbE:function(t,e,n){"use strict";var r=n("wA6s"),o=n("uoca");r({target:"String",proto:!0,forced:n("d8Sw")("strike")},{strike:function(){return o(this,"strike","","")}})},W0ke:function(t,e,n){"use strict";var r=n("wA6s"),o=n("uoca");r({target:"String",proto:!0,forced:n("d8Sw")("fontsize")},{fontsize:function(t){return o(this,"font","size",t)}})},WEX0:function(t,e,n){"use strict";var r=n("wA6s"),o=n("uoca");r({target:"String",proto:!0,forced:n("d8Sw")("link")},{link:function(t){return o(this,"a","href",t)}})},WEpO:function(t,e,n){var r=n("wA6s"),o=Math.log,i=Math.LOG10E;r({target:"Math",stat:!0},{log10:function(t){return o(t)*i}})},WKvG:function(t,e,n){"use strict";var r=n("wA6s"),o=n("uoca");r({target:"String",proto:!0,forced:n("d8Sw")("fontcolor")},{fontcolor:function(t){return o(this,"font","color",t)}})},WLa2:function(t,e,n){var r=n("wA6s"),o=n("6XUM"),i=n("M7Xk").onFreeze,a=n("cZY6"),c=n("rG8t"),u=Object.preventExtensions;r({target:"Object",stat:!0,forced:c((function(){u(1)})),sham:!a},{preventExtensions:function(t){return u&&o(t)?u(i(t)):t}})},WijE:function(t,e,n){"use strict";var r=n("wA6s"),o=n("ZJLg"),i=n("wIVT"),a=n("7/lX"),c=n("shqn"),u=n("aJMj"),s=n("2MGJ"),f=n("m41k"),l=n("g9hI"),p=n("pz+c"),h=n("G1Vw"),v=h.IteratorPrototype,d=h.BUGGY_SAFARI_ITERATORS,g=f("iterator"),y=function(){return this};t.exports=function(t,e,n,f,h,m,b){o(n,e,f);var k,w,E,S=function(t){if(t===h&&A)return A;if(!d&&t in T)return T[t];switch(t){case"keys":case"values":case"entries":return function(){return new n(this,t)}}return func
GJ"),o=Date.prototype,i=o.toString,a=o.getTime;new Date(NaN)+""!="Invalid Date"&&r(o,"toString",(function(){var t=a.call(this);return t==t?i.call(this):"Invalid Date"}))},nIH4:function(t,e,n){"use strict";var r=n("/Ybd").f,o=n("2RDa"),i=n("8aNu"),a=n("tcQx"),c=n("SM6+"),u=n("Rn6E"),s=n("WijE"),f=n("JHhb"),l=n("T69T"),p=n("M7Xk").fastKey,h=n("XH/I"),v=h.set,d=h.getterFor;t.exports={getConstructor:function(t,e,n,s){var f=t((function(t,r){c(t,f,e),v(t,{type:e,index:o(null),first:void 0,last:void 0,size:0}),l||(t.size=0),null!=r&&u(r,t[s],t,n)})),h=d(e),g=function(t,e,n){var r,o,i=h(t),a=y(t,e);return a?a.value=n:(i.last=a={index:o=p(e,!0),key:e,value:n,previous:r=i.last,next:void 0,removed:!1},i.first||(i.first=a),r&&(r.next=a),l?i.size++:t.size++,"F"!==o&&(i.index[o]=a)),t},y=function(t,e){var n,r=h(t),o=p(e);if("F"!==o)return r.index[o];for(n=r.first;n;n=n.next)if(n.key==e)return n};return i(f.prototype,{clear:function(){for(var t=h(this),e=t.index,n=t.first;n;)n.removed=!0,n.previous&&(n.previous=n.previous.next=void 0),delete e[n.index],n=n.next;t.first=t.last=void 0,l?t.size=0:this.size=0},delete:function(t){var e=h(this),n=y(this,t);if(n){var r=n.next,o=n.previous;delete e.index[n.index],n.removed=!0,o&&(o.next=r),r&&(r.previous=o),e.first==n&&(e.first=r),e.last==n&&(e.last=o),l?e.size--:this.size--}return!!n},forEach:function(t){for(var e,n=h(this),r=a(t,arguments.length>1?arguments[1]:void 0,3);e=e?e.next:n.first;)for(r(e.value,e.key,this);e&&e.removed;)e=e.previous},has:function(t){return!!y(this,t)}}),i(f.prototype,n?{get:function(t){var e=y(this,t);return e&&e.value},set:function(t,e){return g(this,0===t?0:t,e)}}:{add:function(t){return g(this,t=0===t?0:t,t)}}),l&&r(f
totype,i=o.toString,a=o.getTime;new Date(NaN)+""!="Invalid Date"&&r(o,"toString",(function(){var t=a.call(this);return t==t?i.call(this):"Invalid Date"}))},nIH4:function(t,e,n){"use strict";var r=n("/Ybd").f,o=n("2RDa"),i=n("8aNu"),a=n("tcQx"),c=n("SM6+"),u=n("Rn6E"),s=n("WijE"),f=n("JHhb"),l=n("T69T"),p=n("M7Xk").fastKey,h=n("XH/I"),v=h.set,d=h.getterFor;t.exports={getConstructor:function(t,e,n,s){var f=t((function(t,r){c(t,f,e),v(t,{type:e,index:o(null),first:void 0,last:void 0,size:0}),l||(t.size=0),null!=r&&u(r,t[s],t,n)})),h=d(e),g=function(t,e,n){var r,o,i=h(t),a=y(t,e);return a?a.value=n:(i.last=a={index:o=p(e,!0),key:e,value:n,previous:r=i.last,next:void 0,removed:!1},i.first||(i.first=a),r&&(r.next=a),l?i.size++:t.size++,"F"!==o&&(i.index[o]=a)),t},y=function(t,e){var n,r=h(t),o=p(e);if("F"!==o)return r.index[o];for(n=r.first;n;n=n.next)if(n.key==e)return n};return i(f.prototype,{clear:function(){for(var t=h(this),e=t.index,n=t.first;n;)n.removed=!0,n.previous&&(n.previous=n.previous.next=void 0),delete e[n.index],n=n.next;t.first=t.last=void 0,l?t.size=0:this.size=0},delete:function(t){var e=h(this),n=y(this,t);if(n){var r=n.next,o=n.previous;delete e.index[n.index],n.removed=!0,o&&(o.next=r),r&&(r.previous=o),e.first==n&&(e.first=r),e.last==n&&(e.last=o),l?e.size--:this.size--}return!!n},forEach:function(t){for(var e,n=h(this),r=a(t,arguments.length>1?arguments[1]:void 0,3);e=e?e.next:n.first;)for(r(e.value,e.key,this);e&&e.removed;)e=e.previous},has:function(t){return!!y(this,t)}}),i(f.prototype,n?{get:function(t){var e=y(this,t);return e&&e.value},set:function(t,e){return g(this,0===t?0:t,e)}}:{add:function(t){return g(this,t=0===t?0:t,t)}}),l&&r(f.prototype,"siz

💾 فایل گزارش JSON

فایل اصلی:
/home/ninijoni/ai2.sfamm.ir/rubika-source-test/rubika_web_api_discovery_v3_temp/rubika-web-api-discovery-v3_20261026_002703.json

فایل آخرین گزارش:
/home/ninijoni/ai2.sfamm.ir/rubika-source-test/rubika_web_api_discovery_v3_temp/rubika-web-api-discovery-v3_LATEST.json

فایل rubika-web-api-discovery-v3_LATEST.json را دانلود کن و برای من ارسال کن.

📌 مرحله بعد

فقط فایل JSON گزارش را برای تحلیل ارسال کن.