Module 809871

1,900 characters · in no known chunk
Dependencies
Required by (3)
Lazily required by (0)none
Lazily requires (0)none
Source Raw
function(e,t,n){"use strict";n.d(t,{A:()=>g});var i=n(691540),r=n(857250),a=n(97483),s=n(228366),l=n(574172),o=n(869146),d=n(113854),c=n(439372),u=n(957292),_=n(400115),E=n(174459),A=n(91242),h=n(652215);class I extends c.A{static displayName="FramesManager";actions={RPC_APP_DISCONNECTED:e=>{this.handleRPCDisconnect(e)},FRAME_LAUNCH:e=>{let{applicationId:t}=e;(0,u.Pd)(t)},FRAME_LAUNCH_FAIL:e=>{let{applicationId:t}=e;(0,_.Wl)(t)},FRAME_STOP:e=>{let{applicationId:t}=e;(0,u.iG)(t)}};handleRPCDisconnect=e=>{let{reason:t,application:n}=e,i=n.id;if(null==i||null==t)return;let r=A.A.getConnectedFrame();r?.applicationId===i&&(this.leaveFrame({applicationId:i}),t.code!==h.YI$.CLOSE_NORMAL&&(E.default.track(h.HAw.ACTIVITY_CLOSED_RPC_ERROR,{rpc_close_code:t.code,rpc_message:t.message,application_id:i}),this.showRPCDisconnectErrorUI(t)))}}var f=n(165610),p=n(375708);let T=!1,m=!1,g=new class extends I{static displayName="FramesWebManager";_initialize(){super._initialize(),o.A.addChangeListener(this.handlePopoutWindowUpdate),s.h.subscribe("POPOUT_WINDOW_OPEN",this.handlePopoutWindowOpen)}_terminate(){super._terminate(),o.A.removeChangeListener(this.handlePopoutWindowUpdate),s.h.unsubscribe("POPOUT_WINDOW_OPEN",this.handlePopoutWindowOpen)}handlePopoutWindowOpen=e=>{let{key:t}=e;t===h.MLl.ACTIVITY_POPOUT&&(m=!1)};handlePopoutWindowUpdate=()=>{let e=T,t=o.A.getWindowOpen(h.MLl.ACTIVITY_POPOUT);if(e&&!t&&!m){let e=A.A.getConnectedFrame();null!=e&&d.A.stopFrame({applicationId:e.applicationId})}T=t};popInFrame=()=>{m=!0,l.close(h.MLl.ACTIVITY_POPOUT);let e=A.A.getConnectedFrame();null!=e&&d.A.updateFrameLayoutMode({applicationId:e.applicationId,layoutMode:f.y.FOCUSED})};showRPCDisconnectErrorUI(e){let{code:t,message:n}=e,s=`${p.intl.formatToPlainString(p.t.hbiAO6,{code:t})}: ${n}`;(0,i.P0)((0,r.o)(s,a.Ck.FAILURE))}leaveFrame(e){let{applicationId:t}=e;d.A.stopFrame({applicationId:t})}}}