Loading
function(e,t,n){n.d(t,{A:()=>s});var l=n(636537),a=n(451988),i=n(228366),r=n(546183),o=n(652215);let u=new a.OC(c,e=>r.default.getFetchStateForApplication(e)!==r.FetchState.FETCHING);async function c(e){i.h.dispatch({type:"USER_AUTHORIZED_APPS_REQUEST",request:null==e?{type:"full"}:{type:"partial",applicationIds:e}}),await l.Bo.get({url:o.Rsh.OAUTH2_TOKENS,oldFormErrors:!0,rejectWithError:!0,query:{application_ids:e}}).then(t=>i.h.dispatch({type:"USER_AUTHORIZED_APPS_UPDATE",isFullFetch:null==e,tokens:function(e,t){let n=Object.fromEntries(t?.map(e=>[e,null])??[]);for(let t of e)n[t.application.id]=t;return n}(t.body,e)}),()=>i.h.dispatch({type:"USER_AUTHORIZED_APPS_REQUEST_FAILED",request:null==e?{type:"full"}:{type:"partial",applicationIds:e}}))}let s={fetch(e){r.default.getFetchState()!==r.FetchState.FETCHING&&(null!=e?u.queue(e):(u.reset(),c()))},delete(e){l.Bo.del({url:o.Rsh.OAUTH2_TOKEN(e),oldFormErrors:!0,rejectWithError:!0}).then(()=>{this.fetch()})}}}