{"version":3,"file":"GoogleConnectionModule.min.js","names":["initializeApp","getAnalytics","getFirestore","getAuth","createUserWithEmailAndPassword","sendEmailVerification","updateProfile","signInWithEmailAndPassword","onAuthStateChanged","signOut","signInWithPopup","GoogleAuthProvider","FacebookAuthProvider","TwitterAuthProvider","firebaseConfig","apiKey","authDomain","projectId","storageBucket","messagingSenderId","appId","measurementId","app","provider","auth","analytics","signin","then","result","credentialFromResult","accessToken","callLogin","user","catch","error","code","message","customData","email","credentialFromError","console","log","$","ajax","url","dataType","method","traditional","data","JSON","stringify","done","response","window","location","href","document","getElementById","onclick","fbprovider","addScope","addEventListener","errorCode","errorMessage","credential","twprovider","secret"],"sources":["js/GoogleConnectionModule.js"],"mappings":"OACYA,kBAAoB,mEAGpBC,iBAAmB,yEAItBC,iBAAoB,yEAIzBC,QACAC,+BACAC,sBACAC,cACAC,2BACAC,mBACAC,QACAC,gBACAC,mBACAC,qBACAC,wBACG,6DAGP,MAAMC,eAAiB,CACnBC,OAAQ,0CACRC,WAAY,oCACZC,UAAW,oBACXC,cAAe,gCACfC,kBAAmB,eACnBC,MAAO,4CACPC,cAAe,gBAGbC,IAAMtB,cAAcc,gBACpBS,SAAW,IAAIZ,mBACfa,KAAOrB,UACPsB,UAAYxB,aAAaqB,KAC/B,SAASI,SACThB,gBAAgBc,KAAMD,UACjBI,MAAMC,IAEgBjB,mBAAmBkB,qBAAqBD,GAClCE,YAKzBC,UAHaH,EAAOI,KAGL,IAChBC,OAAOC,IAEYA,EAAMC,KACHD,EAAME,QAEbF,EAAMG,WAAWC,MAEZ3B,mBAAmB4B,oBAAoBL,EAAM,GAGxE,CACA,SAASH,UAAUC,GACfQ,QAAQC,IAAIT,GACZU,EAAEC,KAAK,CACHC,IAAK,qBACLC,SAAU,OACVC,OAAQ,OACRC,aAAa,EACbC,KACA,CACIhB,KAAMiB,KAAKC,UAAUlB,MAE1BmB,MAAK,SAAUC,GACdC,OAAOC,SAASC,KAAOH,EAASJ,IACpC,GACJ,CACAQ,SAASC,eAAe,SAASC,QAAU,WACvChC,QACJ,EAEA8B,SAASC,eAAe,YAAYC,QAAU,WAC1ChC,QACJ,EAIA,MAAMiC,WAAa,IAAI/C,qBACvB+C,WAAWC,SAAS,yBACpBJ,SACKC,eAAe,UACfI,iBAAiB,SAAS,WACvBnD,gBAAgBc,KAAMmC,YACjBhC,MAAMC,IAEH,MAAMI,EAAOJ,EAAOI,KAGhBpB,qBAAqBiB,qBAAqBD,GACfE,YAC/BC,UAAUC,EAAK,IAIlBC,OAAOC,IAEJ,MAAM4B,EAAY5B,EAAMC,KAClB4B,EAAe7B,EAAME,QAErBE,EAAQJ,EAAMG,WAAWC,MAEzB0B,EAAapD,qBAAqB2B,oBAAoBL,GAE5DM,QAAQC,IAAIqB,EAAWC,EAAczB,EAAO0B,EAAW,GAEnE,IAGJ,MAAMC,WAAa,IAAIpD,oBACvB2C,SACKC,eAAe,iBACfI,iBAAiB,SAAS,WACvBnD,gBAAgBc,KAAMyC,YACjBtC,MAAMC,IAGH,MAAMoC,EAAanD,oBAAoBgB,qBAAqBD,GAC9CoC,EAAWlC,YACVkC,EAAWE,OAGbtC,EAAOI,KACpBqB,OAAOC,SAASC,KAAO,WAAW,IAIrCtB,OAAOC,IAEJ,MAAM4B,EAAY5B,EAAMC,KAClB4B,EAAe7B,EAAME,QAErBE,EAAQJ,EAAMG,WAAWC,MAEzB0B,EAAanD,oBAAoB0B,oBAAoBL,GAE3DM,QAAQC,IAAIqB,EAAWC,EAAczB,EAAO0B,EAAW,GAEnE","ignoreList":[],"sourcesContent":["\r\n import {initializeApp} from 'https://www.gstatic.com/firebasejs/9.19.1/firebase-app.js'\r\n\r\n // If you enabled Analytics in your project, add the Firebase SDK for Google Analytics\r\n import {getAnalytics} from 'https://www.gstatic.com/firebasejs/9.19.1/firebase-analytics.js'\r\n\r\n // Add Firebase products that you want to use\r\n /* import {getAuth} from 'https://www.gstatic.com/firebasejs/9.19.1/firebase-auth.js'*/\r\nimport { getFirestore } from 'https://www.gstatic.com/firebasejs/9.19.1/firebase-firestore.js'\r\n\r\n\r\nimport {\r\n getAuth,\r\n createUserWithEmailAndPassword,\r\n sendEmailVerification,\r\n updateProfile,\r\n signInWithEmailAndPassword,\r\n onAuthStateChanged,\r\n signOut,\r\n signInWithPopup,\r\n GoogleAuthProvider,\r\n FacebookAuthProvider,\r\n TwitterAuthProvider,\r\n} from \"https://www.gstatic.com/firebasejs/9.19.1/firebase-auth.js\";\r\n \r\n\r\nconst firebaseConfig = {\r\n apiKey: \"AIzaSyB799B7DS6fITQtflefME9u4baknreMTTQ\",\r\n authDomain: \"tellmyroute-2689e.firebaseapp.com\",\r\n projectId: \"tellmyroute-2689e\",\r\n storageBucket: \"tellmyroute-2689e.appspot.com\",\r\n messagingSenderId: \"735276613863\",\r\n appId: \"1:735276613863:web:2008633ba3d1a4f1546242\",\r\n measurementId: \"G-B7BB9LHBB6\"\r\n};\r\n // Initialize Firebase\r\nconst app = initializeApp(firebaseConfig);\r\nconst provider = new GoogleAuthProvider();\r\nconst auth = getAuth();\r\nconst analytics = getAnalytics(app);\r\nfunction signin() {\r\nsignInWithPopup(auth, provider)\r\n .then((result) => {\r\n // This gives you a Google Access Token. You can use it to access the Google API.\r\n const credential = GoogleAuthProvider.credentialFromResult(result);\r\n const token = credential.accessToken;\r\n // The signed-in user info.\r\n const user = result.user;\r\n // IdP data available using getAdditionalUserInfo(result)\r\n // ...\r\n callLogin(user);\r\n }).catch((error) => {\r\n // Handle Errors here.\r\n const errorCode = error.code;\r\n const errorMessage = error.message;\r\n // The email of the user's account used.\r\n const email = error.customData.email;\r\n // The AuthCredential type that was used.\r\n const credential = GoogleAuthProvider.credentialFromError(error);\r\n // ...\r\n });\r\n}\r\nfunction callLogin(user) {\r\n console.log(user)\r\n $.ajax({\r\n url: \"/Login/GoogleLogin\",\r\n dataType: \"json\",\r\n method: \"post\",\r\n traditional: true,\r\n data:\r\n {\r\n user: JSON.stringify(user)\r\n }\r\n }).done(function (response) {\r\n window.location.href = response.data;\r\n });\r\n}\r\ndocument.getElementById(\"glink\").onclick = function () {\r\n signin();\r\n};\r\n\r\ndocument.getElementById(\"glinkreg\").onclick = function () {\r\n signin();\r\n};\r\n\r\n\r\n//Facebook SignIn\r\nconst fbprovider = new FacebookAuthProvider();\r\nfbprovider.addScope(\"public_profile, email\");\r\ndocument\r\n .getElementById(\"fblink\")\r\n .addEventListener(\"click\", function () {\r\n signInWithPopup(auth, fbprovider)\r\n .then((result) => {\r\n // The signed-in user info.\r\n const user = result.user;\r\n // This gives you a Facebook Access Token. You can use it to access the Facebook API.\r\n const credential =\r\n FacebookAuthProvider.credentialFromResult(result);\r\n const accessToken = credential.accessToken;\r\n callLogin(user);\r\n // IdP data available using getAdditionalUserInfo(result)\r\n // ...\r\n })\r\n .catch((error) => {\r\n // Handle Errors here.\r\n const errorCode = error.code;\r\n const errorMessage = error.message;\r\n // The email of the user's account used.\r\n const email = error.customData.email;\r\n // The AuthCredential type that was used.\r\n const credential = FacebookAuthProvider.credentialFromError(error);\r\n // ...\r\n console.log(errorCode, errorMessage, email, credential);\r\n });\r\n });\r\n\r\n//Twitter SignIn\r\nconst twprovider = new TwitterAuthProvider();\r\ndocument\r\n .getElementById(\"twittersignin\")\r\n .addEventListener(\"click\", function () {\r\n signInWithPopup(auth, twprovider)\r\n .then((result) => {\r\n // This gives you a the Twitter OAuth 1.0 Access Token and Secret.\r\n // You can use these server side with your app's credentials to access the Twitter API.\r\n const credential = TwitterAuthProvider.credentialFromResult(result);\r\n const token = credential.accessToken;\r\n const secret = credential.secret;\r\n\r\n // The signed-in user info.\r\n const user = result.user;\r\n window.location.href = \"home.html\";\r\n // IdP data available using getAdditionalUserInfo(result)\r\n // ...\r\n })\r\n .catch((error) => {\r\n // Handle Errors here.\r\n const errorCode = error.code;\r\n const errorMessage = error.message;\r\n // The email of the user's account used.\r\n const email = error.customData.email;\r\n // The AuthCredential type that was used.\r\n const credential = TwitterAuthProvider.credentialFromError(error);\r\n // ...\r\n console.log(errorCode, errorMessage, email, credential);\r\n });\r\n });"]}