Module 787389

877 characters · in no known chunk
Dependencies
Required by (2)
Lazily required by (0)none
Lazily requires (0)none
Source Raw
function(e,t,n){"use strict";n.d(t,{A:()=>h});var i=n(64700),r=n(17928),s=n(522305),a=n(627363),o=n(113854),l=n(91242),u=n(207371),c=n(933958),d=n(748975),_=n(165610);function h(e){let{applicationId:t,analyticsLocations:n,runBeforeLaunchAttempt:h,runAfterLaunchAttempt:f}=e,{data:E}=(0,a.YY)(t),p=(0,r.bG)([c.Ay],()=>c.Ay.getCurrentEmbeddedActivity()),m=(0,r.bG)([l.A],()=>l.A.getConnectedFrame()),g=(0,u.x)(E);return i.useCallback(async()=>{if(null==t||null==E)return;let e=null!=p&&p.applicationId===t;if(null!=m&&m.applicationId===t)return void o.A.updateFrameLayoutMode({applicationId:m.applicationId,layoutMode:_.y.FOCUSED});if(e){let e=p.location;(0,d.A)("guild_id"in e?e.guild_id:null,e);return}h?.();try{g?await o.A.launchFrame({applicationId:t}):E?.bot?.id!=null&&await (0,s.Q)({appId:t,botId:E?.bot?.id,analyticsLocations:n??[]})}catch(e){}f?.()},[n,E,t,g,p,m,f,h])}}