if("undefined"!=typeof eslpGoogleData&&eslpGoogleData.client_id&&eslpGoogleData.exchange_url){async function handleCredentialResponse(e){console.log("Token de ID:",e.credential);try{const o=parseJwt(e.credential);o.email_verified?redirectToGoogleOAuth(o.email,eslpGoogleData.redirect_url):(console.warn("Email não verificado:",o.email),showInvalidEmailToast())}catch(e){console.error("Erro ao processar login:",e)}}function parseJwt(e){var o=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),t=decodeURIComponent(atob(o).split("").map((function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})).join(""));return JSON.parse(t)}function redirectToGoogleOAuth(e,o){const t=`https://accounts.google.com/o/oauth2/v2/auth?client_id=${eslpGoogleData.client_id}&redirect_uri=${encodeURIComponent(eslpGoogleData.exchange_url)}&state=${o}&response_type=code&scope=https://www.googleapis.com/auth/userinfo.profile&login_hint=${encodeURIComponent(e)}&include_granted_scopes=true&enable_granular_consent=true`;window.location.href=t}!function(){const e=document.createElement("script");e.src="https://accounts.google.com/gsi/client",e.async=!0,e.defer=!0,e.onload=function(){google.accounts.id.initialize({client_id:eslpGoogleData.client_id,callback:handleCredentialResponse,auto_select:!1,cancel_on_tap_outside:!0,prompt_parent_id:"g_id_onload",context:"signin",itp_support:!0,use_fedcm_for_prompt:!0,enable_redirect_uri_validation:!0,advanced:{opt_in:!0,mode:"FedCM"}}),google.accounts.id.prompt()},document.head.appendChild(e)}()}