Module 680724

1,086 characters · in no known chunk
Dependencies
Required by (1)
Lazily required by (0)none
Lazily requires (0)none
Source Raw
function(e,t,n){"use strict";n.d(t,{A:()=>g});var r=n(311907),i=n(73153),s=n(652896),a=n(383501),o=n(652215);let l={},u={},c=null;function d(){u={},l={}}function _(e){let{channelId:t,currentVoiceChannelId:n}=e;if(t===n)return!1;d()}function f(e){let{id:t}=e;for(let[e,n]of(delete l[t],Object.entries(u)))t===n&&delete u[e]}function p(e){let{channelId:t,sendMessageOptions:n,message:r,optimistic:i}=e;if(t!==a.A.getChannelId())return!1;if(i){let e=n?.activityAction?.targetUserId;return null!=e&&(l[r.id]=e,!1)}if(null==r.nonce||r.activity?.type!==o.xL.STREAM_REQUEST)return!1;let s=l[r.nonce];if(null==s)return!1;delete l[r.nonce],u={...u,[s]:r.id}}function h(e){let{streamKey:t}=e,{ownerId:n}=s.Iy(t);if(null==u[n])return!1;delete u[n]}function m(){if(a.A.getWasMoved()){if(a.A.getChannelId()===c)return!1;c=a.A.getChannelId(),d()}else{if(null==c)return!1;c=null}}class E extends r.Ay.Store{initialize(){this.waitFor(a.A)}getPendingRequestForUser(e){return u[e]}}let g=new E(i.h,{STREAM_WATCH:h,MESSAGE_CREATE:p,MESSAGE_DELETE:f,VOICE_CHANNEL_SELECT:_,VOICE_STATE_UPDATES:m,LOGOUT:d})}