Build 533169stable
Module 115036
1,140 characters · in no known chunkDependencies
Source Raw
function(e,t,n){"use strict";let r,i,s;n.d(t,{A:()=>R});var a=n(835245),o=n(311907),l=n(506774),u=n(451988),c=n(73153),d=n(6981),_=n(427157),f=n(353835),p=n(723702),h=n(536194);let m="BrowserHandoffStore",E=!1,g=new u.Ep;function A(){null!=r&&null!=i&&(window.open(`${r}&key=${i}`),f.A.focus(null,!0))}function I(){i=null,g.stop(),E=!1,l.w.set(m,E)}function T(e){r=`${location.protocol}//${location.host}/handoff?rpc=${e.port}`,A()}function S(e){if(null!=i)return!1;i=(0,a.A)(),g.start(e.timeout,()=>(0,d.mZ)()),A()}function y(e){let{handoffKey:t,handoffToken:n,timeout:r}=e;if(null==t||null==n)return!1;E=!0,g.start(r,()=>(0,d.mZ)())}function v(e){s=new _.A(e.user)}function N(){I()}class C extends o.Ay.Store{static displayName="BrowserHandoffStore";initialize(){!1!==l.w.get(m)&&(E=p.isPlatformEmbedded&&"stable"===window.GLOBAL_ENV.RELEASE_CHANNEL)}isHandoffAvailable(){return!h.P.isDisallowPopupsSet()&&E}get user(){return s}get key(){return i}}let R=new C(c.h,{RPC_SERVER_READY:T,BROWSER_HANDOFF_BEGIN:S,BROWSER_HANDOFF_FROM_APP:y,BROWSER_HANDOFF_UNAVAILABLE:I,BROWSER_HANDOFF_SET_USER:v,LOGIN:N,LOGIN_SUCCESS:N,LOGOUT:N,REGISTER:N})}