\n \n Login Google? {{ isLogin }}\n
\n\n\n\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/@vue/cli-plugin-babel/node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./LoginAccount.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/@vue/cli-plugin-babel/node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./LoginAccount.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./LoginAccount.vue?vue&type=template&id=03ca362e&\"\nimport script from \"./LoginAccount.vue?vue&type=script&lang=js&\"\nexport * from \"./LoginAccount.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","\nvar googleAuth = (function () {\n\n function installClient() {\n var apiUrl = 'https://apis.google.com/js/api.js'\n return new Promise((resolve) => {\n var script = document.createElement('script')\n script.src = apiUrl\n script.onreadystatechange = script.onload = function () {\n if (!script.readyState || /loaded|complete/.test(script.readyState)) {\n setTimeout(function () {\n resolve()\n }, 500)\n }\n }\n document.getElementsByTagName('head')[0].appendChild(script)\n })\n }\n\n function initClient(config) {\n return new Promise((resolve, reject) => {\n window.gapi.load('auth2', () => {\n window.gapi.auth2.init(config)\n .then(() => {\n resolve(window.gapi)\n }).catch((error) => {\n reject(error)\n })\n })\n })\n\n }\n\n function Auth() {\n if (!(this instanceof Auth))\n return new Auth()\n this.GoogleAuth = null /* window.gapi.auth2.getAuthInstance() */\n this.isAuthorized = false\n this.isInit = false\n this.prompt = null\n this.isLoaded = function () {\n /* eslint-disable */\n console.warn('isLoaded() will be deprecated. You can use \"this.$gAuth.isInit\"')\n return !!this.GoogleAuth\n };\n\n this.load = (config, prompt) => {\n installClient()\n .then(() => {\n return initClient(config)\n })\n .then((gapi) => {\n this.GoogleAuth = gapi.auth2.getAuthInstance()\n this.isInit = true\n this.prompt = prompt\n this.isAuthorized = this.GoogleAuth.isSignedIn.get()\n }).catch((error) => {\n console.error(error)\n })\n };\n\n this.signIn = (successCallback, errorCallback) => {\n return new Promise((resolve, reject) => {\n if (!this.GoogleAuth) {\n if (typeof errorCallback === 'function') errorCallback(false)\n reject(false)\n return\n }\n this.GoogleAuth.signIn()\n .then(googleUser => {\n if (typeof successCallback === 'function') successCallback(googleUser)\n this.isAuthorized = this.GoogleAuth.isSignedIn.get()\n resolve(googleUser)\n })\n .catch(error => {\n if (typeof errorCallback === 'function') errorCallback(error)\n reject(error)\n })\n })\n };\n\n this.getAuthCode = (successCallback, errorCallback) => {\n return new Promise((resolve, reject) => {\n if (!this.GoogleAuth) {\n if (typeof errorCallback === 'function') errorCallback(false)\n reject(false)\n return\n }\n this.GoogleAuth.grantOfflineAccess({ prompt: this.prompt })\n .then(function (resp) {\n if (typeof successCallback === 'function') successCallback(resp.code)\n resolve(resp.code)\n })\n .catch(function (error) {\n if (typeof errorCallback === 'function') errorCallback(error)\n reject(error)\n })\n })\n };\n\n this.signOut = (successCallback, errorCallback) => {\n return new Promise((resolve, reject) => {\n if (!this.GoogleAuth) {\n if (typeof errorCallback === 'function') errorCallback(false)\n reject(false)\n return\n }\n this.GoogleAuth.signOut()\n .then(() => {\n if (typeof successCallback === 'function') successCallback()\n this.isAuthorized = false\n resolve(true)\n })\n .catch(error => {\n if (typeof errorCallback === 'function') errorCallback(error)\n reject(error)\n })\n })\n };\n }\n\n return new Auth()\n})();\n\n\n\n\nfunction installGoogleAuthPlugin(Vue, options) {\n /* eslint-disable */\n //set config\n let GoogleAuthConfig = null\n let GoogleAuthDefaultConfig = { scope: 'profile email' }\n let prompt = 'select_account'\n if (typeof options === 'object') {\n GoogleAuthConfig = Object.assign(GoogleAuthDefaultConfig, options)\n if (options.scope) GoogleAuthConfig.scope = options.scope\n if (options.prompt) prompt = options.prompt\n if (!options.clientId) {\n console.warn('clientId is required')\n }\n } else {\n console.warn('invalid option type. Object type accepted only')\n }\n\n //Install Vue plugin\n Vue.gAuth = googleAuth\n Object.defineProperties(Vue.prototype, {\n $gAuth: {\n get: function () {\n return Vue.gAuth\n }\n }\n })\n Vue.gAuth.load(GoogleAuthConfig, prompt)\n}\n\nexport default installGoogleAuthPlugin\n"],"sourceRoot":""}