Build 533169stable
Module 912630
1,291 characters · in no known chunkDependencies
Source Raw
function(e,t,n){"use strict";n.d(t,{A:()=>v});var r=n(311907),i=n(205693),s=n(73153),a=n(617617),o=n(430452),l=n(309010),u=n(287809),c=n(965162);let d=!1,_=null,f=!1,p={};function h(e){let{assets:t}=e,n={};t.forEach(e=>n[e.id]=e),p=n}function m(e){let{videoFilterAsset:t}=e;p={...p,[t.id]:t}}function E(e){let{videoFilterAsset:t}=e;p={...p},delete p[t.id]}function g(e){let t=u.default.getCurrentUser();if(null==t)return!1;let n=e??(0,c.Hk)(a.A.settings.voiceAndVideo?.videoBackgroundFilterDesktop,t.id);return null!=l.A.getVoiceChannelId()&&o.Ay.isVideoEnabled()&&null!=n}function A(e){let{backgroundOption:t}=e;g(t)&&(f=!0)}function I(e){let{settings:t}=e;i.Tr.CAMERA_BACKGROUND_LIVE in t&&(d=!0)}function T(){_!==l.A.getVoiceChannelId()&&(f=!1),g()&&(f=!0),_=l.A.getVoiceChannelId()}function S(){d=!1,f=!1,_=null,p={}}class y extends r.Ay.Store{static displayName="VideoBackgroundStore";initialize(){this.waitFor(o.Ay,l.A,a.A,u.default),this.syncWith([l.A,o.Ay],T)}get videoFilterAssets(){return p}get hasBeenApplied(){return d}get hasUsedBackgroundInCall(){return f}}let v=new y(s.h,{VIDEO_FILTER_ASSETS_FETCH_SUCCESS:h,VIDEO_FILTER_ASSET_UPLOAD_SUCCESS:m,VIDEO_FILTER_ASSET_DELETE_SUCCESS:E,VIDEO_SAVE_LAST_USED_BACKGROUND_OPTION:A,MEDIA_ENGINE_APPLY_MEDIA_FILTER_SETTINGS:I,LOGOUT:S})}