1class AuthGoogleOneTap{CLIENT_ID="970561948081-q6f0dmtmkf9e349s67em57uf12ljtdkv.apps.googleusercontent.com";GSI_SRC="https://accounts.google.com/gsi/client";#e=!1;constructor(){this.noAmplitudeParam=new URLSearchParams(document.location.search).get("no-amplitude"),this.noAmplitudeParam||(async()=>{const{loginExistingUserAmplitude:e}=await import("authAmplitude")})()}#t(e){if(window.google?.accounts?.id)return e();let t=0;const o=setInterval(()=>{window.google?.accounts?.id?(clearInterval(o),e()):++t>200&&clearInterval(o)},50)}loadGsiScript(){if(window.google?.accounts?.id)return Promise.resolve();const e=document.querySelector(`script[src="${this.GSI_SRC}"]`);return new Promise(e?(t,o)=>{e.addEventListener("load",t,{once:!0}),e.addEventListener("error",o,{once:!0})}:(e,t)=>{const o=document.createElement("script");o.src=this.GSI_SRC,o.async=!0,o.defer=!0,o.onload=e,o.onerror=t,document.head.appendChild(o)})}init(){if(this.#e)return;this.#e=!0;const e=async()=>{try{await this.loadGsiScript()}catch(e){return}this.#t(()=>{google.accounts.id.initialize({client_id:this.CLIENT_ID,use_fedcm_for_prompt:!0,cancel_on_tap_outside:!1,callback:e=>this.handleCredentialResponse(e)}),google.accounts.id.prompt(()=>{})})};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",e):e()}async handleCredentialResponse(e){const t=e?.credential;if(t)try{storage.getScrollPosition()||storage.setScrollPosition(window.scrollY||window.pageYOffset),storage.setRegPlacement("google_one_tap");if(!(await fetch("/connect/google/onetap",{method:"POST",headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"},credentials:"same-origin",body:JSON.stringify({credential:t})})).ok)return;const e=new URL(window.location.href);e.searchParams.set("logged_in","true"),window.location.href=e.toString()}catch(e){}}}const authGoogleOneTap=new AuthGoogleOneTap;export{authGoogleOneTap};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.