{"version":3,"file":"GoogleLoginButton.DLljIPAP.mjs","names":["React.useState","React.useCallback"],"sources":["https:/framerusercontent.com/modules/G6pHlNo5Di1VaINuY9ir/c2Lrks6FvzZfJBndzuZa/GoogleIcon.js","https:/framer.com/m/GoogleIcon-kXrN7w.js@c2Lrks6FvzZfJBndzuZa","https:/framerusercontent.com/modules/7AbsyEcNFg61VfpB4bJC/Fu6tHD0ESdQKfoGkEJXg/GoogleLoginButton.js"],"sourcesContent":["/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";export default function GoogleIcon(props){return /*#__PURE__*/_jsxs(\"svg\",{width:\"24\",height:\"24\",viewBox:\"0 0 24 24\",fill:\"none\",xmlns:\"http://www.w3.org/2000/svg\",children:[/*#__PURE__*/_jsx(\"path\",{fillRule:\"evenodd\",clipRule:\"evenodd\",d:\"M23.04 12.2605C23.04 11.445 22.9668 10.6609 22.8309 9.9082H12V14.3566H18.1891C17.9225 15.7941 17.1123 17.0121 15.8943 17.8275V20.713H19.6109C21.7855 18.7109 23.04 15.7627 23.04 12.2605Z\",fill:\"#4285F4\"}),/*#__PURE__*/_jsx(\"path\",{fillRule:\"evenodd\",clipRule:\"evenodd\",d:\"M11.9995 23.5005C15.1045 23.5005 17.7077 22.4708 19.6104 20.7144L15.8938 17.829C14.864 18.519 13.5467 18.9267 11.9995 18.9267C9.00425 18.9267 6.46902 16.9037 5.5647 14.1855H1.72266V17.1651C3.61493 20.9235 7.50402 23.5005 11.9995 23.5005Z\",fill:\"#34A853\"}),/*#__PURE__*/_jsx(\"path\",{fillRule:\"evenodd\",clipRule:\"evenodd\",d:\"M5.56523 14.1855C5.33523 13.4955 5.20455 12.7584 5.20455 12.0005C5.20455 11.2425 5.33523 10.5055 5.56523 9.81548V6.83594H1.72318C0.944318 8.38844 0.5 10.1448 0.5 12.0005C0.5 13.8562 0.944318 15.6125 1.72318 17.165L5.56523 14.1855Z\",fill:\"#FBBC05\"}),/*#__PURE__*/_jsx(\"path\",{fillRule:\"evenodd\",clipRule:\"evenodd\",d:\"M11.9995 5.07386C13.6879 5.07386 15.2038 5.65409 16.3956 6.79364L19.694 3.49523C17.7024 1.63955 15.0992 0.5 11.9995 0.5C7.50402 0.5 3.61493 3.07705 1.72266 6.83545L5.5647 9.815C6.46902 7.09682 9.00425 5.07386 11.9995 5.07386Z\",fill:\"#EA4335\"})]});}\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"GoogleIcon\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"auto\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./GoogleIcon.map","/*\n * GoogleIcon\n *\n * Learn More: https://www.framer.com/asset-urls\n */\n\nexport * from \"https://framerusercontent.com/modules/G6pHlNo5Di1VaINuY9ir/c2Lrks6FvzZfJBndzuZa/GoogleIcon.js\"\nexport { default } from \"https://framerusercontent.com/modules/G6pHlNo5Di1VaINuY9ir/c2Lrks6FvzZfJBndzuZa/GoogleIcon.js\"\n","import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{ControlType,addPropertyControls}from\"framer\";import GoogleIcon from\"https://framer.com/m/GoogleIcon-kXrN7w.js@c2Lrks6FvzZfJBndzuZa\";import*as React from\"react\";// ─── Constants ────────────────────────────────────────────────────────────────\nconst CLIENT_IDS={dev:\"323526149964-un862lt799c2s60fikso6v0oedubir0m.apps.googleusercontent.com\",prod:\"681811240469-ani215tcqac6eu4kq7e5a3caccj610ne.apps.googleusercontent.com\"};const GOOGLE_OAUTH_URL=\"https://accounts.google.com/o/oauth2/v2/auth\";const GOOGLE_SCOPES=[\"openid\",\"profile\",\"email\"];// ─── Style Maps ───────────────────────────────────────────────────────────────\nconst PADDING_BY_SIZE={small:\"8px 12px\",medium:\"12px 20px\",large:\"16px 24px\"};const FONT_WEIGHT_MAP={normal:400,medium:500,\"semi-bold\":600,bold:700};const JUSTIFY_BY_ALIGN={left:\"flex-start\",center:\"center\",right:\"flex-end\"};// ─── Hooks ────────────────────────────────────────────────────────────────────\nfunction useButtonStyles(variant,size,fontWeight,align,isBlock,isHovered){const bg=(()=>{if(variant===\"primary\")return isHovered?\"#0449cf\":\"#0556f3\";if(variant===\"secondary\")return\"#fff\";return isHovered?\"#f1f5fd\":\"none\";})();const button={display:\"flex\",alignItems:\"center\",gap:16,padding:PADDING_BY_SIZE[size],width:isBlock?\"100%\":undefined,justifyContent:JUSTIFY_BY_ALIGN[align],background:bg,color:variant===\"primary\"?\"#fff\":\"#25265e\",fontFamily:\"Euclid Circular A Medium\",fontSize:16,fontWeight:FONT_WEIGHT_MAP[fontWeight],lineHeight:\"24px\",border:\"1px solid #d3dce6\",borderRadius:4,cursor:\"pointer\",outline:\"none\",appearance:\"none\"};const iconWrapper={display:\"flex\",alignItems:\"center\",justifyContent:\"center\",flex:\"0 0 auto\",...variant===\"default\"&&{width:24,height:24,backgroundColor:\"#fff\",borderRadius:2,padding:4,boxSizing:\"border-box\"}};return{button,iconWrapper};}/**\n * ----------------------------\n * Helpers (no external deps)\n * ----------------------------\n */function setCookie(name,value,days=1){const expires=new Date(Date.now()+days*864e5).toUTCString();document.cookie=`${encodeURIComponent(name)}=${encodeURIComponent(value)}; expires=${expires}; path=/`;}function getValidNextURL(next){if(!next)return\"/\";if(next.startsWith(\"/\")&&!next.startsWith(\"//\"))return next;return\"/\";}function getValueFromQueryParam(param){const params=new URLSearchParams(window.location.search);return params.get(param)??\"\";}function appendQuery(urlPathAndSearch,extra){const base=new URL(urlPathAndSearch,window.location.origin);for(const[k,v]of Object.entries(extra)){if(v!==undefined&&v!==null&&String(v).length>0)base.searchParams.set(k,String(v));}return`${base.pathname}${base.search}`;}/**\n * ----------------------------\n * Constants\n * ----------------------------\n */const GOOGLE_LOGIN_CLIENT_ID=\"681811240469-ani215tcqac6eu4kq7e5a3caccj610ne.apps.googleusercontent.com\";// \"323526149964-un862lt799c2s60fikso6v0oedubir0m.apps.googleusercontent.com\"\n/**\n * ----------------------------\n * Component\n * ----------------------------\n */export default function GoogleLoginButton(props){const{buttonText=\"Continue with Google\",redirectUrl,variant=\"default\",size=\"medium\",fontWeight=\"normal\",inlineIcon=false,isBlock=false,align=\"left\",googleClientId=window.location.origin===\"https://dev.programiz.pro\"?\"323526149964-un862lt799c2s60fikso6v0oedubir0m.apps.googleusercontent.com\":GOOGLE_LOGIN_CLIENT_ID,onFailure,reason=\"\",plan=\"\"}=props;const[isHovered,setIsHovered]=React.useState(false);const styles=useButtonStyles(variant,size,fontWeight,align,isBlock,isHovered);const handleGoogleSignIn=React.useCallback(async()=>{try{const redirectUri=`${window.location.origin}/login`;let state=\"\";if(redirectUrl){const urlObj=new URL(redirectUrl,window.location.origin);state=`${urlObj.pathname}${urlObj.search}$`;}else{const next=getValueFromQueryParam(\"next\");state=getValidNextURL(next);}console.debug(\"Reason\",reason,plan);if(reason)state=appendQuery(state,{reason:reason,plan:plan});console.debug(\"State\",state);const params=new URLSearchParams({response_type:\"code\",client_id:googleClientId,redirect_uri:redirectUri,scope:GOOGLE_SCOPES.join(\" \"),state});console.debug(\"params\",params);window.location.href=`${GOOGLE_OAUTH_URL}?${params.toString()}`;}catch(err){onFailure?.(err);console.error(err);}},[redirectUrl,googleClientId,onFailure]);return /*#__PURE__*/_jsxs(\"button\",{onClick:handleGoogleSignIn,style:styles.button,onMouseEnter:()=>setIsHovered(true),onMouseLeave:()=>setIsHovered(false),type:\"button\",children:[/*#__PURE__*/_jsx(\"div\",{style:styles.iconWrapper,children:/*#__PURE__*/_jsx(GoogleIcon,{})}),/*#__PURE__*/_jsx(\"span\",{children:buttonText})]});}/**\n * ----------------------------\n * Framer Controls\n * ----------------------------\n */addPropertyControls(GoogleLoginButton,{buttonText:{type:ControlType.String,defaultValue:\"Continue with Google\"},redirectUrl:{type:ControlType.String,defaultValue:\"\"},variant:{type:ControlType.Enum,options:[\"default\",\"primary\",\"secondary\"],defaultValue:\"default\"},size:{type:ControlType.Enum,options:[\"small\",\"medium\",\"large\"],defaultValue:\"medium\"},fontWeight:{type:ControlType.Enum,options:[\"normal\",\"medium\",\"semi-bold\",\"bold\"],defaultValue:\"normal\"},inlineIcon:{type:ControlType.Boolean,defaultValue:false},isBlock:{type:ControlType.Boolean,defaultValue:false},align:{type:ControlType.Enum,options:[\"left\",\"center\",\"right\"],defaultValue:\"left\"},googleClientId:{type:ControlType.String,defaultValue:GOOGLE_LOGIN_CLIENT_ID},reason:{type:ControlType.String},plan:{type:ControlType.String}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"GoogleLoginButton\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./GoogleLoginButton.map"],"mappings":"kMAG4D,SAAwB,EAAW,EAAM,CAAC,OAAoB,EAAM,MAAM,CAAC,MAAM,KAAK,OAAO,KAAK,QAAQ,YAAY,KAAK,OAAO,MAAM,6BAA6B,SAAS,CAAc,EAAK,OAAO,CAAC,SAAS,UAAU,SAAS,UAAU,EAAE,4LAA4L,KAAK,UAAU,CAAC,CAAc,EAAK,OAAO,CAAC,SAAS,UAAU,SAAS,UAAU,EAAE,gPAAgP,KAAK,UAAU,CAAC,CAAc,EAAK,OAAO,CAAC,SAAS,UAAU,SAAS,UAAU,EAAE,yOAAyO,KAAK,UAAU,CAAC,CAAc,EAAK,OAAO,CAAC,SAAS,UAAU,SAAS,UAAU,EAAE,oOAAoO,KAAK,UAAU,CAAC,CAAC,CAAC,CAAC,kBAAt3C,qBCI2D,ICJvH,SAAS,EAAgB,EAAQ,EAAK,EAAW,EAAM,EAAQ,EAAU,CAAC,IAAM,OAAY,IAAU,UAAiB,EAAU,UAAU,UAAa,IAAU,YAAkB,OAAc,EAAU,UAAU,SAAW,CAAinB,MAAM,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