{"version":3,"sources":["meteor://💻app/packages/accounts-google/notice.js","meteor://💻app/packages/accounts-google/google.js"],"names":["Package","Object","prototype","hasOwnProperty","call","console","warn","_objectSpread","module","link","default","v","Accounts","oauth","registerService","Meteor","isClient","loginWithGoogle","options","callback","isCordova","Google","signIn","_options","restrictCreationByEmailDomain","loginUrlParameters","hd","credentialRequestCompleteCallback","credentialRequestCompleteHandler","requestCredential","registerClientLoginFunction","args","applyLoginFunction","addAutopublishFields","forLoggedInUser","whitelistedFields","concat","map","subfield","forOtherUsers","filter","field"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,IAAIA,OAAO,CAAC,aAAD,CAAP,IACG,CAACA,OAAO,CAAC,uBAAD,CADX,IAEG,CAACC,MAAM,CAACC,SAAP,CAAiBC,cAAjB,CAAgCC,IAAhC,CAAqCJ,OAArC,EAA8C,kBAA9C,CAFR,EAE2E;AACzEK,SAAO,CAACC,IAAR,CACE,0DACA,0DADA,GAEA,mCAFA,GAGA,IAHA,GAIA,iCAJA,GAKA,IANF;AAQD,C;;;;;;;;;;;ACXD,IAAIC,aAAJ;;AAAkBC,MAAM,CAACC,IAAP,CAAY,sCAAZ,EAAmD;AAACC,SAAO,CAACC,CAAD,EAAG;AAACJ,iBAAa,GAACI,CAAd;AAAgB;;AAA5B,CAAnD,EAAiF,CAAjF;AAAlBC,QAAQ,CAACC,KAAT,CAAeC,eAAf,CAA+B,QAA/B;;AAEA,IAAIC,MAAM,CAACC,QAAX,EAAqB;AACnB,QAAMC,eAAe,GAAG,CAACC,OAAD,EAAUC,QAAV,KAAuB;AAC7C;AACA,QAAI,CAAEA,QAAF,IAAc,OAAOD,OAAP,KAAmB,UAArC,EAAiD;AAC/CC,cAAQ,GAAGD,OAAX;AACAA,aAAO,GAAG,IAAV;AACD;;AAED,QAAIH,MAAM,CAACK,SAAP,IACAC,MAAM,CAACC,MADX,EACmB;AACjB;AACA;AACA;AACAD,YAAM,CAACC,MAAP,CAAcJ,OAAd,EAAuBC,QAAvB;AACA;AACD,KAd4C,CAgB7C;AACA;AACA;AACA;AACA;;;AACA,QAAI,OAAOP,QAAQ,CAACW,QAAT,CAAkBC,6BAAzB,KAA2D,QAA/D,EAAyE;AACvEN,aAAO,qBAAQA,OAAR,CAAP;AACAA,aAAO,CAACO,kBAAR,qBAAkCP,OAAO,CAACO,kBAA1C;AACAP,aAAO,CAACO,kBAAR,CAA2BC,EAA3B,GAAgCd,QAAQ,CAACW,QAAT,CAAkBC,6BAAlD;AACD;;AACD,UAAMG,iCAAiC,GAAGf,QAAQ,CAACC,KAAT,CAAee,gCAAf,CAAgDT,QAAhD,CAA1C;AACAE,UAAM,CAACQ,iBAAP,CAAyBX,OAAzB,EAAkCS,iCAAlC;AACD,GA5BD;;AA6BAf,UAAQ,CAACkB,2BAAT,CAAqC,QAArC,EAA+Cb,eAA/C;;AACAF,QAAM,CAACE,eAAP,GACE;AAAA,sCAAIc,IAAJ;AAAIA,UAAJ;AAAA;;AAAA,WAAanB,QAAQ,CAACoB,kBAAT,CAA4B,QAA5B,EAAsCD,IAAtC,CAAb;AAAA,GADF;AAED,CAjCD,MAiCO;AACLnB,UAAQ,CAACqB,oBAAT,CAA8B;AAC5BC,mBAAe,EACb;AACA;AACA;AACA;AACAb,UAAM,CAACc,iBAAP,CAAyBC,MAAzB,CAAgC,CAAC,aAAD,EAAgB,WAAhB,CAAhC,EAA8DC,GAA9D,CACEC,QAAQ,8BAAuBA,QAAvB,CADV,CAC4C;AAD5C,KAN0B;AAU5BC,iBAAa,EACX;AACA;AACAlB,UAAM,CAACc,iBAAP,CAAyBK,MAAzB,CACEC,KAAK,IAAIA,KAAK,KAAK,OAAV,IAAqBA,KAAK,KAAK,gBAD1C,EAEEJ,GAFF,CAGEC,QAAQ,8BAAuBA,QAAvB,CAHV;AAb0B,GAA9B;AAmBD,C","file":"/packages/accounts-google.js","sourcesContent":["if (Package['accounts-ui']\n && !Package['service-configuration']\n && !Object.prototype.hasOwnProperty.call(Package, 'google-config-ui')) {\n console.warn(\n \"Note: You're using accounts-ui and accounts-google,\\n\" +\n \"but didn't install the configuration UI for the Google\\n\" +\n \"OAuth. You can install it with:\\n\" +\n \"\\n\" +\n \" meteor add google-config-ui\" +\n \"\\n\"\n );\n}\n","Accounts.oauth.registerService('google');\n\nif (Meteor.isClient) {\n const loginWithGoogle = (options, callback) => {\n // support a callback without options\n if (! callback && typeof options === \"function\") {\n callback = options;\n options = null;\n }\n\n if (Meteor.isCordova &&\n Google.signIn) {\n // After 20 April 2017, Google OAuth login will no longer work from\n // a WebView, so Cordova apps must use Google Sign-In instead.\n // https://github.com/meteor/meteor/issues/8253\n Google.signIn(options, callback);\n return;\n }\n\n // Use Google's domain-specific login page if we want to restrict creation to\n // a particular email domain. (Don't use it if restrictCreationByEmailDomain\n // is a function.) Note that all this does is change Google's UI ---\n // accounts-base/accounts_server.js still checks server-side that the server\n // has the proper email address after the OAuth conversation.\n if (typeof Accounts._options.restrictCreationByEmailDomain === 'string') {\n options = { ...options };\n options.loginUrlParameters = { ...options.loginUrlParameters };\n options.loginUrlParameters.hd = Accounts._options.restrictCreationByEmailDomain;\n }\n const credentialRequestCompleteCallback = Accounts.oauth.credentialRequestCompleteHandler(callback);\n Google.requestCredential(options, credentialRequestCompleteCallback);\n };\n Accounts.registerClientLoginFunction('google', loginWithGoogle);\n Meteor.loginWithGoogle = \n (...args) => Accounts.applyLoginFunction('google', args);\n} else {\n Accounts.addAutopublishFields({\n forLoggedInUser:\n // publish access token since it can be used from the client (if\n // transmitted over ssl or on\n // localhost). https://developers.google.com/accounts/docs/OAuth2UserAgent\n // refresh token probably shouldn't be sent down.\n Google.whitelistedFields.concat(['accessToken', 'expiresAt']).map(\n subfield => `services.google.${subfield}` // don't publish refresh token\n ), \n\n forOtherUsers: \n // even with autopublish, no legitimate web app should be\n // publishing all users' emails\n Google.whitelistedFields.filter(\n field => field !== 'email' && field !== 'verified_email'\n ).map(\n subfield => `services.google.${subfield}`\n ),\n });\n}\n"]}