Loading
function(e,t,n){"use strict";n.r(t),n.d(t,{promoteFrame:()=>m,launchFrame:()=>I,resetFrameLayoutModes:()=>C,demoteMainFrame:()=>T,refreshProxyTicket:()=>D,attachFrameIframe:()=>O,attachFrameHostWindow:()=>L,detachFrameHostWindow:()=>y,updateFrameLayoutMode:()=>g,detachFrameIframe:()=>R,setFrameRunsInBackground:()=>S,updateFramePanelMode:()=>N,clearMainFrameSlot:()=>p});var i=n(73153),r=n(730602),a=n(950803),s=n(933958),l=n(988534);function o(){let e=s.Ay.getCurrentEmbeddedActivity();null!=e&&(0,l.d)({location:e.location,applicationId:e.applicationId,showFeedback:!1})}var d=n(85982),c=n(982844),u=n(197184),_=n(91242),E=n(457827),A=n(165610),h=n(5867);let f=0;async function I(e){let{applicationId:t,surface:n,launch:s,analyticsContext:l,hostWindowKey:E,showErrorModal:h=!0}=e,I=(0,A.VA)(t,n),T=_.A.getFrame(I);if(null!=T)return T.intent===A.sV.MAIN&&(m(I),g({frameId:I,layoutMode:A.y0.FOCUSED})),I;(0,A.Yf)(n)===A.sV.MAIN&&(o(),p());let S=++f;i.h.dispatch({type:"FRAME_LAUNCH_START",applicationId:t,frameId:I,surface:n,hostWindowKey:E,launch:s,launchRequestId:S});try{let[e]=await Promise.all([(0,r.D2)(t,(0,u.A)(n),n.type),(0,c.A)(t)]);return i.h.dispatch({type:"FRAME_LAUNCH",applicationId:t,frameId:I,surface:n,proxyTicket:e,analyticsContext:l,launch:s??{},hostWindowKey:E,launchRequestId:S}),I}catch(e){if(h){let n=await (0,a.f)(e,t);(0,d.A)(n.message)}throw i.h.dispatch({type:"FRAME_LAUNCH_FAIL",applicationId:t,frameId:I,launchRequestId:S,error:e,analyticsContext:l}),e}}function p(){let e=_.A.getMainFrame();null!=e&&(e.intent===A.sV.MAIN?(0,E.r)(e.id):T(e.id))}function T(e){_.A.getMainFrame()?.id===e&&(C(e),i.h.dispatch({type:"FRAME_CLEAR_MAIN_SLOT",frameId:e}))}function m(e){null!=_.A.getFrame(e)&&_.A.getMainFrame()?.id!==e&&(o(),p(),i.h.dispatch({type:"FRAME_PROMOTE",frameId:e}))}function g(e){let{frameId:t,layoutMode:n}=e,r=_.A.getFrame(t);null!=r&&i.h.dispatch({type:"FRAME_UPDATE_LAYOUT_MODE",applicationId:r.applicationId,frameId:t,layoutMode:n})}function S(e,t){i.h.dispatch({type:"FRAME_SET_RUNS_IN_BACKGROUND",frameId:e,enabled:t})}function N(e,t){i.h.dispatch({type:"FRAME_SET_PANEL_MODE",frameId:e,activityPanelMode:t})}function C(e){g({frameId:e,layoutMode:A.y0.FOCUSED}),N(e,h.Gd.PANEL)}function O(e,t){i.h.dispatch({type:"FRAME_IFRAME_MOUNT",frameId:e,iframeId:t})}function R(e,t){i.h.dispatch({type:"FRAME_IFRAME_UNMOUNT",frameId:e,iframeId:t})}function L(e,t){i.h.dispatch({type:"FRAME_HOST_WINDOW_MOUNT",frameId:e,windowKey:t})}function y(e,t){i.h.dispatch({type:"FRAME_HOST_WINDOW_UNMOUNT",frameId:e,windowKey:t})}async function D(e){let t=_.A.getFrame(e);if(null==t)return!1;let{applicationId:n,surface:s}=t;i.h.dispatch({type:"FRAME_SET_PROXY_TICKET_REFRESHING",applicationId:n,frameId:e,refreshing:!0});try{let t=await (0,r.D2)(n,(0,u.A)(s),s.type);i.h.dispatch({type:"FRAME_UPDATE_PROXY_TICKET",applicationId:n,frameId:e,proxyTicket:t})}catch(t){let e=await (0,a.f)(t,n);return(0,d.A)(e.message),!1}finally{i.h.dispatch({type:"FRAME_SET_PROXY_TICKET_REFRESHING",applicationId:n,frameId:e,refreshing:!1})}return!0}}