From f3136eefe9105deb1d97123629dae80c2de66304 Mon Sep 17 00:00:00 2001 From: PliablePixels Date: Thu, 2 Jul 2015 10:33:26 -0400 Subject: updated libraries, squashed the problem of not getting bar handles on click, optimized montage view --- www/lib/ngCordova/dist/ng-cordova-mocks.js | 4126 ++++++++++++------------ www/lib/ngCordova/dist/ng-cordova-mocks.min.js | 4 +- www/lib/ngCordova/dist/ng-cordova.js | 2869 ++++++++-------- www/lib/ngCordova/dist/ng-cordova.min.js | 9 +- 4 files changed, 3650 insertions(+), 3358 deletions(-) (limited to 'www/lib/ngCordova/dist') diff --git a/www/lib/ngCordova/dist/ng-cordova-mocks.js b/www/lib/ngCordova/dist/ng-cordova-mocks.js index cda8cf4f..77606630 100644 --- a/www/lib/ngCordova/dist/ng-cordova-mocks.js +++ b/www/lib/ngCordova/dist/ng-cordova-mocks.js @@ -1,16 +1,16 @@ /*! * ngCordova - * v0.1.15-alpha + * v0.1.17-alpha * Copyright 2014 Drifty Co. http://drifty.com/ * See LICENSE in this repository for license information */ (function(){ var ngCordovaMocks = angular.module('ngCordovaMocks', []); -ngCordovaMocks.factory('$cordovaAppVersion', ['$q', function($q) { +ngCordovaMocks.factory('$cordovaAppVersion', ['$q', function ($q) { var throwsError = false; return { throwsError: throwsError, - getAppVersion: function() { + getAppVersion: function () { var defer = $q.defer(); defer.resolve('mock v'); return defer.promise; @@ -25,89 +25,91 @@ ngCordovaMocks.factory('$cordovaAppVersion', ['$q', function($q) { * @description * A service for testing barcode scanner features * in an app build with ngCordova. -**/ -ngCordovaMocks.factory('$cordovaBarcodeScanner', ['$q', function($q) { - var throwsError = false; + **/ +ngCordovaMocks.factory('$cordovaBarcodeScanner', ['$q', function ($q) { + var throwsError = false; - var scannedText = ''; - var scannedFormat = ''; - var wasCancelled = false; + var scannedText = ''; + var scannedFormat = ''; + var wasCancelled = false; - return { - /** - * @ngdoc property - * @name throwsError - * @propertyOf ngCordovaMocks.cordovaBarcodeScanner - * - * @description - * A flag that signals whether a promise should be rejected or not. - * This property should only be used in automated tests. - **/ - throwsError: throwsError, - - /** - * @ngdoc property - * @name scannedText - * @propertyOf ngCordovaMocks.cordovaBarcodeScanner - * - * @description - * Used to simulate the result.text property of a - * successful scan. For more information, see the text at - * https://github.com/wildabeast/BarcodeScanner/#using-the-plugin - * This property should only be used in automated tests. - **/ - scannedText: scannedText, - - /** - * @ngdoc property - * @name scannedFormat - * @propertyOf ngCordovaMocks.cordovaBarcodeScanner - * - * @description - * Used to simulate the result.format property of a - * successful scan. For more information, see the text at - * https://github.com/wildabeast/BarcodeScanner/#using-the-plugin - * This property should only be used in automated tests. - **/ - scannedFormat: scannedFormat, - - /** - * @ngdoc property - * @name wasCancelled - * @propertyOf ngCordovaMocks.cordovaBarcodeScanner - * - * @description - * Used to simulate the result.cancelled property of a - * successful scan. For more information, see the text at - * https://github.com/wildabeast/BarcodeScanner/#using-the-plugin - * This property should only be used in automated tests. - **/ - wasCancelled: wasCancelled, - - scan: function() { - var defer = $q.defer(); - if (this.throwsError) { - defer.reject('There was an error scanning.'); - } else { - defer.resolve({text: this.scannedText, format: this.scannedFormat, cancelled: this.wasCancelled }); - } - return defer.promise; - }, + return { + /** + * @ngdoc property + * @name throwsError + * @propertyOf ngCordovaMocks.cordovaBarcodeScanner + * + * @description + * A flag that signals whether a promise should be rejected or not. + * This property should only be used in automated tests. + **/ + throwsError: throwsError, - encode: function(type, data) { - this.scannedFormat = type; - this.scannedText = data; - - var defer = $q.defer(); - if (this.throwsError) { - defer.reject('There was an error encoding the data.'); - } else { - defer.resolve(); - } - return defer.promise; - } - }; + /** + * @ngdoc property + * @name scannedText + * @propertyOf ngCordovaMocks.cordovaBarcodeScanner + * + * @description + * Used to simulate the result.text property of a + * successful scan. For more information, see the text at + * https://github.com/wildabeast/BarcodeScanner/#using-the-plugin + * This property should only be used in automated tests. + **/ + scannedText: scannedText, + + /** + * @ngdoc property + * @name scannedFormat + * @propertyOf ngCordovaMocks.cordovaBarcodeScanner + * @description + * Used to simulate the result.format property of a + * successful scan. For more information, see the text at + * https://github.com/wildabeast/BarcodeScanner/#using-the-plugin + * This property should only be used in automated tests. + **/ + scannedFormat: scannedFormat, + + /** + * @ngdoc property + * @name wasCancelled + * @propertyOf ngCordovaMocks.cordovaBarcodeScanner + * + * @description + * Used to simulate the result.cancelled property of a + * successful scan. For more information, see the text at + * https://github.com/wildabeast/BarcodeScanner/#using-the-plugin + * This property should only be used in automated tests. + **/ + wasCancelled: wasCancelled, + + scan: function () { + var defer = $q.defer(); + if (this.throwsError) { + defer.reject('There was an error scanning.'); + } else { + defer.resolve({text: this.scannedText, format: this.scannedFormat, cancelled: this.wasCancelled}); + } + + return defer.promise; + }, + + encode: function (type, data) { + this.scannedFormat = type; + this.scannedText = data; + + var defer = $q.defer(); + if (this.throwsError) { + defer.reject('There was an error encoding the data.'); + } else { + defer.resolve(); + } + + return defer.promise; + } + }; }]); + /** * @ngdoc service * @name ngCordovaMocks.cordovaBLE @@ -115,46 +117,46 @@ ngCordovaMocks.factory('$cordovaBarcodeScanner', ['$q', function($q) { * @description * A service for ble features * in an app build with ngCordova. -**/ -ngCordovaMocks.factory('$cordovaBLE', ['$q', '$timeout', function($q, $timeout) { - var deviceScan = { - "name": "Test Device", - "id": "AA:BB:CC:DD:EE:FF", - "advertising": [2,1,6,3,3,15,24,8,9,66,97,116,116,101,114,121], - "rssi": -55 + **/ +ngCordovaMocks.factory('$cordovaBLE', ['$q', '$timeout', function ($q, $timeout) { + var deviceScan = { + name: 'Test Device', + id: 'AA:BB:CC:DD:EE:FF', + advertising: [2, 1, 6, 3, 3, 15, 24, 8, 9, 66, 97, 116, 116, 101, 114, 121], + rssi: -55 }; var deviceConnect = { - "name": "Test Device", - "id": "AA:BB:CC:DD:EE:FF", - "advertising": [2,1,6,3,3,15,24,8,9,66,97,116,116,101,114,121], - "rssi": -55, - "services": [ - "1800", - "1801", - "180f" + name: 'Test Device', + id: 'AA:BB:CC:DD:EE:FF', + advertising: [2, 1, 6, 3, 3, 15, 24, 8, 9, 66, 97, 116, 116, 101, 114, 121], + rssi: -55, + services: [ + '1800', + '1801', + '180f' ], - "characteristics": [ + characteristics: [ { - "service": "1800", - "characteristic": "2a00", - "properties": [ "Read" ] + service: '1800', + characteristic: '2a00', + properties: ['Read'] }, { - "service": "1800", - "characteristic": "2a01", - "properties": [ "Read" ] + service: '1800', + characteristic: '2a01', + properties: ['Read'] }, { - "service": "1801", - "characteristic": "2a05", - "properties": [ "Read" ] + service: '1801', + characteristic: '2a05', + properties: ['Read'] }, { - "service": "180f", - "characteristic": "2a19", - "properties": [ "Read" ], - "descriptors": [ { "uuid": "2901" }, { "uuid": "2904" } ] + service: '180f', + characteristic: '2a19', + properties: ['Read'], + descriptors: [{'uuid': '2901'}, {'uuid': '2904'}] } ] }; @@ -167,7 +169,7 @@ ngCordovaMocks.factory('$cordovaBLE', ['$q', '$timeout', function($q, $timeout) var q = $q.defer(); $timeout(function () { q.resolve(deviceScan); - }, seconds*1000); + }, seconds * 1000); return q.promise; }, @@ -238,9 +240,33 @@ ngCordovaMocks.factory('$cordovaBLE', ['$q', '$timeout', function($q, $timeout) q.resolve(true); return q.promise; } - }; + }; }]); +ngCordovaMocks.factory('$cordovaBrightness', ['$q', function ($q) { + var currentBrightness = 100; + + return { + get: function () { + var q = $q.defer(); + q.resolve(currentBrightness); + return q.promise; + }, + + set: function (data) { + var q = $q.defer(); + currentBrightness = data; + q.resolve('OK'); + return q.promise; + }, + + setKeepScreenOn: function (bool) { + var q = $q.defer(); + q.resolve('OK'); + return q.promise; + } + }; +}]); /** * @ngdoc service * @name ngCordovaMocks.cordovaCamera @@ -248,23 +274,23 @@ ngCordovaMocks.factory('$cordovaBLE', ['$q', '$timeout', function($q, $timeout) * @description * A service for testing camera features * in an app build with ngCordova. -**/ -ngCordovaMocks.factory('$cordovaCamera', ['$q', function($q) { - var throwsError = false; + **/ +ngCordovaMocks.factory('$cordovaCamera', ['$q', function ($q) { + var throwsError = false; var imageData = ''; - return { + return { /** - * @ngdoc property - * @name throwsError - * @propertyOf ngCordovaMocks.cordovaCamera - * - * @description - * A flag that signals whether a promise should be rejected or not. - * This property should only be used in automated tests. - **/ - throwsError: throwsError, + * @ngdoc property + * @name throwsError + * @propertyOf ngCordovaMocks.cordovaCamera + * + * @description + * A flag that signals whether a promise should be rejected or not. + * This property should only be used in automated tests. + **/ + throwsError: throwsError, /** * @ngdoc property @@ -277,20 +303,21 @@ ngCordovaMocks.factory('$cordovaCamera', ['$q', function($q) { **/ imageData: imageData, - getPicture: function(options) { - var defer = $q.defer(); - if (this.throwsError) { - defer.reject('There was an error getting the picture.'); - } else { - if (options) { - options = options; // This is just to get by JSHint. - } + getPicture: function (options) { + var defer = $q.defer(); + if (this.throwsError) { + defer.reject('There was an error getting the picture.'); + } else { + if (options) { + options = options; // This is just to get by JSHint. + } defer.resolve(this.imageData); - } - return defer.promise; - } - }; + } + + return defer.promise; + } + }; }]); /** @@ -303,52 +330,56 @@ ngCordovaMocks.factory('$cordovaCamera', ['$q', function($q) { * * @example */ -ngCordovaMocks.factory('$cordovaCapture', ['$q', function($q) { - var throwsError = false; +ngCordovaMocks.factory('$cordovaCapture', ['$q', function ($q) { + var throwsError = false; - return { - /** - * @ngdoc property - * @name throwsError - * @propertyOf ngCordovaMocks.cordovaCapture - * - * @description - * A flag that signals whether a promise should be rejected or not. - * This property should only be used in automated tests. - **/ - throwsError: throwsError, - - captureAudio : function() { - var defer = $q.defer(); - if (this.throwsError) { - defer.reject('There was an error capturing the audio.'); - } else { - defer.resolve(); - } - return defer.promise; - }, + return { + /** + * @ngdoc property + * @name throwsError + * @propertyOf ngCordovaMocks.cordovaCapture + * + * @description + * A flag that signals whether a promise should be rejected or not. + * This property should only be used in automated tests. + **/ + throwsError: throwsError, - captureImage: function() { - var defer = $q.defer(); - if (this.throwsError) { - defer.reject('There was an error capturing the image.'); - } else { - defer.resolve(); - } - return defer.promise; - }, + captureAudio: function () { + var defer = $q.defer(); + if (this.throwsError) { + defer.reject('There was an error capturing the audio.'); + } else { + defer.resolve(); + } - captureVideo: function() { - var defer = $q.defer(); - if (this.throwsError) { - defer.reject('There was an error capturing the video.'); - } else { - defer.resolve(); - } - return defer.promise; - } - }; + return defer.promise; + }, + + captureImage: function () { + var defer = $q.defer(); + if (this.throwsError) { + defer.reject('There was an error capturing the image.'); + } else { + defer.resolve(); + } + + return defer.promise; + }, + + captureVideo: function () { + var defer = $q.defer(); + if (this.throwsError) { + defer.reject('There was an error capturing the video.'); + } else { + defer.resolve(); + } + + return defer.promise; + } + }; }]); + /** * @ngdoc service * @name ngCordovaMocks.cordovaContacts @@ -356,115 +387,120 @@ ngCordovaMocks.factory('$cordovaCapture', ['$q', function($q) { * @description * A service for testing features related with contacts * in an app build with ngCordova. -**/ -ngCordovaMocks.factory('$cordovaContacts', ['$q', function($q) { - var throwsError = false; - var contacts = []; + **/ +ngCordovaMocks.factory('$cordovaContacts', ['$q', function ($q) { + var throwsError = false; + var contacts = []; - return { - /** - * @ngdoc property - * @name throwsError - * @propertyOf ngCordovaMocks.cordovaContacts - * - * @description - * A flag that signals whether a promise should be rejected or not. - * This property should only be used in automated tests. - **/ - throwsError: throwsError, - - /** - * @ngdoc contacts - * @name throwsError - * @propertyOf ngCordovaMocks.cordovaContacts - * - * @description - * An in-memory collection of contacts. - * This property should only be used in automated tests. - **/ - contacts: contacts, - - save: function(contact) { - var defer = $q.defer(); - if (this.throwsError) { - defer.reject('There was an error saving the contact.'); - } else { - var existingIndex = null; - for (var i=0; i 0) { - this.isVibrating = true; - self = this; - - if (time instanceof Array) { - // TODO: Implement pattern here. - // The following is a temporary timer that just looks at the first value - this.vibrateTimer = $timeout( - function() { - self.isVibrating = false; - self.vibrateTimer = null; - }, - time[0] - ); - } else { - this.vibrateTimer = $timeout( - function() { - self.isVibrating = false; - self.vibrateTimer = null; - }, - time - ); - } - } - }, + return { + /** + * @ngdoc property + * @name vibrateTimer + * @propertyOf ngCordovaMocks.cordovaVibration + * + * @description + * Access to the timer associated with vibration. + * This property should only be used in automated tests. + **/ + vibrateTimer: vibrateTimer, - /* jshint ignore:start */ - vibrateWithPattern: function(pattern, repeat) { - // Based on the documentation (https://github.com/apache/cordova-plugin-vibration/blob/master/doc/index.md) - // This method is deprecated. For that reason, this isn't implemented at this time. - }, - /* jshint ignore:end */ - - cancelVibration: function() { - if (this.vibrateTimer !== null) { - if (this.isVibrating === true) { - $timeout.cancel(this.vibrateTimer); - this.isVibrating = false; - } - } - } - }; + /** + * @ngdoc property + * @name isVibrating + * @propertyOf ngCordovaMocks.cordovaVibration + * + * @description + * A flag that signals whether vibration is active. + * This property should only be used in automated tests. + **/ + isVibrating: isVibrating, + + vibrate: function (time) { + if (time > 0) { + this.isVibrating = true; + self = this; + + if (time instanceof Array) { + // TODO: Implement pattern here. + // The following is a temporary timer that just looks at the first value + this.vibrateTimer = $timeout( + function () { + self.isVibrating = false; + self.vibrateTimer = null; + }, + time[0] + ); + } else { + this.vibrateTimer = $timeout( + function () { + self.isVibrating = false; + self.vibrateTimer = null; + }, + time + ); + } + } + }, + + /* jshint ignore:start */ + vibrateWithPattern: function (pattern, repeat) { + // Based on the documentation (https://github.com/apache/cordova-plugin-vibration) + // This method is deprecated. For that reason, this isn't implemented at this time. + }, + /* jshint ignore:end */ + + cancelVibration: function () { + if (this.vibrateTimer !== null) { + if (this.isVibrating === true) { + $timeout.cancel(this.vibrateTimer); + this.isVibrating = false; + } + } + } + }; }]); + })(); diff --git a/www/lib/ngCordova/dist/ng-cordova-mocks.min.js b/www/lib/ngCordova/dist/ng-cordova-mocks.min.js index 1d6d9a5d..64559d76 100644 --- a/www/lib/ngCordova/dist/ng-cordova-mocks.min.js +++ b/www/lib/ngCordova/dist/ng-cordova-mocks.min.js @@ -1,7 +1,7 @@ /*! * ngCordova - * v0.1.15-alpha + * v0.1.17-alpha * Copyright 2014 Drifty Co. http://drifty.com/ * See LICENSE in this repository for license information */ -!function(){var r=angular.module("ngCordovaMocks",[]);r.factory("$cordovaAppVersion",["$q",function(r){var e=!1;return{throwsError:e,getAppVersion:function(){var e=r.defer();return e.resolve("mock v"),e.promise}}}]),r.factory("$cordovaBarcodeScanner",["$q",function(r){var e=!1,t="",o="",i=!1;return{throwsError:e,scannedText:t,scannedFormat:o,wasCancelled:i,scan:function(){var e=r.defer();return this.throwsError?e.reject("There was an error scanning."):e.resolve({text:this.scannedText,format:this.scannedFormat,cancelled:this.wasCancelled}),e.promise},encode:function(e,t){this.scannedFormat=e,this.scannedText=t;var o=r.defer();return this.throwsError?o.reject("There was an error encoding the data."):o.resolve(),o.promise}}}]),r.factory("$cordovaBLE",["$q","$timeout",function(r,e){var t={name:"Test Device",id:"AA:BB:CC:DD:EE:FF",advertising:[2,1,6,3,3,15,24,8,9,66,97,116,116,101,114,121],rssi:-55},o={name:"Test Device",id:"AA:BB:CC:DD:EE:FF",advertising:[2,1,6,3,3,15,24,8,9,66,97,116,116,101,114,121],rssi:-55,services:["1800","1801","180f"],characteristics:[{service:"1800",characteristic:"2a00",properties:["Read"]},{service:"1800",characteristic:"2a01",properties:["Read"]},{service:"1801",characteristic:"2a05",properties:["Read"]},{service:"180f",characteristic:"2a19",properties:["Read"],descriptors:[{uuid:"2901"},{uuid:"2904"}]}]},i=new ArrayBuffer(8);return{scan:function(o,i){var n=r.defer();return e(function(){n.resolve(t)},1e3*i),n.promise},connect:function(){var t=r.defer();return e(function(){t.resolve(o)},1500),t.promise},disconnect:function(){var t=r.defer();return e(function(){t.resolve(!0)},500),t.promise},read:function(){var t=r.defer();return e(function(){t.resolve(i)},100),t.promise},write:function(){var t=r.defer();return e(function(){t.resolve(!0)},100),t.promise},writeCommand:function(){var t=r.defer();return e(function(){t.resolve(!0)},100),t.promise},notify:function(){var t=r.defer();return e(function(){t.resolve(!0)},100),t.promise},indicate:function(){var t=r.defer();return e(function(){t.resolve(!0)},100),t.promise},isConnected:function(){var e=r.defer();return e.resolve(!0),e.promise},isEnabled:function(){var e=r.defer();return e.resolve(!0),e.promise}}}]),r.factory("$cordovaCamera",["$q",function(r){var e=!1,t="";return{throwsError:e,imageData:t,getPicture:function(e){var t=r.defer();return this.throwsError?t.reject("There was an error getting the picture."):(e&&(e=e),t.resolve(this.imageData)),t.promise}}}]),r.factory("$cordovaCapture",["$q",function(r){var e=!1;return{throwsError:e,captureAudio:function(){var e=r.defer();return this.throwsError?e.reject("There was an error capturing the audio."):e.resolve(),e.promise},captureImage:function(){var e=r.defer();return this.throwsError?e.reject("There was an error capturing the image."):e.resolve(),e.promise},captureVideo:function(){var e=r.defer();return this.throwsError?e.reject("There was an error capturing the video."):e.resolve(),e.promise}}}]),r.factory("$cordovaContacts",["$q",function(r){var e=!1,t=[];return{throwsError:e,contacts:t,save:function(e){var t=r.defer();if(this.throwsError)t.reject("There was an error saving the contact.");else{for(var o=null,i=0;i0&&(this.isVibrating=!0,self=this,this.vibrateTimer=e instanceof Array?r(function(){self.isVibrating=!1,self.vibrateTimer=null},e[0]):r(function(){self.isVibrating=!1,self.vibrateTimer=null},e))},vibrateWithPattern:function(){},cancelVibration:function(){null!==this.vibrateTimer&&this.isVibrating===!0&&(r.cancel(this.vibrateTimer),this.isVibrating=!1)}}}])}(); +!function(){var r=angular.module("ngCordovaMocks",[]);r.factory("$cordovaAppVersion",["$q",function(r){var e=!1;return{throwsError:e,getAppVersion:function(){var e=r.defer();return e.resolve("mock v"),e.promise}}}]),r.factory("$cordovaBarcodeScanner",["$q",function(r){var e=!1,t="",o="",i=!1;return{throwsError:e,scannedText:t,scannedFormat:o,wasCancelled:i,scan:function(){var e=r.defer();return this.throwsError?e.reject("There was an error scanning."):e.resolve({text:this.scannedText,format:this.scannedFormat,cancelled:this.wasCancelled}),e.promise},encode:function(e,t){this.scannedFormat=e,this.scannedText=t;var o=r.defer();return this.throwsError?o.reject("There was an error encoding the data."):o.resolve(),o.promise}}}]),r.factory("$cordovaBLE",["$q","$timeout",function(r,e){var t={name:"Test Device",id:"AA:BB:CC:DD:EE:FF",advertising:[2,1,6,3,3,15,24,8,9,66,97,116,116,101,114,121],rssi:-55},o={name:"Test Device",id:"AA:BB:CC:DD:EE:FF",advertising:[2,1,6,3,3,15,24,8,9,66,97,116,116,101,114,121],rssi:-55,services:["1800","1801","180f"],characteristics:[{service:"1800",characteristic:"2a00",properties:["Read"]},{service:"1800",characteristic:"2a01",properties:["Read"]},{service:"1801",characteristic:"2a05",properties:["Read"]},{service:"180f",characteristic:"2a19",properties:["Read"],descriptors:[{uuid:"2901"},{uuid:"2904"}]}]},i=new ArrayBuffer(8);return{scan:function(o,i){var n=r.defer();return e(function(){n.resolve(t)},1e3*i),n.promise},connect:function(){var t=r.defer();return e(function(){t.resolve(o)},1500),t.promise},disconnect:function(){var t=r.defer();return e(function(){t.resolve(!0)},500),t.promise},read:function(){var t=r.defer();return e(function(){t.resolve(i)},100),t.promise},write:function(){var t=r.defer();return e(function(){t.resolve(!0)},100),t.promise},writeCommand:function(){var t=r.defer();return e(function(){t.resolve(!0)},100),t.promise},notify:function(){var t=r.defer();return e(function(){t.resolve(!0)},100),t.promise},indicate:function(){var t=r.defer();return e(function(){t.resolve(!0)},100),t.promise},isConnected:function(){var e=r.defer();return e.resolve(!0),e.promise},isEnabled:function(){var e=r.defer();return e.resolve(!0),e.promise}}}]),r.factory("$cordovaBrightness",["$q",function(r){var e=100;return{get:function(){var t=r.defer();return t.resolve(e),t.promise},set:function(t){var o=r.defer();return e=t,o.resolve("OK"),o.promise},setKeepScreenOn:function(){var e=r.defer();return e.resolve("OK"),e.promise}}}]),r.factory("$cordovaCamera",["$q",function(r){var e=!1,t="";return{throwsError:e,imageData:t,getPicture:function(e){var t=r.defer();return this.throwsError?t.reject("There was an error getting the picture."):(e&&(e=e),t.resolve(this.imageData)),t.promise}}}]),r.factory("$cordovaCapture",["$q",function(r){var e=!1;return{throwsError:e,captureAudio:function(){var e=r.defer();return this.throwsError?e.reject("There was an error capturing the audio."):e.resolve(),e.promise},captureImage:function(){var e=r.defer();return this.throwsError?e.reject("There was an error capturing the image."):e.resolve(),e.promise},captureVideo:function(){var e=r.defer();return this.throwsError?e.reject("There was an error capturing the video."):e.resolve(),e.promise}}}]),r.factory("$cordovaContacts",["$q",function(r){var e=!1,t=[];return{throwsError:e,contacts:t,save:function(e){var t=r.defer();if(this.throwsError)t.reject("There was an error saving the contact.");else{for(var o=null,i=0;i0&&(this.isVibrating=!0,self=this,this.vibrateTimer=e instanceof Array?r(function(){self.isVibrating=!1,self.vibrateTimer=null},e[0]):r(function(){self.isVibrating=!1,self.vibrateTimer=null},e))},vibrateWithPattern:function(){},cancelVibration:function(){null!==this.vibrateTimer&&this.isVibrating===!0&&(r.cancel(this.vibrateTimer),this.isVibrating=!1)}}}])}(); diff --git a/www/lib/ngCordova/dist/ng-cordova.js b/www/lib/ngCordova/dist/ng-cordova.js index 76f3fa6e..4f749d9f 100644 --- a/www/lib/ngCordova/dist/ng-cordova.js +++ b/www/lib/ngCordova/dist/ng-cordova.js @@ -1,6 +1,6 @@ /*! * ngCordova - * v0.1.15-alpha + * v0.1.17-alpha * Copyright 2014 Drifty Co. http://drifty.com/ * See LICENSE in this repository for license information */ @@ -133,7 +133,6 @@ angular.module('ngCordova.plugins.appRate', []) .provider("$cordovaAppRate", [function () { - this.setPreferences = function (defaults) { if (!defaults || !angular.isObject(defaults)) { return; @@ -151,7 +150,6 @@ angular.module('ngCordova.plugins.appRate', []) AppRate.preferences.storeAppURL.windows8 = defaults.windowsURL || null; }; - this.setCustomLocale = function (customObj) { var strings = { title: 'Rate %@', @@ -279,9 +277,10 @@ angular.module('ngCordova.plugins.backgroundGeolocation', []) } }; } + ]); -// install : cordova plugin add de.appplant.cordova.plugin.badge +// install : cordova plugin add https://github.com/katzer/cordova-plugin-badge.git // link : https://github.com/katzer/cordova-plugin-badge angular.module('ngCordova.plugins.badge', []) @@ -294,8 +293,7 @@ angular.module('ngCordova.plugins.badge', []) cordova.plugins.notification.badge.hasPermission(function (permission) { if (permission) { q.resolve(true); - } - else { + } else { q.reject("You do not have permission"); } }); @@ -313,8 +311,7 @@ angular.module('ngCordova.plugins.badge', []) cordova.plugins.notification.badge.hasPermission(function (permission) { if (permission) { q.resolve(cordova.plugins.notification.badge.set(number)); - } - else { + } else { q.reject("You do not have permission to set Badge"); } }); @@ -342,8 +339,7 @@ angular.module('ngCordova.plugins.badge', []) cordova.plugins.notification.badge.hasPermission(function (permission) { if (permission) { q.resolve(cordova.plugins.notification.badge.clear()); - } - else { + } else { q.reject("You do not have permission to clear Badge"); } }); @@ -357,7 +353,7 @@ angular.module('ngCordova.plugins.badge', []) }]); // install : cordova plugin add https://github.com/wildabeast/BarcodeScanner.git -// link : https://github.com/wildabeast/BarcodeScanner/#using-the-plugin +// link : https://github.com/wildabeast/BarcodeScanner angular.module('ngCordova.plugins.barcodeScanner', []) @@ -391,8 +387,8 @@ angular.module('ngCordova.plugins.barcodeScanner', []) }; }]); -// install : cordova plugin add org.apache.cordova.battery-status -// link : https://github.com/apache/cordova-plugin-battery-status/blob/master/doc/index.md +// install : cordova plugin add cordova-plugin-battery-status +// link : https://github.com/apache/cordova-plugin-battery-status angular.module('ngCordova.plugins.batteryStatus', []) @@ -429,7 +425,7 @@ angular.module('ngCordova.plugins.batteryStatus', []) .run(['$cordovaBatteryStatus', function ($cordovaBatteryStatus) { }]); -// install : cordova plugin add https://github.com/don/cordova-plugin-ble-central#:/plugin +// install : cordova plugin add https://github.com/don/cordova-plugin-ble-central.git // link : https://github.com/don/cordova-plugin-ble-central angular.module('ngCordova.plugins.ble', []) @@ -497,9 +493,9 @@ angular.module('ngCordova.plugins.ble', []) return q.promise; }, - notify: function (deviceID, serviceUUID, characteristicUUID) { + startNotification: function (deviceID, serviceUUID, characteristicUUID) { var q = $q.defer(); - ble.notify(deviceID, serviceUUID, characteristicUUID, function (result) { + ble.startNotification(deviceID, serviceUUID, characteristicUUID, function (result) { q.resolve(result); }, function (error) { q.reject(error); @@ -507,9 +503,9 @@ angular.module('ngCordova.plugins.ble', []) return q.promise; }, - indicate: function (deviceID, serviceUUID, characteristicUUID) { + stopNotification: function (deviceID, serviceUUID, characteristicUUID) { var q = $q.defer(); - ble.indicate(deviceID, serviceUUID, characteristicUUID, function (result) { + ble.stopNotification(deviceID, serviceUUID, characteristicUUID, function (result) { q.resolve(result); }, function (error) { q.reject(error); @@ -539,7 +535,7 @@ angular.module('ngCordova.plugins.ble', []) }; }]); -// install : cordova plugin add com.megster.cordova.bluetoothserial +// install : cordova plugin add https://github.com/don/BluetoothSerial.git // link : https://github.com/don/BluetoothSerial angular.module('ngCordova.plugins.bluetoothSerial', []) @@ -568,7 +564,6 @@ angular.module('ngCordova.plugins.bluetoothSerial', []) return q.promise; }, - disconnect: function () { var q = $q.defer(); $window.bluetoothSerial.disconnect(function () { @@ -579,7 +574,6 @@ angular.module('ngCordova.plugins.bluetoothSerial', []) return q.promise; }, - list: function () { var q = $q.defer(); $window.bluetoothSerial.list(function (data) { @@ -590,7 +584,6 @@ angular.module('ngCordova.plugins.bluetoothSerial', []) return q.promise; }, - discoverUnpaired: function () { var q = $q.defer(); $window.bluetoothSerial.discoverUnpaired(function (data) { @@ -601,7 +594,6 @@ angular.module('ngCordova.plugins.bluetoothSerial', []) return q.promise; }, - setDeviceDiscoveredListener: function () { var q = $q.defer(); $window.bluetoothSerial.setDeviceDiscoveredListener(function (data) { @@ -610,11 +602,10 @@ angular.module('ngCordova.plugins.bluetoothSerial', []) return q.promise; }, - clearDeviceDiscoveredListener: function() { + clearDeviceDiscoveredListener: function () { $window.bluetoothSerial.clearDeviceDiscoveredListener(); }, - showBluetoothSettings: function () { var q = $q.defer(); $window.bluetoothSerial.showBluetoothSettings(function () { @@ -625,7 +616,6 @@ angular.module('ngCordova.plugins.bluetoothSerial', []) return q.promise; }, - isEnabled: function () { var q = $q.defer(); $window.bluetoothSerial.isEnabled(function () { @@ -636,7 +626,6 @@ angular.module('ngCordova.plugins.bluetoothSerial', []) return q.promise; }, - enable: function () { var q = $q.defer(); $window.bluetoothSerial.enable(function () { @@ -647,7 +636,6 @@ angular.module('ngCordova.plugins.bluetoothSerial', []) return q.promise; }, - isConnected: function () { var q = $q.defer(); $window.bluetoothSerial.isConnected(function () { @@ -658,7 +646,6 @@ angular.module('ngCordova.plugins.bluetoothSerial', []) return q.promise; }, - available: function () { var q = $q.defer(); $window.bluetoothSerial.available(function (data) { @@ -669,7 +656,6 @@ angular.module('ngCordova.plugins.bluetoothSerial', []) return q.promise; }, - read: function () { var q = $q.defer(); $window.bluetoothSerial.read(function (data) { @@ -690,7 +676,6 @@ angular.module('ngCordova.plugins.bluetoothSerial', []) return q.promise; }, - write: function (data) { var q = $q.defer(); $window.bluetoothSerial.write(data, function () { @@ -701,7 +686,6 @@ angular.module('ngCordova.plugins.bluetoothSerial', []) return q.promise; }, - subscribe: function (delimiter) { var q = $q.defer(); $window.bluetoothSerial.subscribe(delimiter, function (data) { @@ -722,7 +706,6 @@ angular.module('ngCordova.plugins.bluetoothSerial', []) return q.promise; }, - unsubscribe: function () { var q = $q.defer(); $window.bluetoothSerial.unsubscribe(function () { @@ -743,7 +726,6 @@ angular.module('ngCordova.plugins.bluetoothSerial', []) return q.promise; }, - clear: function () { var q = $q.defer(); $window.bluetoothSerial.clear(function () { @@ -754,7 +736,6 @@ angular.module('ngCordova.plugins.bluetoothSerial', []) return q.promise; }, - readRSSI: function () { var q = $q.defer(); $window.bluetoothSerial.readRSSI(function (data) { @@ -814,8 +795,6 @@ angular.module('ngCordova.plugins.brightness', []) }]); - - // install : cordova plugin add https://github.com/EddyVerbruggen/Calendar-PhoneGap-Plugin.git // link : https://github.com/EddyVerbruggen/Calendar-PhoneGap-Plugin @@ -1111,8 +1090,8 @@ angular.module('ngCordova.plugins.calendar', []) }; }]); -// install : cordova plugin add org.apache.cordova.camera -// link : https://github.com/apache/cordova-plugin-camera/blob/master/doc/index.md#orgapachecordovacamera +// install : cordova plugin add cordova-plugin-camera +// link : https://github.com/apache/cordova-plugin-camera angular.module('ngCordova.plugins.camera', []) @@ -1150,8 +1129,8 @@ angular.module('ngCordova.plugins.camera', []) }; }]); -// install : cordova plugin add org.apache.cordova.media-capture -// link : https://github.com/apache/cordova-plugin-media-capture/blob/master/doc/index.md +// install : cordova plugin add cordova-plugin-media-capture +// link : https://github.com/apache/cordova-plugin-media-capture angular.module('ngCordova.plugins.capture', []) @@ -1209,7 +1188,7 @@ angular.module('ngCordova.plugins.capture', []) }; }]); -// install : cordova plugin add https://github.com/VersoSolutions/CordovaClipboard +// install : cordova plugin add https://github.com/VersoSolutions/CordovaClipboard.git // link : https://github.com/VersoSolutions/CordovaClipboard angular.module('ngCordova.plugins.clipboard', []) @@ -1244,8 +1223,8 @@ angular.module('ngCordova.plugins.clipboard', []) }; }]); -// install : cordova plugin add org.apache.cordova.contacts -// link : https://github.com/apache/cordova-plugin-contacts/blob/master/doc/index.md +// install : cordova plugin add cordova-plugin-contacts +// link : https://github.com/apache/cordova-plugin-contacts angular.module('ngCordova.plugins.contacts', []) @@ -1332,8 +1311,8 @@ angular.module('ngCordova.plugins.datePicker', []) }; }]); -// install : cordova plugin add org.apache.cordova.device -// link : https://github.com/apache/cordova-plugin-device/blob/master/doc/index.md +// install : cordova plugin add cordova-plugin-device +// link : https://github.com/apache/cordova-plugin-device angular.module('ngCordova.plugins.device', []) @@ -1342,7 +1321,7 @@ angular.module('ngCordova.plugins.device', []) return { /** * Returns the whole device object. - * @see https://github.com/apache/cordova-plugin-device/blob/master/doc/index.md + * @see https://github.com/apache/cordova-plugin-device * @returns {Object} The device object. */ getDevice: function () { @@ -1351,7 +1330,7 @@ angular.module('ngCordova.plugins.device', []) /** * Returns the Cordova version. - * @see https://github.com/apache/cordova-plugin-device/blob/master/doc/index.md#devicecordova + * @see https://github.com/apache/cordova-plugin-device#devicecordova * @returns {String} The Cordova version. */ getCordova: function () { @@ -1360,7 +1339,7 @@ angular.module('ngCordova.plugins.device', []) /** * Returns the name of the device's model or product. - * @see https://github.com/apache/cordova-plugin-device/blob/master/doc/index.md#devicemodel + * @see https://github.com/apache/cordova-plugin-device#devicemodel * @returns {String} The name of the device's model or product. */ getModel: function () { @@ -1377,7 +1356,7 @@ angular.module('ngCordova.plugins.device', []) /** * Returns the device's operating system name. - * @see https://github.com/apache/cordova-plugin-device/blob/master/doc/index.md#deviceplatform + * @see https://github.com/apache/cordova-plugin-device#deviceplatform * @returns {String} The device's operating system name. */ getPlatform: function () { @@ -1386,7 +1365,7 @@ angular.module('ngCordova.plugins.device', []) /** * Returns the device's Universally Unique Identifier. - * @see https://github.com/apache/cordova-plugin-device/blob/master/doc/index.md#deviceuuid + * @see https://github.com/apache/cordova-plugin-device#deviceuuid * @returns {String} The device's Universally Unique Identifier */ getUUID: function () { @@ -1395,7 +1374,7 @@ angular.module('ngCordova.plugins.device', []) /** * Returns the operating system version. - * @see https://github.com/apache/cordova-plugin-device/blob/master/doc/index.md#deviceversion + * @see https://github.com/apache/cordova-plugin-device#deviceversion * @returns {String} */ getVersion: function () { @@ -1404,8 +1383,8 @@ angular.module('ngCordova.plugins.device', []) }; }]); -// install : cordova plugin add org.apache.cordova.device-motion -// link : https://github.com/apache/cordova-plugin-device-motion/blob/master/doc/index.md +// install : cordova plugin add cordova-plugin-device-motion +// link : https://github.com/apache/cordova-plugin-device-motion angular.module('ngCordova.plugins.deviceMotion', []) @@ -1452,13 +1431,15 @@ angular.module('ngCordova.plugins.deviceMotion', []) }; }]); -// install : cordova plugin add org.apache.cordova.device-orientation -// link : https://github.com/apache/cordova-plugin-device-orientation/blob/master/doc/index.md +// install : cordova plugin add cordova-plugin-device-orientation +// link : https://github.com/apache/cordova-plugin-device-orientation angular.module('ngCordova.plugins.deviceOrientation', []) .factory('$cordovaDeviceOrientation', ['$q', function ($q) { - + var defaultOptions = { + frequency: 3000 // every 3s + }; return { getCurrentHeading: function () { var q = $q.defer(); @@ -1475,11 +1456,12 @@ angular.module('ngCordova.plugins.deviceOrientation', []) watchHeading: function (options) { var q = $q.defer(); + var _options = angular.extend(defaultOptions, options); var watchID = navigator.compass.watchHeading(function (result) { q.notify(result); }, function (err) { q.reject(err); - }, options); + }, _options); q.promise.cancel = function () { navigator.compass.clearWatch(watchID); @@ -1500,8 +1482,8 @@ angular.module('ngCordova.plugins.deviceOrientation', []) }; }]); -// install : cordova plugin add org.apache.cordova.dialogs -// link : https://github.com/apache/cordova-plugin-dialogs/blob/master/doc/index.md +// install : cordova plugin add cordova-plugin-dialogs +// link : https://github.com/apache/cordova-plugin-dialogs angular.module('ngCordova.plugins.dialogs', []) @@ -1514,8 +1496,7 @@ angular.module('ngCordova.plugins.dialogs', []) if (!$window.navigator.notification) { $window.alert(message); q.resolve(); - } - else { + } else { navigator.notification.alert(message, function () { q.resolve(); }, title, buttonName); @@ -1530,12 +1511,10 @@ angular.module('ngCordova.plugins.dialogs', []) if (!$window.navigator.notification) { if ($window.confirm(message)) { q.resolve(1); - } - else { + } else { q.resolve(2); } - } - else { + } else { navigator.notification.confirm(message, function (buttonIndex) { q.resolve(buttonIndex); }, title, buttonLabels); @@ -1551,12 +1530,10 @@ angular.module('ngCordova.plugins.dialogs', []) var res = $window.prompt(message, defaultText); if (res !== null) { q.resolve({input1: res, buttonIndex: 1}); - } - else { + } else { q.resolve({input1: res, buttonIndex: 2}); } - } - else { + } else { navigator.notification.prompt(message, function (result) { q.resolve(result); }, title, buttonLabels, defaultText); @@ -1570,7 +1547,7 @@ angular.module('ngCordova.plugins.dialogs', []) }; }]); -// install : cordova plugin add https://github.com/katzer/cordova-plugin-email-composer.git@0.8.2 +// install : cordova plugin add https://github.com/katzer/cordova-plugin-email-composer.git // link : https://github.com/katzer/cordova-plugin-email-composer angular.module('ngCordova.plugins.emailComposer', []) @@ -1582,7 +1559,11 @@ angular.module('ngCordova.plugins.emailComposer', []) var q = $q.defer(); cordova.plugins.email.isAvailable(function (isAvailable) { - isAvailable ? q.resolve() : q.reject(); + if (isAvailable) { + q.resolve(); + } else { + q.reject(); + } }); return q.promise; @@ -1604,7 +1585,7 @@ angular.module('ngCordova.plugins.emailComposer', []) }; }]); -// install : cordova -d plugin add /Users/your/path/here/phonegap-facebook-plugin --variable APP_ID="123456789" --variable APP_NAME="myApplication" +// install : cordova -d plugin add https://github.com/Wizcorp/phonegap-facebook-plugin.git --variable APP_ID="123456789" --variable APP_NAME="myApplication" // link : https://github.com/Wizcorp/phonegap-facebook-plugin angular.module('ngCordova.plugins.facebook', []) @@ -1788,8 +1769,8 @@ angular.module('ngCordova.plugins.facebookAds', []) }; }]); -// install : cordova plugin add org.apache.cordova.file -// link : https://github.com/apache/cordova-plugin-file/blob/master/doc/index.md +// install : cordova plugin add cordova-plugin-file +// link : https://github.com/apache/cordova-plugin-file angular.module('ngCordova.plugins.file', []) @@ -1814,21 +1795,21 @@ angular.module('ngCordova.plugins.file', []) return { - getFreeDiskSpace: function() { - var q = $q.defer(); - cordova.exec(function(result) { - q.resolve(result); - }, function(error) { - q.reject(error); - }, "File", "getFreeDiskSpace", []); - return q.promise; + getFreeDiskSpace: function () { + var q = $q.defer(); + cordova.exec(function (result) { + q.resolve(result); + }, function (error) { + q.reject(error); + }, "File", "getFreeDiskSpace", []); + return q.promise; }, checkDir: function (path, dir) { var q = $q.defer(); if ((/^\//.test(dir))) { - q.reject("directory cannot start with \/") + q.reject("directory cannot start with \/"); } try { @@ -1851,12 +1832,11 @@ angular.module('ngCordova.plugins.file', []) return q.promise; }, - checkFile: function (path, file) { var q = $q.defer(); if ((/^\//.test(file))) { - q.reject("directory cannot start with \/") + q.reject("directory cannot start with \/"); } try { @@ -1883,7 +1863,7 @@ angular.module('ngCordova.plugins.file', []) var q = $q.defer(); if ((/^\//.test(dirName))) { - q.reject("directory cannot start with \/") + q.reject("directory cannot start with \/"); } replaceBool = replaceBool ? false : true; @@ -1917,7 +1897,7 @@ angular.module('ngCordova.plugins.file', []) var q = $q.defer(); if ((/^\//.test(fileName))) { - q.reject("file-name cannot start with \/") + q.reject("file-name cannot start with \/"); } replaceBool = replaceBool ? false : true; @@ -1946,12 +1926,11 @@ angular.module('ngCordova.plugins.file', []) return q.promise; }, - removeDir: function (path, dirName) { var q = $q.defer(); if ((/^\//.test(dirName))) { - q.reject("file-name cannot start with \/") + q.reject("file-name cannot start with \/"); } try { @@ -2013,7 +1992,7 @@ angular.module('ngCordova.plugins.file', []) var q = $q.defer(); if ((/^\//.test(dirName))) { - q.reject("file-name cannot start with \/") + q.reject("file-name cannot start with \/"); } try { @@ -2069,8 +2048,7 @@ angular.module('ngCordova.plugins.file', []) writer.onwriteend = function (evt) { if (this.error) { q.reject(this.error); - } - else { + } else { q.resolve(evt); } }; @@ -2097,7 +2075,6 @@ angular.module('ngCordova.plugins.file', []) return q.promise; }, - writeExistingFile: function (path, fileName, text) { var q = $q.defer(); @@ -2114,8 +2091,7 @@ angular.module('ngCordova.plugins.file', []) writer.onwriteend = function (evt) { if (this.error) { q.reject(this.error); - } - else { + } else { q.resolve(evt); } }; @@ -2142,7 +2118,6 @@ angular.module('ngCordova.plugins.file', []) return q.promise; }, - readAsText: function (path, file) { var q = $q.defer(); @@ -2157,13 +2132,11 @@ angular.module('ngCordova.plugins.file', []) var reader = new FileReader(); reader.onloadend = function (evt) { - if (evt.target._result !== undefined || evt.target._result !== null) { - q.resolve(evt.target._result); - } - else if (evt.target._error !== undefined || evt.target._error !== null) { - q.reject(evt.target._error); - } - else { + if (evt.target.result !== undefined || evt.target.result !== null) { + q.resolve(evt.target.result); + } else if (evt.target.error !== undefined || evt.target.error !== null) { + q.reject(evt.target.error); + } else { q.reject({code: null, message: 'READER_ONLOADEND_ERR'}); } }; @@ -2186,7 +2159,6 @@ angular.module('ngCordova.plugins.file', []) return q.promise; }, - readAsDataURL: function (path, file) { var q = $q.defer(); @@ -2200,13 +2172,11 @@ angular.module('ngCordova.plugins.file', []) fileEntry.file(function (fileData) { var reader = new FileReader(); reader.onloadend = function (evt) { - if (evt.target._result !== undefined || evt.target._result !== null) { - q.resolve(evt.target._result); - } - else if (evt.target._error !== undefined || evt.target._error !== null) { - q.reject(evt.target._error); - } - else { + if (evt.target.result !== undefined || evt.target.result !== null) { + q.resolve(evt.target.result); + } else if (evt.target.error !== undefined || evt.target.error !== null) { + q.reject(evt.target.error); + } else { q.reject({code: null, message: 'READER_ONLOADEND_ERR'}); } }; @@ -2241,13 +2211,11 @@ angular.module('ngCordova.plugins.file', []) fileEntry.file(function (fileData) { var reader = new FileReader(); reader.onloadend = function (evt) { - if (evt.target._result !== undefined || evt.target._result !== null) { - q.resolve(evt.target._result); - } - else if (evt.target._error !== undefined || evt.target._error !== null) { - q.reject(evt.target._error); - } - else { + if (evt.target.result !== undefined || evt.target.result !== null) { + q.resolve(evt.target.result); + } else if (evt.target.error !== undefined || evt.target.error !== null) { + q.reject(evt.target.error); + } else { q.reject({code: null, message: 'READER_ONLOADEND_ERR'}); } }; @@ -2282,13 +2250,11 @@ angular.module('ngCordova.plugins.file', []) fileEntry.file(function (fileData) { var reader = new FileReader(); reader.onloadend = function (evt) { - if (evt.target._result !== undefined || evt.target._result !== null) { - q.resolve(evt.target._result); - } - else if (evt.target._error !== undefined || evt.target._error !== null) { - q.reject(evt.target._error); - } - else { + if (evt.target.result !== undefined || evt.target.result !== null) { + q.resolve(evt.target.result); + } else if (evt.target.error !== undefined || evt.target.error !== null) { + q.reject(evt.target.error); + } else { q.reject({code: null, message: 'READER_ONLOADEND_ERR'}); } }; @@ -2310,7 +2276,6 @@ angular.module('ngCordova.plugins.file', []) return q.promise; }, - moveFile: function (path, fileName, newPath, newFileName) { var q = $q.defer(); @@ -2377,7 +2342,6 @@ angular.module('ngCordova.plugins.file', []) return q.promise; }, - copyDir: function (path, dirName, newPath, newDirName) { var q = $q.defer(); @@ -2498,7 +2462,7 @@ angular.module('ngCordova.plugins.file', []) }]; }]); -// install : cordova plugin add https://github.com/pwlin/cordova-plugin-file-opener2 +// install : cordova plugin add https://github.com/pwlin/cordova-plugin-file-opener2.git // link : https://github.com/pwlin/cordova-plugin-file-opener2 angular.module('ngCordova.plugins.fileOpener2', []) @@ -2542,8 +2506,8 @@ angular.module('ngCordova.plugins.fileOpener2', []) }; }]); -// install : cordova plugin add org.apache.cordova.file-transfer -// link : https://github.com/apache/cordova-plugin-file-transfer/blob/master/doc/index.md +// install : cordova plugin add cordova-plugin-file-transfer +// link : https://github.com/apache/cordova-plugin-file-transfer angular.module('ngCordova.plugins.fileTransfer', []) @@ -2822,8 +2786,8 @@ angular.module('ngCordova.plugins.ga', []) }; }]); -// install : cordova plugin add org.apache.cordova.geolocation -// link : https://github.com/apache/cordova-plugin-geolocation/blob/master/doc/index.md +// install : cordova plugin add cordova-plugin-geolocation +// link : https://github.com/apache/cordova-plugin-geolocation angular.module('ngCordova.plugins.geolocation', []) @@ -2870,8 +2834,8 @@ angular.module('ngCordova.plugins.geolocation', []) }; }]); -// install : cordova plugin add org.apache.cordova.globalization -// link : https://github.com/apache/cordova-plugin-globalization/blob/master/doc/index.md +// install : cordova plugin add cordova-plugin-globalization +// link : https://github.com/apache/cordova-plugin-globalization angular.module('ngCordova.plugins.globalization', []) @@ -3234,6 +3198,30 @@ angular.module('ngCordova.plugins.googleAnalytics', []) return d.promise; }, + trackException: function (description, fatal) { + var d = $q.defer(); + + $window.analytics.trackException(description, fatal, function (response) { + d.resolve(response); + }, function (error) { + d.reject(error); + }); + + return d.promise; + }, + + trackTiming: function (category, milliseconds, variable, label) { + var d = $q.defer(); + + $window.analytics.trackTiming(category, milliseconds, variable, label, function (response) { + d.resolve(response); + }, function (error) { + d.reject(error); + }); + + return d.promise; + }, + addTransaction: function (transactionId, affiliation, revenue, tax, shipping, currencyCode) { var d = $q.defer(); @@ -3278,8 +3266,7 @@ angular.module('ngCordova.plugins.googleMap', []) if (!$window.plugin.google.maps) { q.reject(null); - } - else { + } else { var div = document.getElementById("map_canvas"); map = $window.plugin.google.maps.Map.getMap(options); map.setDiv(div); @@ -3288,7 +3275,6 @@ angular.module('ngCordova.plugins.googleMap', []) return q.promise; }, - isMapLoaded: function () { // check if an instance of the map exists return !!map; }, @@ -3321,198 +3307,180 @@ angular.module('ngCordova.plugins.googleMap', []) angular.module('ngCordova.plugins.googlePlayGame', []) - .factory('$cordovaGooglePlayGame', ['$q', function ($q) { - - return { - - auth: function() { - var q = $q.defer(); - - googleplaygame.auth(function(success) { - return q.resolve(success); - }, function(err) { - return q.reject(err); - }); - - return q.promise; - }, - signout: function() { - var q = $q.defer(); - - googleplaygame.signout(function(success) { - return q.resolve(success); - }, function(err) { - return q.reject(err); - }); - - return q.promise; - }, - isSignedIn: function() { - var q = $q.defer(); - - googleplaygame.isSignedIn(function(success) { - return q.resolve(success); - }, function(err) { - return q.reject(err); - }); - - return q.promise; - }, - showPlayer: function() { - var q = $q.defer(); - - googleplaygame.showPlayer(function(success) { - return q.resolve(success); - }, function(err) { - return q.reject(err); - }); - - return q.promise; - }, - submitScore: function(data) { - var q = $q.defer(); - - googleplaygame.submitScore(data, function(success) { - return q.resolve(success); - }, function(err) { - return q.reject(err); - }); - - return q.promise; - }, - showAllLeaderboards: function() { - var q = $q.defer(); - - googleplaygame.showAllLeaderboards(function(success) { - return q.resolve(success); - }, function(err) { - return q.reject(err); - }); - - return q.promise; - }, - showLeaderboard: function(data) { - var q = $q.defer(); - - googleplaygame.showLeaderboard(data, function(success) { - return q.resolve(success); - }, function(err) { - return q.reject(err); - }); - - return q.promise; - }, - unlockAchievement: function(data) { - var q = $q.defer(); - - googleplaygame.unlockAchievement(data, function(success) { - return q.resolve(success); - }, function(err) { - return q.reject(err); - }); - - return q.promise; - }, - incrementAchievement: function(data) { - var q = $q.defer(); - - googleplaygame.incrementAchievement(data, function(success) { - return q.resolve(success); - }, function(err) { - return q.reject(err); - }); - - return q.promise; - }, - showAchievements: function() { - var q = $q.defer(); - - googleplaygame.showAchievements(function(success) { - return q.resolve(success); - }, function(err) { - return q.reject(err); - }); - - return q.promise; - } - }; - - }]); -// install : cordova plugin add nl.x-services.plugins.googleplus + .factory('$cordovaGooglePlayGame', ['$q', function ($q) { + + return { + + auth: function () { + var q = $q.defer(); + + googleplaygame.auth(function (success) { + return q.resolve(success); + }, function (err) { + return q.reject(err); + }); + + return q.promise; + }, + signout: function () { + var q = $q.defer(); + + googleplaygame.signout(function (success) { + return q.resolve(success); + }, function (err) { + return q.reject(err); + }); + + return q.promise; + }, + isSignedIn: function () { + var q = $q.defer(); + + googleplaygame.isSignedIn(function (success) { + return q.resolve(success); + }, function (err) { + return q.reject(err); + }); + + return q.promise; + }, + showPlayer: function () { + var q = $q.defer(); + + googleplaygame.showPlayer(function (success) { + return q.resolve(success); + }, function (err) { + return q.reject(err); + }); + + return q.promise; + }, + submitScore: function (data) { + var q = $q.defer(); + + googleplaygame.submitScore(data, function (success) { + return q.resolve(success); + }, function (err) { + return q.reject(err); + }); + + return q.promise; + }, + showAllLeaderboards: function () { + var q = $q.defer(); + + googleplaygame.showAllLeaderboards(function (success) { + return q.resolve(success); + }, function (err) { + return q.reject(err); + }); + + return q.promise; + }, + showLeaderboard: function (data) { + var q = $q.defer(); + + googleplaygame.showLeaderboard(data, function (success) { + return q.resolve(success); + }, function (err) { + return q.reject(err); + }); + + return q.promise; + }, + unlockAchievement: function (data) { + var q = $q.defer(); + + googleplaygame.unlockAchievement(data, function (success) { + return q.resolve(success); + }, function (err) { + return q.reject(err); + }); + + return q.promise; + }, + incrementAchievement: function (data) { + var q = $q.defer(); + + googleplaygame.incrementAchievement(data, function (success) { + return q.resolve(success); + }, function (err) { + return q.reject(err); + }); + + return q.promise; + }, + showAchievements: function () { + var q = $q.defer(); + + googleplaygame.showAchievements(function (success) { + return q.resolve(success); + }, function (err) { + return q.reject(err); + }); + + return q.promise; + } + }; + + }]); + +// install : cordova plugin add https://github.com/EddyVerbruggen/cordova-plugin-googleplus.git // link : https://github.com/EddyVerbruggen/cordova-plugin-googleplus - angular.module('ngCordova.plugins.googleplus', []) +angular.module('ngCordova.plugins.googleplus', []) .factory('$cordovaGooglePlus', ['$q', '$window', function ($q, $window) { return { - login: function(iosKey){ - if(iosKey === undefined){ - iosKey = {}; - } - var q = $q.defer(); - $window.plugins.googleplus.login( - { - 'iOSApiKey': iosKey - // there is no API key for Android; you app is wired to the Google+ API by - //listing your package name in the google dev console and signing your apk - }, - function (response) { - q.resolve(response) - }, - function (error) { - q.reject(error) - } - ); + login: function (iosKey) { + var q = $q.defer(); + + if (iosKey === undefined) { + iosKey = {}; + } + $window.plugins.googleplus.login({'iOSApiKey': iosKey}, function (response) { + q.resolve(response); + }, function (error) { + q.reject(error); + }); return q.promise; }, - silentLogin: function(iosKey){ + silentLogin: function (iosKey) { + var q = $q.defer(); - if(iosKey === undefined){ - iosKey = {}; - } - var q = $q.defer(); - $window.plugins.googleplus.trySilentLogin( - { - 'iOSApiKey': iosKey - // there is no API key for Android; you app is wired to the Google+ API by - //listing your package name in the google dev console and signing your apk - }, - function (response) { - q.resolve(response) - }, - function (error) { - q.reject(error) - } - ); + if (iosKey === undefined) { + iosKey = {}; + } + $window.plugins.googleplus.trySilentLogin({'iOSApiKey': iosKey}, function (response) { + q.resolve(response); + }, function (error) { + q.reject(error); + }); return q.promise; }, - logout: function(){ + logout: function () { var q = $q.defer(); - $window.plugins.googleplus.logout( - function (response) { - q.resolve(response); - } - ); + $window.plugins.googleplus.logout(function (response) { + q.resolve(response); + }); }, - disconnect: function(){ + disconnect: function () { var q = $q.defer(); - $window.plugins.googleplus.disconnect( - function (response) { - q.resolve(response); - } - ); + $window.plugins.googleplus.disconnect(function (response) { + q.resolve(response); + }); } }; }]); -// install : cordova plugin add https://github.com/Telerik-Verified-Plugins/HealthKit +// install : cordova plugin add https://github.com/Telerik-Verified-Plugins/HealthKit.git // link : https://github.com/Telerik-Verified-Plugins/HealthKit angular.module('ngCordova.plugins.healthKit', []) @@ -3925,8 +3893,8 @@ angular.module('ngCordova.plugins.imagePicker', []) }; }]); -// install : cordova plugin add org.apache.cordova.inappbrowser -// link : https://github.com/apache/cordova-plugin-inappbrowser/blob/master/doc/index.md +// install : cordova plugin add cordova-plugin-inappbrowser +// link : https://github.com/apache/cordova-plugin-inappbrowser angular.module('ngCordova.plugins.inAppBrowser', []) @@ -4033,10 +4001,11 @@ angular.module('ngCordova.plugins.insomnia', []) allowSleepAgain: function () { return $window.plugins.insomnia.allowSleepAgain(); } - } + }; }]); -// install : cordova plugins add https://github.com/vstirbu/InstagramPlugin + +// install : cordova plugins add https://github.com/vstirbu/InstagramPlugin.git // link : https://github.com/vstirbu/InstagramPlugin angular.module('ngCordova.plugins.instagram', []) @@ -4053,7 +4022,7 @@ angular.module('ngCordova.plugins.instagram', []) return q.promise; } - Instagram.share(options.image, options.caption, function(err) { + Instagram.share(options.image, options.caption, function (err) { if(err) { q.reject(err); } else { @@ -4088,16 +4057,16 @@ angular.module('ngCordova.plugins.instagram', []) angular.module('ngCordova.plugins.keyboard', []) - .factory('$cordovaKeyboard', [function () { + .factory('$cordovaKeyboard', ['$rootScope', '$timeout', function ($rootScope, $timeout) { var keyboardShowEvent = function () { - $timeout(function () { + $rootScope.$evalAsync(function () { $rootScope.$broadcast('$cordovaKeyboard:show'); }); }; var keyboardHideEvent = function () { - $timeout(function () { + $rootScope.$evalAsync(function () { $rootScope.$broadcast('$cordovaKeyboard:hide'); }); }; @@ -4118,6 +4087,10 @@ angular.module('ngCordova.plugins.keyboard', []) return cordova.plugins.Keyboard.close(); }, + show: function () { + return cordova.plugins.Keyboard.show(); + }, + disableScroll: function (bool) { return cordova.plugins.Keyboard.disableScroll(bool); }, @@ -4143,15 +4116,12 @@ angular.module('ngCordova.plugins.keyboard', []) angular.module('ngCordova.plugins.keychain', []) - .factory('$cordovaKeychain', ['$q', '$window', function ($q, $window) { - - if ('Keychain' in $window) { - var kc = new Keychain(); - } + .factory('$cordovaKeychain', ['$q', function ($q) { return { getForKey: function (key, serviceName) { - var defer = $q.defer(); + var defer = $q.defer(), + kc = new Keychain(); kc.getForKey(defer.resolve, defer.reject, key, serviceName); @@ -4159,7 +4129,8 @@ angular.module('ngCordova.plugins.keychain', []) }, setForKey: function (key, serviceName, value) { - var defer = $q.defer(); + var defer = $q.defer(), + kc = new Keychain(); kc.setForKey(defer.resolve, defer.reject, key, serviceName, value); @@ -4167,7 +4138,8 @@ angular.module('ngCordova.plugins.keychain', []) }, removeForKey: function (key, serviceName) { - var defer = $q.defer(); + var defer = $q.defer(), + kc = new Keychain(); kc.removeForKey(defer.resolve, defer.reject, key, serviceName); @@ -4176,91 +4148,191 @@ angular.module('ngCordova.plugins.keychain', []) }; }]); -// install : cordova plugin add de.appplant.cordova.plugin.local-notification -// link : https://github.com/katzer/cordova-plugin-local-notifications/ +// install : cordova plugin add https://github.com/katzer/cordova-plugin-local-notifications.git +// link : https://github.com/katzer/cordova-plugin-local-notifications angular.module('ngCordova.plugins.localNotification', []) .factory('$cordovaLocalNotification', ['$q', '$window', '$rootScope', '$timeout', function ($q, $window, $rootScope, $timeout) { - document.addEventListener("deviceready", function () { - if ($window.plugin && $window.plugin.notification) { - $window.plugin.notification.local.on("cancel", function (id, state, json) { - var notification = { - id: id, - state: state, - json: json - }; + document.addEventListener('deviceready', function () { + if ($window.cordova && + $window.cordova.plugins && + $window.cordova.plugins.notification && + $window.cordova.plugins.notification.local) { + // ----- "Scheduling" events + + // A local notification was scheduled + $window.cordova.plugins.notification.local.on('schedule', function (notification, state) { $timeout(function () { - $rootScope.$broadcast("$cordovaLocalNotification:canceled", notification); + $rootScope.$broadcast('$cordovaLocalNotification:schedule', notification, state); }); }); - $window.plugin.notification.local.on("click", function (id, state, json) { - var notification = { - id: id, - state: state, - json: json - }; + // A local notification was triggered + $window.cordova.plugins.notification.local.on('trigger', function (notification, state) { $timeout(function () { - $rootScope.$broadcast("$cordovaLocalNotification:clicked", notification); + $rootScope.$broadcast('$cordovaLocalNotification:trigger', notification, state); }); }); - $window.plugin.notification.local.on("trigger", function (id, state, json) { - var notification = { - id: id, - state: state, - json: json - }; + // ----- "Update" events + + // A local notification was updated + $window.cordova.plugins.notification.local.on('update', function (notification, state) { $timeout(function () { - $rootScope.$broadcast("$cordovaLocalNotification:triggered", notification); + $rootScope.$broadcast('$cordovaLocalNotification:update', notification, state); }); }); - $window.plugin.notification.local.on("add", function (id, state, json) { - var notification = { - id: id, - state: state, - json: json - }; + // ----- "Clear" events + + // A local notification was cleared from the notification center + $window.cordova.plugins.notification.local.on('clear', function (notification, state) { $timeout(function () { - $rootScope.$broadcast("$cordovaLocalNotification:added", notification); + $rootScope.$broadcast('$cordovaLocalNotification:clear', notification, state); }); }); - } - }, false); - return { - add: function (options, scope) { - var q = $q.defer(); - scope = scope || null; - $window.plugin.notification.local.add(options, function (result) { - q.resolve(result); - }, scope); - return q.promise; - }, - - cancel: function (id, scope) { - var q = $q.defer(); - scope = scope || null; - $window.plugin.notification.local.cancel(id, function (result) { - q.resolve(result); - }, scope); - return q.promise; - }, + + // All local notifications were cleared from the notification center + $window.cordova.plugins.notification.local.on('clearall', function (state) { + $timeout(function () { + $rootScope.$broadcast('$cordovaLocalNotification:clearall', state); + }); + }); + + // ----- "Cancel" events + + // A local notification was cancelled + $window.cordova.plugins.notification.local.on('cancel', function (notification, state) { + $timeout(function () { + $rootScope.$broadcast('$cordovaLocalNotification:cancel', notification, state); + }); + }); + + // All local notifications were cancelled + $window.cordova.plugins.notification.local.on('cancelall', function (state) { + $timeout(function () { + $rootScope.$broadcast('$cordovaLocalNotification:cancelall', state); + }); + }); + + // ----- Other events + + // A local notification was clicked + $window.cordova.plugins.notification.local.on('click', function (notification, state) { + $timeout(function () { + $rootScope.$broadcast('$cordovaLocalNotification:click', notification, state); + }); + }); + } + }, false); + return { + schedule: function (options, scope) { + var q = $q.defer(); + scope = scope || null; + + $window.cordova.plugins.notification.local.schedule(options, function (result) { + q.resolve(result); + }, scope); + + return q.promise; + }, + + add: function (options, scope) { + console.warn('Deprecated: use "schedule" instead.'); + + var q = $q.defer(); + scope = scope || null; + + $window.cordova.plugins.notification.local.schedule(options, function (result) { + q.resolve(result); + }, scope); + + return q.promise; + }, + + update: function (options, scope) { + var q = $q.defer(); + scope = scope || null; + + $window.cordova.plugins.notification.local.update(options, function (result) { + q.resolve(result); + }, scope); + + return q.promise; + }, + + clear: function (ids, scope) { + var q = $q.defer(); + scope = scope || null; + + $window.cordova.plugins.notification.local.clear(ids, function (result) { + q.resolve(result); + }, scope); + + return q.promise; + }, + + clearAll: function (scope) { + var q = $q.defer(); + scope = scope || null; + + $window.cordova.plugins.notification.local.clearAll(function (result) { + q.resolve(result); + }, scope); + + return q.promise; + }, + + cancel: function (ids, scope) { + var q = $q.defer(); + scope = scope || null; + + $window.cordova.plugins.notification.local.cancel(ids, function (result) { + q.resolve(result); + }, scope); + + return q.promise; + }, cancelAll: function (scope) { var q = $q.defer(); scope = scope || null; - $window.plugin.notification.local.cancelAll(function (result) { + + $window.cordova.plugins.notification.local.cancelAll(function (result) { + q.resolve(result); + }, scope); + + return q.promise; + }, + + isPresent: function (id, scope) { + var q = $q.defer(); + scope = scope || null; + + $window.cordova.plugins.notification.local.isPresent(id, function (result) { q.resolve(result); }, scope); + return q.promise; }, isScheduled: function (id, scope) { var q = $q.defer(); scope = scope || null; - $window.plugin.notification.local.isScheduled(id, function (result) { + + $window.cordova.plugins.notification.local.isScheduled(id, function (result) { + q.resolve(result); + }, scope); + + return q.promise; + }, + + isTriggered: function (id, scope) { + var q = $q.defer(); + scope = scope || null; + + $window.cordova.plugins.notification.local.isTriggered(id, function (result) { q.resolve(result); }, scope); @@ -4269,58 +4341,167 @@ angular.module('ngCordova.plugins.localNotification', []) hasPermission: function (scope) { var q = $q.defer(); - $window.plugin.notification.local.hasPermission(function (result) { - result ? q.resolve(result) : q.reject(result); + scope = scope || null; + + $window.cordova.plugins.notification.local.hasPermission(function (result) { + if (result) { + q.resolve(result); + } else { + q.reject(result); + } }, scope); + return q.promise; }, - promptForPermission: function () { + registerPermission: function (scope) { var q = $q.defer(); - $window.plugin.notification.local.promptForPermission(function (result) { - result ? q.resolve(result) : q.reject(result); - }); + scope = scope || null; + + $window.cordova.plugins.notification.local.registerPermission(function (result) { + if (result) { + q.resolve(result); + } else { + q.reject(result); + } + }, scope); + return q.promise; }, - registerPermission: function () { + promptForPermission: function (scope) { + console.warn('Deprecated: use "registerPermission" instead.'); + var q = $q.defer(); - $window.plugin.notification.local.registerPermission(function (result) { - result ? q.resolve(result) : q.reject(result); - }); + scope = scope || null; + + $window.cordova.plugins.notification.local.registerPermission(function (result) { + if (result) { + q.resolve(result); + } else { + q.reject(result); + } + }, scope); + return q.promise; }, - getScheduledIds: function (scope) { + getAllIds: function (scope) { var q = $q.defer(); - $window.plugin.notification.local.getScheduledIds(function (result) { + scope = scope || null; + + $window.cordova.plugins.notification.local.getAllIds(function (result) { q.resolve(result); }, scope); + return q.promise; }, - isTriggered: function (id, scope) { + getIds: function (scope) { + var q = $q.defer(); + scope = scope || null; + + $window.cordova.plugins.notification.local.getIds(function (result) { + q.resolve(result); + }, scope); + + return q.promise; + }, + + getScheduledIds: function (scope) { var q = $q.defer(); - $window.plugin.notification.local.isTriggered(id, function (result) { + scope = scope || null; + + $window.cordova.plugins.notification.local.getScheduledIds(function (result) { q.resolve(result); }, scope); + return q.promise; }, getTriggeredIds: function (scope) { var q = $q.defer(); - $window.plugin.notification.local.getTriggeredIds(function (result) { + scope = scope || null; + + $window.cordova.plugins.notification.local.getTriggeredIds(function (result) { + q.resolve(result); + }, scope); + + return q.promise; + }, + + get: function (ids, scope) { + var q = $q.defer(); + scope = scope || null; + + $window.cordova.plugins.notification.local.get(ids, function (result) { + q.resolve(result); + }, scope); + + return q.promise; + }, + + getAll: function (scope) { + var q = $q.defer(); + scope = scope || null; + + $window.cordova.plugins.notification.local.getAll(function (result) { + q.resolve(result); + }, scope); + + return q.promise; + }, + + getScheduled: function (ids, scope) { + var q = $q.defer(); + scope = scope || null; + + $window.cordova.plugins.notification.local.getScheduled(ids, function (result) { + q.resolve(result); + }, scope); + + return q.promise; + }, + + getAllScheduled: function (scope) { + var q = $q.defer(); + scope = scope || null; + + $window.cordova.plugins.notification.local.getAllScheduled(function (result) { + q.resolve(result); + }, scope); + + return q.promise; + }, + + getTriggered: function (ids, scope) { + var q = $q.defer(); + scope = scope || null; + + $window.cordova.plugins.notification.local.getTriggered(ids, function (result) { + q.resolve(result); + }, scope); + + return q.promise; + }, + + getAllTriggered: function (scope) { + var q = $q.defer(); + scope = scope || null; + + $window.cordova.plugins.notification.local.getAllTriggered(function (result) { q.resolve(result); }, scope); + return q.promise; }, getDefaults: function () { - return $window.plugin.notification.local.getDefaults(); + return $window.cordova.plugins.notification.local.getDefaults(); }, setDefaults: function (Object) { - $window.plugin.notification.local.setDefaults(Object); + $window.cordova.plugins.notification.local.setDefaults(Object); } }; }]); @@ -4430,7 +4611,7 @@ angular.module('ngCordova.plugins.mMediaAds', []) }; }]); -// install : cordova plugin add org.apache.cordova.media +// install : cordova plugin add cordova-plugin-media // link : https://github.com/apache/cordova-plugin-media angular.module('ngCordova.plugins.media', []) @@ -4877,8 +5058,8 @@ angular.module('ngCordova.plugins.nativeAudio', []) }; }]); -// install : cordova plugin add org.apache.cordova.network-information -// link : https://github.com/apache/cordova-plugin-network-information/blob/master/doc/index.md +// install : cordova plugin add cordova-plugin-network-information +// link : https://github.com/apache/cordova-plugin-network-information angular.module('ngCordova.plugins.network', []) @@ -4968,925 +5149,938 @@ angular.module("ngCordova.plugins.oauth", ["ngCordova.plugins.oauthUtility"]) return { - /* - * Sign into the ADFS service (ADFS 3.0 onwards) - * - * @param string clientId (client registered in ADFS, with redirect_uri configured to: http://localhost/callback) - * @param string adfsServer (url of the ADFS Server) - * @param string relyingPartyId (url of the Relying Party (resource relying on ADFS for authentication) configured in ADFS) - * @return promise - */ - adfs: function(clientId, adfsServer, relyingPartyId) { - var deferred = $q.defer(); - if(window.cordova) { - var cordovaMetadata = cordova.require("cordova/plugin_list").metadata; - if(cordovaMetadata.hasOwnProperty("org.apache.cordova.inappbrowser") === true) { - var browserRef = window.open(adfsServer + '/adfs/oauth2/authorize?response_type=code&client_id=' + clientId +'&redirect_uri=http://localhost/callback&resource=' + relyingPartyId, '_blank', 'location=no'); - - browserRef.addEventListener("loadstart", function(event) { - if((event.url).indexOf('http://localhost/callback') === 0) { - var requestToken = (event.url).split("code=")[1]; - $http.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded'; - $http({method: "post", url: adfsServer + "/adfs/oauth2/token", data: "client_id=" + clientId + "&code=" + requestToken + "&redirect_uri=http://localhost/callback&grant_type=authorization_code" }) - .success(function(data) { - deferred.resolve(data); - }) - .error(function(data, status) { - deferred.reject("Problem authenticating"); - }) - .finally(function() { - setTimeout(function() { - browserRef.close(); - }, 10); - }); - } - }); - browserRef.addEventListener('exit', function(event) { - deferred.reject("The sign in flow was canceled"); - }); - } else { - deferred.reject("Could not find InAppBrowser plugin"); - } - } else { - deferred.reject("Cannot authenticate via a web browser"); - } - return deferred.promise; - }, + /* + * Sign into the ADFS service (ADFS 3.0 onwards) + * + * @param string clientId (client registered in ADFS, with redirect_uri configured to: http://localhost/callback) + * @param string adfsServer (url of the ADFS Server) + * @param string relyingPartyId (url of the Relying Party (resource relying on ADFS for authentication) configured in ADFS) + * @return promise + */ + adfs: function (clientId, adfsServer, relyingPartyId) { + var deferred = $q.defer(); + if (window.cordova) { + var cordovaMetadata = cordova.require("cordova/plugin_list").metadata; + if (cordovaMetadata.hasOwnProperty("org.apache.cordova.inappbrowser") === true) { + var browserRef = window.open(adfsServer + '/adfs/oauth2/authorize?response_type=code&client_id=' + clientId + '&redirect_uri=http://localhost/callback&resource=' + relyingPartyId, '_blank', 'location=no'); + + browserRef.addEventListener("loadstart", function (event) { + if ((event.url).indexOf('http://localhost/callback') === 0) { + var requestToken = (event.url).split("code=")[1]; + $http.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded'; + $http({method: "post", url: adfsServer + "/adfs/oauth2/token", data: "client_id=" + clientId + "&code=" + requestToken + "&redirect_uri=http://localhost/callback&grant_type=authorization_code"}) + .success(function (data) { + deferred.resolve(data); + }) + .error(function (data, status) { + deferred.reject("Problem authenticating"); + }) + .finally(function () { + setTimeout(function () { + browserRef.close(); + }, 10); + }); + } + }); + browserRef.addEventListener('exit', function (event) { + deferred.reject("The sign in flow was canceled"); + }); + } else { + deferred.reject("Could not find InAppBrowser plugin"); + } + } else { + deferred.reject("Cannot authenticate via a web browser"); + } + return deferred.promise; + }, - /* - * Sign into the Dropbox service - * - * @param string appKey - * @return promise - */ - dropbox: function(appKey) { - var deferred = $q.defer(); - if(window.cordova) { - var cordovaMetadata = cordova.require("cordova/plugin_list").metadata; - if(cordovaMetadata.hasOwnProperty("org.apache.cordova.inappbrowser") === true) { - var browserRef = window.open("https://www.dropbox.com/1/oauth2/authorize?client_id=" + appKey + "&redirect_uri=http://localhost/callback" + "&response_type=token", "_blank", "location=no,clearsessioncache=yes,clearcache=yes"); - browserRef.addEventListener("loadstart", function(event) { - if((event.url).indexOf("http://localhost/callback") === 0) { - var callbackResponse = (event.url).split("#")[1]; - var responseParameters = (callbackResponse).split("&"); - var parameterMap = []; - for(var i = 0; i < responseParameters.length; i++) { - parameterMap[responseParameters[i].split("=")[0]] = responseParameters[i].split("=")[1]; - } - if(parameterMap.access_token !== undefined && parameterMap.access_token !== null) { - deferred.resolve({ access_token: parameterMap.access_token, token_type: parameterMap.token_type, uid: parameterMap.uid }); - } else { - deferred.reject("Problem authenticating"); - } - setTimeout(function() { - browserRef.close(); - }, 10); - } - }); - browserRef.addEventListener('exit', function(event) { - deferred.reject("The sign in flow was canceled"); - }); + /* + * Sign into the Dropbox service + * + * @param string appKey + * @return promise + */ + dropbox: function (appKey) { + var deferred = $q.defer(); + if (window.cordova) { + var cordovaMetadata = cordova.require("cordova/plugin_list").metadata; + if (cordovaMetadata.hasOwnProperty("org.apache.cordova.inappbrowser") === true) { + var browserRef = window.open("https://www.dropbox.com/1/oauth2/authorize?client_id=" + appKey + "&redirect_uri=http://localhost/callback" + "&response_type=token", "_blank", "location=no,clearsessioncache=yes,clearcache=yes"); + browserRef.addEventListener("loadstart", function (event) { + if ((event.url).indexOf("http://localhost/callback") === 0) { + var callbackResponse = (event.url).split("#")[1]; + var responseParameters = (callbackResponse).split("&"); + var parameterMap = []; + for (var i = 0; i < responseParameters.length; i++) { + parameterMap[responseParameters[i].split("=")[0]] = responseParameters[i].split("=")[1]; + } + if (parameterMap.access_token !== undefined && parameterMap.access_token !== null) { + deferred.resolve({access_token: parameterMap.access_token, token_type: parameterMap.token_type, uid: parameterMap.uid}); } else { - deferred.reject("Could not find InAppBrowser plugin"); + deferred.reject("Problem authenticating"); } - } else { - deferred.reject("Cannot authenticate via a web browser"); - } - return deferred.promise; - }, + setTimeout(function () { + browserRef.close(); + }, 10); + } + }); + browserRef.addEventListener('exit', function (event) { + deferred.reject("The sign in flow was canceled"); + }); + } else { + deferred.reject("Could not find InAppBrowser plugin"); + } + } else { + deferred.reject("Cannot authenticate via a web browser"); + } + return deferred.promise; + }, - /* - * Sign into the Digital Ocean service - * - * @param string clientId - * @param string clientSecret - * @return promise - */ - digitalOcean: function(clientId, clientSecret) { - var deferred = $q.defer(); - if(window.cordova) { - var cordovaMetadata = cordova.require("cordova/plugin_list").metadata; - if(cordovaMetadata.hasOwnProperty("org.apache.cordova.inappbrowser") === true) { - var browserRef = window.open("https://cloud.digitalocean.com/v1/oauth/authorize?client_id=" + clientId + "&redirect_uri=http://localhost/callback&response_type=code&scope=read%20write", "_blank", "location=no,clearsessioncache=yes,clearcache=yes"); - browserRef.addEventListener("loadstart", function(event) { - if((event.url).indexOf("http://localhost/callback") === 0) { - var requestToken = (event.url).split("code=")[1]; - $http.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded'; - $http({method: "post", url: "https://cloud.digitalocean.com/v1/oauth/token", data: "client_id=" + clientId + "&client_secret=" + clientSecret + "&redirect_uri=http://localhost/callback" + "&grant_type=authorization_code" + "&code=" + requestToken }) - .success(function(data) { - deferred.resolve(data); - }) - .error(function(data, status) { - deferred.reject("Problem authenticating"); - }) - .finally(function() { - setTimeout(function() { - browserRef.close(); - }, 10); - }); - } - }); - browserRef.addEventListener('exit', function(event) { - deferred.reject("The sign in flow was canceled"); - }); + /* + * Sign into the Digital Ocean service + * + * @param string clientId + * @param string clientSecret + * @return promise + */ + digitalOcean: function (clientId, clientSecret) { + var deferred = $q.defer(); + if (window.cordova) { + var cordovaMetadata = cordova.require("cordova/plugin_list").metadata; + if (cordovaMetadata.hasOwnProperty("org.apache.cordova.inappbrowser") === true) { + var browserRef = window.open("https://cloud.digitalocean.com/v1/oauth/authorize?client_id=" + clientId + "&redirect_uri=http://localhost/callback&response_type=code&scope=read%20write", "_blank", "location=no,clearsessioncache=yes,clearcache=yes"); + browserRef.addEventListener("loadstart", function (event) { + if ((event.url).indexOf("http://localhost/callback") === 0) { + var requestToken = (event.url).split("code=")[1]; + $http.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded'; + $http({ + method: "post", + url: "https://cloud.digitalocean.com/v1/oauth/token", + data: "client_id=" + clientId + "&client_secret=" + clientSecret + "&redirect_uri=http://localhost/callback" + "&grant_type=authorization_code" + "&code=" + requestToken + }) + .success(function (data) { + deferred.resolve(data); + }) + .error(function (data, status) { + deferred.reject("Problem authenticating"); + }) + .finally(function () { + setTimeout(function () { + browserRef.close(); + }, 10); + }); + } + }); + browserRef.addEventListener('exit', function (event) { + deferred.reject("The sign in flow was canceled"); + }); + } else { + deferred.reject("Could not find InAppBrowser plugin"); + } + } else { + deferred.reject("Cannot authenticate via a web browser"); + } + return deferred.promise; + }, + + /* + * Sign into the Google service + * + * @param string clientId + * @param array appScope + * @return promise + */ + google: function (clientId, appScope) { + var deferred = $q.defer(); + if (window.cordova) { + var cordovaMetadata = cordova.require("cordova/plugin_list").metadata; + if (cordovaMetadata.hasOwnProperty("org.apache.cordova.inappbrowser") === true) { + var browserRef = window.open('https://accounts.google.com/o/oauth2/auth?client_id=' + clientId + '&redirect_uri=http://localhost/callback&scope=' + appScope.join(" ") + '&approval_prompt=force&response_type=token', '_blank', 'location=no,clearsessioncache=yes,clearcache=yes'); + browserRef.addEventListener("loadstart", function (event) { + if ((event.url).indexOf("http://localhost/callback") === 0) { + var callbackResponse = (event.url).split("#")[1]; + var responseParameters = (callbackResponse).split("&"); + var parameterMap = []; + for (var i = 0; i < responseParameters.length; i++) { + parameterMap[responseParameters[i].split("=")[0]] = responseParameters[i].split("=")[1]; + } + if (parameterMap.access_token !== undefined && parameterMap.access_token !== null) { + deferred.resolve({access_token: parameterMap.access_token, token_type: parameterMap.token_type, expires_in: parameterMap.expires_in}); } else { - deferred.reject("Could not find InAppBrowser plugin"); + deferred.reject("Problem authenticating"); } - } else { - deferred.reject("Cannot authenticate via a web browser"); - } - return deferred.promise; - }, - - /* - * Sign into the Google service - * - * @param string clientId - * @param array appScope - * @return promise - */ - google: function(clientId, appScope) { - var deferred = $q.defer(); - if(window.cordova) { - var cordovaMetadata = cordova.require("cordova/plugin_list").metadata; - if(cordovaMetadata.hasOwnProperty("org.apache.cordova.inappbrowser") === true) { - var browserRef = window.open('https://accounts.google.com/o/oauth2/auth?client_id=' + clientId + '&redirect_uri=http://localhost/callback&scope=' + appScope.join(" ") + '&approval_prompt=force&response_type=token', '_blank', 'location=no,clearsessioncache=yes,clearcache=yes'); - browserRef.addEventListener("loadstart", function(event) { - if((event.url).indexOf("http://localhost/callback") === 0) { - var callbackResponse = (event.url).split("#")[1]; - var responseParameters = (callbackResponse).split("&"); - var parameterMap = []; - for(var i = 0; i < responseParameters.length; i++) { - parameterMap[responseParameters[i].split("=")[0]] = responseParameters[i].split("=")[1]; - } - if(parameterMap.access_token !== undefined && parameterMap.access_token !== null) { - deferred.resolve({ access_token: parameterMap.access_token, token_type: parameterMap.token_type, expires_in: parameterMap.expires_in }); - } else { - deferred.reject("Problem authenticating"); - } - setTimeout(function() { - browserRef.close(); - }, 10); - } - }); - browserRef.addEventListener('exit', function(event) { - deferred.reject("The sign in flow was canceled"); - }); - } else { - deferred.reject("Could not find InAppBrowser plugin"); - } - } else { - deferred.reject("Cannot authenticate via a web browser"); - } - return deferred.promise; - }, + setTimeout(function () { + browserRef.close(); + }, 10); + } + }); + browserRef.addEventListener('exit', function (event) { + deferred.reject("The sign in flow was canceled"); + }); + } else { + deferred.reject("Could not find InAppBrowser plugin"); + } + } else { + deferred.reject("Cannot authenticate via a web browser"); + } + return deferred.promise; + }, - /* - * Sign into the GitHub service - * - * @param string clientId - * @param string clientSecret - * @param array appScope - * @return promise - */ - github: function(clientId, clientSecret, appScope) { - var deferred = $q.defer(); - if(window.cordova) { - var cordovaMetadata = cordova.require("cordova/plugin_list").metadata; - if(cordovaMetadata.hasOwnProperty("org.apache.cordova.inappbrowser") === true) { - var browserRef = window.open('https://github.com/login/oauth/authorize?client_id=' + clientId + '&redirect_uri=http://localhost/callback&scope=' + appScope.join(","), '_blank', 'location=no,clearsessioncache=yes,clearcache=yes'); - browserRef.addEventListener('loadstart', function(event) { - if((event.url).indexOf("http://localhost/callback") === 0) { - requestToken = (event.url).split("code=")[1]; - $http.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded'; - $http.defaults.headers.post.accept = 'application/json'; - $http({method: "post", url: "https://github.com/login/oauth/access_token", data: "client_id=" + clientId + "&client_secret=" + clientSecret + "&redirect_uri=http://localhost/callback" + "&code=" + requestToken }) - .success(function(data) { - deferred.resolve(data); - }) - .error(function(data, status) { - deferred.reject("Problem authenticating"); - }) - .finally(function() { - setTimeout(function() { - browserRef.close(); - }, 10); - }); - } - }); - browserRef.addEventListener('exit', function(event) { - deferred.reject("The sign in flow was canceled"); - }); - } else { - deferred.reject("Could not find InAppBrowser plugin"); - } - } else { - deferred.reject("Cannot authenticate via a web browser"); - } - return deferred.promise; - }, + /* + * Sign into the GitHub service + * + * @param string clientId + * @param string clientSecret + * @param array appScope + * @return promise + */ + github: function (clientId, clientSecret, appScope) { + var deferred = $q.defer(); + if (window.cordova) { + var cordovaMetadata = cordova.require("cordova/plugin_list").metadata; + if (cordovaMetadata.hasOwnProperty("org.apache.cordova.inappbrowser") === true) { + var browserRef = window.open('https://github.com/login/oauth/authorize?client_id=' + clientId + '&redirect_uri=http://localhost/callback&scope=' + appScope.join(","), '_blank', 'location=no,clearsessioncache=yes,clearcache=yes'); + browserRef.addEventListener('loadstart', function (event) { + if ((event.url).indexOf("http://localhost/callback") === 0) { + requestToken = (event.url).split("code=")[1]; + $http.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded'; + $http.defaults.headers.post.accept = 'application/json'; + $http({method: "post", url: "https://github.com/login/oauth/access_token", data: "client_id=" + clientId + "&client_secret=" + clientSecret + "&redirect_uri=http://localhost/callback" + "&code=" + requestToken}) + .success(function (data) { + deferred.resolve(data); + }) + .error(function (data, status) { + deferred.reject("Problem authenticating"); + }) + .finally(function () { + setTimeout(function () { + browserRef.close(); + }, 10); + }); + } + }); + browserRef.addEventListener('exit', function (event) { + deferred.reject("The sign in flow was canceled"); + }); + } else { + deferred.reject("Could not find InAppBrowser plugin"); + } + } else { + deferred.reject("Cannot authenticate via a web browser"); + } + return deferred.promise; + }, - /* - * Sign into the Facebook service - * - * @param string clientId - * @param array appScope - * @return promise - */ - facebook: function(clientId, appScope) { - var deferred = $q.defer(); - if(window.cordova) { - var cordovaMetadata = cordova.require("cordova/plugin_list").metadata; - if(cordovaMetadata.hasOwnProperty("org.apache.cordova.inappbrowser") === true) { - var browserRef = window.open('https://www.facebook.com/dialog/oauth?client_id=' + clientId + '&redirect_uri=http://localhost/callback&response_type=token&scope=' + appScope.join(","), '_blank', 'location=no,clearsessioncache=yes,clearcache=yes'); - browserRef.addEventListener('loadstart', function(event) { - if((event.url).indexOf("http://localhost/callback") === 0) { - var callbackResponse = (event.url).split("#")[1]; - var responseParameters = (callbackResponse).split("&"); - var parameterMap = []; - for(var i = 0; i < responseParameters.length; i++) { - parameterMap[responseParameters[i].split("=")[0]] = responseParameters[i].split("=")[1]; - } - if(parameterMap.access_token !== undefined && parameterMap.access_token !== null) { - deferred.resolve({ access_token: parameterMap.access_token, expires_in: parameterMap.expires_in }); - } else { - deferred.reject("Problem authenticating"); - } - setTimeout(function() { - browserRef.close(); - }, 10); - } - }); - browserRef.addEventListener('exit', function(event) { - deferred.reject("The sign in flow was canceled"); - }); - } else { - deferred.reject("Could not find InAppBrowser plugin"); + /* + * Sign into the Facebook service + * + * @param string clientId + * @param array appScope + * @return promise + */ + facebook: function (clientId, appScope) { + var deferred = $q.defer(); + if (window.cordova) { + var cordovaMetadata = cordova.require("cordova/plugin_list").metadata; + if (cordovaMetadata.hasOwnProperty("org.apache.cordova.inappbrowser") === true) { + var browserRef = window.open('https://www.facebook.com/dialog/oauth?client_id=' + clientId + '&redirect_uri=http://localhost/callback&response_type=token&scope=' + appScope.join(","), '_blank', 'location=no,clearsessioncache=yes,clearcache=yes'); + browserRef.addEventListener('loadstart', function (event) { + if ((event.url).indexOf("http://localhost/callback") === 0) { + var callbackResponse = (event.url).split("#")[1]; + var responseParameters = (callbackResponse).split("&"); + var parameterMap = []; + for (var i = 0; i < responseParameters.length; i++) { + parameterMap[responseParameters[i].split("=")[0]] = responseParameters[i].split("=")[1]; } - } else { - deferred.reject("Cannot authenticate via a web browser"); - } - return deferred.promise; - }, - - /* - * Sign into the LinkedIn service - * - * @param string clientId - * @param string clientSecret - * @param array appScope - * @param string state - * @return promise - */ - linkedin: function(clientId, clientSecret, appScope, state) { - var deferred = $q.defer(); - if(window.cordova) { - var cordovaMetadata = cordova.require("cordova/plugin_list").metadata; - if(cordovaMetadata.hasOwnProperty("org.apache.cordova.inappbrowser") === true) { - var browserRef = window.open('https://www.linkedin.com/uas/oauth2/authorization?client_id=' + clientId + '&redirect_uri=http://localhost/callback&scope=' + appScope.join(" ") + '&response_type=code&state=' + state, '_blank', 'location=no,clearsessioncache=yes,clearcache=yes'); - browserRef.addEventListener('loadstart', function(event) { - if((event.url).indexOf("http://localhost/callback") === 0) { - requestToken = (event.url).split("code=")[1]; - $http.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded'; - $http({method: "post", url: "https://www.linkedin.com/uas/oauth2/accessToken", data: "client_id=" + clientId + "&client_secret=" + clientSecret + "&redirect_uri=http://localhost/callback" + "&grant_type=authorization_code" + "&code=" + requestToken }) - .success(function(data) { - deferred.resolve(data); - }) - .error(function(data, status) { - deferred.reject("Problem authenticating"); - }) - .finally(function() { - setTimeout(function() { - browserRef.close(); - }, 10); - }); - } - }); - browserRef.addEventListener('exit', function(event) { - deferred.reject("The sign in flow was canceled"); - }); + if (parameterMap.access_token !== undefined && parameterMap.access_token !== null) { + deferred.resolve({access_token: parameterMap.access_token, expires_in: parameterMap.expires_in}); } else { - deferred.reject("Could not find InAppBrowser plugin"); + deferred.reject("Problem authenticating"); } - } else { - deferred.reject("Cannot authenticate via a web browser"); - } - return deferred.promise; - }, + setTimeout(function () { + browserRef.close(); + }, 10); + } + }); + browserRef.addEventListener('exit', function (event) { + deferred.reject("The sign in flow was canceled"); + }); + } else { + deferred.reject("Could not find InAppBrowser plugin"); + } + } else { + deferred.reject("Cannot authenticate via a web browser"); + } + return deferred.promise; + }, - /* - * Sign into the Instagram service - * - * @param string clientId - * @param array appScope - * @return promise - */ - instagram: function(clientId, appScope) { - var deferred = $q.defer(); - if(window.cordova) { - var cordovaMetadata = cordova.require("cordova/plugin_list").metadata; - if(cordovaMetadata.hasOwnProperty("org.apache.cordova.inappbrowser") === true) { - var browserRef = window.open('https://api.instagram.com/oauth/authorize/?client_id=' + clientId + '&redirect_uri=http://localhost/callback&scope=' + appScope.join(" ") + '&response_type=token', '_blank', 'location=no,clearsessioncache=yes,clearcache=yes'); - browserRef.addEventListener('loadstart', function(event) { - if((event.url).indexOf("http://localhost/callback") === 0) { - var callbackResponse = (event.url).split("#")[1]; - var responseParameters = (callbackResponse).split("&"); - var parameterMap = []; - for(var i = 0; i < responseParameters.length; i++) { - parameterMap[responseParameters[i].split("=")[0]] = responseParameters[i].split("=")[1]; - } - if(parameterMap.access_token !== undefined && parameterMap.access_token !== null) { - deferred.resolve({ access_token: parameterMap.access_token }); - } else { - deferred.reject("Problem authenticating"); - } - setTimeout(function() { - browserRef.close(); - }, 10); - } - }); - browserRef.addEventListener('exit', function(event) { - deferred.reject("The sign in flow was canceled"); - }); - } else { - deferred.reject("Could not find InAppBrowser plugin"); - } - } else { - deferred.reject("Cannot authenticate via a web browser"); - } - return deferred.promise; - }, + /* + * Sign into the LinkedIn service + * + * @param string clientId + * @param string clientSecret + * @param array appScope + * @param string state + * @return promise + */ + linkedin: function (clientId, clientSecret, appScope, state) { + var deferred = $q.defer(); + if (window.cordova) { + var cordovaMetadata = cordova.require("cordova/plugin_list").metadata; + if (cordovaMetadata.hasOwnProperty("org.apache.cordova.inappbrowser") === true) { + var browserRef = window.open('https://www.linkedin.com/uas/oauth2/authorization?client_id=' + clientId + '&redirect_uri=http://localhost/callback&scope=' + appScope.join(" ") + '&response_type=code&state=' + state, '_blank', 'location=no,clearsessioncache=yes,clearcache=yes'); + browserRef.addEventListener('loadstart', function (event) { + if ((event.url).indexOf("http://localhost/callback") === 0) { + requestToken = (event.url).split("code=")[1]; + $http.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded'; + $http({ + method: "post", + url: "https://www.linkedin.com/uas/oauth2/accessToken", + data: "client_id=" + clientId + "&client_secret=" + clientSecret + "&redirect_uri=http://localhost/callback" + "&grant_type=authorization_code" + "&code=" + requestToken + }) + .success(function (data) { + deferred.resolve(data); + }) + .error(function (data, status) { + deferred.reject("Problem authenticating"); + }) + .finally(function () { + setTimeout(function () { + browserRef.close(); + }, 10); + }); + } + }); + browserRef.addEventListener('exit', function (event) { + deferred.reject("The sign in flow was canceled"); + }); + } else { + deferred.reject("Could not find InAppBrowser plugin"); + } + } else { + deferred.reject("Cannot authenticate via a web browser"); + } + return deferred.promise; + }, - /* - * Sign into the Box service - * - * @param string clientId - * @param string clientSecret - * @param string appState - * @return promise - */ - box: function(clientId, clientSecret, appState) { - var deferred = $q.defer(); - if(window.cordova) { - var cordovaMetadata = cordova.require("cordova/plugin_list").metadata; - if(cordovaMetadata.hasOwnProperty("org.apache.cordova.inappbrowser") === true) { - var browserRef = window.open('https://app.box.com/api/oauth2/authorize/?client_id=' + clientId + '&redirect_uri=http://localhost/callback&state=' + appState + '&response_type=code', '_blank', 'location=no,clearsessioncache=yes,clearcache=yes'); - browserRef.addEventListener('loadstart', function(event) { - if((event.url).indexOf("http://localhost/callback") === 0) { - requestToken = (event.url).split("code=")[1]; - $http.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded'; - $http({method: "post", url: "https://app.box.com/api/oauth2/token", data: "client_id=" + clientId + "&client_secret=" + clientSecret + "&redirect_uri=http://localhost/callback" + "&grant_type=authorization_code" + "&code=" + requestToken }) - .success(function(data) { - deferred.resolve(data); - }) - .error(function(data, status) { - deferred.reject("Problem authenticating"); - }) - .finally(function() { - setTimeout(function() { - browserRef.close(); - }, 10); - }); - } - }); - browserRef.addEventListener('exit', function(event) { - deferred.reject("The sign in flow was canceled"); - }); - } else { - deferred.reject("Could not find InAppBrowser plugin"); + /* + * Sign into the Instagram service + * + * @param string clientId + * @param array appScope + * @return promise + */ + instagram: function (clientId, appScope) { + var deferred = $q.defer(); + if (window.cordova) { + var cordovaMetadata = cordova.require("cordova/plugin_list").metadata; + if (cordovaMetadata.hasOwnProperty("org.apache.cordova.inappbrowser") === true) { + var browserRef = window.open('https://api.instagram.com/oauth/authorize/?client_id=' + clientId + '&redirect_uri=http://localhost/callback&scope=' + appScope.join(" ") + '&response_type=token', '_blank', 'location=no,clearsessioncache=yes,clearcache=yes'); + browserRef.addEventListener('loadstart', function (event) { + if ((event.url).indexOf("http://localhost/callback") === 0) { + var callbackResponse = (event.url).split("#")[1]; + var responseParameters = (callbackResponse).split("&"); + var parameterMap = []; + for (var i = 0; i < responseParameters.length; i++) { + parameterMap[responseParameters[i].split("=")[0]] = responseParameters[i].split("=")[1]; } - } else { - deferred.reject("Cannot authenticate via a web browser"); - } - return deferred.promise; - }, - - /* - * Sign into the Reddit service - * - * @param string clientId - * @param string clientSecret - * @param array appScope - * @return promise - */ - reddit: function(clientId, clientSecret, appScope) { - var deferred = $q.defer(); - if(window.cordova) { - var cordovaMetadata = cordova.require("cordova/plugin_list").metadata; - if(cordovaMetadata.hasOwnProperty("org.apache.cordova.inappbrowser") === true) { - var browserRef = window.open('https://ssl.reddit.com/api/v1/authorize?client_id=' + clientId + '&redirect_uri=http://localhost/callback&duration=permanent&state=ngcordovaoauth&scope=' + appScope.join(",") + '&response_type=code', '_blank', 'location=no,clearsessioncache=yes,clearcache=yes'); - browserRef.addEventListener('loadstart', function(event) { - if((event.url).indexOf("http://localhost/callback") === 0) { - requestToken = (event.url).split("code=")[1]; - $http.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded'; - $http.defaults.headers.post.Authorization = 'Basic ' + btoa(clientId + ":" + clientSecret); - $http({method: "post", url: "https://ssl.reddit.com/api/v1/access_token", data: "redirect_uri=http://localhost/callback" + "&grant_type=authorization_code" + "&code=" + requestToken }) - .success(function(data) { - deferred.resolve(data); - }) - .error(function(data, status) { - deferred.reject("Problem authenticating"); - }) - .finally(function() { - setTimeout(function() { - browserRef.close(); - }, 10); - }); - } - }); - browserRef.addEventListener('exit', function(event) { - deferred.reject("The sign in flow was canceled"); - }); + if (parameterMap.access_token !== undefined && parameterMap.access_token !== null) { + deferred.resolve({access_token: parameterMap.access_token}); } else { - deferred.reject("Could not find InAppBrowser plugin"); + deferred.reject("Problem authenticating"); } - } else { - deferred.reject("Cannot authenticate via a web browser"); - } - return deferred.promise; - }, + setTimeout(function () { + browserRef.close(); + }, 10); + } + }); + browserRef.addEventListener('exit', function (event) { + deferred.reject("The sign in flow was canceled"); + }); + } else { + deferred.reject("Could not find InAppBrowser plugin"); + } + } else { + deferred.reject("Cannot authenticate via a web browser"); + } + return deferred.promise; + }, - /* - * Sign into the Twitter service - * Note that this service requires jsSHA for generating HMAC-SHA1 Oauth 1.0 signatures - * - * @param string clientId - * @param string clientSecret - * @return promise - */ - twitter: function(clientId, clientSecret) { - var deferred = $q.defer(); - if(window.cordova) { - var cordovaMetadata = cordova.require("cordova/plugin_list").metadata; - if(cordovaMetadata.hasOwnProperty("org.apache.cordova.inappbrowser") === true) { - if(typeof jsSHA !== "undefined") { - var oauthObject = { - oauth_consumer_key: clientId, - oauth_nonce: $cordovaOauthUtility.createNonce(10), - oauth_signature_method: "HMAC-SHA1", - oauth_timestamp: Math.round((new Date()).getTime() / 1000.0), - oauth_version: "1.0" - }; - var signatureObj = $cordovaOauthUtility.createSignature("POST", "https://api.twitter.com/oauth/request_token", oauthObject, { oauth_callback: "http://localhost/callback" }, clientSecret); - $http({ - method: "post", - url: "https://api.twitter.com/oauth/request_token", - headers: { - "Authorization": signatureObj.authorization_header, - "Content-Type": "application/x-www-form-urlencoded" - }, - data: "oauth_callback=" + encodeURIComponent("http://localhost/callback") + /* + * Sign into the Box service + * + * @param string clientId + * @param string clientSecret + * @param string appState + * @return promise + */ + box: function (clientId, clientSecret, appState) { + var deferred = $q.defer(); + if (window.cordova) { + var cordovaMetadata = cordova.require("cordova/plugin_list").metadata; + if (cordovaMetadata.hasOwnProperty("org.apache.cordova.inappbrowser") === true) { + var browserRef = window.open('https://app.box.com/api/oauth2/authorize/?client_id=' + clientId + '&redirect_uri=http://localhost/callback&state=' + appState + '&response_type=code', '_blank', 'location=no,clearsessioncache=yes,clearcache=yes'); + browserRef.addEventListener('loadstart', function (event) { + if ((event.url).indexOf("http://localhost/callback") === 0) { + requestToken = (event.url).split("code=")[1]; + $http.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded'; + $http({ + method: "post", + url: "https://app.box.com/api/oauth2/token", + data: "client_id=" + clientId + "&client_secret=" + clientSecret + "&redirect_uri=http://localhost/callback" + "&grant_type=authorization_code" + "&code=" + requestToken + }) + .success(function (data) { + deferred.resolve(data); + }) + .error(function (data, status) { + deferred.reject("Problem authenticating"); + }) + .finally(function () { + setTimeout(function () { + browserRef.close(); + }, 10); + }); + } + }); + browserRef.addEventListener('exit', function (event) { + deferred.reject("The sign in flow was canceled"); + }); + } else { + deferred.reject("Could not find InAppBrowser plugin"); + } + } else { + deferred.reject("Cannot authenticate via a web browser"); + } + return deferred.promise; + }, + + /* + * Sign into the Reddit service + * + * @param string clientId + * @param string clientSecret + * @param array appScope + * @return promise + */ + reddit: function (clientId, clientSecret, appScope) { + var deferred = $q.defer(); + if (window.cordova) { + var cordovaMetadata = cordova.require("cordova/plugin_list").metadata; + if (cordovaMetadata.hasOwnProperty("org.apache.cordova.inappbrowser") === true) { + var browserRef = window.open('https://ssl.reddit.com/api/v1/authorize?client_id=' + clientId + '&redirect_uri=http://localhost/callback&duration=permanent&state=ngcordovaoauth&scope=' + appScope.join(",") + '&response_type=code', '_blank', 'location=no,clearsessioncache=yes,clearcache=yes'); + browserRef.addEventListener('loadstart', function (event) { + if ((event.url).indexOf("http://localhost/callback") === 0) { + requestToken = (event.url).split("code=")[1]; + $http.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded'; + $http.defaults.headers.post.Authorization = 'Basic ' + btoa(clientId + ":" + clientSecret); + $http({method: "post", url: "https://ssl.reddit.com/api/v1/access_token", data: "redirect_uri=http://localhost/callback" + "&grant_type=authorization_code" + "&code=" + requestToken}) + .success(function (data) { + deferred.resolve(data); + }) + .error(function (data, status) { + deferred.reject("Problem authenticating"); + }) + .finally(function () { + setTimeout(function () { + browserRef.close(); + }, 10); + }); + } + }); + browserRef.addEventListener('exit', function (event) { + deferred.reject("The sign in flow was canceled"); + }); + } else { + deferred.reject("Could not find InAppBrowser plugin"); + } + } else { + deferred.reject("Cannot authenticate via a web browser"); + } + return deferred.promise; + }, + + /* + * Sign into the Twitter service + * Note that this service requires jsSHA for generating HMAC-SHA1 Oauth 1.0 signatures + * + * @param string clientId + * @param string clientSecret + * @return promise + */ + twitter: function (clientId, clientSecret) { + var deferred = $q.defer(); + if (window.cordova) { + var cordovaMetadata = cordova.require("cordova/plugin_list").metadata; + if (cordovaMetadata.hasOwnProperty("org.apache.cordova.inappbrowser") === true) { + if (typeof jsSHA !== "undefined") { + var oauthObject = { + oauth_consumer_key: clientId, + oauth_nonce: $cordovaOauthUtility.createNonce(10), + oauth_signature_method: "HMAC-SHA1", + oauth_timestamp: Math.round((new Date()).getTime() / 1000.0), + oauth_version: "1.0" + }; + var signatureObj = $cordovaOauthUtility.createSignature("POST", "https://api.twitter.com/oauth/request_token", oauthObject, {oauth_callback: "http://localhost/callback"}, clientSecret); + $http({ + method: "post", + url: "https://api.twitter.com/oauth/request_token", + headers: { + "Authorization": signatureObj.authorization_header, + "Content-Type": "application/x-www-form-urlencoded" + }, + data: "oauth_callback=" + encodeURIComponent("http://localhost/callback") + }) + .success(function (requestTokenResult) { + var requestTokenParameters = (requestTokenResult).split("&"); + var parameterMap = {}; + for (var i = 0; i < requestTokenParameters.length; i++) { + parameterMap[requestTokenParameters[i].split("=")[0]] = requestTokenParameters[i].split("=")[1]; + } + if (parameterMap.hasOwnProperty("oauth_token") === false) { + deferred.reject("Oauth request token was not received"); + } + var browserRef = window.open('https://api.twitter.com/oauth/authenticate?oauth_token=' + parameterMap.oauth_token, '_blank', 'location=no,clearsessioncache=yes,clearcache=yes'); + browserRef.addEventListener('loadstart', function (event) { + if ((event.url).indexOf("http://localhost/callback") === 0) { + var callbackResponse = (event.url).split("?")[1]; + var responseParameters = (callbackResponse).split("&"); + var parameterMap = {}; + for (var i = 0; i < responseParameters.length; i++) { + parameterMap[responseParameters[i].split("=")[0]] = responseParameters[i].split("=")[1]; + } + if (parameterMap.hasOwnProperty("oauth_verifier") === false) { + deferred.reject("Browser authentication failed to complete. No oauth_verifier was returned"); + } + delete oauthObject.oauth_signature; + oauthObject.oauth_token = parameterMap.oauth_token; + var signatureObj = $cordovaOauthUtility.createSignature("POST", "https://api.twitter.com/oauth/access_token", oauthObject, {oauth_verifier: parameterMap.oauth_verifier}, clientSecret); + $http({ + method: "post", + url: "https://api.twitter.com/oauth/access_token", + headers: { + "Authorization": signatureObj.authorization_header + }, + params: { + "oauth_verifier": parameterMap.oauth_verifier + } + }) + .success(function (result) { + var accessTokenParameters = result.split("&"); + var parameterMap = {}; + for (var i = 0; i < accessTokenParameters.length; i++) { + parameterMap[accessTokenParameters[i].split("=")[0]] = accessTokenParameters[i].split("=")[1]; + } + if (parameterMap.hasOwnProperty("oauth_token_secret") === false) { + deferred.reject("Oauth access token was not received"); + } + deferred.resolve(parameterMap); }) - .success(function(requestTokenResult) { - var requestTokenParameters = (requestTokenResult).split("&"); - var parameterMap = {}; - for(var i = 0; i < requestTokenParameters.length; i++) { - parameterMap[requestTokenParameters[i].split("=")[0]] = requestTokenParameters[i].split("=")[1]; - } - if(parameterMap.hasOwnProperty("oauth_token") === false) { - deferred.reject("Oauth request token was not received"); - } - var browserRef = window.open('https://api.twitter.com/oauth/authenticate?oauth_token=' + parameterMap.oauth_token, '_blank', 'location=no,clearsessioncache=yes,clearcache=yes'); - browserRef.addEventListener('loadstart', function(event) { - if((event.url).indexOf("http://localhost/callback") === 0) { - var callbackResponse = (event.url).split("?")[1]; - var responseParameters = (callbackResponse).split("&"); - var parameterMap = {}; - for(var i = 0; i < responseParameters.length; i++) { - parameterMap[responseParameters[i].split("=")[0]] = responseParameters[i].split("=")[1]; - } - if(parameterMap.hasOwnProperty("oauth_verifier") === false) { - deferred.reject("Browser authentication failed to complete. No oauth_verifier was returned"); - } - delete oauthObject.oauth_signature; - oauthObject.oauth_token = parameterMap.oauth_token; - var signatureObj = $cordovaOauthUtility.createSignature("POST", "https://api.twitter.com/oauth/access_token", oauthObject, { oauth_verifier: parameterMap.oauth_verifier }, clientSecret); - $http({ - method: "post", - url: "https://api.twitter.com/oauth/access_token", - headers: { - "Authorization": signatureObj.authorization_header - }, - params: { - "oauth_verifier": parameterMap.oauth_verifier - } - }) - .success(function(result) { - var accessTokenParameters = result.split("&"); - var parameterMap = {}; - for(var i = 0; i < accessTokenParameters.length; i++) { - parameterMap[accessTokenParameters[i].split("=")[0]] = accessTokenParameters[i].split("=")[1]; - } - if(parameterMap.hasOwnProperty("oauth_token_secret") === false) { - deferred.reject("Oauth access token was not received"); - } - deferred.resolve(parameterMap); - }) - .error(function(error) { - deferred.reject(error); - }) - .finally(function() { - setTimeout(function() { - browserRef.close(); - }, 10); - }); - } - }); - browserRef.addEventListener('exit', function(event) { - deferred.reject("The sign in flow was canceled"); - }); - }) - .error(function(error) { - deferred.reject(error); - }); - } else { - deferred.reject("Missing jsSHA JavaScript library"); + .error(function (error) { + deferred.reject(error); + }) + .finally(function () { + setTimeout(function () { + browserRef.close(); + }, 10); + }); } - } else { - deferred.reject("Could not find InAppBrowser plugin"); - } + }); + browserRef.addEventListener('exit', function (event) { + deferred.reject("The sign in flow was canceled"); + }); + }) + .error(function (error) { + deferred.reject(error); + }); } else { - deferred.reject("Cannot authenticate via a web browser"); + deferred.reject("Missing jsSHA JavaScript library"); } - return deferred.promise; - }, + } else { + deferred.reject("Could not find InAppBrowser plugin"); + } + } else { + deferred.reject("Cannot authenticate via a web browser"); + } + return deferred.promise; + }, - /* - * Sign into the Meetup service - * - * @param string clientId - * @return promise - */ - meetup: function(clientId) { - var deferred = $q.defer(); - if(window.cordova) { - var cordovaMetadata = cordova.require("cordova/plugin_list").metadata; - if(cordovaMetadata.hasOwnProperty("org.apache.cordova.inappbrowser") === true) { - var browserRef = window.open('https://secure.meetup.com/oauth2/authorize/?client_id=' + clientId + '&redirect_uri=http://localhost/callback&response_type=token', '_blank', 'location=no,clearsessioncache=yes,clearcache=yes'); - browserRef.addEventListener('loadstart', function(event) { - if((event.url).indexOf("http://localhost/callback") === 0) { - var callbackResponse = (event.url).split("#")[1]; - var responseParameters = (callbackResponse).split("&"); - var parameterMap = {}; - for(var i = 0; i < responseParameters.length; i++) { - parameterMap[responseParameters[i].split("=")[0]] = responseParameters[i].split("=")[1]; - } - if(parameterMap.access_token !== undefined && parameterMap.access_token !== null) { - deferred.resolve(parameterMap); - } else { - deferred.reject("Problem authenticating"); - } - setTimeout(function() { - browserRef.close(); - }, 10); - } - }); - browserRef.addEventListener('exit', function(event) { - deferred.reject("The sign in flow was canceled"); - }); - } else { - deferred.reject("Could not find InAppBrowser plugin"); + /* + * Sign into the Meetup service + * + * @param string clientId + * @return promise + */ + meetup: function (clientId) { + var deferred = $q.defer(); + if (window.cordova) { + var cordovaMetadata = cordova.require("cordova/plugin_list").metadata; + if (cordovaMetadata.hasOwnProperty("org.apache.cordova.inappbrowser") === true) { + var browserRef = window.open('https://secure.meetup.com/oauth2/authorize/?client_id=' + clientId + '&redirect_uri=http://localhost/callback&response_type=token', '_blank', 'location=no,clearsessioncache=yes,clearcache=yes'); + browserRef.addEventListener('loadstart', function (event) { + if ((event.url).indexOf("http://localhost/callback") === 0) { + var callbackResponse = (event.url).split("#")[1]; + var responseParameters = (callbackResponse).split("&"); + var parameterMap = {}; + for (var i = 0; i < responseParameters.length; i++) { + parameterMap[responseParameters[i].split("=")[0]] = responseParameters[i].split("=")[1]; } - } else { - deferred.reject("Cannot authenticate via a web browser"); - } - return deferred.promise; - }, - - /* - * Sign into the Salesforce service - * - * Suggestion: use salesforce oauth with forcetk.js(as SDK) - * - * @param string loginUrl (such as: https://login.salesforce.com ; please notice community login) - * @param string clientId (copy from connection app info) - * @param string redirectUri (callback url in connection app info) - * @return promise - */ - salesforce: function (loginUrl, clientId) { - var redirectUri = 'http://localhost/callback'; - var getAuthorizeUrl = function (loginUrl, clientId, redirectUri) { - return loginUrl+'services/oauth2/authorize?display=touch'+ - '&response_type=token&client_id='+escape(clientId)+ - '&redirect_uri='+escape(redirectUri); - }; - var startWith = function(string, str) { - return (string.substr(0, str.length) === str); - }; - var deferred = $q.defer(); - if(window.cordova) { - var cordovaMetadata = cordova.require("cordova/plugin_list").metadata; - if(cordovaMetadata.hasOwnProperty("org.apache.cordova.inappbrowser") === true) { - var browserRef = window.open(getAuthorizeUrl(loginUrl, clientId, redirectUri), "_blank", "location=no,clearsessioncache=yes,clearcache=yes"); - browserRef.addEventListener("loadstart", function(event) { - if(startWith(event.url, redirectUri)) { - var oauthResponse = {}; - - var fragment = (event.url).split('#')[1]; - - if (fragment) { - var nvps = fragment.split('&'); - for (var nvp in nvps) { - var parts = nvps[nvp].split('='); - oauthResponse[parts[0]] = unescape(parts[1]); - } - } - - if (typeof oauthResponse === 'undefined' || - typeof oauthResponse.access_token === 'undefined') { - deferred.reject("Problem authenticating"); - } else { - deferred.resolve(oauthResponse); - } - setTimeout(function() { - browserRef.close(); - }, 10); - } - }); - browserRef.addEventListener('exit', function(event) { - deferred.reject("The sign in flow was canceled"); - }); - } else { - deferred.reject("Could not find InAppBrowser plugin"); - } + if (parameterMap.access_token !== undefined && parameterMap.access_token !== null) { + deferred.resolve(parameterMap); } else { - deferred.reject("Cannot authenticate via a web browser"); + deferred.reject("Problem authenticating"); } - return deferred.promise; - }, + setTimeout(function () { + browserRef.close(); + }, 10); + } + }); + browserRef.addEventListener('exit', function (event) { + deferred.reject("The sign in flow was canceled"); + }); + } else { + deferred.reject("Could not find InAppBrowser plugin"); + } + } else { + deferred.reject("Cannot authenticate via a web browser"); + } + return deferred.promise; + }, - /* - * Sign into the Strava service - * - * @param string clientId - * @param string clientSecret - * @param array appScope - * @return promise - */ - strava: function(clientId, clientSecret, appScope) { - var deferred = $q.defer(); - if(window.cordova) { - var cordovaMetadata = cordova.require("cordova/plugin_list").metadata; - if(cordovaMetadata.hasOwnProperty("org.apache.cordova.inappbrowser") === true) { - var browserRef = window.open('https://www.strava.com/oauth/authorize?client_id=' + clientId + '&redirect_uri=http://localhost/callback&scope=' + appScope.join(",") + '&response_type=code&approval_prompt=force', '_blank', 'location=no,clearsessioncache=yes,clearcache=yes'); - browserRef.addEventListener('loadstart', function(event) { - if((event.url).indexOf("http://localhost/callback") === 0) { - requestToken = (event.url).split("code=")[1]; - $http.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded'; - $http({method: "post", url: "https://www.strava.com/oauth/token", data: "client_id=" + clientId + "&client_secret=" + clientSecret + "&code=" + requestToken }) - .success(function(data) { - deferred.resolve(data); - }) - .error(function(data, status) { - deferred.reject("Problem authenticating"); - }) - .finally(function() { - setTimeout(function() { - browserRef.close(); - }, 10); - }); - } - }); - browserRef.addEventListener('exit', function(event) { - deferred.reject("The sign in flow was canceled"); - }); - } else { - deferred.reject("Could not find InAppBrowser plugin"); - } - } else { - deferred.reject("Cannot authenticate via a web browser"); + /* + * Sign into the Salesforce service + * + * Suggestion: use salesforce oauth with forcetk.js(as SDK) + * + * @param string loginUrl (such as: https://login.salesforce.com ; please notice community login) + * @param string clientId (copy from connection app info) + * @param string redirectUri (callback url in connection app info) + * @return promise + */ + salesforce: function (loginUrl, clientId) { + var redirectUri = 'http://localhost/callback'; + var getAuthorizeUrl = function (loginUrl, clientId, redirectUri) { + return loginUrl + 'services/oauth2/authorize?display=touch' + + '&response_type=token&client_id=' + escape(clientId) + + '&redirect_uri=' + escape(redirectUri); + }; + var startWith = function (string, str) { + return (string.substr(0, str.length) === str); + }; + var deferred = $q.defer(); + if (window.cordova) { + var cordovaMetadata = cordova.require("cordova/plugin_list").metadata; + if (cordovaMetadata.hasOwnProperty("org.apache.cordova.inappbrowser") === true) { + var browserRef = window.open(getAuthorizeUrl(loginUrl, clientId, redirectUri), "_blank", "location=no,clearsessioncache=yes,clearcache=yes"); + browserRef.addEventListener("loadstart", function (event) { + if (startWith(event.url, redirectUri)) { + var oauthResponse = {}; + + var fragment = (event.url).split('#')[1]; + + if (fragment) { + var nvps = fragment.split('&'); + for (var nvp in nvps) { + var parts = nvps[nvp].split('='); + oauthResponse[parts[0]] = unescape(parts[1]); + } } - return deferred.promise; - }, - /* - * Sign into the Foursquare service - * - * @param string clientId - * @return promise - */ - foursquare: function(clientId) { - var deferred = $q.defer(); - if (window.cordova) { - var cordovaMetadata = cordova.require("cordova/plugin_list").metadata; - if (cordovaMetadata.hasOwnProperty("org.apache.cordova.inappbrowser") === true) { - var browserRef = window.open('https://foursquare.com/oauth2/authenticate?client_id=' + clientId + '&redirect_uri=http://localhost/callback&response_type=token', '_blank', 'location=no,clearsessioncache=yes,clearcache=yes'); - browserRef.addEventListener('loadstart', function (event) { - if ((event.url).indexOf("http://localhost/callback") === 0) { - var callbackResponse = (event.url).split("#")[1]; - var responseParameters = (callbackResponse).split("&"); - var parameterMap = []; - for (var i = 0; i < responseParameters.length; i++) { - parameterMap[responseParameters[i].split("=")[0]] = responseParameters[i].split("=")[1]; - } - if (parameterMap.access_token !== undefined && parameterMap.access_token !== null) { - var promiseResponse = { - access_token: parameterMap.access_token, - expires_in: parameterMap.expires_in - }; - deferred.resolve(promiseResponse); - } else { - deferred.reject("Problem authenticating"); - } - setTimeout(function() { - browserRef.close(); - }, 10); - } - }); - browserRef.addEventListener('exit', function(event) { - deferred.reject("The sign in flow was canceled"); - }); - } else { - deferred.reject("Could not find InAppBrowser plugin"); - } + if (typeof oauthResponse === 'undefined' || + typeof oauthResponse.access_token === 'undefined') { + deferred.reject("Problem authenticating"); } else { - deferred.reject("Cannot authenticate via a web browser"); + deferred.resolve(oauthResponse); } - return deferred.promise; - }, + setTimeout(function () { + browserRef.close(); + }, 10); + } + }); + browserRef.addEventListener('exit', function (event) { + deferred.reject("The sign in flow was canceled"); + }); + } else { + deferred.reject("Could not find InAppBrowser plugin"); + } + } else { + deferred.reject("Cannot authenticate via a web browser"); + } + return deferred.promise; + }, - /* - * Sign into the Magento service - * Note that this service requires jsSHA for generating HMAC-SHA1 Oauth 1.0 signatures - * - * @param string baseUrl - * @param string clientId - * @param string clientSecret - * @return promise - */ - magento: function(baseUrl, clientId, clientSecret) { - var deferred = $q.defer(); - if(window.cordova) { - var cordovaMetadata = cordova.require("cordova/plugin_list").metadata; - if(cordovaMetadata.hasOwnProperty("org.apache.cordova.inappbrowser") === true) { - if(typeof jsSHA !== "undefined") { - var oauthObject = { - oauth_callback: "http://localhost/callback", - oauth_consumer_key: clientId, - oauth_nonce: $cordovaOauthUtility.createNonce(5), - oauth_signature_method: "HMAC-SHA1", - oauth_timestamp: Math.round((new Date()).getTime() / 1000.0), - oauth_version: "1.0" - }; - var signatureObj = $cordovaOauthUtility.createSignature("POST", baseUrl + "/oauth/initiate", oauthObject, { oauth_callback: "http://localhost/callback" }, clientSecret); - $http.defaults.headers.post.Authorization = signatureObj.authorization_header; - $http.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded'; - $http({method: "post", url: baseUrl + "/oauth/initiate", data: "oauth_callback=http://localhost/callback" }) - .success(function(requestTokenResult) { - var requestTokenParameters = (requestTokenResult).split("&"); - var parameterMap = {}; - for(var i = 0; i < requestTokenParameters.length; i++) { - parameterMap[requestTokenParameters[i].split("=")[0]] = requestTokenParameters[i].split("=")[1]; - } - if(parameterMap.hasOwnProperty("oauth_token") === false) { - deferred.reject("Oauth request token was not received"); - } - var tokenSecret = parameterMap.oauth_token_secret; - var browserRef = window.open(baseUrl + '/oauth/authorize?oauth_token=' + parameterMap.oauth_token, '_blank', 'location=no,clearsessioncache=yes,clearcache=yes'); - browserRef.addEventListener('loadstart', function(event) { - if((event.url).indexOf("http://localhost/callback") === 0) { - var callbackResponse = (event.url).split("?")[1]; - var responseParameters = (callbackResponse).split("&"); - var parameterMap = {}; - for(var i = 0; i < responseParameters.length; i++) { - parameterMap[responseParameters[i].split("=")[0]] = responseParameters[i].split("=")[1]; - } - if(parameterMap.hasOwnProperty("oauth_verifier") === false) { - deferred.reject("Browser authentication failed to complete. No oauth_verifier was returned"); - } - delete oauthObject.oauth_signature; - delete oauthObject.oauth_callback; - oauthObject.oauth_token = parameterMap.oauth_token; - oauthObject.oauth_nonce = $cordovaOauthUtility.createNonce(5); - oauthObject.oauth_verifier = parameterMap.oauth_verifier; - var signatureObj = $cordovaOauthUtility.createSignature("POST", baseUrl + "/oauth/token", oauthObject, {}, clientSecret, tokenSecret); - $http.defaults.headers.post.Authorization = signatureObj.authorization_header; - $http.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded'; - $http({method: "post", url: baseUrl + "/oauth/token" }) - .success(function(result) { - var accessTokenParameters = result.split("&"); - var parameterMap = {}; - for(var i = 0; i < accessTokenParameters.length; i++) { - parameterMap[accessTokenParameters[i].split("=")[0]] = accessTokenParameters[i].split("=")[1]; - } - if(parameterMap.hasOwnProperty("oauth_token_secret") === false) { - deferred.reject("Oauth access token was not received"); - } - deferred.resolve(parameterMap); - }) - .error(function(error) { - deferred.reject(error); - }) - .finally(function() { - setTimeout(function() { - browserRef.close(); - }, 10); - }); - } - }); - browserRef.addEventListener('exit', function(event) { - deferred.reject("The sign in flow was canceled"); - }); - }) - .error(function(error) { - deferred.reject(error); - }); - } else { - deferred.reject("Missing jsSHA JavaScript library"); - } - } else { - deferred.reject("Could not find InAppBrowser plugin"); - } + /* + * Sign into the Strava service + * + * @param string clientId + * @param string clientSecret + * @param array appScope + * @return promise + */ + strava: function (clientId, clientSecret, appScope) { + var deferred = $q.defer(); + if (window.cordova) { + var cordovaMetadata = cordova.require("cordova/plugin_list").metadata; + if (cordovaMetadata.hasOwnProperty("org.apache.cordova.inappbrowser") === true) { + var browserRef = window.open('https://www.strava.com/oauth/authorize?client_id=' + clientId + '&redirect_uri=http://localhost/callback&scope=' + appScope.join(",") + '&response_type=code&approval_prompt=force', '_blank', 'location=no,clearsessioncache=yes,clearcache=yes'); + browserRef.addEventListener('loadstart', function (event) { + if ((event.url).indexOf("http://localhost/callback") === 0) { + requestToken = (event.url).split("code=")[1]; + $http.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded'; + $http({method: "post", url: "https://www.strava.com/oauth/token", data: "client_id=" + clientId + "&client_secret=" + clientSecret + "&code=" + requestToken}) + .success(function (data) { + deferred.resolve(data); + }) + .error(function (data, status) { + deferred.reject("Problem authenticating"); + }) + .finally(function () { + setTimeout(function () { + browserRef.close(); + }, 10); + }); + } + }); + browserRef.addEventListener('exit', function (event) { + deferred.reject("The sign in flow was canceled"); + }); + } else { + deferred.reject("Could not find InAppBrowser plugin"); + } + } else { + deferred.reject("Cannot authenticate via a web browser"); + } + return deferred.promise; + }, + + /* + * Sign into the Foursquare service + * + * @param string clientId + * @return promise + */ + foursquare: function (clientId) { + var deferred = $q.defer(); + if (window.cordova) { + var cordovaMetadata = cordova.require("cordova/plugin_list").metadata; + if (cordovaMetadata.hasOwnProperty("org.apache.cordova.inappbrowser") === true) { + var browserRef = window.open('https://foursquare.com/oauth2/authenticate?client_id=' + clientId + '&redirect_uri=http://localhost/callback&response_type=token', '_blank', 'location=no,clearsessioncache=yes,clearcache=yes'); + browserRef.addEventListener('loadstart', function (event) { + if ((event.url).indexOf("http://localhost/callback") === 0) { + var callbackResponse = (event.url).split("#")[1]; + var responseParameters = (callbackResponse).split("&"); + var parameterMap = []; + for (var i = 0; i < responseParameters.length; i++) { + parameterMap[responseParameters[i].split("=")[0]] = responseParameters[i].split("=")[1]; + } + if (parameterMap.access_token !== undefined && parameterMap.access_token !== null) { + var promiseResponse = { + access_token: parameterMap.access_token, + expires_in: parameterMap.expires_in + }; + deferred.resolve(promiseResponse); } else { - deferred.reject("Cannot authenticate via a web browser"); + deferred.reject("Problem authenticating"); } - return deferred.promise; - }, + setTimeout(function () { + browserRef.close(); + }, 10); + } + }); + browserRef.addEventListener('exit', function (event) { + deferred.reject("The sign in flow was canceled"); + }); + } else { + deferred.reject("Could not find InAppBrowser plugin"); + } + } else { + deferred.reject("Cannot authenticate via a web browser"); + } + return deferred.promise; + }, - /* - * Sign into the Vkontakte service - * - * @param string clientId - * @param array appScope (for example: "friends,wall,photos,messages") - * @return promise - */ - vkontakte: function(clientId, appScope) { - var deferred = $q.defer(); - if(window.cordova) { - var cordovaMetadata = cordova.require("cordova/plugin_list").metadata; - if(cordovaMetadata.hasOwnProperty("org.apache.cordova.inappbrowser") === true) { - var browserRef = window.open('https://oauth.vk.com/authorize?client_id=' + clientId + '&redirect_uri=http://oauth.vk.com/blank.html&response_type=token&scope=' + appScope.join(",") + '&display=touch&response_type=token', '_blank', 'location=no,clearsessioncache=yes,clearcache=yes'); - browserRef.addEventListener('loadstart', function(event) { - var tmp = (event.url).split("#"); - if (tmp[0] == 'https://oauth.vk.com/blank.html' || tmp[0] == 'http://oauth.vk.com/blank.html') { - var callbackResponse = (event.url).split("#")[1]; - var responseParameters = (callbackResponse).split("&"); - var parameterMap = []; - for(var i = 0; i < responseParameters.length; i++) { - parameterMap[responseParameters[i].split("=")[0]] = responseParameters[i].split("=")[1]; - } - if(parameterMap.access_token !== undefined && parameterMap.access_token !== null) { - deferred.resolve({ access_token: parameterMap.access_token, expires_in: parameterMap.expires_in, user_id: parameterMap.user_id }); - } else { - deferred.reject("Problem authenticating"); - } - setTimeout(function() { - browserRef.close(); - }, 10); - } - }); - browserRef.addEventListener('exit', function(event) { - deferred.reject("The sign in flow was canceled"); + /* + * Sign into the Magento service + * Note that this service requires jsSHA for generating HMAC-SHA1 Oauth 1.0 signatures + * + * @param string baseUrl + * @param string clientId + * @param string clientSecret + * @return promise + */ + magento: function (baseUrl, clientId, clientSecret) { + var deferred = $q.defer(); + if (window.cordova) { + var cordovaMetadata = cordova.require("cordova/plugin_list").metadata; + if (cordovaMetadata.hasOwnProperty("org.apache.cordova.inappbrowser") === true) { + if (typeof jsSHA !== "undefined") { + var oauthObject = { + oauth_callback: "http://localhost/callback", + oauth_consumer_key: clientId, + oauth_nonce: $cordovaOauthUtility.createNonce(5), + oauth_signature_method: "HMAC-SHA1", + oauth_timestamp: Math.round((new Date()).getTime() / 1000.0), + oauth_version: "1.0" + }; + var signatureObj = $cordovaOauthUtility.createSignature("POST", baseUrl + "/oauth/initiate", oauthObject, {oauth_callback: "http://localhost/callback"}, clientSecret); + $http.defaults.headers.post.Authorization = signatureObj.authorization_header; + $http.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded'; + $http({method: "post", url: baseUrl + "/oauth/initiate", data: "oauth_callback=http://localhost/callback"}) + .success(function (requestTokenResult) { + var requestTokenParameters = (requestTokenResult).split("&"); + var parameterMap = {}; + for (var i = 0; i < requestTokenParameters.length; i++) { + parameterMap[requestTokenParameters[i].split("=")[0]] = requestTokenParameters[i].split("=")[1]; + } + if (parameterMap.hasOwnProperty("oauth_token") === false) { + deferred.reject("Oauth request token was not received"); + } + var tokenSecret = parameterMap.oauth_token_secret; + var browserRef = window.open(baseUrl + '/oauth/authorize?oauth_token=' + parameterMap.oauth_token, '_blank', 'location=no,clearsessioncache=yes,clearcache=yes'); + browserRef.addEventListener('loadstart', function (event) { + if ((event.url).indexOf("http://localhost/callback") === 0) { + var callbackResponse = (event.url).split("?")[1]; + var responseParameters = (callbackResponse).split("&"); + var parameterMap = {}; + for (var i = 0; i < responseParameters.length; i++) { + parameterMap[responseParameters[i].split("=")[0]] = responseParameters[i].split("=")[1]; + } + if (parameterMap.hasOwnProperty("oauth_verifier") === false) { + deferred.reject("Browser authentication failed to complete. No oauth_verifier was returned"); + } + delete oauthObject.oauth_signature; + delete oauthObject.oauth_callback; + oauthObject.oauth_token = parameterMap.oauth_token; + oauthObject.oauth_nonce = $cordovaOauthUtility.createNonce(5); + oauthObject.oauth_verifier = parameterMap.oauth_verifier; + var signatureObj = $cordovaOauthUtility.createSignature("POST", baseUrl + "/oauth/token", oauthObject, {}, clientSecret, tokenSecret); + $http.defaults.headers.post.Authorization = signatureObj.authorization_header; + $http.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded'; + $http({method: "post", url: baseUrl + "/oauth/token"}) + .success(function (result) { + var accessTokenParameters = result.split("&"); + var parameterMap = {}; + for (var i = 0; i < accessTokenParameters.length; i++) { + parameterMap[accessTokenParameters[i].split("=")[0]] = accessTokenParameters[i].split("=")[1]; + } + if (parameterMap.hasOwnProperty("oauth_token_secret") === false) { + deferred.reject("Oauth access token was not received"); + } + deferred.resolve(parameterMap); + }) + .error(function (error) { + deferred.reject(error); + }) + .finally(function () { + setTimeout(function () { + browserRef.close(); + }, 10); }); - } else { - deferred.reject("Could not find InAppBrowser plugin"); } + }); + browserRef.addEventListener('exit', function (event) { + deferred.reject("The sign in flow was canceled"); + }); + }) + .error(function (error) { + deferred.reject(error); + }); + } else { + deferred.reject("Missing jsSHA JavaScript library"); + } + } else { + deferred.reject("Could not find InAppBrowser plugin"); + } + } else { + deferred.reject("Cannot authenticate via a web browser"); + } + return deferred.promise; + }, + + /* + * Sign into the Vkontakte service + * + * @param string clientId + * @param array appScope (for example: "friends,wall,photos,messages") + * @return promise + */ + vkontakte: function (clientId, appScope) { + var deferred = $q.defer(); + if (window.cordova) { + var cordovaMetadata = cordova.require("cordova/plugin_list").metadata; + if (cordovaMetadata.hasOwnProperty("org.apache.cordova.inappbrowser") === true) { + var browserRef = window.open('https://oauth.vk.com/authorize?client_id=' + clientId + '&redirect_uri=http://oauth.vk.com/blank.html&response_type=token&scope=' + appScope.join(",") + '&display=touch&response_type=token', '_blank', 'location=no,clearsessioncache=yes,clearcache=yes'); + browserRef.addEventListener('loadstart', function (event) { + var tmp = (event.url).split("#"); + if (tmp[0] == 'https://oauth.vk.com/blank.html' || tmp[0] == 'http://oauth.vk.com/blank.html') { + var callbackResponse = (event.url).split("#")[1]; + var responseParameters = (callbackResponse).split("&"); + var parameterMap = []; + for (var i = 0; i < responseParameters.length; i++) { + parameterMap[responseParameters[i].split("=")[0]] = responseParameters[i].split("=")[1]; + } + if (parameterMap.access_token !== undefined && parameterMap.access_token !== null) { + deferred.resolve({access_token: parameterMap.access_token, expires_in: parameterMap.expires_in, user_id: parameterMap.user_id}); } else { - deferred.reject("Cannot authenticate via a web browser"); + deferred.reject("Problem authenticating"); } - return deferred.promise; - }, + setTimeout(function () { + browserRef.close(); + }, 10); + } + }); + browserRef.addEventListener('exit', function (event) { + deferred.reject("The sign in flow was canceled"); + }); + } else { + deferred.reject("Could not find InAppBrowser plugin"); + } + } else { + deferred.reject("Cannot authenticate via a web browser"); + } + return deferred.promise; + }, - /* - * Sign into the Imgur service - * - * @param string clientId - * @return promise - */ - imgur: function(clientId) { - var deferred = $q.defer(); - if(window.cordova) { - var cordovaMetadata = cordova.require("cordova/plugin_list").metadata; - if(cordovaMetadata.hasOwnProperty("org.apache.cordova.inappbrowser") === true) { - var browserRef = window.open('https://api.imgur.com/oauth2/authorize?client_id=' + clientId + '&response_type=token', '_blank', 'location=no,clearsessioncache=yes,clearcache=yes'); - browserRef.addEventListener('loadstart', function(event) { - if((event.url).indexOf("http://localhost/callback") === 0) { - browserRef.removeEventListener("exit",function(event){}); - browserRef.close(); - var callbackResponse = (event.url).split("#")[1]; - var responseParameters = (callbackResponse).split("&"); - var parameterMap = []; - for(var i = 0; i < responseParameters.length; i++) { - parameterMap[responseParameters[i].split("=")[0]] = responseParameters[i].split("=")[1]; - } - if(parameterMap.access_token !== undefined && parameterMap.access_token !== null) { - deferred.resolve({ access_token: parameterMap.access_token, expires_in: parameterMap.expires_in, account_username: parameterMap.account_username }); - } else { - deferred.reject("Problem authenticating"); - } - } - }); - browserRef.addEventListener('exit', function(event) { - deferred.reject("The sign in flow was canceled"); - }); - } else { - deferred.reject("Could not find InAppBrowser plugin"); - } + /* + * Sign into the Imgur service + * + * @param string clientId + * @return promise + */ + imgur: function (clientId) { + var deferred = $q.defer(); + if (window.cordova) { + var cordovaMetadata = cordova.require("cordova/plugin_list").metadata; + if (cordovaMetadata.hasOwnProperty("org.apache.cordova.inappbrowser") === true) { + var browserRef = window.open('https://api.imgur.com/oauth2/authorize?client_id=' + clientId + '&response_type=token', '_blank', 'location=no,clearsessioncache=yes,clearcache=yes'); + browserRef.addEventListener('loadstart', function (event) { + if ((event.url).indexOf("http://localhost/callback") === 0) { + browserRef.removeEventListener("exit", function (event) { + }); + browserRef.close(); + var callbackResponse = (event.url).split("#")[1]; + var responseParameters = (callbackResponse).split("&"); + var parameterMap = []; + for (var i = 0; i < responseParameters.length; i++) { + parameterMap[responseParameters[i].split("=")[0]] = responseParameters[i].split("=")[1]; + } + if (parameterMap.access_token !== undefined && parameterMap.access_token !== null) { + deferred.resolve({access_token: parameterMap.access_token, expires_in: parameterMap.expires_in, account_username: parameterMap.account_username}); } else { - deferred.reject("Cannot authenticate via a web browser"); + deferred.reject("Problem authenticating"); } - return deferred.promise; - } + } + }); + browserRef.addEventListener('exit', function (event) { + deferred.reject("The sign in flow was canceled"); + }); + } else { + deferred.reject("Could not find InAppBrowser plugin"); + } + } else { + deferred.reject("Cannot authenticate via a web browser"); + } + return deferred.promise; + } }; }]); @@ -5907,59 +6101,59 @@ angular.module("ngCordova.plugins.oauthUtility", []) * @param string secretKey * @return object */ - createSignature: function(method, endPoint, headerParameters, bodyParameters, secretKey, tokenSecret) { - if(typeof jsSHA !== "undefined") { - var headerAndBodyParameters = angular.copy(headerParameters); - var bodyParameterKeys = Object.keys(bodyParameters); - for(var i = 0; i < bodyParameterKeys.length; i++) { - headerAndBodyParameters[bodyParameterKeys[i]] = encodeURIComponent(bodyParameters[bodyParameterKeys[i]]); - } - var signatureBaseString = method + "&" + encodeURIComponent(endPoint) + "&"; - var headerAndBodyParameterKeys = (Object.keys(headerAndBodyParameters)).sort(); - for(i = 0; i < headerAndBodyParameterKeys.length; i++) { - if(i == headerAndBodyParameterKeys.length - 1) { - signatureBaseString += encodeURIComponent(headerAndBodyParameterKeys[i] + "=" + headerAndBodyParameters[headerAndBodyParameterKeys[i]]); - } else { - signatureBaseString += encodeURIComponent(headerAndBodyParameterKeys[i] + "=" + headerAndBodyParameters[headerAndBodyParameterKeys[i]] + "&"); - } - } - var oauthSignatureObject = new jsSHA(signatureBaseString, "TEXT"); - - var encodedTokenSecret = ''; - if (tokenSecret) { - encodedTokenSecret = encodeURIComponent(tokenSecret); - } - - headerParameters.oauth_signature = encodeURIComponent(oauthSignatureObject.getHMAC(encodeURIComponent(secretKey) + "&" + encodedTokenSecret, "TEXT", "SHA-1", "B64")); - var headerParameterKeys = Object.keys(headerParameters); - var authorizationHeader = 'OAuth '; - for(i = 0; i < headerParameterKeys.length; i++) { - if(i == headerParameterKeys.length - 1) { - authorizationHeader += headerParameterKeys[i] + '="' + headerParameters[headerParameterKeys[i]] + '"'; - } else { - authorizationHeader += headerParameterKeys[i] + '="' + headerParameters[headerParameterKeys[i]] + '",'; - } - } - return { signature_base_string: signatureBaseString, authorization_header: authorizationHeader, signature: headerParameters.oauth_signature }; - } else { - return "Missing jsSHA JavaScript library"; - } - }, + createSignature: function (method, endPoint, headerParameters, bodyParameters, secretKey, tokenSecret) { + if (typeof jsSHA !== "undefined") { + var headerAndBodyParameters = angular.copy(headerParameters); + var bodyParameterKeys = Object.keys(bodyParameters); + for (var i = 0; i < bodyParameterKeys.length; i++) { + headerAndBodyParameters[bodyParameterKeys[i]] = encodeURIComponent(bodyParameters[bodyParameterKeys[i]]); + } + var signatureBaseString = method + "&" + encodeURIComponent(endPoint) + "&"; + var headerAndBodyParameterKeys = (Object.keys(headerAndBodyParameters)).sort(); + for (i = 0; i < headerAndBodyParameterKeys.length; i++) { + if (i == headerAndBodyParameterKeys.length - 1) { + signatureBaseString += encodeURIComponent(headerAndBodyParameterKeys[i] + "=" + headerAndBodyParameters[headerAndBodyParameterKeys[i]]); + } else { + signatureBaseString += encodeURIComponent(headerAndBodyParameterKeys[i] + "=" + headerAndBodyParameters[headerAndBodyParameterKeys[i]] + "&"); + } + } + var oauthSignatureObject = new jsSHA(signatureBaseString, "TEXT"); + + var encodedTokenSecret = ''; + if (tokenSecret) { + encodedTokenSecret = encodeURIComponent(tokenSecret); + } + + headerParameters.oauth_signature = encodeURIComponent(oauthSignatureObject.getHMAC(encodeURIComponent(secretKey) + "&" + encodedTokenSecret, "TEXT", "SHA-1", "B64")); + var headerParameterKeys = Object.keys(headerParameters); + var authorizationHeader = 'OAuth '; + for (i = 0; i < headerParameterKeys.length; i++) { + if (i == headerParameterKeys.length - 1) { + authorizationHeader += headerParameterKeys[i] + '="' + headerParameters[headerParameterKeys[i]] + '"'; + } else { + authorizationHeader += headerParameterKeys[i] + '="' + headerParameters[headerParameterKeys[i]] + '",'; + } + } + return {signature_base_string: signatureBaseString, authorization_header: authorizationHeader, signature: headerParameters.oauth_signature}; + } else { + return "Missing jsSHA JavaScript library"; + } + }, - /* - * Create Random String Nonce - * - * @param integer length - * @return string - */ - createNonce: function(length) { + /* + * Create Random String Nonce + * + * @param integer length + * @return string + */ + createNonce: function (length) { var text = ""; var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; - for(var i = 0; i < length; i++) { - text += possible.charAt(Math.floor(Math.random() * possible.length)); + for (var i = 0; i < length; i++) { + text += possible.charAt(Math.floor(Math.random() * possible.length)); } return text; - } + } }; @@ -6020,7 +6214,7 @@ angular.module('ngCordova.plugins.prefs', []) }; }]); -// install : cordova plugin add de.appplant.cordova.plugin.printer +// install : cordova plugin add https://github.com/katzer/cordova-plugin-printer.git // link : https://github.com/katzer/cordova-plugin-printer angular.module('ngCordova.plugins.printer', []) @@ -6048,7 +6242,7 @@ angular.module('ngCordova.plugins.printer', []) }; }]); -// install : cordova plugin add org.pbernasconi.progressindicator +// install : cordova plugin add https://github.com/pbernasconi/cordova-progressIndicator.git // link : http://pbernasconi.github.io/cordova-progressIndicator/ angular.module('ngCordova.plugins.progressIndicator', []) @@ -6056,7 +6250,7 @@ angular.module('ngCordova.plugins.progressIndicator', []) .factory('$cordovaProgress', ['$q', function ($q) { return { - show: function(_message) { + show: function (_message) { var message = _message || "Please wait..."; return ProgressIndicator.show(message); }, @@ -6156,7 +6350,7 @@ angular.module('ngCordova.plugins.push', []) var q = $q.defer(); var injector; if (config !== undefined && config.ecb === undefined) { - if (document.querySelector('[ng-app]') == null) { + if (document.querySelector('[ng-app]') === null) { injector = "document.body"; } else { @@ -6383,8 +6577,8 @@ angular.module('ngCordova.plugins.spinnerDialog', []) }]); -// install : cordova plugin add org.apache.cordova.splashscreen -// link : https://github.com/apache/cordova-plugin-splashscreen/blob/master/doc/index.md +// install : cordova plugin add cordova-plugin-splashscreen +// link : https://github.com/apache/cordova-plugin-splashscreen angular.module('ngCordova.plugins.splashscreen', []) @@ -6402,8 +6596,8 @@ angular.module('ngCordova.plugins.splashscreen', []) }]); -// install : cordova plugin add https://github.com/brodysoft/Cordova-SQLitePlugin.git -// link : https://github.com/brodysoft/Cordova-SQLitePlugin/blob/master/README.md +// install : cordova plugin add https://github.com/litehelpers/Cordova-sqlite-storage.git +// link : https://github.com/litehelpers/Cordova-sqlite-storage angular.module('ngCordova.plugins.sqlite', []) @@ -6493,8 +6687,8 @@ angular.module('ngCordova.plugins.sqlite', []) }; }]); -// install : cordova plugin add org.apache.cordova.statusbar -// link : https://github.com/apache/cordova-plugin-statusbar/ +// install : cordova plugin add cordova-plugin-statusbar +// link : https://github.com/apache/cordova-plugin-statusbar angular.module('ngCordova.plugins.statusbar', []) @@ -6505,6 +6699,13 @@ angular.module('ngCordova.plugins.statusbar', []) return StatusBar.overlaysWebView(!!bool); }, + STYLES: { + DEFAULT: 0, + LIGHT_CONTENT: 1, + BLACK_TRANSLUCENT: 2, + BLACK_OPAQUE: 3 + }, + style: function (style) { switch (style) { // Default @@ -6675,8 +6876,8 @@ angular.module('ngCordova.plugins.touchid', []) }; }]); -// install : cordova plugin add org.apache.cordova.vibration -// link : https://github.com/apache/cordova-plugin-vibration/blob/master/doc/index.md +// install : cordova plugin add cordova-plugin-vibration +// link : https://github.com/apache/cordova-plugin-vibration angular.module('ngCordova.plugins.vibration', []) diff --git a/www/lib/ngCordova/dist/ng-cordova.min.js b/www/lib/ngCordova/dist/ng-cordova.min.js index 9c372655..25fca1f5 100644 --- a/www/lib/ngCordova/dist/ng-cordova.min.js +++ b/www/lib/ngCordova/dist/ng-cordova.min.js @@ -1,9 +1,10 @@ /*! * ngCordova - * v0.1.15-alpha + * v0.1.17-alpha * Copyright 2014 Drifty Co. http://drifty.com/ * See LICENSE in this repository for license information */ -!function(){angular.module("ngCordova",["ngCordova.plugins"]),angular.module("ngCordova.plugins.actionSheet",[]).factory("$cordovaActionSheet",["$q","$window",function(e,n){return{show:function(t){var r=e.defer();return n.plugins.actionsheet.show(t,function(e){r.resolve(e)}),r.promise},hide:function(){return n.plugins.actionsheet.hide()}}}]),angular.module("ngCordova.plugins.adMob",[]).factory("$cordovaAdMob",["$q","$window",function(e,n){return{createBannerView:function(t){var r=e.defer();return n.plugins.AdMob.createBannerView(t,function(){r.resolve()},function(){r.reject()}),r.promise},createInterstitialView:function(t){var r=e.defer();return n.plugins.AdMob.createInterstitialView(t,function(){r.resolve()},function(){r.reject()}),r.promise},requestAd:function(t){var r=e.defer();return n.plugins.AdMob.requestAd(t,function(){r.resolve()},function(){r.reject()}),r.promise},showAd:function(t){var r=e.defer();return n.plugins.AdMob.showAd(t,function(){r.resolve()},function(){r.reject()}),r.promise},requestInterstitialAd:function(t){var r=e.defer();return n.plugins.AdMob.requestInterstitialAd(t,function(){r.resolve()},function(){r.reject()}),r.promise}}}]),angular.module("ngCordova.plugins.appAvailability",[]).factory("$cordovaAppAvailability",["$q",function(e){return{check:function(n){var t=e.defer();return appAvailability.check(n,function(e){t.resolve(e)},function(e){t.reject(e)}),t.promise}}}]),angular.module("ngCordova.plugins.appRate",[]).provider("$cordovaAppRate",[function(){this.setPreferences=function(e){e&&angular.isObject(e)&&(AppRate.preferences.useLanguage=e.language||null,AppRate.preferences.displayAppName=e.appName||"",AppRate.preferences.promptAgainForEachNewVersion=e.promptForNewVersion||!0,AppRate.preferences.openStoreInApp=e.openStoreInApp||!1,AppRate.preferences.usesUntilPrompt=e.usesUntilPrompt||3,AppRate.preferences.useCustomRateDialog=e.useCustomRateDialog||!1,AppRate.preferences.storeAppURL.ios=e.iosURL||null,AppRate.preferences.storeAppURL.android=e.androidURL||null,AppRate.preferences.storeAppURL.blackberry=e.blackberryURL||null,AppRate.preferences.storeAppURL.windows8=e.windowsURL||null)},this.setCustomLocale=function(e){var n={title:"Rate %@",message:"If you enjoy using %@, would you mind taking a moment to rate it? It won’t take more than a minute. Thanks for your support!",cancelButtonLabel:"No, Thanks",laterButtonLabel:"Remind Me Later",rateButtonLabel:"Rate It Now"};n=angular.extend(n,e),AppRate.preferences.customLocale=n},this.$get=["$q",function(e){return{promptForRating:function(n){var t=e.defer(),r=AppRate.promptForRating(n);return t.resolve(r),t.promise},navigateToAppStore:function(){var n=e.defer(),t=AppRate.navigateToAppStore();return n.resolve(t),n.promise},onButtonClicked:function(e){AppRate.onButtonClicked=function(n){e.call(this,n)}},onRateDialogShow:function(e){AppRate.onRateDialogShow=e()}}}]}]),angular.module("ngCordova.plugins.appVersion",[]).factory("$cordovaAppVersion",["$q",function(e){return{getAppVersion:function(){var n=e.defer();return cordova.getAppVersion(function(e){n.resolve(e)}),n.promise}}}]),angular.module("ngCordova.plugins.backgroundGeolocation",[]).factory("$cordovaBackgroundGeolocation",["$q","$window",function(e,n){return{init:function(){n.navigator.geolocation.getCurrentPosition(function(e){return e})},configure:function(t){this.init();var r=e.defer();return n.plugins.backgroundGeoLocation.configure(function(e){r.notify(e),n.plugins.backgroundGeoLocation.finish()},function(e){r.reject(e)},t),this.start(),r.promise},start:function(){var t=e.defer();return n.plugins.backgroundGeoLocation.start(function(e){t.resolve(e)},function(e){t.reject(e)}),t.promise},stop:function(){var t=e.defer();return n.plugins.backgroundGeoLocation.stop(function(e){t.resolve(e)},function(e){t.reject(e)}),t.promise}}}]),angular.module("ngCordova.plugins.badge",[]).factory("$cordovaBadge",["$q",function(e){return{hasPermission:function(){var n=e.defer();return cordova.plugins.notification.badge.hasPermission(function(e){e?n.resolve(!0):n.reject("You do not have permission")}),n.promise},promptForPermission:function(){return cordova.plugins.notification.badge.promptForPermission()},set:function(n){var t=e.defer();return cordova.plugins.notification.badge.hasPermission(function(e){e?t.resolve(cordova.plugins.notification.badge.set(n)):t.reject("You do not have permission to set Badge")}),t.promise},get:function(){var n=e.defer();return cordova.plugins.notification.badge.hasPermission(function(e){e?cordova.plugins.notification.badge.get(function(e){n.resolve(e)}):n.reject("You do not have permission to get Badge")}),n.promise},clear:function(){var n=e.defer();return cordova.plugins.notification.badge.hasPermission(function(e){e?n.resolve(cordova.plugins.notification.badge.clear()):n.reject("You do not have permission to clear Badge")}),n.promise},configure:function(e){return cordova.plugins.notification.badge.configure(e)}}}]),angular.module("ngCordova.plugins.barcodeScanner",[]).factory("$cordovaBarcodeScanner",["$q",function(e){return{scan:function(n){var t=e.defer();return cordova.plugins.barcodeScanner.scan(function(e){t.resolve(e)},function(e){t.reject(e)},n),t.promise},encode:function(n,t){var r=e.defer();return n=n||"TEXT_TYPE",cordova.plugins.barcodeScanner.encode(n,t,function(e){r.resolve(e)},function(e){r.reject(e)}),r.promise}}}]),angular.module("ngCordova.plugins.batteryStatus",[]).factory("$cordovaBatteryStatus",["$rootScope","$window","$timeout",function(e,n,t){var r=function(n){t(function(){e.$broadcast("$cordovaBatteryStatus:status",n)})},o=function(n){t(function(){e.$broadcast("$cordovaBatteryStatus:critical",n)})},i=function(n){t(function(){e.$broadcast("$cordovaBatteryStatus:low",n)})};return document.addEventListener("deviceready",function(){navigator.battery&&(n.addEventListener("batterystatus",r,!1),n.addEventListener("batterycritical",o,!1),n.addEventListener("batterylow",i,!1))},!1),!0}]).run(["$cordovaBatteryStatus",function(){}]),angular.module("ngCordova.plugins.ble",[]).factory("$cordovaBLE",["$q",function(e){return{scan:function(n,t){var r=e.defer();return ble.scan(n,t,function(e){r.resolve(e)},function(e){r.reject(e)}),r.promise},connect:function(n){var t=e.defer();return ble.connect(n,function(e){t.resolve(e)},function(e){t.reject(e)}),t.promise},disconnect:function(n){var t=e.defer();return ble.disconnect(n,function(e){t.resolve(e)},function(e){t.reject(e)}),t.promise},read:function(n,t,r){var o=e.defer();return ble.read(n,t,r,function(e){o.resolve(e)},function(e){o.reject(e)}),o.promise},write:function(n,t,r,o){var i=e.defer();return ble.write(n,t,r,o,function(e){i.resolve(e)},function(e){i.reject(e)}),i.promise},writeCommand:function(n,t,r,o){var i=e.defer();return ble.writeCommand(n,t,r,o,function(e){i.resolve(e)},function(e){i.reject(e)}),i.promise},notify:function(n,t,r){var o=e.defer();return ble.notify(n,t,r,function(e){o.resolve(e)},function(e){o.reject(e)}),o.promise},indicate:function(n,t,r){var o=e.defer();return ble.indicate(n,t,r,function(e){o.resolve(e)},function(e){o.reject(e)}),o.promise},isConnected:function(n){var t=e.defer();return ble.isConnected(n,function(e){t.resolve(e)},function(e){t.reject(e)}),t.promise},isEnabled:function(){var n=e.defer();return ble.isEnabled(function(e){n.resolve(e)},function(e){n.reject(e)}),n.promise}}}]),angular.module("ngCordova.plugins.bluetoothSerial",[]).factory("$cordovaBluetoothSerial",["$q","$window",function(e,n){return{connect:function(t){var r=e.defer();return n.bluetoothSerial.connect(t,function(){r.resolve()},function(e){r.reject(e)}),r.promise},connectInsecure:function(t){var r=e.defer();return n.bluetoothSerial.connectInsecure(t,function(){r.resolve()},function(e){r.reject(e)}),r.promise},disconnect:function(){var t=e.defer();return n.bluetoothSerial.disconnect(function(){t.resolve()},function(e){t.reject(e)}),t.promise},list:function(){var t=e.defer();return n.bluetoothSerial.list(function(e){t.resolve(e)},function(e){t.reject(e)}),t.promise},discoverUnpaired:function(){var t=e.defer();return n.bluetoothSerial.discoverUnpaired(function(e){t.resolve(e)},function(e){t.reject(e)}),t.promise},setDeviceDiscoveredListener:function(){var t=e.defer();return n.bluetoothSerial.setDeviceDiscoveredListener(function(e){t.notify(e)}),t.promise},clearDeviceDiscoveredListener:function(){n.bluetoothSerial.clearDeviceDiscoveredListener()},showBluetoothSettings:function(){var t=e.defer();return n.bluetoothSerial.showBluetoothSettings(function(){t.resolve()},function(e){t.reject(e)}),t.promise},isEnabled:function(){var t=e.defer();return n.bluetoothSerial.isEnabled(function(){t.resolve()},function(){t.reject()}),t.promise},enable:function(){var t=e.defer();return n.bluetoothSerial.enable(function(){t.resolve()},function(){t.reject()}),t.promise},isConnected:function(){var t=e.defer();return n.bluetoothSerial.isConnected(function(){t.resolve()},function(){t.reject()}),t.promise},available:function(){var t=e.defer();return n.bluetoothSerial.available(function(e){t.resolve(e)},function(e){t.reject(e)}),t.promise},read:function(){var t=e.defer();return n.bluetoothSerial.read(function(e){t.resolve(e)},function(e){t.reject(e)}),t.promise},readUntil:function(t){var r=e.defer();return n.bluetoothSerial.readUntil(t,function(e){r.resolve(e)},function(e){r.reject(e)}),r.promise},write:function(t){var r=e.defer();return n.bluetoothSerial.write(t,function(){r.resolve()},function(e){r.reject(e)}),r.promise},subscribe:function(t){var r=e.defer();return n.bluetoothSerial.subscribe(t,function(e){r.notify(e)},function(e){r.reject(e)}),r.promise},subscribeRawData:function(){var t=e.defer();return n.bluetoothSerial.subscribeRawData(function(e){t.notify(e)},function(e){t.reject(e)}),t.promise},unsubscribe:function(){var t=e.defer();return n.bluetoothSerial.unsubscribe(function(){t.resolve()},function(e){t.reject(e)}),t.promise},unsubscribeRawData:function(){var t=e.defer();return n.bluetoothSerial.unsubscribeRawData(function(){t.resolve()},function(e){t.reject(e)}),t.promise},clear:function(){var t=e.defer();return n.bluetoothSerial.clear(function(){t.resolve()},function(e){t.reject(e)}),t.promise},readRSSI:function(){var t=e.defer();return n.bluetoothSerial.readRSSI(function(e){t.resolve(e)},function(e){t.reject(e)}),t.promise}}}]),angular.module("ngCordova.plugins.brightness",[]).factory("$cordovaBrightness",["$q","$window",function(e,n){return{get:function(){var t=e.defer();return n.cordova.plugins.brightness.getBrightness(function(e){t.resolve(e)},function(e){t.reject(e)}),t.promise},set:function(t){var r=e.defer();return n.cordova.plugins.brightness.setBrightness(t,function(e){r.resolve(e)},function(e){r.reject(e)}),r.promise},setKeepScreenOn:function(t){var r=e.defer();return n.cordova.plugins.brightness.setKeepScreenOn(t,function(e){r.resolve(e)},function(e){r.reject(e)}),r.promise}}}]),angular.module("ngCordova.plugins.calendar",[]).factory("$cordovaCalendar",["$q","$window",function(e,n){return{createCalendar:function(t){var r=e.defer(),o=n.plugins.calendar.getCreateCalendarOptions();return"string"==typeof t?o.calendarName=t:o=angular.extend(o,t),n.plugins.calendar.createCalendar(o,function(e){r.resolve(e)},function(e){r.reject(e)}),r.promise},deleteCalendar:function(t){var r=e.defer();return n.plugins.calendar.deleteCalendar(t,function(e){r.resolve(e)},function(e){r.reject(e)}),r.promise},createEvent:function(t){var r=e.defer(),o={title:null,location:null,notes:null,startDate:null,endDate:null};return o=angular.extend(o,t),n.plugins.calendar.createEvent(o.title,o.location,o.notes,new Date(o.startDate),new Date(o.endDate),function(e){r.resolve(e)},function(e){r.reject(e)}),r.promise},createEventWithOptions:function(t){var r=e.defer(),o=[],i=window.plugins.calendar.getCalendarOptions(),a={title:null,location:null,notes:null,startDate:null,endDate:null};o=Object.keys(a);for(var c in t)-1===o.indexOf(c)?i[c]=t[c]:a[c]=t[c];return n.plugins.calendar.createEventWithOptions(a.title,a.location,a.notes,new Date(a.startDate),new Date(a.endDate),i,function(e){r.resolve(e)},function(e){r.reject(e)}),r.promise},createEventInteractively:function(t){var r=e.defer(),o={title:null,location:null,notes:null,startDate:null,endDate:null};return o=angular.extend(o,t),n.plugins.calendar.createEventInteractively(o.title,o.location,o.notes,new Date(o.startDate),new Date(o.endDate),function(e){r.resolve(e)},function(e){r.reject(e)}),r.promise},createEventInNamedCalendar:function(t){var r=e.defer(),o={title:null,location:null,notes:null,startDate:null,endDate:null,calendarName:null};return o=angular.extend(o,t),n.plugins.calendar.createEventInNamedCalendar(o.title,o.location,o.notes,new Date(o.startDate),new Date(o.endDate),o.calendarName,function(e){r.resolve(e)},function(e){r.reject(e)}),r.promise},findEvent:function(t){var r=e.defer(),o={title:null,location:null,notes:null,startDate:null,endDate:null};return o=angular.extend(o,t),n.plugins.calendar.findEvent(o.title,o.location,o.notes,new Date(o.startDate),new Date(o.endDate),function(e){r.resolve(e)},function(e){r.reject(e)}),r.promise},listEventsInRange:function(t,r){var o=e.defer();return n.plugins.calendar.listEventsInRange(t,r,function(e){o.resolve(e)},function(e){o.reject(e)}),o.promise},listCalendars:function(){var t=e.defer();return n.plugins.calendar.listCalendars(function(e){t.resolve(e)},function(e){t.reject(e)}),t.promise},findAllEventsInNamedCalendar:function(t){var r=e.defer();return n.plugins.calendar.findAllEventsInNamedCalendar(t,function(e){r.resolve(e)},function(e){r.reject(e)}),r.promise},modifyEvent:function(t){var r=e.defer(),o={title:null,location:null,notes:null,startDate:null,endDate:null,newTitle:null,newLocation:null,newNotes:null,newStartDate:null,newEndDate:null};return o=angular.extend(o,t),n.plugins.calendar.modifyEvent(o.title,o.location,o.notes,new Date(o.startDate),new Date(o.endDate),o.newTitle,o.newLocation,o.newNotes,new Date(o.newStartDate),new Date(o.newEndDate),function(e){r.resolve(e)},function(e){r.reject(e)}),r.promise},deleteEvent:function(t){var r=e.defer(),o={newTitle:null,location:null,notes:null,startDate:null,endDate:null};return o=angular.extend(o,t),n.plugins.calendar.deleteEvent(o.newTitle,o.location,o.notes,new Date(o.startDate),new Date(o.endDate),function(e){r.resolve(e)},function(e){r.reject(e)}),r.promise}}}]),angular.module("ngCordova.plugins.camera",[]).factory("$cordovaCamera",["$q",function(e){return{getPicture:function(n){var t=e.defer();return navigator.camera?(navigator.camera.getPicture(function(e){t.resolve(e)},function(e){t.reject(e)},n),t.promise):(t.resolve(null),t.promise)},cleanup:function(){var n=e.defer();return navigator.camera.cleanup(function(){n.resolve()},function(e){n.reject(e)}),n.promise}}}]),angular.module("ngCordova.plugins.capture",[]).factory("$cordovaCapture",["$q",function(e){return{captureAudio:function(n){var t=e.defer();return navigator.device.capture?(navigator.device.capture.captureAudio(function(e){t.resolve(e)},function(e){t.reject(e)},n),t.promise):(t.resolve(null),t.promise)},captureImage:function(n){var t=e.defer();return navigator.device.capture?(navigator.device.capture.captureImage(function(e){t.resolve(e)},function(e){t.reject(e)},n),t.promise):(t.resolve(null),t.promise)},captureVideo:function(n){var t=e.defer();return navigator.device.capture?(navigator.device.capture.captureVideo(function(e){t.resolve(e)},function(e){t.reject(e)},n),t.promise):(t.resolve(null),t.promise)}}}]),angular.module("ngCordova.plugins.clipboard",[]).factory("$cordovaClipboard",["$q","$window",function(e,n){return{copy:function(t){var r=e.defer();return n.cordova.plugins.clipboard.copy(t,function(){r.resolve()},function(){r.reject()}),r.promise},paste:function(){var t=e.defer();return n.cordova.plugins.clipboard.paste(function(e){t.resolve(e)},function(){t.reject()}),t.promise}}}]),angular.module("ngCordova.plugins.contacts",[]).factory("$cordovaContacts",["$q",function(e){return{save:function(n){var t=e.defer(),r=navigator.contacts.create(n);return r.save(function(e){t.resolve(e)},function(e){t.reject(e)}),t.promise},remove:function(n){var t=e.defer(),r=navigator.contacts.create(n);return r.remove(function(e){t.resolve(e)},function(e){t.reject(e)}),t.promise},clone:function(e){var n=navigator.contacts.create(e);return n.clone(e)},find:function(n){var t=e.defer(),r=n.fields||["id","displayName"];return delete n.fields,navigator.contacts.find(r,function(e){t.resolve(e)},function(e){t.reject(e)},n),t.promise},pickContact:function(){var n=e.defer();return navigator.contacts.pickContact(function(e){n.resolve(e)},function(e){n.reject(e)}),n.promise}}}]),angular.module("ngCordova.plugins.datePicker",[]).factory("$cordovaDatePicker",["$window","$q",function(e,n){return{show:function(t){var r=n.defer();return t=t||{date:new Date,mode:"date"},e.datePicker.show(t,function(e){r.resolve(e)}),r.promise}}}]),angular.module("ngCordova.plugins.device",[]).factory("$cordovaDevice",[function(){return{getDevice:function(){return device},getCordova:function(){return device.cordova},getModel:function(){return device.model},getName:function(){return device.name},getPlatform:function(){return device.platform},getUUID:function(){return device.uuid},getVersion:function(){return device.version}}}]),angular.module("ngCordova.plugins.deviceMotion",[]).factory("$cordovaDeviceMotion",["$q",function(e){return{getCurrentAcceleration:function(){var n=e.defer();return navigator.accelerometer.getCurrentAcceleration(function(e){n.resolve(e)},function(e){n.reject(e)}),n.promise},watchAcceleration:function(n){var t=e.defer(),r=navigator.accelerometer.watchAcceleration(function(e){t.notify(e)},function(e){t.reject(e)},n);return t.promise.cancel=function(){navigator.accelerometer.clearWatch(r)},t.promise.clearWatch=function(e){navigator.accelerometer.clearWatch(e||r)},t.promise.watchID=r,t.promise},clearWatch:function(e){return navigator.accelerometer.clearWatch(e)}}}]),angular.module("ngCordova.plugins.deviceOrientation",[]).factory("$cordovaDeviceOrientation",["$q",function(e){return{getCurrentHeading:function(){var n=e.defer();return navigator.compass.getCurrentHeading(function(e){n.resolve(e)},function(e){n.reject(e)}),n.promise},watchHeading:function(n){var t=e.defer(),r=navigator.compass.watchHeading(function(e){t.notify(e)},function(e){t.reject(e)},n);return t.promise.cancel=function(){navigator.compass.clearWatch(r)},t.promise.clearWatch=function(e){navigator.compass.clearWatch(e||r)},t.promise.watchID=r,t.promise},clearWatch:function(e){return navigator.compass.clearWatch(e)}}}]),angular.module("ngCordova.plugins.dialogs",[]).factory("$cordovaDialogs",["$q","$window",function(e,n){return{alert:function(t,r,o){var i=e.defer();return n.navigator.notification?navigator.notification.alert(t,function(){i.resolve()},r,o):(n.alert(t),i.resolve()),i.promise},confirm:function(t,r,o){var i=e.defer();return n.navigator.notification?navigator.notification.confirm(t,function(e){i.resolve(e)},r,o):i.resolve(n.confirm(t)?1:2),i.promise},prompt:function(t,r,o,i){var a=e.defer();if(n.navigator.notification)navigator.notification.prompt(t,function(e){a.resolve(e)},r,o,i);else{var c=n.prompt(t,i);a.resolve(null!==c?{input1:c,buttonIndex:1}:{input1:c,buttonIndex:2})}return a.promise},beep:function(e){return navigator.notification.beep(e)}}}]),angular.module("ngCordova.plugins.emailComposer",[]).factory("$cordovaEmailComposer",["$q",function(e){return{isAvailable:function(){var n=e.defer();return cordova.plugins.email.isAvailable(function(e){e?n.resolve():n.reject()}),n.promise},open:function(n){var t=e.defer();return cordova.plugins.email.open(n,function(){t.reject()}),t.promise},addAlias:function(e,n){cordova.plugins.email.addAlias(e,n)}}}]),angular.module("ngCordova.plugins.facebook",[]).provider("$cordovaFacebook",[function(){this.browserInit=function(e,n){this.appID=e,this.appVersion=n||"v2.0",facebookConnectPlugin.browserInit(this.appID,this.appVersion)},this.$get=["$q",function(e){return{login:function(n){var t=e.defer();return facebookConnectPlugin.login(n,function(e){t.resolve(e)},function(e){t.reject(e)}),t.promise},showDialog:function(n){var t=e.defer();return facebookConnectPlugin.showDialog(n,function(e){t.resolve(e)},function(e){t.reject(e)}),t.promise},api:function(n,t){var r=e.defer();return facebookConnectPlugin.api(n,t,function(e){r.resolve(e)},function(e){r.reject(e)}),r.promise},getAccessToken:function(){var n=e.defer();return facebookConnectPlugin.getAccessToken(function(e){n.resolve(e)},function(e){n.reject(e)}),n.promise},getLoginStatus:function(){var n=e.defer();return facebookConnectPlugin.getLoginStatus(function(e){n.resolve(e)},function(e){n.reject(e)}),n.promise},logout:function(){var n=e.defer();return facebookConnectPlugin.logout(function(e){n.resolve(e)},function(e){n.reject(e)}),n.promise}}}]}]),angular.module("ngCordova.plugins.facebookAds",[]).factory("$cordovaFacebookAds",["$q","$window",function(e,n){return{setOptions:function(t){var r=e.defer();return n.FacebookAds.setOptions(t,function(){r.resolve()},function(){r.reject()}),r.promise},createBanner:function(t){var r=e.defer();return n.FacebookAds.createBanner(t,function(){r.resolve()},function(){r.reject()}),r.promise},removeBanner:function(){var t=e.defer();return n.FacebookAds.removeBanner(function(){t.resolve()},function(){t.reject()}),t.promise},showBanner:function(t){var r=e.defer();return n.FacebookAds.showBanner(t,function(){r.resolve()},function(){r.reject()}),r.promise},showBannerAtXY:function(t,r){var o=e.defer();return n.FacebookAds.showBannerAtXY(t,r,function(){o.resolve()},function(){o.reject()}),o.promise},hideBanner:function(){var t=e.defer();return n.FacebookAds.hideBanner(function(){t.resolve()},function(){t.reject()}),t.promise},prepareInterstitial:function(t){var r=e.defer();return n.FacebookAds.prepareInterstitial(t,function(){r.resolve()},function(){r.reject()}),r.promise},showInterstitial:function(){var t=e.defer();return n.FacebookAds.showInterstitial(function(){t.resolve()},function(){t.reject()}),t.promise}}}]),angular.module("ngCordova.plugins.file",[]).constant("$cordovaFileError",{1:"NOT_FOUND_ERR",2:"SECURITY_ERR",3:"ABORT_ERR",4:"NOT_READABLE_ERR",5:"ENCODING_ERR",6:"NO_MODIFICATION_ALLOWED_ERR",7:"INVALID_STATE_ERR",8:"SYNTAX_ERR",9:"INVALID_MODIFICATION_ERR",10:"QUOTA_EXCEEDED_ERR",11:"TYPE_MISMATCH_ERR",12:"PATH_EXISTS_ERR"}).provider("$cordovaFile",[function(){this.$get=["$q","$window","$cordovaFileError",function(e,n,t){return{getFreeDiskSpace:function(){var n=e.defer();return cordova.exec(function(e){n.resolve(e)},function(e){n.reject(e)},"File","getFreeDiskSpace",[]),n.promise},checkDir:function(r,o){var i=e.defer();/^\//.test(o)&&i.reject("directory cannot start with /");try{var a=r+o;n.resolveLocalFileSystemURL(a,function(e){e.isDirectory===!0?i.resolve(e):i.reject({code:13,message:"input is not a directory"})},function(e){e.message=t[e.code],i.reject(e)})}catch(c){c.message=t[c.code],i.reject(c)}return i.promise},checkFile:function(r,o){var i=e.defer();/^\//.test(o)&&i.reject("directory cannot start with /");try{var a=r+o;n.resolveLocalFileSystemURL(a,function(e){e.isFile===!0?i.resolve(e):i.reject({code:13,message:"input is not a file"})},function(e){e.message=t[e.code],i.reject(e)})}catch(c){c.message=t[c.code],i.reject(c)}return i.promise},createDir:function(r,o,i){var a=e.defer();/^\//.test(o)&&a.reject("directory cannot start with /"),i=i?!1:!0;var c={create:!0,exclusive:i};try{n.resolveLocalFileSystemURL(r,function(e){e.getDirectory(o,c,function(e){a.resolve(e)},function(e){e.message=t[e.code],a.reject(e)})},function(e){e.message=t[e.code],a.reject(e)})}catch(u){u.message=t[u.code],a.reject(u)}return a.promise},createFile:function(r,o,i){var a=e.defer();/^\//.test(o)&&a.reject("file-name cannot start with /"),i=i?!1:!0;var c={create:!0,exclusive:i};try{n.resolveLocalFileSystemURL(r,function(e){e.getFile(o,c,function(e){a.resolve(e)},function(e){e.message=t[e.code],a.reject(e)})},function(e){e.message=t[e.code],a.reject(e)})}catch(u){u.message=t[u.code],a.reject(u)}return a.promise},removeDir:function(r,o){var i=e.defer();/^\//.test(o)&&i.reject("file-name cannot start with /");try{n.resolveLocalFileSystemURL(r,function(e){e.getDirectory(o,{create:!1},function(e){e.remove(function(){i.resolve({success:!0,fileRemoved:e})},function(e){e.message=t[e.code],i.reject(e)})},function(e){e.message=t[e.code],i.reject(e)})},function(e){e.message=t[e.code],i.reject(e)})}catch(a){a.message=t[a.code],i.reject(a)}return i.promise},removeFile:function(r,o){var i=e.defer();/^\//.test(o)&&i.reject("file-name cannot start with /");try{n.resolveLocalFileSystemURL(r,function(e){e.getFile(o,{create:!1},function(e){e.remove(function(){i.resolve({success:!0,fileRemoved:e})},function(e){e.message=t[e.code],i.reject(e)})},function(e){e.message=t[e.code],i.reject(e)})},function(e){e.message=t[e.code],i.reject(e)})}catch(a){a.message=t[a.code],i.reject(a)}return i.promise},removeRecursively:function(r,o){var i=e.defer();/^\//.test(o)&&i.reject("file-name cannot start with /");try{n.resolveLocalFileSystemURL(r,function(e){e.getDirectory(o,{create:!1},function(e){e.removeRecursively(function(){i.resolve({success:!0,fileRemoved:e})},function(e){e.message=t[e.code],i.reject(e)})},function(e){e.message=t[e.code],i.reject(e)})},function(e){e.message=t[e.code],i.reject(e)})}catch(a){a.message=t[a.code],i.reject(a)}return i.promise},writeFile:function(r,o,i,a){var c=e.defer();/^\//.test(o)&&c.reject("file-name cannot start with /"),a=a?!1:!0;var u={create:!0,exclusive:a};try{n.resolveLocalFileSystemURL(r,function(e){e.getFile(o,u,function(e){e.createWriter(function(e){u.append===!0&&e.seek(e.length),u.truncate&&e.truncate(u.truncate),e.onwriteend=function(e){this.error?c.reject(this.error):c.resolve(e)},e.write(i),c.promise.abort=function(){e.abort()}})},function(e){e.message=t[e.code],c.reject(e)})},function(e){e.message=t[e.code],c.reject(e)})}catch(s){s.message=t[s.code],c.reject(s)}return c.promise},writeExistingFile:function(r,o,i){var a=e.defer();/^\//.test(o)&&a.reject("file-name cannot start with /");try{n.resolveLocalFileSystemURL(r,function(e){e.getFile(o,{create:!1},function(e){e.createWriter(function(e){e.seek(e.length),e.onwriteend=function(e){this.error?a.reject(this.error):a.resolve(e)},e.write(i),a.promise.abort=function(){e.abort()}})},function(e){e.message=t[e.code],a.reject(e)})},function(e){e.message=t[e.code],a.reject(e)})}catch(c){c.message=t[c.code],a.reject(c)}return a.promise},readAsText:function(r,o){var i=e.defer();/^\//.test(o)&&i.reject("file-name cannot start with /");try{n.resolveLocalFileSystemURL(r,function(e){e.getFile(o,{create:!1},function(e){e.file(function(e){var n=new FileReader;n.onloadend=function(e){void 0!==e.target._result||null!==e.target._result?i.resolve(e.target._result):i.reject(void 0!==e.target._error||null!==e.target._error?e.target._error:{code:null,message:"READER_ONLOADEND_ERR"})},n.readAsText(e)})},function(e){e.message=t[e.code],i.reject(e)})},function(e){e.message=t[e.code],i.reject(e)})}catch(a){a.message=t[a.code],i.reject(a)}return i.promise},readAsDataURL:function(r,o){var i=e.defer();/^\//.test(o)&&i.reject("file-name cannot start with /");try{n.resolveLocalFileSystemURL(r,function(e){e.getFile(o,{create:!1},function(e){e.file(function(e){var n=new FileReader;n.onloadend=function(e){void 0!==e.target._result||null!==e.target._result?i.resolve(e.target._result):i.reject(void 0!==e.target._error||null!==e.target._error?e.target._error:{code:null,message:"READER_ONLOADEND_ERR"})},n.readAsDataURL(e)})},function(e){e.message=t[e.code],i.reject(e)})},function(e){e.message=t[e.code],i.reject(e)})}catch(a){a.message=t[a.code],i.reject(a)}return i.promise},readAsBinaryString:function(r,o){var i=e.defer();/^\//.test(o)&&i.reject("file-name cannot start with /");try{n.resolveLocalFileSystemURL(r,function(e){e.getFile(o,{create:!1},function(e){e.file(function(e){var n=new FileReader;n.onloadend=function(e){void 0!==e.target._result||null!==e.target._result?i.resolve(e.target._result):i.reject(void 0!==e.target._error||null!==e.target._error?e.target._error:{code:null,message:"READER_ONLOADEND_ERR"})},n.readAsBinaryString(e)})},function(e){e.message=t[e.code],i.reject(e)})},function(e){e.message=t[e.code],i.reject(e)})}catch(a){a.message=t[a.code],i.reject(a)}return i.promise},readAsArrayBuffer:function(r,o){var i=e.defer();/^\//.test(o)&&i.reject("file-name cannot start with /");try{n.resolveLocalFileSystemURL(r,function(e){e.getFile(o,{create:!1},function(e){e.file(function(e){var n=new FileReader;n.onloadend=function(e){void 0!==e.target._result||null!==e.target._result?i.resolve(e.target._result):i.reject(void 0!==e.target._error||null!==e.target._error?e.target._error:{code:null,message:"READER_ONLOADEND_ERR"})},n.readAsArrayBuffer(e)})},function(e){e.message=t[e.code],i.reject(e)})},function(e){e.message=t[e.code],i.reject(e)})}catch(a){a.message=t[a.code],i.reject(a)}return i.promise},moveFile:function(t,r,o,i){var a=e.defer();i=i||r,(/^\//.test(r)||/^\//.test(i))&&a.reject("file-name cannot start with /");try{n.resolveLocalFileSystemURL(t,function(e){e.getFile(r,{create:!1},function(e){n.resolveLocalFileSystemURL(o,function(n){e.moveTo(n,i,function(e){a.resolve(e)},function(e){a.reject(e)})},function(e){a.reject(e)})},function(e){a.reject(e)})},function(e){a.reject(e)})}catch(c){a.reject(c)}return a.promise},moveDir:function(t,r,o,i){var a=e.defer();i=i||r,(/^\//.test(r)||/^\//.test(i))&&a.reject("file-name cannot start with /");try{n.resolveLocalFileSystemURL(t,function(e){e.getDirectory(r,{create:!1},function(e){n.resolveLocalFileSystemURL(o,function(n){e.moveTo(n,i,function(e){a.resolve(e)},function(e){a.reject(e)})},function(e){a.reject(e)})},function(e){a.reject(e)})},function(e){a.reject(e)})}catch(c){a.reject(c)}return a.promise},copyDir:function(r,o,i,a){var c=e.defer();a=a||o,(/^\//.test(o)||/^\//.test(a))&&c.reject("file-name cannot start with /");try{n.resolveLocalFileSystemURL(r,function(e){e.getDirectory(o,{create:!1,exclusive:!1},function(e){n.resolveLocalFileSystemURL(i,function(n){e.copyTo(n,a,function(e){c.resolve(e)},function(e){e.message=t[e.code],c.reject(e)})},function(e){e.message=t[e.code],c.reject(e)})},function(e){e.message=t[e.code],c.reject(e)})},function(e){e.message=t[e.code],c.reject(e)})}catch(u){u.message=t[u.code],c.reject(u)}return c.promise},copyFile:function(r,o,i,a){var c=e.defer();a=a||o,/^\//.test(o)&&c.reject("file-name cannot start with /");try{n.resolveLocalFileSystemURL(r,function(e){e.getFile(o,{create:!1,exclusive:!1},function(e){n.resolveLocalFileSystemURL(i,function(n){e.copyTo(n,a,function(e){c.resolve(e)},function(e){e.message=t[e.code],c.reject(e)})},function(e){e.message=t[e.code],c.reject(e)})},function(e){e.message=t[e.code],c.reject(e)})},function(e){e.message=t[e.code],c.reject(e)})}catch(u){u.message=t[u.code],c.reject(u)}return c.promise}}}]}]),angular.module("ngCordova.plugins.fileOpener2",[]).factory("$cordovaFileOpener2",["$q",function(e){return{open:function(n,t){var r=e.defer();return cordova.plugins.fileOpener2.open(n,t,{error:function(e){r.reject(e)},success:function(){r.resolve()}}),r.promise},uninstall:function(n){var t=e.defer();return cordova.plugins.fileOpener2.uninstall(n,{error:function(e){t.reject(e)},success:function(){t.resolve()}}),t.promise},appIsInstalled:function(n){var t=e.defer();return cordova.plugins.fileOpener2.appIsInstalled(n,{success:function(e){t.resolve(e)}}),t.promise}}}]),angular.module("ngCordova.plugins.fileTransfer",[]).factory("$cordovaFileTransfer",["$q","$timeout",function(e,n){return{download:function(t,r,o,i){var a=e.defer(),c=new FileTransfer,u=o&&o.encodeURI===!1?t:encodeURI(t);return o&&void 0!==o.timeout&&null!==o.timeout&&(n(function(){c.abort()},o.timeout),o.timeout=null),c.onprogress=function(e){a.notify(e)},a.promise.abort=function(){c.abort()},c.download(u,r,a.resolve,a.reject,i,o),a.promise -},upload:function(t,r,o,i){var a=e.defer(),c=new FileTransfer,u=o&&o.encodeURI===!1?t:encodeURI(t);return o&&void 0!==o.timeout&&null!==o.timeout&&(n(function(){c.abort()},o.timeout),o.timeout=null),c.onprogress=function(e){a.notify(e)},a.promise.abort=function(){c.abort()},c.upload(r,u,a.resolve,a.reject,o,i),a.promise}}}]),angular.module("ngCordova.plugins.flashlight",[]).factory("$cordovaFlashlight",["$q","$window",function(e,n){return{available:function(){var t=e.defer();return n.plugins.flashlight.available(function(e){t.resolve(e)}),t.promise},switchOn:function(){var t=e.defer();return n.plugins.flashlight.switchOn(function(e){t.resolve(e)},function(e){t.reject(e)}),t.promise},switchOff:function(){var t=e.defer();return n.plugins.flashlight.switchOff(function(e){t.resolve(e)},function(e){t.reject(e)}),t.promise},toggle:function(){var t=e.defer();return n.plugins.flashlight.toggle(function(e){t.resolve(e)},function(e){t.reject(e)}),t.promise}}}]),angular.module("ngCordova.plugins.flurryAds",[]).factory("$cordovaFlurryAds",["$q","$window",function(e,n){return{setOptions:function(t){var r=e.defer();return n.FlurryAds.setOptions(t,function(){r.resolve()},function(){r.reject()}),r.promise},createBanner:function(t){var r=e.defer();return n.FlurryAds.createBanner(t,function(){r.resolve()},function(){r.reject()}),r.promise},removeBanner:function(){var t=e.defer();return n.FlurryAds.removeBanner(function(){t.resolve()},function(){t.reject()}),t.promise},showBanner:function(t){var r=e.defer();return n.FlurryAds.showBanner(t,function(){r.resolve()},function(){r.reject()}),r.promise},showBannerAtXY:function(t,r){var o=e.defer();return n.FlurryAds.showBannerAtXY(t,r,function(){o.resolve()},function(){o.reject()}),o.promise},hideBanner:function(){var t=e.defer();return n.FlurryAds.hideBanner(function(){t.resolve()},function(){t.reject()}),t.promise},prepareInterstitial:function(t){var r=e.defer();return n.FlurryAds.prepareInterstitial(t,function(){r.resolve()},function(){r.reject()}),r.promise},showInterstitial:function(){var t=e.defer();return n.FlurryAds.showInterstitial(function(){t.resolve()},function(){t.reject()}),t.promise}}}]),angular.module("ngCordova.plugins.ga",[]).factory("$cordovaGA",["$q","$window",function(e,n){return{init:function(t,r){var o=e.defer();return r=r>=0?r:10,n.plugins.gaPlugin.init(function(e){o.resolve(e)},function(e){o.reject(e)},t,r),o.promise},trackEvent:function(t,r,o,i,a,c){var u=e.defer();return n.plugins.gaPlugin.trackEvent(function(e){u.resolve(e)},function(e){u.reject(e)},o,i,a,c),u.promise},trackPage:function(t,r,o){var i=e.defer();return n.plugins.gaPlugin.trackPage(function(e){i.resolve(e)},function(e){i.reject(e)},o),i.promise},setVariable:function(t,r,o,i){var a=e.defer();return n.plugins.gaPlugin.setVariable(function(e){a.resolve(e)},function(e){a.reject(e)},o,i),a.promise},exit:function(){var t=e.defer();return n.plugins.gaPlugin.exit(function(e){t.resolve(e)},function(e){t.reject(e)}),t.promise}}}]),angular.module("ngCordova.plugins.geolocation",[]).factory("$cordovaGeolocation",["$q",function(e){return{getCurrentPosition:function(n){var t=e.defer();return navigator.geolocation.getCurrentPosition(function(e){t.resolve(e)},function(e){t.reject(e)},n),t.promise},watchPosition:function(n){var t=e.defer(),r=navigator.geolocation.watchPosition(function(e){t.notify(e)},function(e){t.reject(e)},n);return t.promise.cancel=function(){navigator.geolocation.clearWatch(r)},t.promise.clearWatch=function(e){navigator.geolocation.clearWatch(e||r)},t.promise.watchID=r,t.promise},clearWatch:function(e){return navigator.geolocation.clearWatch(e)}}}]),angular.module("ngCordova.plugins.globalization",[]).factory("$cordovaGlobalization",["$q",function(e){return{getPreferredLanguage:function(){var n=e.defer();return navigator.globalization.getPreferredLanguage(function(e){n.resolve(e)},function(e){n.reject(e)}),n.promise},getLocaleName:function(){var n=e.defer();return navigator.globalization.getLocaleName(function(e){n.resolve(e)},function(e){n.reject(e)}),n.promise},getFirstDayOfWeek:function(){var n=e.defer();return navigator.globalization.getFirstDayOfWeek(function(e){n.resolve(e)},function(e){n.reject(e)}),n.promise},dateToString:function(n,t){var r=e.defer();return navigator.globalization.dateToString(n,function(e){r.resolve(e)},function(e){r.reject(e)},t),r.promise},stringToDate:function(n,t){var r=e.defer();return navigator.globalization.stringToDate(n,function(e){r.resolve(e)},function(e){r.reject(e)},t),r.promise},getDatePattern:function(n){var t=e.defer();return navigator.globalization.getDatePattern(function(e){t.resolve(e)},function(e){t.reject(e)},n),t.promise},getDateNames:function(n){var t=e.defer();return navigator.globalization.getDateNames(function(e){t.resolve(e)},function(e){t.reject(e)},n),t.promise},isDayLightSavingsTime:function(n){var t=e.defer();return navigator.globalization.isDayLightSavingsTime(n,function(e){t.resolve(e)},function(e){t.reject(e)}),t.promise},numberToString:function(n,t){var r=e.defer();return navigator.globalization.numberToString(n,function(e){r.resolve(e)},function(e){r.reject(e)},t),r.promise},stringToNumber:function(n,t){var r=e.defer();return navigator.globalization.stringToNumber(n,function(e){r.resolve(e)},function(e){r.reject(e)},t),r.promise},getNumberPattern:function(n){var t=e.defer();return navigator.globalization.getNumberPattern(function(e){t.resolve(e)},function(e){t.reject(e)},n),t.promise},getCurrencyPattern:function(n){var t=e.defer();return navigator.globalization.getCurrencyPattern(n,function(e){t.resolve(e)},function(e){t.reject(e)}),t.promise}}}]),angular.module("ngCordova.plugins.googleAds",[]).factory("$cordovaGoogleAds",["$q","$window",function(e,n){return{setOptions:function(t){var r=e.defer();return n.AdMob.setOptions(t,function(){r.resolve()},function(){r.reject()}),r.promise},createBanner:function(t){var r=e.defer();return n.AdMob.createBanner(t,function(){r.resolve()},function(){r.reject()}),r.promise},removeBanner:function(){var t=e.defer();return n.AdMob.removeBanner(function(){t.resolve()},function(){t.reject()}),t.promise},showBanner:function(t){var r=e.defer();return n.AdMob.showBanner(t,function(){r.resolve()},function(){r.reject()}),r.promise},showBannerAtXY:function(t,r){var o=e.defer();return n.AdMob.showBannerAtXY(t,r,function(){o.resolve()},function(){o.reject()}),o.promise},hideBanner:function(){var t=e.defer();return n.AdMob.hideBanner(function(){t.resolve()},function(){t.reject()}),t.promise},prepareInterstitial:function(t){var r=e.defer();return n.AdMob.prepareInterstitial(t,function(){r.resolve()},function(){r.reject()}),r.promise},showInterstitial:function(){var t=e.defer();return n.AdMob.showInterstitial(function(){t.resolve()},function(){t.reject()}),t.promise}}}]),angular.module("ngCordova.plugins.googleAnalytics",[]).factory("$cordovaGoogleAnalytics",["$q","$window",function(e,n){return{startTrackerWithId:function(t){var r=e.defer();return n.analytics.startTrackerWithId(t,function(e){r.resolve(e)},function(e){r.reject(e)}),r.promise},setUserId:function(t){var r=e.defer();return n.analytics.setUserId(t,function(e){r.resolve(e)},function(e){r.reject(e)}),r.promise},debugMode:function(){var t=e.defer();return n.analytics.debugMode(function(e){t.resolve(e)},function(){t.reject()}),t.promise},trackView:function(t){var r=e.defer();return n.analytics.trackView(t,function(e){r.resolve(e)},function(e){r.reject(e)}),r.promise},addCustomDimension:function(t,r){var o=e.defer();return n.analytics.addCustomDimension(t,r,function(){o.resolve()},function(e){o.reject(e)}),o.promise},trackEvent:function(t,r,o,i){var a=e.defer();return n.analytics.trackEvent(t,r,o,i,function(e){a.resolve(e)},function(e){a.reject(e)}),a.promise},addTransaction:function(t,r,o,i,a,c){var u=e.defer();return n.analytics.addTransaction(t,r,o,i,a,c,function(e){u.resolve(e)},function(e){u.reject(e)}),u.promise},addTransactionItem:function(t,r,o,i,a,c,u){var s=e.defer();return n.analytics.addTransactionItem(t,r,o,i,a,c,u,function(e){s.resolve(e)},function(e){s.reject(e)}),s.promise}}}]),angular.module("ngCordova.plugins.googleMap",[]).factory("$cordovaGoogleMap",["$q","$window",function(e,n){var t=null;return{getMap:function(r){var o=e.defer();if(n.plugin.google.maps){var i=document.getElementById("map_canvas");t=n.plugin.google.maps.Map.getMap(r),t.setDiv(i),o.resolve(t)}else o.reject(null);return o.promise},isMapLoaded:function(){return!!t},addMarker:function(n){var r=e.defer();return t.addMarker(n,function(e){r.resolve(e)}),r.promise},getMapTypeIds:function(){return n.plugin.google.maps.mapTypeId},setVisible:function(n){var r=e.defer();return t.setVisible(n),r.promise},cleanup:function(){t=null}}}]),angular.module("ngCordova.plugins.googlePlayGame",[]).factory("$cordovaGooglePlayGame",["$q",function(e){return{auth:function(){var n=e.defer();return googleplaygame.auth(function(e){return n.resolve(e)},function(e){return n.reject(e)}),n.promise},signout:function(){var n=e.defer();return googleplaygame.signout(function(e){return n.resolve(e)},function(e){return n.reject(e)}),n.promise},isSignedIn:function(){var n=e.defer();return googleplaygame.isSignedIn(function(e){return n.resolve(e)},function(e){return n.reject(e)}),n.promise},showPlayer:function(){var n=e.defer();return googleplaygame.showPlayer(function(e){return n.resolve(e)},function(e){return n.reject(e)}),n.promise},submitScore:function(n){var t=e.defer();return googleplaygame.submitScore(n,function(e){return t.resolve(e)},function(e){return t.reject(e)}),t.promise},showAllLeaderboards:function(){var n=e.defer();return googleplaygame.showAllLeaderboards(function(e){return n.resolve(e)},function(e){return n.reject(e)}),n.promise},showLeaderboard:function(n){var t=e.defer();return googleplaygame.showLeaderboard(n,function(e){return t.resolve(e)},function(e){return t.reject(e)}),t.promise},unlockAchievement:function(n){var t=e.defer();return googleplaygame.unlockAchievement(n,function(e){return t.resolve(e)},function(e){return t.reject(e)}),t.promise},incrementAchievement:function(n){var t=e.defer();return googleplaygame.incrementAchievement(n,function(e){return t.resolve(e)},function(e){return t.reject(e)}),t.promise},showAchievements:function(){var n=e.defer();return googleplaygame.showAchievements(function(e){return n.resolve(e)},function(e){return n.reject(e)}),n.promise}}}]),angular.module("ngCordova.plugins.googleplus",[]).factory("$cordovaGooglePlus",["$q","$window",function(e,n){return{login:function(t){void 0===t&&(t={});var r=e.defer();return n.plugins.googleplus.login({iOSApiKey:t},function(e){r.resolve(e)},function(e){r.reject(e)}),r.promise},silentLogin:function(t){void 0===t&&(t={});var r=e.defer();return n.plugins.googleplus.trySilentLogin({iOSApiKey:t},function(e){r.resolve(e)},function(e){r.reject(e)}),r.promise},logout:function(){var t=e.defer();n.plugins.googleplus.logout(function(e){t.resolve(e)})},disconnect:function(){var t=e.defer();n.plugins.googleplus.disconnect(function(e){t.resolve(e)})}}}]),angular.module("ngCordova.plugins.healthKit",[]).factory("$cordovaHealthKit",["$q","$window",function(e,n){return{isAvailable:function(){var t=e.defer();return n.plugins.healthkit.available(function(e){t.resolve(e)},function(e){t.reject(e)}),t.promise},checkAuthStatus:function(t){var r=e.defer();return t=t||"HKQuantityTypeIdentifierHeight",n.plugins.healthkit.checkAuthStatus({type:t},function(e){r.resolve(e)},function(e){r.reject(e)}),r.promise},requestAuthorization:function(t,r){var o=e.defer();return t=t||["HKCharacteristicTypeIdentifierDateOfBirth","HKQuantityTypeIdentifierActiveEnergyBurned","HKQuantityTypeIdentifierHeight"],r=r||["HKQuantityTypeIdentifierActiveEnergyBurned","HKQuantityTypeIdentifierHeight","HKQuantityTypeIdentifierDistanceCycling"],n.plugins.healthkit.requestAuthorization({readTypes:t,writeTypes:r},function(e){o.resolve(e)},function(e){o.reject(e)}),o.promise},readDateOfBirth:function(){var t=e.defer();return n.plugins.healthkit.readDateOfBirth(function(e){t.resolve(e)},function(e){t.resolve(e)}),t.promise},readGender:function(){var t=e.defer();return n.plugins.healthkit.readGender(function(e){t.resolve(e)},function(e){t.resolve(e)}),t.promise},saveWeight:function(t,r,o){var i=e.defer();return n.plugins.healthkit.saveWeight({unit:r||"lb",amount:t,date:o||new Date},function(e){i.resolve(e)},function(e){i.resolve(e)}),i.promise},readWeight:function(t){var r=e.defer();return n.plugins.healthkit.readWeight({unit:t||"lb"},function(e){r.resolve(e)},function(e){r.resolve(e)}),r.promise},saveHeight:function(t,r,o){var i=e.defer();return n.plugins.healthkit.saveHeight({unit:r||"in",amount:t,date:o||new Date},function(e){i.resolve(e)},function(e){i.resolve(e)}),i.promise},readHeight:function(t){var r=e.defer();return n.plugins.healthkit.readHeight({unit:t||"in"},function(e){r.resolve(e)},function(e){r.resolve(e)}),r.promise},findWorkouts:function(){var t=e.defer();return n.plugins.healthkit.findWorkouts({},function(e){t.resolve(e)},function(e){t.resolve(e)}),t.promise},saveWorkout:function(t){var r=e.defer();return n.plugins.healthkit.saveWorkout(t,function(e){r.resolve(e)},function(e){r.resolve(e)}),r.promise},querySampleType:function(t){var r=e.defer();return n.plugins.healthkit.querySampleType(t,function(e){r.resolve(e)},function(e){r.resolve(e)}),r.promise}}}]),angular.module("ngCordova.plugins.httpd",[]).factory("$cordovaHttpd",["$q",function(e){return{startServer:function(n){var t=e.defer();return cordova.plugins.CorHttpd.startServer(n,function(){t.resolve()},function(){t.reject()}),t.promise},stopServer:function(){var n=e.defer();return cordova.plugins.CorHttpd.stopServer(function(){n.resolve()},function(){n.reject()}),n.promise},getURL:function(){var n=e.defer();return cordova.plugins.CorHttpd.getURL(function(e){n.resolve(e)},function(){n.reject()}),n.promise},getLocalPath:function(){var n=e.defer();return cordova.plugins.CorHttpd.getLocalPath(function(e){n.resolve(e)},function(){n.reject()}),n.promise}}}]),angular.module("ngCordova.plugins.iAd",[]).factory("$cordovaiAd",["$q","$window",function(e,n){return{setOptions:function(t){var r=e.defer();return n.iAd.setOptions(t,function(){r.resolve()},function(){r.reject()}),r.promise},createBanner:function(t){var r=e.defer();return n.iAd.createBanner(t,function(){r.resolve()},function(){r.reject()}),r.promise},removeBanner:function(){var t=e.defer();return n.iAd.removeBanner(function(){t.resolve()},function(){t.reject()}),t.promise},showBanner:function(t){var r=e.defer();return n.iAd.showBanner(t,function(){r.resolve()},function(){r.reject()}),r.promise},showBannerAtXY:function(t,r){var o=e.defer();return n.iAd.showBannerAtXY(t,r,function(){o.resolve()},function(){o.reject()}),o.promise},hideBanner:function(){var t=e.defer();return n.iAd.hideBanner(function(){t.resolve()},function(){t.reject()}),t.promise},prepareInterstitial:function(t){var r=e.defer();return n.iAd.prepareInterstitial(t,function(){r.resolve()},function(){r.reject()}),r.promise},showInterstitial:function(){var t=e.defer();return n.iAd.showInterstitial(function(){t.resolve()},function(){t.reject()}),t.promise}}}]),angular.module("ngCordova.plugins.imagePicker",[]).factory("$cordovaImagePicker",["$q","$window",function(e,n){return{getPictures:function(t){var r=e.defer();return n.imagePicker.getPictures(function(e){r.resolve(e)},function(e){r.reject(e)},t),r.promise}}}]),angular.module("ngCordova.plugins.inAppBrowser",[]).provider("$cordovaInAppBrowser",[function(){var e,n=this.defaultOptions={};this.setDefaultOptions=function(e){n=angular.extend(n,e)},this.$get=["$rootScope","$q","$window","$timeout",function(t,r,o,i){return{open:function(a,c,u){var s=r.defer();if(u&&!angular.isObject(u))return s.reject("options must be an object"),s.promise;var l=angular.extend({},n,u),f=[];angular.forEach(l,function(e,n){f.push(n+"="+e)});var d=f.join();return e=o.open(a,c,d),e.addEventListener("loadstart",function(e){i(function(){t.$broadcast("$cordovaInAppBrowser:loadstart",e)})},!1),e.addEventListener("loadstop",function(e){s.resolve(e),i(function(){t.$broadcast("$cordovaInAppBrowser:loadstop",e)})},!1),e.addEventListener("loaderror",function(e){s.reject(e),i(function(){t.$broadcast("$cordovaInAppBrowser:loaderror",e)})},!1),e.addEventListener("exit",function(e){i(function(){t.$broadcast("$cordovaInAppBrowser:exit",e)})},!1),s.promise},close:function(){e.close(),e=null},show:function(){e.show()},executeScript:function(n){var t=r.defer();return e.executeScript(n,function(e){t.resolve(e)}),t.promise},insertCSS:function(n){var t=r.defer();return e.insertCSS(n,function(e){t.resolve(e)}),t.promise}}}]}]),angular.module("ngCordova.plugins.insomnia",[]).factory("$cordovaInsomnia",["$window",function(e){return{keepAwake:function(){return e.plugins.insomnia.keepAwake()},allowSleepAgain:function(){return e.plugins.insomnia.allowSleepAgain()}}}]),angular.module("ngCordova.plugins.instagram",[]).factory("$cordovaInstagram",["$q",function(e){return{share:function(n){var t=e.defer();return window.Instagram?(Instagram.share(n.image,n.caption,function(e){e?t.reject(e):t.resolve(!0)}),t.promise):(console.error("Tried to call Instagram.share but the Instagram plugin isn't installed!"),t.resolve(null),t.promise)},isInstalled:function(){var n=e.defer();return window.Instagram?(Instagram.isInstalled(function(e,t){e?n.reject(e):n.resolve(t||!0)}),n.promise):(console.error("Tried to call Instagram.isInstalled but the Instagram plugin isn't installed!"),n.resolve(null),n.promise)}}}]),angular.module("ngCordova.plugins.keyboard",[]).factory("$cordovaKeyboard",[function(){var e=function(){$timeout(function(){$rootScope.$broadcast("$cordovaKeyboard:show")})},n=function(){$timeout(function(){$rootScope.$broadcast("$cordovaKeyboard:hide")})};return document.addEventListener("deviceready",function(){cordova.plugins.Keyboard&&(window.addEventListener("native.keyboardshow",e,!1),window.addEventListener("native.keyboardhide",n,!1))}),{hideAccessoryBar:function(e){return cordova.plugins.Keyboard.hideKeyboardAccessoryBar(e)},close:function(){return cordova.plugins.Keyboard.close()},disableScroll:function(e){return cordova.plugins.Keyboard.disableScroll(e)},isVisible:function(){return cordova.plugins.Keyboard.isVisible},clearShowWatch:function(){document.removeEventListener("native.keyboardshow",e),$rootScope.$$listeners["$cordovaKeyboard:show"]=[]},clearHideWatch:function(){document.removeEventListener("native.keyboardhide",n),$rootScope.$$listeners["$cordovaKeyboard:hide"]=[]}}}]),angular.module("ngCordova.plugins.keychain",[]).factory("$cordovaKeychain",["$q","$window",function(e,n){if("Keychain"in n)var t=new Keychain;return{getForKey:function(n,r){var o=e.defer();return t.getForKey(o.resolve,o.reject,n,r),o.promise},setForKey:function(n,r,o){var i=e.defer();return t.setForKey(i.resolve,i.reject,n,r,o),i.promise},removeForKey:function(n,r){var o=e.defer();return t.removeForKey(o.resolve,o.reject,n,r),o.promise}}}]),angular.module("ngCordova.plugins.localNotification",[]).factory("$cordovaLocalNotification",["$q","$window","$rootScope","$timeout",function(e,n,t,r){return document.addEventListener("deviceready",function(){n.plugin&&n.plugin.notification&&(n.plugin.notification.local.on("cancel",function(e,n,o){var i={id:e,state:n,json:o};r(function(){t.$broadcast("$cordovaLocalNotification:canceled",i)})}),n.plugin.notification.local.on("click",function(e,n,o){var i={id:e,state:n,json:o};r(function(){t.$broadcast("$cordovaLocalNotification:clicked",i)})}),n.plugin.notification.local.on("trigger",function(e,n,o){var i={id:e,state:n,json:o};r(function(){t.$broadcast("$cordovaLocalNotification:triggered",i)})}),n.plugin.notification.local.on("add",function(e,n,o){var i={id:e,state:n,json:o};r(function(){t.$broadcast("$cordovaLocalNotification:added",i)})}))},!1),{add:function(t,r){var o=e.defer();return r=r||null,n.plugin.notification.local.add(t,function(e){o.resolve(e)},r),o.promise},cancel:function(t,r){var o=e.defer();return r=r||null,n.plugin.notification.local.cancel(t,function(e){o.resolve(e)},r),o.promise},cancelAll:function(t){var r=e.defer();return t=t||null,n.plugin.notification.local.cancelAll(function(e){r.resolve(e)},t),r.promise},isScheduled:function(t,r){var o=e.defer();return r=r||null,n.plugin.notification.local.isScheduled(t,function(e){o.resolve(e)},r),o.promise},hasPermission:function(t){var r=e.defer();return n.plugin.notification.local.hasPermission(function(e){e?r.resolve(e):r.reject(e)},t),r.promise},promptForPermission:function(){var t=e.defer();return n.plugin.notification.local.promptForPermission(function(e){e?t.resolve(e):t.reject(e)}),t.promise},registerPermission:function(){var t=e.defer();return n.plugin.notification.local.registerPermission(function(e){e?t.resolve(e):t.reject(e)}),t.promise},getScheduledIds:function(t){var r=e.defer();return n.plugin.notification.local.getScheduledIds(function(e){r.resolve(e)},t),r.promise},isTriggered:function(t,r){var o=e.defer();return n.plugin.notification.local.isTriggered(t,function(e){o.resolve(e)},r),o.promise},getTriggeredIds:function(t){var r=e.defer();return n.plugin.notification.local.getTriggeredIds(function(e){r.resolve(e)},t),r.promise},getDefaults:function(){return n.plugin.notification.local.getDefaults()},setDefaults:function(e){n.plugin.notification.local.setDefaults(e)}}}]),angular.module("ngCordova.plugins.mMediaAds",[]).factory("$cordovaMMediaAds",["$q","$window",function(e,n){return{setOptions:function(t){var r=e.defer();return n.mMedia.setOptions(t,function(){r.resolve()},function(){r.reject()}),r.promise},createBanner:function(t){var r=e.defer();return n.mMedia.createBanner(t,function(){r.resolve()},function(){r.reject()}),r.promise},removeBanner:function(){var t=e.defer();return n.mMedia.removeBanner(function(){t.resolve()},function(){t.reject()}),t.promise},showBanner:function(t){var r=e.defer();return n.mMedia.showBanner(t,function(){r.resolve()},function(){r.reject()}),r.promise},showBannerAtXY:function(t,r){var o=e.defer();return n.mMedia.showBannerAtXY(t,r,function(){o.resolve()},function(){o.reject()}),o.promise},hideBanner:function(){var t=e.defer();return n.mMedia.hideBanner(function(){t.resolve()},function(){t.reject()}),t.promise},prepareInterstitial:function(t){var r=e.defer();return n.mMedia.prepareInterstitial(t,function(){r.resolve()},function(){r.reject()}),r.promise},showInterstitial:function(){var t=e.defer();return n.mMedia.showInterstitial(function(){t.resolve()},function(){t.reject()}),t.promise}}}]),angular.module("ngCordova.plugins.media",[]).factory("$cordovaMedia",["$q",function(e){return{newMedia:function(n){var t,r=e.defer(),o=null;return t=new Media(n,function(e){r.resolve(e)},function(e){r.reject(e)},function(e){o=e}),r.promise.getCurrentPosition=function(){t.getCurrentPosition(function(){},function(){})},r.promise.getDuration=function(){t.getDuration()},r.promise.play=function(e){"object"!=typeof e&&(e={}),t.play(e)},r.promise.pause=function(){t.pause()},r.promise.stop=function(){t.stop()},r.promise.release=function(){t.release()},r.promise.seekTo=function(e){t.seekTo(e)},r.promise.setVolume=function(e){t.setVolume(e)},r.promise.startRecord=function(){t.startRecord()},r.promise.stopRecord=function(){t.stopRecord()},r.promise.media=t,r.promise}}}]),angular.module("ngCordova.plugins.mobfoxAds",[]).factory("$cordovaMobFoxAds",["$q","$window",function(e,n){return{setOptions:function(t){var r=e.defer();return n.MobFox.setOptions(t,function(){r.resolve()},function(){r.reject()}),r.promise},createBanner:function(t){var r=e.defer();return n.MobFox.createBanner(t,function(){r.resolve()},function(){r.reject()}),r.promise},removeBanner:function(){var t=e.defer();return n.MobFox.removeBanner(function(){t.resolve()},function(){t.reject()}),t.promise},showBanner:function(t){var r=e.defer();return n.MobFox.showBanner(t,function(){r.resolve()},function(){r.reject()}),r.promise},showBannerAtXY:function(t,r){var o=e.defer();return n.MobFox.showBannerAtXY(t,r,function(){o.resolve()},function(){o.reject()}),o.promise},hideBanner:function(){var t=e.defer();return n.MobFox.hideBanner(function(){t.resolve()},function(){t.reject()}),t.promise},prepareInterstitial:function(t){var r=e.defer();return n.MobFox.prepareInterstitial(t,function(){r.resolve()},function(){r.reject()}),r.promise},showInterstitial:function(){var t=e.defer();return n.MobFox.showInterstitial(function(){t.resolve()},function(){t.reject()}),t.promise}}}]),angular.module("ngCordova.plugins",["ngCordova.plugins.actionSheet","ngCordova.plugins.adMob","ngCordova.plugins.appAvailability","ngCordova.plugins.appRate","ngCordova.plugins.appVersion","ngCordova.plugins.backgroundGeolocation","ngCordova.plugins.badge","ngCordova.plugins.barcodeScanner","ngCordova.plugins.batteryStatus","ngCordova.plugins.ble","ngCordova.plugins.bluetoothSerial","ngCordova.plugins.brightness","ngCordova.plugins.calendar","ngCordova.plugins.camera","ngCordova.plugins.capture","ngCordova.plugins.clipboard","ngCordova.plugins.contacts","ngCordova.plugins.datePicker","ngCordova.plugins.device","ngCordova.plugins.deviceMotion","ngCordova.plugins.deviceOrientation","ngCordova.plugins.dialogs","ngCordova.plugins.emailComposer","ngCordova.plugins.facebook","ngCordova.plugins.facebookAds","ngCordova.plugins.file","ngCordova.plugins.fileTransfer","ngCordova.plugins.fileOpener2","ngCordova.plugins.flashlight","ngCordova.plugins.flurryAds","ngCordova.plugins.ga","ngCordova.plugins.geolocation","ngCordova.plugins.globalization","ngCordova.plugins.googleAds","ngCordova.plugins.googleAnalytics","ngCordova.plugins.googleMap","ngCordova.plugins.googlePlayGame","ngCordova.plugins.healthKit","ngCordova.plugins.httpd","ngCordova.plugins.iAd","ngCordova.plugins.imagePicker","ngCordova.plugins.inAppBrowser","ngCordova.plugins.keyboard","ngCordova.plugins.keychain","ngCordova.plugins.localNotification","ngCordova.plugins.media","ngCordova.plugins.mMediaAds","ngCordova.plugins.mobfoxAds","ngCordova.plugins.mopubAds","ngCordova.plugins.nativeAudio","ngCordova.plugins.network","ngCordova.plugins.oauth","ngCordova.plugins.oauthUtility","ngCordova.plugins.pinDialog","ngCordova.plugins.prefs","ngCordova.plugins.printer","ngCordova.plugins.progressIndicator","ngCordova.plugins.push","ngCordova.plugins.sms","ngCordova.plugins.socialSharing","ngCordova.plugins.spinnerDialog","ngCordova.plugins.splashscreen","ngCordova.plugins.sqlite","ngCordova.plugins.statusbar","ngCordova.plugins.toast","ngCordova.plugins.touchid","ngCordova.plugins.vibration","ngCordova.plugins.videoCapturePlus","ngCordova.plugins.zip","ngCordova.plugins.insomnia"]),angular.module("ngCordova.plugins.mopubAds",[]).factory("$cordovaMoPubAds",["$q","$window",function(e,n){return{setOptions:function(t){var r=e.defer();return n.MoPub.setOptions(t,function(){r.resolve()},function(){r.reject()}),r.promise},createBanner:function(t){var r=e.defer();return n.MoPub.createBanner(t,function(){r.resolve()},function(){r.reject()}),r.promise},removeBanner:function(){var t=e.defer();return n.MoPub.removeBanner(function(){t.resolve()},function(){t.reject()}),t.promise},showBanner:function(t){var r=e.defer();return n.MoPub.showBanner(t,function(){r.resolve()},function(){r.reject()}),r.promise},showBannerAtXY:function(t,r){var o=e.defer();return n.MoPub.showBannerAtXY(t,r,function(){o.resolve()},function(){o.reject()}),o.promise},hideBanner:function(){var t=e.defer();return n.MoPub.hideBanner(function(){t.resolve()},function(){t.reject()}),t.promise},prepareInterstitial:function(t){var r=e.defer();return n.MoPub.prepareInterstitial(t,function(){r.resolve()},function(){r.reject()}),r.promise},showInterstitial:function(){var t=e.defer();return n.MoPub.showInterstitial(function(){t.resolve()},function(){t.reject()}),t.promise}}}]),angular.module("ngCordova.plugins.nativeAudio",[]).factory("$cordovaNativeAudio",["$q","$window",function(e,n){return{preloadSimple:function(t,r){var o=e.defer();return n.plugins.NativeAudio.preloadSimple(t,r,function(e){o.resolve(e)},function(e){o.reject(e)}),o.promise},preloadComplex:function(t,r,o,i){var a=e.defer();return n.plugins.NativeAudio.preloadComplex(t,r,o,i,function(e){a.resolve(e)},function(e){a.reject(e)}),a.promise},play:function(t,r){var o=e.defer();return n.plugins.NativeAudio.play(t,r,function(e){o.resolve(e)},function(e){o.reject(e)}),o.promise},stop:function(t){var r=e.defer();return n.plugins.NativeAudio.stop(t,function(e){r.resolve(e)},function(e){r.reject(e)}),r.promise},loop:function(t){var r=e.defer();return n.plugins.NativeAudio.loop(t,function(e){r.resolve(e)},function(e){r.reject(e)}),r.promise},unload:function(t){var r=e.defer();return n.plugins.NativeAudio.unload(t,function(e){r.resolve(e)},function(e){r.reject(e)}),r.promise},setVolumeForComplexAsset:function(t,r){var o=e.defer();return n.plugins.NativeAudio.setVolumeForComplexAsset(t,r,function(e){o.resolve(e)},function(e){o.reject(e)}),o.promise}}}]),angular.module("ngCordova.plugins.network",[]).factory("$cordovaNetwork",["$rootScope","$timeout",function(e,n){var t=function(){var t=navigator.connection.type;n(function(){e.$broadcast("$cordovaNetwork:offline",t)})},r=function(){var t=navigator.connection.type;n(function(){e.$broadcast("$cordovaNetwork:online",t)})};return document.addEventListener("deviceready",function(){navigator.connection&&(document.addEventListener("offline",t,!1),document.addEventListener("online",r,!1))}),{getNetwork:function(){return navigator.connection.type},isOnline:function(){var e=navigator.connection.type;return e!==Connection.UNKNOWN&&e!==Connection.NONE},isOffline:function(){var e=navigator.connection.type;return e===Connection.UNKNOWN||e===Connection.NONE},clearOfflineWatch:function(){document.removeEventListener("offline",t),e.$$listeners["$cordovaNetwork:offline"]=[]},clearOnlineWatch:function(){document.removeEventListener("online",t),e.$$listeners["$cordovaNetwork:online"]=[]}}}]).run(["$cordovaNetwork",function(){}]),angular.module("ngCordova.plugins.oauth",["ngCordova.plugins.oauthUtility"]).factory("$cordovaOauth",["$q","$http","$cordovaOauthUtility",function(e,n,t){return{adfs:function(t,r,o){var i=e.defer();if(window.cordova){var a=cordova.require("cordova/plugin_list").metadata;if(a.hasOwnProperty("org.apache.cordova.inappbrowser")===!0){var c=window.open(r+"/adfs/oauth2/authorize?response_type=code&client_id="+t+"&redirect_uri=http://localhost/callback&resource="+o,"_blank","location=no");c.addEventListener("loadstart",function(e){if(0===e.url.indexOf("http://localhost/callback")){var o=e.url.split("code=")[1];n.defaults.headers.post["Content-Type"]="application/x-www-form-urlencoded",n({method:"post",url:r+"/adfs/oauth2/token",data:"client_id="+t+"&code="+o+"&redirect_uri=http://localhost/callback&grant_type=authorization_code"}).success(function(e){i.resolve(e)}).error(function(){i.reject("Problem authenticating")}).finally(function(){setTimeout(function(){c.close()},10)})}}),c.addEventListener("exit",function(){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},dropbox:function(n){var t=e.defer();if(window.cordova){var r=cordova.require("cordova/plugin_list").metadata;if(r.hasOwnProperty("org.apache.cordova.inappbrowser")===!0){var o=window.open("https://www.dropbox.com/1/oauth2/authorize?client_id="+n+"&redirect_uri=http://localhost/callback&response_type=token","_blank","location=no,clearsessioncache=yes,clearcache=yes");o.addEventListener("loadstart",function(e){if(0===e.url.indexOf("http://localhost/callback")){for(var n=e.url.split("#")[1],r=n.split("&"),i=[],a=0;ar;r++)n+=t.charAt(Math.floor(Math.random()*t.length));return n}}}]),angular.module("ngCordova.plugins.pinDialog",[]).factory("$cordovaPinDialog",["$q","$window",function(e,n){return{prompt:function(t,r,o){var i=e.defer();return n.plugins.pinDialog.prompt(t,function(e){i.resolve(e)},r,o),i.promise}}}]),angular.module("ngCordova.plugins.prefs",[]).factory("$cordovaPreferences",["$window","$q",function(e,n){return{set:function(t,r){var o=n.defer();return e.appgiraffe.plugins.applicationPreferences.set(t,r,function(e){o.resolve(e)},function(e){o.reject(e)}),o.promise},get:function(t){var r=n.defer();return e.appgiraffe.plugins.applicationPreferences.get(t,function(e){r.resolve(e)},function(e){r.reject(e)}),r.promise}}}]),angular.module("ngCordova.plugins.printer",[]).factory("$cordovaPrinter",["$q","$window",function(e,n){return{isAvailable:function(){var t=e.defer();return n.plugin.printer.isAvailable(function(e){t.resolve(e)}),t.promise},print:function(t,r){var o=e.defer();return n.plugin.printer.print(t,r,function(){o.resolve()}),o.promise}}}]),angular.module("ngCordova.plugins.progressIndicator",[]).factory("$cordovaProgress",["$q",function(){return{show:function(e){var n=e||"Please wait...";return ProgressIndicator.show(n)},showSimple:function(e){var n=e||!1;return ProgressIndicator.showSimple(n)},showSimpleWithLabel:function(e,n){var t=e||!1,r=n||"Loading...";return ProgressIndicator.showSimpleWithLabel(t,r)},showSimpleWithLabelDetail:function(e,n,t){var r=e||!1,o=n||"Loading...",i=t||"Please wait";return ProgressIndicator.showSimpleWithLabelDetail(r,o,i)},showDeterminate:function(e,n){var t=e||!1,r=n||5e4;return ProgressIndicator.showDeterminate(t,r)},showDeterminateWithLabel:function(e,n,t){var r=e||!1,o=n||5e4,i=t||"Loading...";return ProgressIndicator.showDeterminateWithLabel(r,o,i)},showAnnular:function(e,n){var t=e||!1,r=n||5e4;return ProgressIndicator.showAnnular(t,r)},showAnnularWithLabel:function(e,n,t){var r=e||!1,o=n||5e4,i=t||"Loading...";return ProgressIndicator.showAnnularWithLabel(r,o,i)},showBar:function(e,n){var t=e||!1,r=n||5e4;return ProgressIndicator.showBar(t,r)},showBarWithLabel:function(e,n,t){var r=e||!1,o=n||5e4,i=t||"Loading...";return ProgressIndicator.showBarWithLabel(r,o,i)},showSuccess:function(e,n){var t=e||!1,r=n||"Success";return ProgressIndicator.showSuccess(t,r)},showText:function(e,n,t){var r=e||!1,o=n||"Warning",i=t||"center";return ProgressIndicator.showText(r,o,i)},hide:function(){return ProgressIndicator.hide()}}}]),angular.module("ngCordova.plugins.push",[]).factory("$cordovaPush",["$q","$window","$rootScope","$timeout",function(e,n,t,r){return{onNotification:function(e){r(function(){t.$broadcast("$cordovaPush:notificationReceived",e)})},register:function(t){var r,o=e.defer();return void 0!==t&&void 0===t.ecb&&(r=null==document.querySelector("[ng-app]")?"document.body":"document.querySelector('[ng-app]')",t.ecb="angular.element("+r+").injector().get('$cordovaPush').onNotification"),n.plugins.pushNotification.register(function(e){o.resolve(e)},function(e){o.reject(e)},t),o.promise},unregister:function(t){var r=e.defer();return n.plugins.pushNotification.unregister(function(e){r.resolve(e)},function(e){r.reject(e)},t),r.promise},setBadgeNumber:function(t){var r=e.defer();return n.plugins.pushNotification.setApplicationIconBadgeNumber(function(e){r.resolve(e)},function(e){r.reject(e)},t),r.promise}}}]),angular.module("ngCordova.plugins.sms",[]).factory("$cordovaSms",["$q",function(e){return{send:function(n,t,r){var o=e.defer();return sms.send(n,t,r,function(e){o.resolve(e)},function(e){o.reject(e)}),o.promise}}}]),angular.module("ngCordova.plugins.socialSharing",[]).factory("$cordovaSocialSharing",["$q","$window",function(e,n){return{share:function(t,r,o,i){var a=e.defer();return r=r||null,o=o||null,i=i||null,n.plugins.socialsharing.share(t,r,o,i,function(){a.resolve(!0)},function(){a.reject(!1)}),a.promise},shareViaTwitter:function(t,r,o){var i=e.defer();return r=r||null,o=o||null,n.plugins.socialsharing.shareViaTwitter(t,r,o,function(){i.resolve(!0)},function(){i.reject(!1)}),i.promise},shareViaWhatsApp:function(t,r,o){var i=e.defer();return r=r||null,o=o||null,n.plugins.socialsharing.shareViaWhatsApp(t,r,o,function(){i.resolve(!0)},function(){i.reject(!1)}),i.promise},shareViaFacebook:function(t,r,o){var i=e.defer();return t=t||null,r=r||null,o=o||null,n.plugins.socialsharing.shareViaFacebook(t,r,o,function(){i.resolve(!0)},function(){i.reject(!1)}),i.promise},shareViaFacebookWithPasteMessageHint:function(t,r,o,i){var a=e.defer();return r=r||null,o=o||null,n.plugins.socialsharing.shareViaFacebookWithPasteMessageHint(t,r,o,i,function(){a.resolve(!0)},function(){a.reject(!1)}),a.promise},shareViaSMS:function(t,r){var o=e.defer();return n.plugins.socialsharing.shareViaSMS(t,r,function(){o.resolve(!0)},function(){o.reject(!1)}),o.promise},shareViaEmail:function(t,r,o,i,a,c){var u=e.defer();return o=o||null,i=i||null,a=a||null,c=c||null,n.plugins.socialsharing.shareViaEmail(t,r,o,i,a,c,function(){u.resolve(!0)},function(){u.reject(!1)}),u.promise},shareVia:function(t,r,o,i,a){var c=e.defer();return r=r||null,o=o||null,i=i||null,a=a||null,n.plugins.socialsharing.shareVia(t,r,o,i,a,function(){c.resolve(!0)},function(){c.reject(!1)}),c.promise},canShareViaEmail:function(){var t=e.defer();return n.plugins.socialsharing.canShareViaEmail(function(){t.resolve(!0)},function(){t.reject(!1)}),t.promise},canShareVia:function(t,r,o,i,a){var c=e.defer();return n.plugins.socialsharing.canShareVia(t,r,o,i,a,function(e){c.resolve(e)},function(e){c.reject(e)}),c.promise},available:function(){var n=e.defer();window.plugins.socialsharing.available(function(e){e?n.resolve():n.reject()})}}}]),angular.module("ngCordova.plugins.spinnerDialog",[]).factory("$cordovaSpinnerDialog",["$window",function(e){return{show:function(n,t,r){return r=r||!1,e.plugins.spinnerDialog.show(n,t,r)},hide:function(){return e.plugins.spinnerDialog.hide()}}}]),angular.module("ngCordova.plugins.splashscreen",[]).factory("$cordovaSplashscreen",[function(){return{hide:function(){return navigator.splashscreen.hide()},show:function(){return navigator.splashscreen.show()}}}]),angular.module("ngCordova.plugins.sqlite",[]).factory("$cordovaSQLite",["$q","$window",function(e,n){return{openDB:function(e,t){return"undefined"==typeof t&&(t=0),n.sqlitePlugin.openDatabase({name:e,bgType:t})},execute:function(n,t,r){var o=e.defer();return n.transaction(function(e){e.executeSql(t,r,function(e,n){o.resolve(n)},function(e,n){o.reject(n)})}),o.promise},insertCollection:function(n,t,r){var o=e.defer(),i=r.slice(0);return n.transaction(function(e){!function n(){var r=i.splice(0,1)[0];try{e.executeSql(t,r,function(e,t){0===i.length?o.resolve(t):n()},function(e,n){o.reject(n)})}catch(a){o.reject(a)}}()}),o.promise},nestedExecute:function(n,t,r,o,i){var a=e.defer();return n.transaction(function(e){e.executeSql(t,o,function(e,n){a.resolve(n),e.executeSql(r,i,function(e,n){a.resolve(n)})})},function(e,n){a.reject(n)}),a.promise},deleteDB:function(t){var r=e.defer();return n.sqlitePlugin.deleteDatabase(t,function(e){r.resolve(e)},function(e){r.reject(e)}),r.promise}}}]),angular.module("ngCordova.plugins.statusbar",[]).factory("$cordovaStatusbar",[function(){return{overlaysWebView:function(e){return StatusBar.overlaysWebView(!!e)},style:function(e){switch(e){case 0:return StatusBar.styleDefault();case 1:return StatusBar.styleLightContent();case 2:return StatusBar.styleBlackTranslucent();case 3:return StatusBar.styleBlackOpaque();default:return StatusBar.styleDefault()}},styleColor:function(e){return StatusBar.backgroundColorByName(e)},styleHex:function(e){return StatusBar.backgroundColorByHexString(e)},hide:function(){return StatusBar.hide()},show:function(){return StatusBar.show()},isVisible:function(){return StatusBar.isVisible}}}]),angular.module("ngCordova.plugins.toast",[]).factory("$cordovaToast",["$q","$window",function(e,n){return{showShortTop:function(t){var r=e.defer();return n.plugins.toast.showShortTop(t,function(e){r.resolve(e)},function(e){r.reject(e)}),r.promise},showShortCenter:function(t){var r=e.defer();return n.plugins.toast.showShortCenter(t,function(e){r.resolve(e)},function(e){r.reject(e)}),r.promise},showShortBottom:function(t){var r=e.defer();return n.plugins.toast.showShortBottom(t,function(e){r.resolve(e)},function(e){r.reject(e)}),r.promise},showLongTop:function(t){var r=e.defer();return n.plugins.toast.showLongTop(t,function(e){r.resolve(e)},function(e){r.reject(e)}),r.promise},showLongCenter:function(t){var r=e.defer();return n.plugins.toast.showLongCenter(t,function(e){r.resolve(e)},function(e){r.reject(e)}),r.promise},showLongBottom:function(t){var r=e.defer();return n.plugins.toast.showLongBottom(t,function(e){r.resolve(e)},function(e){r.reject(e)}),r.promise},show:function(t,r,o){var i=e.defer();return n.plugins.toast.show(t,r,o,function(e){i.resolve(e)},function(e){i.reject(e)}),i.promise}}}]),angular.module("ngCordova.plugins.touchid",[]).factory("$cordovaTouchID",["$q",function(e){return{checkSupport:function(){var n=e.defer();return window.cordova?touchid.checkSupport(function(e){n.resolve(e)},function(e){n.reject(e)}):n.reject("Not supported without cordova.js"),n.promise},authenticate:function(n){var t=e.defer();return window.cordova?touchid.authenticate(function(e){t.resolve(e)},function(e){t.reject(e)},n):t.reject("Not supported without cordova.js"),t.promise}}}]),angular.module("ngCordova.plugins.vibration",[]).factory("$cordovaVibration",[function(){return{vibrate:function(e){return navigator.notification.vibrate(e)},vibrateWithPattern:function(e,n){return navigator.notification.vibrateWithPattern(e,n)},cancelVibration:function(){return navigator.notification.cancelVibration()}}}]),angular.module("ngCordova.plugins.videoCapturePlus",[]).provider("$cordovaVideoCapturePlus",[function(){var e={};this.setLimit=function(n){e.limit=n},this.setMaxDuration=function(n){e.duration=n},this.setHighQuality=function(n){e.highquality=n},this.useFrontCamera=function(n){e.frontcamera=n},this.setPortraitOverlay=function(n){e.portraitOverlay=n},this.setLandscapeOverlay=function(n){e.landscapeOverlay=n},this.setOverlayText=function(n){e.overlayText=n},this.$get=["$q","$window",function(n,t){return{captureVideo:function(r){var o=n.defer();return t.plugins.videocaptureplus?(t.plugins.videocaptureplus.captureVideo(o.resolve,o.reject,angular.extend({},e,r)),o.promise):(o.resolve(null),o.promise)}}}]}]),angular.module("ngCordova.plugins.zip",[]).factory("$cordovaZip",["$q","$window",function(e,n){return{unzip:function(t,r){var o=e.defer();return n.zip.unzip(t,r,function(e){0===e?o.resolve():o.reject()},function(e){o.notify(e)}),o.promise}}}])}(); +!function(){angular.module("ngCordova",["ngCordova.plugins"]),angular.module("ngCordova.plugins.actionSheet",[]).factory("$cordovaActionSheet",["$q","$window",function(e,n){return{show:function(t){var o=e.defer();return n.plugins.actionsheet.show(t,function(e){o.resolve(e)}),o.promise},hide:function(){return n.plugins.actionsheet.hide()}}}]),angular.module("ngCordova.plugins.adMob",[]).factory("$cordovaAdMob",["$q","$window",function(e,n){return{createBannerView:function(t){var o=e.defer();return n.plugins.AdMob.createBannerView(t,function(){o.resolve()},function(){o.reject()}),o.promise},createInterstitialView:function(t){var o=e.defer();return n.plugins.AdMob.createInterstitialView(t,function(){o.resolve()},function(){o.reject()}),o.promise},requestAd:function(t){var o=e.defer();return n.plugins.AdMob.requestAd(t,function(){o.resolve()},function(){o.reject()}),o.promise},showAd:function(t){var o=e.defer();return n.plugins.AdMob.showAd(t,function(){o.resolve()},function(){o.reject()}),o.promise},requestInterstitialAd:function(t){var o=e.defer();return n.plugins.AdMob.requestInterstitialAd(t,function(){o.resolve()},function(){o.reject()}),o.promise}}}]),angular.module("ngCordova.plugins.appAvailability",[]).factory("$cordovaAppAvailability",["$q",function(e){return{check:function(n){var t=e.defer();return appAvailability.check(n,function(e){t.resolve(e)},function(e){t.reject(e)}),t.promise}}}]),angular.module("ngCordova.plugins.appRate",[]).provider("$cordovaAppRate",[function(){this.setPreferences=function(e){e&&angular.isObject(e)&&(AppRate.preferences.useLanguage=e.language||null,AppRate.preferences.displayAppName=e.appName||"",AppRate.preferences.promptAgainForEachNewVersion=e.promptForNewVersion||!0,AppRate.preferences.openStoreInApp=e.openStoreInApp||!1,AppRate.preferences.usesUntilPrompt=e.usesUntilPrompt||3,AppRate.preferences.useCustomRateDialog=e.useCustomRateDialog||!1,AppRate.preferences.storeAppURL.ios=e.iosURL||null,AppRate.preferences.storeAppURL.android=e.androidURL||null,AppRate.preferences.storeAppURL.blackberry=e.blackberryURL||null,AppRate.preferences.storeAppURL.windows8=e.windowsURL||null)},this.setCustomLocale=function(e){var n={title:"Rate %@",message:"If you enjoy using %@, would you mind taking a moment to rate it? It won’t take more than a minute. Thanks for your support!",cancelButtonLabel:"No, Thanks",laterButtonLabel:"Remind Me Later",rateButtonLabel:"Rate It Now"};n=angular.extend(n,e),AppRate.preferences.customLocale=n},this.$get=["$q",function(e){return{promptForRating:function(n){var t=e.defer(),o=AppRate.promptForRating(n);return t.resolve(o),t.promise},navigateToAppStore:function(){var n=e.defer(),t=AppRate.navigateToAppStore();return n.resolve(t),n.promise},onButtonClicked:function(e){AppRate.onButtonClicked=function(n){e.call(this,n)}},onRateDialogShow:function(e){AppRate.onRateDialogShow=e()}}}]}]),angular.module("ngCordova.plugins.appVersion",[]).factory("$cordovaAppVersion",["$q",function(e){return{getAppVersion:function(){var n=e.defer();return cordova.getAppVersion(function(e){n.resolve(e)}),n.promise}}}]),angular.module("ngCordova.plugins.backgroundGeolocation",[]).factory("$cordovaBackgroundGeolocation",["$q","$window",function(e,n){return{init:function(){n.navigator.geolocation.getCurrentPosition(function(e){return e})},configure:function(t){this.init();var o=e.defer();return n.plugins.backgroundGeoLocation.configure(function(e){o.notify(e),n.plugins.backgroundGeoLocation.finish()},function(e){o.reject(e)},t),this.start(),o.promise},start:function(){var t=e.defer();return n.plugins.backgroundGeoLocation.start(function(e){t.resolve(e)},function(e){t.reject(e)}),t.promise},stop:function(){var t=e.defer();return n.plugins.backgroundGeoLocation.stop(function(e){t.resolve(e)},function(e){t.reject(e)}),t.promise}}}]),angular.module("ngCordova.plugins.badge",[]).factory("$cordovaBadge",["$q",function(e){return{hasPermission:function(){var n=e.defer();return cordova.plugins.notification.badge.hasPermission(function(e){e?n.resolve(!0):n.reject("You do not have permission")}),n.promise},promptForPermission:function(){return cordova.plugins.notification.badge.promptForPermission()},set:function(n){var t=e.defer();return cordova.plugins.notification.badge.hasPermission(function(e){e?t.resolve(cordova.plugins.notification.badge.set(n)):t.reject("You do not have permission to set Badge")}),t.promise},get:function(){var n=e.defer();return cordova.plugins.notification.badge.hasPermission(function(e){e?cordova.plugins.notification.badge.get(function(e){n.resolve(e)}):n.reject("You do not have permission to get Badge")}),n.promise},clear:function(){var n=e.defer();return cordova.plugins.notification.badge.hasPermission(function(e){e?n.resolve(cordova.plugins.notification.badge.clear()):n.reject("You do not have permission to clear Badge")}),n.promise},configure:function(e){return cordova.plugins.notification.badge.configure(e)}}}]),angular.module("ngCordova.plugins.barcodeScanner",[]).factory("$cordovaBarcodeScanner",["$q",function(e){return{scan:function(n){var t=e.defer();return cordova.plugins.barcodeScanner.scan(function(e){t.resolve(e)},function(e){t.reject(e)},n),t.promise},encode:function(n,t){var o=e.defer();return n=n||"TEXT_TYPE",cordova.plugins.barcodeScanner.encode(n,t,function(e){o.resolve(e)},function(e){o.reject(e)}),o.promise}}}]),angular.module("ngCordova.plugins.batteryStatus",[]).factory("$cordovaBatteryStatus",["$rootScope","$window","$timeout",function(e,n,t){var o=function(n){t(function(){e.$broadcast("$cordovaBatteryStatus:status",n)})},r=function(n){t(function(){e.$broadcast("$cordovaBatteryStatus:critical",n)})},i=function(n){t(function(){e.$broadcast("$cordovaBatteryStatus:low",n)})};return document.addEventListener("deviceready",function(){navigator.battery&&(n.addEventListener("batterystatus",o,!1),n.addEventListener("batterycritical",r,!1),n.addEventListener("batterylow",i,!1))},!1),!0}]).run(["$cordovaBatteryStatus",function(){}]),angular.module("ngCordova.plugins.ble",[]).factory("$cordovaBLE",["$q",function(e){return{scan:function(n,t){var o=e.defer();return ble.scan(n,t,function(e){o.resolve(e)},function(e){o.reject(e)}),o.promise},connect:function(n){var t=e.defer();return ble.connect(n,function(e){t.resolve(e)},function(e){t.reject(e)}),t.promise},disconnect:function(n){var t=e.defer();return ble.disconnect(n,function(e){t.resolve(e)},function(e){t.reject(e)}),t.promise},read:function(n,t,o){var r=e.defer();return ble.read(n,t,o,function(e){r.resolve(e)},function(e){r.reject(e)}),r.promise},write:function(n,t,o,r){var i=e.defer();return ble.write(n,t,o,r,function(e){i.resolve(e)},function(e){i.reject(e)}),i.promise},writeCommand:function(n,t,o,r){var i=e.defer();return ble.writeCommand(n,t,o,r,function(e){i.resolve(e)},function(e){i.reject(e)}),i.promise},startNotification:function(n,t,o){var r=e.defer();return ble.startNotification(n,t,o,function(e){r.resolve(e)},function(e){r.reject(e)}),r.promise},stopNotification:function(n,t,o){var r=e.defer();return ble.stopNotification(n,t,o,function(e){r.resolve(e)},function(e){r.reject(e)}),r.promise},isConnected:function(n){var t=e.defer();return ble.isConnected(n,function(e){t.resolve(e)},function(e){t.reject(e)}),t.promise},isEnabled:function(){var n=e.defer();return ble.isEnabled(function(e){n.resolve(e)},function(e){n.reject(e)}),n.promise}}}]),angular.module("ngCordova.plugins.bluetoothSerial",[]).factory("$cordovaBluetoothSerial",["$q","$window",function(e,n){return{connect:function(t){var o=e.defer();return n.bluetoothSerial.connect(t,function(){o.resolve()},function(e){o.reject(e)}),o.promise},connectInsecure:function(t){var o=e.defer();return n.bluetoothSerial.connectInsecure(t,function(){o.resolve()},function(e){o.reject(e)}),o.promise},disconnect:function(){var t=e.defer();return n.bluetoothSerial.disconnect(function(){t.resolve()},function(e){t.reject(e)}),t.promise},list:function(){var t=e.defer();return n.bluetoothSerial.list(function(e){t.resolve(e)},function(e){t.reject(e)}),t.promise},discoverUnpaired:function(){var t=e.defer();return n.bluetoothSerial.discoverUnpaired(function(e){t.resolve(e)},function(e){t.reject(e)}),t.promise},setDeviceDiscoveredListener:function(){var t=e.defer();return n.bluetoothSerial.setDeviceDiscoveredListener(function(e){t.notify(e)}),t.promise},clearDeviceDiscoveredListener:function(){n.bluetoothSerial.clearDeviceDiscoveredListener()},showBluetoothSettings:function(){var t=e.defer();return n.bluetoothSerial.showBluetoothSettings(function(){t.resolve()},function(e){t.reject(e)}),t.promise},isEnabled:function(){var t=e.defer();return n.bluetoothSerial.isEnabled(function(){t.resolve()},function(){t.reject()}),t.promise},enable:function(){var t=e.defer();return n.bluetoothSerial.enable(function(){t.resolve()},function(){t.reject()}),t.promise},isConnected:function(){var t=e.defer();return n.bluetoothSerial.isConnected(function(){t.resolve()},function(){t.reject()}),t.promise},available:function(){var t=e.defer();return n.bluetoothSerial.available(function(e){t.resolve(e)},function(e){t.reject(e)}),t.promise},read:function(){var t=e.defer();return n.bluetoothSerial.read(function(e){t.resolve(e)},function(e){t.reject(e)}),t.promise},readUntil:function(t){var o=e.defer();return n.bluetoothSerial.readUntil(t,function(e){o.resolve(e)},function(e){o.reject(e)}),o.promise},write:function(t){var o=e.defer();return n.bluetoothSerial.write(t,function(){o.resolve()},function(e){o.reject(e)}),o.promise},subscribe:function(t){var o=e.defer();return n.bluetoothSerial.subscribe(t,function(e){o.notify(e)},function(e){o.reject(e)}),o.promise},subscribeRawData:function(){var t=e.defer();return n.bluetoothSerial.subscribeRawData(function(e){t.notify(e)},function(e){t.reject(e)}),t.promise},unsubscribe:function(){var t=e.defer();return n.bluetoothSerial.unsubscribe(function(){t.resolve()},function(e){t.reject(e)}),t.promise},unsubscribeRawData:function(){var t=e.defer();return n.bluetoothSerial.unsubscribeRawData(function(){t.resolve()},function(e){t.reject(e)}),t.promise},clear:function(){var t=e.defer();return n.bluetoothSerial.clear(function(){t.resolve()},function(e){t.reject(e)}),t.promise},readRSSI:function(){var t=e.defer();return n.bluetoothSerial.readRSSI(function(e){t.resolve(e)},function(e){t.reject(e)}),t.promise}}}]),angular.module("ngCordova.plugins.brightness",[]).factory("$cordovaBrightness",["$q","$window",function(e,n){return{get:function(){var t=e.defer();return n.cordova.plugins.brightness.getBrightness(function(e){t.resolve(e)},function(e){t.reject(e)}),t.promise},set:function(t){var o=e.defer();return n.cordova.plugins.brightness.setBrightness(t,function(e){o.resolve(e)},function(e){o.reject(e)}),o.promise},setKeepScreenOn:function(t){var o=e.defer();return n.cordova.plugins.brightness.setKeepScreenOn(t,function(e){o.resolve(e)},function(e){o.reject(e)}),o.promise}}}]),angular.module("ngCordova.plugins.calendar",[]).factory("$cordovaCalendar",["$q","$window",function(e,n){return{createCalendar:function(t){var o=e.defer(),r=n.plugins.calendar.getCreateCalendarOptions();return"string"==typeof t?r.calendarName=t:r=angular.extend(r,t),n.plugins.calendar.createCalendar(r,function(e){o.resolve(e)},function(e){o.reject(e)}),o.promise},deleteCalendar:function(t){var o=e.defer();return n.plugins.calendar.deleteCalendar(t,function(e){o.resolve(e)},function(e){o.reject(e)}),o.promise},createEvent:function(t){var o=e.defer(),r={title:null,location:null,notes:null,startDate:null,endDate:null};return r=angular.extend(r,t),n.plugins.calendar.createEvent(r.title,r.location,r.notes,new Date(r.startDate),new Date(r.endDate),function(e){o.resolve(e)},function(e){o.reject(e)}),o.promise},createEventWithOptions:function(t){var o=e.defer(),r=[],i=window.plugins.calendar.getCalendarOptions(),a={title:null,location:null,notes:null,startDate:null,endDate:null};r=Object.keys(a);for(var c in t)-1===r.indexOf(c)?i[c]=t[c]:a[c]=t[c];return n.plugins.calendar.createEventWithOptions(a.title,a.location,a.notes,new Date(a.startDate),new Date(a.endDate),i,function(e){o.resolve(e)},function(e){o.reject(e)}),o.promise},createEventInteractively:function(t){var o=e.defer(),r={title:null,location:null,notes:null,startDate:null,endDate:null};return r=angular.extend(r,t),n.plugins.calendar.createEventInteractively(r.title,r.location,r.notes,new Date(r.startDate),new Date(r.endDate),function(e){o.resolve(e)},function(e){o.reject(e)}),o.promise},createEventInNamedCalendar:function(t){var o=e.defer(),r={title:null,location:null,notes:null,startDate:null,endDate:null,calendarName:null};return r=angular.extend(r,t),n.plugins.calendar.createEventInNamedCalendar(r.title,r.location,r.notes,new Date(r.startDate),new Date(r.endDate),r.calendarName,function(e){o.resolve(e)},function(e){o.reject(e)}),o.promise},findEvent:function(t){var o=e.defer(),r={title:null,location:null,notes:null,startDate:null,endDate:null};return r=angular.extend(r,t),n.plugins.calendar.findEvent(r.title,r.location,r.notes,new Date(r.startDate),new Date(r.endDate),function(e){o.resolve(e)},function(e){o.reject(e)}),o.promise},listEventsInRange:function(t,o){var r=e.defer();return n.plugins.calendar.listEventsInRange(t,o,function(e){r.resolve(e)},function(e){r.reject(e)}),r.promise},listCalendars:function(){var t=e.defer();return n.plugins.calendar.listCalendars(function(e){t.resolve(e)},function(e){t.reject(e)}),t.promise},findAllEventsInNamedCalendar:function(t){var o=e.defer();return n.plugins.calendar.findAllEventsInNamedCalendar(t,function(e){o.resolve(e)},function(e){o.reject(e)}),o.promise},modifyEvent:function(t){var o=e.defer(),r={title:null,location:null,notes:null,startDate:null,endDate:null,newTitle:null,newLocation:null,newNotes:null,newStartDate:null,newEndDate:null};return r=angular.extend(r,t),n.plugins.calendar.modifyEvent(r.title,r.location,r.notes,new Date(r.startDate),new Date(r.endDate),r.newTitle,r.newLocation,r.newNotes,new Date(r.newStartDate),new Date(r.newEndDate),function(e){o.resolve(e)},function(e){o.reject(e)}),o.promise},deleteEvent:function(t){var o=e.defer(),r={newTitle:null,location:null,notes:null,startDate:null,endDate:null};return r=angular.extend(r,t),n.plugins.calendar.deleteEvent(r.newTitle,r.location,r.notes,new Date(r.startDate),new Date(r.endDate),function(e){o.resolve(e)},function(e){o.reject(e)}),o.promise}}}]),angular.module("ngCordova.plugins.camera",[]).factory("$cordovaCamera",["$q",function(e){return{getPicture:function(n){var t=e.defer();return navigator.camera?(navigator.camera.getPicture(function(e){t.resolve(e)},function(e){t.reject(e)},n),t.promise):(t.resolve(null),t.promise)},cleanup:function(){var n=e.defer();return navigator.camera.cleanup(function(){n.resolve()},function(e){n.reject(e)}),n.promise}}}]),angular.module("ngCordova.plugins.capture",[]).factory("$cordovaCapture",["$q",function(e){return{captureAudio:function(n){var t=e.defer();return navigator.device.capture?(navigator.device.capture.captureAudio(function(e){t.resolve(e)},function(e){t.reject(e)},n),t.promise):(t.resolve(null),t.promise)},captureImage:function(n){var t=e.defer();return navigator.device.capture?(navigator.device.capture.captureImage(function(e){t.resolve(e)},function(e){t.reject(e)},n),t.promise):(t.resolve(null),t.promise)},captureVideo:function(n){var t=e.defer();return navigator.device.capture?(navigator.device.capture.captureVideo(function(e){t.resolve(e)},function(e){t.reject(e)},n),t.promise):(t.resolve(null),t.promise)}}}]),angular.module("ngCordova.plugins.clipboard",[]).factory("$cordovaClipboard",["$q","$window",function(e,n){return{copy:function(t){var o=e.defer();return n.cordova.plugins.clipboard.copy(t,function(){o.resolve()},function(){o.reject()}),o.promise},paste:function(){var t=e.defer();return n.cordova.plugins.clipboard.paste(function(e){t.resolve(e)},function(){t.reject()}),t.promise}}}]),angular.module("ngCordova.plugins.contacts",[]).factory("$cordovaContacts",["$q",function(e){return{save:function(n){var t=e.defer(),o=navigator.contacts.create(n);return o.save(function(e){t.resolve(e)},function(e){t.reject(e)}),t.promise},remove:function(n){var t=e.defer(),o=navigator.contacts.create(n);return o.remove(function(e){t.resolve(e)},function(e){t.reject(e)}),t.promise},clone:function(e){var n=navigator.contacts.create(e);return n.clone(e)},find:function(n){var t=e.defer(),o=n.fields||["id","displayName"];return delete n.fields,navigator.contacts.find(o,function(e){t.resolve(e)},function(e){t.reject(e)},n),t.promise},pickContact:function(){var n=e.defer();return navigator.contacts.pickContact(function(e){n.resolve(e)},function(e){n.reject(e)}),n.promise}}}]),angular.module("ngCordova.plugins.datePicker",[]).factory("$cordovaDatePicker",["$window","$q",function(e,n){return{show:function(t){var o=n.defer();return t=t||{date:new Date,mode:"date"},e.datePicker.show(t,function(e){o.resolve(e)}),o.promise}}}]),angular.module("ngCordova.plugins.device",[]).factory("$cordovaDevice",[function(){return{getDevice:function(){return device},getCordova:function(){return device.cordova},getModel:function(){return device.model},getName:function(){return device.name},getPlatform:function(){return device.platform},getUUID:function(){return device.uuid},getVersion:function(){return device.version}}}]),angular.module("ngCordova.plugins.deviceMotion",[]).factory("$cordovaDeviceMotion",["$q",function(e){return{getCurrentAcceleration:function(){var n=e.defer();return navigator.accelerometer.getCurrentAcceleration(function(e){n.resolve(e)},function(e){n.reject(e)}),n.promise},watchAcceleration:function(n){var t=e.defer(),o=navigator.accelerometer.watchAcceleration(function(e){t.notify(e)},function(e){t.reject(e)},n);return t.promise.cancel=function(){navigator.accelerometer.clearWatch(o)},t.promise.clearWatch=function(e){navigator.accelerometer.clearWatch(e||o)},t.promise.watchID=o,t.promise},clearWatch:function(e){return navigator.accelerometer.clearWatch(e)}}}]),angular.module("ngCordova.plugins.deviceOrientation",[]).factory("$cordovaDeviceOrientation",["$q",function(e){var n={frequency:3e3};return{getCurrentHeading:function(){var n=e.defer();return navigator.compass.getCurrentHeading(function(e){n.resolve(e)},function(e){n.reject(e)}),n.promise},watchHeading:function(t){var o=e.defer(),r=angular.extend(n,t),i=navigator.compass.watchHeading(function(e){o.notify(e)},function(e){o.reject(e)},r);return o.promise.cancel=function(){navigator.compass.clearWatch(i)},o.promise.clearWatch=function(e){navigator.compass.clearWatch(e||i)},o.promise.watchID=i,o.promise},clearWatch:function(e){return navigator.compass.clearWatch(e)}}}]),angular.module("ngCordova.plugins.dialogs",[]).factory("$cordovaDialogs",["$q","$window",function(e,n){return{alert:function(t,o,r){var i=e.defer();return n.navigator.notification?navigator.notification.alert(t,function(){i.resolve()},o,r):(n.alert(t),i.resolve()),i.promise},confirm:function(t,o,r){var i=e.defer();return n.navigator.notification?navigator.notification.confirm(t,function(e){i.resolve(e)},o,r):i.resolve(n.confirm(t)?1:2),i.promise},prompt:function(t,o,r,i){var a=e.defer();if(n.navigator.notification)navigator.notification.prompt(t,function(e){a.resolve(e)},o,r,i);else{var c=n.prompt(t,i);a.resolve(null!==c?{input1:c,buttonIndex:1}:{input1:c,buttonIndex:2})}return a.promise},beep:function(e){return navigator.notification.beep(e)}}}]),angular.module("ngCordova.plugins.emailComposer",[]).factory("$cordovaEmailComposer",["$q",function(e){return{isAvailable:function(){var n=e.defer();return cordova.plugins.email.isAvailable(function(e){e?n.resolve():n.reject()}),n.promise},open:function(n){var t=e.defer();return cordova.plugins.email.open(n,function(){t.reject()}),t.promise},addAlias:function(e,n){cordova.plugins.email.addAlias(e,n)}}}]),angular.module("ngCordova.plugins.facebook",[]).provider("$cordovaFacebook",[function(){this.browserInit=function(e,n){this.appID=e,this.appVersion=n||"v2.0",facebookConnectPlugin.browserInit(this.appID,this.appVersion)},this.$get=["$q",function(e){return{login:function(n){var t=e.defer();return facebookConnectPlugin.login(n,function(e){t.resolve(e)},function(e){t.reject(e)}),t.promise},showDialog:function(n){var t=e.defer();return facebookConnectPlugin.showDialog(n,function(e){t.resolve(e)},function(e){t.reject(e)}),t.promise},api:function(n,t){var o=e.defer();return facebookConnectPlugin.api(n,t,function(e){o.resolve(e)},function(e){o.reject(e)}),o.promise},getAccessToken:function(){var n=e.defer();return facebookConnectPlugin.getAccessToken(function(e){n.resolve(e)},function(e){n.reject(e)}),n.promise},getLoginStatus:function(){var n=e.defer();return facebookConnectPlugin.getLoginStatus(function(e){n.resolve(e)},function(e){n.reject(e)}),n.promise},logout:function(){var n=e.defer();return facebookConnectPlugin.logout(function(e){n.resolve(e)},function(e){n.reject(e)}),n.promise}}}]}]),angular.module("ngCordova.plugins.facebookAds",[]).factory("$cordovaFacebookAds",["$q","$window",function(e,n){return{setOptions:function(t){var o=e.defer();return n.FacebookAds.setOptions(t,function(){o.resolve()},function(){o.reject()}),o.promise},createBanner:function(t){var o=e.defer();return n.FacebookAds.createBanner(t,function(){o.resolve()},function(){o.reject()}),o.promise},removeBanner:function(){var t=e.defer();return n.FacebookAds.removeBanner(function(){t.resolve()},function(){t.reject()}),t.promise},showBanner:function(t){var o=e.defer();return n.FacebookAds.showBanner(t,function(){o.resolve()},function(){o.reject()}),o.promise},showBannerAtXY:function(t,o){var r=e.defer();return n.FacebookAds.showBannerAtXY(t,o,function(){r.resolve()},function(){r.reject()}),r.promise},hideBanner:function(){var t=e.defer();return n.FacebookAds.hideBanner(function(){t.resolve()},function(){t.reject()}),t.promise},prepareInterstitial:function(t){var o=e.defer();return n.FacebookAds.prepareInterstitial(t,function(){o.resolve()},function(){o.reject()}),o.promise},showInterstitial:function(){var t=e.defer();return n.FacebookAds.showInterstitial(function(){t.resolve()},function(){t.reject()}),t.promise}}}]),angular.module("ngCordova.plugins.file",[]).constant("$cordovaFileError",{1:"NOT_FOUND_ERR",2:"SECURITY_ERR",3:"ABORT_ERR",4:"NOT_READABLE_ERR",5:"ENCODING_ERR",6:"NO_MODIFICATION_ALLOWED_ERR",7:"INVALID_STATE_ERR",8:"SYNTAX_ERR",9:"INVALID_MODIFICATION_ERR",10:"QUOTA_EXCEEDED_ERR",11:"TYPE_MISMATCH_ERR",12:"PATH_EXISTS_ERR"}).provider("$cordovaFile",[function(){this.$get=["$q","$window","$cordovaFileError",function(e,n,t){return{getFreeDiskSpace:function(){var n=e.defer();return cordova.exec(function(e){n.resolve(e)},function(e){n.reject(e)},"File","getFreeDiskSpace",[]),n.promise},checkDir:function(o,r){var i=e.defer();/^\//.test(r)&&i.reject("directory cannot start with /");try{var a=o+r;n.resolveLocalFileSystemURL(a,function(e){e.isDirectory===!0?i.resolve(e):i.reject({code:13,message:"input is not a directory"})},function(e){e.message=t[e.code],i.reject(e)})}catch(c){c.message=t[c.code],i.reject(c)}return i.promise},checkFile:function(o,r){var i=e.defer();/^\//.test(r)&&i.reject("directory cannot start with /");try{var a=o+r;n.resolveLocalFileSystemURL(a,function(e){e.isFile===!0?i.resolve(e):i.reject({code:13,message:"input is not a file"})},function(e){e.message=t[e.code],i.reject(e)})}catch(c){c.message=t[c.code],i.reject(c)}return i.promise},createDir:function(o,r,i){var a=e.defer();/^\//.test(r)&&a.reject("directory cannot start with /"),i=i?!1:!0;var c={create:!0,exclusive:i};try{n.resolveLocalFileSystemURL(o,function(e){e.getDirectory(r,c,function(e){a.resolve(e)},function(e){e.message=t[e.code],a.reject(e)})},function(e){e.message=t[e.code],a.reject(e)})}catch(u){u.message=t[u.code],a.reject(u)}return a.promise},createFile:function(o,r,i){var a=e.defer();/^\//.test(r)&&a.reject("file-name cannot start with /"),i=i?!1:!0;var c={create:!0,exclusive:i};try{n.resolveLocalFileSystemURL(o,function(e){e.getFile(r,c,function(e){a.resolve(e)},function(e){e.message=t[e.code],a.reject(e)})},function(e){e.message=t[e.code],a.reject(e)})}catch(u){u.message=t[u.code],a.reject(u)}return a.promise},removeDir:function(o,r){var i=e.defer();/^\//.test(r)&&i.reject("file-name cannot start with /");try{n.resolveLocalFileSystemURL(o,function(e){e.getDirectory(r,{create:!1},function(e){e.remove(function(){i.resolve({success:!0,fileRemoved:e})},function(e){e.message=t[e.code],i.reject(e)})},function(e){e.message=t[e.code],i.reject(e)})},function(e){e.message=t[e.code],i.reject(e)})}catch(a){a.message=t[a.code],i.reject(a)}return i.promise},removeFile:function(o,r){var i=e.defer();/^\//.test(r)&&i.reject("file-name cannot start with /");try{n.resolveLocalFileSystemURL(o,function(e){e.getFile(r,{create:!1},function(e){e.remove(function(){i.resolve({success:!0,fileRemoved:e})},function(e){e.message=t[e.code],i.reject(e)})},function(e){e.message=t[e.code],i.reject(e)})},function(e){e.message=t[e.code],i.reject(e)})}catch(a){a.message=t[a.code],i.reject(a)}return i.promise},removeRecursively:function(o,r){var i=e.defer();/^\//.test(r)&&i.reject("file-name cannot start with /");try{n.resolveLocalFileSystemURL(o,function(e){e.getDirectory(r,{create:!1},function(e){e.removeRecursively(function(){i.resolve({success:!0,fileRemoved:e})},function(e){e.message=t[e.code],i.reject(e)})},function(e){e.message=t[e.code],i.reject(e)})},function(e){e.message=t[e.code],i.reject(e)})}catch(a){a.message=t[a.code],i.reject(a)}return i.promise},writeFile:function(o,r,i,a){var c=e.defer();/^\//.test(r)&&c.reject("file-name cannot start with /"),a=a?!1:!0;var u={create:!0,exclusive:a};try{n.resolveLocalFileSystemURL(o,function(e){e.getFile(r,u,function(e){e.createWriter(function(e){u.append===!0&&e.seek(e.length),u.truncate&&e.truncate(u.truncate),e.onwriteend=function(e){this.error?c.reject(this.error):c.resolve(e)},e.write(i),c.promise.abort=function(){e.abort()}})},function(e){e.message=t[e.code],c.reject(e)})},function(e){e.message=t[e.code],c.reject(e)})}catch(s){s.message=t[s.code],c.reject(s)}return c.promise},writeExistingFile:function(o,r,i){var a=e.defer();/^\//.test(r)&&a.reject("file-name cannot start with /");try{n.resolveLocalFileSystemURL(o,function(e){e.getFile(r,{create:!1},function(e){e.createWriter(function(e){e.seek(e.length),e.onwriteend=function(e){this.error?a.reject(this.error):a.resolve(e)},e.write(i),a.promise.abort=function(){e.abort()}})},function(e){e.message=t[e.code],a.reject(e)})},function(e){e.message=t[e.code],a.reject(e)})}catch(c){c.message=t[c.code],a.reject(c)}return a.promise},readAsText:function(o,r){var i=e.defer();/^\//.test(r)&&i.reject("file-name cannot start with /");try{n.resolveLocalFileSystemURL(o,function(e){e.getFile(r,{create:!1},function(e){e.file(function(e){var n=new FileReader;n.onloadend=function(e){void 0!==e.target.result||null!==e.target.result?i.resolve(e.target.result):i.reject(void 0!==e.target.error||null!==e.target.error?e.target.error:{code:null,message:"READER_ONLOADEND_ERR"})},n.readAsText(e)})},function(e){e.message=t[e.code],i.reject(e)})},function(e){e.message=t[e.code],i.reject(e)})}catch(a){a.message=t[a.code],i.reject(a)}return i.promise},readAsDataURL:function(o,r){var i=e.defer();/^\//.test(r)&&i.reject("file-name cannot start with /");try{n.resolveLocalFileSystemURL(o,function(e){e.getFile(r,{create:!1},function(e){e.file(function(e){var n=new FileReader;n.onloadend=function(e){void 0!==e.target.result||null!==e.target.result?i.resolve(e.target.result):i.reject(void 0!==e.target.error||null!==e.target.error?e.target.error:{code:null,message:"READER_ONLOADEND_ERR"})},n.readAsDataURL(e)})},function(e){e.message=t[e.code],i.reject(e)})},function(e){e.message=t[e.code],i.reject(e)})}catch(a){a.message=t[a.code],i.reject(a)}return i.promise},readAsBinaryString:function(o,r){var i=e.defer();/^\//.test(r)&&i.reject("file-name cannot start with /");try{n.resolveLocalFileSystemURL(o,function(e){e.getFile(r,{create:!1},function(e){e.file(function(e){var n=new FileReader;n.onloadend=function(e){void 0!==e.target.result||null!==e.target.result?i.resolve(e.target.result):i.reject(void 0!==e.target.error||null!==e.target.error?e.target.error:{code:null,message:"READER_ONLOADEND_ERR"})},n.readAsBinaryString(e)})},function(e){e.message=t[e.code],i.reject(e)})},function(e){e.message=t[e.code],i.reject(e)})}catch(a){a.message=t[a.code],i.reject(a)}return i.promise},readAsArrayBuffer:function(o,r){var i=e.defer();/^\//.test(r)&&i.reject("file-name cannot start with /");try{n.resolveLocalFileSystemURL(o,function(e){e.getFile(r,{create:!1},function(e){e.file(function(e){var n=new FileReader;n.onloadend=function(e){void 0!==e.target.result||null!==e.target.result?i.resolve(e.target.result):i.reject(void 0!==e.target.error||null!==e.target.error?e.target.error:{code:null,message:"READER_ONLOADEND_ERR"})},n.readAsArrayBuffer(e)})},function(e){e.message=t[e.code],i.reject(e)})},function(e){e.message=t[e.code],i.reject(e)})}catch(a){a.message=t[a.code],i.reject(a)}return i.promise},moveFile:function(t,o,r,i){var a=e.defer();i=i||o,(/^\//.test(o)||/^\//.test(i))&&a.reject("file-name cannot start with /");try{n.resolveLocalFileSystemURL(t,function(e){e.getFile(o,{create:!1},function(e){n.resolveLocalFileSystemURL(r,function(n){e.moveTo(n,i,function(e){a.resolve(e)},function(e){a.reject(e)})},function(e){a.reject(e)})},function(e){a.reject(e)})},function(e){a.reject(e)})}catch(c){a.reject(c)}return a.promise},moveDir:function(t,o,r,i){var a=e.defer();i=i||o,(/^\//.test(o)||/^\//.test(i))&&a.reject("file-name cannot start with /");try{n.resolveLocalFileSystemURL(t,function(e){e.getDirectory(o,{create:!1},function(e){n.resolveLocalFileSystemURL(r,function(n){e.moveTo(n,i,function(e){a.resolve(e)},function(e){a.reject(e)})},function(e){a.reject(e)})},function(e){a.reject(e)})},function(e){a.reject(e)})}catch(c){a.reject(c)}return a.promise},copyDir:function(o,r,i,a){var c=e.defer();a=a||r,(/^\//.test(r)||/^\//.test(a))&&c.reject("file-name cannot start with /");try{n.resolveLocalFileSystemURL(o,function(e){e.getDirectory(r,{create:!1,exclusive:!1},function(e){n.resolveLocalFileSystemURL(i,function(n){e.copyTo(n,a,function(e){c.resolve(e)},function(e){e.message=t[e.code],c.reject(e)})},function(e){e.message=t[e.code],c.reject(e)})},function(e){e.message=t[e.code],c.reject(e)})},function(e){e.message=t[e.code],c.reject(e)})}catch(u){u.message=t[u.code],c.reject(u)}return c.promise},copyFile:function(o,r,i,a){var c=e.defer();a=a||r,/^\//.test(r)&&c.reject("file-name cannot start with /");try{n.resolveLocalFileSystemURL(o,function(e){e.getFile(r,{create:!1,exclusive:!1},function(e){n.resolveLocalFileSystemURL(i,function(n){e.copyTo(n,a,function(e){c.resolve(e)},function(e){e.message=t[e.code],c.reject(e)})},function(e){e.message=t[e.code],c.reject(e)})},function(e){e.message=t[e.code],c.reject(e)})},function(e){e.message=t[e.code],c.reject(e)})}catch(u){u.message=t[u.code],c.reject(u)}return c.promise}}}]}]),angular.module("ngCordova.plugins.fileOpener2",[]).factory("$cordovaFileOpener2",["$q",function(e){return{open:function(n,t){var o=e.defer();return cordova.plugins.fileOpener2.open(n,t,{error:function(e){o.reject(e)},success:function(){o.resolve()}}),o.promise},uninstall:function(n){var t=e.defer();return cordova.plugins.fileOpener2.uninstall(n,{error:function(e){t.reject(e)},success:function(){t.resolve()}}),t.promise},appIsInstalled:function(n){var t=e.defer();return cordova.plugins.fileOpener2.appIsInstalled(n,{success:function(e){t.resolve(e)}}),t.promise}}}]),angular.module("ngCordova.plugins.fileTransfer",[]).factory("$cordovaFileTransfer",["$q","$timeout",function(e,n){return{download:function(t,o,r,i){var a=e.defer(),c=new FileTransfer,u=r&&r.encodeURI===!1?t:encodeURI(t);return r&&void 0!==r.timeout&&null!==r.timeout&&(n(function(){c.abort()},r.timeout),r.timeout=null),c.onprogress=function(e){a.notify(e)},a.promise.abort=function(){c.abort() +},c.download(u,o,a.resolve,a.reject,i,r),a.promise},upload:function(t,o,r,i){var a=e.defer(),c=new FileTransfer,u=r&&r.encodeURI===!1?t:encodeURI(t);return r&&void 0!==r.timeout&&null!==r.timeout&&(n(function(){c.abort()},r.timeout),r.timeout=null),c.onprogress=function(e){a.notify(e)},a.promise.abort=function(){c.abort()},c.upload(o,u,a.resolve,a.reject,r,i),a.promise}}}]),angular.module("ngCordova.plugins.flashlight",[]).factory("$cordovaFlashlight",["$q","$window",function(e,n){return{available:function(){var t=e.defer();return n.plugins.flashlight.available(function(e){t.resolve(e)}),t.promise},switchOn:function(){var t=e.defer();return n.plugins.flashlight.switchOn(function(e){t.resolve(e)},function(e){t.reject(e)}),t.promise},switchOff:function(){var t=e.defer();return n.plugins.flashlight.switchOff(function(e){t.resolve(e)},function(e){t.reject(e)}),t.promise},toggle:function(){var t=e.defer();return n.plugins.flashlight.toggle(function(e){t.resolve(e)},function(e){t.reject(e)}),t.promise}}}]),angular.module("ngCordova.plugins.flurryAds",[]).factory("$cordovaFlurryAds",["$q","$window",function(e,n){return{setOptions:function(t){var o=e.defer();return n.FlurryAds.setOptions(t,function(){o.resolve()},function(){o.reject()}),o.promise},createBanner:function(t){var o=e.defer();return n.FlurryAds.createBanner(t,function(){o.resolve()},function(){o.reject()}),o.promise},removeBanner:function(){var t=e.defer();return n.FlurryAds.removeBanner(function(){t.resolve()},function(){t.reject()}),t.promise},showBanner:function(t){var o=e.defer();return n.FlurryAds.showBanner(t,function(){o.resolve()},function(){o.reject()}),o.promise},showBannerAtXY:function(t,o){var r=e.defer();return n.FlurryAds.showBannerAtXY(t,o,function(){r.resolve()},function(){r.reject()}),r.promise},hideBanner:function(){var t=e.defer();return n.FlurryAds.hideBanner(function(){t.resolve()},function(){t.reject()}),t.promise},prepareInterstitial:function(t){var o=e.defer();return n.FlurryAds.prepareInterstitial(t,function(){o.resolve()},function(){o.reject()}),o.promise},showInterstitial:function(){var t=e.defer();return n.FlurryAds.showInterstitial(function(){t.resolve()},function(){t.reject()}),t.promise}}}]),angular.module("ngCordova.plugins.ga",[]).factory("$cordovaGA",["$q","$window",function(e,n){return{init:function(t,o){var r=e.defer();return o=o>=0?o:10,n.plugins.gaPlugin.init(function(e){r.resolve(e)},function(e){r.reject(e)},t,o),r.promise},trackEvent:function(t,o,r,i,a,c){var u=e.defer();return n.plugins.gaPlugin.trackEvent(function(e){u.resolve(e)},function(e){u.reject(e)},r,i,a,c),u.promise},trackPage:function(t,o,r){var i=e.defer();return n.plugins.gaPlugin.trackPage(function(e){i.resolve(e)},function(e){i.reject(e)},r),i.promise},setVariable:function(t,o,r,i){var a=e.defer();return n.plugins.gaPlugin.setVariable(function(e){a.resolve(e)},function(e){a.reject(e)},r,i),a.promise},exit:function(){var t=e.defer();return n.plugins.gaPlugin.exit(function(e){t.resolve(e)},function(e){t.reject(e)}),t.promise}}}]),angular.module("ngCordova.plugins.geolocation",[]).factory("$cordovaGeolocation",["$q",function(e){return{getCurrentPosition:function(n){var t=e.defer();return navigator.geolocation.getCurrentPosition(function(e){t.resolve(e)},function(e){t.reject(e)},n),t.promise},watchPosition:function(n){var t=e.defer(),o=navigator.geolocation.watchPosition(function(e){t.notify(e)},function(e){t.reject(e)},n);return t.promise.cancel=function(){navigator.geolocation.clearWatch(o)},t.promise.clearWatch=function(e){navigator.geolocation.clearWatch(e||o)},t.promise.watchID=o,t.promise},clearWatch:function(e){return navigator.geolocation.clearWatch(e)}}}]),angular.module("ngCordova.plugins.globalization",[]).factory("$cordovaGlobalization",["$q",function(e){return{getPreferredLanguage:function(){var n=e.defer();return navigator.globalization.getPreferredLanguage(function(e){n.resolve(e)},function(e){n.reject(e)}),n.promise},getLocaleName:function(){var n=e.defer();return navigator.globalization.getLocaleName(function(e){n.resolve(e)},function(e){n.reject(e)}),n.promise},getFirstDayOfWeek:function(){var n=e.defer();return navigator.globalization.getFirstDayOfWeek(function(e){n.resolve(e)},function(e){n.reject(e)}),n.promise},dateToString:function(n,t){var o=e.defer();return navigator.globalization.dateToString(n,function(e){o.resolve(e)},function(e){o.reject(e)},t),o.promise},stringToDate:function(n,t){var o=e.defer();return navigator.globalization.stringToDate(n,function(e){o.resolve(e)},function(e){o.reject(e)},t),o.promise},getDatePattern:function(n){var t=e.defer();return navigator.globalization.getDatePattern(function(e){t.resolve(e)},function(e){t.reject(e)},n),t.promise},getDateNames:function(n){var t=e.defer();return navigator.globalization.getDateNames(function(e){t.resolve(e)},function(e){t.reject(e)},n),t.promise},isDayLightSavingsTime:function(n){var t=e.defer();return navigator.globalization.isDayLightSavingsTime(n,function(e){t.resolve(e)},function(e){t.reject(e)}),t.promise},numberToString:function(n,t){var o=e.defer();return navigator.globalization.numberToString(n,function(e){o.resolve(e)},function(e){o.reject(e)},t),o.promise},stringToNumber:function(n,t){var o=e.defer();return navigator.globalization.stringToNumber(n,function(e){o.resolve(e)},function(e){o.reject(e)},t),o.promise},getNumberPattern:function(n){var t=e.defer();return navigator.globalization.getNumberPattern(function(e){t.resolve(e)},function(e){t.reject(e)},n),t.promise},getCurrencyPattern:function(n){var t=e.defer();return navigator.globalization.getCurrencyPattern(n,function(e){t.resolve(e)},function(e){t.reject(e)}),t.promise}}}]),angular.module("ngCordova.plugins.googleAds",[]).factory("$cordovaGoogleAds",["$q","$window",function(e,n){return{setOptions:function(t){var o=e.defer();return n.AdMob.setOptions(t,function(){o.resolve()},function(){o.reject()}),o.promise},createBanner:function(t){var o=e.defer();return n.AdMob.createBanner(t,function(){o.resolve()},function(){o.reject()}),o.promise},removeBanner:function(){var t=e.defer();return n.AdMob.removeBanner(function(){t.resolve()},function(){t.reject()}),t.promise},showBanner:function(t){var o=e.defer();return n.AdMob.showBanner(t,function(){o.resolve()},function(){o.reject()}),o.promise},showBannerAtXY:function(t,o){var r=e.defer();return n.AdMob.showBannerAtXY(t,o,function(){r.resolve()},function(){r.reject()}),r.promise},hideBanner:function(){var t=e.defer();return n.AdMob.hideBanner(function(){t.resolve()},function(){t.reject()}),t.promise},prepareInterstitial:function(t){var o=e.defer();return n.AdMob.prepareInterstitial(t,function(){o.resolve()},function(){o.reject()}),o.promise},showInterstitial:function(){var t=e.defer();return n.AdMob.showInterstitial(function(){t.resolve()},function(){t.reject()}),t.promise}}}]),angular.module("ngCordova.plugins.googleAnalytics",[]).factory("$cordovaGoogleAnalytics",["$q","$window",function(e,n){return{startTrackerWithId:function(t){var o=e.defer();return n.analytics.startTrackerWithId(t,function(e){o.resolve(e)},function(e){o.reject(e)}),o.promise},setUserId:function(t){var o=e.defer();return n.analytics.setUserId(t,function(e){o.resolve(e)},function(e){o.reject(e)}),o.promise},debugMode:function(){var t=e.defer();return n.analytics.debugMode(function(e){t.resolve(e)},function(){t.reject()}),t.promise},trackView:function(t){var o=e.defer();return n.analytics.trackView(t,function(e){o.resolve(e)},function(e){o.reject(e)}),o.promise},addCustomDimension:function(t,o){var r=e.defer();return n.analytics.addCustomDimension(t,o,function(){r.resolve()},function(e){r.reject(e)}),r.promise},trackEvent:function(t,o,r,i){var a=e.defer();return n.analytics.trackEvent(t,o,r,i,function(e){a.resolve(e)},function(e){a.reject(e)}),a.promise},trackException:function(t,o){var r=e.defer();return n.analytics.trackException(t,o,function(e){r.resolve(e)},function(e){r.reject(e)}),r.promise},trackTiming:function(t,o,r,i){var a=e.defer();return n.analytics.trackTiming(t,o,r,i,function(e){a.resolve(e)},function(e){a.reject(e)}),a.promise},addTransaction:function(t,o,r,i,a,c){var u=e.defer();return n.analytics.addTransaction(t,o,r,i,a,c,function(e){u.resolve(e)},function(e){u.reject(e)}),u.promise},addTransactionItem:function(t,o,r,i,a,c,u){var s=e.defer();return n.analytics.addTransactionItem(t,o,r,i,a,c,u,function(e){s.resolve(e)},function(e){s.reject(e)}),s.promise}}}]),angular.module("ngCordova.plugins.googleMap",[]).factory("$cordovaGoogleMap",["$q","$window",function(e,n){var t=null;return{getMap:function(o){var r=e.defer();if(n.plugin.google.maps){var i=document.getElementById("map_canvas");t=n.plugin.google.maps.Map.getMap(o),t.setDiv(i),r.resolve(t)}else r.reject(null);return r.promise},isMapLoaded:function(){return!!t},addMarker:function(n){var o=e.defer();return t.addMarker(n,function(e){o.resolve(e)}),o.promise},getMapTypeIds:function(){return n.plugin.google.maps.mapTypeId},setVisible:function(n){var o=e.defer();return t.setVisible(n),o.promise},cleanup:function(){t=null}}}]),angular.module("ngCordova.plugins.googlePlayGame",[]).factory("$cordovaGooglePlayGame",["$q",function(e){return{auth:function(){var n=e.defer();return googleplaygame.auth(function(e){return n.resolve(e)},function(e){return n.reject(e)}),n.promise},signout:function(){var n=e.defer();return googleplaygame.signout(function(e){return n.resolve(e)},function(e){return n.reject(e)}),n.promise},isSignedIn:function(){var n=e.defer();return googleplaygame.isSignedIn(function(e){return n.resolve(e)},function(e){return n.reject(e)}),n.promise},showPlayer:function(){var n=e.defer();return googleplaygame.showPlayer(function(e){return n.resolve(e)},function(e){return n.reject(e)}),n.promise},submitScore:function(n){var t=e.defer();return googleplaygame.submitScore(n,function(e){return t.resolve(e)},function(e){return t.reject(e)}),t.promise},showAllLeaderboards:function(){var n=e.defer();return googleplaygame.showAllLeaderboards(function(e){return n.resolve(e)},function(e){return n.reject(e)}),n.promise},showLeaderboard:function(n){var t=e.defer();return googleplaygame.showLeaderboard(n,function(e){return t.resolve(e)},function(e){return t.reject(e)}),t.promise},unlockAchievement:function(n){var t=e.defer();return googleplaygame.unlockAchievement(n,function(e){return t.resolve(e)},function(e){return t.reject(e)}),t.promise},incrementAchievement:function(n){var t=e.defer();return googleplaygame.incrementAchievement(n,function(e){return t.resolve(e)},function(e){return t.reject(e)}),t.promise},showAchievements:function(){var n=e.defer();return googleplaygame.showAchievements(function(e){return n.resolve(e)},function(e){return n.reject(e)}),n.promise}}}]),angular.module("ngCordova.plugins.googleplus",[]).factory("$cordovaGooglePlus",["$q","$window",function(e,n){return{login:function(t){var o=e.defer();return void 0===t&&(t={}),n.plugins.googleplus.login({iOSApiKey:t},function(e){o.resolve(e)},function(e){o.reject(e)}),o.promise},silentLogin:function(t){var o=e.defer();return void 0===t&&(t={}),n.plugins.googleplus.trySilentLogin({iOSApiKey:t},function(e){o.resolve(e)},function(e){o.reject(e)}),o.promise},logout:function(){var t=e.defer();n.plugins.googleplus.logout(function(e){t.resolve(e)})},disconnect:function(){var t=e.defer();n.plugins.googleplus.disconnect(function(e){t.resolve(e)})}}}]),angular.module("ngCordova.plugins.healthKit",[]).factory("$cordovaHealthKit",["$q","$window",function(e,n){return{isAvailable:function(){var t=e.defer();return n.plugins.healthkit.available(function(e){t.resolve(e)},function(e){t.reject(e)}),t.promise},checkAuthStatus:function(t){var o=e.defer();return t=t||"HKQuantityTypeIdentifierHeight",n.plugins.healthkit.checkAuthStatus({type:t},function(e){o.resolve(e)},function(e){o.reject(e)}),o.promise},requestAuthorization:function(t,o){var r=e.defer();return t=t||["HKCharacteristicTypeIdentifierDateOfBirth","HKQuantityTypeIdentifierActiveEnergyBurned","HKQuantityTypeIdentifierHeight"],o=o||["HKQuantityTypeIdentifierActiveEnergyBurned","HKQuantityTypeIdentifierHeight","HKQuantityTypeIdentifierDistanceCycling"],n.plugins.healthkit.requestAuthorization({readTypes:t,writeTypes:o},function(e){r.resolve(e)},function(e){r.reject(e)}),r.promise},readDateOfBirth:function(){var t=e.defer();return n.plugins.healthkit.readDateOfBirth(function(e){t.resolve(e)},function(e){t.resolve(e)}),t.promise},readGender:function(){var t=e.defer();return n.plugins.healthkit.readGender(function(e){t.resolve(e)},function(e){t.resolve(e)}),t.promise},saveWeight:function(t,o,r){var i=e.defer();return n.plugins.healthkit.saveWeight({unit:o||"lb",amount:t,date:r||new Date},function(e){i.resolve(e)},function(e){i.resolve(e)}),i.promise},readWeight:function(t){var o=e.defer();return n.plugins.healthkit.readWeight({unit:t||"lb"},function(e){o.resolve(e)},function(e){o.resolve(e)}),o.promise},saveHeight:function(t,o,r){var i=e.defer();return n.plugins.healthkit.saveHeight({unit:o||"in",amount:t,date:r||new Date},function(e){i.resolve(e)},function(e){i.resolve(e)}),i.promise},readHeight:function(t){var o=e.defer();return n.plugins.healthkit.readHeight({unit:t||"in"},function(e){o.resolve(e)},function(e){o.resolve(e)}),o.promise},findWorkouts:function(){var t=e.defer();return n.plugins.healthkit.findWorkouts({},function(e){t.resolve(e)},function(e){t.resolve(e)}),t.promise},saveWorkout:function(t){var o=e.defer();return n.plugins.healthkit.saveWorkout(t,function(e){o.resolve(e)},function(e){o.resolve(e)}),o.promise},querySampleType:function(t){var o=e.defer();return n.plugins.healthkit.querySampleType(t,function(e){o.resolve(e)},function(e){o.resolve(e)}),o.promise}}}]),angular.module("ngCordova.plugins.httpd",[]).factory("$cordovaHttpd",["$q",function(e){return{startServer:function(n){var t=e.defer();return cordova.plugins.CorHttpd.startServer(n,function(){t.resolve()},function(){t.reject()}),t.promise},stopServer:function(){var n=e.defer();return cordova.plugins.CorHttpd.stopServer(function(){n.resolve()},function(){n.reject()}),n.promise},getURL:function(){var n=e.defer();return cordova.plugins.CorHttpd.getURL(function(e){n.resolve(e)},function(){n.reject()}),n.promise},getLocalPath:function(){var n=e.defer();return cordova.plugins.CorHttpd.getLocalPath(function(e){n.resolve(e)},function(){n.reject()}),n.promise}}}]),angular.module("ngCordova.plugins.iAd",[]).factory("$cordovaiAd",["$q","$window",function(e,n){return{setOptions:function(t){var o=e.defer();return n.iAd.setOptions(t,function(){o.resolve()},function(){o.reject()}),o.promise},createBanner:function(t){var o=e.defer();return n.iAd.createBanner(t,function(){o.resolve()},function(){o.reject()}),o.promise},removeBanner:function(){var t=e.defer();return n.iAd.removeBanner(function(){t.resolve()},function(){t.reject()}),t.promise},showBanner:function(t){var o=e.defer();return n.iAd.showBanner(t,function(){o.resolve()},function(){o.reject()}),o.promise},showBannerAtXY:function(t,o){var r=e.defer();return n.iAd.showBannerAtXY(t,o,function(){r.resolve()},function(){r.reject()}),r.promise},hideBanner:function(){var t=e.defer();return n.iAd.hideBanner(function(){t.resolve()},function(){t.reject()}),t.promise},prepareInterstitial:function(t){var o=e.defer();return n.iAd.prepareInterstitial(t,function(){o.resolve()},function(){o.reject()}),o.promise},showInterstitial:function(){var t=e.defer();return n.iAd.showInterstitial(function(){t.resolve()},function(){t.reject()}),t.promise}}}]),angular.module("ngCordova.plugins.imagePicker",[]).factory("$cordovaImagePicker",["$q","$window",function(e,n){return{getPictures:function(t){var o=e.defer();return n.imagePicker.getPictures(function(e){o.resolve(e)},function(e){o.reject(e)},t),o.promise}}}]),angular.module("ngCordova.plugins.inAppBrowser",[]).provider("$cordovaInAppBrowser",[function(){var e,n=this.defaultOptions={};this.setDefaultOptions=function(e){n=angular.extend(n,e)},this.$get=["$rootScope","$q","$window","$timeout",function(t,o,r,i){return{open:function(a,c,u){var s=o.defer();if(u&&!angular.isObject(u))return s.reject("options must be an object"),s.promise;var l=angular.extend({},n,u),f=[];angular.forEach(l,function(e,n){f.push(n+"="+e)});var d=f.join();return e=r.open(a,c,d),e.addEventListener("loadstart",function(e){i(function(){t.$broadcast("$cordovaInAppBrowser:loadstart",e)})},!1),e.addEventListener("loadstop",function(e){s.resolve(e),i(function(){t.$broadcast("$cordovaInAppBrowser:loadstop",e)})},!1),e.addEventListener("loaderror",function(e){s.reject(e),i(function(){t.$broadcast("$cordovaInAppBrowser:loaderror",e)})},!1),e.addEventListener("exit",function(e){i(function(){t.$broadcast("$cordovaInAppBrowser:exit",e)})},!1),s.promise},close:function(){e.close(),e=null},show:function(){e.show()},executeScript:function(n){var t=o.defer();return e.executeScript(n,function(e){t.resolve(e)}),t.promise},insertCSS:function(n){var t=o.defer();return e.insertCSS(n,function(e){t.resolve(e)}),t.promise}}}]}]),angular.module("ngCordova.plugins.insomnia",[]).factory("$cordovaInsomnia",["$window",function(e){return{keepAwake:function(){return e.plugins.insomnia.keepAwake()},allowSleepAgain:function(){return e.plugins.insomnia.allowSleepAgain()}}}]),angular.module("ngCordova.plugins.instagram",[]).factory("$cordovaInstagram",["$q",function(e){return{share:function(n){var t=e.defer();return window.Instagram?(Instagram.share(n.image,n.caption,function(e){e?t.reject(e):t.resolve(!0)}),t.promise):(console.error("Tried to call Instagram.share but the Instagram plugin isn't installed!"),t.resolve(null),t.promise)},isInstalled:function(){var n=e.defer();return window.Instagram?(Instagram.isInstalled(function(e,t){e?n.reject(e):n.resolve(t||!0)}),n.promise):(console.error("Tried to call Instagram.isInstalled but the Instagram plugin isn't installed!"),n.resolve(null),n.promise)}}}]),angular.module("ngCordova.plugins.keyboard",[]).factory("$cordovaKeyboard",["$rootScope","$timeout",function(e){var n=function(){e.$evalAsync(function(){e.$broadcast("$cordovaKeyboard:show")})},t=function(){e.$evalAsync(function(){e.$broadcast("$cordovaKeyboard:hide")})};return document.addEventListener("deviceready",function(){cordova.plugins.Keyboard&&(window.addEventListener("native.keyboardshow",n,!1),window.addEventListener("native.keyboardhide",t,!1))}),{hideAccessoryBar:function(e){return cordova.plugins.Keyboard.hideKeyboardAccessoryBar(e)},close:function(){return cordova.plugins.Keyboard.close()},show:function(){return cordova.plugins.Keyboard.show()},disableScroll:function(e){return cordova.plugins.Keyboard.disableScroll(e)},isVisible:function(){return cordova.plugins.Keyboard.isVisible},clearShowWatch:function(){document.removeEventListener("native.keyboardshow",n),e.$$listeners["$cordovaKeyboard:show"]=[]},clearHideWatch:function(){document.removeEventListener("native.keyboardhide",t),e.$$listeners["$cordovaKeyboard:hide"]=[]}}}]),angular.module("ngCordova.plugins.keychain",[]).factory("$cordovaKeychain",["$q",function(e){return{getForKey:function(n,t){var o=e.defer(),r=new Keychain;return r.getForKey(o.resolve,o.reject,n,t),o.promise},setForKey:function(n,t,o){var r=e.defer(),i=new Keychain;return i.setForKey(r.resolve,r.reject,n,t,o),r.promise},removeForKey:function(n,t){var o=e.defer(),r=new Keychain;return r.removeForKey(o.resolve,o.reject,n,t),o.promise}}}]),angular.module("ngCordova.plugins.localNotification",[]).factory("$cordovaLocalNotification",["$q","$window","$rootScope","$timeout",function(e,n,t,o){return document.addEventListener("deviceready",function(){n.cordova&&n.cordova.plugins&&n.cordova.plugins.notification&&n.cordova.plugins.notification.local&&(n.cordova.plugins.notification.local.on("schedule",function(e,n){o(function(){t.$broadcast("$cordovaLocalNotification:schedule",e,n)})}),n.cordova.plugins.notification.local.on("trigger",function(e,n){o(function(){t.$broadcast("$cordovaLocalNotification:trigger",e,n)})}),n.cordova.plugins.notification.local.on("update",function(e,n){o(function(){t.$broadcast("$cordovaLocalNotification:update",e,n)})}),n.cordova.plugins.notification.local.on("clear",function(e,n){o(function(){t.$broadcast("$cordovaLocalNotification:clear",e,n)})}),n.cordova.plugins.notification.local.on("clearall",function(e){o(function(){t.$broadcast("$cordovaLocalNotification:clearall",e)})}),n.cordova.plugins.notification.local.on("cancel",function(e,n){o(function(){t.$broadcast("$cordovaLocalNotification:cancel",e,n)})}),n.cordova.plugins.notification.local.on("cancelall",function(e){o(function(){t.$broadcast("$cordovaLocalNotification:cancelall",e)})}),n.cordova.plugins.notification.local.on("click",function(e,n){o(function(){t.$broadcast("$cordovaLocalNotification:click",e,n)})}))},!1),{schedule:function(t,o){var r=e.defer();return o=o||null,n.cordova.plugins.notification.local.schedule(t,function(e){r.resolve(e)},o),r.promise},add:function(t,o){console.warn('Deprecated: use "schedule" instead.');var r=e.defer();return o=o||null,n.cordova.plugins.notification.local.schedule(t,function(e){r.resolve(e)},o),r.promise},update:function(t,o){var r=e.defer();return o=o||null,n.cordova.plugins.notification.local.update(t,function(e){r.resolve(e)},o),r.promise},clear:function(t,o){var r=e.defer();return o=o||null,n.cordova.plugins.notification.local.clear(t,function(e){r.resolve(e)},o),r.promise},clearAll:function(t){var o=e.defer();return t=t||null,n.cordova.plugins.notification.local.clearAll(function(e){o.resolve(e)},t),o.promise},cancel:function(t,o){var r=e.defer();return o=o||null,n.cordova.plugins.notification.local.cancel(t,function(e){r.resolve(e)},o),r.promise},cancelAll:function(t){var o=e.defer();return t=t||null,n.cordova.plugins.notification.local.cancelAll(function(e){o.resolve(e)},t),o.promise},isPresent:function(t,o){var r=e.defer();return o=o||null,n.cordova.plugins.notification.local.isPresent(t,function(e){r.resolve(e)},o),r.promise},isScheduled:function(t,o){var r=e.defer();return o=o||null,n.cordova.plugins.notification.local.isScheduled(t,function(e){r.resolve(e)},o),r.promise},isTriggered:function(t,o){var r=e.defer();return o=o||null,n.cordova.plugins.notification.local.isTriggered(t,function(e){r.resolve(e)},o),r.promise},hasPermission:function(t){var o=e.defer();return t=t||null,n.cordova.plugins.notification.local.hasPermission(function(e){e?o.resolve(e):o.reject(e)},t),o.promise},registerPermission:function(t){var o=e.defer();return t=t||null,n.cordova.plugins.notification.local.registerPermission(function(e){e?o.resolve(e):o.reject(e)},t),o.promise},promptForPermission:function(t){console.warn('Deprecated: use "registerPermission" instead.');var o=e.defer();return t=t||null,n.cordova.plugins.notification.local.registerPermission(function(e){e?o.resolve(e):o.reject(e)},t),o.promise},getAllIds:function(t){var o=e.defer();return t=t||null,n.cordova.plugins.notification.local.getAllIds(function(e){o.resolve(e)},t),o.promise},getIds:function(t){var o=e.defer();return t=t||null,n.cordova.plugins.notification.local.getIds(function(e){o.resolve(e)},t),o.promise},getScheduledIds:function(t){var o=e.defer();return t=t||null,n.cordova.plugins.notification.local.getScheduledIds(function(e){o.resolve(e)},t),o.promise},getTriggeredIds:function(t){var o=e.defer();return t=t||null,n.cordova.plugins.notification.local.getTriggeredIds(function(e){o.resolve(e)},t),o.promise},get:function(t,o){var r=e.defer();return o=o||null,n.cordova.plugins.notification.local.get(t,function(e){r.resolve(e)},o),r.promise},getAll:function(t){var o=e.defer();return t=t||null,n.cordova.plugins.notification.local.getAll(function(e){o.resolve(e)},t),o.promise},getScheduled:function(t,o){var r=e.defer();return o=o||null,n.cordova.plugins.notification.local.getScheduled(t,function(e){r.resolve(e)},o),r.promise},getAllScheduled:function(t){var o=e.defer();return t=t||null,n.cordova.plugins.notification.local.getAllScheduled(function(e){o.resolve(e)},t),o.promise},getTriggered:function(t,o){var r=e.defer();return o=o||null,n.cordova.plugins.notification.local.getTriggered(t,function(e){r.resolve(e)},o),r.promise},getAllTriggered:function(t){var o=e.defer();return t=t||null,n.cordova.plugins.notification.local.getAllTriggered(function(e){o.resolve(e)},t),o.promise},getDefaults:function(){return n.cordova.plugins.notification.local.getDefaults()},setDefaults:function(e){n.cordova.plugins.notification.local.setDefaults(e)}}}]),angular.module("ngCordova.plugins.mMediaAds",[]).factory("$cordovaMMediaAds",["$q","$window",function(e,n){return{setOptions:function(t){var o=e.defer();return n.mMedia.setOptions(t,function(){o.resolve()},function(){o.reject()}),o.promise},createBanner:function(t){var o=e.defer();return n.mMedia.createBanner(t,function(){o.resolve()},function(){o.reject()}),o.promise},removeBanner:function(){var t=e.defer();return n.mMedia.removeBanner(function(){t.resolve()},function(){t.reject()}),t.promise},showBanner:function(t){var o=e.defer();return n.mMedia.showBanner(t,function(){o.resolve()},function(){o.reject()}),o.promise},showBannerAtXY:function(t,o){var r=e.defer();return n.mMedia.showBannerAtXY(t,o,function(){r.resolve()},function(){r.reject()}),r.promise},hideBanner:function(){var t=e.defer();return n.mMedia.hideBanner(function(){t.resolve()},function(){t.reject()}),t.promise},prepareInterstitial:function(t){var o=e.defer();return n.mMedia.prepareInterstitial(t,function(){o.resolve()},function(){o.reject()}),o.promise},showInterstitial:function(){var t=e.defer();return n.mMedia.showInterstitial(function(){t.resolve()},function(){t.reject()}),t.promise}}}]),angular.module("ngCordova.plugins.media",[]).factory("$cordovaMedia",["$q",function(e){return{newMedia:function(n){var t,o=e.defer(),r=null;return t=new Media(n,function(e){o.resolve(e)},function(e){o.reject(e)},function(e){r=e}),o.promise.getCurrentPosition=function(){t.getCurrentPosition(function(){},function(){})},o.promise.getDuration=function(){t.getDuration()},o.promise.play=function(e){"object"!=typeof e&&(e={}),t.play(e)},o.promise.pause=function(){t.pause()},o.promise.stop=function(){t.stop()},o.promise.release=function(){t.release()},o.promise.seekTo=function(e){t.seekTo(e)},o.promise.setVolume=function(e){t.setVolume(e)},o.promise.startRecord=function(){t.startRecord()},o.promise.stopRecord=function(){t.stopRecord()},o.promise.media=t,o.promise}}}]),angular.module("ngCordova.plugins.mobfoxAds",[]).factory("$cordovaMobFoxAds",["$q","$window",function(e,n){return{setOptions:function(t){var o=e.defer();return n.MobFox.setOptions(t,function(){o.resolve()},function(){o.reject()}),o.promise},createBanner:function(t){var o=e.defer();return n.MobFox.createBanner(t,function(){o.resolve()},function(){o.reject()}),o.promise},removeBanner:function(){var t=e.defer();return n.MobFox.removeBanner(function(){t.resolve()},function(){t.reject()}),t.promise},showBanner:function(t){var o=e.defer();return n.MobFox.showBanner(t,function(){o.resolve()},function(){o.reject()}),o.promise},showBannerAtXY:function(t,o){var r=e.defer();return n.MobFox.showBannerAtXY(t,o,function(){r.resolve()},function(){r.reject()}),r.promise},hideBanner:function(){var t=e.defer();return n.MobFox.hideBanner(function(){t.resolve()},function(){t.reject()}),t.promise},prepareInterstitial:function(t){var o=e.defer();return n.MobFox.prepareInterstitial(t,function(){o.resolve()},function(){o.reject()}),o.promise},showInterstitial:function(){var t=e.defer();return n.MobFox.showInterstitial(function(){t.resolve()},function(){t.reject()}),t.promise}}}]),angular.module("ngCordova.plugins",["ngCordova.plugins.actionSheet","ngCordova.plugins.adMob","ngCordova.plugins.appAvailability","ngCordova.plugins.appRate","ngCordova.plugins.appVersion","ngCordova.plugins.backgroundGeolocation","ngCordova.plugins.badge","ngCordova.plugins.barcodeScanner","ngCordova.plugins.batteryStatus","ngCordova.plugins.ble","ngCordova.plugins.bluetoothSerial","ngCordova.plugins.brightness","ngCordova.plugins.calendar","ngCordova.plugins.camera","ngCordova.plugins.capture","ngCordova.plugins.clipboard","ngCordova.plugins.contacts","ngCordova.plugins.datePicker","ngCordova.plugins.device","ngCordova.plugins.deviceMotion","ngCordova.plugins.deviceOrientation","ngCordova.plugins.dialogs","ngCordova.plugins.emailComposer","ngCordova.plugins.facebook","ngCordova.plugins.facebookAds","ngCordova.plugins.file","ngCordova.plugins.fileTransfer","ngCordova.plugins.fileOpener2","ngCordova.plugins.flashlight","ngCordova.plugins.flurryAds","ngCordova.plugins.ga","ngCordova.plugins.geolocation","ngCordova.plugins.globalization","ngCordova.plugins.googleAds","ngCordova.plugins.googleAnalytics","ngCordova.plugins.googleMap","ngCordova.plugins.googlePlayGame","ngCordova.plugins.healthKit","ngCordova.plugins.httpd","ngCordova.plugins.iAd","ngCordova.plugins.imagePicker","ngCordova.plugins.inAppBrowser","ngCordova.plugins.keyboard","ngCordova.plugins.keychain","ngCordova.plugins.localNotification","ngCordova.plugins.media","ngCordova.plugins.mMediaAds","ngCordova.plugins.mobfoxAds","ngCordova.plugins.mopubAds","ngCordova.plugins.nativeAudio","ngCordova.plugins.network","ngCordova.plugins.oauth","ngCordova.plugins.oauthUtility","ngCordova.plugins.pinDialog","ngCordova.plugins.prefs","ngCordova.plugins.printer","ngCordova.plugins.progressIndicator","ngCordova.plugins.push","ngCordova.plugins.sms","ngCordova.plugins.socialSharing","ngCordova.plugins.spinnerDialog","ngCordova.plugins.splashscreen","ngCordova.plugins.sqlite","ngCordova.plugins.statusbar","ngCordova.plugins.toast","ngCordova.plugins.touchid","ngCordova.plugins.vibration","ngCordova.plugins.videoCapturePlus","ngCordova.plugins.zip","ngCordova.plugins.insomnia"]),angular.module("ngCordova.plugins.mopubAds",[]).factory("$cordovaMoPubAds",["$q","$window",function(e,n){return{setOptions:function(t){var o=e.defer();return n.MoPub.setOptions(t,function(){o.resolve()},function(){o.reject()}),o.promise},createBanner:function(t){var o=e.defer();return n.MoPub.createBanner(t,function(){o.resolve()},function(){o.reject()}),o.promise},removeBanner:function(){var t=e.defer();return n.MoPub.removeBanner(function(){t.resolve()},function(){t.reject()}),t.promise},showBanner:function(t){var o=e.defer();return n.MoPub.showBanner(t,function(){o.resolve()},function(){o.reject()}),o.promise},showBannerAtXY:function(t,o){var r=e.defer();return n.MoPub.showBannerAtXY(t,o,function(){r.resolve()},function(){r.reject()}),r.promise},hideBanner:function(){var t=e.defer();return n.MoPub.hideBanner(function(){t.resolve()},function(){t.reject()}),t.promise},prepareInterstitial:function(t){var o=e.defer();return n.MoPub.prepareInterstitial(t,function(){o.resolve()},function(){o.reject()}),o.promise},showInterstitial:function(){var t=e.defer();return n.MoPub.showInterstitial(function(){t.resolve()},function(){t.reject()}),t.promise}}}]),angular.module("ngCordova.plugins.nativeAudio",[]).factory("$cordovaNativeAudio",["$q","$window",function(e,n){return{preloadSimple:function(t,o){var r=e.defer();return n.plugins.NativeAudio.preloadSimple(t,o,function(e){r.resolve(e)},function(e){r.reject(e)}),r.promise},preloadComplex:function(t,o,r,i){var a=e.defer();return n.plugins.NativeAudio.preloadComplex(t,o,r,i,function(e){a.resolve(e)},function(e){a.reject(e)}),a.promise},play:function(t,o){var r=e.defer();return n.plugins.NativeAudio.play(t,o,function(e){r.resolve(e)},function(e){r.reject(e)}),r.promise},stop:function(t){var o=e.defer();return n.plugins.NativeAudio.stop(t,function(e){o.resolve(e)},function(e){o.reject(e)}),o.promise},loop:function(t){var o=e.defer();return n.plugins.NativeAudio.loop(t,function(e){o.resolve(e)},function(e){o.reject(e)}),o.promise},unload:function(t){var o=e.defer();return n.plugins.NativeAudio.unload(t,function(e){o.resolve(e)},function(e){o.reject(e)}),o.promise},setVolumeForComplexAsset:function(t,o){var r=e.defer();return n.plugins.NativeAudio.setVolumeForComplexAsset(t,o,function(e){r.resolve(e) +},function(e){r.reject(e)}),r.promise}}}]),angular.module("ngCordova.plugins.network",[]).factory("$cordovaNetwork",["$rootScope","$timeout",function(e,n){var t=function(){var t=navigator.connection.type;n(function(){e.$broadcast("$cordovaNetwork:offline",t)})},o=function(){var t=navigator.connection.type;n(function(){e.$broadcast("$cordovaNetwork:online",t)})};return document.addEventListener("deviceready",function(){navigator.connection&&(document.addEventListener("offline",t,!1),document.addEventListener("online",o,!1))}),{getNetwork:function(){return navigator.connection.type},isOnline:function(){var e=navigator.connection.type;return e!==Connection.UNKNOWN&&e!==Connection.NONE},isOffline:function(){var e=navigator.connection.type;return e===Connection.UNKNOWN||e===Connection.NONE},clearOfflineWatch:function(){document.removeEventListener("offline",t),e.$$listeners["$cordovaNetwork:offline"]=[]},clearOnlineWatch:function(){document.removeEventListener("online",t),e.$$listeners["$cordovaNetwork:online"]=[]}}}]).run(["$cordovaNetwork",function(){}]),angular.module("ngCordova.plugins.oauth",["ngCordova.plugins.oauthUtility"]).factory("$cordovaOauth",["$q","$http","$cordovaOauthUtility",function(e,n,t){return{adfs:function(t,o,r){var i=e.defer();if(window.cordova){var a=cordova.require("cordova/plugin_list").metadata;if(a.hasOwnProperty("org.apache.cordova.inappbrowser")===!0){var c=window.open(o+"/adfs/oauth2/authorize?response_type=code&client_id="+t+"&redirect_uri=http://localhost/callback&resource="+r,"_blank","location=no");c.addEventListener("loadstart",function(e){if(0===e.url.indexOf("http://localhost/callback")){var r=e.url.split("code=")[1];n.defaults.headers.post["Content-Type"]="application/x-www-form-urlencoded",n({method:"post",url:o+"/adfs/oauth2/token",data:"client_id="+t+"&code="+r+"&redirect_uri=http://localhost/callback&grant_type=authorization_code"}).success(function(e){i.resolve(e)}).error(function(){i.reject("Problem authenticating")}).finally(function(){setTimeout(function(){c.close()},10)})}}),c.addEventListener("exit",function(){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},dropbox:function(n){var t=e.defer();if(window.cordova){var o=cordova.require("cordova/plugin_list").metadata;if(o.hasOwnProperty("org.apache.cordova.inappbrowser")===!0){var r=window.open("https://www.dropbox.com/1/oauth2/authorize?client_id="+n+"&redirect_uri=http://localhost/callback&response_type=token","_blank","location=no,clearsessioncache=yes,clearcache=yes");r.addEventListener("loadstart",function(e){if(0===e.url.indexOf("http://localhost/callback")){for(var n=e.url.split("#")[1],o=n.split("&"),i=[],a=0;ao;o++)n+=t.charAt(Math.floor(Math.random()*t.length));return n}}}]),angular.module("ngCordova.plugins.pinDialog",[]).factory("$cordovaPinDialog",["$q","$window",function(e,n){return{prompt:function(t,o,r){var i=e.defer();return n.plugins.pinDialog.prompt(t,function(e){i.resolve(e)},o,r),i.promise}}}]),angular.module("ngCordova.plugins.prefs",[]).factory("$cordovaPreferences",["$window","$q",function(e,n){return{set:function(t,o){var r=n.defer();return e.appgiraffe.plugins.applicationPreferences.set(t,o,function(e){r.resolve(e)},function(e){r.reject(e)}),r.promise},get:function(t){var o=n.defer();return e.appgiraffe.plugins.applicationPreferences.get(t,function(e){o.resolve(e)},function(e){o.reject(e)}),o.promise}}}]),angular.module("ngCordova.plugins.printer",[]).factory("$cordovaPrinter",["$q","$window",function(e,n){return{isAvailable:function(){var t=e.defer();return n.plugin.printer.isAvailable(function(e){t.resolve(e)}),t.promise},print:function(t,o){var r=e.defer();return n.plugin.printer.print(t,o,function(){r.resolve()}),r.promise}}}]),angular.module("ngCordova.plugins.progressIndicator",[]).factory("$cordovaProgress",["$q",function(){return{show:function(e){var n=e||"Please wait...";return ProgressIndicator.show(n)},showSimple:function(e){var n=e||!1;return ProgressIndicator.showSimple(n)},showSimpleWithLabel:function(e,n){var t=e||!1,o=n||"Loading...";return ProgressIndicator.showSimpleWithLabel(t,o)},showSimpleWithLabelDetail:function(e,n,t){var o=e||!1,r=n||"Loading...",i=t||"Please wait";return ProgressIndicator.showSimpleWithLabelDetail(o,r,i)},showDeterminate:function(e,n){var t=e||!1,o=n||5e4;return ProgressIndicator.showDeterminate(t,o)},showDeterminateWithLabel:function(e,n,t){var o=e||!1,r=n||5e4,i=t||"Loading...";return ProgressIndicator.showDeterminateWithLabel(o,r,i)},showAnnular:function(e,n){var t=e||!1,o=n||5e4;return ProgressIndicator.showAnnular(t,o)},showAnnularWithLabel:function(e,n,t){var o=e||!1,r=n||5e4,i=t||"Loading...";return ProgressIndicator.showAnnularWithLabel(o,r,i)},showBar:function(e,n){var t=e||!1,o=n||5e4;return ProgressIndicator.showBar(t,o)},showBarWithLabel:function(e,n,t){var o=e||!1,r=n||5e4,i=t||"Loading...";return ProgressIndicator.showBarWithLabel(o,r,i)},showSuccess:function(e,n){var t=e||!1,o=n||"Success";return ProgressIndicator.showSuccess(t,o)},showText:function(e,n,t){var o=e||!1,r=n||"Warning",i=t||"center";return ProgressIndicator.showText(o,r,i)},hide:function(){return ProgressIndicator.hide()}}}]),angular.module("ngCordova.plugins.push",[]).factory("$cordovaPush",["$q","$window","$rootScope","$timeout",function(e,n,t,o){return{onNotification:function(e){o(function(){t.$broadcast("$cordovaPush:notificationReceived",e)})},register:function(t){var o,r=e.defer();return void 0!==t&&void 0===t.ecb&&(o=null===document.querySelector("[ng-app]")?"document.body":"document.querySelector('[ng-app]')",t.ecb="angular.element("+o+").injector().get('$cordovaPush').onNotification"),n.plugins.pushNotification.register(function(e){r.resolve(e)},function(e){r.reject(e)},t),r.promise},unregister:function(t){var o=e.defer();return n.plugins.pushNotification.unregister(function(e){o.resolve(e)},function(e){o.reject(e)},t),o.promise},setBadgeNumber:function(t){var o=e.defer();return n.plugins.pushNotification.setApplicationIconBadgeNumber(function(e){o.resolve(e)},function(e){o.reject(e)},t),o.promise}}}]),angular.module("ngCordova.plugins.sms",[]).factory("$cordovaSms",["$q",function(e){return{send:function(n,t,o){var r=e.defer();return sms.send(n,t,o,function(e){r.resolve(e)},function(e){r.reject(e)}),r.promise}}}]),angular.module("ngCordova.plugins.socialSharing",[]).factory("$cordovaSocialSharing",["$q","$window",function(e,n){return{share:function(t,o,r,i){var a=e.defer();return o=o||null,r=r||null,i=i||null,n.plugins.socialsharing.share(t,o,r,i,function(){a.resolve(!0)},function(){a.reject(!1)}),a.promise},shareViaTwitter:function(t,o,r){var i=e.defer();return o=o||null,r=r||null,n.plugins.socialsharing.shareViaTwitter(t,o,r,function(){i.resolve(!0)},function(){i.reject(!1)}),i.promise},shareViaWhatsApp:function(t,o,r){var i=e.defer();return o=o||null,r=r||null,n.plugins.socialsharing.shareViaWhatsApp(t,o,r,function(){i.resolve(!0)},function(){i.reject(!1)}),i.promise},shareViaFacebook:function(t,o,r){var i=e.defer();return t=t||null,o=o||null,r=r||null,n.plugins.socialsharing.shareViaFacebook(t,o,r,function(){i.resolve(!0)},function(){i.reject(!1)}),i.promise},shareViaFacebookWithPasteMessageHint:function(t,o,r,i){var a=e.defer();return o=o||null,r=r||null,n.plugins.socialsharing.shareViaFacebookWithPasteMessageHint(t,o,r,i,function(){a.resolve(!0)},function(){a.reject(!1)}),a.promise},shareViaSMS:function(t,o){var r=e.defer();return n.plugins.socialsharing.shareViaSMS(t,o,function(){r.resolve(!0)},function(){r.reject(!1)}),r.promise},shareViaEmail:function(t,o,r,i,a,c){var u=e.defer();return r=r||null,i=i||null,a=a||null,c=c||null,n.plugins.socialsharing.shareViaEmail(t,o,r,i,a,c,function(){u.resolve(!0)},function(){u.reject(!1)}),u.promise},shareVia:function(t,o,r,i,a){var c=e.defer();return o=o||null,r=r||null,i=i||null,a=a||null,n.plugins.socialsharing.shareVia(t,o,r,i,a,function(){c.resolve(!0)},function(){c.reject(!1)}),c.promise},canShareViaEmail:function(){var t=e.defer();return n.plugins.socialsharing.canShareViaEmail(function(){t.resolve(!0)},function(){t.reject(!1)}),t.promise},canShareVia:function(t,o,r,i,a){var c=e.defer();return n.plugins.socialsharing.canShareVia(t,o,r,i,a,function(e){c.resolve(e)},function(e){c.reject(e)}),c.promise},available:function(){var n=e.defer();window.plugins.socialsharing.available(function(e){e?n.resolve():n.reject()})}}}]),angular.module("ngCordova.plugins.spinnerDialog",[]).factory("$cordovaSpinnerDialog",["$window",function(e){return{show:function(n,t,o){return o=o||!1,e.plugins.spinnerDialog.show(n,t,o)},hide:function(){return e.plugins.spinnerDialog.hide()}}}]),angular.module("ngCordova.plugins.splashscreen",[]).factory("$cordovaSplashscreen",[function(){return{hide:function(){return navigator.splashscreen.hide()},show:function(){return navigator.splashscreen.show()}}}]),angular.module("ngCordova.plugins.sqlite",[]).factory("$cordovaSQLite",["$q","$window",function(e,n){return{openDB:function(e,t){return"undefined"==typeof t&&(t=0),n.sqlitePlugin.openDatabase({name:e,bgType:t})},execute:function(n,t,o){var r=e.defer();return n.transaction(function(e){e.executeSql(t,o,function(e,n){r.resolve(n)},function(e,n){r.reject(n)})}),r.promise},insertCollection:function(n,t,o){var r=e.defer(),i=o.slice(0);return n.transaction(function(e){!function n(){var o=i.splice(0,1)[0];try{e.executeSql(t,o,function(e,t){0===i.length?r.resolve(t):n()},function(e,n){r.reject(n)})}catch(a){r.reject(a)}}()}),r.promise},nestedExecute:function(n,t,o,r,i){var a=e.defer();return n.transaction(function(e){e.executeSql(t,r,function(e,n){a.resolve(n),e.executeSql(o,i,function(e,n){a.resolve(n)})})},function(e,n){a.reject(n)}),a.promise},deleteDB:function(t){var o=e.defer();return n.sqlitePlugin.deleteDatabase(t,function(e){o.resolve(e)},function(e){o.reject(e)}),o.promise}}}]),angular.module("ngCordova.plugins.statusbar",[]).factory("$cordovaStatusbar",[function(){return{overlaysWebView:function(e){return StatusBar.overlaysWebView(!!e)},STYLES:{DEFAULT:0,LIGHT_CONTENT:1,BLACK_TRANSLUCENT:2,BLACK_OPAQUE:3},style:function(e){switch(e){case 0:return StatusBar.styleDefault();case 1:return StatusBar.styleLightContent();case 2:return StatusBar.styleBlackTranslucent();case 3:return StatusBar.styleBlackOpaque();default:return StatusBar.styleDefault()}},styleColor:function(e){return StatusBar.backgroundColorByName(e)},styleHex:function(e){return StatusBar.backgroundColorByHexString(e)},hide:function(){return StatusBar.hide()},show:function(){return StatusBar.show()},isVisible:function(){return StatusBar.isVisible}}}]),angular.module("ngCordova.plugins.toast",[]).factory("$cordovaToast",["$q","$window",function(e,n){return{showShortTop:function(t){var o=e.defer();return n.plugins.toast.showShortTop(t,function(e){o.resolve(e)},function(e){o.reject(e)}),o.promise},showShortCenter:function(t){var o=e.defer();return n.plugins.toast.showShortCenter(t,function(e){o.resolve(e) +},function(e){o.reject(e)}),o.promise},showShortBottom:function(t){var o=e.defer();return n.plugins.toast.showShortBottom(t,function(e){o.resolve(e)},function(e){o.reject(e)}),o.promise},showLongTop:function(t){var o=e.defer();return n.plugins.toast.showLongTop(t,function(e){o.resolve(e)},function(e){o.reject(e)}),o.promise},showLongCenter:function(t){var o=e.defer();return n.plugins.toast.showLongCenter(t,function(e){o.resolve(e)},function(e){o.reject(e)}),o.promise},showLongBottom:function(t){var o=e.defer();return n.plugins.toast.showLongBottom(t,function(e){o.resolve(e)},function(e){o.reject(e)}),o.promise},show:function(t,o,r){var i=e.defer();return n.plugins.toast.show(t,o,r,function(e){i.resolve(e)},function(e){i.reject(e)}),i.promise}}}]),angular.module("ngCordova.plugins.touchid",[]).factory("$cordovaTouchID",["$q",function(e){return{checkSupport:function(){var n=e.defer();return window.cordova?touchid.checkSupport(function(e){n.resolve(e)},function(e){n.reject(e)}):n.reject("Not supported without cordova.js"),n.promise},authenticate:function(n){var t=e.defer();return window.cordova?touchid.authenticate(function(e){t.resolve(e)},function(e){t.reject(e)},n):t.reject("Not supported without cordova.js"),t.promise}}}]),angular.module("ngCordova.plugins.vibration",[]).factory("$cordovaVibration",[function(){return{vibrate:function(e){return navigator.notification.vibrate(e)},vibrateWithPattern:function(e,n){return navigator.notification.vibrateWithPattern(e,n)},cancelVibration:function(){return navigator.notification.cancelVibration()}}}]),angular.module("ngCordova.plugins.videoCapturePlus",[]).provider("$cordovaVideoCapturePlus",[function(){var e={};this.setLimit=function(n){e.limit=n},this.setMaxDuration=function(n){e.duration=n},this.setHighQuality=function(n){e.highquality=n},this.useFrontCamera=function(n){e.frontcamera=n},this.setPortraitOverlay=function(n){e.portraitOverlay=n},this.setLandscapeOverlay=function(n){e.landscapeOverlay=n},this.setOverlayText=function(n){e.overlayText=n},this.$get=["$q","$window",function(n,t){return{captureVideo:function(o){var r=n.defer();return t.plugins.videocaptureplus?(t.plugins.videocaptureplus.captureVideo(r.resolve,r.reject,angular.extend({},e,o)),r.promise):(r.resolve(null),r.promise)}}}]}]),angular.module("ngCordova.plugins.zip",[]).factory("$cordovaZip",["$q","$window",function(e,n){return{unzip:function(t,o){var r=e.defer();return n.zip.unzip(t,o,function(e){0===e?r.resolve():r.reject()},function(e){r.notify(e)}),r.promise}}}])}(); -- cgit v1.2.3