import{_ as n}from"./main-tangy-colts-beg.js";globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(o,t){return this.cache.has(o)?this.cache.get(o):(this.cache.set(o,t),t)}};const r=o=>({addConnectionHelpingText:n("You can find credentials from ")+`<a target="_blank" class="text-blue-600 underline" rel="noopener noreferrer nofollow" href="https://console.cloud.google.com/apis/credentials">${n("Here")}</a>`,componentName:o.componentName.connection,connectionsTypes:[{authCodeEndpoint:{method:"GET",queryParams:{access_type:"offline",client_id:"",prompt:"consent",response_type:"code",scope:"https://mail.google.com/"},url:"https://accounts.google.com/o/oauth2/v2/auth"},encryptKeys:["access_token","refresh_token","client_secret"],label:n("OAuth 2"),refreshTokenUrl:"https://oauth2.googleapis.com/token",tokenEndpoint:{bodyParams:{client_id:"",client_secret:"",grant_type:"authorization_code"},method:"POST",url:"https://oauth2.googleapis.com/token"},type:"oauth2",verifyConnection:{method:"GET",queryParams:{access_token:"$_access_token_$"},responseMatch:{scope:"https://mail.google.com/"},url:"https://www.googleapis.com/oauth2/v2/tokeninfo"}}],fieldType:"config",id:"connection-id",label:n("Select Connection"),onConnectionAddChange:"CONNECTION_ADD_CHANGE",onConnectionChange:"SET_CONNECTION",render:!0,value:void 0}),l=({$:o,e:t})=>{o.setThisComponent(c=>{var a,i;if(!o.util.isConnectionComponent(c))return;const e=c.connectionsTypes[0];e.type==="oauth2"&&((a=e==null?void 0:e.authCodeEndpoint)!=null&&a.queryParams)&&(e.authCodeEndpoint.queryParams.client_id=t.clientId),e.type==="oauth2"&&((i=e==null?void 0:e.tokenEndpoint)!=null&&i.bodyParams)&&(e.tokenEndpoint.bodyParams.client_id=t.clientId,e.tokenEndpoint.bodyParams.client_secret=t.clientSecret)})};export{r as c,l as h};
