File "ng-cordova-oauth.min.js"

Full Path: /srv/www/www.cadoro.it/app/lib/ng-cordova-oauth/dist/ng-cordova-oauth.min.js
File size: 59.94 KB
MIME-type: text/plain
Charset: utf-8

// ng-cordova-oauth - v0.3.0 (2016-11-17)
// http://www.nraboy.com
!function(){"use strict";function a(a,b,c){function d(b,d){var e=a.defer();if(window.cordova)if(c.isInAppBrowserInstalled()){var f="http://localhost/callback";void 0!==d&&d.hasOwnProperty("redirect_uri")&&(f=d.redirect_uri);var g=window.cordova.InAppBrowser.open("https://api.500px.com/v1/api/js-sdk/authorize?sdk_key="+b+"&callback="+f,"_blank","toolbar=no,zoom=no,location=no,clearsessioncache=yes,clearcache=yes");g.addEventListener("loadstart",function(a){if(0===a.url.indexOf(f)){var b=a.url.split("#token:")[1].split(",")[0];e.resolve({error:!1,success:!0,access_token:b,callback:f})}else e.reject({success:!1,callback:f,error:!0,access_token:null})}),g.addEventListener("exit",function(a){e.reject("The sign in flow was canceled")})}else e.reject("Could not find InAppBrowser plugin");else e.reject("Cannot authenticate via a web browser");return e.promise}return{signin:d}}angular.module("oauth.500px",["oauth.utils"]).factory("$ngCordova500px",a),a.$inject=["$q","$http","$cordovaOauthUtility"]}(),function(){"use strict";function a(a,b,c){function d(d,e,f){var g=a.defer();if(window.cordova)if(c.isInAppBrowserInstalled()){var h=window.cordova.InAppBrowser.open(e+"/adfs/oauth2/authorize?response_type=code&client_id="+d+"&redirect_uri=http://localhost/callback&resource="+f,"_blank","location=no");h.addEventListener("loadstart",function(a){if(0===a.url.indexOf("http://localhost/callback")){var c=a.url.split("code=")[1];b({method:"post",headers:{"Content-Type":"application/x-www-form-urlencoded"},url:e+"/adfs/oauth2/token",data:"client_id="+d+"&code="+c+"&redirect_uri=http://localhost/callback&grant_type=authorization_code"}).success(function(a){g.resolve(a)}).error(function(a,b){g.reject("Problem authenticating")})["finally"](function(){setTimeout(function(){h.close()},10)})}}),h.addEventListener("exit",function(a){g.reject("The sign in flow was canceled")})}else g.reject("Could not find InAppBrowser plugin");else g.reject("Cannot authenticate via a web browser");return g.promise}return{signin:d}}angular.module("oauth.adfs",["oauth.utils"]).factory("$ngCordovaAdfs",a),a.$inject=["$q","$http","$cordovaOauthUtility"]}(),function(){"use strict";function a(a,b,c){function d(d,e,f){var g=a.defer();if(window.cordova)if(c.isInAppBrowserInstalled()){var h=window.cordova.InAppBrowser.open("https://login.microsoftonline.com/"+e+"/oauth2/authorize?response_type=code&client_id="+d+"&redirect_uri=http://localhost/callback","_blank","location=no,clearsessioncache=yes,clearcache=yes");h.addEventListener("loadstart",function(a){if(0===a.url.indexOf("http://localhost/callback")){var c=a.url.split("code=")[1];console.log(c),b({method:"post",headers:{"Content-Type":"application/x-www-form-urlencoded"},url:"https://login.microsoftonline.com/"+e+"/oauth2/token",data:"client_id="+d+"&code="+c+"&redirect_uri=http://localhost/callback&grant_type=authorization_code&resource="+f}).success(function(a){g.resolve(a)}).error(function(a,b){g.reject("Problem authenticating")})["finally"](function(){setTimeout(function(){h.close()},10)})}}),h.addEventListener("exit",function(a){g.reject("The sign in flow was canceled")})}else g.reject("Could not find InAppBrowser plugin");else g.reject("Cannot authenticate via a web browser");return g.promise}return{signin:d}}angular.module("oauth.azuread",["oauth.utils"]).factory("$ngCordovaAzureAD",a),a.$inject=["$q","$http","$cordovaOauthUtility"]}(),function(){"use strict";function a(a,b,c){function d(d,e,f,g){var h=a.defer();if(window.cordova)if(c.isInAppBrowserInstalled()){var i="http://localhost/callback";void 0!==g&&g.hasOwnProperty("redirect_uri")&&(i=g.redirect_uri);var j=window.cordova.InAppBrowser.open("https://app.box.com/api/oauth2/authorize/?client_id="+d+"&redirect_uri="+i+"&state="+f+"&response_type=code","_blank","location=no,clearsessioncache=yes,clearcache=yes");j.addEventListener("loadstart",function(a){if(0===a.url.indexOf(i)){var c=a.url.split("code=")[1];b({method:"post",headers:{"Content-Type":"application/x-www-form-urlencoded"},url:"https://app.box.com/api/oauth2/token",data:"client_id="+d+"&client_secret="+e+"&redirect_uri="+i+"&grant_type=authorization_code&code="+c}).success(function(a){h.resolve(a)}).error(function(a,b){h.reject("Problem authenticating")})["finally"](function(){setTimeout(function(){j.close()},10)})}}),j.addEventListener("exit",function(a){h.reject("The sign in flow was canceled")})}else h.reject("Could not find InAppBrowser plugin");else h.reject("Cannot authenticate via a web browser");return h.promise}return{signin:d}}angular.module("oauth.box",["oauth.utils"]).factory("$ngCordovaBox",a),a.$inject=["$q","$http","$cordovaOauthUtility"]}(),function(){"use strict";function a(a,b,c){function d(d,e,f){var g=a.defer();if(window.cordova)if(c.isInAppBrowserInstalled()){var h="http://localhost/callback";void 0!==f&&f.hasOwnProperty("redirect_uri")&&(h=f.redirect_uri);var i=window.cordova.InAppBrowser.open("https://cloud.digitalocean.com/v1/oauth/authorize?client_id="+d+"&redirect_uri="+h+"&response_type=code&scope=read%20write","_blank","location=no,clearsessioncache=yes,clearcache=yes");i.addEventListener("loadstart",function(a){if(0===a.url.indexOf(h)){var c=a.url.split("code=")[1];b({method:"post",headers:{"Content-Type":"application/x-www-form-urlencoded"},url:"https://cloud.digitalocean.com/v1/oauth/token",data:"client_id="+d+"&client_secret="+e+"&redirect_uri="+h+"&grant_type=authorization_code&code="+c}).success(function(a){g.resolve(a)}).error(function(a,b){g.reject("Problem authenticating")})["finally"](function(){setTimeout(function(){i.close()},10)})}}),i.addEventListener("exit",function(a){g.reject("The sign in flow was canceled")})}else g.reject("Could not find InAppBrowser plugin");else g.reject("Cannot authenticate via a web browser");return g.promise}return{signin:d}}angular.module("oauth.digitalOcean",["oauth.utils"]).factory("$ngCordovaDigitalOcean",a),a.$inject=["$q","$http","$cordovaOauthUtility"]}(),function(){"use strict";function a(a,b,c){function d(d,e,f,g,h){var i=a.defer();if(window.cordova)if(c.isInAppBrowserInstalled()){var j="http://localhost/callback",k="https://dribbble.com/oauth/authorize",l="https://dribbble.com/oauth/token";void 0!==g&&g.hasOwnProperty("redirect_uri")&&(j=g.redirect_uri),void 0===h&&(h=c.createNonce(5));var m=f.join(",").replace(/,/g,"+"),n=window.cordova.InAppBrowser.open(k+"?client_id="+d+"&redirect_uri="+j+"&scope="+m+"&state="+h,"_blank","location=no,clearsessioncache=yes,clearcache=yes");n.addEventListener("loadstart",function(a){if(0===a.url.indexOf(j)){var c=a.url.split("code=")[1],f=c.split("&")[0];b({method:"post",headers:{"Content-Type":"application/x-www-form-urlencoded"},url:l,data:"client_id="+d+"&redirect_uri="+j+"&client_secret="+e+"&code="+f}).success(function(a){i.resolve(a)}).error(function(a,b){i.reject("Problem authenticating ")})["finally"](function(){setTimeout(function(){n.close()},10)})}}),n.addEventListener("exit",function(a){i.reject("The sign in flow was canceled")})}else i.reject("Could not find InAppBrowser plugin");else i.reject("Cannot authenticate via a web browser");return i.promise}return{signin:d}}angular.module("oauth.dribble",["oauth.utils"]).factory("$ngCordovaDribble",a),a.$inject=["$q","$http","$cordovaOauthUtility"]}(),function(){"use strict";function a(a,b,c){function d(b,d){var e=a.defer();if(window.cordova)if(c.isInAppBrowserInstalled()){var f="http://localhost/callback";void 0!==d&&d.hasOwnProperty("redirect_uri")&&(f=d.redirect_uri);var g=window.cordova.InAppBrowser.open("https://www.dropbox.com/1/oauth2/authorize?client_id="+b+"&redirect_uri="+f+"&response_type=token","_blank","location=no,clearsessioncache=yes,clearcache=yes");g.addEventListener("loadstart",function(a){if(0===a.url.indexOf(f)){g.removeEventListener("exit",function(a){}),g.close();for(var b=a.url.split("#")[1],c=b.split("&"),d=[],h=0;h<c.length;h++)d[c[h].split("=")[0]]=c[h].split("=")[1];void 0!==d.access_token&&null!==d.access_token?e.resolve({access_token:d.access_token,token_type:d.token_type,uid:d.uid}):e.reject("Problem authenticating")}}),g.addEventListener("exit",function(a){e.reject("The sign in flow was canceled")})}else e.reject("Could not find InAppBrowser plugin");else e.reject("Cannot authenticate via a web browser");return e.promise}return{signin:d}}angular.module("oauth.dropbox",["oauth.utils"]).factory("$ngCordovaDropbox",a),a.$inject=["$q","$http","$cordovaOauthUtility"]}(),function(){"use strict";function a(a,b,c){function d(b,d){var e=a.defer();if(window.cordova)if(c.isInAppBrowserInstalled()){var f="http://localhost/callback";void 0!==d&&d.hasOwnProperty("redirect_uri")&&(f=d.redirect_uri);var g=window.cordova.InAppBrowser.open("https://api.envato.com/authorization?client_id="+b+"&redirect_uri="+f+"&response_type=token","_blank","location=no,clearsessioncache=yes,clearcache=yes");g.addEventListener("loadstart",function(a){if(0===a.url.indexOf(f)){g.removeEventListener("exit",function(a){}),g.close();for(var b=a.url.split("#")[1],c=b.split("&"),d=[],h=0;h<c.length;h++)d[c[h].split("=")[0]]=c[h].split("=")[1];void 0!==d.access_token&&null!==d.access_token?e.resolve({access_token:d.access_token,expires_in:d.expires_in}):e.reject("Problem authenticating")}}),g.addEventListener("exit",function(a){e.reject("The sign in flow was canceled")})}else e.reject("Could not find InAppBrowser plugin");else e.reject("Cannot authenticate via a web browser");return e.promise}return{signin:d}}angular.module("oauth.envato",["oauth.utils"]).factory("$ngCordovaEnvato",a),a.$inject=["$q","$http","$cordovaOauthUtility"]}(),function(){"use strict";function a(a,b,c){function d(b,d,e){var f=a.defer();if(window.cordova)if(c.isInAppBrowserInstalled()){var g="http://localhost/callback";void 0!==e&&e.hasOwnProperty("redirect_uri")&&(g=e.redirect_uri);var h="https://www.facebook.com/v2.6/dialog/oauth?client_id="+b+"&redirect_uri="+g+"&response_type=token&scope="+d.join(",");void 0!==e&&e.hasOwnProperty("auth_type")&&(h+="&auth_type="+e.auth_type);var i=window.cordova.InAppBrowser.open(h,"_blank","location=no,clearsessioncache=yes,clearcache=yes");i.addEventListener("loadstart",function(a){if(0===a.url.indexOf(g)){i.removeEventListener("exit",function(a){}),i.close();for(var b=a.url.split("#")[1],c=b.split("&"),d=[],e=0;e<c.length;e++)d[c[e].split("=")[0]]=c[e].split("=")[1];void 0!==d.access_token&&null!==d.access_token?f.resolve({access_token:d.access_token,expires_in:d.expires_in}):0!==a.url.indexOf("error_code=100")?f.reject("Facebook returned error_code=100: Invalid permissions"):f.reject("Problem authenticating")}}),i.addEventListener("exit",function(a){f.reject("The sign in flow was canceled")})}else f.reject("Could not find InAppBrowser plugin");else f.reject("Cannot authenticate via a web browser");return f.promise}return{signin:d}}angular.module("oauth.facebook",["oauth.utils"]).factory("$ngCordovaFacebook",a),a.$inject=["$q","$http","$cordovaOauthUtility"]}(),function(){"use strict";function a(a,b,c){function d(d,e,f){var g=a.defer();if(window.cordova)if(c.isInAppBrowserInstalled()){var h="http://localhost/callback";void 0!==f&&f.hasOwnProperty("redirect_uri")&&(h=f.redirect_uri);var i=window.cordova.InAppBrowser.open("https://ident.familysearch.org/cis-web/oauth2/v3/authorization?client_id="+d+"&redirect_uri="+h+"&response_type=code&state="+e,"_blank","location=no,clearsessioncache=yes,clearcache=yes");i.addEventListener("loadstart",function(a){if(0===a.url.indexOf(h)){var c=a.url.split("code=")[1];b({method:"post",headers:{"Content-Type":"application/x-www-form-urlencoded"},url:"https://ident.familysearch.org/cis-web/oauth2/v3/token",data:"client_id="+d+"&redirect_uri="+h+"&grant_type=authorization_code&code="+c}).success(function(a){g.resolve(a)}).error(function(a,b){g.reject("Problem authenticating")})["finally"](function(){setTimeout(function(){i.close()},10)})}}),i.addEventListener("exit",function(a){g.reject("The sign in flow was canceled")})}else g.reject("Could not find InAppBrowser plugin");else g.reject("Cannot authenticate via a web browser");return g.promise}return{signin:d}}angular.module("oauth.familySearch",["oauth.utils"]).factory("$ngCordovaFamilySearch",a),a.$inject=["$q","$http","$cordovaOauthUtility"]}(),function(){"use strict";function a(a,b,c){function d(b,d){var e=a.defer();if(window.cordova)if(c.isInAppBrowserInstalled()){var f="http://localhost/callback";void 0!==d&&d.hasOwnProperty("redirect_uri")&&(f=d.redirect_uri);var g=window.cordova.InAppBrowser.open("https://foursquare.com/oauth2/authenticate?client_id="+b+"&redirect_uri="+f+"&response_type=token","_blank","location=no,clearsessioncache=yes,clearcache=yes");g.addEventListener("loadstart",function(a){if(0===a.url.indexOf(f)){g.removeEventListener("exit",function(a){}),g.close();for(var b=a.url.split("#")[1],c=b.split("&"),d=[],h=0;h<c.length;h++)d[c[h].split("=")[0]]=c[h].split("=")[1];if(void 0!==d.access_token&&null!==d.access_token){var i={access_token:d.access_token,expires_in:d.expires_in};e.resolve(i)}else e.reject("Problem authenticating")}}),g.addEventListener("exit",function(a){e.reject("The sign in flow was canceled")})}else e.reject("Could not find InAppBrowser plugin");else e.reject("Cannot authenticate via a web browser");return e.promise}return{signin:d}}angular.module("oauth.foursquare",["oauth.utils"]).factory("$ngCordovaFoursquare",a),a.$inject=["$q","$http","$cordovaOauthUtility"]}(),function(){"use strict";function a(a,b,c){function d(d,e,f,g){var h=a.defer();if(window.cordova)if(c.isInAppBrowserInstalled()){var i="http://localhost/callback";void 0!==g&&g.hasOwnProperty("redirect_uri")&&(i=g.redirect_uri);var j=window.cordova.InAppBrowser.open("https://github.com/login/oauth/authorize?client_id="+d+"&redirect_uri="+i+"&scope="+f.join(","),"_blank","location=no,clearsessioncache=yes,clearcache=yes");j.addEventListener("loadstart",function(a){if(0===a.url.indexOf(i)){var c=a.url.split("code=")[1];b({method:"post",headers:{"Content-Type":"application/x-www-form-urlencoded",accept:"application/json"},url:"https://github.com/login/oauth/access_token",data:"client_id="+d+"&client_secret="+e+"&redirect_uri="+i+"&code="+c}).success(function(a){h.resolve(a)}).error(function(a,b){h.reject("Problem authenticating")})["finally"](function(){setTimeout(function(){j.close()},10)})}}),j.addEventListener("exit",function(a){h.reject("The sign in flow was canceled")})}else h.reject("Could not find InAppBrowser plugin");else h.reject("Cannot authenticate via a web browser");return h.promise}return{signin:d}}angular.module("oauth.github",["oauth.utils"]).factory("$ngCordovaGithub",a),a.$inject=["$q","$http","$cordovaOauthUtility"]}(),function(){"use strict";function a(a,b,c){function d(b,c,d){var e=a.defer();return e.reject("Google no longer supports authentication requests from the web view.  More information can be found at https://developers.googleblog.com/2016/08/modernizing-oauth-interactions-in-native-apps.html"),e.promise}return{signin:d}}angular.module("oauth.google",["oauth.utils"]).factory("$ngCordovaGoogle",a),a.$inject=["$q","$http","$cordovaOauthUtility"]}(),function(){"use strict";function a(a,b,c){function d(b,d){var e=a.defer();if(window.cordova)if(c.isInAppBrowserInstalled()){var f="http://localhost/callback";void 0!==d&&d.hasOwnProperty("redirect_uri")&&(f=d.redirect_uri);var g=window.cordova.InAppBrowser.open("https://api.imgur.com/oauth2/authorize?client_id="+b+"&response_type=token","_blank","location=no,clearsessioncache=yes,clearcache=yes");g.addEventListener("loadstart",function(a){if(0===a.url.indexOf(f)){g.removeEventListener("exit",function(a){}),g.close();for(var b=a.url.split("#")[1],c=b.split("&"),d=[],h=0;h<c.length;h++)d[c[h].split("=")[0]]=c[h].split("=")[1];void 0!==d.access_token&&null!==d.access_token?e.resolve({access_token:d.access_token,expires_in:d.expires_in,account_username:d.account_username}):e.reject("Problem authenticating")}}),g.addEventListener("exit",function(a){e.reject("The sign in flow was canceled")})}else e.reject("Could not find InAppBrowser plugin");else e.reject("Cannot authenticate via a web browser");return e.promise}return{signin:d}}angular.module("oauth.imgur",["oauth.utils"]).factory("$ngCordovaImgur",a),a.$inject=["$q","$http","$cordovaOauthUtility"]}(),function(){"use strict";function a(a,b,c){function d(b,d,e){var f=a.defer(),g={code:"?",token:"#"};if(window.cordova)if(c.isInAppBrowserInstalled()){var h="http://localhost/callback",i="token",j="https://www.instagram.com/";void 0!==e&&(e.hasOwnProperty("redirect_uri")&&(h=e.redirect_uri),e.hasOwnProperty("response_type")&&(i=e.response_type));var k="";d&&d.length>0&&(k="&scope="+d.join("+"));var l="https://api.instagram.com/oauth/authorize/?client_id="+b+k+"&response_type="+i+"&redirect_uri="+h,m=window.cordova.InAppBrowser.open(l,"_blank","location=no,clearsessioncache=yes,clearcache=yes");m.addEventListener("loadstart",function(a){if(0===a.url.indexOf(h)){m.removeEventListener("exit",function(a){}),m.close();var b=a.url.split(g[i])[1],d=c.parseResponseParameters(b);d.access_token?f.resolve({access_token:d.access_token}):void 0!==d.code&&null!==d.code?f.resolve({code:d.code}):f.reject("Problem authenticating")}else a.url===j&&m.executeScript({code:"window.location = '"+l+"';"})}),m.addEventListener("exit",function(a){f.reject("The sign in flow was canceled")})}else f.reject("Could not find InAppBrowser plugin");else f.reject("Cannot authenticate via a web browser");return f.promise}return{signin:d}}angular.module("oauth.instagram",["oauth.utils"]).factory("$ngCordovaInstagram",a),a.$inject=["$q","$http","$cordovaOauthUtility"]}(),function(){"use strict";function a(a,b,c){function d(d,e,f,g){var h=a.defer();if(window.cordova)if(c.isInAppBrowserInstalled()){var i="http://localhost/callback";void 0!==g&&g.hasOwnProperty("redirect_uri")&&(i=g.redirect_uri);var j=window.cordova.InAppBrowser.open("https://jawbone.com/auth/oauth2/auth?client_id="+d+"&redirect_uri="+i+"&response_type=code&scope="+f.join(" "),"_blank","location=no,clearsessioncache=yes,clearcache=yes");j.addEventListener("loadstart",function(a){if(0===a.url.indexOf(i)){var c=a.url.split("code=")[1];b({method:"post",headers:{"Content-Type":"application/x-www-form-urlencoded"},url:"https://jawbone.com/auth/oauth2/token",data:"client_id="+d+"&client_secret="+e+"&grant_type=authorization_code&code="+c}).success(function(a){h.resolve(a)}).error(function(a,b){h.reject("Problem authenticating")})["finally"](function(){setTimeout(function(){j.close()},10)})}}),j.addEventListener("exit",function(a){h.reject("The sign in flow was canceled")})}else h.reject("Could not find InAppBrowser plugin");else h.reject("Cannot authenticate via a web browser");return h.promise}return{signin:d}}angular.module("oauth.jawbone",["oauth.utils"]).factory("$ngCordovaJawbone",a),a.$inject=["$q","$http","$cordovaOauthUtility"]}(),function(){"use strict";function a(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R){return{azureAD:d.signin,adfs:e.signin,dropbox:f.signin,digitalOcean:g.signin,google:h.signin,github:i.signin,facebook:j.signin,linkedin:k.signin,instagram:l.signin,box:m.signin,reddit:n.signin,slack:o.signin,twitter:p.signin,meetup:q.signin,salesforce:r.signin,strava:s.signin,withings:t.signin,foursquare:u.signin,magento:v.signin,vkontakte:w.signin,odnoklassniki:x.signin,imgur:y.signin,spotify:z.signin,uber:A.signin,windowsLive:B.signin,yammer:C.signin,venmo:D.signin,stripe:E.signin,rally:F.signin,familySearch:G.signin,envato:H.signin,weibo:I.signin,jawbone:J.signin,untappd:K.signin,dribble:L.signin,pocket:M.signin,mercadolibre:N.signin,xing:O.signin,netatmo:P.signin,trakttv:Q.signin,yahoo:R.signin}}angular.module("oauth.providers",["oauth.utils","oauth.500px","oauth.azuread","oauth.adfs","oauth.dropbox","oauth.digitalOcean","oauth.google","oauth.github","oauth.facebook","oauth.linkedin","oauth.instagram","oauth.box","oauth.reddit","oauth.slack","oauth.twitter","oauth.meetup","oauth.salesforce","oauth.strava","oauth.withings","oauth.foursquare","oauth.magento","oauth.vkontakte","oauth.odnoklassniki","oauth.imgur","oauth.spotify","oauth.uber","oauth.windowslive","oauth.yammer","oauth.venmo","oauth.stripe","oauth.rally","oauth.familySearch","oauth.envato","oauth.weibo","oauth.jawbone","oauth.untappd","oauth.dribble","oauth.pocket","oauth.mercadolibre","oauth.xing","oauth.netatmo","oauth.trakttv","oauth.yahoo"]).factory("$cordovaOauth",a),a.$inject=["$q","$http","$cordovaOauthUtility","$ngCordovaAzureAD","$ngCordovaAdfs","$ngCordovaDropbox","$ngCordovaDigitalOcean","$ngCordovaGoogle","$ngCordovaGithub","$ngCordovaFacebook","$ngCordovaLinkedin","$ngCordovaInstagram","$ngCordovaBox","$ngCordovaReddit","$ngCordovaSlack","$ngCordovaTwitter","$ngCordovaMeetup","$ngCordovaSalesforce","$ngCordovaStrava","$ngCordovaWithings","$ngCordovaFoursquare","$ngCordovaMagento","$ngCordovaVkontakte","$ngCordovaOdnoklassniki","$ngCordovaImgur","$ngCordovaSpotify","$ngCordovaUber","$ngCordovaWindowslive","$ngCordovaYammer","$ngCordovaVenmo","$ngCordovaStripe","$ngCordovaRally","$ngCordovaFamilySearch","$ngCordovaEnvato","$ngCordovaWeibo","$ngCordovaJawbone","$ngCordovaUntappd","$ngCordovaDribble","$ngCordovaPocket","$ngCordovaMercadolibre","$ngCordovaXing","$ngCordovaNetatmo","$ngCordovaTraktTv","$ngCordovaYahoo"]}(),function(){"use strict";function a(a,b,c){function d(d,e,f,g,h){var i=a.defer();if(window.cordova)if(c.isInAppBrowserInstalled()){var j="http://localhost/callback";void 0!==h&&h.hasOwnProperty("redirect_uri")&&(j=h.redirect_uri);var k=window.cordova.InAppBrowser.open("https://www.linkedin.com/uas/oauth2/authorization?client_id="+d+"&redirect_uri="+j+"&scope="+f.join(" ")+"&response_type=code&state="+g,"_blank","location=no,clearsessioncache=yes,clearcache=yes");k.addEventListener("loadstart",function(a){if(0===a.url.indexOf(j))try{var c=a.url.split("code=")[1].split("&")[0];b({method:"post",headers:{"Content-Type":"application/x-www-form-urlencoded"},url:"https://www.linkedin.com/uas/oauth2/accessToken",data:"client_id="+d+"&client_secret="+e+"&redirect_uri="+j+"&grant_type=authorization_code&code="+c}).success(function(a){i.resolve(a)}).error(function(a,b){i.reject("Problem authenticating")})["finally"](function(){setTimeout(function(){k.close()},10)})}catch(f){setTimeout(function(){k.close()},10)}}),k.addEventListener("exit",function(a){i.reject("The sign in flow was canceled")})}else i.reject("Could not find InAppBrowser plugin");else i.reject("Cannot authenticate via a web browser");return i.promise}return{signin:d}}angular.module("oauth.linkedin",["oauth.utils"]).factory("$ngCordovaLinkedin",a),a.$inject=["$q","$http","$cordovaOauthUtility"]}(),function(){"use strict";function a(a,b,c){function d(d,e,f){var g=a.defer();if(window.cordova)if(c.isInAppBrowserInstalled())if("undefined"!=typeof jsSHA){var h={oauth_callback:"http://localhost/callback",oauth_consumer_key:e,oauth_nonce:c.createNonce(5),oauth_signature_method:"HMAC-SHA1",oauth_timestamp:Math.round((new Date).getTime()/1e3),oauth_version:"1.0"},i=c.createSignature("POST",d+"/oauth/initiate",h,{oauth_callback:"http://localhost/callback"},f);b.defaults.headers.post.Authorization=i.authorization_header,b.defaults.headers.post["Content-Type"]="application/x-www-form-urlencoded",b({method:"post",url:d+"/oauth/initiate",data:"oauth_callback=http://localhost/callback"}).success(function(a){for(var e=a.split("&"),i={},j=0;j<e.length;j++)i[e[j].split("=")[0]]=e[j].split("=")[1];i.hasOwnProperty("oauth_token")===!1&&g.reject("Oauth request token was not received");var k=i.oauth_token_secret,l=window.cordova.InAppBrowser.open(d+"/oauth/authorize?oauth_token="+i.oauth_token,"_blank","location=no,clearsessioncache=yes,clearcache=yes");l.addEventListener("loadstart",function(a){if(0===a.url.indexOf("http://localhost/callback")){for(var e=a.url.split("?")[1],i=e.split("&"),j={},m=0;m<i.length;m++)j[i[m].split("=")[0]]=i[m].split("=")[1];j.hasOwnProperty("oauth_verifier")===!1&&g.reject("Browser authentication failed to complete.  No oauth_verifier was returned"),delete h.oauth_signature,delete h.oauth_callback,h.oauth_token=j.oauth_token,h.oauth_nonce=c.createNonce(5),h.oauth_verifier=j.oauth_verifier;var n=c.createSignature("POST",d+"/oauth/token",h,{},f,k);b.defaults.headers.post.Authorization=n.authorization_header,b.defaults.headers.post["Content-Type"]="application/x-www-form-urlencoded",b({method:"post",url:d+"/oauth/token"}).success(function(a){for(var b=a.split("&"),c={},d=0;d<b.length;d++)c[b[d].split("=")[0]]=b[d].split("=")[1];c.hasOwnProperty("oauth_token_secret")===!1&&g.reject("Oauth access token was not received"),g.resolve(c)}).error(function(a){g.reject(a)})["finally"](function(){setTimeout(function(){l.close()},10)})}}),l.addEventListener("exit",function(a){g.reject("The sign in flow was canceled")})}).error(function(a){g.reject(a)})}else g.reject("Missing jsSHA JavaScript library");else g.reject("Could not find InAppBrowser plugin");else g.reject("Cannot authenticate via a web browser");return g.promise}return{signin:d}}angular.module("oauth.magento",["oauth.utils"]).factory("$ngCordovaMagento",a),a.$inject=["$q","$http","$cordovaOauthUtility"]}(),function(){"use strict";function a(a,b,c){function d(b,d){var e=a.defer();if(window.cordova)if(c.isInAppBrowserInstalled()){var f="http://localhost/callback";void 0!==d&&d.hasOwnProperty("redirect_uri")&&(f=d.redirect_uri);var g=window.cordova.InAppBrowser.open("https://secure.meetup.com/oauth2/authorize/?client_id="+b+"&redirect_uri="+f+"&response_type=token","_blank","location=no,clearsessioncache=yes,clearcache=yes");g.addEventListener("loadstart",function(a){if(0===a.url.indexOf(f)){g.removeEventListener("exit",function(a){}),g.close();for(var b=a.url.split("#")[1],c=b.split("&"),d={},h=0;h<c.length;h++)d[c[h].split("=")[0]]=c[h].split("=")[1];void 0!==d.access_token&&null!==d.access_token?e.resolve(d):e.reject("Problem authenticating")}}),g.addEventListener("exit",function(a){e.reject("The sign in flow was canceled")})}else e.reject("Could not find InAppBrowser plugin");else e.reject("Cannot authenticate via a web browser");return e.promise}return{signin:d}}angular.module("oauth.meetup",["oauth.utils"]).factory("$ngCordovaMeetup",a),a.$inject=["$q","$http","$cordovaOauthUtility"]}(),function(){"use strict";function a(a,b,c){function d(b,d){var e=a.defer();if(window.cordova)if(c.isInAppBrowserInstalled()){var f="http://localhost/callback";void 0!==d&&d.hasOwnProperty("redirect_uri")&&(f=d.redirect_uri);var g=window.cordova.InAppBrowser.open("http://auth.mercadolibre.com.ar/authorization?client_id="+b+"&redirect_uri="+f+"&response_type=token","_blank","location=no,clearsessioncache=yes,clearcache=yes");g.addEventListener("loadstart",function(a){if(0===a.url.indexOf(f)){g.removeEventListener("exit",function(a){}),g.close();for(var b=a.url.split("#")[1],c=b.split("&"),d=[],h=0;h<c.length;h++)d[c[h].split("=")[0]]=c[h].split("=")[1];void 0!==d.access_token&&null!==d.access_token?e.resolve({access_token:d.access_token,expires_in:d.expires_in,user_id:d.user_id,domains:d.domains}):e.reject("Problem authenticating")}}),g.addEventListener("exit",function(a){e.reject("The sign in flow was canceled")})}else e.reject("Could not find InAppBrowser plugin");else e.reject("Cannot authenticate via a web browser");return e.promise}return{signin:d}}angular.module("oauth.mercadolibre",["oauth.utils"]).factory("$ngCordovaMercadolibre",a),a.$inject=["$q","$http","$cordovaOauthUtility"]}(),function(){"use strict";function a(a,b,c){function d(d){function e(a){function c(a){g.resolve(a)}function d(a){g.reject(a)}function e(){}var f=0===a.url.indexOf(n),m=a.url.split("?")[0]===n;if(f&&m){h=!0,p.close();for(var o=a.url.split("?")[1],q=o.split("&"),r=[],s=0;s<q.length;s++)r[q[s].split("=")[0]]=q[s].split("=")[1];var t=r.code,u=r.state;if(l===u){var v={method:"post",url:"https://api.netatmo.com/oauth2/token",data:"grant_type=authorization_code&client_id="+i+"&client_secret="+j+"&code="+t+"&scope="+k+"&redirect_uri="+n,headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"}};b(v).success(c).error(d)["finally"](e)}else g.reject({error:"string_missmatch"})}}function f(a){if(!h){var b={error:"flow_canceled"};g.reject(b)}}var g=a.defer(),h=!1,i=d.clientId?d.clientId:null,j=d.clientSecret?d.clientSecret:null,k=d.appScope?d.appScope:null,l=d.state?d.state:Math.random().toString(36).substr(2,5),m=d.inappbrowserOptions?d.inappbrowserOptions:"location=no,clearsessioncache=yes,clearcache=yes";if(window.cordova)if(c.isInAppBrowserInstalled()){var n="http://localhost/callback",o="https://api.netatmo.com/oauth2/authorize?client_id="+i+"&redirect_uri="+n+"&scope="+k+"&state="+l,p=window.cordova.InAppBrowser.open(o,"_blank",m);p.addEventListener("loadstart",e),p.addEventListener("exit",f)}else g.reject({error:"no_inappbrowser_plugin"});else g.reject({error:"no_inappbrowser_plugin"});return g.promise}return{signin:d}}angular.module("oauth.netatmo",["oauth.utils"]).factory("$ngCordovaNetatmo",a),a.$inject=["$q","$http","$cordovaOauthUtility"]}(),function(){"use strict";function a(a,b,c){function d(b,d){var e=a.defer();if(window.cordova)if(c.isInAppBrowserInstalled()){var f=window.cordova.InAppBrowser.open("http://www.odnoklassniki.ru/oauth/authorize?client_id="+b+"&scope="+d.join(",")+"&response_type=token&redirect_uri=http://localhost/callback&layout=m","_blank","location=no,clearsessioncache=yes,clearcache=yes");f.addEventListener("loadstart",function(a){if(0===a.url.indexOf("http://localhost/callback")){for(var b=a.url.split("#")[1],c=b.split("&"),d=[],g=0;g<c.length;g++)d[c[g].split("=")[0]]=c[g].split("=")[1];void 0!==d.access_token&&null!==d.access_token?e.resolve({access_token:d.access_token,session_secret_key:d.session_secret_key}):e.reject("Problem authenticating"),setTimeout(function(){f.close()},10)}}),f.addEventListener("exit",function(a){e.reject("The sign in flow was canceled")})}else e.reject("Could not find InAppBrowser plugin");else e.reject("Cannot authenticate via a web browser");return e.promise}return{signin:d}}angular.module("oauth.odnoklassniki",["oauth.utils"]).factory("$ngCordovaOdnoklassniki",a),a.$inject=["$q","$http","$cordovaOauthUtility"]}(),function(){"use strict";function a(a,b,c){function d(d,e){var f=a.defer();if(window.cordova)if(c.isInAppBrowserInstalled()){var g="http://localhost/callback";void 0!==e&&e.hasOwnProperty("redirect_url")&&(g=e.redirect_url);var h="consumer_key="+d+"&redirect_uri="+encodeURIComponent(g);b({method:"post",url:"https://getpocket.com/v3/oauth/request",headers:{"X-Accept":"application/x-www-form-urlencoded","Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:h}).success(function(a){var c=a.split("code=")[1],e=window.cordova.InAppBrowser.open("https://getpocket.com/auth/authorize?request_token="+c+"&redirect_uri="+g,"_blank","location=no,clearsessioncache=yes,clearcache=yes");e.addEventListener("loadstart",function(h){0===h.url.indexOf(g)&&(e.removeEventListener("exit",function(a){}),a="consumer_key="+d+"&code="+c,b({method:"post",url:"https://getpocket.com/v3/oauth/authorize",headers:{"X-Accept":"application/x-www-form-urlencoded","Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:a}).success(function(a){f.resolve(a)}).error(function(a){f.reject(a)})["finally"](function(){setTimeout(function(){e.close()},10)}))}),e.addEventListener("exit",function(a){f.reject("The sign in flow was canceled")})}).error(function(a){f.reject(a)})}else f.reject("Could not find InAppBrowser plugin");else f.reject("Cannot authenticate via a web browser");return f.promise}return{signin:d}}angular.module("oauth.pocket",["oauth.utils"]).factory("$ngCordovaPocket",a),a.$inject=["$q","$http","$cordovaOauthUtility"]}(),function(){"use strict";function a(a,b,c){function d(d,e,f,g){var h=a.defer();if(window.cordova)if(c.isInAppBrowserInstalled()){var i="http://localhost/callback";
void 0!==g&&g.hasOwnProperty("redirect_uri")&&(i=g.redirect_uri);var j=window.cordova.InAppBrowser.open("https://rally1.rallydev.com/login/oauth2/auth?client_id="+d+"&redirect_uri="+i+"&scope="+f+"&response_type=code","_blank","location=no,clearsessioncache=yes,clearcache=yes");j.addEventListener("loadstart",function(a){if(0===a.url.indexOf("http://localhost/callback")){var c=a.url.split("code=")[1];b.defaults.headers.post["Content-Type"]="application/x-www-form-urlencoded",b({method:"post",url:"https://rally1.rallydev.com/login/oauth2/auth",data:"client_id="+d+"&client_secret="+e+"&redirect_uri="+i+"&grant_type=authorization_code&code="+c}).success(function(a){h.resolve(a)}).error(function(a,b){h.reject("Problem authenticating")})["finally"](function(){setTimeout(function(){j.close()},10)})}}),j.addEventListener("exit",function(a){h.reject("The sign in flow was canceled")})}else h.reject("Could not find InAppBrowser plugin");else h.reject("Cannot authenticate via a web browser");return h.promise}return{signin:d}}angular.module("oauth.rally",["oauth.utils"]).factory("$ngCordovaRally",a),a.$inject=["$q","$http","$cordovaOauthUtility"]}(),function(){"use strict";function a(a,b,c){function d(d,e,f,g,h){var i=a.defer();if(window.cordova)if(c.isInAppBrowserInstalled()){var j="http://localhost/callback";void 0!==h&&h.hasOwnProperty("redirect_uri")&&(j=h.redirect_uri);var k=window.cordova.InAppBrowser.open("https://ssl.reddit.com/api/v1/authorize"+(g?".compact":"")+"?client_id="+d+"&redirect_uri="+j+"&duration=permanent&state=ngcordovaoauth&scope="+f.join(",")+"&response_type=code","_blank","location=no,clearsessioncache=yes,clearcache=yes");k.addEventListener("loadstart",function(a){if(0===a.url.indexOf(j)){var c=a.url.split("code=")[1];b.defaults.headers.post["Content-Type"]="application/x-www-form-urlencoded",b.defaults.headers.post.Authorization="Basic "+btoa(d+":"+e),b({method:"post",url:"https://ssl.reddit.com/api/v1/access_token",data:"redirect_uri="+j+"&grant_type=authorization_code&code="+c}).success(function(a){i.resolve(a)}).error(function(a,b){i.reject("Problem authenticating")})["finally"](function(){setTimeout(function(){k.close()},10)})}}),k.addEventListener("exit",function(a){i.reject("The sign in flow was canceled")})}else i.reject("Could not find InAppBrowser plugin");else i.reject("Cannot authenticate via a web browser");return i.promise}return{signin:d}}angular.module("oauth.reddit",["oauth.utils"]).factory("$ngCordovaReddit",a),a.$inject=["$q","$http","$cordovaOauthUtility"]}(),function(){"use strict";function a(a,b,c){function d(b,d){var e="http://localhost/callback",f=function(a,b,c){return a+"services/oauth2/authorize?display=touch&response_type=token&client_id="+escape(b)+"&redirect_uri="+escape(c)},g=function(a,b){return a.substr(0,b.length)===b},h=a.defer();if(window.cordova)if(c.isInAppBrowserInstalled()){var i=window.cordova.InAppBrowser.open(f(b,d,e),"_blank","location=no,clearsessioncache=yes,clearcache=yes");i.addEventListener("loadstart",function(a){if(g(a.url,e)){var b={},c=a.url.split("#")[1];if(c){var d=c.split("&");for(var f in d){var j=d[f].split("=");b[j[0]]=unescape(j[1])}}"undefined"==typeof b||"undefined"==typeof b.access_token?h.reject("Problem authenticating"):h.resolve(b),setTimeout(function(){i.close()},10)}}),i.addEventListener("exit",function(a){h.reject("The sign in flow was canceled")})}else h.reject("Could not find InAppBrowser plugin");else h.reject("Cannot authenticate via a web browser");return h.promise}return{signin:d}}angular.module("oauth.salesforce",["oauth.utils"]).factory("$ngCordovaSalesforce",a),a.$inject=["$q","$http","$cordovaOauthUtility"]}(),function(){"use strict";function a(a,b,c){function d(d,e,f,g){var h=a.defer();if(window.cordova)if(c.isInAppBrowserInstalled()){var i="http://localhost/callback";void 0!==g&&g.hasOwnProperty("redirect_uri")&&(i=g.redirect_uri);var j=window.cordova.InAppBrowser.open("https://slack.com/oauth/authorize?client_id="+d+"&redirect_uri="+i+"&state=ngcordovaoauth&scope="+f.join(","),"_blank","location=no,clearsessioncache=yes,clearcache=yes");j.addEventListener("loadstart",function(a){if(0===a.url.indexOf(i)){var c=a.url.split("code=")[1];b.defaults.headers.post["Content-Type"]="application/x-www-form-urlencoded",b({method:"post",url:"https://slack.com/api/oauth.access",data:"client_id="+d+"&client_secret="+e+"&redirect_uri="+i+"&grant_type=authorization_code&code="+c}).success(function(a){h.resolve(a)}).error(function(a,b){h.reject("Problem authenticating")})["finally"](function(){setTimeout(function(){j.close()},10)})}}),j.addEventListener("exit",function(a){h.reject("The sign in flow was canceled")})}else h.reject("Could not find InAppBrowser plugin");else h.reject("Cannot authenticate via a web browser");return h.promise}return{signin:d}}angular.module("oauth.slack",["oauth.utils"]).factory("$ngCordovaSlack",a),a.$inject=["$q","$http","$cordovaOauthUtility"]}(),function(){"use strict";function a(a,b,c){function d(b,d,e){var f=a.defer();if(window.cordova)if(c.isInAppBrowserInstalled()){var g="http://localhost/callback",h="token",i="",j="";void 0!==e&&(e.hasOwnProperty("redirect_uri")&&(g=e.redirect_uri),e.hasOwnProperty("response_type")&&(h=e.response_type),e.hasOwnProperty("state")&&(i="&state="+e.state),e.hasOwnProperty("show_dialog")&&(j="&show_dialog="+e.show_dialog));var k=window.cordova.InAppBrowser.open("https://accounts.spotify.com/authorize?client_id="+b+"&redirect_uri="+g+"&response_type="+h+i+"&scope="+d.join(" ")+j,"_blank","location=no,clearsessioncache=yes,clearcache=yes");k.addEventListener("loadstart",function(a){if(0===a.url.indexOf(g)){k.removeEventListener("exit",function(a){}),k.close();for(var b="code"===h?"?":"#",c=a.url.split(b)[1],d=c.split("&"),e=[],i=0;i<d.length;i++)e[d[i].split("=")[0]]=d[i].split("=")[1];"token"===h&&void 0!==e.access_token&&null!==e.access_token?f.resolve({access_token:e.access_token,expires_in:e.expires_in,account_username:e.account_username}):"code"===h&&void 0!==e.code&&null!==e.code?f.resolve({code:e.code,state:e.state}):f.reject("Problem authenticating")}}),k.addEventListener("exit",function(a){f.reject("The sign in flow was canceled")})}else f.reject("Could not find InAppBrowser plugin");else f.reject("Cannot authenticate via a web browser");return f.promise}return{signin:d}}angular.module("oauth.spotify",["oauth.utils"]).factory("$ngCordovaSpotify",a),a.$inject=["$q","$http","$cordovaOauthUtility"]}(),function(){"use strict";function a(a,b,c){function d(d,e,f,g){var h=a.defer();if(window.cordova)if(c.isInAppBrowserInstalled()){var i="http://localhost/callback";void 0!==g&&g.hasOwnProperty("redirect_uri")&&(i=g.redirect_uri);var j=window.cordova.InAppBrowser.open("https://www.strava.com/oauth/authorize?client_id="+d+"&redirect_uri="+i+"&scope="+f.join(",")+"&response_type=code&approval_prompt=force","_blank","location=no,clearsessioncache=yes,clearcache=yes");j.addEventListener("loadstart",function(a){if(0===a.url.indexOf(i)){var c=a.url.split("code=")[1];b.defaults.headers.post["Content-Type"]="application/x-www-form-urlencoded",b({method:"post",url:"https://www.strava.com/oauth/token",data:"client_id="+d+"&client_secret="+e+"&code="+c}).success(function(a){h.resolve(a)}).error(function(a,b){h.reject("Problem authenticating")})["finally"](function(){setTimeout(function(){j.close()},10)})}}),j.addEventListener("exit",function(a){h.reject("The sign in flow was canceled")})}else h.reject("Could not find InAppBrowser plugin");else h.reject("Cannot authenticate via a web browser");return h.promise}return{signin:d}}angular.module("oauth.strava",["oauth.utils"]).factory("$ngCordovaStrava",a),a.$inject=["$q","$http","$cordovaOauthUtility"]}(),function(){"use strict";function a(a,b,c){function d(d,e,f,g){var h=a.defer();if(window.cordova)if(c.isInAppBrowserInstalled()){var i="http://localhost/callback";void 0!==g&&g.hasOwnProperty("redirect_uri")&&(i=g.redirect_uri);var j=window.cordova.InAppBrowser.open("https://connect.stripe.com/oauth/authorize?client_id="+d+"&redirect_uri="+i+"&scope="+f+"&response_type=code","_blank","location=no,clearsessioncache=yes,clearcache=yes");j.addEventListener("loadstart",function(a){if(0===a.url.indexOf("http://localhost/callback")){var c=a.url.split("code=")[1];b.defaults.headers.post["Content-Type"]="application/x-www-form-urlencoded",b({method:"post",url:"https://connect.stripe.com/oauth/token",data:"client_id="+d+"&client_secret="+e+"&redirect_uri="+i+"&grant_type=authorization_code&code="+c}).success(function(a){h.resolve(a)}).error(function(a,b){h.reject("Problem authenticating")})["finally"](function(){setTimeout(function(){j.close()},10)})}}),j.addEventListener("exit",function(a){h.reject("The sign in flow was canceled")})}else h.reject("Could not find InAppBrowser plugin");else h.reject("Cannot authenticate via a web browser");return h.promise}return{signin:d}}angular.module("oauth.stripe",["oauth.utils"]).factory("$ngCordovaStripe",a),a.$inject=["$q","$http","$cordovaOauthUtility"]}(),function(){"use strict";function a(a,b,c){function d(d,e,f,g,h){var i=a.defer();if(window.cordova)if(c.isInAppBrowserInstalled()){var j="http://localhost/callback";void 0!==h&&h.hasOwnProperty("redirect_uri")&&(j=h.redirect_uri);var k=window.cordova.InAppBrowser.open("https://trakt.tv/oauth/authorize?client_id="+d+"&redirect_uri="+j+"&response_type=code&state="+g,"_blank","location=no,clearsessioncache=yes,clearcache=yes");k.addEventListener("loadstart",function(a){if(0===a.url.indexOf(j))try{var c=a.url.split("code=")[1].split("&")[0];b({method:"post",headers:{"Content-Type":"application/json"},url:"https://trakt.tv/oauth/token",data:{code:c,client_id:d,client_secret:e,redirect_uri:j,grant_type:"authorization_code"}}).success(function(a){i.resolve(a)}).error(function(a,b){i.reject("Problem authenticating")})["finally"](function(){setTimeout(function(){k.close()},10)})}catch(f){setTimeout(function(){k.close()},10)}}),k.addEventListener("exit",function(a){i.reject("The sign in flow was canceled")})}else i.reject("Could not find InAppBrowser plugin");else i.reject("Cannot authenticate via a web browser");return i.promise}return{signin:d}}angular.module("oauth.trakttv",["oauth.utils"]).factory("$ngCordovaTraktTv",a),a.$inject=["$q","$http","$cordovaOauthUtility"]}(),function(){"use strict";function a(a,b,c){function d(d,e,f){var g=a.defer();if(window.cordova)if(c.isInAppBrowserInstalled()){var h="http://localhost/callback";if(void 0!==f&&f.hasOwnProperty("redirect_uri")&&(h=f.redirect_uri),"undefined"!=typeof jsSHA){var i={oauth_consumer_key:d,oauth_nonce:c.createNonce(10),oauth_signature_method:"HMAC-SHA1",oauth_timestamp:Math.round((new Date).getTime()/1e3),oauth_version:"1.0"},j=c.createSignature("POST","https://api.twitter.com/oauth/request_token",i,{oauth_callback:h},e);b({method:"post",url:"https://api.twitter.com/oauth/request_token",headers:{Authorization:j.authorization_header,"Content-Type":"application/x-www-form-urlencoded"},data:"oauth_callback="+encodeURIComponent(h)}).success(function(a){for(var d=a.split("&"),f={},j=0;j<d.length;j++)f[d[j].split("=")[0]]=d[j].split("=")[1];f.hasOwnProperty("oauth_token")===!1&&g.reject("Oauth request token was not received");var k=window.cordova.InAppBrowser.open("https://api.twitter.com/oauth/authenticate?oauth_token="+f.oauth_token,"_blank","location=no,clearsessioncache=yes,clearcache=yes");k.addEventListener("loadstart",function(a){if(0===a.url.indexOf(h)){for(var d=a.url.split("?")[1],f=d.split("&"),j={},l=0;l<f.length;l++)j[f[l].split("=")[0]]=f[l].split("=")[1];j.hasOwnProperty("oauth_verifier")===!1&&g.reject("Browser authentication failed to complete.  No oauth_verifier was returned"),delete i.oauth_signature,i.oauth_token=j.oauth_token;var m=c.createSignature("POST","https://api.twitter.com/oauth/access_token",i,{oauth_verifier:j.oauth_verifier},e);b({method:"post",url:"https://api.twitter.com/oauth/access_token",headers:{Authorization:m.authorization_header},params:{oauth_verifier:j.oauth_verifier}}).success(function(a){for(var b=a.split("&"),c={},d=0;d<b.length;d++)c[b[d].split("=")[0]]=b[d].split("=")[1];c.hasOwnProperty("oauth_token_secret")===!1&&g.reject("Oauth access token was not received"),g.resolve(c)}).error(function(a){g.reject(a)})["finally"](function(){setTimeout(function(){k.close()},10)})}}),k.addEventListener("exit",function(a){g.reject("The sign in flow was canceled")})}).error(function(a){g.reject(a)})}else g.reject("Missing jsSHA JavaScript library")}else g.reject("Could not find InAppBrowser plugin");else g.reject("Cannot authenticate via a web browser");return g.promise}return{signin:d}}angular.module("oauth.twitter",["oauth.utils"]).factory("$ngCordovaTwitter",a),a.$inject=["$q","$http","$cordovaOauthUtility"]}(),function(){"use strict";function a(a,b,c){function d(b,d,e){var f=a.defer();if(window.cordova)if(c.isInAppBrowserInstalled()){var g="http://localhost/callback";void 0!==e&&e.hasOwnProperty("redirect_uri")&&(g=e.redirect_uri);var h=window.cordova.InAppBrowser.open("https://login.uber.com/oauth/authorize?client_id="+b+"&redirect_uri="+g+"&response_type=token&scope="+d.join(" "),"_blank","location=no,clearsessioncache=yes,clearcache=yes");h.addEventListener("loadstart",function(a){if(0===a.url.indexOf(g)){h.removeEventListener("exit",function(a){}),h.close();for(var b=a.url.split("#")[1],c=b.split("&"),d=[],e=0;e<c.length;e++)d[c[e].split("=")[0]]=c[e].split("=")[1];void 0!==d.access_token&&null!==d.access_token?f.resolve({access_token:d.access_token,token_type:d.token_type,expires_in:d.expires_in,scope:d.scope}):f.reject("Problem authenticating")}}),h.addEventListener("exit",function(a){f.reject("The sign in flow was canceled")})}else f.reject("Could not find InAppBrowser plugin");else f.reject("Cannot authenticate via a web browser");return f.promise}return{signin:d}}angular.module("oauth.uber",["oauth.utils"]).factory("$ngCordovaUber",a),a.$inject=["$q","$http","$cordovaOauthUtility"]}(),function(){"use strict";function a(a,b,c){function d(b,d){var e=a.defer();if(window.cordova)if(c.isInAppBrowserInstalled()){var f="http://localhost/callback";void 0!==d&&d.hasOwnProperty("redirect_url")&&(f=d.redirect_url);var g=window.cordova.InAppBrowser.open("https://untappd.com/oauth/authenticate/?client_id="+b+"&redirect_url="+f+"&response_type=token","_blank","location=no,clearsessioncache=yes,clearcache=yes");g.addEventListener("loadstart",function(a){if(0===a.url.indexOf(f)){g.removeEventListener("exit",function(a){}),g.close();for(var b=a.url.split("#")[1],c=b.split("&"),d=[],h=0;h<c.length;h++)d[c[h].split("=")[0]]=c[h].split("=")[1];if(void 0!==d.access_token&&null!==d.access_token){var i={access_token:d.access_token};e.resolve(i)}else e.reject("Problem authenticating")}}),g.addEventListener("exit",function(a){e.reject("The sign in flow was canceled")})}else e.reject("Could not find InAppBrowser plugin");else e.reject("Cannot authenticate via a web browser");return e.promise}return{signin:d}}angular.module("oauth.untappd",["oauth.utils"]).factory("$ngCordovaUntappd",a),a.$inject=["$q","$http","$cordovaOauthUtility"]}(),function(){"use strict";function a(a,b,c){function d(b,d,e){var f=a.defer();if(window.cordova)if(c.isInAppBrowserInstalled()){var g="http://localhost/callback";void 0!==e&&e.hasOwnProperty("redirect_uri")&&(g=e.redirect_uri);var h=window.cordova.InAppBrowser.open("https://api.venmo.com/v1/oauth/authorize?client_id="+b+"&redirect_uri="+g+"&response_type=token&scope="+d.join(" "),"_blank","location=no,clearsessioncache=yes,clearcache=yes");h.addEventListener("loadstart",function(a){if(0===a.url.indexOf(g)){h.removeEventListener("exit",function(a){}),h.close();for(var b=a.url.split("?")[1],c=b.split("&"),d=[],e=0;e<c.length;e++)d[c[e].split("=")[0]]=c[e].split("=")[1];void 0!==d.access_token&&null!==d.access_token?f.resolve({access_token:d.access_token}):void 0!==d.error&&null!==d.error?f.reject(d.error.replace("+"," ")):f.reject("Problem authenticating")}}),h.addEventListener("exit",function(a){f.reject("The sign in flow was canceled")})}else f.reject("Could not find InAppBrowser plugin");else f.reject("Cannot authenticate via a web browser");return f.promise}return{signin:d}}angular.module("oauth.venmo",["oauth.utils"]).factory("$ngCordovaVenmo",a),a.$inject=["$q","$http","$cordovaOauthUtility"]}(),function(){"use strict";function a(a,b,c){function d(b,d){var e=a.defer();if(window.cordova)if(c.isInAppBrowserInstalled()){var f=window.cordova.InAppBrowser.open("https://oauth.vk.com/authorize?client_id="+b+"&redirect_uri=http://oauth.vk.com/blank.html&response_type=token&scope="+d.join(",")+"&display=touch&response_type=token","_blank","location=no,clearsessioncache=yes,clearcache=yes");f.addEventListener("loadstart",function(a){var b=a.url.split("#");if("https://oauth.vk.com/blank.html"==b[0]||"http://oauth.vk.com/blank.html"==b[0]){f.removeEventListener("exit",function(a){}),f.close();for(var c=a.url.split("#")[1],d=c.split("&"),g=[],h=0;h<d.length;h++)g[d[h].split("=")[0]]=d[h].split("=")[1];if(void 0!==g.access_token&&null!==g.access_token){var i={access_token:g.access_token,expires_in:g.expires_in};void 0!==g.email&&null!==g.email&&(i.email=g.email),e.resolve(i)}else e.reject("Problem authenticating")}}),f.addEventListener("exit",function(a){e.reject("The sign in flow was canceled")})}else e.reject("Could not find InAppBrowser plugin");else e.reject("Cannot authenticate via a web browser");return e.promise}return{signin:d}}angular.module("oauth.vkontakte",["oauth.utils"]).factory("$ngCordovaVkontakte",a),a.$inject=["$q","$http","$cordovaOauthUtility"]}(),function(){"use strict";function a(a,b,c){function d(d,e,f,g){var h=a.defer();if(window.cordova)if(c.isInAppBrowserInstalled()){var i="http://localhost/callback";void 0!==g&&g.hasOwnProperty("redirect_uri")&&(i=g.redirect_uri);var j="https://open.weibo.cn/oauth2/authorize?display=mobile&client_id="+d+"&redirect_uri="+i+"&scope="+f.join(",");void 0!==g&&(g.hasOwnProperty("language")&&(j+="&language="+g.language),g.hasOwnProperty("forcelogin")&&(j+="&forcelogin="+g.forcelogin));var k=window.cordova.InAppBrowser.open(j,"_blank","location=no,clearsessioncache=yes,clearcache=yes");k.addEventListener("loadstart",function(a){if(0===a.url.indexOf(i)){var c=a.url.split("code=")[1];b.defaults.headers.post["Content-Type"]="application/x-www-form-urlencoded",b({method:"post",url:"https://api.weibo.com/oauth2/access_token",data:"client_id="+d+"&client_secret="+e+"&grant_type=authorization_code&code="+c+"&redirect_uri="+i}).success(function(a){h.resolve(a)}).error(function(a,b){h.reject("Problem authenticating")})["finally"](function(){setTimeout(function(){k.close()},10)})}}),k.addEventListener("exit",function(a){h.reject("The sign in flow was canceled")})}else h.reject("Could not find InAppBrowser plugin");else h.reject("Cannot authenticate via a web browser");return h.promise}return{signin:d}}angular.module("oauth.weibo",["oauth.utils"]).factory("$ngCordovaWeibo",a),a.$inject=["$q","$http","$cordovaOauthUtility"]}(),function(){"use strict";function a(a,b,c){function d(b,d,e){var f=a.defer();if(window.cordova)if(c.isInAppBrowserInstalled()){var g="https://login.live.com/oauth20_desktop.srf";void 0!==e&&e.hasOwnProperty("redirect_uri")&&(g=e.redirect_uri);var h=window.cordova.InAppBrowser.open("https://login.live.com/oauth20_authorize.srf?client_id="+b+"&scope="+d.join(",")+"&response_type=token&display=touch&redirect_uri="+g,"_blank","location=no,clearsessioncache=yes,clearcache=yes");h.addEventListener("loadstart",function(a){if(0===a.url.indexOf(g)){h.removeEventListener("exit",function(a){}),h.close();for(var b=a.url.split("#")[1],c=b.split("&"),d=[],e=0;e<c.length;e++)d[c[e].split("=")[0]]=c[e].split("=")[1];void 0!==d.access_token&&null!==d.access_token?f.resolve({access_token:d.access_token,expires_in:d.expires_in}):f.reject("Problem authenticating")}}),h.addEventListener("exit",function(a){f.reject("The sign in flow was canceled")})}else f.reject("Could not find InAppBrowser plugin");else f.reject("Cannot authenticate via a web browser");return f.promise}return{signin:d}}angular.module("oauth.windowslive",["oauth.utils"]).factory("$ngCordovaWindowslive",a),a.$inject=["$q","$http","$cordovaOauthUtility"]}(),function(){"use strict";function a(a,b,c){function d(d,e){var f=a.defer();if(window.cordova)if(c.isInAppBrowserInstalled())if("undefined"!=typeof jsSHA){var g=c.generateOauthParametersInstance(d);g.oauth_callback="http://localhost/callback";var h="https://oauth.withings.com/account/request_token",i=c.createSignature("GET",h,{},g,e);g.oauth_signature=i.signature;var j=c.generateUrlParameters(g);b({method:"get",url:h+"?"+j}).success(function(a){var g=c.parseResponseParameters(a);g.oauth_token||f.reject("Oauth request token was not received");var h=c.generateOauthParametersInstance(d);h.oauth_token=g.oauth_token;var i=g.oauth_token_secret,j="https://oauth.withings.com/account/authorize",k=c.createSignature("GET",j,{},h,e);h.oauth_signature=k.signature;var l=c.generateUrlParameters(h),m=window.cordova.InAppBrowser.open(j+"?"+l,"_blank","location=no,clearsessioncache=yes,clearcache=yes");m.addEventListener("loadstart",function(a){if(0===a.url.indexOf("http://localhost/callback")){var h=a.url.split("?")[1];g=c.parseResponseParameters(h),g.oauth_verifier||f.reject("Browser authentication failed to complete.  No oauth_verifier was returned");var j=c.generateOauthParametersInstance(d);j.oauth_token=g.oauth_token;var k="https://oauth.withings.com/account/access_token",l=c.createSignature("GET",k,{},j,e,i);j.oauth_signature=l.signature;var n=c.generateUrlParameters(j);b({method:"get",url:k+"?"+n}).success(function(a){var b=c.parseResponseParameters(a);b.oauth_token_secret||f.reject("Oauth access token was not received"),f.resolve(b)}).error(function(a){f.reject(a)})["finally"](function(){setTimeout(function(){m.close()},10)})}}),m.addEventListener("exit",function(a){f.reject("The sign in flow was canceled")})}).error(function(a){f.reject(a)})}else f.reject("Missing jsSHA JavaScript library");else f.reject("Could not find InAppBrowser plugin");else f.reject("Cannot authenticate via a web browser");return f.promise}return{signin:d}}angular.module("oauth.withings",["oauth.utils"]).factory("$ngCordovaWithings",a),a.$inject=["$q","$http","$cordovaOauthUtility"]}(),function(){"use strict";function a(a,b,c){function d(d,e,f){var g=a.defer();if(window.cordova)if(c.isInAppBrowserInstalled()){var h="http://localhost/callback";if(void 0!==f&&f.hasOwnProperty("redirect_uri")&&(h=f.redirect_uri),"undefined"!=typeof jsSHA){var i={oauth_consumer_key:d,oauth_nonce:c.createNonce(10),oauth_signature_method:"HMAC-SHA1",oauth_timestamp:Math.round((new Date).getTime()/1e3),oauth_version:"1.0"},j=c.createSignature("POST","https://api.xing.com/v1/request_token",i,{oauth_callback:h},e);b({method:"post",url:"https://api.xing.com/v1/request_token",headers:{Authorization:j.authorization_header,"Content-Type":"application/x-www-form-urlencoded"},data:"oauth_callback="+encodeURIComponent(h)}).success(function(a){for(var d=a.split("&"),f={},j=0;j<d.length;j++)f[d[j].split("=")[0]]=d[j].split("=")[1];f.hasOwnProperty("oauth_token")===!1&&g.reject("Oauth request token was not received");var k=f.oauth_token_secret,l=window.cordova.InAppBrowser.open("https://api.xing.com/v1/authorize?oauth_token="+f.oauth_token,"_blank","location=no,clearsessioncache=yes,clearcache=yes");l.addEventListener("loadstart",function(a){if(0===a.url.indexOf(h)){for(var d=a.url.split("?")[1],f=d.split("&"),j={},m=0;m<f.length;m++)j[f[m].split("=")[0]]=f[m].split("=")[1];j.hasOwnProperty("oauth_verifier")===!1&&g.reject("Browser authentication failed to complete.  No oauth_verifier was returned"),delete i.oauth_signature,i.oauth_token=j.oauth_token;var n=c.createSignature("POST","https://api.xing.com/v1/access_token",i,{oauth_verifier:j.oauth_verifier},e,k);b({method:"post",url:"https://api.xing.com/v1/access_token",headers:{Authorization:n.authorization_header},params:{oauth_verifier:j.oauth_verifier}}).success(function(a){for(var b=a.split("&"),c={},d=0;d<b.length;d++)c[b[d].split("=")[0]]=b[d].split("=")[1];c.hasOwnProperty("oauth_token_secret")===!1&&g.reject("Oauth access token was not received"),g.resolve(c)}).error(function(a){g.reject(a)})["finally"](function(){setTimeout(function(){l.close()},10)})}}),l.addEventListener("exit",function(a){g.reject("The sign in flow was canceled")})}).error(function(a){g.reject(a)})}else g.reject("Missing jsSHA JavaScript library")}else g.reject("Could not find InAppBrowser plugin");else g.reject("Cannot authenticate via a web browser");return g.promise}return{signin:d}}angular.module("oauth.xing",["oauth.utils"]).factory("$ngCordovaXing",a),a.$inject=["$q","$http","$cordovaOauthUtility"]}(),function(){"use strict";function a(a,b){function c(c,d,e){var f=a.defer();if(window.cordova)if(b.isInAppBrowserInstalled()){var g="http://localhost/callback";void 0!==e&&e.hasOwnProperty("redirect_uri")&&(g=e.redirect_uri);var h="https://api.login.yahoo.com/oauth2/request_auth?client_id="+c;h+="&redirect_uri="+g,h+="&response_type=token",h+="&scope="+d.join(" ");var i=window.cordova.InAppBrowser.open(h,"_blank","location=no,clearsessioncache=yes,clearcache=yes");i.addEventListener("loadstart",function(a){if(0===a.url.indexOf(g)){i.removeEventListener("exit",function(a){}),i.close();for(var b=a.url.split("#")[1],c=b.split("&"),d={},e=0;e<c.length;e++)d[c[e].split("=")[0]]=c[e].split("=")[1];void 0!==d.access_token&&null!==d.access_token?f.resolve({access_token:d.access_token,token_type:d.token_type,expires_in:d.expires_in,id_token:d.id_token}):f.reject("Problem authenticating")}}),i.addEventListener("exit",function(a){f.reject("The sign in flow was canceled")})}else f.reject("Could not find InAppBrowser plugin");else f.reject("Cannot authenticate via a web browser");return f.promise}return{signin:c}}angular.module("oauth.yahoo",["oauth.utils"]).factory("$ngCordovaYahoo",a),a.$inject=["$q","$cordovaOauthUtility"]}(),function(){"use strict";function a(a,b,c){function d(b,d){var e=a.defer();if(window.cordova)if(c.isInAppBrowserInstalled()){var f="http://localhost/callback";void 0!==d&&d.hasOwnProperty("redirect_uri")&&(f=d.redirect_uri);var g=window.cordova.InAppBrowser.open("https://www.yammer.com/dialog/oauth?client_id="+b+"&redirect_uri="+f+"&response_type=token","_blank","location=no,clearsessioncache=yes,clearcache=yes");g.addEventListener("loadstart",function(a){if(0===a.url.indexOf(f)){g.removeEventListener("exit",function(a){}),g.close();for(var b=a.url.split("#")[1],c=b.split("&"),d=[],h=0;h<c.length;h++)d[c[h].split("=")[0]]=c[h].split("=")[1];void 0!==d.access_token&&null!==d.access_token?e.resolve({access_token:d.access_token}):e.reject("Problem authenticating")}}),g.addEventListener("exit",function(a){e.reject("The sign in flow was canceled")})}else e.reject("Could not find InAppBrowser plugin");else e.reject("Cannot authenticate via a web browser");return e.promise}return{signin:d}}angular.module("oauth.yammer",["oauth.utils"]).factory("$ngCordovaYammer",a),a.$inject=["$q","$http","$cordovaOauthUtility"]}(),angular.module("ngCordovaOauth",["oauth.providers","oauth.utils"]),function(){function a(a){function b(){var a=cordova.require("cordova/plugin_list"),b=["cordova-plugin-inappbrowser","cordova-plugin-inappbrowser.inappbrowser","org.apache.cordova.inappbrowser"];if(0===Object.keys(a.metadata).length){var c=a.map(function(a){return a.id||a.pluginId});return b.some(function(a){return c.indexOf(a)!=-1})}return b.some(function(b){return a.metadata.hasOwnProperty(b)})}function c(a,b,c,d,e,f){if("undefined"!=typeof jsSHA){for(var g=angular.copy(c),h=Object.keys(d),i=0;i<h.length;i++)g[h[i]]=encodeURIComponent(d[h[i]]);var j=a+"&"+encodeURIComponent(b)+"&",k=Object.keys(g).sort();for(i=0;i<k.length;i++)j+=i==k.length-1?encodeURIComponent(k[i]+"="+g[k[i]]):encodeURIComponent(k[i]+"="+g[k[i]]+"&");var l=new jsSHA(j,"TEXT"),m="";f&&(m=encodeURIComponent(f)),c.oauth_signature=encodeURIComponent(l.getHMAC(encodeURIComponent(e)+"&"+m,"TEXT","SHA-1","B64"));var n=Object.keys(c),o="OAuth ";for(i=0;i<n.length;i++)o+=i==n.length-1?n[i]+'="'+c[n[i]]+'"':n[i]+'="'+c[n[i]]+'",';return{signature_base_string:j,authorization_header:o,signature:c.oauth_signature}}return"Missing jsSHA JavaScript library"}function d(a){for(var b="",c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",d=0;d<a;d++)b+=c.charAt(Math.floor(Math.random()*c.length));return b}function e(a){var b=Object.keys(a);b.sort();for(var c="",d="",e=0;e<b.length;e++)c+=d+b[e]+"="+a[b[e]],d="&";return c}function f(a){if(a.split){for(var b=a.split("&"),c={},d=0;d<b.length;d++)c[b[d].split("=")[0]]=b[d].split("=")[1];return c}return{}}function g(a){var b=new jsSHA(Math.round((new Date).getTime()/1e3),"TEXT"),c={oauth_consumer_key:a,oauth_nonce:b.getHash("SHA-1","HEX"),oauth_signature_method:"HMAC-SHA1",oauth_timestamp:Math.round((new Date).getTime()/1e3),oauth_version:"1.0"};return c}return{isInAppBrowserInstalled:b,createSignature:c,createNonce:d,generateUrlParameters:e,parseResponseParameters:f,generateOauthParametersInstance:g}}angular.module("oauth.utils",[]).factory("$cordovaOauthUtility",a),a.$inject=["$q"]}();